Commenting is nice (also disabled debug in FDD driver)
[tpg/acess2.git] / Kernel / arch / x86 / proc.asm
index 9d752bf..1cf1f96 100644 (file)
@@ -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:

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