]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/dde/fbsd/lib/common/bsd/src/autoconf.c
Inital import
[l4.git] / l4 / pkg / dde / fbsd / lib / common / bsd / src / autoconf.c
1 /**
2  * The device autoconfiguration sysinits inspired by
3  * i386/i386/autoconf.c
4  *
5  * \author Thomas Friebel <tf13@os.inf.tu-dresden.de>
6  */
7
8 #include <sys/param.h>
9 #include <sys/systm.h>
10 #include <sys/bus.h>
11 #include <sys/conf.h>
12 #include <sys/kernel.h>
13
14 #include <dde_fbsd/cold.h>
15
16 static void ac_start(void *dummy) {
17         // nexus0 is the top of the i386 device tree
18         device_add_child(root_bus, "nexus", 0);
19
20         // initiate autoconf
21         root_bus_configure();
22 }
23
24 static void ac_done(void *dummy) {
25         // start scheduling
26         bsd_unset_cold();
27 }
28
29 SYSINIT(ac_start, SI_SUB_CONFIGURE, SI_ORDER_THIRD, ac_start, NULL);
30 SYSINIT(ac_done,  SI_SUB_CONFIGURE, SI_ORDER_ANY,   ac_done,  NULL);
31