diff options
| author | christos <christos@NetBSD.org> | 2002-02-18 22:24:17 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2002-02-18 22:24:17 +0000 |
| commit | e52b5e4bfb2a6ba0d6baefb6006bfcddf2531b1e (patch) | |
| tree | b6233ff419a3cb51cc7d9c79e875a737f9be2262 /sys/compat/linux | |
| parent | e96b77f08f89717239bc3379e6002a6dec387185 (diff) | |
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 (limited to 'sys/compat/linux')
| -rw-r--r-- | sys/compat/linux/arch/alpha/linux_machdep.c | 8 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_misc.c | 9 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_signal.c | 103 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_signal.h | 6 |
4 files changed, 69 insertions, 57 deletions
diff --git a/sys/compat/linux/arch/alpha/linux_machdep.c b/sys/compat/linux/arch/alpha/linux_machdep.c index d56637efc84..b10a0406d30 100644 --- a/sys/compat/linux/arch/alpha/linux_machdep.c +++ b/sys/compat/linux/arch/alpha/linux_machdep.c @@ -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 @@ linux_sys_rt_sigreturn(p, v, retval) 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 @@ linux_sys_sigreturn(p, v, retval) /* 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 --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c index 9daec51fc8b..847a10d9109 100644 --- a/sys/compat/linux/common/linux_misc.c +++ b/sys/compat/linux/common/linux_misc.c @@ -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 @@ linux_sys_setrlimit(p, v, retval) 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 --git a/sys/compat/linux/common/linux_signal.c b/sys/compat/linux/common/linux_signal.c index 658fb8b0559..b03e09aa1fc 100644 --- a/sys/compat/linux/common/linux_signal.c +++ b/sys/compat/linux/common/linux_signal.c @@ -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 @@ native_to_linux_sigset(lss, bss) } } -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 @@ linux_old_to_native_sigaction(bsa, lsa) { 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 @@ native_to_linux_old_sigaction(lsa, bsa) { 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 @@ linux_to_native_sigaction(bsa, lsa) { 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 @@ native_to_linux_sigaction(lsa, bsa) { 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 --git a/sys/compat/linux/common/linux_signal.h b/sys/compat/linux/common/linux_signal.h index 688964c0162..f7beb4e44e5 100644 --- a/sys/compat/linux/common/linux_signal.h +++ b/sys/compat/linux/common/linux_signal.h @@ -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 native_to_linux_old_extra_sigset __P((linux_old_sigset_t *, 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 *)); |
