summary refs log tree commit diff stats
path: root/hw/i386/fw_cfg.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-07 16:01:59 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-11 20:03:26 +0100
commitbb99b92a6b1828fe7e37497ad1aac157cdcb36b5 (patch)
treedd2e6248c95654b872a5caf844ca949df45ede1d /hw/i386/fw_cfg.c
parente6ffea40e221d26a213a59cba2598e15f01facf3 (diff)
downloadfocaccia-qemu-bb99b92a6b1828fe7e37497ad1aac157cdcb36b5.tar.gz
focaccia-qemu-bb99b92a6b1828fe7e37497ad1aac157cdcb36b5.zip
hw/i386/fw_cfg: Check ACPI availability with acpi_builtin()
Define acpi_tables / acpi_tables_len stubs, then replace the
compile-time CONFIG_ACPI check in fw_cfg.c by a runtime one.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Message-Id: <20250307223949.54040-4-philmd@linaro.org>
Diffstat (limited to 'hw/i386/fw_cfg.c')
-rw-r--r--hw/i386/fw_cfg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index d08aefa029..a7f1b60b98 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -145,10 +145,10 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms,
      */
     fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, apic_id_limit);
     fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
-#ifdef CONFIG_ACPI
-    fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
-                     acpi_tables, acpi_tables_len);
-#endif
+    if (acpi_builtin()) {
+        fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
+                         acpi_tables, acpi_tables_len);
+    }
     fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, 1);
 
     fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, &hpet_fw_cfg, sizeof(hpet_fw_cfg));