Source-Changes-HG archive

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

[src/trunk]: src/sys/lkm/exec/svr4_elf port this to sparc64.



details:   https://anonhg.NetBSD.org/src/rev/dd72983ba621
branches:  trunk
changeset: 512868:dd72983ba621
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Jul 18 16:53:34 2001 +0000

description:
port this to sparc64.

diffstat:

 sys/lkm/exec/svr4_elf/Makefile       |  12 +++++++++---
 sys/lkm/exec/svr4_elf/lkminit_exec.c |  12 +++++++++++-
 2 files changed, 20 insertions(+), 4 deletions(-)

diffs (68 lines):

diff -r 2ef525e989c3 -r dd72983ba621 sys/lkm/exec/svr4_elf/Makefile
--- a/sys/lkm/exec/svr4_elf/Makefile    Wed Jul 18 16:51:39 2001 +0000
+++ b/sys/lkm/exec/svr4_elf/Makefile    Wed Jul 18 16:53:34 2001 +0000
@@ -1,16 +1,22 @@
-#      $NetBSD: Makefile,v 1.1 2000/12/08 23:05:47 jdolecek Exp $
+#      $NetBSD: Makefile,v 1.2 2001/07/18 16:53:34 mrg Exp $
 
 .include "../Makefile.inc"
 
+.if ${MACHINE} == sparc64 && ${MACHINE_ARCH} == sparc64
+ELFSIZE=64
+.else
+ELFSIZE=32
+.endif
+
 .PATH: $S/compat/svr4
 
-CPPFLAGS+=     -nostdinc -I$S -D_KERNEL -DEXEC_ELF32
+CPPFLAGS+=     -nostdinc -I$S -D_KERNEL -DEXEC_ELF${ELFSIZE} -DELFSIZE=${ELFSIZE}
 
 MKMAN= no
 
 KMOD=  exec_svr4_elf
 
 SRCS=  lkminit_exec.c
-SRCS+= svr4_exec_elf32.c
+SRCS+= svr4_exec_elf${ELFSIZE}.c
 
 .include <bsd.kmod.mk>
diff -r 2ef525e989c3 -r dd72983ba621 sys/lkm/exec/svr4_elf/lkminit_exec.c
--- a/sys/lkm/exec/svr4_elf/lkminit_exec.c      Wed Jul 18 16:51:39 2001 +0000
+++ b/sys/lkm/exec/svr4_elf/lkminit_exec.c      Wed Jul 18 16:53:34 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lkminit_exec.c,v 1.2 2001/05/15 02:00:14 lukem Exp $ */
+/* $NetBSD: lkminit_exec.c,v 1.3 2001/07/18 16:53:34 mrg Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -44,7 +44,9 @@
 #include <sys/lkm.h>
 
 #include <machine/elf_machdep.h>
+#ifndef ELFSIZE
 #define ELFSIZE        32
+#endif
 #include <sys/exec_elf.h>
 
 #include <compat/svr4/svr4_exec.h>
@@ -52,11 +54,19 @@
 int exec_svr4_elf_lkmentry __P((struct lkm_table *, int, int));
 
 static struct execsw exec_svr4_elf =
+#if ELFSIZE == 32
        { sizeof (Elf_Ehdr), exec_elf32_makecmds,
          { ELFNAME2(svr4,probe) },
          NULL, EXECSW_PRIO_ANY,
          SVR4_AUX_ARGSIZ,
          svr4_copyargs, svr4_setregs };        /* SVR4 32bit ELF bins (not 64bit safe) */
+#else
+       { sizeof (Elf64_Ehdr), exec_elf64_makecmds,
+         { ELFNAME2(svr4,probe) },
+         NULL, EXECSW_PRIO_ANY,
+         SVR4_AUX_ARGSIZ64,
+         svr4_copyargs64, svr4_setregs };      /* SVR4 64bit ELF bins (not 64bit safe) */
+#endif
 
 /*
  * declare the exec



Home | Main Index | Thread Index | Old Index