summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-03-29 16:38:15 +0000
committerdeischen <deischen@FreeBSD.org>2003-03-29 16:38:15 +0000
commit86761e7dd6cf3456bb1aae5858988badf423a7f1 (patch)
treebe90800fdebe1c1f5dc9bbc462cc3492b4350fad /lib/libc
parentfb5092cdc48b50191bca10376c2889796cc39792 (diff)
downloadFreeBSD-src-86761e7dd6cf3456bb1aae5858988badf423a7f1.zip
FreeBSD-src-86761e7dd6cf3456bb1aae5858988badf423a7f1.tar.gz
Align signal frame placed on stack to 16 bytes so that SSE FPU register
restores can work. Also correct allocation for signal frame size. Reviewed by: mini
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/i386/gen/signalcontext.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/i386/gen/signalcontext.c b/lib/libc/i386/gen/signalcontext.c
index a66e2db..50c4889 100644
--- a/lib/libc/i386/gen/signalcontext.c
+++ b/lib/libc/i386/gen/signalcontext.c
@@ -56,7 +56,8 @@ __signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func)
*/
p = (register_t *)(void *)(intptr_t)ucp->uc_mcontext.mc_esp;
*--p = (register_t)(intptr_t)ucp;
- p -= sizeof(struct sigframe);
+ p = (register_t *)((u_register_t)p & ~0xF); /* Align to 16 bytes. */
+ p = (register_t *)((u_register_t)p - sizeof(struct sigframe));
sfp = (struct sigframe *)p;
bzero(sfp, sizeof(struct sigframe));
sfp->sf_signum = sig;
OpenPOWER on IntegriCloud