[SeaBIOS] [PATCH 5/6] Get rid of size element of pci_bus->r structure
Alexey Korolev
alexey.korolev at endace.com
Tue Mar 13 06:05:23 CET 2012
The size element of pci_bus->r structure is no longer need as the
information about bridge region size is stored in pci_region_entry
structure.
Signed-off-by: Alexey Korolev <alexey.korolev at endace.com>
---
src/pciinit.c | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/pciinit.c b/src/pciinit.c
index 468aa66..0743e68 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -48,7 +48,6 @@ struct pci_bus {
struct {
/* pci region stats */
u32 sum, max;
- u32 size;
u32 base;
struct pci_region_entry *list;
} r[PCI_REGION_TYPE_COUNT];
@@ -416,24 +415,22 @@ static int pci_bios_check_devices(struct pci_bus *busses)
continue;
struct pci_bus *parent = &busses[pci_bdf_to_bus(s->bus_dev->bdf)];
int type;
+ u32 size;
for (type = 0; type < PCI_REGION_TYPE_COUNT; type++) {
u32 limit = (type == PCI_REGION_TYPE_IO) ?
PCI_BRIDGE_IO_MIN : PCI_BRIDGE_MEM_MIN;
- s->r[type].size = s->r[type].sum;
- if (s->r[type].size < limit)
- s->r[type].size = limit;
- s->r[type].size = pci_size_roundup(s->r[type].size);
- entry = pci_region_create_entry(parent, s->bus_dev,
- s->r[type].size, type, 0);
+ size = s->r[type].sum;
+ if (size < limit)
+ size = limit;
+ size = pci_size_roundup(size);
+ entry = pci_region_create_entry(parent, s->bus_dev, size, type, 0);
if (!entry)
return -1;
entry->this_bus = s;
+ dprintf(1, "PCI: secondary bus %d size 0x%x type %s\n",
+ entry->dev->secondary_bus, size,
+ region_type_name[entry->type]);
}
- dprintf(1, "PCI: secondary bus %d sizes: io %x, mem %x, prefmem %x\n",
- secondary_bus,
- s->r[PCI_REGION_TYPE_IO].size,
- s->r[PCI_REGION_TYPE_MEM].size,
- s->r[PCI_REGION_TYPE_PREFMEM].size);
}
return 0;
}
--
1.7.5.4
More information about the SeaBIOS
mailing list