]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/TcgSmm/TcgSmm.h
OvmfPkg/Csm/LegacyBiosDxe: Update to make it build for OVMF
[mirror_edk2.git] / SecurityPkg / Tcg / TcgSmm / TcgSmm.h
1 /** @file
2 The header file for TCG SMM driver.
3
4 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __TCG_SMM_H__
10 #define __TCG_SMM_H__
11
12 #include <PiDxe.h>
13 #include <IndustryStandard/Acpi.h>
14 #include <IndustryStandard/UefiTcgPlatform.h>
15
16 #include <Guid/PhysicalPresenceData.h>
17 #include <Guid/MemoryOverwriteControl.h>
18 #include <Guid/TpmInstance.h>
19
20 #include <Protocol/SmmSwDispatch2.h>
21 #include <Protocol/AcpiTable.h>
22 #include <Protocol/SmmVariable.h>
23
24 #include <Library/BaseLib.h>
25 #include <Library/BaseMemoryLib.h>
26 #include <Library/DebugLib.h>
27 #include <Library/SmmServicesTableLib.h>
28 #include <Library/UefiDriverEntryPoint.h>
29 #include <Library/UefiBootServicesTableLib.h>
30 #include <Library/DxeServicesLib.h>
31 #include <Library/TpmMeasurementLib.h>
32 #include <Library/PcdLib.h>
33 #include <Library/TcgPpVendorLib.h>
34
35 #pragma pack(1)
36 typedef struct {
37 UINT8 SoftwareSmi;
38 UINT32 Parameter;
39 UINT32 Response;
40 UINT32 Request;
41 UINT32 LastRequest;
42 UINT32 ReturnCode;
43 } PHYSICAL_PRESENCE_NVS;
44
45 typedef struct {
46 UINT8 SoftwareSmi;
47 UINT32 Parameter;
48 UINT32 Request;
49 UINT32 ReturnCode;
50 } MEMORY_CLEAR_NVS;
51
52 typedef struct {
53 PHYSICAL_PRESENCE_NVS PhysicalPresence;
54 MEMORY_CLEAR_NVS MemoryClear;
55 UINT32 PPRequestUserConfirm;
56 } TCG_NVS;
57
58 typedef struct {
59 UINT8 OpRegionOp;
60 UINT32 NameString;
61 UINT8 RegionSpace;
62 UINT8 DWordPrefix;
63 UINT32 RegionOffset;
64 UINT8 BytePrefix;
65 UINT8 RegionLen;
66 } AML_OP_REGION_32_8;
67 #pragma pack()
68
69 //
70 // The definition for TCG physical presence ACPI function
71 //
72 #define ACPI_FUNCTION_GET_PHYSICAL_PRESENCE_INTERFACE_VERSION 1
73 #define ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS 2
74 #define ACPI_FUNCTION_GET_PENDING_REQUEST_BY_OS 3
75 #define ACPI_FUNCTION_GET_PLATFORM_ACTION_TO_TRANSITION_TO_BIOS 4
76 #define ACPI_FUNCTION_RETURN_REQUEST_RESPONSE_TO_OS 5
77 #define ACPI_FUNCTION_SUBMIT_PREFERRED_USER_LANGUAGE 6
78 #define ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS_2 7
79 #define ACPI_FUNCTION_GET_USER_CONFIRMATION_STATUS_FOR_REQUEST 8
80
81 //
82 // The return code for Return TPM Operation Response to OS Environment
83 //
84 #define PP_RETURN_TPM_OPERATION_RESPONSE_SUCCESS 0
85 #define PP_RETURN_TPM_OPERATION_RESPONSE_FAILURE 1
86
87 //
88 // The definition for TCG MOR
89 //
90 #define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1
91 #define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2
92
93 //
94 // The return code for Memory Clear Interface Functions
95 //
96 #define MOR_REQUEST_SUCCESS 0
97 #define MOR_REQUEST_GENERAL_FAILURE 1
98
99 #endif // __TCG_SMM_H__