Align signal stack pointer to 16 bytes.

The stack must be aligned to 16 bytes at all times.  Clang 3.8 is especially
adamant about this, and causes strange behavior and segmentation faults if it is
not the case.

PR:		kern/206810
This commit is contained in:
Justin Hibbits 2016-02-03 01:50:27 +00:00
parent 4be4b11f30
commit a4d64816be
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295186
2 changed files with 5 additions and 5 deletions

View File

@ -219,10 +219,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
*/
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
usfp = (void *)((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size - rndfsize);
usfp = (void *)(((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size - rndfsize) & ~0xFul);
} else {
usfp = (void *)(tf->fixreg[1] - rndfsize);
usfp = (void *)((tf->fixreg[1] - rndfsize) & ~0xFul);
}
/*

View File

@ -45,9 +45,9 @@
*/
.globl CNAME(sigcode32),CNAME(szsigcode32)
CNAME(sigcode32):
addi 1,1,-20 /* reserved space for callee */
addi 1,1,-32 /* reserved space for callee */
blrl
addi 3,1,20+SF_UC /* restore sp, and get &frame->sf_uc */
addi 3,1,32+SF_UC /* restore sp, and get &frame->sf_uc */
li 0,SYS_sigreturn
sc /* sigreturn(scp) */
li 0,SYS_exit