41 if (*(UINT32 *)Ptr != 1) {
43 Print (L
"\nERROR: Reserved should be 1 for backward compatibility.\n");
65 UINT8 DeviceHandleType;
67 DeviceHandleType = *Ptr;
69 if (DeviceHandleType > EFI_ACPI_6_3_PCI_DEVICE_HANDLE) {
72 L
"\nERROR: Invalid Device Handle Type: %d. Must be between 0 and %d.",
74 EFI_ACPI_6_3_PCI_DEVICE_HANDLE
95 CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
133 (*Ptr & (BIT7 | BIT6 | BIT5 | BIT4 | BIT3)) >> 3
140 L
"PCI Function Number"
145 *Ptr & (BIT2 | BIT1 | BIT0)
164 { L
"Reserved", 12, 4, L
"%x %x %x %x - %x %x %x %x - %x %x %x %x",
Dump12Chars,
185 if (SratDeviceHandleType ==
NULL) {
187 Print (L
"\nERROR: Device Handle Type read incorrectly.\n");
193 if (*SratDeviceHandleType == EFI_ACPI_6_3_ACPI_DEVICE_HANDLE) {
202 }
else if (*SratDeviceHandleType == EFI_ACPI_6_3_PCI_DEVICE_HANDLE) {
230 UINT32 ProximityDomain;
232 ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16);
234 Print (Format, ProximityDomain);
287 { L
"Device Handle Type", 1, 3, L
"%d",
NULL, (VOID **)&SratDeviceHandleType,
367 IN UINT32 AcpiTableLength,
368 IN UINT8 AcpiTableRevision
373 UINT32 GicCAffinityIndex;
374 UINT32 GicITSAffinityIndex;
375 UINT32 GenericInitiatorAffinityIndex;
376 UINT32 MemoryAffinityIndex;
377 UINT32 ApicSapicAffinityIndex;
378 UINT32 X2ApicAffinityIndex;
381 GicCAffinityIndex = 0;
382 GicITSAffinityIndex = 0;
383 GenericInitiatorAffinityIndex = 0;
384 MemoryAffinityIndex = 0;
385 ApicSapicAffinityIndex = 0;
386 X2ApicAffinityIndex = 0;
401 ResourcePtr = Ptr + Offset;
403 while (Offset < AcpiTableLength) {
409 AcpiTableLength - Offset,
415 if ((SratRAType ==
NULL) ||
416 (SratRALength ==
NULL))
420 L
"ERROR: Insufficient remaining table buffer length to read the " \
421 L
"Static Resource Allocation structure header. Length = %d.\n",
422 AcpiTableLength - Offset
428 if ((*SratRALength == 0) ||
429 ((Offset + (*SratRALength)) > AcpiTableLength))
433 L
"ERROR: Invalid Static Resource Allocation Structure length. " \
434 L
"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
442 switch (*SratRAType) {
443 case EFI_ACPI_6_3_GICC_AFFINITY:
447 "GICC Affinity Structure [%d]",
460 case EFI_ACPI_6_3_GIC_ITS_AFFINITY:
464 "GIC ITS Affinity Structure [%d]",
465 GicITSAffinityIndex++
477 case EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY:
481 "Generic Initiator Affinity Structure [%d]",
482 GenericInitiatorAffinityIndex++
494 case EFI_ACPI_6_3_MEMORY_AFFINITY:
498 "Memory Affinity Structure [%d]",
499 MemoryAffinityIndex++
511 case EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY:
515 "APIC/SAPIC Affinity Structure [%d]",
516 ApicSapicAffinityIndex++
528 case EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY:
532 "X2APIC Affinity Structure [%d]",
533 X2ApicAffinityIndex++
547 Print (L
"ERROR: Unknown SRAT Affinity type = 0x%x\n", *SratRAType);
551 ResourcePtr += (*SratRALength);
552 Offset += (*SratRALength);
VOID EFIAPI PrintFieldName(IN UINT32 Indent, IN CONST CHAR16 *FieldName)
VOID EFIAPI Dump12Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI IncrementErrorCount(VOID)
UINT32 EFIAPI ParseAcpi(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
#define PARSER_PARAMS(Parser)
#define PARSE_ACPI_HEADER(Info)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
UINTN EFIAPI AsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
STATIC CONST ACPI_PARSER SratGicCAffinityParser[]
STATIC VOID EFIAPI DumpSratPciBdfNumber(IN CONST CHAR16 *Format, IN UINT8 *Ptr, IN UINT32 Length)
STATIC VOID EFIAPI DumpSratDeviceHandle(IN CONST CHAR16 *Format, IN UINT8 *Ptr, IN UINT32 Length)
STATIC CONST ACPI_PARSER SratDeviceHandlePciParser[]
STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[]
STATIC CONST ACPI_PARSER SratDeviceHandleAcpiParser[]
STATIC CONST ACPI_PARSER SratApciSapicAffinityParser[]
STATIC CONST ACPI_PARSER SratGenericInitiatorAffinityParser[]
STATIC VOID EFIAPI ValidateSratReserved(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
VOID EFIAPI ParseAcpiSrat(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
STATIC VOID EFIAPI ValidateSratDeviceHandleType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER SratParser[]
STATIC CONST ACPI_PARSER SratGicITSAffinityParser[]
STATIC CONST ACPI_PARSER SratResourceAllocationParser[]
STATIC CONST ACPI_PARSER SratMemAffinityParser[]
STATIC VOID EFIAPI DumpSratApicProximity(IN CONST CHAR16 *Format, IN UINT8 *Ptr, IN UINT32 Length)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)