TianoCore EDK2 master
|
#include <Library/AcpiLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/AcpiTable.h>
#include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h>
#include <Library/TableHelperLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
#include "PpttGenerator.h"
Go to the source code of this file.
Macros | |
#define | PPTT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
Variables | |
STATIC ACPI_PPTT_GENERATOR | PpttGenerator |
PPTT Table Generator
Copyright (c) 2021, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PpttGenerator.c.
#define PPTT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
The PPTT Table Generator revision.
Definition at line 1387 of file PpttGenerator.c.
EFI_STATUS EFIAPI AcpiPpttLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Register the Generator with the ACPI Table Factory.
[in] | ImageHandle | The handle to the image. |
[in] | SystemTable | Pointer to the System Table. |
EFI_SUCCESS | The Generator is registered. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_ALREADY_STARTED | The Generator for the Table ID is already registered. |
Definition at line 1445 of file PpttGenerator.c.
EFI_STATUS EFIAPI AcpiPpttLibDestructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Deregister the Generator from the ACPI Table Factory.
[in] | ImageHandle | The handle to the image. |
[in] | SystemTable | Pointer to the System Table. |
EFI_SUCCESS | The Generator is deregistered. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The Generator is not registered. |
Definition at line 1470 of file PpttGenerator.c.
STATIC EFI_STATUS AddCacheTypeStructures | ( | IN CONST ACPI_PPTT_GENERATOR *CONST | Generator, |
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, | ||
IN CONST EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * | Pptt, | ||
IN CONST UINT32 | NodesStartOffset, | ||
IN CONST UINT32 | Revision | ||
) |
Update the Cache Type Structure (Type 1) information.
This function populates the Cache Type Structures with information from the Configuration Manager and adds this information to the PPTT table.
[in] | Generator | Pointer to the PPTT Generator. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in] | Pptt | Pointer to PPTT table structure. |
[in] | NodesStartOffset | Offset from the start of PPTT table to the start of Cache Type Structures. |
[in] | Revision | Revision of the PPTT table being requested. |
EFI_SUCCESS | Structures updated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | A required object was not found. |
EFI_OUT_OF_RESOURCES | Out of resources. |
Definition at line 780 of file PpttGenerator.c.
STATIC EFI_STATUS AddPrivateResources | ( | IN CONST ACPI_PPTT_GENERATOR *CONST | Generator, |
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, | ||
IN UINT32 * | PrivResArray, | ||
IN UINT32 | PrivResCount, | ||
IN CONST CM_OBJECT_TOKEN | PrivResArrayToken | ||
) |
Update the array of private resources for a given Processor Hierarchy Node.
[in] | Generator | Pointer to the PPTT Generator. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in] | PrivResArray | Pointer to the array of private resources. |
[in] | PrivResCount | Number of private resources. |
[in] | PrivResArrayToken | Reference Token for the CM_ARCH_COMMON_OBJ_REF array describing node's private resources. |
EFI_SUCCESS | Array updated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | A private resource was not found. |
Definition at line 276 of file PpttGenerator.c.
STATIC EFI_STATUS AddProcHierarchyNodes | ( | IN CONST ACPI_PPTT_GENERATOR *CONST | Generator, |
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, | ||
IN CONST EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * | Pptt, | ||
IN CONST UINT32 | NodesStartOffset | ||
) |
Update the Processor Hierarchy Node (Type 0) information.
This function populates the Processor Hierarchy Nodes with information from the Configuration Manager and adds this information to the PPTT table.
[in] | Generator | Pointer to the PPTT Generator. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in] | Pptt | Pointer to PPTT table structure. |
[in] | NodesStartOffset | Offset from the start of PPTT table to the start of Processor Hierarchy Nodes. |
EFI_SUCCESS | Node updated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The required object was not found. |
Definition at line 469 of file PpttGenerator.c.
STATIC EFI_STATUS EFIAPI BuildPpttTable | ( | IN CONST ACPI_TABLE_GENERATOR *CONST | This, |
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST | AcpiTableInfo, | ||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, | ||
OUT EFI_ACPI_DESCRIPTION_HEADER **CONST | Table | ||
) |
Construct the PPTT ACPI table.
This function invokes the Configuration Manager protocol interface to get the required hardware information for generating the ACPI table.
If this function allocates any resources then they must be freed in the FreeXXXXTableResources function.
[in] | This | Pointer to the table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI table generator to be used. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[out] | Table | Pointer to the constructed ACPI Table. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
EFI_NOT_FOUND | The required object was not found. |
EFI_BAD_BUFFER_SIZE | The size returned by the Configuration Manager is less than the Object size for the requested object. |
Definition at line 1061 of file PpttGenerator.c.
STATIC EFI_STATUS DetectCyclesInTopology | ( | IN CONST ACPI_PPTT_GENERATOR *CONST | Generator | ) |
Detect cycles in the processor and cache topology graph represented in the PPTT table.
EFI_SUCCESS | There are no cyclic references in the graph. |
EFI_INVALID_PARAMETER | Processor or cache references form a cycle. |
Definition at line 201 of file PpttGenerator.c.
STATIC EFI_STATUS EFIAPI FreePpttTableResources | ( | IN CONST ACPI_TABLE_GENERATOR *CONST | This, |
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST | AcpiTableInfo, | ||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST | CfgMgrProtocol, | ||
IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST | Table | ||
) |
Free any resources allocated for constructing the PPTT
[in] | This | Pointer to the table generator. |
[in] | AcpiTableInfo | Pointer to the ACPI Table Info. |
[in] | CfgMgrProtocol | Pointer to the Configuration Manager Protocol Interface. |
[in,out] | Table | Pointer to the ACPI Table. |
EFI_SUCCESS | The resources were freed successfully. |
EFI_INVALID_PARAMETER | The table pointer is NULL or invalid. |
Definition at line 1346 of file PpttGenerator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjCacheInfo | , | ||
CM_ARCH_COMMON_CACHE_INFO | |||
) |
This macro expands to a function that retrieves the cache information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjCmRef | , | ||
CM_ARCH_COMMON_OBJ_REF | |||
) |
This macro expands to a function that retrieves the cross-CM-object- reference information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjProcHierarchyInfo | , | ||
CM_ARCH_COMMON_PROC_HIERARCHY_INFO | |||
) |
ARM standard PPTT Generator
Requirements: The following Configuration Manager Object(s) are used by this Generator:
GET_OBJECT_LIST | ( | EObjNameSpaceArm | , |
EArmObjGicCInfo | , | ||
CM_ARM_GICC_INFO | |||
) |
This macro expands to a function that retrieves the GIC CPU interface information from the Configuration Manager.
GET_SIZE_OF_PPTT_STRUCTS | ( | CacheTypeStructs | , |
sizeof(EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE) | , | ||
CM_ARCH_COMMON_CACHE_INFO | |||
) |
This macro expands to a function that retrieves the amount of memory required to store the Cache Type Structures (Type 1) and updates the Node Indexer.
GET_SIZE_OF_PPTT_STRUCTS | ( | ProcHierarchyNodes | , |
GetProcHierarchyNodeSize(NodesToIndex) | , | ||
CM_ARCH_COMMON_PROC_HIERARCHY_INFO | |||
) |
This macro expands to a function that retrieves the amount of memory required to store the Processor Hierarchy Nodes (Type 0) and updates the Node Indexer.
STATIC EFI_STATUS GetPpttNodeReferencedByToken | ( | IN PPTT_NODE_INDEXER * | NodeIndexer, |
IN UINT32 | NodeCount, | ||
IN CONST CM_OBJECT_TOKEN | SearchToken, | ||
OUT PPTT_NODE_INDEXER ** | IndexedNodeFound | ||
) |
Search the Node Indexer and return the indexed PPTT node with the given Token.
[in] | NodeIndexer | Pointer to the Node Indexer array. |
[in] | NodeCount | Number of elements in Node Indexer. |
[in] | SearchToken | Token used for Node Indexer lookup. |
[out] | IndexedNodeFound | Pointer to the Node Indexer array element with the given Token. |
EFI_SUCCESS | Success. |
EFI_NOT_FOUND | No element with a matching token was found in the Node Indexer array. |
Definition at line 139 of file PpttGenerator.c.
STATIC UINT32 GetProcHierarchyNodeSize | ( | IN CONST CM_ARCH_COMMON_PROC_HIERARCHY_INFO * | Node | ) |
Returns the size of the PPTT Processor Hierarchy Node (Type 0) given a Processor Hierarchy Info CM object.
[in] | Node | Pointer to Processor Hierarchy Info CM object which represents the Processor Hierarchy Node to be generated. |
Size | of the Processor Hierarchy Node in bytes. |
Definition at line 92 of file PpttGenerator.c.
BOOLEAN EFIAPI IsAcpiIdObjectTokenEqual | ( | IN CONST VOID * | Object1, |
IN CONST VOID * | Object2, | ||
IN UINTN | Index1, | ||
IN UINTN | Index2 | ||
) |
Function to test if two indexed Processor Hierarchy Info objects map to the same GIC CPU Interface Info object.
This is a callback function that can be invoked by FindDuplicateValue ().
[in] | Object1 | Pointer to the first indexed Processor Hierarchy Info object. |
[in] | Object2 | Pointer to the second indexed Processor Hierarchy Info object. |
[in] | Index1 | Index of Object1 to be displayed for debugging purposes. |
[in] | Index2 | Index of Object2 to be displayed for debugging purposes. |
TRUE | Object1 and Object2 have the same AcpiIdObjectToken. |
FALSE | Object1 and Object2 have different AcpiIdObjectTokens. |
Definition at line 407 of file PpttGenerator.c.
STATIC BOOLEAN IsCacheIdUnique | ( | IN CONST UINT32 | CacheId, |
IN CONST UINT32 * | CacheIdList, | ||
IN CONST UINT32 | CacheIdListSize | ||
) |
Test whether CacheId is unique among the CacheIdList.
[in] | CacheId | Cache ID to check. |
[in] | CacheIdList | List of already existing cache IDs. |
[in] | CacheIdListSize | Size of CacheIdList. |
TRUE | CacheId does not exist in CacheIdList. |
FALSE | CacheId already exists in CacheIdList. |
Definition at line 742 of file PpttGenerator.c.
STATIC ACPI_PPTT_GENERATOR PpttGenerator |
The interface for the PPTT Table Generator.
Definition at line 1392 of file PpttGenerator.c.