Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/lkm/exec add build glue for exec LKMs
details: https://anonhg.NetBSD.org/src/rev/ef1155e092c9
branches: trunk
changeset: 500246:ef1155e092c9
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Dec 08 23:05:33 2000 +0000
description:
add build glue for exec LKMs
for now, only i386 linux_elf is actually installed, since the others have
not been tested yet
diffstat:
sys/lkm/exec/Makefile | 42 ++++++++++++++++
sys/lkm/exec/Makefile.inc | 5 +
sys/lkm/exec/freebsd_aout/Makefile | 16 ++++++
sys/lkm/exec/freebsd_aout/lkminit_exec.c | 76 +++++++++++++++++++++++++++++
sys/lkm/exec/freebsd_elf/Makefile | 16 ++++++
sys/lkm/exec/freebsd_elf/lkminit_exec.c | 80 +++++++++++++++++++++++++++++++
sys/lkm/exec/hpux_aout/Makefile | 16 ++++++
sys/lkm/exec/hpux_aout/lkminit_exec.c | 75 +++++++++++++++++++++++++++++
sys/lkm/exec/ibcs2_coff/Makefile | 16 ++++++
sys/lkm/exec/ibcs2_coff/lkminit_exec.c | 75 +++++++++++++++++++++++++++++
sys/lkm/exec/ibcs2_elf/Makefile | 16 ++++++
sys/lkm/exec/ibcs2_elf/lkminit_exec.c | 79 ++++++++++++++++++++++++++++++
sys/lkm/exec/ibcs2_xout/Makefile | 16 ++++++
sys/lkm/exec/ibcs2_xout/lkminit_exec.c | 74 ++++++++++++++++++++++++++++
sys/lkm/exec/linux_aout/Makefile | 16 ++++++
sys/lkm/exec/linux_aout/lkminit_exec.c | 75 +++++++++++++++++++++++++++++
sys/lkm/exec/linux_elf/Makefile | 30 +++++++++++
sys/lkm/exec/linux_elf/lkminit_exec.c | 80 +++++++++++++++++++++++++++++++
sys/lkm/exec/m68k4k/Makefile | 16 ++++++
sys/lkm/exec/m68k4k/lkminit_exec.c | 73 ++++++++++++++++++++++++++++
sys/lkm/exec/netbsd32_aout/Makefile | 16 ++++++
sys/lkm/exec/netbsd32_aout/lkminit_exec.c | 74 ++++++++++++++++++++++++++++
sys/lkm/exec/netbsd32_elf/Makefile | 16 ++++++
sys/lkm/exec/netbsd32_elf/lkminit_exec.c | 79 ++++++++++++++++++++++++++++++
sys/lkm/exec/osf1_ecoff/Makefile | 16 ++++++
sys/lkm/exec/osf1_ecoff/lkminit_exec.c | 78 ++++++++++++++++++++++++++++++
sys/lkm/exec/sunos_aout/Makefile | 16 ++++++
sys/lkm/exec/sunos_aout/lkminit_exec.c | 73 ++++++++++++++++++++++++++++
sys/lkm/exec/svr4_elf/Makefile | 16 ++++++
sys/lkm/exec/svr4_elf/lkminit_exec.c | 79 ++++++++++++++++++++++++++++++
sys/lkm/exec/ultrix_ecoff/Makefile | 21 ++++++++
sys/lkm/exec/ultrix_ecoff/lkminit_exec.c | 75 +++++++++++++++++++++++++++++
sys/lkm/exec/vax1k/Makefile | 16 ++++++
sys/lkm/exec/vax1k/lkminit_exec.c | 73 ++++++++++++++++++++++++++++
34 files changed, 1540 insertions(+), 0 deletions(-)
diffs (truncated from 1676 to 300 lines):
diff -r fb2adc5dac65 -r ef1155e092c9 sys/lkm/exec/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/lkm/exec/Makefile Fri Dec 08 23:05:33 2000 +0000
@@ -0,0 +1,42 @@
+# $NetBSD: Makefile,v 1.1 2000/12/08 23:05:33 jdolecek Exp $
+
+# XXX only linux_elf is actually tested for now; build LKMs on all platforms
+# as appropriate, but only install linux_elf on i386
+.if make(install)
+.if ${MACHINE} == "i386"
+SUBDIR+= linux_elf
+.endif
+.else # !make(install)
+
+.if ${MACHINE} == "alpha"
+SUBDIR+= linux_aout linux_elf osf1_ecoff
+.endif
+
+.if ${MACHINE} == "hp300"
+SUBDIR+= hpux_aout
+.endif
+
+.if ${MACHINE} == "i386"
+SUBDIR+= ibcs2_coff ibcs2_elf ibcs2_xout linux_aout linux_elf
+SUBDIR+= freebsd_aout freebsd_elf svr4_elf
+.endif
+
+.if ${MACHINE_ARCH} == "m68k"
+SUBDIR+= linux_aout linux_elf sunos_aout m68k4k
+.endif
+
+.if ${MACHINE_ARCH} == "sparc"
+SUBDIR+= svr4_elf
+.endif
+
+.if ${MACHINE_ARCH} == "sparc64"
+SUBDIR+= netbsd32_aout netbsd32_elf
+.endif
+
+.if ${MACHINE_ARCH} == "vax"
+SUBDIR+= vax1k
+.endif
+
+.endif # !make(install)
+
+.include <bsd.kinc.mk>
diff -r fb2adc5dac65 -r ef1155e092c9 sys/lkm/exec/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/lkm/exec/Makefile.inc Fri Dec 08 23:05:33 2000 +0000
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile.inc,v 1.1 2000/12/08 23:05:33 jdolecek Exp $
+
+S!= cd ${.CURDIR}/../../..;pwd
+
+.include "../Makefile.inc"
diff -r fb2adc5dac65 -r ef1155e092c9 sys/lkm/exec/freebsd_aout/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/lkm/exec/freebsd_aout/Makefile Fri Dec 08 23:05:33 2000 +0000
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1 2000/12/08 23:05:34 jdolecek Exp $
+
+.include "../Makefile.inc"
+
+.PATH: $S/compat/freebsd
+
+CPPFLAGS+= -nostdinc -I$S -D_KERNEL -DEXEC_AOUT
+
+MKMAN= no
+
+KMOD= exec_freebsd_aout
+
+SRCS= lkminit_exec.c
+SRCS+= freebsd_exec_aout.c
+
+.include <bsd.kmod.mk>
diff -r fb2adc5dac65 -r ef1155e092c9 sys/lkm/exec/freebsd_aout/lkminit_exec.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/lkm/exec/freebsd_aout/lkminit_exec.c Fri Dec 08 23:05:33 2000 +0000
@@ -0,0 +1,76 @@
+/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:35 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@localhost>.
+ *
+ * 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/exec_aout.h>
+#include <sys/exec_elf.h>
+#include <sys/proc.h>
+#include <sys/lkm.h>
+
+#include <compat/freebsd/freebsd_exec.h>
+
+int exec_freebsd_aout_lkmentry __P((struct lkm_table *, int, int));
+
+static struct execsw exec_freebsd_aout =
+ { FREEBSD_AOUT_HDR_SIZE, exec_freebsd_aout_makecmds, { NULL },
+ NULL, EXECSW_PRIO_ANY,
+ 0, copyargs, freebsd_setregs }; /* a.out */
+
+
+/*
+ * declare the exec
+ */
+MOD_EXEC("exec_freebsd_aout", -1, &exec_freebsd_aout, "freebsd");
+
+/*
+ * entry point
+ */
+int
+exec_freebsd_aout_lkmentry(lkmtp, cmd, ver)
+ struct lkm_table *lkmtp;
+ int cmd;
+ int ver;
+{
+ DISPATCH(lkmtp, cmd, ver,
+ lkm_nofunc,
+ lkm_nofunc,
+ lkm_nofunc);
+}
diff -r fb2adc5dac65 -r ef1155e092c9 sys/lkm/exec/freebsd_elf/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/lkm/exec/freebsd_elf/Makefile Fri Dec 08 23:05:33 2000 +0000
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1 2000/12/08 23:05:35 jdolecek Exp $
+
+.include "../Makefile.inc"
+
+.PATH: $S/compat/freebsd
+
+CPPFLAGS+= -nostdinc -I$S -D_KERNEL -DEXEC_ELF32
+
+MKMAN= no
+
+KMOD= exec_freebsd_elf
+
+SRCS= lkminit_exec.c
+SRCS+= freebsd_exec_elf32.c
+
+.include <bsd.kmod.mk>
diff -r fb2adc5dac65 -r ef1155e092c9 sys/lkm/exec/freebsd_elf/lkminit_exec.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/lkm/exec/freebsd_elf/lkminit_exec.c Fri Dec 08 23:05:33 2000 +0000
@@ -0,0 +1,80 @@
+/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:36 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@localhost>.
+ *
+ * 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>
+
+#include <machine/elf_machdep.h>
+#define ELFSIZE 32
+#include <sys/exec_elf.h>
+
+#include <compat/freebsd/freebsd_exec.h>
+
+int exec_freebsd_elf_lkmentry __P((struct lkm_table *, int, int));
+
+static struct execsw exec_freebsd_elf =
+ { sizeof (Elf32_Ehdr), exec_elf32_makecmds,
+ { elf_probe_func: ELFNAME2(freebsd,probe) },
+ NULL, EXECSW_PRIO_ANY,
+ FREEBSD_ELF_AUX_ARGSIZ,
+ elf32_copyargs, setregs }; /* FreeBSD 32bit ELF bins (not 64bit safe )*/
+
+
+/*
+ * declare the exec
+ */
+MOD_EXEC("exec_freebsd_elf", -1, &exec_freebsd_elf, "freebsd");
+
+/*
+ * entry point
+ */
+int
+exec_freebsd_elf_lkmentry(lkmtp, cmd, ver)
+ struct lkm_table *lkmtp;
+ int cmd;
+ int ver;
+{
+ DISPATCH(lkmtp, cmd, ver,
+ lkm_nofunc,
+ lkm_nofunc,
+ lkm_nofunc);
+}
diff -r fb2adc5dac65 -r ef1155e092c9 sys/lkm/exec/hpux_aout/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/lkm/exec/hpux_aout/Makefile Fri Dec 08 23:05:33 2000 +0000
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1 2000/12/08 23:05:36 jdolecek Exp $
+
+.include "../Makefile.inc"
+
+.PATH: $S/compat/hpux
+
+CPPFLAGS+= -nostdinc -I$S -D_KERNEL -DEXEC_AOUT
+
+MKMAN= no
+
+KMOD= exec_hpux_aout
+
+SRCS= lkminit_exec.c
+SRCS+= hpux_exec_aout.c
+
+.include <bsd.kmod.mk>
diff -r fb2adc5dac65 -r ef1155e092c9 sys/lkm/exec/hpux_aout/lkminit_exec.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/lkm/exec/hpux_aout/lkminit_exec.c Fri Dec 08 23:05:33 2000 +0000
@@ -0,0 +1,75 @@
+/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:36 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@localhost>.
+ *
+ * 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.
Home |
Main Index |
Thread Index |
Old Index