From owner-p4-projects@FreeBSD.ORG Wed Jun 22 21:33:39 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F2DA6106566C; Wed, 22 Jun 2011 21:33:38 +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 9D04C106564A for ; Wed, 22 Jun 2011 21:33:38 +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 7F9A68FC15 for ; Wed, 22 Jun 2011 21:33:38 +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 p5MLXcRX096202 for ; Wed, 22 Jun 2011 21:33:38 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p5MLXcgV096199 for perforce@freebsd.org; Wed, 22 Jun 2011 21:33:38 GMT (envelope-from jhb@freebsd.org) Date: Wed, 22 Jun 2011 21:33:38 GMT Message-Id: <201106222133.p5MLXcgV096199@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 195169 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, 22 Jun 2011 21:33:39 -0000 http://p4web.freebsd.org/@@195169?ac=10 Change 195169 by jhb@jhb_jhbbsd on 2011/06/22 21:33:14 Some cleanups. Affected files ... .. //depot/projects/pci/sys/dev/pci/pci_domain.c#12 edit .. //depot/projects/pci/sys/dev/pci/pci_private.h#6 edit .. //depot/projects/pci/sys/dev/pci/pcib_private.h#17 edit Differences ... ==== //depot/projects/pci/sys/dev/pci/pci_domain.c#12 (text+ko) ==== @@ -1,7 +1,8 @@ /*- - * XXX: Rename this file to something else, maybe pcib_subr.c? + * XXX: Rename this file to something else, maybe pci_subr.c? * - * Support utilities for Host to PCI bridge drivers. + * Support APIs for Host to PCI bridge drivers and drivers that + * provide PCI domains. */ #include @@ -11,8 +12,10 @@ #include #include #include +#include #include +#ifdef PCI_RES_BUS struct pci_domain { int pd_domain; struct rman pd_bus_rman; @@ -105,7 +108,9 @@ #endif return (rman_release_resource(r)); } +#endif /* PCI_RES_BUS */ +#ifdef NEW_PCIB /* * Some Host-PCI bridge drivers know which resource ranges they can * decode and should only allocate subranges to child PCI devices. @@ -240,3 +245,4 @@ } return (ERANGE); } +#endif /* NEW_PCIB */ ==== //depot/projects/pci/sys/dev/pci/pci_private.h#6 (text+ko) ==== @@ -124,4 +124,13 @@ */ void pci_cfg_save(device_t, struct pci_devinfo *, int); +#ifdef PCI_RES_BUS +struct resource *pci_domain_alloc_bus(int domain, device_t dev, int *rid, + u_long start, u_long end, u_long count, u_int flags); +int pci_domain_adjust_bus(int domain, device_t dev, + struct resource *r, u_long start, u_long end); +int pci_domain_release_bus(int domain, device_t dev, int rid, + struct resource *r); +#endif + #endif /* _PCI_PRIVATE_H_ */ ==== //depot/projects/pci/sys/dev/pci/pcib_private.h#17 (text+ko) ==== @@ -43,6 +43,19 @@ device_t hr_pcib; struct resource_list hr_rl; }; + +int pcib_host_res_init(device_t pcib, + struct pcib_host_resources *hr); +int pcib_host_res_free(device_t pcib, + struct pcib_host_resources *hr); +int pcib_host_res_decodes(struct pcib_host_resources *hr, int type, + u_long start, u_long end, u_int flags); +struct resource *pcib_host_res_alloc(struct pcib_host_resources *hr, + device_t dev, int type, int *rid, u_long start, u_long end, + u_long count, u_int flags); +int pcib_host_res_adjust(struct pcib_host_resources *hr, + device_t dev, int type, struct resource *r, u_long start, + u_long end); #endif /* @@ -104,24 +117,6 @@ #ifdef NEW_PCIB const char *pcib_child_name(device_t child); -int pcib_host_res_init(device_t pcib, - struct pcib_host_resources *hr); -int pcib_host_res_free(device_t pcib, - struct pcib_host_resources *hr); -int pcib_host_res_decodes(struct pcib_host_resources *hr, int type, - u_long start, u_long end, u_int flags); -struct resource *pcib_host_res_alloc(struct pcib_host_resources *hr, - device_t dev, int type, int *rid, u_long start, u_long end, - u_long count, u_int flags); -int pcib_host_res_adjust(struct pcib_host_resources *hr, - device_t dev, int type, struct resource *r, u_long start, - u_long end); -struct resource *pci_domain_alloc_bus(int domain, device_t dev, int *rid, - u_long start, u_long end, u_long count, u_int flags); -int pci_domain_adjust_bus(int domain, device_t dev, - struct resource *r, u_long start, u_long end); -int pci_domain_release_bus(int domain, device_t dev, int rid, - struct resource *r); #endif int host_pcib_get_busno(pci_read_config_fn read_config, int bus, int slot, int func, uint8_t *busnum);