Module Name: src Committed By: pooka Date: Mon Mar 10 22:38:53 UTC 2014
Modified Files: src/share/mk: bsd.own.mk src/sys/rump: Makefile.rump src/sys/rump/include/rump: rump.h src/sys/rump/librump/rumpkern: Makefile.rumpkern rump.c src/tests/rump/modautoload: Makefile t_modautoload.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.782 -r1.783 src/share/mk/bsd.own.mk cvs rdiff -u -r1.89 -r1.90 src/sys/rump/Makefile.rump cvs rdiff -u -r1.58 -r1.59 src/sys/rump/include/rump/rump.h cvs rdiff -u -r1.138 -r1.139 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.287 -r1.288 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.1 -r1.2 src/tests/rump/modautoload/Makefile \ src/tests/rump/modautoload/t_modautoload.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.782 src/share/mk/bsd.own.mk:1.783 --- src/share/mk/bsd.own.mk:1.782 Sun Mar 9 19:58:43 2014 +++ src/share/mk/bsd.own.mk Mon Mar 10 22:38:53 2014 @@ -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 @@ ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang 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 \ Index: src/sys/rump/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.89 src/sys/rump/Makefile.rump:1.90 --- src/sys/rump/Makefile.rump:1.89 Mon Dec 9 17:57:11 2013 +++ src/sys/rump/Makefile.rump Mon Mar 10 22:38:53 2014 @@ -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 @@ NOLINT= # kernel code .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 Index: src/sys/rump/include/rump/rump.h diff -u src/sys/rump/include/rump/rump.h:1.58 src/sys/rump/include/rump/rump.h:1.59 --- src/sys/rump/include/rump/rump.h:1.58 Thu Feb 20 00:41:05 2014 +++ src/sys/rump/include/rump/rump.h Mon Mar 10 22:38:53 2014 @@ -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 @@ enum rump_etfs_type { _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); Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.138 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.139 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.138 Fri Feb 28 14:19:25 2014 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Mon Mar 10 22:38:53 2014 @@ -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 @@ CPPFLAGS+= -Dsun3 # include libkern source files KERNDIR=${RUMPTOP}/../lib/libkern -.ifdef RUMPKMOD +.if "${_RUMP_NATIVEABI}" == "yes" KERNMISCCPPFLAGS+= -D_RUMPKERNEL .endif .include "${RUMPTOP}/../lib/libkern/Makefile.libkern" Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.287 src/sys/rump/librump/rumpkern/rump.c:1.288 --- src/sys/rump/librump/rumpkern/rump.c:1.287 Fri Feb 28 10:16:51 2014 +++ src/sys/rump/librump/rumpkern/rump.c Mon Mar 10 22:38:53 2014 @@ -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 @@ rump_getversion(void) 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). Index: src/tests/rump/modautoload/Makefile diff -u src/tests/rump/modautoload/Makefile:1.1 src/tests/rump/modautoload/Makefile:1.2 --- src/tests/rump/modautoload/Makefile:1.1 Wed Jun 9 12:35:45 2010 +++ src/tests/rump/modautoload/Makefile Mon Mar 10 22:38:53 2014 @@ -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. Index: src/tests/rump/modautoload/t_modautoload.c diff -u src/tests/rump/modautoload/t_modautoload.c:1.1 src/tests/rump/modautoload/t_modautoload.c:1.2 --- src/tests/rump/modautoload/t_modautoload.c:1.1 Wed Jun 9 12:35:45 2010 +++ src/tests/rump/modautoload/t_modautoload.c Mon Mar 10 22:38:53 2014 @@ -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 @@ static void 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();