X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fproc.asm;h=1cf1f9626ca7297f70991e35a6b1596507dda6d8;hb=4b80e9762374558077e28e321d75029645529a45;hp=9d752bf10d908df8688627378347bafd215ed664;hpb=7a6a1cbc62289d64d604fb2cb204d21659c4905e;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/proc.asm b/Kernel/arch/x86/proc.asm index 9d752bf1..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 @@ -109,12 +108,19 @@ Proc_AlterUserReturnAddr: push 0x23 ; SS push ecx ; ESP - push 0x22 ; EFLAGS + push 0x202 ; EFLAGS (IP and Rsvd) push 0x1B ; CS push ebp ; EIP iret +[global GetCPUNum] +GetCPUNum: + xor eax, eax + ltr ax + sub ax, 0x30 + shr ax, 3 ; ax /= 8 + ret [section .usertext] User_Syscall_RetAndExit: