Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump gardenize: function calls over #ifdefs
details: https://anonhg.NetBSD.org/src/rev/8e4c25a14420
branches: trunk
changeset: 795717:8e4c25a14420
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Apr 25 18:31:35 2014 +0000
description:
gardenize: function calls over #ifdefs
diffstat:
sys/rump/librump/rumpkern/kobj_rename.c | 11 +++++------
sys/rump/librump/rumpvfs/rump_vfs.c | 26 ++++++++++++--------------
2 files changed, 17 insertions(+), 20 deletions(-)
diffs (100 lines):
diff -r fc8094a29c69 -r 8e4c25a14420 sys/rump/librump/rumpkern/kobj_rename.c
--- a/sys/rump/librump/rumpkern/kobj_rename.c Fri Apr 25 18:25:52 2014 +0000
+++ b/sys/rump/librump/rumpkern/kobj_rename.c Fri Apr 25 18:31:35 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kobj_rename.c,v 1.1 2010/04/26 23:17:13 pooka Exp $ */
+/* $NetBSD: kobj_rename.c,v 1.2 2014/04/25 18:31:35 pooka Exp $ */
/*-
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kobj_rename.c,v 1.1 2010/04/26 23:17:13 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kobj_rename.c,v 1.2 2014/04/25 18:31:35 pooka Exp $");
#define ELFSIZE ARCH_ELFSIZE
@@ -36,6 +36,8 @@
#include <sys/kobj.h>
#include <sys/systm.h>
+#include <rump/rump.h>
+
/*
* Mangle symbols into rump kernel namespace. This means
* putting "rumpns" in front of select symbols.
@@ -70,15 +72,12 @@
size_t worktabsz, worktabidx;
unsigned i;
const size_t prefixlen = strlen(RUMPNS);
-
-#ifndef _RUMP_NATIVE_ABI
static int warned;
- if (!warned) {
+ if (!rump_nativeabi_p() && !warned) {
printf("warning: kernel ABI not supported on this arch\n");
warned = 1;
}
-#endif
/* allocate space for worst-case stringtab */
worktabsz = *strtabsz + symcount * prefixlen;
diff -r fc8094a29c69 -r 8e4c25a14420 sys/rump/librump/rumpvfs/rump_vfs.c
--- a/sys/rump/librump/rumpvfs/rump_vfs.c Fri Apr 25 18:25:52 2014 +0000
+++ b/sys/rump/librump/rumpvfs/rump_vfs.c Fri Apr 25 18:31:35 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_vfs.c,v 1.77 2013/06/10 19:48:22 pooka Exp $ */
+/* $NetBSD: rump_vfs.c,v 1.78 2014/04/25 18:31:35 pooka Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.77 2013/06/10 19:48:22 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.78 2014/04/25 18:31:35 pooka Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -93,6 +93,7 @@
{
extern struct vfsops rumpfs_vfsops;
char buf[64];
+ char *mbase;
int rv, i;
/* initialize indirect interfaces */
@@ -153,20 +154,17 @@
* host module directory to rump. This means that kernel
* modules from the host will be autoloaded to rump kernels.
*/
-#ifdef _RUMP_NATIVE_ABI
- {
- char *mbase;
+ if (rump_nativeabi_p()) {
+ if (rumpuser_getparam("RUMP_MODULEBASE", buf, sizeof(buf)) == 0)
+ mbase = buf;
+ else
+ mbase = module_base;
- if (rumpuser_getparam("RUMP_MODULEBASE", buf, sizeof(buf)) == 0)
- mbase = buf;
- else
- mbase = module_base;
-
- if (strlen(mbase) != 0 && *mbase != '0') {
- rump_etfs_register(module_base, mbase, RUMP_ETFS_DIR_SUBDIRS);
+ if (strlen(mbase) != 0 && *mbase != '0') {
+ rump_etfs_register(module_base, mbase,
+ RUMP_ETFS_DIR_SUBDIRS);
+ }
}
- }
-#endif
module_init_class(MODULE_CLASS_VFS);
Home |
Main Index |
Thread Index |
Old Index