24#define MAX_MEMORY_DOMAIN_TARGET_PRINT_MATRIX 10
45 L
"Access %sLatency%s",
48 L
"Access %sBandwidth%s",
49 L
"Read %sBandwidth%s",
50 L
"Write %sBandwidth%s"
76 if (Attributes->TotalCacheLevels > 0x3) {
79 L
"\nERROR: Attributes bits [3:0] have invalid value: 0x%x",
80 Attributes->TotalCacheLevels
84 if (Attributes->CacheLevel > 0x3) {
87 L
"\nERROR: Attributes bits [7:4] have invalid value: 0x%x",
88 Attributes->CacheLevel
92 if (Attributes->CacheAssociativity > 0x2) {
95 L
"\nERROR: Attributes bits [11:8] have invalid value: 0x%x",
96 Attributes->CacheAssociativity
100 if (Attributes->WritePolicy > 0x2) {
103 L
"\nERROR: Attributes bits [15:12] have invalid value: 0x%x",
104 Attributes->WritePolicy
120 IN CONST CHAR16 *Format OPTIONAL,
133 Print (L
"%d\n", Attributes->TotalCacheLevels);
135 Print (L
"%d\n", Attributes->CacheLevel);
137 Print (L
"%d\n", Attributes->CacheAssociativity);
139 Print (L
"%d\n", Attributes->WritePolicy);
141 Print (L
"%d\n", Attributes->CacheLineSize);
186 { L
"Flags", 1, 8, L
"0x%x",
NULL, (VOID **)&SllbiFlags,
NULL,
NULL },
187 { L
"Data type", 1, 9, L
"0x%x",
NULL, (VOID **)&SllbiDataType,
NULL,
NULL },
190 { L
"Initiator Proximity Dom Count", 4, 12, L
"%d",
NULL,
191 (VOID **)&NumberInitiatorProximityDomain,
NULL,
NULL },
192 { L
"Target Proximity Dom Count", 4, 16, L
"%d",
NULL,
193 (VOID **)&NumberTargetProximityDomain,
NULL,
NULL },
215 { L
"SMBIOS Handle Count", 2, 30, L
"%d",
NULL,
216 (VOID **)&NumberSMBIOSHandles,
NULL,
NULL }
239 "Memory Proximity Domain Attributes Structure",
262 CONST UINT32 *InitiatorProximityDomainList;
263 CONST UINT32 *TargetProximityDomainList;
264 CONST UINT16 *LatencyBandwidthMatrix;
266 CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
267 CHAR16 SecondBuffer[OUTPUT_FIELD_COLUMN_WIDTH];
268 UINT32 RequiredTableSize;
270 UINT32 IndexInitiator;
272 UINT32 TargetStartOffset;
277 "System Locality Latency and Bandwidth Information Structure",
285 if ((SllbiFlags ==
NULL) ||
286 (SllbiDataType ==
NULL) ||
287 (NumberInitiatorProximityDomain ==
NULL) ||
288 (NumberTargetProximityDomain ==
NULL))
292 L
"ERROR: Insufficient remaining table buffer length to read the " \
293 L
"SLLBI structure header. Length = %d.\n",
299 RequiredTableSize = (*NumberInitiatorProximityDomain *
sizeof (UINT32)) +
300 (*NumberTargetProximityDomain *
sizeof (UINT32)) +
301 (*NumberInitiatorProximityDomain *
302 *NumberTargetProximityDomain *
sizeof (UINT16)) +
305 if (RequiredTableSize > Length) {
308 L
"ERROR: Insufficient System Locality Latency and Bandwidth" \
309 L
"Information Structure length. TableLength = %d. " \
310 L
"RequiredTableLength = %d.\n",
317 InitiatorProximityDomainList = (UINT32 *)(Ptr + Offset);
318 TargetProximityDomainList = InitiatorProximityDomainList +
319 *NumberInitiatorProximityDomain;
320 LatencyBandwidthMatrix = (UINT16 *)(TargetProximityDomainList +
321 *NumberTargetProximityDomain);
324 for (Index = 0; Index < *NumberInitiatorProximityDomain; Index++) {
328 L
"Initiator Proximity Dom [%d]",
335 InitiatorProximityDomainList[Index]
340 for (Index = 0; Index < *NumberTargetProximityDomain; Index++) {
344 L
"Target Proximity Dom [%d]",
351 TargetProximityDomainList[Index]
358 Print (L
"Error: Unkown Data Type. DataType = 0x%x.\n", *SllbiDataType);
365 switch (SllbiFlags->MemoryHierarchy) {
369 sizeof (SecondBuffer),
380 sizeof (SecondBuffer),
389 L
"Error: Invalid Memory Hierarchy. MemoryHierarchy = %d.\n",
390 SllbiFlags->MemoryHierarchy
395 if (*NumberTargetProximityDomain <= MAX_MEMORY_DOMAIN_TARGET_PRINT_MATRIX) {
405 Print (L
"\n Target : X-axis (Horizontal)");
406 Print (L
"\n Initiator : Y-axis (Vertical)");
409 for (IndexTarget = 0;
410 IndexTarget < *NumberTargetProximityDomain;
413 Print (L
" %2d", IndexTarget);
417 for (IndexTarget = 0;
418 IndexTarget < *NumberTargetProximityDomain;
426 TargetStartOffset = 0;
427 for (IndexInitiator = 0;
428 IndexInitiator < *NumberInitiatorProximityDomain;
431 Print (L
" %2d |", IndexInitiator);
432 for (IndexTarget = 0;
433 IndexTarget < *NumberTargetProximityDomain;
438 LatencyBandwidthMatrix[TargetStartOffset + IndexTarget]
443 TargetStartOffset += (*NumberTargetProximityDomain);
456 TargetStartOffset = 0;
457 for (IndexInitiator = 0;
458 IndexInitiator < *NumberInitiatorProximityDomain;
461 for (IndexTarget = 0;
462 IndexTarget < *NumberTargetProximityDomain;
467 sizeof (SecondBuffer),
476 LatencyBandwidthMatrix[TargetStartOffset + IndexTarget]
480 TargetStartOffset += (*NumberTargetProximityDomain);
499 CONST UINT16 *SMBIOSHandlesList;
500 CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
507 "Memory Side Cache Information Structure",
515 if (NumberSMBIOSHandles ==
NULL) {
518 L
"ERROR: Insufficient remaining table buffer length to read the " \
519 L
"MSCI structure header. Length = %d.\n",
525 if ((*NumberSMBIOSHandles *
sizeof (UINT16)) > (Length - Offset)) {
528 L
"ERROR: Invalid Number of SMBIOS Handles. SMBIOSHandlesCount = %d." \
529 L
"RemainingBufferLength = %d.\n",
530 *NumberSMBIOSHandles,
536 SMBIOSHandlesList = (UINT16 *)(Ptr + Offset);
538 for (Index = 0; Index < *NumberSMBIOSHandles; Index++) {
542 L
"SMBIOS Handles [%d]",
549 SMBIOSHandlesList[Index]
576 IN UINT32 AcpiTableLength,
577 IN UINT8 AcpiTableRevision
581 UINT8 *HmatStructurePtr;
596 HmatStructurePtr = Ptr + Offset;
598 while (Offset < AcpiTableLength) {
605 AcpiTableLength - Offset,
611 if ((HmatStructureType ==
NULL) ||
612 (HmatStructureLength ==
NULL))
616 L
"ERROR: Insufficient remaining table buffer length to read the " \
617 L
"HMAT structure header. Length = %d.\n",
618 AcpiTableLength - Offset
624 if ((*HmatStructureLength == 0) ||
625 ((Offset + (*HmatStructureLength)) > AcpiTableLength))
629 L
"ERROR: Invalid HMAT Structure length. " \
630 L
"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
631 *HmatStructureLength,
638 switch (*HmatStructureType) {
645 case EFI_ACPI_6_4_HMAT_TYPE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO:
651 case EFI_ACPI_6_4_HMAT_TYPE_MEMORY_SIDE_CACHE_INFO:
660 L
"ERROR: Unknown HMAT structure:"
661 L
" Type = %d, Length = %d\n",
668 HmatStructurePtr += *HmatStructureLength;
669 Offset += *HmatStructureLength;
#define EFI_ACPI_6_4_HMAT_TYPE_MEMORY_PROXIMITY_DOMAIN_ATTRIBUTES
VOID EFIAPI PrintFieldName(IN UINT32 Indent, IN CONST CHAR16 *FieldName)
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)
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
STATIC CONST CHAR16 * SllbiNames[]
STATIC CONST ACPI_PARSER HmatParser[]
STATIC CONST ACPI_PARSER SllbiParser[]
STATIC VOID DumpMpda(IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI ParseAcpiHmat(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
STATIC VOID EFIAPI ValidateCacheAttributes(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER MemProximityDomainAttributeParser[]
STATIC CONST ACPI_PARSER MemSideCacheInfoParser[]
STATIC VOID EFIAPI DumpCacheAttributes(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
STATIC VOID DumpSllbi(IN UINT8 *Ptr, IN UINT32 Length)
STATIC CONST ACPI_PARSER HmatStructureHeaderParser[]
STATIC VOID DumpMsci(IN UINT8 *Ptr, IN UINT32 Length)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define ARRAY_SIZE(Array)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)