From: John Hodge (sonata) Date: Sun, 18 Nov 2012 05:39:11 +0000 (+0800) Subject: Kernel/x86_64 - Debugging X-Git-Tag: rel0.15~656 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=c040a99e085bfeaac5146ed68a44d8c1e2ce9936;p=tpg%2Facess2.git Kernel/x86_64 - Debugging --- 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 )