Adding support for the Local APIC Timer (requires some hacks)
[tpg/acess2.git] / Kernel / arch / x86 / desctab.asm
index 43bd8e4..1513984 100644 (file)
@@ -21,8 +21,8 @@ gGDT:
        dd 0x0000FFFF, 0x00CF9200       ; 10 PL0 Data
        dd 0x0000FFFF, 0x00CFFA00       ; 18 PL3 Code
        dd 0x0000FFFF, 0x00CFF200       ; 20 PL3 Data
-       dd 26*4-1, 0x00408900   ; Double Fault TSS
-       times MAX_CPUS  dd 26*4-1, 0x00408900
+       dd 26*4-1, 0x00408900   ; 28 Double Fault TSS
+       times MAX_CPUS  dd 26*4-1, 0x00408900   ; 30+ TSSes
 [global gGDTPtr]
 gGDTPtr:
        dw      GDT_SIZE-1
@@ -76,6 +76,10 @@ Desctab_Install:
        SETISR  0xAC
        SETUSER 0xAC
        
+       %if USE_MP
+       SETISR  239
+       %endif
+       
        %assign i       0xF0
        %rep 16
        SETISR  i
@@ -187,12 +191,27 @@ ISR_NOERR 31; 31: Reserved
 
 DEF_SYSCALL    0xAC    ; Acess System Call
 
+; AP's Timer Interrupt
+%if USE_MP
+[global Isr239]
+[extern SchedulerBase]
+Isr239:
+       push 0
+       jmp SchedulerBase
+%endif
+
 ; IRQs
 ; - Timer
 [global Isr240]
+[extern SchedulerBase]
+[extern SetAPICTimerCount]
 Isr240:
        push 0
+       %if USE_MP
+       jmp SetAPICTimerCount
+       %else
        jmp SchedulerBase
+       %endif
 ; - Assignable
 %assign i      0xF1
 %rep 16
@@ -257,6 +276,7 @@ SyscallCommon:
 ; IRQ Handling
 ; ------------
 [extern IRQ_Handler]
+[global IRQCommon]
 IRQCommon:
        pusha
        push ds
@@ -281,40 +301,3 @@ IRQCommon:
        popa
        add esp, 8      ; Error Code and ID
        iret
-
-; --------------
-; Task Scheduler
-; --------------
-[extern Proc_Scheduler]
-SchedulerBase:
-       pusha
-       push ds
-       push es
-       push fs
-       push gs
-       
-       mov ax, 0x10
-       mov ds, ax
-       mov es, ax
-       mov fs, ax
-       mov gs, ax
-       
-       mov eax, [esp+12*4]     ; CPU Number
-       push eax        ; Pus as argument
-       
-       call Proc_Scheduler
-       
-       add esp, 4      ; Remove Argument
-       
-       pop gs
-       pop fs
-       pop es
-       pop ds
-
-       mov dx, 0x20
-       mov al, 0x20
-       out dx, al              ; ACK IRQ
-       popa
-       add esp, 4      ; CPU ID
-       ; No Error code / int num
-       iret

UCC git Repository :: git.ucc.asn.au