Changeset View
Changeset View
Standalone View
Standalone View
head/sys/x86/x86/legacy.c
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | legacy_attach(device_t dev) | ||||
* Let our child drivers identify any child devices that they | * Let our child drivers identify any child devices that they | ||||
* can find. Once that is done attach any devices that we | * can find. Once that is done attach any devices that we | ||||
* found. | * found. | ||||
*/ | */ | ||||
bus_generic_probe(dev); | bus_generic_probe(dev); | ||||
bus_generic_attach(dev); | bus_generic_attach(dev); | ||||
/* | /* | ||||
* If we didn't see ISA on a pci bridge, create some | * If we didn't see ISA on a PCI bridge, add a top-level bus. | ||||
* connection points now so they show up "on motherboard". | |||||
*/ | */ | ||||
if (!devclass_get_device(devclass_find("isa"), 0)) { | if (!devclass_get_device(devclass_find("isa"), 0)) { | ||||
child = BUS_ADD_CHILD(dev, 0, "isa", 0); | child = BUS_ADD_CHILD(dev, 0, "isa", 0); | ||||
if (child == NULL) | if (child == NULL) | ||||
panic("legacy_attach isa"); | panic("legacy_attach isa"); | ||||
device_probe_and_attach(child); | device_probe_and_attach(child); | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
static int | static int | ||||
legacy_print_child(device_t bus, device_t child) | legacy_print_child(device_t bus, device_t child) | ||||
{ | { | ||||
struct legacy_device *atdev = DEVTOAT(child); | struct legacy_device *atdev = DEVTOAT(child); | ||||
int retval = 0; | int retval = 0; | ||||
retval += bus_print_child_header(bus, child); | retval += bus_print_child_header(bus, child); | ||||
if (atdev->lg_pcibus != -1) | if (atdev->lg_pcibus != -1) | ||||
retval += printf(" pcibus %d", atdev->lg_pcibus); | retval += printf(" pcibus %d", atdev->lg_pcibus); | ||||
retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */ | retval += printf("\n"); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
static device_t | static device_t | ||||
legacy_add_child(device_t bus, u_int order, const char *name, int unit) | legacy_add_child(device_t bus, u_int order, const char *name, int unit) | ||||
{ | { | ||||
device_t child; | device_t child; | ||||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |