Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc Enable reset of a process's alternative signa...



details:   https://anonhg.NetBSD.org/src/rev/3132805f129e
branches:  trunk
changeset: 557013:3132805f129e
user:      pk <pk%NetBSD.org@localhost>
date:      Thu Jan 01 15:02:31 2004 +0000

description:
Enable reset of a process's alternative signal stack flag.

diffstat:

 sys/arch/sparc/include/mcontext.h |   5 ++++-
 sys/arch/sparc/sparc/machdep.c    |  18 ++++++++++++------
 2 files changed, 16 insertions(+), 7 deletions(-)

diffs (79 lines):

diff -r 95373d2f97f2 -r 3132805f129e sys/arch/sparc/include/mcontext.h
--- a/sys/arch/sparc/include/mcontext.h Thu Jan 01 14:34:24 2004 +0000
+++ b/sys/arch/sparc/include/mcontext.h Thu Jan 01 15:02:31 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.4 2003/10/12 16:01:35 pk Exp $  */
+/*     $NetBSD: mcontext.h,v 1.5 2004/01/01 15:02:31 pk Exp $  */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -39,6 +39,9 @@
 #ifndef _SPARC_MCONTEXT_H_
 #define _SPARC_MCONTEXT_H_
 
+#define _UC_SETSTACK   0x00010000
+#define _UC_CLRSTACK   0x00020000
+
 /*
  * Layout of mcontext_t according the System V Application Binary Interface,
  * Edition 4.1, SPARC Processor ABI Supplement and updated for SPARC v9.
diff -r 95373d2f97f2 -r 3132805f129e sys/arch/sparc/sparc/machdep.c
--- a/sys/arch/sparc/sparc/machdep.c    Thu Jan 01 14:34:24 2004 +0000
+++ b/sys/arch/sparc/sparc/machdep.c    Thu Jan 01 15:02:31 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.243 2003/12/30 14:29:30 pk Exp $ */
+/*     $NetBSD: machdep.c,v 1.244 2004/01/01 15:02:32 pk Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.243 2003/12/30 14:29:30 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.244 2004/01/01 15:02:32 pk Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_sunos.h"
@@ -609,14 +609,15 @@
        int sig;
        size_t ucsz;
 
+       sig = ksi->ksi_signo;
+
 #ifdef COMPAT_16
-       if (p->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2) {
+       if (ps->sa_sigdesc[sig].sd_vers < 2) {
                sendsig_sigcontext(ksi, mask);
                return;
        }
 #endif /* COMPAT_16 */
 
-       sig = ksi->ksi_signo;
        tf = l->l_md.md_tf;
        oldsp = tf->tf_out[6];
 
@@ -646,9 +647,9 @@
        /*
         * Build the signal context to be used by sigreturn.
         */
-       uc.uc_flags = _UC_SIGMASK /*|
+       uc.uc_flags = _UC_SIGMASK |
                ((p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK)
-                       ? _UC_SETSTACK : _UC_CLRSTACK)*/;
+                       ? _UC_SETSTACK : _UC_CLRSTACK);
        uc.uc_sigmask = *mask;
        uc.uc_link = NULL;
        memset(&uc.uc_stack, 0, sizeof(uc.uc_stack));
@@ -992,6 +993,11 @@
        }
 #endif
 
+       if (flags & _UC_SETSTACK)  
+               l->l_proc->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
+       if (flags & _UC_CLRSTACK)
+               l->l_proc->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; 
+
        return (0);
 }
 



Home | Main Index | Thread Index | Old Index