Save the IO/mem/bus numbers ranges assigned to the extra root busses
to be removed from the root bus 0 range.
Signed-off-by: Marcel Apfelbaum <address@hidden>
---
hw/i386/acpi-build.c | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 146 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index ee1a50a..0822a20 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -719,6 +719,145 @@ static AcpiAml build_prt(void)
return method;
}
+typedef struct PciRangeEntry {
+ QLIST_ENTRY(PciRangeEntry) entry;
+ int64_t base;
+ int64_t limit;
+} PciRangeEntry;
+
+typedef QLIST_HEAD(PciRangeQ, PciRangeEntry) PciRangeQ;
+
+static void pci_range_insert(PciRangeQ *list, int64_t base, int64_t limit) {
+ PciRangeEntry *entry, *next, *e;
+
+ if (!base) {
+ return;
+ }
+
+ if (limit - base + 1 < 0x1000)
+ limit = base + 0x1000 - 1;