Fix kernel thread frame pointer base case.
This commit is contained in:
parent
5ad26d68a3
commit
a685a9d68f
|
@ -89,7 +89,8 @@ namespace Sortix
|
||||||
// the entry function returns. Note that since we use a register based
|
// the entry function returns. Note that since we use a register based
|
||||||
// calling convention, we call BootstrapKernelThread directly.
|
// calling convention, we call BootstrapKernelThread directly.
|
||||||
regs->rip = (addr_t) BootstrapKernelThread;
|
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->rax = 0;
|
||||||
regs->rbx = 0;
|
regs->rbx = 0;
|
||||||
regs->rcx = 0;
|
regs->rcx = 0;
|
||||||
|
|
|
@ -76,7 +76,8 @@ namespace Sortix
|
||||||
// calling convention, we go through a proxy that uses %edi and %esi
|
// 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.
|
// as parameters and pushes them to the stack and then does the call.
|
||||||
regs->eip = (addr_t) asm_call_BootstrapKernelThread;
|
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->eax = 0;
|
||||||
regs->ebx = 0;
|
regs->ebx = 0;
|
||||||
regs->ecx = 0;
|
regs->ecx = 0;
|
||||||
|
|
Loading…
Reference in New Issue