Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/powerpc/powerpc/compat_16_machdep.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/powerpc/powerpc/compat_16_machdep.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.6 retrieving revision 1.6.20.2 diff -u -p -r1.6 -r1.6.20.2 --- src/sys/arch/powerpc/powerpc/compat_16_machdep.c 2005/12/11 12:18:46 1.6 +++ src/sys/arch/powerpc/powerpc/compat_16_machdep.c 2007/01/30 13:49:37 1.6.20.2 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_16_machdep.c,v 1.6 2005/12/11 12:18:46 christos Exp $ */ +/* $NetBSD: compat_16_machdep.c,v 1.6.20.2 2007/01/30 13:49:37 ad Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.6 2005/12/11 12:18:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.6.20.2 2007/01/30 13:49:37 ad Exp $"); #include "opt_compat_netbsd.h" #include "opt_altivec.h" @@ -41,8 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: compat_16_ma #include #include #include -#include -#include #include #include #include @@ -65,20 +63,20 @@ sendsig_sigcontext(int sig, const sigset struct sigcontext *fp, frame; struct trapframe *tf; struct utrapframe *utf = &frame.sc_frame; - int onstack; + int onstack, error; sig_t catcher = SIGACTION(p, sig).sa_handler; tf = trapframe(l); /* Do we need to jump onto the signal stack? */ onstack = - (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && + (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0; /* Allocate space for the signal handler context. */ if (onstack) - fp = (struct sigcontext *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp + - p->p_sigctx.ps_sigstk.ss_size); + fp = (struct sigcontext *)((caddr_t)l->l_sigstk.ss_sp + + l->l_sigstk.ss_size); else fp = (struct sigcontext *)tf->fixreg[1]; fp = (struct sigcontext *)((uintptr_t)(fp - 1) & ~0xf); @@ -103,7 +101,7 @@ sendsig_sigcontext(int sig, const sigset #endif /* Save signal stack. */ - frame.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK; + frame.sc_onstack = l->l_sigstk.ss_flags & SS_ONSTACK; /* Save signal mask. */ frame.sc_mask = *mask; @@ -117,8 +115,12 @@ sendsig_sigcontext(int sig, const sigset */ native_sigset_to_sigset13(mask, &frame.__sc_mask13); #endif + sendsig_reset(l, sig); + mutex_exit(&p->p_smutex); + error = copyout(&frame, fp, sizeof frame); + mutex_enter(&p->p_smutex); - if (copyout(&frame, fp, sizeof frame) != 0) { + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instructoin to halt it in its tracks. @@ -159,7 +161,7 @@ sendsig_sigcontext(int sig, const sigset /* Remember that we're now on the signal stack. */ if (onstack) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; } /* @@ -211,14 +213,15 @@ compat_16_sys___sigreturn14(struct lwp * tf->tf_xtra[TF_MQ] = utf->mq; #endif + mutex_enter(&p->p_smutex); /* Restore signal stack. */ if (sc.sc_onstack & SS_ONSTACK) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; - + l->l_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ - (void) sigprocmask1(p, SIG_SETMASK, &sc.sc_mask, 0); + (void) sigprocmask1(l, SIG_SETMASK, &sc.sc_mask, 0); + mutex_exit(&p->p_smutex); return (EJUSTRETURN); }