X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fproc.asm;h=1cf1f9626ca7297f70991e35a6b1596507dda6d8;hb=4b80e9762374558077e28e321d75029645529a45;hp=b1843c782c33570f0371e5bc3c6396c7d49a9c5c;hpb=b2b9acdf26d6b525f09545b0d07845fde997873b;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/proc.asm b/Kernel/arch/x86/proc.asm index b1843c78..1cf1f962 100644 --- a/Kernel/arch/x86/proc.asm +++ b/Kernel/arch/x86/proc.asm @@ -74,13 +74,12 @@ SpawnTask: ; ; Calls a user fault handler ; -[global Proc_AlterUserReturnAddr] +[global Proc_ReturnToUser] [extern Proc_GetCurThread] -Proc_AlterUserReturnAddr: +Proc_ReturnToUser: ; EBP is the handler to use call Proc_GetCurThread - xchg bx, bx ; EAX is the current thread mov ebx, eax @@ -115,6 +114,13 @@ Proc_AlterUserReturnAddr: iret +[global GetCPUNum] +GetCPUNum: + xor eax, eax + ltr ax + sub ax, 0x30 + shr ax, 3 ; ax /= 8 + ret [section .usertext] User_Syscall_RetAndExit: