Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48405
b: refs/heads/master
c: 6a0668f
h: refs/heads/master
i:
  48403: 5d14e5f
v: v3
  • Loading branch information
Olivier Galibert authored and Andi Kleen committed Feb 13, 2007
1 parent 4238f11 commit e7d3423
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9358c693c5ac1afde28f24ac651f7903d32a850c
refs/heads/master: 6a0668fc41fa479df617151c2d4e297299a4ffe2
33 changes: 33 additions & 0 deletions trunk/arch/i386/pci/mmconfig-shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,37 @@ static int __init pci_mmcfg_check_hostbridge(void)
return name != NULL;
}

static __init void pci_mmcfg_insert_resources(void)
{
#define PCI_MMCFG_RESOURCE_NAME_LEN 19
int i;
struct resource *res;
char *names;
unsigned num_buses;

res = kcalloc(PCI_MMCFG_RESOURCE_NAME_LEN + sizeof(*res),
pci_mmcfg_config_num, GFP_KERNEL);

if (!res) {
printk(KERN_ERR "PCI: Unable to allocate MMCONFIG resources\n");
return;
}

names = (void *)&res[pci_mmcfg_config_num];
for (i = 0; i < pci_mmcfg_config_num; i++, res++) {
num_buses = pci_mmcfg_config[i].end_bus_number -
pci_mmcfg_config[i].start_bus_number + 1;
res->name = names;
snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN, "PCI MMCONFIG %u",
pci_mmcfg_config[i].pci_segment);
res->start = pci_mmcfg_config[i].address;
res->end = res->start + (num_buses << 20) - 1;
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
insert_resource(&iomem_resource, res);
names += PCI_MMCFG_RESOURCE_NAME_LEN;
}
}

void __init pci_mmcfg_init(int type)
{
int known_bridge = 0;
Expand Down Expand Up @@ -199,6 +230,8 @@ void __init pci_mmcfg_init(int type)
if (pci_mmcfg_arch_init()) {
if (type == 1)
unreachable_devices();
if (known_bridge)
pci_mmcfg_insert_resources();
pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
}
}

0 comments on commit e7d3423

Please sign in to comment.