]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/TcgSmm/TcgSmm.h
eee8bc3d718bffc9e22d51b2f8f55b664e250fa9
[mirror_edk2.git] / SecurityPkg / Tcg / TcgSmm / TcgSmm.h
1 /** @file
2 The header file for TCG SMM driver.
3
4 Copyright (c) 2012 - 2013, 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 __TCG_SMM_H__
16 #define __TCG_SMM_H__
17
18 #include <PiDxe.h>
19 #include <IndustryStandard/Acpi.h>
20 #include <IndustryStandard/UefiTcgPlatform.h>
21
22 #include <Guid/PhysicalPresenceData.h>
23 #include <Guid/MemoryOverwriteControl.h>
24 #include <Guid/TpmInstance.h>
25
26 #include <Protocol/SmmSwDispatch2.h>
27 #include <Protocol/AcpiTable.h>
28 #include <Protocol/SmmVariable.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/PcdLib.h>
39
40 #pragma pack(1)
41 typedef struct {
42 UINT8 SoftwareSmi;
43 UINT32 Parameter;
44 UINT32 Response;
45 UINT32 Request;
46 UINT32 LastRequest;
47 UINT32 ReturnCode;
48 } PHYSICAL_PRESENCE_NVS;
49
50 typedef struct {
51 UINT8 SoftwareSmi;
52 UINT32 Parameter;
53 UINT32 Request;
54 UINT32 ReturnCode;
55 } MEMORY_CLEAR_NVS;
56
57 typedef struct {
58 PHYSICAL_PRESENCE_NVS PhysicalPresence;
59 MEMORY_CLEAR_NVS MemoryClear;
60 } TCG_NVS;
61
62 typedef struct {
63 UINT8 OpRegionOp;
64 UINT32 NameString;
65 UINT8 RegionSpace;
66 UINT8 DWordPrefix;
67 UINT32 RegionOffset;
68 UINT8 BytePrefix;
69 UINT8 RegionLen;
70 } AML_OP_REGION_32_8;
71 #pragma pack()
72
73 //
74 // The definition for TCG physical presence ACPI function
75 //
76 #define ACPI_FUNCTION_GET_PHYSICAL_PRESENCE_INTERFACE_VERSION 1
77 #define ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS 2
78 #define ACPI_FUNCTION_GET_PENDING_REQUEST_BY_OS 3
79 #define ACPI_FUNCTION_GET_PLATFORM_ACTION_TO_TRANSITION_TO_BIOS 4
80 #define ACPI_FUNCTION_RETURN_REQUEST_RESPONSE_TO_OS 5
81 #define ACPI_FUNCTION_SUBMIT_PREFERRED_USER_LANGUAGE 6
82 #define ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS_2 7
83 #define ACPI_FUNCTION_GET_USER_CONFIRMATION_STATUS_FOR_REQUEST 8
84
85 //
86 // The return code for Get User Confirmation Status for Operation
87 //
88 #define PP_REQUEST_NOT_IMPLEMENTED 0
89 #define PP_REQUEST_BIOS_ONLY 1
90 #define PP_REQUEST_BLOCKED 2
91 #define PP_REQUEST_ALLOWED_AND_PPUSER_REQUIRED 3
92 #define PP_REQUEST_ALLOWED_AND_PPUSER_NOT_REQUIRED 4
93
94 //
95 // The return code for Sumbit TPM Request to Pre-OS Environment
96 // and Sumbit TPM Request to Pre-OS Environment 2
97 //
98 #define PP_SUBMIT_REQUEST_SUCCESS 0
99 #define PP_SUBMIT_REQUEST_NOT_IMPLEMENTED 1
100 #define PP_SUBMIT_REQUEST_GENERAL_FAILURE 2
101 #define PP_SUBMIT_REQUEST_BLOCKED_BY_BIOS_SETTINGS 3
102
103
104 //
105 // The definition for TCG MOR
106 //
107 #define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1
108 #define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2
109
110 //
111 // The return code for Memory Clear Interface Functions
112 //
113 #define MOR_REQUEST_SUCCESS 0
114 #define MOR_REQUEST_GENERAL_FAILURE 1
115
116 #endif // __TCG_SMM_H__