Annotation of prex-old/dev/core/config_rootdev.c, Revision 1.1
1.1 ! nbrk 1: /*
! 2: * $Id$
! 3: */
! 4: /*
! 5: * 'root' is the parent to all devices in system.
! 6: * Device module calls config_attach_rootdev() to initiate recursive
! 7: * autoconfiguration process.
! 8: */
! 9: #include <driver.h>
! 10:
! 11: /*
! 12: * rootdev driver.
! 13: */
! 14: struct driver root_drv = {
! 15: "root", /* name */
! 16: 0, /* datasize */
! 17: NULL, /* match */
! 18: NULL, /* attach */
! 19: NULL, /* detach */
! 20: -1 /* nunits XXX */
! 21: };
! 22:
! 23: /*
! 24: * rootdev device.
! 25: */
! 26: struct device *root_dev;
! 27:
! 28:
! 29: void
! 30: config_attach_rootdev()
! 31: {
! 32: /*
! 33: * Attach our one and only child, 'hostio'.
! 34: * Panic if attachment failed.
! 35: */
! 36: int ndevs;
! 37:
! 38: /*
! 39: * Allocate and construct ourselfes.
! 40: */
! 41: root_dev = config_alloc_device(&root_drv);
! 42: root_dev->dv_parent = root_dev;
! 43:
! 44: ndevs = config_search_children(root_dev, NULL);
! 45: if (ndevs == 0)
! 46: panic("rootdev: can't find hostio");
! 47: }
! 48:
CVSweb