From owner-p4-projects@FreeBSD.ORG Wed May 4 21:51:52 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D30811065759; Wed, 4 May 2011 21:51:51 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 290271065679 for ; Wed, 4 May 2011 21:51:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id EDF298FC20 for ; Wed, 4 May 2011 21:51:50 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p44LpoIJ020943 for ; Wed, 4 May 2011 21:51:50 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p44Lpofx020940 for perforce@freebsd.org; Wed, 4 May 2011 21:51:50 GMT (envelope-from jhb@freebsd.org) Date: Wed, 4 May 2011 21:51:50 GMT Message-Id: <201105042151.p44Lpofx020940@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 192619 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 21:51:52 -0000 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),