TianoCore EDK2 master
Loading...
Searching...
No Matches
PpttParser.c File Reference
#include <Library/PrintLib.h>
#include <Library/UefiLib.h>
#include "AcpiParser.h"
#include "AcpiView.h"
#include "AcpiViewConfig.h"
#include "PpttParser.h"

Go to the source code of this file.

Functions

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)
 
STATIC VOID EFIAPI ValidateCacheAssociativity (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateCacheLineSize (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateCacheId (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID EFIAPI ValidateCacheAttributes (IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
 
STATIC VOID DumpProcessorHierarchyNodeStructure (IN UINT8 *Ptr, IN UINT8 Length)
 
STATIC VOID DumpCacheTypeStructure (IN UINT8 *Ptr, IN UINT8 Length)
 
VOID EFIAPI ParseAcpiPptt (IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
 

Variables

STATIC CONST UINT8 * ProcessorTopologyStructureType
 
STATIC CONST UINT8 * ProcessorTopologyStructureLength
 
STATIC CONST UINT32 * NumberOfPrivateResources
 
STATIC CONST EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE_FLAGSCacheFlags
 
STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo
 
STATIC CONST ACPI_PARSER PpttParser []
 
STATIC CONST ACPI_PARSER ProcessorTopologyStructureHeaderParser []
 
STATIC CONST ACPI_PARSER ProcessorHierarchyNodeStructureParser []
 
STATIC CONST ACPI_PARSER CacheTypeStructureParser []
 

Detailed Description

PPTT table parser

Copyright (c) 2019 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
  • ACPI 6.4 Specification - January 2021
  • ARM Architecture Reference Manual ARMv8 (D.a)

Definition in file PpttParser.c.

Function Documentation

◆ DumpCacheTypeStructure()

STATIC VOID DumpCacheTypeStructure ( IN UINT8 *  Ptr,
IN UINT8  Length 
)

This function parses the Cache Type Structure (Type 1).

Parameters
[in]PtrPointer to the start of the Cache Type Structure data.
[in]LengthLength of the Cache Type Structure.

Definition at line 453 of file PpttParser.c.

◆ DumpProcessorHierarchyNodeStructure()

STATIC VOID DumpProcessorHierarchyNodeStructure ( IN UINT8 *  Ptr,
IN UINT8  Length 
)

This function parses the Processor Hierarchy Node Structure (Type 0).

Parameters
[in]PtrPointer to the start of the Processor Hierarchy Node Structure data.
[in]LengthLength of the Processor Hierarchy Node Structure.

Definition at line 380 of file PpttParser.c.

◆ ParseAcpiPptt()

VOID EFIAPI ParseAcpiPptt ( IN BOOLEAN  Trace,
IN UINT8 *  Ptr,
IN UINT32  AcpiTableLength,
IN UINT8  AcpiTableRevision 
)

This function parses the ACPI PPTT table. When trace is enabled this function parses the PPTT table and traces the ACPI table fields.

This function parses the following processor topology structures:

  • Processor hierarchy node structure (Type 0)
  • Cache Type Structure (Type 1)

This function also performs validation of the ACPI table fields.

Parameters
[in]TraceIf TRUE, trace the ACPI fields.
[in]PtrPointer to the start of the buffer.
[in]AcpiTableLengthLength of the ACPI table.
[in]AcpiTableRevisionRevision of the ACPI table.

Definition at line 486 of file PpttParser.c.

◆ ValidateCacheAssociativity()

STATIC VOID EFIAPI ValidateCacheAssociativity ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the Cache Type Structure (Type 1) 'Associativity' field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 180 of file PpttParser.c.

◆ ValidateCacheAttributes()

STATIC VOID EFIAPI ValidateCacheAttributes ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the Cache Type Structure (Type 1) Attributes field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 296 of file PpttParser.c.

◆ ValidateCacheFlags()

STATIC VOID EFIAPI ValidateCacheFlags ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the Cache Type Structure (Type 1) Cache Flags field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 62 of file PpttParser.c.

◆ ValidateCacheId()

STATIC VOID EFIAPI ValidateCacheId ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the Cache Type Structure (Type 1) Cache ID field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 255 of file PpttParser.c.

◆ ValidateCacheLineSize()

STATIC VOID EFIAPI ValidateCacheLineSize ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the Cache Type Structure (Type 1) Line size field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 208 of file PpttParser.c.

◆ ValidateCacheNumberOfSets()

STATIC VOID EFIAPI ValidateCacheNumberOfSets ( IN UINT8 *  Ptr,
IN UINT32  Length,
IN VOID *  Context 
)

This function validates the Cache Type Structure (Type 1) 'Number of sets' field.

Parameters
[in]PtrPointer to the start of the field data.
[in]LengthLength of the field.
[in]ContextPointer to context specific information e.g. this could be a pointer to the ACPI table header.

Definition at line 127 of file PpttParser.c.

Variable Documentation

◆ AcpiHdrInfo

Definition at line 24 of file PpttParser.c.

◆ CacheFlags

Definition at line 23 of file PpttParser.c.

◆ CacheTypeStructureParser

STATIC CONST ACPI_PARSER CacheTypeStructureParser[]
Initial value:
= {
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Flags", 4, 4, L"0x%x", NULL, (VOID **)&CacheFlags, ValidateCacheFlags,
NULL },
{ L"Next Level of Cache", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Size", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Number of sets", 4, 16, L"%d", NULL, NULL, ValidateCacheNumberOfSets, NULL },
{ L"Associativity", 1, 20, L"%d", NULL, NULL, ValidateCacheAssociativity, NULL },
{ L"Attributes", 1, 21, L"0x%x", NULL, NULL, ValidateCacheAttributes, NULL },
{ L"Line size", 2, 22, L"%d", NULL, NULL, ValidateCacheLineSize, NULL },
{ L"Cache ID", 4, 24, L"%d", NULL, NULL, ValidateCacheId, NULL }
}
#define NULL
Definition: Base.h:319
STATIC VOID EFIAPI ValidateCacheLineSize(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PpttParser.c:208
STATIC VOID EFIAPI ValidateCacheAttributes(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PpttParser.c:296
STATIC VOID EFIAPI ValidateCacheId(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PpttParser.c:255
STATIC VOID EFIAPI ValidateCacheAssociativity(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PpttParser.c:180
STATIC VOID EFIAPI ValidateCacheFlags(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PpttParser.c:62
STATIC VOID EFIAPI ValidateCacheNumberOfSets(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: PpttParser.c:127

An ACPI_PARSER array describing the Cache Type Structure - Type 1.

Definition at line 355 of file PpttParser.c.

◆ NumberOfPrivateResources

STATIC CONST UINT32* NumberOfPrivateResources

Definition at line 22 of file PpttParser.c.

◆ PpttParser

STATIC CONST ACPI_PARSER PpttParser[]
Initial value:
= {
}

An ACPI_PARSER array describing the ACPI PPTT Table.

Definition at line 322 of file PpttParser.c.

◆ ProcessorHierarchyNodeStructureParser

STATIC CONST ACPI_PARSER ProcessorHierarchyNodeStructureParser[]
Initial value:
= {
{ L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },
{ L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Parent", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },
{ L"ACPI Processor ID", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },
{ L"Number of private resources", 4, 16, L"%d", NULL,
(VOID **)&NumberOfPrivateResources, NULL, NULL }
}

An ACPI_PARSER array describing the Processor Hierarchy Node Structure - Type 0.

Definition at line 340 of file PpttParser.c.

◆ ProcessorTopologyStructureHeaderParser

STATIC CONST ACPI_PARSER ProcessorTopologyStructureHeaderParser[]
Initial value:
= {
{ L"Type", 1, 0, NULL, NULL, (VOID **)&ProcessorTopologyStructureType,
NULL, NULL },
{ L"Length", 1, 1, NULL, NULL, (VOID **)&ProcessorTopologyStructureLength,
NULL, NULL },
{ L"Reserved", 2, 2, NULL, NULL, NULL, NULL,NULL }
}

An ACPI_PARSER array describing the processor topology structure header.

Definition at line 329 of file PpttParser.c.

◆ ProcessorTopologyStructureLength

STATIC CONST UINT8* ProcessorTopologyStructureLength

Definition at line 21 of file PpttParser.c.

◆ ProcessorTopologyStructureType

STATIC CONST UINT8* ProcessorTopologyStructureType

Definition at line 20 of file PpttParser.c.