Date: Thu, 5 Sep 2013 23:00:24 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255273 - in head/sys/powerpc: aim include Message-ID: <201309052300.r85N0OLX076496@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Thu Sep 5 23:00:24 2013 New Revision: 255273 URL: http://svnweb.freebsd.org/changeset/base/255273 Log: 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 Modified: head/sys/powerpc/aim/vm_machdep.c head/sys/powerpc/include/frame.h Modified: head/sys/powerpc/aim/vm_machdep.c ============================================================================== --- head/sys/powerpc/aim/vm_machdep.c Thu Sep 5 22:59:18 2013 (r255272) +++ head/sys/powerpc/aim/vm_machdep.c Thu Sep 5 23:00:24 2013 (r255273) @@ -187,6 +187,7 @@ cpu_fork(struct thread *td1, struct proc 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]; Modified: head/sys/powerpc/include/frame.h ============================================================================== --- head/sys/powerpc/include/frame.h Thu Sep 5 22:59:18 2013 (r255272) +++ head/sys/powerpc/include/frame.h Thu Sep 5 23:00:24 2013 (r255273) @@ -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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309052300.r85N0OLX076496>