FACS table is created as a mockup, as with the Hardware Reduced bit set it will not be used.
Update the header definitions for FACS taking into account the new additions of ACPI v5.1 in `include/hw/acpi/acpi-defs.h` Signed-off-by: Shannon Zhao <zhaoshengl...@huawei.com> --- hw/arm/virt-acpi-build.c | 4 ++++ include/hw/acpi/acpi-defs.h | 28 +++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e3c708d..de1f307 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -250,6 +250,10 @@ build_fadt(GArray *table_data, GArray *linker, uint64_t facs, uint64_t dsdt) static void build_facs(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) { + AcpiFacsDescriptorRev5_1 *facs = acpi_data_push(table_data, sizeof *facs); + memcpy(&facs->signature, "FACS", sizeof(facs->signature)); + facs->length = cpu_to_le32(sizeof(*facs)); + facs->version = 0x02; } /* DSDT */ diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index c1255fa..91b3520 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -196,20 +196,34 @@ struct AcpiRsdtDescriptorRev1 typedef struct AcpiRsdtDescriptorRev1 AcpiRsdtDescriptorRev1; /* - * ACPI 1.0 Firmware ACPI Control Structure (FACS) + * ACPI Firmware ACPI Control Structure (FACS) */ +#define ACPI_FACS_COMMON_DEF /* FACS common definition */ \ + uint32_t signature; /* ACPI Signature */ \ + uint32_t length; /* Length of structure, in bytes */ \ + uint32_t hardware_signature; /* Hardware configuration signature */ \ + uint32_t firmware_waking_vector; /* ACPI OS waking vector */ \ + uint32_t global_lock; /* Global Lock */ \ + uint32_t flags; + struct AcpiFacsDescriptorRev1 { - uint32_t signature; /* ACPI Signature */ - uint32_t length; /* Length of structure, in bytes */ - uint32_t hardware_signature; /* Hardware configuration signature */ - uint32_t firmware_waking_vector; /* ACPI OS waking vector */ - uint32_t global_lock; /* Global Lock */ - uint32_t flags; + ACPI_FACS_COMMON_DEF uint8_t resverved3 [40]; /* Reserved - must be zero */ } QEMU_PACKED; typedef struct AcpiFacsDescriptorRev1 AcpiFacsDescriptorRev1; +struct AcpiFacsDescriptorRev5_1 { + ACPI_FACS_COMMON_DEF + /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ + uint64_t xfirmware_waking_vector; + uint8_t version; /* Version of this table (ACPI 2.0+) */ + uint8_t reserved[3]; /* Reserved, must be zero */ + uint32_t ospm_flags; /* Flags to be set by OSPM (ACPI 4.0) */ + uint8_t reserved1[24]; /* Reserved, must be zero */ +} QEMU_PACKED; +typedef struct AcpiFacsDescriptorRev5_1 AcpiFacsDescriptorRev5_1; + /* * Differentiated System Description Table (DSDT) */ -- 1.7.1