Align stacks of kernel threads correctly at 16-byte boundaries rather than
making sure they are all misaligned at +8 bytes. This fixes clang builds of powerpc64 kernels (aside from a required increase in KSTACK_PAGES which will come later). This commit from FreeBSD/powerpc64 with a clang-built kernel. MFC after: 2 weeks
This commit is contained in:
parent
3186588c66
commit
4a4705a68f
@ -187,6 +187,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
|
||||
cf->cf_arg1 = (register_t)tf;
|
||||
|
||||
pcb->pcb_sp = (register_t)cf;
|
||||
KASSERT(pcb->pcb_sp % 16 == 0, ("stack misaligned"));
|
||||
#ifdef __powerpc64__
|
||||
pcb->pcb_lr = ((register_t *)fork_trampoline)[0];
|
||||
pcb->pcb_toc = ((register_t *)fork_trampoline)[1];
|
||||
|
@ -94,6 +94,7 @@ struct callframe {
|
||||
register_t cf_func;
|
||||
register_t cf_arg0;
|
||||
register_t cf_arg1;
|
||||
register_t _padding; /* Maintain 16-byte alignment */
|
||||
};
|
||||
#else
|
||||
struct callframe {
|
||||
|
Loading…
x
Reference in New Issue
Block a user