Source-Changes-HG archive

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

[src/trunk]: src Move the "is arch capable of loading native kernel modules into



details:   https://anonhg.NetBSD.org/src/rev/40cf0203b5e4
branches:  trunk
changeset: 327560:40cf0203b5e4
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Mar 10 22:38:53 2014 +0000

description:
Move the "is arch capable of loading native kernel modules into
rump kernel" clauses from bsd.own.mk to Makefile.rump.  Also,
add a rump_nativeabi_p() call to determine if rump kernel is
compiled with native ABI support.

diffstat:

 share/mk/bsd.own.mk                         |  10 +---------
 sys/rump/Makefile.rump                      |  15 +++++++++------
 sys/rump/include/rump/rump.h                |   4 +++-
 sys/rump/librump/rumpkern/Makefile.rumpkern |   4 ++--
 sys/rump/librump/rumpkern/rump.c            |  15 +++++++++++++--
 tests/rump/modautoload/Makefile             |   7 +------
 tests/rump/modautoload/t_modautoload.c      |   7 +++----
 7 files changed, 32 insertions(+), 30 deletions(-)

diffs (168 lines):

diff -r cd0eb1f6e08f -r 40cf0203b5e4 share/mk/bsd.own.mk
--- a/share/mk/bsd.own.mk       Mon Mar 10 22:37:51 2014 +0000
+++ b/share/mk/bsd.own.mk       Mon Mar 10 22:38:53 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.own.mk,v 1.782 2014/03/09 19:58:43 matt Exp $
+#      $NetBSD: bsd.own.mk,v 1.783 2014/03/10 22:38:53 pooka Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -792,14 +792,6 @@
 
 GENASSYM_CPPFLAGS+=    ${${ACTIVE_CC} == "clang":? -no-integrated-as :}
 
-#
-# Determine if arch uses native kernel modules with rump
-#
-.if ${MACHINE_ARCH} == "i386" || \
-    ${MACHINE_ARCH} == "x86_64"
-RUMPKMOD=      # defined
-.endif
-
 TARGETS+=      all clean cleandir depend dependall includes \
                install lint obj regress tags html analyze
 PHONY_NOTMAIN =        all clean cleandir depend dependall distclean includes \
diff -r cd0eb1f6e08f -r 40cf0203b5e4 sys/rump/Makefile.rump
--- a/sys/rump/Makefile.rump    Mon Mar 10 22:37:51 2014 +0000
+++ b/sys/rump/Makefile.rump    Mon Mar 10 22:38:53 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rump,v 1.89 2013/12/09 17:57:11 pooka Exp $
+#      $NetBSD: Makefile.rump,v 1.90 2014/03/10 22:38:53 pooka Exp $
 #
 
 WARNS?=                3       # XXX: src/sys won't compile with -Wsign-compare yet
@@ -6,13 +6,16 @@
 
 .include <bsd.own.mk>
 
-# If RUMPKMOD is _not_ set (only on capable archs, from bsd.own.mk),
-# use rump ABI instead of the NetBSD kernel ABI.
-.ifndef RUMPKMOD
+# Use NetBSD kernel ABI by default on x86 archs.  Performance-related
+# compile-time options may override this at a later date.
+.if ${MACHINE_ARCH} == "i386" || \
+    ${MACHINE_ARCH} == "x86_64"
+_RUMP_NATIVEABI= yes
+CPPFLAGS+=     -D_RUMP_NATIVE_ABI
+.else
+_RUMP_NATIVEABI= no
 CPPFLAGS:=     -I${RUMPTOP}/include ${CPPFLAGS}
 CPPFLAGS+=     -D_RUMPKERNEL
-.else
-CPPFLAGS+=     -D_RUMP_NATIVE_ABI
 .endif
 
 CPPFLAGS+=     -DMAXUSERS=32
diff -r cd0eb1f6e08f -r 40cf0203b5e4 sys/rump/include/rump/rump.h
--- a/sys/rump/include/rump/rump.h      Mon Mar 10 22:37:51 2014 +0000
+++ b/sys/rump/include/rump/rump.h      Mon Mar 10 22:38:53 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.h,v 1.58 2014/02/20 00:41:05 pooka Exp $  */
+/*     $NetBSD: rump.h,v 1.59 2014/03/10 22:38:53 pooka Exp $  */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -100,6 +100,8 @@
 _BEGIN_DECLS
 #endif
 
+int    rump_nativeabi_p(void);
+
 int    rump_boot_gethowto(void);
 void   rump_boot_sethowto(int);
 void   rump_boot_setsigmodel(enum rump_sigmodel);
diff -r cd0eb1f6e08f -r 40cf0203b5e4 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Mon Mar 10 22:37:51 2014 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Mon Mar 10 22:38:53 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpkern,v 1.138 2014/02/28 14:19:25 matt Exp $
+#      $NetBSD: Makefile.rumpkern,v 1.139 2014/03/10 22:38:53 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -211,7 +211,7 @@
 
 # include libkern source files
 KERNDIR=${RUMPTOP}/../lib/libkern
-.ifdef RUMPKMOD
+.if "${_RUMP_NATIVEABI}" == "yes"
 KERNMISCCPPFLAGS+=     -D_RUMPKERNEL
 .endif
 .include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
diff -r cd0eb1f6e08f -r 40cf0203b5e4 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Mon Mar 10 22:37:51 2014 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Mon Mar 10 22:38:53 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.287 2014/02/28 10:16:51 skrll Exp $ */
+/*     $NetBSD: rump.c,v 1.288 2014/03/10 22:38:53 pooka Exp $ */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.287 2014/02/28 10:16:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.288 2014/03/10 22:38:53 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -943,6 +943,17 @@
        return __NetBSD_Version__;
 }
 
+int
+rump_nativeabi_p(void)
+{
+
+#ifdef _RUMP_NATIVE_ABI
+       return 1;
+#else
+       return 0;
+#endif
+}
+
 /*
  * Note: may be called unscheduled.  Not fully safe since no locking
  * of allevents (currently that's not even available).
diff -r cd0eb1f6e08f -r 40cf0203b5e4 tests/rump/modautoload/Makefile
--- a/tests/rump/modautoload/Makefile   Mon Mar 10 22:37:51 2014 +0000
+++ b/tests/rump/modautoload/Makefile   Mon Mar 10 22:38:53 2014 +0000
@@ -1,15 +1,10 @@
-#      $NetBSD: Makefile,v 1.1 2010/06/09 12:35:45 pooka Exp $
+#      $NetBSD: Makefile,v 1.2 2014/03/10 22:38:53 pooka Exp $
 #
 
 TESTSDIR=      ${TESTSBASE}/rump/modautoload
 
 TESTS_C=       t_modautoload
 
-.include <bsd.own.mk>
-.ifdef RUMPKMOD
-CPPFLAGS+=     -DHAVE_HOST_MODULES
-.endif
-
 # Note: we link the rump kernel into the application to make this work
 # on amd64.  This is the reason we keep this test in its own
 # subdirectory -- otherwise the LDADD lines would get a little hairy.
diff -r cd0eb1f6e08f -r 40cf0203b5e4 tests/rump/modautoload/t_modautoload.c
--- a/tests/rump/modautoload/t_modautoload.c    Mon Mar 10 22:37:51 2014 +0000
+++ b/tests/rump/modautoload/t_modautoload.c    Mon Mar 10 22:38:53 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_modautoload.c,v 1.1 2010/06/09 12:35:45 pooka Exp $  */
+/*     $NetBSD: t_modautoload.c,v 1.2 2014/03/10 22:38:53 pooka Exp $  */
 
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -34,9 +34,8 @@
 mountkernfs(void)
 {
 
-#ifndef HAVE_HOST_MODULES
-       atf_tc_skip("host kernel modules not supported on this architecture");
-#endif
+       if (!rump_nativeabi_p())
+               atf_tc_skip("host kernel modules not supported");
 
        rump_init();
 



Home | Main Index | Thread Index | Old Index