TianoCore EDK2 master
Loading...
Searching...
No Matches
PcctGenerator.c File Reference

Go to the source code of this file.

Macros

#define PCCT_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPccSubspaceType0Info, CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPccSubspaceType1Info, CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPccSubspaceType2Info, CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPccSubspaceType3Info, CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPccSubspaceType4Info, CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPccSubspaceType5Info, CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO)
 
STATIC EFI_STATUS EFIAPI MappingTableInitialize (IN MAPPING_TABLE *MappingTable, IN UINT32 Count)
 
STATIC VOID EFIAPI MappingTableFree (IN OUT MAPPING_TABLE *MappingTable)
 
STATIC EFI_STATUS EFIAPI MappingTableAdd (IN MAPPING_TABLE *MappingTable, IN VOID *PccSubspace, IN UINT32 Index)
 
STATIC EFI_STATUS EFIAPI MapPccSubspaceId (IN MAPPING_TABLE *MappingTable, IN VOID *CmPccArray, IN UINT32 CmPccCount)
 
STATIC EFI_STATUS EFIAPI AddSubspaceStructType0 (IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO *PccCmObj, IN EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC *PccAcpi)
 
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)
 
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)
 
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)
 
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)
 
STATIC EFI_STATUS EFIAPI PopulatePcctTable (IN MAPPING_TABLE *MappingTable, IN VOID *Pcc, IN UINT32 Size)
 
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)
 
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)
 
EFI_STATUS EFIAPI AcpiPcctLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiPcctLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC BOOLEAN mHasPlatformInterrupt
 
STATIC ACPI_PCCT_GENERATOR PcctGenerator
 

Detailed Description

PCCT Table Generator

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

Reference(s):
  • ACPI 6.4 Specification - January 2021 s14 PLATFORM COMMUNICATIONS CHANNEL (PCC)

Definition in file PcctGenerator.c.

Macro Definition Documentation

◆ PCCT_GENERATOR_REVISION

#define PCCT_GENERATOR_REVISION   CREATE_REVISION (1, 0)

This macro defines the PCCT Table Generator revision.

Definition at line 1105 of file PcctGenerator.c.

Function Documentation

◆ AcpiPcctLibConstructor()

EFI_STATUS EFIAPI AcpiPcctLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Register the Generator with the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is registered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_ALREADY_STARTEDThe Generator for the Table ID is already registered.

Definition at line 1161 of file PcctGenerator.c.

◆ AcpiPcctLibDestructor()

EFI_STATUS EFIAPI AcpiPcctLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Deregister the Generator from the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is deregistered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe Generator is not registered.

Definition at line 1185 of file PcctGenerator.c.

◆ AddSubspaceStructType0()

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).

Parameters
[in]PccCmObjPointer to a CmObj PCCT Subspace info structure.
[in]PccAcpiPointer to the ACPI PCCT Subspace structure to populate.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 308 of file PcctGenerator.c.

◆ AddSubspaceStructType1()

Add one PCCT subspace structure of Type 1 (HW-Reduced).

Parameters
[in]PccCmObjPointer to a CmObj PCCT Subspace info structure.
[in]PccAcpiPointer to the ACPI PCCT Subspace structure to populate.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 360 of file PcctGenerator.c.

◆ AddSubspaceStructType2()

Add one PCCT subspace structure of Type 2 (HW-Reduced).

Parameters
[in]PccCmObjPointer to a CmObj PCCT Subspace info structure.
[in]PccAcpiPointer to the ACPI PCCT Subspace structure to populate.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 422 of file PcctGenerator.c.

◆ AddSubspaceStructType34()

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).

Parameters
[in]PccCmObjPointer to a CmObj PCCT Subspace info structure.
[in]PccAcpiPointer to the ACPI PCCT Subspace structure to populate.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 495 of file PcctGenerator.c.

◆ AddSubspaceStructType5()

Add one PCCT subspace structure of Type 5 (HW-Registers).

Parameters
[in]PccCmObjPointer to a CmObj PCCT Subspace info structure.
[in]PccAcpiPointer to the ACPI PCCT Subspace structure to populate.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 610 of file PcctGenerator.c.

◆ BuildPcctTable()

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.

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[out]TablePointer to the constructed ACPI Table.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object was not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.
EFI_BUFFER_TOO_SMALLBuffer too small.
EFI_OUT_OF_RESOURCESMemory allocation failed.

Definition at line 818 of file PcctGenerator.c.

◆ FreePcctTableResources()

Free any resources allocated for constructing the PCCT.

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in,out]TablePointer to the ACPI Table.
Return values
EFI_SUCCESSThe resources were freed successfully.
EFI_INVALID_PARAMETERThe table pointer is NULL or invalid.

Definition at line 1079 of file PcctGenerator.c.

◆ GET_OBJECT_LIST() [1/6]

ARM standard PCCT Generator

Requirements: The following Configuration Manager Object(s) are required by this Generator:

  • EArchCommonObjPccSubspaceType0Info
  • EArchCommonObjPccSubspaceType1Info
  • EArchCommonObjPccSubspaceType2Info
  • EArchCommonObjPccSubspaceType3Info
  • EArchCommonObjPccSubspaceType4Info
  • EArchCommonObjPccSubspaceType5Info This macro expands to a function that retrieves the PCC Subspace of Type 0 Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [2/6]

This macro expands to a function that retrieves the PCC Subspace of Type 1 Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [3/6]

This macro expands to a function that retrieves the PCC Subspace of Type 2 Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [4/6]

This macro expands to a function that retrieves the PCC Subspace of Type 3 Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [5/6]

This macro expands to a function that retrieves the PCC Subspace of Type 4 Information from the Configuration Manager.

◆ GET_OBJECT_LIST() [6/6]

This macro expands to a function that retrieves the PCC Subspace of Type 5 Information from the Configuration Manager.

◆ MapPccSubspaceId()

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.

Parameters
[in]MappingTableThe mapping table structure.
[in]CmPccArrayPointer to an array of CM_ARCH_COMMON_PCC_SUBSPACE_TYPE[X]_INFO.
[in]CmPccCountCount of objects in CmPccArray.
Return values
EFI_SUCCESSSuccess.
EFI_BUFFER_TOO_SMALLBuffer too small.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 222 of file PcctGenerator.c.

◆ MappingTableAdd()

STATIC EFI_STATUS EFIAPI MappingTableAdd ( IN MAPPING_TABLE MappingTable,
IN VOID *  PccSubspace,
IN UINT32  Index 
)

Add a new entry for PccSubspace at Index.

Parameters
[in]MappingTableThe mapping table structure.
[in]PccSubspaceA pointer to CM_ARCH_COMMON_PCC_SUBSPACE_TYPE[X]_INFO.
[in]IndexIndex at which PccSubspace must be added. This is the Subspace Id.
Return values
EFI_SUCCESSSuccess.
EFI_BUFFER_TOO_SMALLBuffer too small.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 182 of file PcctGenerator.c.

◆ MappingTableFree()

STATIC VOID EFIAPI MappingTableFree ( IN OUT MAPPING_TABLE MappingTable)

Free the MappingTable.

Parameters
[in,out]MappingTableThe mapping table structure.

Definition at line 155 of file PcctGenerator.c.

◆ MappingTableInitialize()

STATIC EFI_STATUS EFIAPI MappingTableInitialize ( IN MAPPING_TABLE MappingTable,
IN UINT32  Count 
)

Initialize the MappingTable.

Parameters
[in]MappingTableThe mapping table structure.
[in]CountNumber of entries to allocate in the MappingTable.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 122 of file PcctGenerator.c.

◆ PopulatePcctTable()

STATIC EFI_STATUS EFIAPI PopulatePcctTable ( IN MAPPING_TABLE MappingTable,
IN VOID *  Pcc,
IN UINT32  Size 
)

Populate the PCCT table using the MappingTable.

Parameters
[in]MappingTableThe mapping table structure.
[in]PccPointer to an array of Pcc Subpace structures.
[in]SizeSize of the Pcc array.
Return values
EFI_SUCCESSTable generated successfully.
EFI_BUFFER_TOO_SMALLBuffer too small.
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 686 of file PcctGenerator.c.

Variable Documentation

◆ mHasPlatformInterrupt

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:

  • One of the PCCT Subspace uses interrupts.
  • A PCC Subspace of type 4 is used.

Definition at line 107 of file PcctGenerator.c.

◆ PcctGenerator

STATIC ACPI_PCCT_GENERATOR PcctGenerator

The interface for the PCCT Table Generator.

Definition at line 1110 of file PcctGenerator.c.