Restore RSP0 properly on syscall exit
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@
|
||||
extern void syscall_entry(void);
|
||||
|
||||
void sys_debug_trace(const char *msg) {
|
||||
kinfo("Trace message: %s\n", msg);
|
||||
//kinfo("Trace message: %s\n", msg);
|
||||
}
|
||||
|
||||
void sys_debug_sleep(uint64_t ms) {
|
||||
|
||||
@@ -15,7 +15,6 @@ syscall_entry:
|
||||
cmpq $57, %rax
|
||||
jz _syscall_fork
|
||||
|
||||
pushq %rsp
|
||||
pushq %rcx
|
||||
pushq %r11
|
||||
movq get_cpu(CPU_SYSCALL_RSP), %rcx
|
||||
@@ -39,11 +38,9 @@ syscall_entry:
|
||||
popq %rdi
|
||||
popq %r11
|
||||
popq %rcx
|
||||
popq %rdx
|
||||
|
||||
//movq get_cpu(CPU_TSS), %rsi
|
||||
//addq $64, %rdx
|
||||
//movq %rdx, TSS_RSP0(%rsi)
|
||||
movq get_cpu(CPU_THREAD), %rsi
|
||||
movq %rsp, THREAD_RSP0(%rsi)
|
||||
|
||||
movq %rdi, %rsp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user