TianoCore EDK2 master
|
#include <Library/AcpiLib.h>
#include <Library/BaseLib.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 <IndustryStandard/Tpm2Acpi.h>
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 |
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
Definition in file Tpm2Generator.c.
#define START_METHOD_ACPI_PARAM_SIZE_MIN 4 |
Definition at line 34 of file Tpm2Generator.c.
#define START_METHOD_CRB_WITH_SMC_PARAM_SIZE 12 |
Definition at line 35 of file Tpm2Generator.c.
#define TPM2_GENERATOR_REVISION CREATE_REVISION (1, 0) |
The TPM2 Table Generator revision.
Definition at line 326 of file Tpm2Generator.c.
STATIC EFI_STATUS AcpiTpm2CheckStartMethodParameters | ( | CM_ARCH_COMMON_TPM2_INTERFACE_INFO * | TpmInfo | ) |
Sanity check Start Method Specific Parameters field
[in] | TpmInfo | Pointer to the CM TPM2 object |
EFI_SUCCESS | No failure |
EFI_INVALID_PARAMETER | A parameter is invalid. |
Definition at line 65 of file Tpm2Generator.c.
EFI_STATUS EFIAPI AcpiTpm2LibConstructor | ( | 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 370 of file Tpm2Generator.c.
EFI_STATUS EFIAPI AcpiTpm2LibDestructor | ( | 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 394 of file Tpm2Generator.c.
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 | ||
) |
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.
[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_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 145 of file Tpm2Generator.c.
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 | ||
) |
Free any resources allocated for constructing the TPM2.
[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 298 of file Tpm2Generator.c.
GET_OBJECT_LIST | ( | EObjNameSpaceArchCommon | , |
EArchCommonObjTpm2InterfaceInfo | , | ||
CM_ARCH_COMMON_TPM2_INTERFACE_INFO | |||
) |
STATIC CONST ACPI_TABLE_GENERATOR Tpm2Generator |
The interface for the TPM2 Table Generator.
Definition at line 332 of file Tpm2Generator.c.