From owner-p4-projects@FreeBSD.ORG Mon May 7 17:33:31 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6DF7116A406; Mon, 7 May 2007 17:33:31 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3DFF416A400 for ; Mon, 7 May 2007 17:33:31 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 3136613C457 for ; Mon, 7 May 2007 17:33:31 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l47HXVpm080484 for ; Mon, 7 May 2007 17:33:31 GMT (envelope-from bms@incunabulum.net) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l47HXURF080481 for perforce@freebsd.org; Mon, 7 May 2007 17:33:30 GMT (envelope-from bms@incunabulum.net) Date: Mon, 7 May 2007 17:33:30 GMT Message-Id: <200705071733.l47HXURF080481@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bms@incunabulum.net using -f From: Bruce M Simpson To: Perforce Change Reviews Cc: Subject: PERFORCE change 119433 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2007 17:33:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=119433 Change 119433 by bms@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)