Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpdev attach mainbus



details:   https://anonhg.NetBSD.org/src/rev/bbcf087de974
branches:  trunk
changeset: 747565:bbcf087de974
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Sep 20 23:16:09 2009 +0000

description:
attach mainbus

diffstat:

 sys/rump/librump/rumpdev/autoconf.c |  56 +++++++++++++++++++++++++++++++-----
 sys/rump/librump/rumpdev/rump_dev.c |   7 +++-
 2 files changed, 53 insertions(+), 10 deletions(-)

diffs (107 lines):

diff -r c2c910aa25c6 -r bbcf087de974 sys/rump/librump/rumpdev/autoconf.c
--- a/sys/rump/librump/rumpdev/autoconf.c       Sun Sep 20 23:02:31 2009 +0000
+++ b/sys/rump/librump/rumpdev/autoconf.c       Sun Sep 20 23:16:09 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.1 2009/07/20 18:04:13 pooka Exp $       */
+/*     $NetBSD: autoconf.c,v 1.2 2009/09/20 23:16:09 pooka Exp $       */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,18 +26,44 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1 2009/07/20 18:04:13 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2009/09/20 23:16:09 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+
+int    mainbus_match(struct device *, struct cfdata *, void *);
+void   mainbus_attach(struct device *, struct device *, void *);
+
+struct mainbus_softc {
+       int mb_nada;
+};
+
+CFDRIVER_DECL(mainbus, DV_DULL, NULL);
+CFATTACH_DECL_NEW(mainbus, sizeof(struct mainbus_softc),
+       mainbus_match, mainbus_attach, NULL, NULL);
+
+struct cfdriver * const cfdriver_list_initial[] = {
+       &mainbus_cd,
+       NULL
+};
 
-/* random stubs since we don't run config on rump yet */
-struct cfdata *cfdata;
-const short *cfroots;
-struct cfdriver * const *cfdriver_list_initial;
-struct cfattachinit *cfattachinit;
+static struct cfattach * const mainbus_cfattachinit[] = {
+       &mainbus_ca, NULL
+};
+const struct cfattachinit cfattachinit[] = {
+       { "mainbus", mainbus_cfattachinit },
+       { NULL, NULL },
+};
+
+struct cfdata cfdata[] = {
+       { "mainbus", "mainbus", 0, FSTATE_NOTFOUND, NULL, 0, NULL},
+};
+
+const short cfroots[] = {
+       0, /* mainbus */
+       -1
+};
 
 /* actually used */
 #define MAXPDEVS 256
@@ -67,3 +93,17 @@
 
        rump_pdev_add(NULL, 0);
 }
+
+int
+mainbus_match(struct device *parent, struct cfdata *match, void *aux)
+{
+
+       return 1;
+}
+
+void
+mainbus_attach(struct device *parent, struct device *self, void *aux)
+{
+
+       aprint_normal("\n");
+}
diff -r c2c910aa25c6 -r bbcf087de974 sys/rump/librump/rumpdev/rump_dev.c
--- a/sys/rump/librump/rumpdev/rump_dev.c       Sun Sep 20 23:02:31 2009 +0000
+++ b/sys/rump/librump/rumpdev/rump_dev.c       Sun Sep 20 23:16:09 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_dev.c,v 1.3 2009/09/08 20:15:51 pooka Exp $       */
+/*     $NetBSD: rump_dev.c,v 1.4 2009/09/20 23:16:09 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.3 2009/09/08 20:15:51 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.4 2009/09/20 23:16:09 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -53,6 +53,9 @@
 
        rump_pdev_finalize();
 
+       if (config_rootfound("mainbus", NULL) == NULL)
+               panic("no mainbus");
+
        config_finalize();
 }
 



Home | Main Index | Thread Index | Old Index