Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Make rumpuser_dl_bootstrap() optional for platforms which don't
details: https://anonhg.NetBSD.org/src/rev/963865f5b8f8
branches: trunk
changeset: 786486:963865f5b8f8
user: pooka <pooka%NetBSD.org@localhost>
date: Mon Apr 29 18:00:19 2013 +0000
description:
Make rumpuser_dl_bootstrap() optional for platforms which don't
provide dynamic linking.
diffstat:
lib/librumpuser/rumpuser_dl.c | 16 ++++------------
sys/rump/librump/rumpkern/rump.c | 23 +++++++++++++++++++----
2 files changed, 23 insertions(+), 16 deletions(-)
diffs (108 lines):
diff -r ab46763f6396 -r 963865f5b8f8 lib/librumpuser/rumpuser_dl.c
--- a/lib/librumpuser/rumpuser_dl.c Mon Apr 29 17:59:50 2013 +0000
+++ b/lib/librumpuser/rumpuser_dl.c Mon Apr 29 18:00:19 2013 +0000
@@ -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 @@
}
#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
diff -r ab46763f6396 -r 963865f5b8f8 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c Mon Apr 29 17:59:50 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump.c Mon Apr 29 18:00:19 2013 +0000
@@ -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 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_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 @@
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 @@
};
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)
{
Home |
Main Index |
Thread Index |
Old Index