Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump Make it possible to run component construct...



details:   https://anonhg.NetBSD.org/src/rev/84cdb8ef7be5
branches:  trunk
changeset: 790089:84cdb8ef7be5
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Sep 17 23:55:16 2013 +0000

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

diffstat:

 sys/rump/librump/rumpdev/rump_dev.c      |  13 ++++++++++---
 sys/rump/librump/rumpkern/rump_private.h |   3 ++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diffs (58 lines):

diff -r 68cd3acf8138 -r 84cdb8ef7be5 sys/rump/librump/rumpdev/rump_dev.c
--- a/sys/rump/librump/rumpdev/rump_dev.c       Tue Sep 17 20:57:45 2013 +0000
+++ b/sys/rump/librump/rumpdev/rump_dev.c       Tue Sep 17 23:55:16 2013 +0000
@@ -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_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 @@
                if (config_rootfound("mainbus", NULL) == NULL)
                        panic("no mainbus");
 
+               rump_component_init(RUMP_COMPONENT_DEV_AFTERMAINBUS);
        }
        config_finalize();
 
diff -r 68cd3acf8138 -r 84cdb8ef7be5 sys/rump/librump/rumpkern/rump_private.h
--- a/sys/rump/librump/rumpkern/rump_private.h  Tue Sep 17 20:57:45 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump_private.h  Tue Sep 17 23:55:16 2013 +0000
@@ -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 @@
 
 enum rump_component_type {
        RUMP_COMPONENT_DEV,
+               RUMP_COMPONENT_DEV_AFTERMAINBUS,
        RUMP_COMPONENT_NET,
                RUMP_COMPONENT_NET_ROUTE,
                RUMP_COMPONENT_NET_IF,



Home | Main Index | Thread Index | Old Index