From f4bf22c8e5093fa65b0c95467c918a2812daef66 Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Wed, 8 Apr 2015 10:51:45 +0200 Subject: LIBPCI: new implementation private header file - new implementation private header file - moved double implementation of pci_dev_create used by read & auto cfg libraries to common pci_dev_create.c - moved declaration of pci_bus_cnt to private header file so avoid extern in .c files --- cpukit/libpci/pci_cfg_read.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'cpukit/libpci/pci_cfg_read.c') diff --git a/cpukit/libpci/pci_cfg_read.c b/cpukit/libpci/pci_cfg_read.c index a2154d2abe..b1ea0709aa 100644 --- a/cpukit/libpci/pci_cfg_read.c +++ b/cpukit/libpci/pci_cfg_read.c @@ -14,6 +14,8 @@ #include #include +#include "pci_internal.h" + /* PCI Library * (For debugging it might be good to use other functions or the driver's * directly) @@ -31,29 +33,9 @@ #define DBG(args...) #endif -/* Number of buses */ -extern int pci_bus_cnt; - /* The Host Bridge bus is initialized here */ extern struct pci_bus pci_hb; -static struct pci_dev *pci_dev_create(int isbus) -{ - void *ptr; - int size; - - if (isbus) - size = sizeof(struct pci_bus); - else - size = sizeof(struct pci_dev); - - ptr = malloc(size); - if (!ptr) - rtems_fatal_error_occurred(RTEMS_NO_MEMORY); - memset(ptr, 0, size); - return ptr; -} - /* Check if address is accessible from host */ static int pci_read_addressable(struct pci_dev *dev, struct pci_res *res) { -- cgit v1.2.3