PERFORCE change 195169 for review

John Baldwin jhb at FreeBSD.org
Wed Jun 22 21:33:39 UTC 2011


http://p4web.freebsd.org/@@195169?ac=10

Change 195169 by jhb at 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 <sys/param.h>
@@ -11,8 +12,10 @@
 #include <sys/rman.h>
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
+#include <dev/pci/pci_private.h>
 #include <dev/pci/pcib_private.h>
 
+#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);


More information about the p4-projects mailing list