/* * $Id: config_rootdev.c,v 1.1 2008/08/08 12:37:11 nbrk Exp $ */ /* * 'root' is the parent to all devices in system. * Device module calls config_attach_rootdev() to initiate recursive * autoconfiguration process. */ #include /* * rootdev driver. */ struct driver root_drv = { "root", /* name */ 0, /* datasize */ NULL, /* match */ NULL, /* attach */ NULL, /* detach */ -1 /* nunits XXX */ }; /* * rootdev device. */ struct device *root_dev; void config_attach_rootdev() { /* * Attach our one and only child, 'hostio'. * Panic if attachment failed. */ int ndevs; /* * Allocate and construct ourselfes. */ root_dev = config_alloc_device(&root_drv); root_dev->dv_parent = root_dev; ndevs = config_search_children(root_dev, NULL); if (ndevs == 0) panic("rootdev: can't find hostio"); }