Module Name:    src
Committed By:   pooka
Date:           Tue Sep 17 23:55:17 UTC 2013

Modified Files:
        src/sys/rump/librump/rumpdev: rump_dev.c
        src/sys/rump/librump/rumpkern: rump_private.h

Log Message:
Make it possible to run component constructors after mainbus attaches,
but before config_finalize() is run.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/rump/librump/rumpdev/rump_dev.c
cvs rdiff -u -r1.76 -r1.77 src/sys/rump/librump/rumpkern/rump_private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpdev/rump_dev.c
diff -u src/sys/rump/librump/rumpdev/rump_dev.c:1.22 src/sys/rump/librump/rumpdev/rump_dev.c:1.23
--- src/sys/rump/librump/rumpdev/rump_dev.c:1.22	Mon Jan 14 16:50:54 2013
+++ src/sys/rump/librump/rumpdev/rump_dev.c	Tue Sep 17 23:55:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_dev.c,v 1.22 2013/01/14 16:50:54 pooka Exp $	*/
+/*	$NetBSD: rump_dev.c,v 1.23 2013/09/17 23:55:16 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.22 2013/01/14 16:50:54 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.23 2013/09/17 23:55:16 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -55,7 +55,13 @@ RUMP_COMPONENT(RUMP__FACTION_DEV)
 	rump_pdev_finalize();
 
 	cold = 0;
-	if (rump_component_count(RUMP_COMPONENT_DEV) > 0) {
+
+	/*
+	 * XXX: does the "if" make any sense?  What if someone wants
+	 * to dynamically load a driver later on?
+	 */
+	if (rump_component_count(RUMP_COMPONENT_DEV) > 0
+	    || rump_component_count(RUMP_COMPONENT_DEV_AFTERMAINBUS) > 0) {
 		extern struct cfdriver mainbus_cd;
 		extern struct cfattach mainbus_ca;
 		extern struct cfdata cfdata[];
@@ -66,6 +72,7 @@ RUMP_COMPONENT(RUMP__FACTION_DEV)
 		if (config_rootfound("mainbus", NULL) == NULL)
 			panic("no mainbus");
 
+		rump_component_init(RUMP_COMPONENT_DEV_AFTERMAINBUS);
 	}
 	config_finalize();
 

Index: src/sys/rump/librump/rumpkern/rump_private.h
diff -u src/sys/rump/librump/rumpkern/rump_private.h:1.76 src/sys/rump/librump/rumpkern/rump_private.h:1.77
--- src/sys/rump/librump/rumpkern/rump_private.h:1.76	Sat Sep  7 17:58:00 2013
+++ src/sys/rump/librump/rumpkern/rump_private.h	Tue Sep 17 23:55:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_private.h,v 1.76 2013/09/07 17:58:00 pooka Exp $	*/
+/*	$NetBSD: rump_private.h,v 1.77 2013/09/17 23:55:16 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -54,6 +54,7 @@ extern struct sysent rump_sysent[];
 
 enum rump_component_type {
 	RUMP_COMPONENT_DEV,
+		RUMP_COMPONENT_DEV_AFTERMAINBUS,
 	RUMP_COMPONENT_NET,
 		RUMP_COMPONENT_NET_ROUTE,
 		RUMP_COMPONENT_NET_IF,

Reply via email to