From: Oliver Steffen Date: Fri, 30 Jan 2026 05:47:08 +0000 (+0100) Subject: hw/acpi: Add standalone function to build MADT X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=403b7db067d7ef27c6de6968cddb5277e3be7126;p=thirdparty%2Fqemu.git hw/acpi: Add standalone function to build MADT Add a function called `acpi_build_madt_standalone()` that builds a MADT without the rest of the ACPI table structure. Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-4-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 9446a9f862..19c62362e3 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2249,3 +2249,12 @@ void acpi_setup(void) */ acpi_build_tables_cleanup(&tables, false); } + +GArray *acpi_build_madt_standalone(MachineState *machine) +{ + X86MachineState *x86ms = X86_MACHINE(machine); + GArray *table = g_array_new(false, true, 1); + acpi_build_madt(table, NULL, x86ms, x86ms->oem_id, + x86ms->oem_table_id); + return table; +} diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h index 8ba3c33e48..00e19bbe5e 100644 --- a/hw/i386/acpi-build.h +++ b/hw/i386/acpi-build.h @@ -8,4 +8,6 @@ extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio; void acpi_setup(void); Object *acpi_get_i386_pci_host(void); +GArray *acpi_build_madt_standalone(MachineState *machine); + #endif