29STATIC UINT32 MpamMscNodeStart;
33STATIC CONST UINT32 *NumberOfInterconnectDescriptors;
65 Print (L
"\nERROR : ");
68 L
"\nError : Insufficient MPAM MSC Node length. Table length : %u.\n",
93 if (Ptr[Length-1] != 0) {
95 Print (L
"\nERROR : Reserved field must be 0\n");
124 ByteLength = (Length + 7) >> 3;
152 InterfaceType = *MscInterfaceType;
154 if (InterfaceType == EFI_ACPI_MPAM_INTERFACE_PCC) {
155 MmioSize = *((UINT32 *)Ptr);
160 L
"\nERROR: MMIO size must be 0 for PCC interface type. Size - %u\n",
193 }
else if (LinkType == EFI_ACPI_MPAM_LINK_TYPE_PROC) {
200 L
"\nERROR: Invalid link type - %u\n",
227 HardwareId = *((UINT64 *)Ptr);
229 if (HardwareId != 0) {
256 InterfaceType = *Ptr;
260 }
else if (InterfaceType == EFI_ACPI_MPAM_INTERFACE_PCC) {
265 L
"\nERROR: Invalid interface type - %u\n",
266 (UINT32)InterfaceType
293 InterruptMode = *Ptr;
296 Print (L
" (Level triggered)");
298 Print (L
" (Edge triggered)");
324 InterruptType = *Ptr;
327 Print (L
" (Wired interrupt)");
330 Print (L
" (Reserved value!)");
354 UINT8 InterruptAffinityValid;
356 InterruptAffinityValid = *Ptr;
358 if (InterruptAffinityValid != EFI_ACPI_MPAM_INTERRUPT_AFFINITY_VALID) {
359 Print (L
" (Affinity not valid)");
361 Print (L
" (Affinity valid)");
386 UINT8 InterruptAffinityType;
388 InterruptAffinityType = *Ptr;
391 Print (L
" (Processor affinity)");
393 Print (L
" (Processor container affinity)");
420 if (LocatorType <= EFI_ACPI_MPAM_LOCATION_INTERCONNECT) {
421 Print (L
" (%s)", MpamMscLocatorTitles[LocatorType]);
422 }
else if (LocatorType == EFI_ACPI_MPAM_LOCATION_UNKNOWN) {
423 Print (L
" (Unknown)");
425 Print (L
" (Reserved)");
433 { L
"Interrupt Mode", 1, 0, L
"%u",
NULL,
NULL,
435 { L
"Interrupt Type", 2, 1, L
"%u",
NULL,
NULL,
437 { L
"Affinity Type", 1, 3, L
"%u",
NULL,
NULL,
439 { L
"Affinity Valid", 1, 4, L
"%u",
NULL,
NULL,
457 IN CONST CHAR16 *Format OPTIONAL,
462 Print (L
"%u\n", *(UINT32 *)Ptr);
515 { L
"ACPI hardware ID", 8, 0, L
"0x%lx",
NULL,
NULL,
524 { L
"Interconnect desc tbl offset", 8, 0, L
"%lu",
NULL,
525 (VOID **)&InterconnectTableOffset,
NULL,
NULL },
550 IN CONST CHAR16 *Format OPTIONAL,
556 switch (*ResourceLocatorType) {
567 case EFI_ACPI_MPAM_LOCATION_MEMORY:
577 case EFI_ACPI_MPAM_LOCATION_SMMU:
587 case EFI_ACPI_MPAM_LOCATION_MEMORY_CACHE:
597 case EFI_ACPI_MPAM_LOCATION_ACPI_DEVICE:
607 case EFI_ACPI_MPAM_LOCATION_INTERCONNECT:
619 case EFI_ACPI_MPAM_LOCATION_UNKNOWN:
630 Print (L
"\nWARNING : Reserved locator type\n");
655 { L
"Length", 2, 0, L
"%u",
NULL,
656 (VOID **)&MpamMscNodeLength,
NULL,
NULL },
660 { L
"Interface type", 1, 2, L
"0x%x",
NULL,
664 { L
"Identifier", 4, 4, L
"%u",
NULL,
666 { L
"Base address", 8, 8, L
"0x%lx",
NULL,
668 { L
"MMIO Size", 4, 16, L
"0x%x",
NULL,
670 { L
"Overflow interrupt", 4, 20, L
"%u",
NULL,
676 { L
"Overflow interrupt affinity", 4, 32, L
"0x%x",
NULL,
678 { L
"Error interrupt", 4, 36, L
"%u",
NULL,
684 { L
"Error interrupt affinity", 4, 48, L
"0x%x",
NULL,
686 { L
"MAX_NRDY_USEC", 4, 52, L
"0x%x",
NULL,
688 { L
"Hardware ID of linked device", 8, 56, L
"0x%lx",
NULL,
690 { L
"Instance ID of linked device", 4, 64, L
"0x%x",
NULL,
692 { L
"Number of resource nodes", 4, 68, L
"%u",
NULL,
693 (VOID **)&NumberOfMscResources,
NULL,
NULL }
700 { L
"Identifier", 4, 0, L
"%u",
NULL,
702 { L
"RIS index", 1, 4, L
"%u",
NULL,
706 { L
"Locator type", 1, 7, L
"0x%x",
NULL,
707 (VOID **)&ResourceLocatorType,
711 { L
"Number of func dependencies", 4, 20, L
"%u",
NULL,
712 (VOID **)&NumberOfFunctionalDependencies,
NULL,
NULL }
729 { L
"Signature", 16, 0,
731 { L
"Number of Interconnect desc", 4, 16,L
"0x%x",
NULL,
732 (VOID **)&NumberOfInterconnectDescriptors,
NULL,
NULL }
742 { L
"Link type", 1, 8, L
"0x%x",
NULL,
774 Print (L
"%u\n\n", Index);
798 IN CONST UINT32 AcpiTableLength,
802 UINT32 InterconnectDescriptorIndex;
804 InterconnectDescriptorIndex = 0;
806 if (NumberOfInterconnectDescriptors ==
NULL) {
808 return EFI_BAD_BUFFER_SIZE;
811 while (InterconnectDescriptorIndex < *NumberOfInterconnectDescriptors) {
814 L
"* Interconnect descriptor *",
815 InterconnectDescriptorIndex
824 AcpiTableLength - *Offset,
828 InterconnectDescriptorIndex++;
859 IN CONST UINT32 AcpiTableLength,
861 IN CONST UINT64 InterconnectOffset
867 if (Offset > (MpamMscNodeStart + InterconnectOffset)) {
869 Print (L
"\nERROR : Parsing Interconnect descriptor table failed!\n");
871 L
"ERROR : Offset overlaps with other objects within the MSC. Offset %u.\n",
875 return EFI_INVALID_PARAMETER;
879 if (InterconnectOffset > (*MpamMscNodeLength)) {
881 Print (L
"\nERROR : Parsing Interconnect descriptor table failed!\n");
883 L
"ERROR : Offset falls outside MSC's space. Offset %u.\n",
887 return EFI_INVALID_PARAMETER;
892 Offset = MpamMscNodeStart + (UINT32)InterconnectOffset;
904 AcpiTableLength - Offset,
938 IN CONST UINT32 AcpiTableLength,
942 UINT32 FunctionalDependencyIndex;
944 FunctionalDependencyIndex = 0;
946 if (NumberOfFunctionalDependencies ==
NULL) {
948 return EFI_BAD_BUFFER_SIZE;
951 while (FunctionalDependencyIndex < *NumberOfFunctionalDependencies) {
954 L
"* Functional dependency *",
955 FunctionalDependencyIndex
964 AcpiTableLength - *Offset,
968 FunctionalDependencyIndex++;
996 IN CONST UINT32 AcpiTableLength,
1001 UINT32 ResourceIndex;
1005 if (NumberOfMscResources ==
NULL) {
1007 return EFI_BAD_BUFFER_SIZE;
1010 while (ResourceIndex < *NumberOfMscResources) {
1023 AcpiTableLength - Offset,
1096 if ( (*ResourceLocatorType == EFI_ACPI_MPAM_LOCATION_INTERCONNECT)
1097 && (InterconnectTableOffset !=
NULL))
1103 *InterconnectTableOffset
1138 IN CONST UINT32 AcpiTableLength,
1147 while (*Offset < AcpiTableLength) {
1148 MpamMscNodeStart = *Offset;
1157 AcpiTableLength - *Offset,
1161 if (MpamMscNodeLength ==
NULL) {
1163 return EFI_BAD_BUFFER_SIZE;
1168 Print (L
"\nERROR: MSC length should be at least the size of node body! ");
1169 Print (L
"MSC Length %u\n", *MpamMscNodeLength);
1170 return EFI_BAD_BUFFER_SIZE;
1179 *Offset = MpamMscNodeStart + *MpamMscNodeLength;
1200 IN UINT32 AcpiTableLength,
1201 IN UINT8 AcpiTableRevision
1230 if (*(AcpiHdrInfo.
Length) != Offset) {
1232 Print (L
"\nERROR: Length mismatch! : ");
1233 Print (L
"MSC Length total != MPAM table length.");
1235 L
"Table length : %u MSC total : %u\n",
VOID EFIAPI Dump16Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI IncrementWarningCount(VOID)
VOID EFIAPI DumpReservedBits(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI PrintFieldName(IN UINT32 Indent, IN CONST CHAR16 *FieldName)
VOID EFIAPI Dump8Chars(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)
VOID EFIAPI DumpReserved(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
UINT32 EFIAPI ParseAcpiBitFields(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)
#define EFI_ACPI_MPAM_INTERFACE_MMIO
#define EFI_ACPI_MPAM_INTERRUPT_WIRED
#define EFI_ACPI_MPAM_INTERRUPT_PROCESSOR_AFFINITY
#define EFI_ACPI_MPAM_LOCATION_PROCESSOR_CACHE
#define EFI_ACPI_MPAM_LINK_TYPE_NUMA
#define EFI_ACPI_MPAM_INTERRUPT_LEVEL_TRIGGERED
STATIC CONST ACPI_PARSER MpamMscGenericLocatorParser[]
STATIC CONST ACPI_PARSER MpamMscInterconnectLocatorParser[]
STATIC EFI_STATUS EFIAPI ParseInterconnectDescriptorTable(IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN UINT32 Offset, IN CONST UINT64 InterconnectOffset)
STATIC VOID EFIAPI DecodeLinkType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER MpamMscMemoryCacheLocatorParser[]
STATIC VOID EFIAPI ParseLocator(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
STATIC CONST ACPI_PARSER MpamMscFunctionalDependencyParser[]
STATIC VOID EFIAPI DecodeInterruptAffinityType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI DecodeInterruptMode(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER MpamMscSMMULocatorParser[]
STATIC CONST ACPI_PARSER MpamInterconnectDescriptorParser[]
STATIC CONST ACPI_PARSER MpamInterconnectDescriptorTableParser[]
VOID EFIAPI ParseAcpiMpam(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
STATIC VOID EFIAPI PrintBlockTitle(IN UINT32 Indent, IN CONST CHAR16 *Title, IN CONST UINT32 Index)
STATIC VOID EFIAPI ValidateReserved(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER MpamMscMemoryLocatorParser[]
STATIC EFI_STATUS EFIAPI ParseMpamMscResources(IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN UINT32 Offset)
STATIC VOID EFIAPI ValidateMmioSize(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER MpamParser[]
STATIC VOID EFIAPI ValidateReservedBits(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC EFI_STATUS EFIAPI ParseMpamMscFunctionalDependencies(IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN OUT UINT32 *CONST Offset)
STATIC CONST ACPI_PARSER MpamMscInterruptFlagParser[]
STATIC EFI_STATUS EFIAPI ParseInterconnectDescriptors(IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN OUT UINT32 *CONST Offset)
STATIC CONST ACPI_PARSER MpamMscNodeParser[]
STATIC CONST ACPI_PARSER MpamMscProcessorCacheLocatorParser[]
STATIC EFI_STATUS EFIAPI ParseMpamMscNodes(IN UINT8 *CONST Ptr, IN CONST UINT32 AcpiTableLength, IN OUT UINT32 *CONST Offset)
STATIC VOID EFIAPI DecodeLocatorType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI DumpMpamMscInterruptFlags(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
STATIC VOID EFIAPI DecodeInterruptType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI DecodeInterfaceType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI DecodeInterruptAffinityValid(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI MpamLengthError(IN CONST CHAR16 *ErrorMsg)
STATIC CONST ACPI_PARSER MpamMscAcpiDeviceLocatorParser[]
STATIC CONST ACPI_PARSER MpamMscResourceParser[]
STATIC VOID EFIAPI DecodeHardwareId(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)