mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
acpi: arm/virt: madt: use build_append_int_noprefix() API to compose MADT table
Drop usage of packed structures and explicit endian conversions when building MADT table for arm/x86 and use endian agnostic build_append_int_noprefix() API to build it. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Message-Id: <20210924122802.1455362-26-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
dd092b9c60
commit
37f33084ed
2 changed files with 89 additions and 143 deletions
|
@ -163,90 +163,6 @@ struct AcpiFacsDescriptorRev1 {
|
|||
} QEMU_PACKED;
|
||||
typedef struct AcpiFacsDescriptorRev1 AcpiFacsDescriptorRev1;
|
||||
|
||||
/* Values for Type in APIC sub-headers */
|
||||
|
||||
#define ACPI_APIC_GENERIC_CPU_INTERFACE 11
|
||||
#define ACPI_APIC_GENERIC_DISTRIBUTOR 12
|
||||
#define ACPI_APIC_GENERIC_MSI_FRAME 13
|
||||
#define ACPI_APIC_GENERIC_REDISTRIBUTOR 14
|
||||
#define ACPI_APIC_GENERIC_TRANSLATOR 15
|
||||
#define ACPI_APIC_RESERVED 16 /* 16 and greater are reserved */
|
||||
|
||||
/*
|
||||
* MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE)
|
||||
*/
|
||||
#define ACPI_SUB_HEADER_DEF /* Common ACPI sub-structure header */\
|
||||
uint8_t type; \
|
||||
uint8_t length;
|
||||
|
||||
/* Sub-structures for MADT */
|
||||
|
||||
struct AcpiMadtGenericCpuInterface {
|
||||
ACPI_SUB_HEADER_DEF
|
||||
uint16_t reserved;
|
||||
uint32_t cpu_interface_number;
|
||||
uint32_t uid;
|
||||
uint32_t flags;
|
||||
uint32_t parking_version;
|
||||
uint32_t performance_interrupt;
|
||||
uint64_t parked_address;
|
||||
uint64_t base_address;
|
||||
uint64_t gicv_base_address;
|
||||
uint64_t gich_base_address;
|
||||
uint32_t vgic_interrupt;
|
||||
uint64_t gicr_base_address;
|
||||
uint64_t arm_mpidr;
|
||||
} QEMU_PACKED;
|
||||
|
||||
typedef struct AcpiMadtGenericCpuInterface AcpiMadtGenericCpuInterface;
|
||||
|
||||
/* GICC CPU Interface Flags */
|
||||
#define ACPI_MADT_GICC_ENABLED 1
|
||||
|
||||
struct AcpiMadtGenericDistributor {
|
||||
ACPI_SUB_HEADER_DEF
|
||||
uint16_t reserved;
|
||||
uint32_t gic_id;
|
||||
uint64_t base_address;
|
||||
uint32_t global_irq_base;
|
||||
/* ACPI 5.1 Errata 1228 Present GIC version in MADT table */
|
||||
uint8_t version;
|
||||
uint8_t reserved2[3];
|
||||
} QEMU_PACKED;
|
||||
|
||||
typedef struct AcpiMadtGenericDistributor AcpiMadtGenericDistributor;
|
||||
|
||||
struct AcpiMadtGenericMsiFrame {
|
||||
ACPI_SUB_HEADER_DEF
|
||||
uint16_t reserved;
|
||||
uint32_t gic_msi_frame_id;
|
||||
uint64_t base_address;
|
||||
uint32_t flags;
|
||||
uint16_t spi_count;
|
||||
uint16_t spi_base;
|
||||
} QEMU_PACKED;
|
||||
|
||||
typedef struct AcpiMadtGenericMsiFrame AcpiMadtGenericMsiFrame;
|
||||
|
||||
struct AcpiMadtGenericRedistributor {
|
||||
ACPI_SUB_HEADER_DEF
|
||||
uint16_t reserved;
|
||||
uint64_t base_address;
|
||||
uint32_t range_length;
|
||||
} QEMU_PACKED;
|
||||
|
||||
typedef struct AcpiMadtGenericRedistributor AcpiMadtGenericRedistributor;
|
||||
|
||||
struct AcpiMadtGenericTranslator {
|
||||
ACPI_SUB_HEADER_DEF
|
||||
uint16_t reserved;
|
||||
uint32_t translation_id;
|
||||
uint64_t base_address;
|
||||
uint32_t reserved2;
|
||||
} QEMU_PACKED;
|
||||
|
||||
typedef struct AcpiMadtGenericTranslator AcpiMadtGenericTranslator;
|
||||
|
||||
/*
|
||||
* Generic Timer Description Table (GTDT)
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue