Module Name: src
Committed By: pooka
Date: Mon Apr 29 18:00:20 UTC 2013
Modified Files:
src/lib/librumpuser: rumpuser_dl.c
src/sys/rump/librump/rumpkern: rump.c
Log Message:
Make rumpuser_dl_bootstrap() optional for platforms which don't
provide dynamic linking.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/librumpuser/rumpuser_dl.c
cvs rdiff -u -r1.264 -r1.265 src/sys/rump/librump/rumpkern/rump.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/librumpuser/rumpuser_dl.c
diff -u src/lib/librumpuser/rumpuser_dl.c:1.17 src/lib/librumpuser/rumpuser_dl.c:1.18
--- src/lib/librumpuser/rumpuser_dl.c:1.17 Wed Mar 20 12:59:10 2013
+++ src/lib/librumpuser/rumpuser_dl.c Mon Apr 29 18:00:20 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser_dl.c,v 1.17 2013/03/20 12:59:10 pooka Exp $ */
+/* $NetBSD: rumpuser_dl.c,v 1.18 2013/04/29 18:00:20 pooka Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@@ -40,7 +40,7 @@
#include "rumpuser_port.h"
#if !defined(lint)
-__RCSID("$NetBSD: rumpuser_dl.c,v 1.17 2013/03/20 12:59:10 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_dl.c,v 1.18 2013/04/29 18:00:20 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -455,22 +455,14 @@ rumpuser_dl_bootstrap(rump_modinit_fn do
}
#else
/*
- * "default" implementation for platforms where we don't support
- * dynamic linking. Assumes that all rump kernel components are
- * statically linked with the local client. No need to handle modules
- * since the module code does that all by itself.
+ * no dynamic linking supported
*/
void
rumpuser_dl_bootstrap(rump_modinit_fn domodinit,
rump_symload_fn symload, rump_compload_fn compload)
{
- extern void *__start_link_set_rump_components;
- extern void *__stop_link_set_rump_components;
- void **rc = &__start_link_set_rump_components;
- void **rc_end = &__stop_link_set_rump_components;
- for (; rc < rc_end; rc++)
- compload(*rc);
+ return;
}
#endif
Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.264 src/sys/rump/librump/rumpkern/rump.c:1.265
--- src/sys/rump/librump/rumpkern/rump.c:1.264 Mon Apr 29 17:31:05 2013
+++ src/sys/rump/librump/rumpkern/rump.c Mon Apr 29 18:00:19 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: rump.c,v 1.264 2013/04/29 17:31:05 pooka Exp $ */
+/* $NetBSD: rump.c,v 1.265 2013/04/29 18:00:19 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.264 2013/04/29 17:31:05 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.265 2013/04/29 18:00:19 pooka Exp $");
#include <sys/systm.h>
#define ELFSIZE ARCH_ELFSIZE
@@ -106,6 +106,7 @@ static int rump_hyp_rfork(void *, int, c
static void rump_hyp_lwpexit(void);
static void rump_hyp_execnotify(const char *);
+static void rump_component_addlocal(void);
static void rump_component_load(const struct rump_component *);
static struct lwp *bootlwp;
@@ -219,8 +220,7 @@ rump_daemonize_done(int error)
RUMP_COMPONENT(RUMP_COMPONENT_POSTINIT)
{
- extern void *__start_link_set_rump_components;
- extern void *__stop_link_set_rump_components;
+ __link_set_decl(rump_components, struct rump_component);
/*
* Trick compiler into generating references so that statically
@@ -402,6 +402,7 @@ rump_init(void)
rumpuser_dl_bootstrap(add_linkedin_modules,
rump_kernelfsym_load, rump_component_load);
+ rump_component_addlocal();
rump_component_init(RUMP_COMPONENT_KERN);
/* initialize factions, if present */
@@ -679,6 +680,20 @@ struct compstore {
};
static LIST_HEAD(, compstore) cshead = LIST_HEAD_INITIALIZER(cshead);
+/*
+ * add components which are visible from the current object.
+ */
+static void
+rump_component_addlocal(void)
+{
+ __link_set_decl(rump_components, struct rump_component);
+ struct rump_component *const *rc;
+
+ __link_set_foreach(rc, rump_components) {
+ rump_component_load(*rc);
+ }
+}
+
static void
rump_component_load(const struct rump_component *rc)
{