Skip to content

Commit e6ffea4

Browse files
committed
hw/acpi: Introduce acpi_builtin() helper
acpi_builtin() can be used to check at runtime whether the ACPI subsystem is built in a qemu-system binary. Reviewed-by: Ani Sinha <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Message-Id: <[email protected]>
1 parent 44ac8ea commit e6ffea4

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

hw/acpi/acpi-stub.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
2525
{
2626
g_assert_not_reached();
2727
}
28+
29+
bool acpi_builtin(void)
30+
{
31+
return false;
32+
}

hw/acpi/core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ static void acpi_register_config(void)
7878

7979
opts_init(acpi_register_config);
8080

81+
bool acpi_builtin(void)
82+
{
83+
return true;
84+
}
85+
8186
static int acpi_checksum(const uint8_t *data, int len)
8287
{
8388
int sum, i;

include/hw/acpi/acpi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ struct ACPIREGS {
150150
Notifier wakeup;
151151
};
152152

153+
/* Return whether ACPI subsystem is built in */
154+
bool acpi_builtin(void);
155+
153156
/* PM_TMR */
154157
void acpi_pm_tmr_update(ACPIREGS *ar, bool enable);
155158
void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar);

0 commit comments

Comments
 (0)