Added linux compat support on m68k ports.
This commit is contained in:
parent
e0f218ab08
commit
0c080222db
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_exec.h,v 1.11 1998/10/04 00:02:31 fvdl Exp $ */
|
||||
/* $NetBSD: linux_exec.h,v 1.12 1998/12/15 19:31:39 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
@ -41,6 +41,8 @@
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_exec.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_exec.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_exec.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_fcntl.h,v 1.4 1998/10/04 00:02:33 fvdl Exp $ */
|
||||
/* $NetBSD: linux_fcntl.h,v 1.5 1998/12/15 19:31:39 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
@ -60,6 +60,8 @@ struct linux_flock {
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_fcntl.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_fcntl.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_fcntl.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_ioctl.h,v 1.10 1998/10/04 00:02:34 fvdl Exp $ */
|
||||
/* $NetBSD: linux_ioctl.h,v 1.11 1998/12/15 19:31:39 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
@ -55,6 +55,8 @@ __END_DECLS
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_ioctl.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_ioctl.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_ioctl.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_machdep.h,v 1.1 1998/10/03 20:20:04 christos Exp $ */
|
||||
/* $NetBSD: linux_machdep.h,v 1.2 1998/12/15 19:31:39 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -41,6 +41,8 @@
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_machdep.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_machdep.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_machdep.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_mmap.h,v 1.5 1998/10/07 23:06:17 erh Exp $ */
|
||||
/* $NetBSD: linux_mmap.h,v 1.6 1998/12/15 19:31:39 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -49,6 +49,8 @@
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_mmap.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_mmap.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_mmap.h>
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_siginfo.h,v 1.1 1998/10/03 20:20:04 christos Exp $ */
|
||||
/* $NetBSD: linux_siginfo.h,v 1.2 1998/12/15 19:31:39 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -42,6 +42,8 @@
|
||||
#if defined(__i386__)
|
||||
/*XXX XAX write me#include <compat/linux/i386/linux_siginfo.h>*/
|
||||
#include <compat/linux/arch/alpha/linux_siginfo.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_siginfo.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_siginfo.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_signal.c,v 1.19 1998/10/07 22:50:42 erh Exp $ */
|
||||
/* $NetBSD: linux_signal.c,v 1.20 1998/12/15 19:31:39 itohy Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -75,12 +75,11 @@
|
||||
#include <compat/linux/linux_syscallargs.h>
|
||||
|
||||
/* Locally used defines (in bsd<->linux conversion functions): */
|
||||
/* XXX XAX rename to linux_old. Add stuff for new type linux_sigset_t
|
||||
handle _NSIG_WORDS > 1 */
|
||||
#define linux_sigmask(n) (1 << ((n) - 1))
|
||||
#define linux_sigemptyset(s) memset((s), 0, sizeof(*(s)))
|
||||
#define linux_sigismember(s, n) (*(s) & linux_sigmask(n))
|
||||
#define linux_sigaddset(s, n) (*(s) |= linux_sigmask(n))
|
||||
#define linux_sigismember(s, n) ((s)->sig[((n) - 1) / LINUX__NSIG_BPW] \
|
||||
& (1 << ((n) - 1) % LINUX__NSIG_BPW))
|
||||
#define linux_sigaddset(s, n) ((s)->sig[((n) - 1) / LINUX__NSIG_BPW] \
|
||||
|= (1 << ((n) - 1) % LINUX__NSIG_BPW))
|
||||
|
||||
/* Note: linux_to_native_sig[] is in <arch>/linux_sigarray.c */
|
||||
int native_to_linux_sig[NSIG] = {
|
||||
@ -120,18 +119,54 @@ int native_to_linux_sig[NSIG] = {
|
||||
};
|
||||
|
||||
/*
|
||||
* Ok, we know that Linux and BSD signals both are just an unsigned int.
|
||||
* Don't bother to use the sigismember() stuff for now.
|
||||
* Convert between Linux and BSD signal sets.
|
||||
*/
|
||||
#if LINUX__NSIG_WORDS > 1
|
||||
void
|
||||
linux_old_to_native_sigset(lss, bss)
|
||||
linux_old_extra_to_native_sigset(lss, extra, bss)
|
||||
const linux_old_sigset_t *lss;
|
||||
const unsigned long *extra;
|
||||
sigset_t *bss;
|
||||
{
|
||||
linux_sigset_t lsnew;
|
||||
|
||||
/* convert old sigset to new sigset */
|
||||
linux_sigemptyset(&lsnew);
|
||||
lsnew.sig[0] = *lss;
|
||||
if (extra)
|
||||
bcopy(extra, &lsnew.sig[1],
|
||||
sizeof(linux_sigset_t) - sizeof(linux_old_sigset_t));
|
||||
|
||||
linux_to_native_sigset(&lsnew, bss);
|
||||
}
|
||||
|
||||
void
|
||||
native_to_linux_old_extra_sigset(bss, lss, extra)
|
||||
const sigset_t *bss;
|
||||
linux_old_sigset_t *lss;
|
||||
unsigned long *extra;
|
||||
{
|
||||
linux_sigset_t lsnew;
|
||||
|
||||
native_to_linux_sigset(bss, &lsnew);
|
||||
|
||||
/* convert new sigset to old sigset */
|
||||
*lss = lsnew.sig[0];
|
||||
if (extra)
|
||||
bcopy(&lsnew.sig[1], extra,
|
||||
sizeof(linux_sigset_t) - sizeof(linux_old_sigset_t));
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
linux_to_native_sigset(lss, bss)
|
||||
const linux_sigset_t *lss;
|
||||
sigset_t *bss;
|
||||
{
|
||||
int i, newsig;
|
||||
|
||||
sigemptyset(bss);
|
||||
for (i = 1; i < LINUX_NSIG; i++) {
|
||||
for (i = 1; i < LINUX__NSIG; i++) {
|
||||
if (linux_sigismember(lss, i)) {
|
||||
newsig = linux_to_native_sig[i];
|
||||
if (newsig)
|
||||
@ -141,12 +176,12 @@ linux_old_to_native_sigset(lss, bss)
|
||||
}
|
||||
|
||||
void
|
||||
native_to_linux_old_sigset(bss, lss)
|
||||
native_to_linux_sigset(bss, lss)
|
||||
const sigset_t *bss;
|
||||
linux_old_sigset_t *lss;
|
||||
linux_sigset_t *lss;
|
||||
{
|
||||
int i, newsig;
|
||||
|
||||
|
||||
linux_sigemptyset(lss);
|
||||
for (i = 1; i < NSIG; i++) {
|
||||
if (sigismember(bss, i)) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_signal.h,v 1.10 1998/10/07 22:45:51 erh Exp $ */
|
||||
/* $NetBSD: linux_signal.h,v 1.11 1998/12/15 19:31:40 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
@ -41,6 +41,8 @@
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_signal.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_signal.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_signal.h>
|
||||
#else
|
||||
@ -53,19 +55,27 @@ extern int linux_to_native_sig[];
|
||||
__BEGIN_DECLS
|
||||
int linux_sigprocmask1 __P((struct proc *, int, const linux_old_sigset_t *,
|
||||
linux_old_sigset_t *));
|
||||
void linux_old_to_native_sigset __P((const linux_old_sigset_t *, sigset_t *));
|
||||
void native_to_linux_old_sigset __P((const sigset_t *, linux_old_sigset_t *));
|
||||
|
||||
#if 0
|
||||
/* XXX Need these if sizeof(linux_old_sigset_t) != sizeof(linux_sigset_t) */
|
||||
void linux_to_native_sigset __P((const linux_sigset_t *, sigset_t *));
|
||||
void native_to_linux_sigset __P((const sigset_t *, linux_sigset_t *));
|
||||
#if LINUX__NSIG_WORDS > 1
|
||||
void linux_old_extra_to_native_sigset __P((const linux_old_sigset_t *,
|
||||
const unsigned long *, sigset_t *));
|
||||
void native_to_linux_old_extra_sigset __P((const sigset_t *,
|
||||
linux_old_sigset_t *, unsigned long *));
|
||||
#define linux_old_to_native_sigset(x,y) \
|
||||
linux_old_extra_to_native_sigset(x, (const unsigned long *) 0, y)
|
||||
#define native_to_linux_old_sigset(x,y) \
|
||||
native_to_linux_old_extra_sigset(x, y, (unsigned long *) 0)
|
||||
|
||||
#else /* LINUX__NSIG_WORDS == 1 */
|
||||
|
||||
#define linux_old_to_native_sigset(x,y) \
|
||||
linux_to_native_sigset((const linux_sigset_t *) x, y)
|
||||
#define native_to_linux_old_sigset(x,y) \
|
||||
native_to_linux_sigset(x, (linux_sigset_t *) y)
|
||||
#endif
|
||||
|
||||
#define linux_to_native_sigset(x,y) \
|
||||
linux_old_to_native_sigset((linux_old_sigset_t *)x, y)
|
||||
#define native_to_linux_sigset(x,y) \
|
||||
native_to_linux_old_sigset(x, (linux_old_sigset_t *)y)
|
||||
void linux_to_native_sigset __P((const linux_sigset_t *, sigset_t *));
|
||||
void native_to_linux_sigset __P((const sigset_t *, linux_sigset_t *));
|
||||
|
||||
void linux_old_to_native_sigaction __P((struct linux_old_sigaction *,
|
||||
struct sigaction *));
|
||||
@ -74,7 +84,7 @@ void native_to_linux_old_sigaction __P((struct sigaction *,
|
||||
|
||||
void linux_to_native_sigaction __P((struct linux_sigaction *,
|
||||
struct sigaction *));
|
||||
void native_to_linux_sigaction __P((struct sigaction *, \
|
||||
void native_to_linux_sigaction __P((struct sigaction *,
|
||||
struct linux_sigaction *));
|
||||
|
||||
__END_DECLS
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_socket.h,v 1.6 1998/10/04 00:02:43 fvdl Exp $ */
|
||||
/* $NetBSD: linux_socket.h,v 1.7 1998/12/15 19:31:40 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
@ -125,6 +125,8 @@
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_socket.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_socket.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_socket.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_termios.h,v 1.4 1998/10/03 20:17:44 christos Exp $ */
|
||||
/* $NetBSD: linux_termios.h,v 1.5 1998/12/15 19:31:40 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -111,6 +111,8 @@ struct linux_termios {
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_termios.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_termios.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_termios.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_syscall.h,v 1.36 1998/10/03 20:17:36 christos Exp $ */
|
||||
/* $NetBSD: linux_syscall.h,v 1.37 1998/12/15 19:31:30 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -41,6 +41,8 @@
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <compat/linux/arch/i386/linux_syscall.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_syscall.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_syscall.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_syscallargs.h,v 1.34 1998/10/03 20:17:37 christos Exp $ */
|
||||
/* $NetBSD: linux_syscallargs.h,v 1.35 1998/12/15 19:31:30 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -41,6 +41,8 @@
|
||||
|
||||
#if defined(i386)
|
||||
#include <compat/linux/arch/i386/linux_syscallargs.h>
|
||||
#elif defined(__m68k__)
|
||||
#include <compat/linux/arch/m68k/linux_syscallargs.h>
|
||||
#elif defined(__alpha__)
|
||||
#include <compat/linux/arch/alpha/linux_syscallargs.h>
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_syscalls.c,v 1.34 1998/10/03 20:17:37 christos Exp $ */
|
||||
/* $NetBSD: linux_syscalls.c,v 1.35 1998/12/15 19:31:30 itohy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -40,6 +40,8 @@
|
||||
|
||||
#if defined(__i386__)
|
||||
#include "../../sys/compat/linux/arch/i386/linux_syscalls.c"
|
||||
#elif defined(__m68k__)
|
||||
#include "../../sys/compat/linux/arch/m68k/linux_syscalls.c"
|
||||
#elif defined(__alpha__)
|
||||
#include "../../sys/compat/linux/arch/alpha/linux_syscalls.c"
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user