Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/powerpc PR port-macppc/43619



details:   https://anonhg.NetBSD.org/src/rev/835e1fed461a
branches:  trunk
changeset: 761770:835e1fed461a
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Feb 07 09:39:48 2011 +0000

description:
PR port-macppc/43619
Save handler before calling sendsig_reset before it will reset to SIG_DFL
is SA_RESETHAND is set.

diffstat:

 sys/arch/powerpc/powerpc/sig_machdep.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r eaec21af7f51 -r 835e1fed461a sys/arch/powerpc/powerpc/sig_machdep.c
--- a/sys/arch/powerpc/powerpc/sig_machdep.c    Mon Feb 07 09:09:47 2011 +0000
+++ b/sys/arch/powerpc/powerpc/sig_machdep.c    Mon Feb 07 09:39:48 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sig_machdep.c,v 1.38 2011/01/18 01:02:55 matt Exp $    */
+/*     $NetBSD: sig_machdep.c,v 1.39 2011/02/07 09:39:48 matt Exp $    */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.38 2011/01/18 01:02:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.39 2011/02/07 09:39:48 matt Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_altivec.h"
@@ -58,10 +58,12 @@
 {
        struct lwp * const l = curlwp;
        struct proc * const p = l->l_proc;
-       struct trapframe * const tf = trapframe(l);
-       struct sigaltstack *ss = &l->l_sigstk;
-       const struct sigact_sigdesc *sd =
+       struct trapframe * const tf = l->l_md.md_utf;
+       struct sigaltstack * const ss = &l->l_sigstk;
+       const struct sigact_sigdesc * const sd =
            &p->p_sigacts->sa_sigdesc[ksi->ksi_signo];
+       /* save handler before sendsig_reset trashes it! */
+       const void * const handler = sd->sd_sigact.sa_handler;
        ucontext_t uc;
        vaddr_t sp, sip, ucp;
        int onstack, error;
@@ -122,7 +124,7 @@
                /* Preserve ucp across call to signal function */
                tf->tf_fixreg[30] = (register_t)ucp;
                tf->tf_lr         = (register_t)sd->sd_tramp;
-               tf->tf_srr0       = (register_t)sd->sd_sigact.sa_handler;
+               tf->tf_srr0       = (register_t)handler;
                break;
 
        default:



Home | Main Index | Thread Index | Old Index