2 This library is to support TCG Physical Presence Interface (PPI) specification
3 >= 128 Vendor Specific PPI Operation.
5 The Vendor Specific PPI operation may change TPM state, BIOS TPM management
6 flags, and may need additional boot cycle.
8 Caution: This function may receive untrusted input.
10 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
11 SPDX-License-Identifier: BSD-2-Clause-Patent
15 #ifndef _TCG_PP_VENDOR_LIB_H_
16 #define _TCG_PP_VENDOR_LIB_H_
19 // The definition of physical presence operation actions
21 #define TCG_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION 128
24 // The definition bit of the BIOS TPM Management Flags
26 #define TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_PROVISION BIT0
27 #define TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_CLEAR BIT1
28 #define TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_MAINTENANCE BIT2
29 #define TCG_VENDOR_LIB_FLAG_RESET_TRACK BIT3
32 // The definition for TPM Operation Response to OS Environment
34 #define TCG_PP_OPERATION_RESPONSE_SUCCESS 0x0
35 #define TCG_PP_OPERATION_RESPONSE_USER_ABORT 0xFFFFFFF0
36 #define TCG_PP_OPERATION_RESPONSE_BIOS_FAILURE 0xFFFFFFF1
39 // The return code for Submit TPM Request to Pre-OS Environment
40 // and Submit TPM Request to Pre-OS Environment 2
42 #define TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS 0
43 #define TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED 1
44 #define TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE 2
45 #define TCG_PP_SUBMIT_REQUEST_TO_PREOS_BLOCKED_BY_BIOS_SETTINGS 3
48 // The return code for Get User Confirmation Status for Operation
50 #define TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED 0
51 #define TCG_PP_GET_USER_CONFIRMATION_BIOS_ONLY 1
52 #define TCG_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION 2
53 #define TCG_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_REQUIRED 3
54 #define TCG_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_NOT_REQUIRED 4
57 Check and execute the requested physical presence command.
59 This API should be invoked in BIOS boot phase to process pending request.
61 Caution: This function may receive untrusted input.
63 If OperationRequest < 128, then ASSERT().
65 @param[in] OperationRequest TPM physical presence operation request.
66 @param[in, out] ManagementFlags BIOS TPM Management Flags.
67 @param[out] ResetRequired If reset is required to vendor settings in effect.
68 True, it indicates the reset is required.
69 False, it indicates the reset is not required.
71 @return TPM Operation Response to OS Environment.
75 TcgPpVendorLibExecutePendingRequest (
76 IN UINT32 OperationRequest
,
77 IN OUT UINT32
*ManagementFlags
,
78 OUT BOOLEAN
*ResetRequired
82 Check if there is a valid physical presence command request.
84 This API should be invoked in BIOS boot phase to process pending request.
86 Caution: This function may receive untrusted input.
88 If OperationRequest < 128, then ASSERT().
90 @param[in] OperationRequest TPM physical presence operation request.
91 @param[in] ManagementFlags BIOS TPM Management Flags.
92 @param[out] RequestConfirmed If the physical presence operation command required user confirm from UI.
93 True, it indicates the command doesn't require user confirm.
94 False, it indicates the command need user confirm from UI.
96 @retval TRUE Physical Presence operation command is valid.
97 @retval FALSE Physical Presence operation command is invalid.
101 TcgPpVendorLibHasValidRequest (
102 IN UINT32 OperationRequest
,
103 IN UINT32 ManagementFlags
,
104 OUT BOOLEAN
*RequestConfirmed
108 The callback for TPM vendor specific physical presence which is called for
109 Submit TPM Operation Request to Pre-OS Environment and
110 Submit TPM Operation Request to Pre-OS Environment 2.
112 This API should be invoked in OS runtime phase to interface with ACPI method.
114 Caution: This function may receive untrusted input.
116 If OperationRequest < 128, then ASSERT().
118 @param[in] OperationRequest TPM physical presence operation request.
119 @param[in] ManagementFlags BIOS TPM Management Flags.
121 @return Return Code for Submit TPM Operation Request to Pre-OS Environment and
122 Submit TPM Operation Request to Pre-OS Environment 2.
126 TcgPpVendorLibSubmitRequestToPreOSFunction (
127 IN UINT32 OperationRequest
,
128 IN UINT32 ManagementFlags
132 The callback for TPM vendor specific physical presence which is called for
133 Get User Confirmation Status for Operation.
135 This API should be invoked in OS runtime phase to interface with ACPI method.
137 Caution: This function may receive untrusted input.
139 If OperationRequest < 128, then ASSERT().
141 @param[in] OperationRequest TPM physical presence operation request.
142 @param[in] ManagementFlags BIOS TPM Management Flags.
144 @return Return Code for Get User Confirmation Status for Operation.
148 TcgPpVendorLibGetUserConfirmationStatusFunction (
149 IN UINT32 OperationRequest
,
150 IN UINT32 ManagementFlags