PERFORCE change 119433 for review
Bruce M Simpson
bms at FreeBSD.org
Mon May 7 17:33:31 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=119433
Change 119433 by bms at bms_anglepoise on 2007/05/07 17:33:27
Give the nexus device a description.
Print child resources as they are probed and attached.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/mips/nexus.c#6 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/mips/nexus.c#6 (text+ko) ====
@@ -73,6 +73,7 @@
static int nexus_probe(device_t);
static int nexus_attach(device_t);
static int nexus_print_child(device_t, device_t);
+static int nexus_print_all_resources(device_t dev);
static device_t nexus_add_child(device_t, int, const char *, int);
static struct resource *
nexus_alloc_resource(device_t, device_t, int, int *, u_long,
@@ -110,7 +111,7 @@
nexus_probe(device_t dev)
{
- device_quiet(dev); /* suppress attach message for neatness */
+ device_set_desc(dev, "MIPS32 root nexus");
irq_rman.rm_start = 0;
irq_rman.rm_end = 5;
@@ -154,6 +155,7 @@
nexus_attach(device_t dev)
{
+ bus_enumerate_hinted_children(dev);
bus_generic_probe(dev);
bus_generic_attach(dev);
@@ -166,11 +168,29 @@
int retval = 0;
retval += bus_print_child_header(bus, child);
- retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */
+ retval += nexus_print_all_resources(child);
+ if (device_get_flags(child))
+ retval += printf(" flags %#x", device_get_flags(child));
+ retval += printf(" on %s\n", device_get_nameunit(bus));
return (retval);
}
+static int
+nexus_print_all_resources(device_t dev)
+{
+ struct nexus_device *ndev = DEVTONX(dev);
+ struct resource_list *rl = &ndev->nx_resources;
+ int retval = 0;
+
+ if (STAILQ_FIRST(rl))
+ retval += printf(" at");
+
+ retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx");
+ retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
+
+ return (retval);
+}
static device_t
nexus_add_child(device_t bus, int order, const char *name, int unit)
More information about the p4-projects
mailing list