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/armv7 - Debugging, fixed TLB issues with a HACK!
[tpg/acess2.git]
/
Kernel
/
arch
/
x86
/
proc.asm
diff --git
a/Kernel/arch/x86/proc.asm
b/Kernel/arch/x86/proc.asm
index
4e7d160
..
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
@@
-162,8
+165,7
@@
SetAPICTimerCount:
pop es
pop ds
popa
pop es
pop ds
popa
- add esp, 4 ; CPU ID
- ; No Error code / int num
+ add esp, 8 ; CPU ID / Error Code
iret
%endif
; --------------
iret
%endif
; --------------
@@
-376,3
+378,5
@@
User_Syscall_Exit:
xor eax, eax
mov ebx, [esp+4]
int 0xAC
xor eax, eax
mov ebx, [esp+4]
int 0xAC
+
+; vim: ft=nasm ts=8
UCC
git Repository :: git.ucc.asn.au