add build glue for supported emulations

since only linux compat on i386 is installed, only that LKM is actually
installed (LKMs are build for all platforms as appropriate though)
further changes to compat code would need to happen to make this usable
also for other plaforms or emulations
This commit is contained in:
jdolecek 2000-12-08 20:15:11 +00:00
parent e0d4418a25
commit e6c64e055f
24 changed files with 844 additions and 120 deletions

View File

@ -1,21 +1,46 @@
# $NetBSD: Makefile,v 1.5 1997/02/18 15:31:51 scottr Exp $ # $NetBSD: Makefile,v 1.6 2000/12/08 20:15:11 jdolecek Exp $
# # XXX for now, only Linux on i386 was actually tested, others might
# XXX the compat LKMs are currently broken. # need further work; compile stuff on everything, but only install
# # compat_linux on i386
.if 0 .if make(install)
.if (${MACHINE} == "i386") .if (${MACHINE} == "i386")
SUBDIR+= freebsd linux SUBDIR+= linux
.endif
.else # !install
.if (${MACHINE} == "alpha")
SUBDIR+= linux osf1
.endif .endif
.if (${MACHINE} == "sparc") .if (${MACHINE} == "hp300")
SUBDIR+= sunos svr4 SUBDIR+= hpux
.endif
.if (${MACHINE} == "i386")
SUBDIR+= aout freebsd ibcs2 linux svr4
.endif .endif
.if (${MACHINE_ARCH} == "m68k") .if (${MACHINE_ARCH} == "m68k")
SUBDIR+= sunos SUBDIR+= aoutm68k linux sunos svr4
.endif
.endif .endif
.if (${MACHINE_ARCH} == "mipsle" || ${MACHINE_ARCH} == "mipsbe")
SUBDIR+= ultrix
.endif
.if (${MACHINE} == "sparc")
SUBDIR+= aout sunos svr4
.endif
.if (${MACHINE_ARCH} == "sparc64")
SUBDIR+= netbsd32 sunos svr4
.endif
.if (${MACHINE_ARCH} == "vax")
SUBDIR+= ibcs2 ultrix
.endif
.endif # target(install)
.include <bsd.subdir.mk> .include <bsd.subdir.mk>

View File

@ -1,5 +1,20 @@
# $NetBSD: Makefile.inc,v 1.3 1998/03/28 23:58:44 thorpej Exp $ # $NetBSD: Makefile.inc,v 1.4 2000/12/08 20:15:12 jdolecek Exp $
S!= cd ${.CURDIR}/../../..;pwd S!= cd ${.CURDIR}/../../..;pwd
DPSRCS+= assym.h
.if exists($S/arch/${MACHINE}/${MACHINE}/genassym.cf)
GENASSYM_DIR?= $S/arch/${MACHINE}/${MACHINE}
.elif exists($S/arch/${MACHINE_ARCH}/${MACHINE_ARCH}/genassym.cf)
GENASSYM_DIR?= $S/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
.else
GENASSYM_DIR?=
.endif
assym.h: ${S}/kern/genassym.sh ${GENASSYM_DIR}/genassym.cf
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
< ${GENASSYM_DIR}/genassym.cf > assym.h.tmp && \
mv -f assym.h.tmp assym.h
.include "../Makefile.inc" .include "../Makefile.inc"

View File

@ -0,0 +1,19 @@
# $NetBSD: Makefile,v 1.1 2000/12/08 20:15:13 jdolecek Exp $
.include "../Makefile.inc"
.PATH: $S/compat/aout
CPPFLAGS+= -DVM86 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_AOUT
CPPFLAGS+= -nostdinc
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D_KERNEL \
-I. -I${S}
MKMAN= no
KMOD= compat_aout
SRCS= lkminit_emul.c
SRCS+= aout_exec.c aout_misc.c aout_syscalls.c aout_sysent.c
.include <bsd.kmod.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: lkminit_linux.c,v 1.4 1997/05/19 22:11:17 jtc Exp $ */ /* $NetBSD: lkminit_emul.c,v 1.1 2000/12/08 20:15:13 jdolecek Exp $ */
/*- /*-
* Copyright (c) 1996 The NetBSD Foundation, Inc. * Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -42,71 +42,42 @@
#include <sys/conf.h> #include <sys/conf.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/exec.h> #include <sys/exec.h>
#include <sys/exec_elf.h> #include <sys/exec_aout.h>
#include <sys/lkm.h> #include <sys/lkm.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/errno.h> #include <sys/errno.h>
#include <sys/proc.h>
#include <machine/cpu.h>
#include <machine/reg.h>
#include <compat/linux/linux_exec.h>
extern int exec_linux_aout_makecmds();
extern struct emul *emul_linux_elf;
extern struct emul *emul_linux_aout;
extern struct emul _emul_linux_elf;
extern struct emul _emul_linux_aout;
struct execsw linux_lkm_execsw = {
LINUX_AOUT_HDR_SIZE, exec_linux_aout_makecmds,
};
/* /*
* declare the filesystem * This module is different to other compat modules - it adds the
* execsw[] entry as well. As the compat_aout is emulation more of
* executable format support, it's probably better to be placed here\
* than under lkm/exec/.
*/ */
MOD_EXEC("compat_linux", -1, &linux_lkm_execsw);
extern const struct emul emul_netbsd_aout;
int compat_aout_lkmentry __P((struct lkm_table *, int, int));
static struct execsw exec_netbsd_aout =
{ sizeof(struct exec), exec_aout_makecmds, { NULL },
&emul_netbsd_aout,
EXECSW_PRIO_FIRST, /* Note: this differs from exec_conf.c entry */
0, copyargs, setregs }; /* a.out binaries */
/*
* declare the executable format
*/
MOD_EXEC("compat_aout", -1, &exec_netbsd_aout, "aout");
/* /*
* entry point * entry point
*/ */
int int
compat_linux_lkmentry(lkmtp, cmd, ver) compat_aout_lkmentry(lkmtp, cmd, ver)
struct lkm_table *lkmtp; struct lkm_table *lkmtp;
int cmd; int cmd;
int ver; int ver;
{ {
DISPATCH(lkmtp, cmd, ver, DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
compat_linux_lkmload,
compat_linux_lkmunload,
lkm_nofunc);
}
int
compat_linux_lkmload(lkmtp, cmd)
struct lkm_table *lkmtp;
int cmd;
{
if (elf_probe_funcs_insert(linux_elf32_probe))
return 1; /* Failure! */
emul_linux_aout = &_emul_linux_aout;
emul_linux_elf = &_emul_linux_elf;
return 0;
}
/*
* Note that it is NOT safe to unload this at all...
*/
int
compat_linux_lkmunload(lkmtp, cmd)
struct lkm_table *lkmtp;
int cmd;
{
if (elf_probe_funcs_insert(linux_elf32_probe))
return 1; /* Failure! */
emul_linux_aout = NULL;
emul_linux_elf = NULL;
return 0;
} }

View File

@ -0,0 +1,21 @@
# $NetBSD: Makefile,v 1.1 2000/12/08 20:15:13 jdolecek Exp $
.include "../Makefile.inc"
.PATH: $S/compat/aoutm68k
CPPFLAGS+= -DVM86 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_AOUT_M68K \
-DCOMPAT_43
CPPFLAGS+= -nostdinc
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D_KERNEL \
-I. -I${S}
MKMAN= no
KMOD= compat_aoutm68k
SRCS= lkminit_emul.c
SRCS+= aoutm68k_exec.c aoutm68k_ioctl.c aoutm68k_misc.c aoutm68k_stat.c \
aoutm68k_syscalls.c aoutm68k_sysent.c
.include <bsd.kmod.mk>

View File

@ -0,0 +1,83 @@
/* $NetBSD: lkminit_emul.c,v 1.1 2000/12/08 20:15:14 jdolecek Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Michael Graff <explorer@flame.org>.
*
* 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 the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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/ioctl.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/exec.h>
#include <sys/exec_aout.h>
#include <sys/lkm.h>
#include <sys/file.h>
#include <sys/errno.h>
#include <sys/proc.h>
/*
* This module is different to other compat modules - it adds the
* execsw[] entry as well. As the compat_aoutm68k is emulation more of
* executable format support, it's probably better to be placed here
* than under lkm/exec/.
*/
extern const struct emul emul_netbsd_aoutm68k;
int compat_aoutm68k_lkmentry __P((struct lkm_table *, int, int));
static struct execsw exec_netbsd_aoutm68k =
{ sizeof(struct exec), exec_aout_makecmds, { NULL },
&emul_netbsd_aoutm68k,
EXECSW_PRIO_FIRST, /* Note: this differs from exec_conf.c entry */
0, copyargs, setregs }; /* a.out binaries */
/*
* declare the executable format
*/
MOD_EXEC("compat_aoutm68k", -1, &exec_netbsd_aoutm68k, "aoutm68k");
/*
* entry point
*/
int
compat_aoutm68k_lkmentry(lkmtp, cmd, ver)
struct lkm_table *lkmtp;
int cmd;
int ver;
{
DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
}

View File

@ -1,20 +1,27 @@
# $NetBSD: Makefile,v 1.6 1999/02/13 02:54:52 lukem Exp $ # $NetBSD: Makefile,v 1.7 2000/12/08 20:15:14 jdolecek Exp $
.include "../Makefile.inc" .include "../Makefile.inc"
.PATH: $S/compat/freebsd $S/arch/i386/i386 .PATH: $S/compat/freebsd
CPPFLAGS+= -DVM86 CPPFLAGS+= -DVM86 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_FREEBSD
CPPFLAGS+= -nostdinc
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE \
-I. -I${S}
MKMAN= no MKMAN= no
KMOD= compat_freebsd KMOD= compat_freebsd
SRCS= freebsd_exec.c freebsd_misc.c freebsd_sysent.c freebsd_file.c # common source files
SRCS+= freebsd_ptrace.c freebsd_ioctl.c freebsd_syscalls.c SRCS= lkminit_emul.c
SRCS+= freebsd_exec.c freebsd_file.c freebsd_ioctl.c freebsd_ipc.c \
freebsd_misc.c freebsd_ptrace.c freebsd_syscalls.c freebsd_sysent.c
SRCS+= freebsd_machdep.c # MD source files
.if ${MACHINE} == "i386"
SRCS+= lkminit_emul.c .PATH: $S/arch/i386/i386
SRCS+= freebsd_machdep.c freebsd_sigcode.s
.endif
.include <bsd.kmod.mk> .include <bsd.kmod.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: lkminit_emul.c,v 1.2 1997/05/19 22:11:12 jtc Exp $ */ /* $NetBSD: lkminit_emul.c,v 1.3 2000/12/08 20:15:14 jdolecek Exp $ */
/*- /*-
* Copyright (c) 1996 The NetBSD Foundation, Inc. * Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -46,18 +46,13 @@
#include <sys/file.h> #include <sys/file.h>
#include <sys/errno.h> #include <sys/errno.h>
#include <compat/freebsd/freebsd_exec.h> extern const struct emul emul_freebsd;
int compat_freebsd_lkmentry __P((struct lkm_table *, int, int));
extern int exec_freebsd_aout_makecmds();
struct execsw freebsd_lkm_execsw = {
FREEBSD_AOUT_HDR_SIZE, exec_freebsd_aout_makecmds,
};
/* /*
* declare the filesystem * declare the emulation
*/ */
MOD_EXEC("freebsd", -1, &freebsd_lkm_execsw); MOD_COMPAT("freebsd", -1, &emul_freebsd);
/* /*
* entry point * entry point

View File

@ -0,0 +1,26 @@
# $NetBSD: Makefile,v 1.1 2000/12/08 20:15:15 jdolecek Exp $
.include "../Makefile.inc"
.PATH: $S/compat/hpux $S/arch/${MACHINE}/${MACHINE}
CPPFLAGS+= -DVM86 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_HPUX
CPPFLAGS+= -nostdinc
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D_KERNEL \
-I. -I${S}
MKMAN= no
KMOD= compat_hpux
# common source files
SRCS= lkminit_emul.c
SRCS+= hpux_compat.c hpux_errno.c hpux_exec.c hpux_file.c hpux_ipc.c \
hpux_net.c hpux_sig.c hpux_syscalls.c hpux_sysent.c hpux_tty.c
SRCS+= hpux_machdep.c
# MD source files
.if ${MACHINE} == "hp300"
.endif
.include <bsd.kmod.mk>

View File

@ -0,0 +1,68 @@
/* $NetBSD: lkminit_emul.c,v 1.1 2000/12/08 20:15:15 jdolecek Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Michael Graff <explorer@flame.org>.
*
* 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 the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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/ioctl.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/exec.h>
#include <sys/lkm.h>
#include <sys/file.h>
#include <sys/errno.h>
extern const struct emul emul_hpux;
int compat_hpux_lkmentry __P((struct lkm_table *, int, int));
/*
* declare the emulation
*/
MOD_COMPAT("hpux", -1, &emul_hpux);
/*
* entry point
*/
int
compat_hpux_lkmentry(lkmtp, cmd, ver)
struct lkm_table *lkmtp;
int cmd;
int ver;
{
DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
}

View File

@ -0,0 +1,26 @@
# $NetBSD: Makefile,v 1.1 2000/12/08 20:15:15 jdolecek Exp $
.include "../Makefile.inc"
.PATH: $S/compat/ibcs2 $S/arch/${MACHINE}/${MACHINE}
CPPFLAGS+= -DCOMPAT_SVR4 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DSVR4_COMPAT_SOLARIS2
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE \
-I. -I${S}
MKMAN= no
KMOD= compat_ibcs2
# common source files
SRCS+= lkminit_emul.c
SRCS+= ibcs2_errno.c ibcs2_exec.c ibcs2_fcntl.c ibcs2_ioctl.c ibcs2_ipc.c \
ibcs2_misc.c ibcs2_signal.c ibcs2_socksys.c ibcs2_stat.c \
ibcs2_syscalls.c ibcs2_sysent.c
# MD source
.if ${MACHINE} == "i386"
.PATH: $S/arch/i386/i386
SRCS+= ibcs2_sigcode.s ibcs2_machdep.c ibcs2_syscall.c
.endif
.include <bsd.kmod.mk>

View File

@ -0,0 +1,66 @@
/* $NetBSD: lkminit_emul.c,v 1.1 2000/12/08 20:15:16 jdolecek Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Michael Graff <explorer@flame.org>.
*
* 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 the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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/ioctl.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/proc.h>
#include <sys/lkm.h>
extern const struct emul emul_ibcs2;
int compat_ibcs2_lkmentry __P((struct lkm_table *, int, int));
/*
* declare the emulation
*/
MOD_COMPAT("ibcs2", -1, &emul_ibcs2);
/*
* entry point
*/
int
compat_ibcs2_lkmentry(lkmtp, cmd, ver)
struct lkm_table *lkmtp;
int cmd;
int ver;
{
DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
}

View File

@ -1,21 +1,61 @@
# $NetBSD: Makefile,v 1.6 1999/02/13 02:54:52 lukem Exp $ # $NetBSD: Makefile,v 1.7 2000/12/08 20:15:16 jdolecek Exp $
.include "../Makefile.inc" .include "../Makefile.inc"
.PATH: $S/compat/linux $S/arch/i386/i386 .PATH: $S/compat/linux/arch/${MACHINE_ARCH}
.PATH: $S/compat/linux/common $S/compat/linux
.PATH: $S/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
CPPFLAGS+= -DVM86 -DNVT=1 -DEXEC_ELF32 CPPFLAGS+= -DNWSDISPLAY=1 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_LINUX
CPPFLAGS+= -nostdinc -DKTRACE -DNSEQUENCER=1
# compat_util.c symbol redifinitions
CPPFLAGS+= -Demul_find=linux_emul_find -Dstackgap_init=linux_stackgap_init\
-Demul_flags_translate=linux_emul_flags_translate \
-Dstackgap_alloc=linux_stackgap_alloc \
-Dcompat_offseterr=linux_compat_offseterr
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D_KERNEL \
-I. -I${S} -DCOMPAT_LINUX -D_LKM
MKMAN= no MKMAN= no
KMOD= compat_linux KMOD= compat_linux
SRCS= linux_audio.c linux_misc.c linux_error.c linux_signal.c # common source
SRCS+= linux_exec.c linux_socket.c linux_file.c linux_syscalls.c SRCS+= lkminit_emul.c
SRCS+= linux_ioctl.c linux_sysent.c linux_ipc.c linux_termios.c SRCS+= linux_cdrom.c linux_errno.c linux_exec.c linux_file.c \
linux_ioctl.c linux_ipc.c linux_misc.c linux_olduname.c linux_pipe.c \
linux_sched.c linux_sigaction.c linux_sigarray.c linux_signal.c \
linux_socket.c linux_termios.c linux_uselib.c
SRCS+= linux_machdep.c linux_syscalls.c linux_sysent.c
SRCS+= linux_machdep.c # emul_find() and friends - symbols are redefined to linux_FOO()
.PATH: $S/compat/common
SRCS+= compat_util.c
SRCS+= lkminit_linux.c # XXXX - temporary, not applicable for kernel with COMPAT_43, OSSAUDIO
#.PATH: $S/compat/common $S/compat/ossaudio
#SRCS+= uipc_syscalls_43.c vfs_syscalls_43.c kern_resource_43.c \
# kern_info_43.c ossaudio.c
# architecture or machine dependant files
.if ${MACHINE} == "i386"
SRCS+= linux_break.c linux_llseek.c linux_misc_notalpha.c linux_oldolduname.c \
linux_oldselect.c linux_sig_notalpha.c linux_socketcall.c \
linux_ipccall.c linux_oldmmap.c
SRCS+= linux_ptrace.c linux_syscall.c
SRCS+= linux_sigcode.s
.endif
.if ${MACHINE_ARCH} == "m68k"
SRCS+= linux_ipccall.c linux_llseek.c linux_misc_notalpha.c \
linux_oldolduname.c linux_oldselect.c linux_sig_notalpha.c \
linux_ipccall.c linux_socketcall.c linux_oldmmap.c
SRCS+= linux_sig_machdep.S
.endif
.if ${MACHINE_ARCH} == "alpha"
CPPFLAGS+= -Dalpha
SRCS+= linux_sigcode.s
.endif
.include <bsd.kmod.mk> .include <bsd.kmod.mk>

View File

@ -0,0 +1,65 @@
/* $NetBSD: lkminit_emul.c,v 1.1 2000/12/08 20:15:16 jdolecek Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Michael Graff <explorer@flame.org>.
*
* 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 the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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>
#include <sys/conf.h>
#include <sys/exec.h>
#include <sys/proc.h>
#include <sys/lkm.h>
extern const struct emul emul_linux;
int compat_linux_lkmentry __P((struct lkm_table *, int, int));
/*
* declare the emulation
*/
MOD_COMPAT("compat_linux", -1, &emul_linux);
/*
* entry point
*/
int
compat_linux_lkmentry(lkmtp, cmd, ver)
struct lkm_table *lkmtp;
int cmd;
int ver;
{
DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
}

View File

@ -0,0 +1,25 @@
# $NetBSD: Makefile,v 1.1 2000/12/08 20:15:17 jdolecek Exp $
.include "../Makefile.inc"
.PATH: $S/compat/netbsd32 $S/arch/${MACHINE}/${MACHINE}
CPPFLAGS+= -DVM86 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_NETBSD32
CPPFLAGS+= -DCOMPAT_12 -DCOMPAT_43
CPPFLAGS+= -DEXEC_AOUT -DEXEC_ELF32 # for netbsd32_exec.c
CPPFLAGS+= -nostdinc
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D_KERNEL \
-I. -I${S}
MKMAN= no
KMOD= compat_netbsd32
# common source files
SRCS+= lkminit_emul.c
SRCS+= netbsd32_compat_09.c netbsd32_compat_10.c netbsd32_compat_12.c \
netbsd32_compat_13.c netbsd32_compat_14.c netbsd32_compat_43.c \
netbsd32_netbsd.c netbsd32_syscalls.c netbsd32_sysent.c \
netbsd32_ioctl.c
.include <bsd.kmod.mk>

View File

@ -0,0 +1,68 @@
/* $NetBSD: lkminit_emul.c,v 1.1 2000/12/08 20:15:18 jdolecek Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Michael Graff <explorer@flame.org>.
*
* 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 the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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/ioctl.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/exec.h>
#include <sys/lkm.h>
#include <sys/file.h>
#include <sys/errno.h>
extern const struct emul emul_netbsd32;
int compat_netbsd32_lkmentry __P((struct lkm_table *, int, int));
/*
* declare the emulation
*/
MOD_COMPAT("netbsd32", -1, &emul_netbsd32);
/*
* entry point
*/
int
compat_netbsd32_lkmentry(lkmtp, cmd, ver)
struct lkm_table *lkmtp;
int cmd;
int ver;
{
DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
}

View File

@ -0,0 +1,29 @@
# $NetBSD: Makefile,v 1.1 2000/12/08 20:15:18 jdolecek Exp $
.include "../Makefile.inc"
.PATH: $S/compat/osf1 $S/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
CPPFLAGS+= -DVM86 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_OSF1
CPPFLAGS+= -nostdinc
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D_KERNEL \
-I. -I${S}
MKMAN= no
KMOD= compat_osf1
# common source files
SRCS= lkminit_emul.c
SRCS+= osf1_cvt.c osf1_cvt_errno.c osf1_cvt_signal.c osf1_descrip.c \
osf1_exec.c osf1_file.c osf1_generic.c osf1_ioctl.c osf1_misc.c \
osf1_mmap.c osf1_mount.c osf1_prot.c osf1_resource.c osf1_signal.c \
osf1_socket.c osf1_syscalls.c osf1_sysent.c osf1_sysv_ipc.c \
osf1_time.c
# MD source files
.if ${MACHINE_ARCH} == "alpha"
SRCS+= osf1_locore.s
.endif
.include <bsd.kmod.mk>

View File

@ -0,0 +1,68 @@
/* $NetBSD: lkminit_emul.c,v 1.1 2000/12/08 20:15:19 jdolecek Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Michael Graff <explorer@flame.org>.
*
* 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 the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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/ioctl.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/exec.h>
#include <sys/lkm.h>
#include <sys/file.h>
#include <sys/errno.h>
extern const struct emul_osf1;
int compat_osf1_lkmentry __P((struct lkm_table *, int, int));
/*
* declare the emulation
*/
MOD_COMPAT("osf1", -1, &emul_osf1);
/*
* entry point
*/
int
compat_osf1_lkmentry(lkmtp, cmd, ver)
struct lkm_table *lkmtp;
int cmd;
int ver;
{
DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
}

View File

@ -1,13 +1,23 @@
# $NetBSD: Makefile,v 1.4 1999/02/13 02:54:52 lukem Exp $ # $NetBSD: Makefile,v 1.5 2000/12/08 20:15:19 jdolecek Exp $
.include "../Makefile.inc" .include "../Makefile.inc"
.PATH: $S/compat/sunos $S/arch/${MACHINE_ARCH}/${MACHINE_ARCH} .PATH: $S/compat/sunos $S/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
CPPFLAGS+= -DCOMPAT_SUNOS CPPFLAGS+= -DCOMPAT_SUNOS -DSYSVSEM -DSYSVMSG -DSYSVSHM -nostdinc
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE \
-I. -I${S}
MKMAN= no MKMAN= no
KMOD= compat_sunos KMOD= compat_sunos
SRCS= sunos_exec.c sunos_ioctl.c sunos_misc.c sunos_syscalls.c \
sunos_sysent.c sunos_machdep.c lkminit_emul.c # common source files
SRCS+= lkminit_emul.c
SRCS+= sunos_exec.c sunos_ioctl.c sunos_misc.c sunos_syscalls.c sunos_sysent.c
# MD files
.if ${MACHINE_ARCH} == "m68k"
SRCS+= sunos_sigcode.s
.endif
.include <bsd.kmod.mk> .include <bsd.kmod.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: lkminit_emul.c,v 1.2 1997/05/19 22:11:19 jtc Exp $ */ /* $NetBSD: lkminit_emul.c,v 1.3 2000/12/08 20:15:19 jdolecek Exp $ */
/*- /*-
* Copyright (c) 1996 The NetBSD Foundation, Inc. * Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -36,21 +36,19 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <sys/param.h> #include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/conf.h> #include <sys/conf.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/exec.h>
#include <sys/lkm.h> #include <sys/lkm.h>
#include <sys/file.h>
#include <sys/errno.h>
struct execsw sunos_lkm_execsw = { sizeof(struct exec), exec_aout_makecmds }; extern const struct emul emul_sunos;
int compat_sunos_lkmentry __P((struct lkm_table *, int, int));
/* /*
* declare the filesystem * declare the emulation
*/ */
MOD_EXEC("sunos", -1, &sunos_lkm_execsw); MOD_COMPAT("sunos", -1, &emul_sunos);
/* /*
* entry point * entry point

View File

@ -1,15 +1,26 @@
# $NetBSD: Makefile,v 1.3 1999/02/13 02:54:52 lukem Exp $ # $NetBSD: Makefile,v 1.4 2000/12/08 20:15:19 jdolecek Exp $
.include "../Makefile.inc" .include "../Makefile.inc"
.PATH: $S/compat/svr4 $S/arch/${MACHINE}/${MACHINE} .PATH: $S/compat/svr4 $S/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
CPPFLAGS+= -DCOMPAT_SVR4 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DSVR4_COMPAT_SOLARIS2
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE \
-I. -I${S}
CPPFLAGS+= -DCOMPAT_SVR4
MKMAN= no MKMAN= no
KMOD= compat_svr4 KMOD= compat_svr4
SRCS= svr4_error.c svr4_exec.c svr4_fcntl.c svr4_filio.c svr4_ioctl.c \
svr4_ipc.c svr4_misc.c svr4_net.c svr4_signal.c svr4_socket.c \ # common source files
svr4_sockio.c svr4_stat.c svr4_stream.c svr4_syscalls.c svr4_sysent.c \ SRCS+= lkminit_emul.c
svr4_termios.c svr4_ttold.c svr4_machdep.o SRCS+= svr4_errno.c svr4_exec.c svr4_fcntl.c svr4_filio.c svr4_ioctl.c \
svr4_ipc.c svr4_lwp.c svr4_misc.c svr4_net.c svr4_resource.c \
svr4_signal.c svr4_socket.c svr4_sockio.c svr4_stat.c svr4_stream.c \
svr4_syscalls.c svr4_sysent.c svr4_termios.c svr4_ttold.c
SRCS+= svr4_machdep.c
.if ${MACHINE} == "i386"
SRCS+= svr4_sigcode.s
.endif
.include <bsd.kmod.mk> .include <bsd.kmod.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: lkminit_emul.c,v 1.2 1997/05/19 22:11:22 jtc Exp $ */ /* $NetBSD: lkminit_emul.c,v 1.3 2000/12/08 20:15:20 jdolecek Exp $ */
/*- /*-
* Copyright (c) 1996 The NetBSD Foundation, Inc. * Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -40,22 +40,17 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/conf.h> #include <sys/conf.h>
#include <sys/mount.h> #include <sys/proc.h>
#include <sys/exec.h>
#include <sys/lkm.h> #include <sys/lkm.h>
#include <sys/file.h>
#include <sys/errno.h>
#include <compat/svr4/svr4_exec.h> extern const struct emul emul_svr4;
struct execsw svr4_lkm_execsw = { ELF_HDR_SIZE, exec_elf_makecmds };
int compat_svr4_lkmentry __P((struct lkm_table *, int, int));
/* /*
* declare the filesystem * declare the emulation
*/ */
MOD_EXEC("svr4", -1, &svr4_lkm_execsw); MOD_COMPAT("svr4", -1, &emul_svr4);
/* /*
* entry point * entry point

View File

@ -0,0 +1,25 @@
# $NetBSD: Makefile,v 1.1 2000/12/08 20:15:20 jdolecek Exp $
.include "../Makefile.inc"
.PATH: $S/compat/ultrix $S/arch/${MACHINE}/${MACHINE}
CPPFLAGS+= -DVM86 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_ULTRIX
CPPFLAGS+= -nostdinc
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D_KERNEL \
-I. -I${S}
MKMAN= no
KMOD= compat_ultrix
# common source files
SRCS+= lkminit_emul.c
SRCS+= ultrix_fs.c ultrix_ioctl.c ultrix_misc.c ultrix_pathname.c \
ultrix_syscalls.c ultrix_sysent.c
.if ${MACHINE_ARCH} == "mips"
CPPFLAGS+= -DMIPS1 -DMIPS3
.endif
.include <bsd.kmod.mk>

View File

@ -0,0 +1,68 @@
/* $NetBSD: lkminit_emul.c,v 1.1 2000/12/08 20:15:20 jdolecek Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Michael Graff <explorer@flame.org>.
*
* 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 the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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/ioctl.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/exec.h>
#include <sys/lkm.h>
#include <sys/file.h>
#include <sys/errno.h>
extern const struct emul emul_ultrix;
int compat_ultrix_lkmentry __P((struct lkm_table *, int, int));
/*
* declare the emulation
*/
MOD_COMPAT("ultrix", -1, &emul_ultrix);
/*
* entry point
*/
int
compat_ultrix_lkmentry(lkmtp, cmd, ver)
struct lkm_table *lkmtp;
int cmd;
int ver;
{
DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
}