From c040a99e085bfeaac5146ed68a44d8c1e2ce9936 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Sun, 18 Nov 2012 13:39:11 +0800 Subject: [PATCH] Kernel/x86_64 - Debugging --- KernelLand/Kernel/arch/x86_64/proc.asm | 2 +- KernelLand/Kernel/arch/x86_64/proc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/KernelLand/Kernel/arch/x86_64/proc.asm b/KernelLand/Kernel/arch/x86_64/proc.asm index f540b3b6..f44d65b0 100644 --- a/KernelLand/Kernel/arch/x86_64/proc.asm +++ b/KernelLand/Kernel/arch/x86_64/proc.asm @@ -21,7 +21,7 @@ NewTaskHeader: 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 diff --git a/KernelLand/Kernel/arch/x86_64/proc.c b/KernelLand/Kernel/arch/x86_64/proc.c index 48504a8b..884babb3 100644 --- a/KernelLand/Kernel/arch/x86_64/proc.c +++ b/KernelLand/Kernel/arch/x86_64/proc.c @@ -758,7 +758,7 @@ void Proc_Reschedule(void) // Update CPU state gaCPUs[cpu].Current = nextthread; - gTSSs[cpu].RSP0 = nextthread->KernelStack-4; + gTSSs[cpu].RSP0 = nextthread->KernelStack-sizeof(void*); __asm__ __volatile__ ("mov %0, %%db0" : : "r" (nextthread)); if( curthread ) -- 2.20.1