Date: Wed, 25 Sep 2002 23:05:50 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 18156 for review Message-ID: <200209260605.g8Q65o6A080227@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18156 Change 18156 by peter@peter_daintree on 2002/09/25 23:05:38 integ i386_hammer Affected files ... .. //depot/projects/hammer/sys/x86_64/include/legacyvar.h#1 branch .. //depot/projects/hammer/sys/x86_64/include/nexusvar.h#2 delete .. //depot/projects/hammer/sys/x86_64/include/segments.h#9 integrate .. //depot/projects/hammer/sys/x86_64/pci/pci_bus.c#3 integrate .. //depot/projects/hammer/sys/x86_64/pci/pci_cfgreg.c#4 integrate .. //depot/projects/hammer/sys/x86_64/x86_64/legacy.c#1 branch .. //depot/projects/hammer/sys/x86_64/x86_64/nexus.c#6 integrate Differences ... ==== //depot/projects/hammer/sys/x86_64/include/segments.h#9 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)segments.h 7.1 (Berkeley) 5/9/91 - * $FreeBSD: src/sys/i386/include/segments.h,v 1.31 2002/09/23 06:50:07 peter Exp $ + * $FreeBSD: src/sys/i386/include/segments.h,v 1.32 2002/09/26 05:07:41 peter Exp $ */ #ifndef _MACHINE_SEGMENTS_H_ ==== //depot/projects/hammer/sys/x86_64/pci/pci_bus.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/pci/pci_bus.c,v 1.89 2002/09/09 08:44:52 phk Exp $ + * $FreeBSD: src/sys/i386/pci/pci_bus.c,v 1.91 2002/09/23 18:14:31 jhb Exp $ * */ @@ -40,7 +40,7 @@ #include <pci/pcireg.h> #include <pci/pcib_private.h> #include <isa/isavar.h> -#include <machine/nexusvar.h> +#include <machine/legacyvar.h> #include <machine/pci_cfgreg.h> #include <machine/segments.h> #include <machine/cputypes.h> @@ -358,7 +358,7 @@ if (strcmp(device_get_name(devs[i]), "pcib") != 0) continue; - if (nexus_get_pcibus(devs[i]) == busnum) + if (legacy_get_pcibus(devs[i]) == busnum) s = NULL; } free(devs, M_TEMP); @@ -373,7 +373,7 @@ child = BUS_ADD_CHILD(parent, 100, "pcib", busnum); device_set_desc(child, s); - nexus_set_pcibus(child, busnum); + legacy_set_pcibus(child, busnum); found = 1; if (id == 0x12258086) @@ -397,26 +397,16 @@ printf( "nexus_pcib_identify: no bridge found, adding pcib0 anyway\n"); child = BUS_ADD_CHILD(parent, 100, "pcib", 0); - nexus_set_pcibus(child, 0); + legacy_set_pcibus(child, 0); } } static int nexus_pcib_probe(device_t dev) { - devclass_t pci_devclass; if (pci_cfgregopen() == 0) return ENXIO; - /* - * Check to see if we haven't already had a PCI bus added - * via some other means. If we have, bail since otherwise - * we're going to end up duplicating it. - */ - if ((pci_devclass = devclass_find("pci")) && - devclass_get_device(pci_devclass, device_get_unit(dev))) - return ENXIO; - return 0; } @@ -436,7 +426,7 @@ switch (which) { case PCIB_IVAR_BUS: - *result = nexus_get_pcibus(dev); + *result = legacy_get_pcibus(dev); return 0; } return ENOENT; @@ -448,7 +438,7 @@ switch (which) { case PCIB_IVAR_BUS: - nexus_set_pcibus(dev, value); + legacy_set_pcibus(dev, value); return 0; } return ENOENT; @@ -490,7 +480,7 @@ 1, }; -DRIVER_MODULE(pcib, nexus, nexus_pcib_driver, pcib_devclass, 0, 0); +DRIVER_MODULE(pcib, legacy, nexus_pcib_driver, pcib_devclass, 0, 0); /* ==== //depot/projects/hammer/sys/x86_64/pci/pci_cfgreg.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/pci/pci_cfgreg.c,v 1.94 2002/09/20 19:16:41 jhb Exp $ + * $FreeBSD: src/sys/i386/pci/pci_cfgreg.c,v 1.95 2002/09/23 18:13:42 jhb Exp $ */ #include <sys/param.h> /* XXX trim includes */ ==== //depot/projects/hammer/sys/x86_64/x86_64/nexus.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/i386/nexus.c,v 1.47 2002/09/04 03:19:33 jhb Exp $ + * $FreeBSD: src/sys/i386/i386/nexus.c,v 1.48 2002/09/23 16:03:00 jhb Exp $ */ /* @@ -57,7 +57,6 @@ #include <vm/pmap.h> #include <machine/pmap.h> -#include <machine/nexusvar.h> #include <machine/resource.h> #ifdef DEV_ISA @@ -71,7 +70,6 @@ static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { struct resource_list nx_resources; - int nx_pcibus; }; #define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev)) @@ -86,8 +84,6 @@ int unit); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); -static int nexus_read_ivar(device_t, device_t, int, uintptr_t *); -static int nexus_write_ivar(device_t, device_t, int, uintptr_t); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_deactivate_resource(device_t, device_t, int, int, @@ -114,8 +110,6 @@ /* Bus interface */ DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_add_child, nexus_add_child), - DEVMETHOD(bus_read_ivar, nexus_read_ivar), - DEVMETHOD(bus_write_ivar, nexus_write_ivar), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), @@ -210,29 +204,21 @@ || rman_manage_region(&mem_rman, 0, ~0)) panic("nexus_probe mem_rman"); - return bus_generic_probe(dev); + return 0; } static int nexus_attach(device_t dev) { - device_t child; + device_t child; - /* - * First, deal with the children we know about already - */ - bus_generic_attach(dev); - /* - * And if we didn't see an ISA on a pci bridge, create some - * connection points now so they show up "on motherboard". - */ - if (!devclass_get_device(devclass_find("isa"), 0)) { - child = BUS_ADD_CHILD(dev, 0, "isa", 0); + bus_generic_probe(dev); + if (!devclass_get_device(devclass_find("acpi"), 0)) { + child = BUS_ADD_CHILD(dev, 0, "legacy", 0); if (child == NULL) - panic("nexus_attach isa"); - device_probe_and_attach(child); + panic("nexus_attach legacy"); } - + bus_generic_attach(dev); return 0; } @@ -243,7 +229,7 @@ struct resource_list *rl = &ndev->nx_resources; int retval = 0; - if (SLIST_FIRST(rl) || ndev->nx_pcibus != -1) + if (SLIST_FIRST(rl)) retval += printf(" at"); retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); @@ -256,13 +242,10 @@ static int nexus_print_child(device_t bus, device_t child) { - struct nexus_device *ndev = DEVTONX(child); int retval = 0; retval += bus_print_child_header(bus, child); retval += nexus_print_all_resources(child); - if (ndev->nx_pcibus != -1) - retval += printf(" pcibus %d", ndev->nx_pcibus); retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */ return (retval); @@ -278,7 +261,6 @@ if (!ndev) return(0); resource_list_init(&ndev->nx_resources); - ndev->nx_pcibus = -1; child = device_add_child_ordered(bus, order, name, unit); @@ -288,38 +270,6 @@ return(child); } -static int -nexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) -{ - struct nexus_device *ndev = DEVTONX(child); - - switch (which) { - case NEXUS_IVAR_PCIBUS: - *result = ndev->nx_pcibus; - break; - default: - return ENOENT; - } - return 0; -} - - -static int -nexus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) -{ - struct nexus_device *ndev = DEVTONX(child); - - switch (which) { - case NEXUS_IVAR_PCIBUS: - ndev->nx_pcibus = value; - break; - default: - return ENOENT; - } - return 0; -} - - /* * Allocate a resource on behalf of child. NB: child is usually going to be a * child of one of our descendants, not a direct child of nexus0. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209260605.g8Q65o6A080227>