TianoCore EDK2 master
|
#include <Library/AcpiLib.h>
#include <Library/BaseMemoryLib.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 "PcctGenerator.h"
Go to the source code of this file.
Macros | |
#define | PCCT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
Variables | |
STATIC BOOLEAN | mHasPlatformInterrupt |
STATIC ACPI_PCCT_GENERATOR | PcctGenerator |
PCCT Table Generator
Copyright (c) 2022, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PcctGenerator.c.
#define PCCT_GENERATOR_REVISION CREATE_REVISION (1, 0) |
This macro defines the PCCT Table Generator revision.
Definition at line 1105 of file PcctGenerator.c.
EFI_STATUS EFIAPI AcpiPcctLibConstructor | ( | 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 1161 of file PcctGenerator.c.
EFI_STATUS EFIAPI AcpiPcctLibDestructor | ( | 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 1185 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI AddSubspaceStructType0 | ( | IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO * | PccCmObj, |
IN EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC * | PccAcpi | ||
) |
Add one PCCT Subspace structure of Type 0 (Generic).
[in] | PccCmObj | Pointer to a CmObj PCCT Subspace info structure. |
[in] | PccAcpi | Pointer to the ACPI PCCT Subspace structure to populate. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 308 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI AddSubspaceStructType1 | ( | IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO * | PccCmObj, |
IN EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS * | PccAcpi | ||
) |
Add one PCCT subspace structure of Type 1 (HW-Reduced).
[in] | PccCmObj | Pointer to a CmObj PCCT Subspace info structure. |
[in] | PccAcpi | Pointer to the ACPI PCCT Subspace structure to populate. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 360 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI AddSubspaceStructType2 | ( | IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO * | PccCmObj, |
IN EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS * | PccAcpi | ||
) |
Add one PCCT subspace structure of Type 2 (HW-Reduced).
[in] | PccCmObj | Pointer to a CmObj PCCT Subspace info structure. |
[in] | PccAcpi | Pointer to the ACPI PCCT Subspace structure to populate. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 422 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI AddSubspaceStructType34 | ( | IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO * | PccCmObj, |
IN EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC * | PccAcpi | ||
) |
Add one PCCT subspace structure of Type 3 or 4 (Extended).
[in] | PccCmObj | Pointer to a CmObj PCCT Subspace info structure. |
[in] | PccAcpi | Pointer to the ACPI PCCT Subspace structure to populate. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 495 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI AddSubspaceStructType5 | ( | IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO * | PccCmObj, |
IN EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS * | PccAcpi | ||
) |
Add one PCCT subspace structure of Type 5 (HW-Registers).
[in] | PccCmObj | Pointer to a CmObj PCCT Subspace info structure. |
[in] | PccAcpi | Pointer to the ACPI PCCT Subspace structure to populate. |
EFI_SUCCESS | Table generated successfully. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 610 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI BuildPcctTable | ( | 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 PCCT ACPI table.
Called by the Dynamic Table Manager, 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 Info. |
[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. |
EFI_BUFFER_TOO_SMALL | Buffer too small. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 818 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI FreePcctTableResources | ( | 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 PCCT.
[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 1079 of file PcctGenerator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjPccSubspaceType0Info | , | ||
CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO | |||
) |
ARM standard PCCT Generator
Requirements: The following Configuration Manager Object(s) are required by this Generator:
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjPccSubspaceType1Info | , | ||
CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO | |||
) |
This macro expands to a function that retrieves the PCC Subspace of Type 1 Information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjPccSubspaceType2Info | , | ||
CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO | |||
) |
This macro expands to a function that retrieves the PCC Subspace of Type 2 Information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjPccSubspaceType3Info | , | ||
CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO | |||
) |
This macro expands to a function that retrieves the PCC Subspace of Type 3 Information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjPccSubspaceType4Info | , | ||
CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO | |||
) |
This macro expands to a function that retrieves the PCC Subspace of Type 4 Information from the Configuration Manager.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjPccSubspaceType5Info | , | ||
CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO | |||
) |
This macro expands to a function that retrieves the PCC Subspace of Type 5 Information from the Configuration Manager.
STATIC EFI_STATUS EFIAPI MapPccSubspaceId | ( | IN MAPPING_TABLE * | MappingTable, |
IN VOID * | CmPccArray, | ||
IN UINT32 | CmPccCount | ||
) |
Parse the CmPccArray objects and add them to the MappingTable.
[in] | MappingTable | The mapping table structure. |
[in] | CmPccArray | Pointer to an array of CM_ARCH_COMMON_PCC_SUBSPACE_TYPE[X]_INFO. |
[in] | CmPccCount | Count of objects in CmPccArray. |
EFI_SUCCESS | Success. |
EFI_BUFFER_TOO_SMALL | Buffer too small. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Definition at line 222 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI MappingTableAdd | ( | IN MAPPING_TABLE * | MappingTable, |
IN VOID * | PccSubspace, | ||
IN UINT32 | Index | ||
) |
Add a new entry for PccSubspace at Index.
[in] | MappingTable | The mapping table structure. |
[in] | PccSubspace | A pointer to CM_ARCH_COMMON_PCC_SUBSPACE_TYPE[X]_INFO. |
[in] | Index | Index at which PccSubspace must be added. This is the Subspace Id. |
EFI_SUCCESS | Success. |
EFI_BUFFER_TOO_SMALL | Buffer too small. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Definition at line 182 of file PcctGenerator.c.
STATIC VOID EFIAPI MappingTableFree | ( | IN OUT MAPPING_TABLE * | MappingTable | ) |
Free the MappingTable.
[in,out] | MappingTable | The mapping table structure. |
Definition at line 155 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI MappingTableInitialize | ( | IN MAPPING_TABLE * | MappingTable, |
IN UINT32 | Count | ||
) |
Initialize the MappingTable.
[in] | MappingTable | The mapping table structure. |
[in] | Count | Number of entries to allocate in the MappingTable. |
EFI_SUCCESS | Success. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
Definition at line 122 of file PcctGenerator.c.
STATIC EFI_STATUS EFIAPI PopulatePcctTable | ( | IN MAPPING_TABLE * | MappingTable, |
IN VOID * | Pcc, | ||
IN UINT32 | Size | ||
) |
Populate the PCCT table using the MappingTable.
[in] | MappingTable | The mapping table structure. |
[in] | Pcc | Pointer to an array of Pcc Subpace structures. |
[in] | Size | Size of the Pcc array. |
EFI_SUCCESS | Table generated successfully. |
EFI_BUFFER_TOO_SMALL | Buffer too small. |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 686 of file PcctGenerator.c.
STATIC BOOLEAN mHasPlatformInterrupt |
The Platform is capable of generating an interrupt to indicate completion of a command.
Cf: s14.1.1 Platform Communications Channel Global Flags Platform Interrupt flag and s14.1.6 Extended PCC subspaces (types 3 and 4) If a responder subspace is included in the PCCT, then the global Platform Interrupt flag must be set to 1
Set this variable and populate the PCCT flag accordingly if either:
Definition at line 107 of file PcctGenerator.c.
STATIC ACPI_PCCT_GENERATOR PcctGenerator |
The interface for the PCCT Table Generator.
Definition at line 1110 of file PcctGenerator.c.