Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/compat/osf1 pull up rev(s) 1.7-1.16 from trunk. (cgd)



details:   https://anonhg.NetBSD.org/src/rev/31b9efa77d00
branches:  netbsd-1-4
changeset: 468860:31b9efa77d00
user:      cgd <cgd%NetBSD.org@localhost>
date:      Mon Jun 21 19:27:41 1999 +0000

description:
pull up rev(s) 1.7-1.16 from trunk. (cgd)

diffstat:

 sys/compat/osf1/osf1_signal.c |  348 ++++++++++-------------------------------
 1 files changed, 85 insertions(+), 263 deletions(-)

diffs (truncated from 473 to 300 lines):

diff -r a4f1bc7fd365 -r 31b9efa77d00 sys/compat/osf1/osf1_signal.c
--- a/sys/compat/osf1/osf1_signal.c     Mon Jun 21 19:27:19 1999 +0000
+++ b/sys/compat/osf1/osf1_signal.c     Mon Jun 21 19:27:41 1999 +0000
@@ -1,4 +1,34 @@
-/*     $NetBSD: osf1_signal.c,v 1.6 1999/02/09 20:34:17 christos Exp $ */
+/*     $NetBSD: osf1_signal.c,v 1.6.2.1 1999/06/21 19:27:41 cgd Exp $  */
+
+/*
+ * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Christopher G. Demetriou
+ *     for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -14,201 +44,27 @@
 
 #include <sys/syscallargs.h>
 
+#include <compat/osf1/osf1.h>
 #include <compat/osf1/osf1_signal.h>
 #include <compat/osf1/osf1_syscallargs.h>
 #include <compat/osf1/osf1_util.h>
-
-static void bsd_to_osf1_sigaction __P((const struct sigaction13 *bsa, 
-                                      struct osf1_sigaction *osa));
-static void osf1_to_bsd_sigaction __P((const struct osf1_sigaction *osa,
-                                      struct sigaction13 *bsa));
-
-#define        osf1_sigmask(n)         (1 << ((n) - 1))
-#define osf1_sigemptyset(s)    memset((s), 0, sizeof(*(s)))
-#define osf1_sigismember(s, n) (*(s) & osf1_sigmask(n))
-#define osf1_sigaddset(s, n)   (*(s) |= osf1_sigmask(n))
-
-int bsd_to_osf1_sig[] = {
-       0,
-       OSF1_SIGHUP,
-       OSF1_SIGINT,
-       OSF1_SIGQUIT,
-       OSF1_SIGILL,
-       OSF1_SIGTRAP,
-       OSF1_SIGABRT,
-       OSF1_SIGEMT,
-       OSF1_SIGFPE,
-       OSF1_SIGKILL,
-       OSF1_SIGBUS,
-       OSF1_SIGSEGV,
-       OSF1_SIGSYS,
-       OSF1_SIGPIPE,
-       OSF1_SIGALRM,
-       OSF1_SIGTERM,
-       OSF1_SIGURG,
-       OSF1_SIGSTOP,
-       OSF1_SIGTSTP,
-       OSF1_SIGCONT,
-       OSF1_SIGCHLD,
-       OSF1_SIGTTIN,
-       OSF1_SIGTTOU,
-       OSF1_SIGIO,
-       OSF1_SIGXCPU,
-       OSF1_SIGXFSZ,
-       OSF1_SIGVTALRM,
-       OSF1_SIGPROF,
-       OSF1_SIGWINCH,
-       OSF1_SIGINFO,
-       OSF1_SIGUSR1,
-       OSF1_SIGUSR2,
-};
-
-int osf1_to_bsd_sig[] = {
-       0,
-       SIGHUP,
-       SIGINT,
-       SIGQUIT,
-       SIGILL,
-       SIGTRAP,
-       SIGABRT,
-       SIGEMT,
-       SIGFPE,
-       SIGKILL,
-       SIGBUS,
-       SIGSEGV,
-       SIGSYS,
-       SIGPIPE,
-       SIGALRM,
-       SIGTERM,
-       SIGURG,
-       SIGSTOP,
-       SIGTSTP,
-       SIGCONT,
-       SIGCHLD,
-       SIGTTIN,
-       SIGTTOU,
-       SIGIO,
-       SIGXCPU,
-       SIGXFSZ,
-       SIGVTALRM,
-       SIGPROF,
-       SIGWINCH,
-       SIGINFO,
-       SIGUSR1,
-       SIGUSR2,
-};
-
-void
-osf1_to_bsd_sigset(oss, bss)
-       const osf1_sigset_t *oss;
-       sigset_t *bss;
-{
-       int i, newsig;
+#include <compat/osf1/osf1_cvt.h>
 
-       sigemptyset(bss);
-       for (i = 1; i < OSF1_NSIG; i++) {
-               if (osf1_sigismember(oss, i)) {
-                       newsig = osf1_to_bsd_sig[i];
-                       if (newsig)
-                               sigaddset(bss, newsig);
-               }
-       }
-}
-
-
-void
-bsd_to_osf1_sigset(bss, oss)
-       const sigset_t *bss;
-       osf1_sigset_t *oss;
+#if 0
+int
+osf1_sys_kill(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
 {
-       int i, newsig;
-
-       osf1_sigemptyset(oss);
-       for (i = 1; i < NSIG; i++) {
-               if (sigismember(bss, i)) {
-                       newsig = bsd_to_osf1_sig[i];
-                       if (newsig)
-                               osf1_sigaddset(oss, newsig);
-               }
-       }
-}
-
-/*
- * XXX: Only a subset of the flags is currently implemented.
- */
-void
-osf1_to_bsd_sigaction(osa, bsa)
-       const struct osf1_sigaction *osa;
-       struct sigaction *bsa;
-{
-
-       bsa->sa_handler = osa->sa_handler;
-       osf1_to_bsd_sigset(&osa->sa_mask, &bsa->sa_mask);
-       bsa->sa_flags = 0;
-       if ((osa->sa_flags & OSF1_SA_ONSTACK) != 0)
-               bsa->sa_flags |= SA_ONSTACK;
-       if ((osa->sa_flags & OSF1_SA_RESTART) != 0)
-               bsa->sa_flags |= SA_RESTART;
-       if ((osa->sa_flags & OSF1_SA_RESETHAND) != 0)
-               bsa->sa_flags |= SA_RESETHAND;
-       if ((osa->sa_flags & OSF1_SA_NOCLDSTOP) != 0)
-               bsa->sa_flags |= SA_NOCLDSTOP;
-       if ((osa->sa_flags & OSF1_SA_NODEFER) != 0)
-               bsa->sa_flags |= SA_NODEFER;
-}
+       struct osf1_sys_kill_args *uap = v;
+       struct sys_kill_args ka;
 
-void
-bsd_to_osf1_sigaction(bsa, osa)
-       const struct sigaction *bsa;
-       struct osf1_sigaction *osa;
-{
-
-       osa->sa_handler = bsa->sa_handler;
-       bsd_to_osf1_sigset(&bsa->sa_mask, &osa->sa_mask);
-       osa->sa_flags = 0;
-       if ((bsa->sa_flags & SA_ONSTACK) != 0)
-               osa->sa_flags |= SA_ONSTACK;
-       if ((bsa->sa_flags & SA_RESTART) != 0)
-               osa->sa_flags |= SA_RESTART;
-       if ((bsa->sa_flags & SA_NOCLDSTOP) != 0)
-               osa->sa_flags |= SA_NOCLDSTOP;
-       if ((bsa->sa_flags & SA_NODEFER) != 0)
-               osa->sa_flags |= SA_NODEFER;
-       if ((bsa->sa_flags & SA_RESETHAND) != 0)
-               osa->sa_flags |= SA_RESETHAND;
+       SCARG(&ka, pid) = SCARG(uap, pid);
+       SCARG(&ka, signum) = osf1_signal_xlist[SCARG(uap, signum)];
+       return sys_kill(p, &ka, retval);
 }
-
-void
-osf1_to_bsd_sigaltstack(oss, bss)
-       const struct osf1_sigaltstack *oss;
-       struct sigaltstack *bss;
-{
-
-       bss->ss_sp = oss->ss_sp;
-       bss->ss_size = oss->ss_size;
-       bss->ss_flags = 0;
-
-       if ((oss->ss_flags & OSF1_SS_DISABLE) != 0)
-               bss->ss_flags |= SS_DISABLE;
-       if ((oss->ss_flags & OSF1_SS_ONSTACK) != 0)
-               bss->ss_flags |= SS_ONSTACK;
-}
-
-void
-bsd_to_osf1_sigaltstack(bss, oss)
-       const struct sigaltstack *bss;
-       struct osf1_sigaltstack *oss;
-{
-
-       oss->ss_sp = bss->ss_sp;
-       oss->ss_size = bss->ss_size;
-       oss->ss_flags = 0;
-
-       if ((bss->ss_flags & SS_DISABLE) != 0)
-               oss->ss_flags |= OSF1_SS_DISABLE;
-       if ((bss->ss_flags & SS_ONSTACK) != 0)
-               oss->ss_flags |= OSF1_SS_ONSTACK;
-}
+#endif
 
 int
 osf1_sys_sigaction(p, v, retval)
@@ -216,14 +72,10 @@
        void *v;
        register_t *retval;
 {
-       struct osf1_sys_sigaction_args /* {
-               syscallarg(int) signum;
-               syscallarg(struct osf1_sigaction *) nsa;
-               syscallarg(struct osf1_sigaction *) osa;
-       } */ *uap = v;
+       struct osf1_sys_sigaction_args *uap = v;
        struct osf1_sigaction *nosa, *oosa, tmposa;
-       struct sigaction13 *nbsa, *obsa, tmpbsa;
-       struct compat_13_sys_sigaction_args sa;
+       struct sigaction *nbsa, *obsa, tmpbsa;
+       struct sys___sigaction14_args sa;
        caddr_t sg;
        int error;
 
@@ -240,23 +92,23 @@
                nbsa = stackgap_alloc(&sg, sizeof(struct sigaction));
                if ((error = copyin(nosa, &tmposa, sizeof(tmposa))) != 0)
                        return error;
-               osf1_to_bsd_sigaction(&tmposa, &tmpbsa);
+               osf1_cvt_sigaction_to_native(&tmposa, &tmpbsa);
                if ((error = copyout(&tmpbsa, nbsa, sizeof(tmpbsa))) != 0)
                        return error;
        } else
                nbsa = NULL;
 
-       SCARG(&sa, signum) = osf1_to_bsd_sig[SCARG(uap, signum)];
+       SCARG(&sa, signum) = osf1_signal_xlist[SCARG(uap, signum)];
        SCARG(&sa, nsa) = nbsa;
        SCARG(&sa, osa) = obsa;
 
-       if ((error = compat_13_sys_sigaction(p, &sa, retval)) != 0)
+       if ((error = sys___sigaction14(p, &sa, retval)) != 0)
                return error;
 
        if (oosa != NULL) {
                if ((error = copyin(obsa, &tmpbsa, sizeof(tmpbsa))) != 0)
                        return error;
-               bsd_to_osf1_sigaction(&tmpbsa, &tmposa);
+               osf1_cvt_sigaction_from_native(&tmpbsa, &tmposa);
                if ((error = copyout(&tmposa, oosa, sizeof(tmposa))) != 0)
                        return error;



Home | Main Index | Thread Index | Old Index