X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fproc.asm;h=5a9ad0aa8acefdc72def6291f772054b461708bd;hb=5e9042e320d0a24d1691bcd6845936879238e812;hp=1011b53c7624cfe8bde0ec218cebe2f429cd6035;hpb=0b6ee7828bf78fd5f8f8df7afcbe16362a9f9437;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/proc.asm b/Kernel/arch/x86/proc.asm index 1011b53c..5a9ad0aa 100644 --- a/Kernel/arch/x86/proc.asm +++ b/Kernel/arch/x86/proc.asm @@ -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]