Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax Add SA_SIGINFO support for VAX.



details:   https://anonhg.NetBSD.org/src/rev/b85d16b1a6e7
branches:  trunk
changeset: 552663:b85d16b1a6e7
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Sep 29 21:04:53 2003 +0000

description:
Add SA_SIGINFO support for VAX.

diffstat:

 sys/arch/vax/conf/files.vax          |    3 +-
 sys/arch/vax/include/ibcs2_machdep.h |    8 +-
 sys/arch/vax/include/signal.h        |   35 +-
 sys/arch/vax/vax/genassym.cf         |    7 +-
 sys/arch/vax/vax/ibcs2_machdep.c     |   27 +-
 sys/arch/vax/vax/machdep.c           |  266 +--------------------
 sys/arch/vax/vax/sig_machdep.c       |  459 +++++++++++++++++++++++++++++++++++
 sys/arch/vax/vax/subr.S              |    6 +-
 sys/arch/vax/vax/trap.c              |   28 +-
 9 files changed, 522 insertions(+), 317 deletions(-)

diffs (truncated from 1062 to 300 lines):

diff -r a283be4c04db -r b85d16b1a6e7 sys/arch/vax/conf/files.vax
--- a/sys/arch/vax/conf/files.vax       Mon Sep 29 20:34:23 2003 +0000
+++ b/sys/arch/vax/conf/files.vax       Mon Sep 29 21:04:53 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.vax,v 1.99 2003/07/27 01:19:34 thorpej Exp $
+#      $NetBSD: files.vax,v 1.100 2003/09/29 21:04:53 matt Exp $
 #
 # new style config file for vax architecture
 #
@@ -332,6 +332,7 @@
 file   arch/vax/vax/bus_mem.c
 file   arch/vax/vax/procfs_machdep.c   procfs
 file   arch/vax/vax/sgmap.c
+file   arch/vax/vax/sig_machdep.c
 file   arch/vax/vax/vm_machdep.c
 file   arch/vax/vax/findcpu.c
 file   arch/vax/vax/autoconf.c
diff -r a283be4c04db -r b85d16b1a6e7 sys/arch/vax/include/ibcs2_machdep.h
--- a/sys/arch/vax/include/ibcs2_machdep.h      Mon Sep 29 20:34:23 2003 +0000
+++ b/sys/arch/vax/include/ibcs2_machdep.h      Mon Sep 29 21:04:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_machdep.h,v 1.6 2003/09/26 12:02:57 simonb Exp $ */
+/*     $NetBSD: ibcs2_machdep.h,v 1.7 2003/09/29 21:04:53 matt Exp $   */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -47,9 +47,9 @@
 struct exec_package;
 struct exec_vmcmd;
 
-void   ibcs2_setregs __P((struct lwp *, struct exec_package *, u_long));
-void   ibcs2_sendsig __P((int, const sigset_t *, u_long));
-int    ibcs2_sys_sysmachine __P((struct proc *, void *, register_t *));
+void   ibcs2_setregs (struct lwp *, struct exec_package *, u_long);
+void   ibcs2_sendsig (const ksiginfo_t *, const sigset_t *);
+int    ibcs2_sys_sysmachine (struct proc *, void *, register_t *);
 
 #endif /* _KERNEL */
 
diff -r a283be4c04db -r b85d16b1a6e7 sys/arch/vax/include/signal.h
--- a/sys/arch/vax/include/signal.h     Mon Sep 29 20:34:23 2003 +0000
+++ b/sys/arch/vax/include/signal.h     Mon Sep 29 21:04:53 2003 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: signal.h,v 1.10 2003/08/07 16:30:12 agc Exp $   */
+/*      $NetBSD: signal.h,v 1.11 2003/09/29 21:04:53 matt Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@@ -40,6 +40,8 @@
 
 typedef int sig_atomic_t;
 
+#define __HAVE_SIGINFO
+
 #if defined(_NETBSD_SOURCE)
 /*
  * Information pushed on stack when a signal is delivered.
@@ -71,29 +73,16 @@
        sigset_t sc_mask;               /* signal mask to restore (new style) */
 };
 
-/*
- * The following macros are used to convert from a ucontext to sigcontext,
- * and vice-versa.  This is for building a sigcontext to deliver to old-style
- * signal handlers, and converting back (in the event the handler modifies
- * the context).
- */
-#define        _MCONTEXT_TO_SIGCONTEXT(uc, sc)                                 \
-do {                                                                   \
-       (sc)->sc_sp = (uc)->uc_mcontext.__gregs[_REG_SP];               \
-       (sc)->sc_fp = (uc)->uc_mcontext.__gregs[_REG_FP];               \
-       (sc)->sc_ap = (uc)->uc_mcontext.__gregs[_REG_AP];               \
-       (sc)->sc_pc = (uc)->uc_mcontext.__gregs[_REG_PC];               \
-       (sc)->sc_ps = (uc)->uc_mcontext.__gregs[_REG_PSL];              \
-} while (/*CONSTCOND*/0)
+#ifdef _KERNEL
+void sendsig_context(int, const sigset_t *, u_long);
 
-#define        _SIGCONTEXT_TO_MCONTEXT(sc, uc)                                 \
-do {                                                                   \
-       (uc)->uc_mcontext.__gregs[_REG_SP]  = (sc)->sc_sp;              \
-       (uc)->uc_mcontext.__gregs[_REG_FP]  = (sc)->sc_fp;              \
-       (uc)->uc_mcontext.__gregs[_REG_AP]  = (sc)->sc_ap;              \
-       (uc)->uc_mcontext.__gregs[_REG_PC]  = (sc)->sc_pc;              \
-       (uc)->uc_mcontext.__gregs[_REG_PSL] = (sc)->sc_ps;              \
-} while (/*CONSTCOND*/0)
+#ifdef COMPAT_16
+#define        SIGTRAMP_VALID(vers)    ((vers) <= 3 && (vers) != 1)
+#else
+#define        SIGTRAMP_VALID(vers)    ((vers) == 3)
+#endif
+
+#endif /* _KERNEL */
 
 #endif /* _NETBSD_SOURCE */
 #endif /* !_VAX_SIGNAL_H_ */
diff -r a283be4c04db -r b85d16b1a6e7 sys/arch/vax/vax/genassym.cf
--- a/sys/arch/vax/vax/genassym.cf      Mon Sep 29 20:34:23 2003 +0000
+++ b/sys/arch/vax/vax/genassym.cf      Mon Sep 29 21:04:53 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.26 2003/01/19 22:29:23 ragge Exp $
+#      $NetBSD: genassym.cf,v 1.27 2003/09/29 21:04:53 matt Exp $
 #
 # Copyright (c) 1997 Ludd, University of Lule}, Sweden.
 # All rights reserved.
@@ -40,11 +40,12 @@
 
 include <uvm/uvm.h>
 
+include        <machine/cpu.h>
 include        <machine/mtpr.h>
 include        <machine/pcb.h>
 include        <machine/sid.h>
+include <machine/signal.h>
 include        <machine/trap.h>
-include        <machine/cpu.h>
 include        <machine/uvax.h>
 
 define L_PRIORITY      offsetof(struct lwp, l_priority)
@@ -125,7 +126,7 @@
 
 define EV_COUNT        offsetof(struct evcnt, ev_count)
 
-define SYS___sigreturn14       SYS___sigreturn14
+define SYS_compat_16___sigreturn14     SYS_compat_16___sigreturn14
 define SYS_exit        SYS_exit
 
 define VAX_TYP_UV2     VAX_TYP_UV2
diff -r a283be4c04db -r b85d16b1a6e7 sys/arch/vax/vax/ibcs2_machdep.c
--- a/sys/arch/vax/vax/ibcs2_machdep.c  Mon Sep 29 20:34:23 2003 +0000
+++ b/sys/arch/vax/vax/ibcs2_machdep.c  Mon Sep 29 21:04:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_machdep.c,v 1.6 2003/09/26 12:02:57 simonb Exp $ */
+/*     $NetBSD: ibcs2_machdep.c,v 1.7 2003/09/29 21:04:53 matt Exp $   */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_machdep.c,v 1.6 2003/09/26 12:02:57 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_machdep.c,v 1.7 2003/09/29 21:04:53 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -57,10 +57,7 @@
 #include <compat/ibcs2/ibcs2_signal.h>
 
 void
-ibcs2_setregs(l, epp, stack)
-       struct lwp *l;
-       struct exec_package *epp;
-       u_long stack;
+ibcs2_setregs(struct lwp *l, struct exec_package *epp, u_long stack)
 {
        /* Don't need to anything special */
        setregs(l, epp, stack);
@@ -77,19 +74,19 @@
  * specified pc, psl.
  */
 void
-ibcs2_sendsig(sig, mask, code)
-       int sig;
-       const sigset_t *mask;
-       u_long code;
+ibcs2_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
 {
-       sendsig(native_to_ibcs2_signo[sig], mask, code);
+       ksiginfo_t nksi;
+       if (ksi->ksi_signo != native_to_ibcs2_signo[ksi->ksi_signo]) {
+               nksi = *ksi;
+               nksi.ksi_signo = native_to_ibcs2_signo[ksi->ksi_signo];
+               ksi = &nksi;
+       }
+       sendsig(ksi, mask);
 }
 
 int
-ibcs2_sys_sysmachine(p, v, retval)
-       struct proc *p;
-       void *v;
-       register_t *retval;
+ibcs2_sys_sysmachine(struct proc *l, void *v, register_t *retval)
 {
        return EINVAL;
 }
diff -r a283be4c04db -r b85d16b1a6e7 sys/arch/vax/vax/machdep.c
--- a/sys/arch/vax/vax/machdep.c        Mon Sep 29 20:34:23 2003 +0000
+++ b/sys/arch/vax/vax/machdep.c        Mon Sep 29 21:04:53 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.139 2003/09/26 12:02:57 simonb Exp $  */
+/* $NetBSD: machdep.c,v 1.140 2003/09/29 21:04:53 matt Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.139 2003/09/26 12:02:57 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.140 2003/09/29 21:04:53 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -412,268 +412,6 @@
 #endif
 }
 
-#if defined(COMPAT_13) || defined(COMPAT_ULTRIX)
-int
-compat_13_sys_sigreturn(l, v, retval)
-       struct lwp *l;
-       void *v;
-       register_t *retval;
-{
-       struct compat_13_sys_sigreturn_args /* {
-               syscallarg(struct sigcontext13 *) sigcntxp;
-       } */ *uap = v;
-       struct proc *p = l->l_proc;
-       struct trapframe *scf;
-       struct sigcontext13 *ucntx;
-       struct sigcontext13 ksc;
-       sigset_t mask;
-
-       scf = l->l_addr->u_pcb.framep;
-       ucntx = SCARG(uap, sigcntxp);
-       if (copyin((caddr_t)ucntx, (caddr_t)&ksc, sizeof(struct sigcontext)))
-               return EINVAL;
-
-       /* Compatibility mode? */
-       if ((ksc.sc_ps & (PSL_IPL | PSL_IS)) ||
-           ((ksc.sc_ps & (PSL_U | PSL_PREVU)) != (PSL_U | PSL_PREVU)) ||
-           (ksc.sc_ps & PSL_CM)) {
-               return (EINVAL);
-       }
-       if (ksc.sc_onstack & SS_ONSTACK)
-               p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
-       else
-               p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
-
-       native_sigset13_to_sigset(&ksc.sc_mask, &mask);
-       (void) sigprocmask1(p, SIG_SETMASK, &mask, 0);
-
-       scf->fp = ksc.sc_fp;
-       scf->ap = ksc.sc_ap;
-       scf->pc = ksc.sc_pc;
-       scf->sp = ksc.sc_sp;
-       scf->psl = ksc.sc_ps;
-       return (EJUSTRETURN);
-}
-#endif
-
-int
-sys___sigreturn14(l, v, retval)
-       struct lwp *l;
-       void *v;
-       register_t *retval;
-{
-       struct sys___sigreturn14_args /* {
-               syscallarg(struct sigcontext *) sigcntxp;
-       } */ *uap = v;
-       struct proc *p = l->l_proc;
-       struct trapframe *scf;
-       struct sigcontext *ucntx;
-       struct sigcontext ksc;
-
-       scf = l->l_addr->u_pcb.framep;
-       ucntx = SCARG(uap, sigcntxp);
-
-       if (copyin((caddr_t)ucntx, (caddr_t)&ksc, sizeof(struct sigcontext)))
-               return EINVAL;
-       /* Compatibility mode? */
-       if ((ksc.sc_ps & (PSL_IPL | PSL_IS)) ||
-           ((ksc.sc_ps & (PSL_U | PSL_PREVU)) != (PSL_U | PSL_PREVU)) ||
-           (ksc.sc_ps & PSL_CM)) {
-               return (EINVAL);
-       }
-       if (ksc.sc_onstack & SS_ONSTACK)
-               p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
-       else
-               p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
-       /* Restore signal mask. */
-       (void) sigprocmask1(p, SIG_SETMASK, &ksc.sc_mask, 0);
-
-       scf->fp = ksc.sc_fp;
-       scf->ap = ksc.sc_ap;
-       scf->pc = ksc.sc_pc;
-       scf->sp = ksc.sc_sp;
-       scf->psl = ksc.sc_ps;
-       return (EJUSTRETURN);
-}
-
-#if defined(COMPAT_16) || defined(COMPAT_ULTRIX) || defined(COMPAT_IBCS2)
-
-struct otrampframe {
-       unsigned        sig;    /* Signal number */
-       unsigned        code;   /* Info code */
-       unsigned        scp;    /* Pointer to struct sigcontext */
-       unsigned        r0, r1, r2, r3, r4, r5; /* Registers saved when



Home | Main Index | Thread Index | Old Index