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_64 - Fix task switching
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
arch
/
x86_64
/
proc.asm
diff --git
a/KernelLand/Kernel/arch/x86_64/proc.asm
b/KernelLand/Kernel/arch/x86_64/proc.asm
index
f540b3b
..
afde354
100644
(file)
--- a/
KernelLand/Kernel/arch/x86_64/proc.asm
+++ b/
KernelLand/Kernel/arch/x86_64/proc.asm
@@
-6,6
+6,8
@@
[section .text]
[extern Threads_Exit]
[section .text]
[extern Threads_Exit]
+[extern glThreadListLock]
+[extern SHORTREL]
[global GetRIP]
GetRIP:
[global GetRIP]
GetRIP:
@@
-18,10
+20,13
@@
NewTaskHeader:
; [rsp+0x08]: Function
; [rsp+0x10]: Argument
; [rsp+0x08]: Function
; [rsp+0x10]: Argument
+ mov rdi, glThreadListLock
+ call SHORTREL
+
mov rdi, [rsp+0x10]
mov rax, [rsp+0x8]
add rsp, 0x10 ; Reclaim stack space (thread/fcn)
mov rdi, [rsp+0x10]
mov rax, [rsp+0x8]
add rsp, 0x10 ; Reclaim stack space (thread/fcn)
- xchg bx, bx
+
;
xchg bx, bx
call rax
; Quit thread with RAX as the return code
call rax
; Quit thread with RAX as the return code
@@
-39,6
+44,8
@@
Proc_CloneInt:
PUSH_GPR
; Save RSP
mov [rdi], rsp
PUSH_GPR
; Save RSP
mov [rdi], rsp
+ ; Call MM_Clone (with bNoUserCopy flag)
+ mov rdi, rdx
call MM_Clone
; Save CR3
mov rsi, [rsp+0x30] ; Saved version of RSI
call MM_Clone
; Save CR3
mov rsi, [rsp+0x30] ; Saved version of RSI
@@
-145,4
+152,15
@@
Proc_RestoreSSE:
fxrstor [rdi]
ret
fxrstor [rdi]
ret
+[section .usertext]
+
+[global User_Signal_Kill]
+User_Signal_Kill:
+ xor rax, rax
+ mov bx, di
+ mov bh, 0x02
+ int 0xAC
+ jmp $
+
+
; vim: ft=nasm
; vim: ft=nasm
UCC
git Repository :: git.ucc.asn.au