Index: head/sys/powerpc/powerpc/swtch64.S =================================================================== --- head/sys/powerpc/powerpc/swtch64.S +++ head/sys/powerpc/powerpc/swtch64.S @@ -160,6 +160,7 @@ ld %r17,TD_PCB(%r13) /* Get new PCB */ ld %r1,PCB_SP(%r17) /* Load the stack pointer */ + addi %r1,%r1,-48 /* Remember about cpu_switch stack frame */ /* Release old thread now that we have a stack pointer set up */ cmpdi %r14,0 Index: head/sys/powerpc/powerpc/vm_machdep.c =================================================================== --- head/sys/powerpc/powerpc/vm_machdep.c +++ head/sys/powerpc/powerpc/vm_machdep.c @@ -190,6 +190,9 @@ cf = (struct callframe *)td->td_pcb->pcb_sp; + #if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) + cf->cf_toc = ((register_t *)func)[1]; + #endif cf->cf_func = (register_t)func; cf->cf_arg0 = (register_t)arg; }