Commit | Line | Data |
---|---|---|
4610b23a | 1 | /** @file\r |
07309c3d | 2 | This library is to support Trusted Execution Environment (TrEE) ACPI Profile\r |
4610b23a JY |
3 | >= 128 Vendor Specific PPI Operation.\r |
4 | \r | |
5 | The Vendor Specific PPI operation may change TPM state, BIOS TPM management\r | |
6 | flags, and may need additional boot cycle.\r | |
7 | \r | |
8 | Caution: This function may receive untrusted input.\r | |
9 | \r | |
07309c3d | 10 | Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r |
4610b23a JY |
11 | This program and the accompanying materials \r |
12 | are licensed and made available under the terms and conditions of the BSD License \r | |
13 | which accompanies this distribution. The full text of the license may be found at \r | |
14 | http://opensource.org/licenses/bsd-license.php\r | |
15 | \r | |
16 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
17 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef _TREE_PP_VENDOR_LIB_H_\r | |
22 | #define _TREE_PP_VENDOR_LIB_H_\r | |
23 | \r | |
24 | #include <IndustryStandard/Tpm20.h>\r | |
25 | #include <Protocol/TrEEProtocol.h>\r | |
26 | \r | |
27 | //\r | |
28 | // The definition of physical presence operation actions\r | |
29 | //\r | |
30 | #define TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION 128\r | |
31 | \r | |
32 | //\r | |
33 | // The definition bit of the BIOS TPM Management Flags\r | |
34 | //\r | |
35 | // BIT0 is reserved\r | |
36 | #define TREE_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_CLEAR BIT1\r | |
37 | // BIT2 is reserved\r | |
38 | #define TREE_VENDOR_LIB_FLAG_RESET_TRACK BIT3\r | |
39 | \r | |
40 | //\r | |
41 | // The definition for TPM Operation Response to OS Environment\r | |
42 | //\r | |
43 | #define TREE_PP_OPERATION_RESPONSE_SUCCESS 0x0\r | |
44 | #define TREE_PP_OPERATION_RESPONSE_USER_ABORT 0xFFFFFFF0\r | |
45 | #define TREE_PP_OPERATION_RESPONSE_BIOS_FAILURE 0xFFFFFFF1\r | |
46 | \r | |
47 | //\r | |
0ab475c9 ZC |
48 | // The return code for Submit TPM Request to Pre-OS Environment\r |
49 | // and Submit TPM Request to Pre-OS Environment 2\r | |
4610b23a JY |
50 | //\r |
51 | #define TREE_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS 0\r | |
52 | #define TREE_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED 1\r | |
53 | #define TREE_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE 2\r | |
54 | #define TREE_PP_SUBMIT_REQUEST_TO_PREOS_BLOCKED_BY_BIOS_SETTINGS 3\r | |
55 | \r | |
56 | //\r | |
57 | // The return code for Get User Confirmation Status for Operation\r | |
58 | //\r | |
59 | #define TREE_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED 0\r | |
60 | #define TREE_PP_GET_USER_CONFIRMATION_BIOS_ONLY 1\r | |
61 | #define TREE_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION 2\r | |
62 | #define TREE_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_REQUIRED 3\r | |
63 | #define TREE_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_NOT_REQUIRED 4\r | |
64 | \r | |
65 | /**\r | |
66 | Check and execute the requested physical presence command.\r | |
67 | \r | |
68 | This API should be invoked in BIOS boot phase to process pending request.\r | |
69 | \r | |
70 | Caution: This function may receive untrusted input.\r | |
71 | \r | |
72 | If OperationRequest < 128, then ASSERT().\r | |
73 | \r | |
74 | @param[in] PlatformAuth platform auth value. NULL means no platform auth change.\r | |
75 | @param[in] OperationRequest TPM physical presence operation request.\r | |
76 | @param[in, out] ManagementFlags BIOS TPM Management Flags.\r | |
77 | @param[out] ResetRequired If reset is required to vendor settings in effect.\r | |
78 | True, it indicates the reset is required.\r | |
79 | False, it indicates the reset is not required.\r | |
80 | \r | |
81 | @return TPM Operation Response to OS Environment.\r | |
82 | **/\r | |
83 | UINT32\r | |
84 | EFIAPI\r | |
85 | TrEEPpVendorLibExecutePendingRequest (\r | |
86 | IN TPM2B_AUTH *PlatformAuth, OPTIONAL\r | |
87 | IN UINT32 OperationRequest,\r | |
88 | IN OUT UINT32 *ManagementFlags,\r | |
89 | OUT BOOLEAN *ResetRequired\r | |
90 | );\r | |
91 | \r | |
92 | /**\r | |
93 | Check if there is a valid physical presence command request.\r | |
94 | \r | |
95 | This API should be invoked in BIOS boot phase to process pending request.\r | |
96 | \r | |
97 | Caution: This function may receive untrusted input.\r | |
98 | \r | |
99 | If OperationRequest < 128, then ASSERT().\r | |
100 | \r | |
101 | @param[in] OperationRequest TPM physical presence operation request.\r | |
102 | @param[in] ManagementFlags BIOS TPM Management Flags.\r | |
103 | @param[out] RequestConfirmed If the physical presence operation command required user confirm from UI.\r | |
104 | True, it indicates the command doesn't require user confirm.\r | |
105 | False, it indicates the command need user confirm from UI.\r | |
106 | \r | |
107 | @retval TRUE Physical Presence operation command is valid.\r | |
108 | @retval FALSE Physical Presence operation command is invalid.\r | |
109 | **/\r | |
110 | BOOLEAN\r | |
111 | EFIAPI\r | |
112 | TrEEPpVendorLibHasValidRequest (\r | |
113 | IN UINT32 OperationRequest,\r | |
114 | IN UINT32 ManagementFlags,\r | |
115 | OUT BOOLEAN *RequestConfirmed\r | |
116 | );\r | |
117 | \r | |
118 | /**\r | |
119 | The callback for TPM vendor specific physical presence which is called for\r | |
120 | Submit TPM Operation Request to Pre-OS Environment and\r | |
121 | Submit TPM Operation Request to Pre-OS Environment 2.\r | |
122 | \r | |
123 | This API should be invoked in OS runtime phase to interface with ACPI method.\r | |
124 | \r | |
125 | Caution: This function may receive untrusted input.\r | |
126 | \r | |
127 | If OperationRequest < 128, then ASSERT().\r | |
128 | \r | |
129 | @param[in] OperationRequest TPM physical presence operation request.\r | |
130 | @param[in] ManagementFlags BIOS TPM Management Flags.\r | |
131 | \r | |
132 | @return Return Code for Submit TPM Operation Request to Pre-OS Environment and\r | |
133 | Submit TPM Operation Request to Pre-OS Environment 2.\r | |
134 | **/\r | |
135 | UINT32\r | |
136 | EFIAPI\r | |
137 | TrEEPpVendorLibSubmitRequestToPreOSFunction (\r | |
138 | IN UINT32 OperationRequest,\r | |
139 | IN UINT32 ManagementFlags\r | |
140 | );\r | |
141 | \r | |
142 | /**\r | |
143 | The callback for TPM vendor specific physical presence which is called for\r | |
144 | Get User Confirmation Status for Operation.\r | |
145 | \r | |
146 | This API should be invoked in OS runtime phase to interface with ACPI method.\r | |
147 | \r | |
148 | Caution: This function may receive untrusted input.\r | |
149 | \r | |
150 | If OperationRequest < 128, then ASSERT().\r | |
151 | \r | |
152 | @param[in] OperationRequest TPM physical presence operation request.\r | |
153 | @param[in] ManagementFlags BIOS TPM Management Flags.\r | |
154 | \r | |
155 | @return Return Code for Get User Confirmation Status for Operation.\r | |
156 | **/\r | |
157 | UINT32\r | |
158 | EFIAPI\r | |
159 | TrEEPpVendorLibGetUserConfirmationStatusFunction (\r | |
160 | IN UINT32 OperationRequest,\r | |
161 | IN UINT32 ManagementFlags\r | |
162 | );\r | |
163 | \r | |
164 | #endif\r |