Date: Wed, 4 May 2011 21:51:50 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 192619 for review Message-ID: <201105042151.p44Lpofx020940@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@192619?ac=10 Change 192619 by jhb@jhb_jhbbsd on 2011/05/04 21:51:21 Hacking on mptable host res support. Affected files ... .. //depot/projects/pci/sys/x86/include/mptable.h#3 edit .. //depot/projects/pci/sys/x86/x86/mptable.c#3 edit .. //depot/projects/pci/sys/x86/x86/mptable_pci.c#6 edit Differences ... ==== //depot/projects/pci/sys/x86/include/mptable.h#3 (text+ko) ==== @@ -187,6 +187,15 @@ } basetable_entry; #ifdef _KERNEL +#ifdef NEW_PCIB +struct mptable_hostb_softc { + struct pcib_host_resources sc_host_res; + int sc_decodes_vga_io; + int sc_decodes_isa_io; +}; + +void mptable_pci_host_res_init(device_t pcib); +#endif int mptable_pci_probe_table(int bus); int mptable_pci_route_interrupt(device_t pcib, device_t dev, int pin); #endif ==== //depot/projects/pci/sys/x86/x86/mptable.c#3 (text+ko) ==== @@ -1081,3 +1081,18 @@ 'A' + pin, args.vector); return (args.vector); } + +#ifdef NEW_PCIB +/* + * Initialize a Host-PCI bridge so it can restrict resource allocation + * requests to the resources it actually decodes according to MP + * config table extended entries. + */ +void +mptable_pci_host_res_init(device_t pcib) +{ + struct mptable_hostb_softc *sc; + + sc = device_get_softc(dev); +} +#endif ==== //depot/projects/pci/sys/x86/x86/mptable_pci.c#6 (text+ko) ==== @@ -68,7 +68,11 @@ static int mptable_hostb_attach(device_t dev) { + struct mptable_hostb_softc *sc; +#ifdef NEW_PCIB + mptable_pci_host_res_init(dev); +#endif device_add_child(dev, "pci", pcib_get_bus(dev)); return (bus_generic_attach(dev)); } @@ -104,6 +108,20 @@ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); } +#ifdef NEW_PCIB +static struct resource * +mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct mptable_hostb_softc *sc; + + sc = device_get_softc(dev); + /* XXX: Special handling for VGA and ISA I/O ranges. */ + return (pcib_host_res_alloc(&sc->sc_host_res, child, type, rid, start, + end, count, flags)); +} +#endif + static device_method_t mptable_hostb_methods[] = { /* Device interface */ DEVMETHOD(device_probe, mptable_hostb_probe),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105042151.p44Lpofx020940>