Skip to content

Commit bb99b92

Browse files
committed
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é <[email protected]> Reviewed-by: Ani Sinha <[email protected]> Message-Id: <[email protected]>
1 parent e6ffea4 commit bb99b92

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

hw/acpi/acpi-stub.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include "qemu/osdep.h"
2222
#include "hw/acpi/acpi.h"
2323

24+
char unsigned *acpi_tables;
25+
size_t acpi_tables_len;
26+
2427
void acpi_table_add(const QemuOpts *opts, Error **errp)
2528
{
2629
g_assert_not_reached();

hw/i386/fw_cfg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms,
145145
*/
146146
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, apic_id_limit);
147147
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
148-
#ifdef CONFIG_ACPI
149-
fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
150-
acpi_tables, acpi_tables_len);
151-
#endif
148+
if (acpi_builtin()) {
149+
fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
150+
acpi_tables, acpi_tables_len);
151+
}
152152
fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, 1);
153153

154154
fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, &hpet_fw_cfg, sizeof(hpet_fw_cfg));

0 commit comments

Comments
 (0)