x86/PCI: dynamically allocate pci_root_info for native host bridge drivers

This dynamically allocates struct pci_root_info instead of using a
static array.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
Yinghai Lu
2012-04-02 18:31:54 -07:00
committed by Bjorn Helgaas
父節點 35cb05e5bd
當前提交 d28e5ac2a0
共有 4 個文件被更改,包括 90 次插入89 次删除

查看文件

@@ -4,22 +4,24 @@
* sub bus (transparent) will use entres from 3 to store extra from
* root, so need to make sure we have enough slot there.
*/
#define RES_NUM 16
struct pci_root_res {
struct list_head list;
struct resource res;
};
struct pci_root_info {
struct list_head list;
char name[12];
unsigned int res_num;
struct resource res[RES_NUM];
struct list_head resources;
int bus_min;
int bus_max;
int node;
int link;
};
/* 4 at this time, it may become to 32 */
#define PCI_ROOT_NR 4
extern int pci_root_num;
extern struct pci_root_info pci_root_info[PCI_ROOT_NR];
extern struct list_head pci_root_infos;
struct pci_root_info *alloc_pci_root_info(int bus_min, int bus_max,
int node, int link);
extern void update_res(struct pci_root_info *info, resource_size_t start,
resource_size_t end, unsigned long flags, int merge);
#endif