Module Name: src
Committed By: pooka
Date: Sun Sep 20 23:16:09 UTC 2009
Modified Files:
src/sys/rump/librump/rumpdev: autoconf.c rump_dev.c
Log Message:
attach mainbus
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpdev/autoconf.c
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/librump/rumpdev/rump_dev.c
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/autoconf.c
diff -u src/sys/rump/librump/rumpdev/autoconf.c:1.1 src/sys/rump/librump/rumpdev/autoconf.c:1.2
--- src/sys/rump/librump/rumpdev/autoconf.c:1.1 Mon Jul 20 18:04:13 2009
+++ src/sys/rump/librump/rumpdev/autoconf.c Sun Sep 20 23:16:09 2009
@@ -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>
-/* 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;
+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
+};
+
+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");
+}
Index: src/sys/rump/librump/rumpdev/rump_dev.c
diff -u src/sys/rump/librump/rumpdev/rump_dev.c:1.3 src/sys/rump/librump/rumpdev/rump_dev.c:1.4
--- src/sys/rump/librump/rumpdev/rump_dev.c:1.3 Tue Sep 8 20:15:51 2009
+++ src/sys/rump/librump/rumpdev/rump_dev.c Sun Sep 20 23:16:09 2009
@@ -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();
}