]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h
SecurityPkg: Tcg2Dxe: Report correct FinalEventLog size
[mirror_edk2.git] / SecurityPkg / Tcg / Tcg2Smm / Tcg2Smm.h
1 /** @file
2 The header file for Tcg2 SMM driver.
3
4 Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __TCG2_SMM_H__
16 #define __TCG2_SMM_H__
17
18 #include <PiDxe.h>
19 #include <IndustryStandard/Acpi.h>
20 #include <IndustryStandard/Tpm2Acpi.h>
21
22 #include <Guid/MemoryOverwriteControl.h>
23 #include <Guid/TpmInstance.h>
24
25 #include <Protocol/SmmSwDispatch2.h>
26 #include <Protocol/AcpiTable.h>
27 #include <Protocol/SmmVariable.h>
28 #include <Protocol/Tcg2Protocol.h>
29
30 #include <Library/BaseLib.h>
31 #include <Library/BaseMemoryLib.h>
32 #include <Library/DebugLib.h>
33 #include <Library/SmmServicesTableLib.h>
34 #include <Library/UefiDriverEntryPoint.h>
35 #include <Library/UefiBootServicesTableLib.h>
36 #include <Library/DxeServicesLib.h>
37 #include <Library/TpmMeasurementLib.h>
38 #include <Library/Tpm2DeviceLib.h>
39 #include <Library/Tcg2PhysicalPresenceLib.h>
40 #include <Library/IoLib.h>
41
42 #include <IndustryStandard/TpmPtp.h>
43
44 #pragma pack(1)
45 typedef struct {
46 UINT8 SoftwareSmi;
47 UINT32 Parameter;
48 UINT32 Response;
49 UINT32 Request;
50 UINT32 RequestParameter;
51 UINT32 LastRequest;
52 UINT32 ReturnCode;
53 } PHYSICAL_PRESENCE_NVS;
54
55 typedef struct {
56 UINT8 SoftwareSmi;
57 UINT32 Parameter;
58 UINT32 Request;
59 UINT32 ReturnCode;
60 } MEMORY_CLEAR_NVS;
61
62 typedef struct {
63 PHYSICAL_PRESENCE_NVS PhysicalPresence;
64 MEMORY_CLEAR_NVS MemoryClear;
65 UINT32 PPRequestUserConfirm;
66 } TCG_NVS;
67
68 typedef struct {
69 UINT8 OpRegionOp;
70 UINT32 NameString;
71 UINT8 RegionSpace;
72 UINT8 DWordPrefix;
73 UINT32 RegionOffset;
74 UINT8 BytePrefix;
75 UINT8 RegionLen;
76 } AML_OP_REGION_32_8;
77 #pragma pack()
78
79 //
80 // The definition for TCG MOR
81 //
82 #define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1
83 #define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2
84
85 //
86 // The return code for Memory Clear Interface Functions
87 //
88 #define MOR_REQUEST_SUCCESS 0
89 #define MOR_REQUEST_GENERAL_FAILURE 1
90
91 //
92 // Physical Presence Interface Version supported by Platform
93 //
94 #define PHYSICAL_PRESENCE_VERSION_TAG "$PV"
95 #define PHYSICAL_PRESENCE_VERSION_SIZE 4
96
97 #endif // __TCG_SMM_H__