Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux Resolve alpha compile issues:



details:   https://anonhg.NetBSD.org/src/rev/3976788839e0
branches:  trunk
changeset: 522434:3976788839e0
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 18 22:24:17 2002 +0000

description:
Resolve alpha compile issues:
- bug with order in args in mask conversion md code.
- flags can be both int and long on the alpha. kludge around that, by not
  passing pointers to the conversion function.
- something is wrong with the toolchain look at the void * cast in copyout().
- sa_restorer is in a different place on the aplha. Deal with that, by not
  initializing it as before. XXX: this should be changed in the MD signal
  definition.

diffstat:

 sys/compat/linux/arch/alpha/linux_machdep.c |    8 +-
 sys/compat/linux/common/linux_misc.c        |    9 +-
 sys/compat/linux/common/linux_signal.c      |  103 +++++++++++++++------------
 sys/compat/linux/common/linux_signal.h      |    6 +-
 4 files changed, 69 insertions(+), 57 deletions(-)

diffs (257 lines):

diff -r 5ead083daa34 -r 3976788839e0 sys/compat/linux/arch/alpha/linux_machdep.c
--- a/sys/compat/linux/arch/alpha/linux_machdep.c       Mon Feb 18 22:00:36 2002 +0000
+++ b/sys/compat/linux/arch/alpha/linux_machdep.c       Mon Feb 18 22:24:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_machdep.c,v 1.20 2002/02/15 16:47:58 christos Exp $      */
+/*     $NetBSD: linux_machdep.c,v 1.21 2002/02/18 22:24:17 christos Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.20 2002/02/15 16:47:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.21 2002/02/18 22:24:17 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -450,7 +450,7 @@
                return (EFAULT);
 
        /* Grab the signal mask */
-       linux_to_native_sigset(&sigframe.uc.uc_sigmask, &mask);
+       linux_to_native_sigset(&mask, &sigframe.uc.uc_sigmask);
 
        return(linux_restore_sigcontext(p, sigframe.uc.uc_mcontext, &mask));
 }
@@ -486,7 +486,7 @@
 
        /* Grab the signal mask. */
        /* XXX use frame.extramask */
-       linux_old_to_native_sigset(frame.sf_sc.sc_mask, &mask);
+       linux_old_to_native_sigset(&mask, frame.sf_sc.sc_mask);
 
        return(linux_restore_sigcontext(p, frame.sf_sc, &mask));
 }
diff -r 5ead083daa34 -r 3976788839e0 sys/compat/linux/common/linux_misc.c
--- a/sys/compat/linux/common/linux_misc.c      Mon Feb 18 22:00:36 2002 +0000
+++ b/sys/compat/linux/common/linux_misc.c      Mon Feb 18 22:24:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_misc.c,v 1.99 2002/02/18 18:51:51 jdolecek Exp $ */
+/*     $NetBSD: linux_misc.c,v 1.100 2002/02/18 22:24:18 christos Exp $        */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.99 2002/02/18 18:51:51 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.100 2002/02/18 22:24:18 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1542,9 +1542,10 @@
        if ((error = copyin(SCARG(uap, rlp), &orl, sizeof(orl))) != 0)
                return error;
        linux_to_bsd_rlimit(&rl, &orl);
-       if ((error = copyout(&rl, SCARG(uap, rlp), sizeof(rl))) != 0)
+       /* XXX: alpha complains about this */
+       if ((error = copyout(&rl, (void *)SCARG(&ap, rlp), sizeof(rl))) != 0)
                return error;
-       return sys_setrlimit(p, v, retval);
+       return sys_setrlimit(p, &ap, retval);
 }
 
 #ifndef __mips__
diff -r 5ead083daa34 -r 3976788839e0 sys/compat/linux/common/linux_signal.c
--- a/sys/compat/linux/common/linux_signal.c    Mon Feb 18 22:00:36 2002 +0000
+++ b/sys/compat/linux/common/linux_signal.c    Mon Feb 18 22:24:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_signal.c,v 1.33 2002/02/15 16:48:03 christos Exp $       */
+/*     $NetBSD: linux_signal.c,v 1.34 2002/02/18 22:24:18 christos Exp $       */
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.33 2002/02/15 16:48:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.34 2002/02/18 22:24:18 christos Exp $");
 
 #define COMPAT_LINUX 1
 
@@ -197,54 +197,54 @@
        }
 }
 
-void
-native_to_linux_sigflags(lsf, bsf)
-       unsigned long *lsf;
-       const int *bsf;
+unsigned int
+native_to_linux_sigflags(bsf)
+       const int bsf;
 {
-       *lsf = 0;
-       if ((*bsf & SA_NOCLDSTOP) != 0)
-               *lsf |= LINUX_SA_NOCLDSTOP;
-       if ((*bsf & SA_NOCLDWAIT) != 0)
-               *lsf |= LINUX_SA_NOCLDWAIT;
-       if ((*bsf & SA_ONSTACK) != 0)
-               *lsf |= LINUX_SA_ONSTACK;
-       if ((*bsf & SA_RESTART) != 0)
-               *lsf |= LINUX_SA_RESTART;
-       if ((*bsf & SA_NODEFER) != 0)
-               *lsf |= LINUX_SA_NOMASK;
-       if ((*bsf & SA_RESETHAND) != 0)
-               *lsf |= LINUX_SA_ONESHOT;
-       if ((*bsf & SA_SIGINFO) != 0)
-               *lsf |= LINUX_SA_SIGINFO;
+       unsigned int lsf = 0;
+       if ((bsf & SA_NOCLDSTOP) != 0)
+               lsf |= LINUX_SA_NOCLDSTOP;
+       if ((bsf & SA_NOCLDWAIT) != 0)
+               lsf |= LINUX_SA_NOCLDWAIT;
+       if ((bsf & SA_ONSTACK) != 0)
+               lsf |= LINUX_SA_ONSTACK;
+       if ((bsf & SA_RESTART) != 0)
+               lsf |= LINUX_SA_RESTART;
+       if ((bsf & SA_NODEFER) != 0)
+               lsf |= LINUX_SA_NOMASK;
+       if ((bsf & SA_RESETHAND) != 0)
+               lsf |= LINUX_SA_ONESHOT;
+       if ((bsf & SA_SIGINFO) != 0)
+               lsf |= LINUX_SA_SIGINFO;
+       return lsf;
 }
 
-void
-linux_to_native_sigflags(bsf, lsf)
-       int *bsf;
-       const unsigned long *lsf;
+int
+linux_to_native_sigflags(lsf)
+       const unsigned long lsf;
 {
-       *bsf = 0;
-       if ((*lsf & LINUX_SA_NOCLDSTOP) != 0)
-               *bsf |= SA_NOCLDSTOP;
-       if ((*lsf & LINUX_SA_NOCLDWAIT) != 0)
-               *bsf |= SA_NOCLDWAIT;
-       if ((*lsf & LINUX_SA_ONSTACK) != 0)
-               *bsf |= SA_ONSTACK;
-       if ((*lsf & LINUX_SA_RESTART) != 0)
-               *bsf |= SA_RESTART;
-       if ((*lsf & LINUX_SA_ONESHOT) != 0)
-               *bsf |= SA_RESETHAND;
-       if ((*lsf & LINUX_SA_NOMASK) != 0)
-               *bsf |= SA_NODEFER;
-       if ((*lsf & LINUX_SA_SIGINFO) != 0)
-               *bsf |= SA_SIGINFO;
+       int bsf = 0;
+       if ((lsf & LINUX_SA_NOCLDSTOP) != 0)
+               bsf |= SA_NOCLDSTOP;
+       if ((lsf & LINUX_SA_NOCLDWAIT) != 0)
+               bsf |= SA_NOCLDWAIT;
+       if ((lsf & LINUX_SA_ONSTACK) != 0)
+               bsf |= SA_ONSTACK;
+       if ((lsf & LINUX_SA_RESTART) != 0)
+               bsf |= SA_RESTART;
+       if ((lsf & LINUX_SA_ONESHOT) != 0)
+               bsf |= SA_RESETHAND;
+       if ((lsf & LINUX_SA_NOMASK) != 0)
+               bsf |= SA_NODEFER;
+       if ((lsf & LINUX_SA_SIGINFO) != 0)
+               bsf |= SA_SIGINFO;
 #ifdef DEBUG_LINUX
-       if ((*lsf & ~LINUX_SA_ALLBITS) != 0)
+       if ((lsf & ~LINUX_SA_ALLBITS) != 0)
                uprintf(
                    "linux_old_to_native_sigflags: %lx extra bits ignored\n",
-                   *lsf);
+                   lsf);
 #endif
+       return bsf;
 }
 
 /*
@@ -258,11 +258,16 @@
 {
        bsa->sa_handler = lsa->sa_handler;
        linux_old_to_native_sigset(&bsa->sa_mask, &lsa->sa_mask);
-       linux_to_native_sigflags(&bsa->sa_flags, &lsa->sa_mask);
+       bsa->sa_flags = linux_to_native_sigflags(lsa->sa_flags);
+#ifndef __alpha__
+/*
+ * XXX: On the alpha sa_restorer is elsewhere.
+ */
 #ifdef DEBUG_LINUX
        if (lsa->sa_restorer != NULL)
                uprintf("linux_old_to_native_sigaction: sa_restorer ignored\n");
 #endif
+#endif
 }
 
 void
@@ -272,8 +277,10 @@
 {
        lsa->sa_handler = bsa->sa_handler;
        native_to_linux_old_sigset(&lsa->sa_mask, &bsa->sa_mask);
-       native_to_linux_sigflags(&lsa->sa_flags, &bsa->sa_flags);
+       lsa->sa_flags = native_to_linux_sigflags(bsa->sa_flags);
+#ifndef __alpha__
        lsa->sa_restorer = NULL;
+#endif
 }
 
 /* ...and the new sigaction conversion funcs. */
@@ -284,11 +291,13 @@
 {
        bsa->sa_handler = lsa->sa_handler;
        linux_to_native_sigset(&bsa->sa_mask, &lsa->sa_mask);
-       linux_to_native_sigflags(&bsa->sa_flags, &lsa->sa_flags);
+       bsa->sa_flags = linux_to_native_sigflags(lsa->sa_flags);
+#ifndef __alpha__
 #ifdef DEBUG_LINUX
        if (lsa->sa_restorer != 0)
                uprintf("linux_to_native_sigaction: sa_restorer ignored\n");
 #endif
+#endif
 }
 
 void
@@ -298,8 +307,10 @@
 {
        lsa->sa_handler = bsa->sa_handler;
        native_to_linux_sigset(&lsa->sa_mask, &bsa->sa_mask);
-       native_to_linux_sigflags(&lsa->sa_flags, &bsa->sa_flags);
+       lsa->sa_flags = native_to_linux_sigflags(bsa->sa_flags);
+#ifndef __alpha__
        lsa->sa_restorer = NULL;
+#endif
 }
 
 /* ----------------------------------------------------------------------- */
diff -r 5ead083daa34 -r 3976788839e0 sys/compat/linux/common/linux_signal.h
--- a/sys/compat/linux/common/linux_signal.h    Mon Feb 18 22:00:36 2002 +0000
+++ b/sys/compat/linux/common/linux_signal.h    Mon Feb 18 22:24:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_signal.h,v 1.16 2002/02/15 16:48:03 christos Exp $       */
+/*     $NetBSD: linux_signal.h,v 1.17 2002/02/18 22:24:18 christos Exp $       */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -82,8 +82,8 @@
 
 void linux_to_native_sigset __P((sigset_t *, const linux_sigset_t *));
 void native_to_linux_sigset __P((linux_sigset_t *, const sigset_t *));
-void linux_to_native_sigflags __P((int *, const unsigned long *));
-void native_to_linux_sigflags __P((unsigned long *, const int *));
+int linux_to_native_sigflags __P((const unsigned long));
+unsigned int native_to_linux_sigflags __P((const int));
 
 void linux_old_to_native_sigaction __P((struct sigaction *,
     const struct linux_old_sigaction *));



Home | Main Index | Thread Index | Old Index