]>
Commit | Line | Data |
---|---|---|
1abfa4ce JY |
1 | /** @file\r |
2 | The header file for Tcg2 SMM driver.\r | |
b3548d32 | 3 | \r |
c4122dca | 4 | Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r |
3c2dc30d | 5 | Copyright (c) Microsoft Corporation.\r |
289b714b | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
1abfa4ce JY |
7 | \r |
8 | **/\r | |
9 | \r | |
10 | #ifndef __TCG2_SMM_H__\r | |
11 | #define __TCG2_SMM_H__\r | |
12 | \r | |
3c2dc30d | 13 | #include <PiMm.h>\r |
1abfa4ce JY |
14 | \r |
15 | #include <Guid/MemoryOverwriteControl.h>\r | |
16 | #include <Guid/TpmInstance.h>\r | |
3c2dc30d | 17 | #include <Guid/TpmNvsMm.h>\r |
1abfa4ce | 18 | \r |
3c2dc30d | 19 | #include <Protocol/MmReadyToLock.h>\r |
1abfa4ce JY |
20 | #include <Protocol/SmmSwDispatch2.h>\r |
21 | #include <Protocol/AcpiTable.h>\r | |
22 | #include <Protocol/SmmVariable.h>\r | |
23 | #include <Protocol/Tcg2Protocol.h>\r | |
24 | \r | |
25 | #include <Library/BaseLib.h>\r | |
26 | #include <Library/BaseMemoryLib.h>\r | |
27 | #include <Library/DebugLib.h>\r | |
e2d6833c | 28 | #include <Library/MmServicesTableLib.h>\r |
73126ac2 | 29 | #include <Library/Tpm2CommandLib.h>\r |
1abfa4ce | 30 | #include <Library/Tcg2PhysicalPresenceLib.h>\r |
d967d6d9 | 31 | #include <Library/IoLib.h>\r |
c4122dca | 32 | #include <Library/PcdLib.h>\r |
f15cb995 | 33 | #include <Library/Tpm2DeviceLib.h>\r |
d967d6d9 JY |
34 | \r |
35 | #include <IndustryStandard/TpmPtp.h>\r | |
1abfa4ce | 36 | \r |
1abfa4ce JY |
37 | //\r |
38 | // The definition for TCG MOR\r | |
39 | //\r | |
40 | #define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1\r | |
41 | #define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2\r | |
42 | \r | |
43 | //\r | |
44 | // The return code for Memory Clear Interface Functions\r | |
45 | //\r | |
46 | #define MOR_REQUEST_SUCCESS 0\r | |
47 | #define MOR_REQUEST_GENERAL_FAILURE 1\r | |
48 | \r | |
3c2dc30d KQ |
49 | /**\r |
50 | Notify the system that the SMM variable driver is ready.\r | |
51 | **/\r | |
52 | VOID\r | |
53 | Tcg2NotifyMmReady (\r | |
54 | VOID\r | |
55 | );\r | |
cd643013 | 56 | \r |
3c2dc30d KQ |
57 | /**\r |
58 | This function is an abstraction layer for implementation specific Mm buffer validation routine.\r | |
73126ac2 | 59 | \r |
3c2dc30d KQ |
60 | @param Buffer The buffer start address to be checked.\r |
61 | @param Length The buffer length to be checked.\r | |
62 | \r | |
63 | @retval TRUE This buffer is valid per processor architecture and not overlap with SMRAM.\r | |
64 | @retval FALSE This buffer is not valid per processor architecture or overlap with SMRAM.\r | |
65 | **/\r | |
66 | BOOLEAN\r | |
67 | IsBufferOutsideMmValid (\r | |
68 | IN EFI_PHYSICAL_ADDRESS Buffer,\r | |
69 | IN UINT64 Length\r | |
70 | );\r | |
71 | \r | |
72 | /**\r | |
73 | The driver's common initialization routine.\r | |
74 | \r | |
75 | It install callbacks for TPM physical presence and MemoryClear, and locate\r | |
76 | SMM variable to be used in the callback function.\r | |
77 | \r | |
78 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
79 | @retval Others Some error occurs when executing this entry point.\r | |
80 | \r | |
81 | **/\r | |
82 | EFI_STATUS\r | |
83 | InitializeTcgCommon (\r | |
84 | VOID\r | |
85 | );\r | |
c4122dca | 86 | \r |
1abfa4ce | 87 | #endif // __TCG_SMM_H__\r |