From adad7147bddf127a2a315edddb87bfee5a6de7a9 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 31 Jul 2010 21:15:05 +0000 Subject: [PATCH] Ignore the PSL_VEC bit in the sigcontext and always copy the bit out from the trap frame. The Altivec unit might have been stolen away from us while we were running the signal handler, so it is ok that the two don't agree. Fixes the X server mysteriously exiting (and seemingly freeze). ok miod@, drahn@ --- sys/arch/macppc/macppc/machdep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index c1f9904562c..185d983d2fd 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.119 2010/06/27 13:28:46 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.120 2010/07/31 21:15:05 kettenis Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -637,6 +637,8 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) if ((error = copyin(SCARG(uap, sigcntxp), &sc, sizeof sc))) return error; tf = trapframe(p); + sc.sc_frame.srr1 &= ~PSL_VEC; + sc.sc_frame.srr1 |= (tf->srr1 & PSL_VEC); if ((sc.sc_frame.srr1 & PSL_USERSTATIC) != (tf->srr1 & PSL_USERSTATIC)) return EINVAL; bcopy(&sc.sc_frame, tf, sizeof *tf); -- 2.20.1