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

Go to the source code of this file.

Macros

#define START_METHOD_ACPI_PARAM_SIZE_MIN   4
 
#define START_METHOD_CRB_WITH_SMC_PARAM_SIZE   12
 
#define TPM2_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjTpm2InterfaceInfo, CM_ARCH_COMMON_TPM2_INTERFACE_INFO)
 
STATIC EFI_STATUS AcpiTpm2CheckStartMethodParameters (CM_ARCH_COMMON_TPM2_INTERFACE_INFO *TpmInfo)
 
STATIC EFI_STATUS EFIAPI BuildTpm2Table (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 FreeTpm2TableResources (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 AcpiTpm2LibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiTpm2LibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST ACPI_TABLE_GENERATOR Tpm2Generator
 

Detailed Description

TPM2 Table Generator

Copyright (c) 2022, ARM Limited. All rights reserved. Copyright (c) 2023 - 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
Glossary:
  • Cm or CM - Configuration Manager
  • Obj or OBJ - Object

Definition in file Tpm2Generator.c.

Macro Definition Documentation

◆ START_METHOD_ACPI_PARAM_SIZE_MIN

#define START_METHOD_ACPI_PARAM_SIZE_MIN   4

Definition at line 34 of file Tpm2Generator.c.

◆ START_METHOD_CRB_WITH_SMC_PARAM_SIZE

#define START_METHOD_CRB_WITH_SMC_PARAM_SIZE   12

Definition at line 35 of file Tpm2Generator.c.

◆ TPM2_GENERATOR_REVISION

#define TPM2_GENERATOR_REVISION   CREATE_REVISION (1, 0)

The TPM2 Table Generator revision.

Definition at line 326 of file Tpm2Generator.c.

Function Documentation

◆ AcpiTpm2CheckStartMethodParameters()

STATIC EFI_STATUS AcpiTpm2CheckStartMethodParameters ( CM_ARCH_COMMON_TPM2_INTERFACE_INFO TpmInfo)

Sanity check Start Method Specific Parameters field

Parameters
[in]TpmInfoPointer to the CM TPM2 object
Return values
EFI_SUCCESSNo failure
EFI_INVALID_PARAMETERA parameter is invalid.

Definition at line 65 of file Tpm2Generator.c.

◆ AcpiTpm2LibConstructor()

EFI_STATUS EFIAPI AcpiTpm2LibConstructor ( 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 370 of file Tpm2Generator.c.

◆ AcpiTpm2LibDestructor()

EFI_STATUS EFIAPI AcpiTpm2LibDestructor ( 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 394 of file Tpm2Generator.c.

◆ BuildTpm2Table()

Construct the TPM2 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 FreeTpm2TableResources 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_OUT_OF_RESOURCESMemory allocation failed.

Definition at line 145 of file Tpm2Generator.c.

◆ FreeTpm2TableResources()

Free any resources allocated for constructing the TPM2.

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 298 of file Tpm2Generator.c.

◆ GET_OBJECT_LIST()

ARM standard TPM2 Generator

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

  • EArchCommonObjTpm2InterfaceInfo This macro expands to a function that retrieves the Processor Hierarchy information from the Configuration Manager.

Variable Documentation

◆ Tpm2Generator

Initial value:
= {
L"ACPI.STD.TPM2.GENERATOR",
EFI_TPM2_ACPI_TABLE_REVISION_4,
EFI_TPM2_ACPI_TABLE_REVISION_4,
}
#define EFI_ACPI_6_4_TRUSTED_COMPUTING_PLATFORM_2_TABLE_SIGNATURE
Definition: Acpi64.h:3135
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdTpm2
TPM2 Generator.
#define NULL
Definition: Base.h:319
STATIC EFI_STATUS EFIAPI FreeTpm2TableResources(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)
STATIC EFI_STATUS EFIAPI BuildTpm2Table(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)
#define TPM2_GENERATOR_REVISION

The interface for the TPM2 Table Generator.

Definition at line 332 of file Tpm2Generator.c.