2 The header file for Tcg2 SMM driver.
4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) Microsoft Corporation.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __TCG2_SMM_H__
11 #define __TCG2_SMM_H__
15 #include <Guid/MemoryOverwriteControl.h>
16 #include <Guid/TpmInstance.h>
17 #include <Guid/TpmNvsMm.h>
19 #include <Protocol/MmReadyToLock.h>
20 #include <Protocol/SmmSwDispatch2.h>
21 #include <Protocol/AcpiTable.h>
22 #include <Protocol/SmmVariable.h>
23 #include <Protocol/Tcg2Protocol.h>
25 #include <Library/BaseLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/MmServicesTableLib.h>
29 #include <Library/Tpm2CommandLib.h>
30 #include <Library/Tcg2PhysicalPresenceLib.h>
31 #include <Library/IoLib.h>
32 #include <Library/PcdLib.h>
33 #include <Library/Tpm2DeviceLib.h>
35 #include <IndustryStandard/TpmPtp.h>
38 // The definition for TCG MOR
40 #define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1
41 #define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2
44 // The return code for Memory Clear Interface Functions
46 #define MOR_REQUEST_SUCCESS 0
47 #define MOR_REQUEST_GENERAL_FAILURE 1
50 Notify the system that the SMM variable driver is ready.
58 This function is an abstraction layer for implementation specific Mm buffer validation routine.
60 @param Buffer The buffer start address to be checked.
61 @param Length The buffer length to be checked.
63 @retval TRUE This buffer is valid per processor architecture and not overlap with SMRAM.
64 @retval FALSE This buffer is not valid per processor architecture or overlap with SMRAM.
67 IsBufferOutsideMmValid (
68 IN EFI_PHYSICAL_ADDRESS Buffer
,
73 The driver's common initialization routine.
75 It install callbacks for TPM physical presence and MemoryClear, and locate
76 SMM variable to be used in the callback function.
78 @retval EFI_SUCCESS The entry point is executed successfully.
79 @retval Others Some error occurs when executing this entry point.
87 #endif // __TCG_SMM_H__