Ignore:
Timestamp:
Jul 26, 2017, 1:20:36 PM (5 years ago)
Author:
max@…
Message:

Add a SRAT parser. For some reason, QEMU does not want to enable the
memory ranges...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_acpi.h

    r241 r275  
    192192typedef struct acpi_madt_io_apic madt_ioapic_t;
    193193
     194/*******************************************************************************
     195 * SRAT - System Resource Affinity Table
     196 *        Version 3
     197 ******************************************************************************/
     198
     199struct acpi_table_srat {
     200        header_t Header;        /* Common ACPI table header */
     201        uint32_t TableRevision; /* Must be value '1' */
     202        uint64_t Reserved;      /* Reserved, must be zero */
     203};
     204typedef struct acpi_table_srat  srat_t;
     205
     206/*******************************************************************************
     207 * SRAT structures
     208 ******************************************************************************/
     209
     210enum AcpiSratType {
     211        ACPI_SRAT_TYPE_CPU_AFFINITY        = 0,
     212        ACPI_SRAT_TYPE_MEMORY_AFFINITY     = 1,
     213        ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
     214        ACPI_SRAT_TYPE_GICC_AFFINITY       = 3,
     215        ACPI_SRAT_TYPE_RESERVED            = 4  /* 4 and greater are reserved */
     216};
     217
     218#define ACPI_SRAT_CPU_USE_AFFINITY  (1) /* 00: Use affinity structure */
     219
     220struct acpi_srat_cpu_affinity {
     221        subheader_t Header;
     222        uint8_t ProximityDomainLo;
     223        uint8_t ApicId;
     224        uint32_t Flags;
     225        uint8_t LocalSapicEid;
     226        uint8_t ProximityDomainHi[3];
     227        uint32_t ClockDomain;
     228};
     229typedef struct acpi_srat_cpu_affinity   srat_cpu_affinity_t;
     230
     231#define ACPI_SRAT_MEM_ENABLED       (1)    /* 00: Use affinity structure */
     232#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
     233#define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2) /* 02: Memory region is non-volatile */
     234
     235struct acpi_srat_mem_affinity {
     236        subheader_t Header;
     237        uint32_t ProximityDomain;
     238        uint16_t Reserved;        /* Reserved, must be zero */
     239        uint64_t BaseAddress;
     240        uint64_t Length;
     241        uint32_t Reserved1;
     242        uint32_t Flags;
     243        uint64_t Reserved2;       /* Reserved, must be zero */
     244};
     245typedef struct acpi_srat_mem_affinity   srat_mem_affinity_t;
     246
Note: See TracChangeset for help on using the changeset viewer.