diff options
Diffstat (limited to 'hw/acpi/utils.c')
-rw-r--r-- | hw/acpi/utils.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/hw/acpi/utils.c b/hw/acpi/utils.c index a134a4d554..0c486ea29f 100644 --- a/hw/acpi/utils.c +++ b/hw/acpi/utils.c @@ -27,9 +27,22 @@ #include "hw/loader.h" MemoryRegion *acpi_add_rom_blob(FWCfgCallback update, void *opaque, - GArray *blob, const char *name, - uint64_t max_size) + GArray *blob, const char *name) { + uint64_t max_size; + + /* Reserve RAM space for tables: add another order of magnitude. */ + if (!strcmp(name, ACPI_BUILD_TABLE_FILE)) { + max_size = 0x200000; + } else if (!strcmp(name, ACPI_BUILD_LOADER_FILE)) { + max_size = 0x10000; + } else if (!strcmp(name, ACPI_BUILD_RSDP_FILE)) { + max_size = 0x1000; + } else { + g_assert_not_reached(); + } + g_assert(acpi_data_len(blob) <= max_size); + return rom_add_blob(name, blob->data, acpi_data_len(blob), max_size, -1, name, update, opaque, NULL, true); } |