]>
Commit | Line | Data |
---|---|---|
4610b23a | 1 | /** @file\r |
07309c3d | 2 | This library is to support TCG Physical Presence Interface (PPI) specification\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 | |
b3548d32 | 7 | \r |
4610b23a JY |
8 | Caution: This function may receive untrusted input.\r |
9 | \r | |
b3548d32 | 10 | Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r |
289b714b | 11 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
4610b23a JY |
12 | \r |
13 | **/\r | |
14 | \r | |
15 | #ifndef _TCG_PP_VENDOR_LIB_H_\r | |
16 | #define _TCG_PP_VENDOR_LIB_H_\r | |
17 | \r | |
18 | //\r | |
19 | // The definition of physical presence operation actions\r | |
20 | //\r | |
c411b485 | 21 | #define TCG_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION 128\r |
4610b23a JY |
22 | \r |
23 | //\r | |
24 | // The definition bit of the BIOS TPM Management Flags\r | |
25 | //\r | |
c411b485 MK |
26 | #define TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_PROVISION BIT0\r |
27 | #define TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_CLEAR BIT1\r | |
28 | #define TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_MAINTENANCE BIT2\r | |
29 | #define TCG_VENDOR_LIB_FLAG_RESET_TRACK BIT3\r | |
4610b23a JY |
30 | \r |
31 | //\r | |
32 | // The definition for TPM Operation Response to OS Environment\r | |
33 | //\r | |
c411b485 MK |
34 | #define TCG_PP_OPERATION_RESPONSE_SUCCESS 0x0\r |
35 | #define TCG_PP_OPERATION_RESPONSE_USER_ABORT 0xFFFFFFF0\r | |
36 | #define TCG_PP_OPERATION_RESPONSE_BIOS_FAILURE 0xFFFFFFF1\r | |
4610b23a JY |
37 | \r |
38 | //\r | |
0ab475c9 ZC |
39 | // The return code for Submit TPM Request to Pre-OS Environment\r |
40 | // and Submit TPM Request to Pre-OS Environment 2\r | |
4610b23a | 41 | //\r |
c411b485 MK |
42 | #define TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS 0\r |
43 | #define TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED 1\r | |
44 | #define TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE 2\r | |
45 | #define TCG_PP_SUBMIT_REQUEST_TO_PREOS_BLOCKED_BY_BIOS_SETTINGS 3\r | |
4610b23a JY |
46 | \r |
47 | //\r | |
48 | // The return code for Get User Confirmation Status for Operation\r | |
49 | //\r | |
c411b485 MK |
50 | #define TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED 0\r |
51 | #define TCG_PP_GET_USER_CONFIRMATION_BIOS_ONLY 1\r | |
52 | #define TCG_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION 2\r | |
53 | #define TCG_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_REQUIRED 3\r | |
54 | #define TCG_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_NOT_REQUIRED 4\r | |
4610b23a JY |
55 | \r |
56 | /**\r | |
57 | Check and execute the requested physical presence command.\r | |
58 | \r | |
59 | This API should be invoked in BIOS boot phase to process pending request.\r | |
b3548d32 | 60 | \r |
4610b23a | 61 | Caution: This function may receive untrusted input.\r |
b3548d32 | 62 | \r |
4610b23a JY |
63 | If OperationRequest < 128, then ASSERT().\r |
64 | \r | |
65 | @param[in] OperationRequest TPM physical presence operation request.\r | |
66 | @param[in, out] ManagementFlags BIOS TPM Management Flags.\r | |
67 | @param[out] ResetRequired If reset is required to vendor settings in effect.\r | |
68 | True, it indicates the reset is required.\r | |
69 | False, it indicates the reset is not required.\r | |
70 | \r | |
71 | @return TPM Operation Response to OS Environment.\r | |
72 | **/\r | |
73 | UINT32\r | |
74 | EFIAPI\r | |
75 | TcgPpVendorLibExecutePendingRequest (\r | |
c411b485 MK |
76 | IN UINT32 OperationRequest,\r |
77 | IN OUT UINT32 *ManagementFlags,\r | |
78 | OUT BOOLEAN *ResetRequired\r | |
4610b23a JY |
79 | );\r |
80 | \r | |
81 | /**\r | |
82 | Check if there is a valid physical presence command request.\r | |
83 | \r | |
84 | This API should be invoked in BIOS boot phase to process pending request.\r | |
b3548d32 | 85 | \r |
4610b23a JY |
86 | Caution: This function may receive untrusted input.\r |
87 | \r | |
88 | If OperationRequest < 128, then ASSERT().\r | |
89 | \r | |
90 | @param[in] OperationRequest TPM physical presence operation request.\r | |
91 | @param[in] ManagementFlags BIOS TPM Management Flags.\r | |
92 | @param[out] RequestConfirmed If the physical presence operation command required user confirm from UI.\r | |
93 | True, it indicates the command doesn't require user confirm.\r | |
94 | False, it indicates the command need user confirm from UI.\r | |
95 | \r | |
96 | @retval TRUE Physical Presence operation command is valid.\r | |
97 | @retval FALSE Physical Presence operation command is invalid.\r | |
98 | **/\r | |
99 | BOOLEAN\r | |
100 | EFIAPI\r | |
101 | TcgPpVendorLibHasValidRequest (\r | |
c411b485 MK |
102 | IN UINT32 OperationRequest,\r |
103 | IN UINT32 ManagementFlags,\r | |
104 | OUT BOOLEAN *RequestConfirmed\r | |
4610b23a JY |
105 | );\r |
106 | \r | |
107 | /**\r | |
108 | The callback for TPM vendor specific physical presence which is called for\r | |
109 | Submit TPM Operation Request to Pre-OS Environment and\r | |
110 | Submit TPM Operation Request to Pre-OS Environment 2.\r | |
111 | \r | |
112 | This API should be invoked in OS runtime phase to interface with ACPI method.\r | |
113 | \r | |
114 | Caution: This function may receive untrusted input.\r | |
b3548d32 | 115 | \r |
4610b23a JY |
116 | If OperationRequest < 128, then ASSERT().\r |
117 | \r | |
118 | @param[in] OperationRequest TPM physical presence operation request.\r | |
119 | @param[in] ManagementFlags BIOS TPM Management Flags.\r | |
120 | \r | |
121 | @return Return Code for Submit TPM Operation Request to Pre-OS Environment and\r | |
122 | Submit TPM Operation Request to Pre-OS Environment 2.\r | |
123 | **/\r | |
124 | UINT32\r | |
125 | EFIAPI\r | |
126 | TcgPpVendorLibSubmitRequestToPreOSFunction (\r | |
c411b485 MK |
127 | IN UINT32 OperationRequest,\r |
128 | IN UINT32 ManagementFlags\r | |
4610b23a JY |
129 | );\r |
130 | \r | |
131 | /**\r | |
132 | The callback for TPM vendor specific physical presence which is called for\r | |
133 | Get User Confirmation Status for Operation.\r | |
134 | \r | |
135 | This API should be invoked in OS runtime phase to interface with ACPI method.\r | |
136 | \r | |
137 | Caution: This function may receive untrusted input.\r | |
b3548d32 | 138 | \r |
4610b23a JY |
139 | If OperationRequest < 128, then ASSERT().\r |
140 | \r | |
141 | @param[in] OperationRequest TPM physical presence operation request.\r | |
142 | @param[in] ManagementFlags BIOS TPM Management Flags.\r | |
143 | \r | |
144 | @return Return Code for Get User Confirmation Status for Operation.\r | |
145 | **/\r | |
146 | UINT32\r | |
147 | EFIAPI\r | |
148 | TcgPpVendorLibGetUserConfirmationStatusFunction (\r | |
c411b485 MK |
149 | IN UINT32 OperationRequest,\r |
150 | IN UINT32 ManagementFlags\r | |
4610b23a JY |
151 | );\r |
152 | \r | |
153 | #endif\r |