21STATIC CONST UINT8 *ProcessorTopologyStructureLength;
26#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
42 L
"\nERROR: On Arm based systems, all cache properties must be"
43 L
" provided in the cache type structure."
44 L
" Missing '%s' flag.",
68 #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
71 if (CacheFlags ==
NULL) {
73 Print (L
"\nERROR: Cache Structure Flags were not successfully read.");
78 LogCacheFlagError (L
"Size Property Valid");
81 if (CacheFlags->NumberOfSetsValid == EFI_ACPI_6_4_PPTT_NUMBER_OF_SETS_INVALID) {
82 LogCacheFlagError (L
"Number Of Sets Valid");
85 if (CacheFlags->AssociativityValid == EFI_ACPI_6_4_PPTT_ASSOCIATIVITY_INVALID) {
86 LogCacheFlagError (L
"Associativity Valid");
89 if (CacheFlags->AllocationTypeValid == EFI_ACPI_6_4_PPTT_ALLOCATION_TYPE_INVALID) {
90 LogCacheFlagError (L
"Allocation Type Valid");
93 if (CacheFlags->CacheTypeValid == EFI_ACPI_6_4_PPTT_CACHE_TYPE_INVALID) {
94 LogCacheFlagError (L
"Cache Type Valid");
97 if (CacheFlags->WritePolicyValid == EFI_ACPI_6_4_PPTT_WRITE_POLICY_INVALID) {
98 LogCacheFlagError (L
"Write Policy Valid");
101 if (CacheFlags->LineSizeValid == EFI_ACPI_6_4_PPTT_LINE_SIZE_INVALID) {
102 LogCacheFlagError (L
"Line Size Valid");
107 if (CacheFlags->CacheIdValid == EFI_ACPI_6_4_PPTT_CACHE_ID_INVALID) {
108 LogCacheFlagError (L
"Cache Id Valid");
135 NumberOfSets = *(UINT32 *)Ptr;
137 if (NumberOfSets == 0) {
139 Print (L
"\nERROR: Cache number of sets must be greater than 0");
143 #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
147 L
"\nERROR: When ARMv8.3-CCIDX is implemented the maximum cache number of "
148 L
"sets must be less than or equal to %d",
157 L
"\nWARNING: Without ARMv8.3-CCIDX, the maximum cache number of sets "
158 L
"must be less than or equal to %d. Ignore this message if "
159 L
"ARMv8.3-CCIDX is implemented",
188 Associativity = *(UINT8 *)Ptr;
190 if (Associativity == 0) {
192 Print (L
"\nERROR: Cache associativity must be greater than 0");
214 #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
221 LineSize = *(UINT16 *)Ptr;
223 if ((LineSize < PPTT_ARM_CACHE_LINE_SIZE_MIN) ||
228 L
"\nERROR: The cache line size must be between %d and %d bytes"
229 L
" on ARM Platforms.",
230 PPTT_ARM_CACHE_LINE_SIZE_MIN,
236 if ((LineSize & (LineSize - 1)) != 0) {
238 Print (L
"\nERROR: The cache line size is not a power of 2.");
263 CacheId = *(UINT32 *)Ptr;
270 if (CacheFlags ==
NULL) {
272 Print (L
"\nERROR: Cache Structure Flags were not successfully read.");
276 if (CacheFlags->CacheIdValid == EFI_ACPI_6_4_PPTT_CACHE_ID_VALID) {
279 Print (L
"\nERROR: 0 is not a valid Cache ID.");
307 Attributes = *(UINT8 *)Ptr;
309 if ((Attributes & 0xE0) != 0) {
312 L
"\nERROR: Attributes bits [7:5] are reserved and must be zero.",
330 { L
"Type", 1, 0,
NULL,
NULL, (VOID **)&ProcessorTopologyStructureType,
332 { L
"Length", 1, 1,
NULL,
NULL, (VOID **)&ProcessorTopologyStructureLength,
348 { L
"Number of private resources", 4, 16, L
"%d",
NULL,
349 (VOID **)&NumberOfPrivateResources,
NULL,
NULL }
387 CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
392 "Processor Hierarchy Node Structure",
400 if (NumberOfPrivateResources ==
NULL) {
403 L
"ERROR: Insufficient Processor Hierarchy Node length. Length = %d.\n",
410 if (Offset + (*NumberOfPrivateResources *
sizeof (UINT32)) > Length) {
413 L
"ERROR: Invalid Number of Private Resources. " \
414 L
"PrivateResourceCount = %d. RemainingBufferLength = %d. " \
415 L
"Parsing of this structure aborted.\n",
416 *NumberOfPrivateResources,
426 while (Index < *NumberOfPrivateResources) {
430 L
"Private resources [%d]",
437 *((UINT32 *)(Ptr + Offset))
440 Offset +=
sizeof (UINT32);
461 "Cache Type Structure",
489 IN UINT32 AcpiTableLength,
490 IN UINT8 AcpiTableRevision
494 UINT8 *ProcessorTopologyStructurePtr;
509 ProcessorTopologyStructurePtr = Ptr + Offset;
511 while (Offset < AcpiTableLength) {
517 ProcessorTopologyStructurePtr,
518 AcpiTableLength - Offset,
524 if ((ProcessorTopologyStructureType ==
NULL) ||
525 (ProcessorTopologyStructureLength ==
NULL))
529 L
"ERROR: Insufficient remaining table buffer length to read the " \
530 L
"processor topology structure header. Length = %d.\n",
531 AcpiTableLength - Offset
537 if ((*ProcessorTopologyStructureLength == 0) ||
538 ((Offset + (*ProcessorTopologyStructureLength)) > AcpiTableLength))
542 L
"ERROR: Invalid Processor Topology Structure length. " \
543 L
"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
544 *ProcessorTopologyStructureLength,
552 Print (L
"0x%x\n", Offset);
554 switch (*ProcessorTopologyStructureType) {
557 ProcessorTopologyStructurePtr,
558 *ProcessorTopologyStructureLength
561 case EFI_ACPI_6_4_PPTT_TYPE_CACHE:
563 ProcessorTopologyStructurePtr,
564 *ProcessorTopologyStructureLength
567 case EFI_ACPI_6_3_PPTT_TYPE_ID:
570 L
"ERROR: PPTT Type 2 - Processor ID has been removed and must not be"
577 L
"ERROR: Unknown processor topology structure:"
578 L
" Type = %d, Length = %d\n",
579 *ProcessorTopologyStructureType,
580 *ProcessorTopologyStructureLength
584 ProcessorTopologyStructurePtr += *ProcessorTopologyStructureLength;
585 Offset += *ProcessorTopologyStructureLength;
#define EFI_ACPI_6_4_PPTT_CACHE_SIZE_INVALID
#define EFI_ACPI_6_4_PPTT_TYPE_PROCESSOR
VOID EFIAPI IncrementWarningCount(VOID)
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)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX
#define PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX
#define PPTT_ARM_CACHE_LINE_SIZE_MAX
STATIC CONST ACPI_PARSER CacheTypeStructureParser[]
STATIC VOID DumpCacheTypeStructure(IN UINT8 *Ptr, IN UINT8 Length)
STATIC VOID DumpProcessorHierarchyNodeStructure(IN UINT8 *Ptr, IN UINT8 Length)
STATIC VOID EFIAPI ValidateCacheLineSize(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER PpttParser[]
STATIC VOID EFIAPI ValidateCacheAttributes(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI ValidateCacheId(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER ProcessorTopologyStructureHeaderParser[]
STATIC CONST ACPI_PARSER ProcessorHierarchyNodeStructureParser[]
VOID EFIAPI ParseAcpiPptt(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
STATIC VOID EFIAPI ValidateCacheAssociativity(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI ValidateCacheFlags(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI ValidateCacheNumberOfSets(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)