diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2015-04-08 10:51:45 +0200 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2015-04-17 01:10:28 +0200 |
commit | f4bf22c8e5093fa65b0c95467c918a2812daef66 (patch) | |
tree | 30f567c90c5bf2cc85e7382a5410a934907dd10d /cpukit/libpci/pci_cfg_read.c | |
parent | LIBPCI: various comment/unsed clean-ups (diff) | |
download | rtems-f4bf22c8e5093fa65b0c95467c918a2812daef66.tar.bz2 |
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
Diffstat (limited to 'cpukit/libpci/pci_cfg_read.c')
-rw-r--r-- | cpukit/libpci/pci_cfg_read.c | 22 |
1 files changed, 2 insertions, 20 deletions
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 <pci/cfg.h> #include <pci/access.h> +#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) { |