Kernel/arm7 - Fiddling with PCI etc
[tpg/acess2.git] / Kernel / arch / x86 / proc.asm
index f53f11d..5a9ad0a 100644 (file)
@@ -8,6 +8,26 @@ KERNEL_BASE    equ 0xC0000000
 KSTACK_USERSTATE_SIZE  equ     (4+8+1+5)*4     ; SRegs, GPRegs, CPU, IRET
 
 [section .text]
+
+[global NewTaskHeader]
+NewTaskHeader:
+       mov eax, [esp]
+       mov dr0, eax
+       xchg bx, bx     
+
+       sti
+       ; TODO: SMP
+       mov al, 0x20
+       out 0x20, al
+       
+       mov eax, [esp+4]
+       add esp, 12     ; Thread, Function, Args
+       call eax
+       
+       push eax        ; Ret val
+       push 0          ; 0 = This Thread
+       call Threads_Exit
+
 %if USE_MP
 [extern giMP_TimerCount]
 [extern gpMP_LocalAPIC]
@@ -135,7 +155,7 @@ scheduler_return:   ; Used by some hackery in Proc_DumpThreadCPUState
 SpawnTask:
        ; Call Proc_Clone with Flags=0
        xor eax, eax
-       push eax
+;      push eax
        push eax
        call Proc_Clone
        add esp, 8      ; Remove arguments from stack

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