mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
e6ffea40e2
commit
bb99b92a6b
2 changed files with 7 additions and 4 deletions
|
@ -21,6 +21,9 @@
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "hw/acpi/acpi.h"
|
#include "hw/acpi/acpi.h"
|
||||||
|
|
||||||
|
char unsigned *acpi_tables;
|
||||||
|
size_t acpi_tables_len;
|
||||||
|
|
||||||
void acpi_table_add(const QemuOpts *opts, Error **errp)
|
void acpi_table_add(const QemuOpts *opts, Error **errp)
|
||||||
{
|
{
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
|
|
|
@ -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_i16(fw_cfg, FW_CFG_MAX_CPUS, apic_id_limit);
|
||||||
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
|
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
|
||||||
#ifdef CONFIG_ACPI
|
if (acpi_builtin()) {
|
||||||
fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
|
fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
|
||||||
acpi_tables, acpi_tables_len);
|
acpi_tables, acpi_tables_len);
|
||||||
#endif
|
}
|
||||||
fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, 1);
|
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));
|
fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, &hpet_fw_cfg, sizeof(hpet_fw_cfg));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue