Fix kernel thread frame pointer base case.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-05-20 19:59:53 +02:00
parent 5ad26d68a3
commit a685a9d68f
2 changed files with 4 additions and 2 deletions

View File

@ -89,7 +89,8 @@ namespace Sortix
// the entry function returns. Note that since we use a register based
// calling convention, we call BootstrapKernelThread directly.
regs->rip = (addr_t) BootstrapKernelThread;
regs->userrsp = stack + stacksize;
regs->userrsp = stack + stacksize - sizeof(size_t);
*((size_t*) regs->userrsp) = 0; /* back tracing stops at NULL rip */
regs->rax = 0;
regs->rbx = 0;
regs->rcx = 0;

View File

@ -76,7 +76,8 @@ namespace Sortix
// calling convention, we go through a proxy that uses %edi and %esi
// as parameters and pushes them to the stack and then does the call.
regs->eip = (addr_t) asm_call_BootstrapKernelThread;
regs->useresp = stack + stacksize;
regs->useresp = stack + stacksize - sizeof(size_t);
*((size_t*) regs->useresp) = 0; /* back tracing stops at NULL rip */
regs->eax = 0;
regs->ebx = 0;
regs->ecx = 0;