]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Include/Library/Tcg2PhysicalPresenceLib.h
SecurityPkg: SmmTcg2PhysicalPresenceLib: Fix coding style issue
[mirror_edk2.git] / SecurityPkg / Include / Library / Tcg2PhysicalPresenceLib.h
CommitLineData
1abfa4ce 1/** @file\r
07309c3d 2 This library is intended to be used by BDS modules.\r
1abfa4ce
JY
3 This library will execute TPM2 request.\r
4\r
edb0fda2 5Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
1abfa4ce
JY
6This program and the accompanying materials \r
7are licensed and made available under the terms and conditions of the BSD License \r
8which accompanies this distribution. The full text of the license may be found at \r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _TCG2_PHYSICAL_PRESENCE_LIB_H_\r
17#define _TCG2_PHYSICAL_PRESENCE_LIB_H_\r
18\r
19#include <IndustryStandard/Tpm20.h>\r
20#include <IndustryStandard/TcgPhysicalPresence.h>\r
21#include <Protocol/Tcg2Protocol.h>\r
22\r
23//\r
24// UEFI TCG2 library definition bit of the BIOS TPM Management Flags\r
25//\r
26// BIT0 is reserved\r
27#define TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_CLEAR BIT1\r
28// BIT2 is reserved\r
29#define TCG2_LIB_PP_FLAG_RESET_TRACK BIT3\r
30#define TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_TURN_ON BIT4\r
31#define TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_TURN_OFF BIT5\r
32#define TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_CHANGE_EPS BIT6\r
33#define TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_CHANGE_PCRS BIT7\r
34\r
35//\r
36// UEFI TCG2 library definition bit of the BIOS Information Flags\r
37//\r
38#define TCG2_BIOS_INFORMATION_FLAG_HIERACHY_CONTROL_STORAGE_DISABLE BIT8\r
39#define TCG2_BIOS_INFORMATION_FLAG_HIERACHY_CONTROL_ENDORSEMENT_DISABLE BIT9\r
40\r
41//\r
42// UEFI TCG2 library definition bit of the BIOS Storage Management Flags\r
43//\r
44#define TCG2_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_ENABLE_BLOCK_SID BIT16\r
45#define TCG2_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_DISABLE_BLOCK_SID BIT17\r
46\r
47//\r
48// Default value\r
49//\r
50#define TCG2_BIOS_TPM_MANAGEMENT_FLAG_DEFAULT (TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_TURN_OFF | \\r
51 TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_CLEAR | \\r
52 TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_CHANGE_EPS | \\r
53 TCG2_BIOS_TPM_MANAGEMENT_FLAG_PP_REQUIRED_FOR_CHANGE_PCRS)\r
54\r
55/**\r
56 Check and execute the pending TPM request.\r
57\r
58 The TPM request may come from OS or BIOS. This API will display request information and wait \r
59 for user confirmation if TPM request exists. The TPM request will be sent to TPM device after\r
60 the TPM request is confirmed, and one or more reset may be required to make TPM request to \r
61 take effect.\r
62 \r
63 This API should be invoked after console in and console out are all ready as they are required\r
64 to display request information and get user input to confirm the request. \r
65\r
66 @param PlatformAuth platform auth value. NULL means no platform auth change.\r
67**/\r
68VOID\r
69EFIAPI\r
70Tcg2PhysicalPresenceLibProcessRequest (\r
71 IN TPM2B_AUTH *PlatformAuth OPTIONAL\r
72 );\r
73\r
74/**\r
75 Check if the pending TPM request needs user input to confirm.\r
76\r
77 The TPM request may come from OS. This API will check if TPM request exists and need user\r
78 input to confirmation.\r
79 \r
80 @retval TRUE TPM needs input to confirm user physical presence.\r
81 @retval FALSE TPM doesn't need input to confirm user physical presence.\r
82\r
83**/\r
84BOOLEAN\r
85EFIAPI\r
86Tcg2PhysicalPresenceLibNeedUserConfirm (\r
87 VOID\r
88 );\r
89\r
90/**\r
91 Return TPM2 ManagementFlags set by PP interface.\r
92\r
93 @retval ManagementFlags TPM2 Management Flags.\r
94**/\r
95UINT32\r
96EFIAPI\r
97Tcg2PhysicalPresenceLibGetManagementFlags (\r
98 VOID\r
99 );\r
100\r
101/**\r
102 The handler for TPM physical presence function:\r
103 Return TPM Operation Response to OS Environment.\r
104\r
105 This API should be invoked in OS runtime phase to interface with ACPI method.\r
106\r
107 @param[out] MostRecentRequest Most recent operation request.\r
108 @param[out] Response Response to the most recent operation request.\r
109\r
110 @return Return Code for Return TPM Operation Response to OS Environment.\r
111**/\r
112UINT32\r
113EFIAPI\r
114Tcg2PhysicalPresenceLibReturnOperationResponseToOsFunction (\r
115 OUT UINT32 *MostRecentRequest,\r
116 OUT UINT32 *Response\r
117 );\r
118\r
edb0fda2
ZC
119/**\r
120 The handler for TPM physical presence function:\r
121 Submit TPM Operation Request to Pre-OS Environment and\r
122 Submit TPM Operation Request to Pre-OS Environment 2.\r
123\r
124 This API should be invoked in OS runtime phase to interface with ACPI method.\r
125\r
126 Caution: This function may receive untrusted input.\r
127\r
3e14edf8
ZC
128 @param[in, out] Pointer to OperationRequest TPM physical presence operation request.\r
129 @param[in, out] Pointer to RequestParameter TPM physical presence operation request parameter.\r
edb0fda2
ZC
130\r
131 @return Return Code for Submit TPM Operation Request to Pre-OS Environment and\r
132 Submit TPM Operation Request to Pre-OS Environment 2.\r
133 **/\r
134UINT32\r
135Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunctionEx (\r
136 IN OUT UINT32 *OperationRequest,\r
137 IN OUT UINT32 *RequestParameter\r
138 );\r
1abfa4ce
JY
139\r
140/**\r
141 The handler for TPM physical presence function:\r
142 Submit TPM Operation Request to Pre-OS Environment and\r
143 Submit TPM Operation Request to Pre-OS Environment 2.\r
144\r
145 This API should be invoked in OS runtime phase to interface with ACPI method.\r
146\r
147 Caution: This function may receive untrusted input.\r
edb0fda2 148\r
1abfa4ce
JY
149 @param[in] OperationRequest TPM physical presence operation request.\r
150 @param[in] RequestParameter TPM physical presence operation request parameter.\r
151\r
152 @return Return Code for Submit TPM Operation Request to Pre-OS Environment and\r
153 Submit TPM Operation Request to Pre-OS Environment 2.\r
154**/\r
155UINT32\r
156EFIAPI\r
157Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (\r
158 IN UINT32 OperationRequest,\r
159 IN UINT32 RequestParameter\r
160 );\r
161\r
162/**\r
163 The handler for TPM physical presence function:\r
164 Get User Confirmation Status for Operation.\r
165\r
166 This API should be invoked in OS runtime phase to interface with ACPI method.\r
167\r
168 Caution: This function may receive untrusted input.\r
169 \r
170 @param[in] OperationRequest TPM physical presence operation request.\r
171\r
172 @return Return Code for Get User Confirmation Status for Operation.\r
173**/\r
174UINT32\r
175EFIAPI\r
176Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction (\r
177 IN UINT32 OperationRequest\r
178 );\r
179\r
180#endif\r