git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/x86 - Debugging SMP bugs, lead to some fixes and cleanups
[tpg/acess2.git]
/
Kernel
/
arch
/
x86
/
proc.asm
diff --git
a/Kernel/arch/x86/proc.asm
b/Kernel/arch/x86/proc.asm
index
74a25d4
..
014cfed
100644
(file)
--- a/
Kernel/arch/x86/proc.asm
+++ b/
Kernel/arch/x86/proc.asm
@@
-55,11
+55,14
@@
SwitchTasks:
; Old IP
mov eax, [esp+0x20+16]
; Old IP
mov eax, [esp+0x20+16]
+ test eax, eax
+ jz .nosave
mov DWORD [eax], .restore
; Old SP
mov eax, [esp+0x20+8]
mov [eax], esp
mov DWORD [eax], .restore
; Old SP
mov eax, [esp+0x20+8]
mov [eax], esp
+.nosave:
mov ecx, [esp+0x20+12] ; New IP
mov eax, [esp+0x20+20] ; New CR3
mov esp, [esp+0x20+ 4] ; New SP
mov ecx, [esp+0x20+12] ; New IP
mov eax, [esp+0x20+20] ; New CR3
mov esp, [esp+0x20+ 4] ; New SP
@@
-376,4
+379,4
@@
User_Syscall_Exit:
mov ebx, [esp+4]
int 0xAC
mov ebx, [esp+4]
int 0xAC
-; vim: ft=nasm
,
ts=8
+; vim: ft=nasm ts=8
UCC
git Repository :: git.ucc.asn.au