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:
nwhitehorn 2013-09-05 23:00:24 +00:00
parent 3186588c66
commit 4a4705a68f
2 changed files with 2 additions and 0 deletions

View File

@ -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];

View File

@ -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 {