+/** @file\r
+ Ihis library is to support Trusted Execution Environment (TrEE) ACPI Profile\r
+ >= 128 Vendor Specific PPI Operation.\r
+\r
+ The Vendor Specific PPI operation may change TPM state, BIOS TPM management\r
+ flags, and may need additional boot cycle.\r
+ \r
+ Caution: This function may receive untrusted input.\r
+\r
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials \r
+are licensed and made available under the terms and conditions of the BSD License \r
+which accompanies this distribution. The full text of the license may be found at \r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _TREE_PP_VENDOR_LIB_H_\r
+#define _TREE_PP_VENDOR_LIB_H_\r
+\r
+#include <IndustryStandard/Tpm20.h>\r
+#include <Protocol/TrEEProtocol.h>\r
+\r
+//\r
+// The definition of physical presence operation actions\r
+//\r
+#define TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION 128\r
+\r
+//\r
+// The definition bit of the BIOS TPM Management Flags\r
+//\r
+// BIT0 is reserved\r
+#define TREE_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_CLEAR BIT1\r
+// BIT2 is reserved\r
+#define TREE_VENDOR_LIB_FLAG_RESET_TRACK BIT3\r
+\r
+//\r
+// The definition for TPM Operation Response to OS Environment\r
+//\r
+#define TREE_PP_OPERATION_RESPONSE_SUCCESS 0x0\r
+#define TREE_PP_OPERATION_RESPONSE_USER_ABORT 0xFFFFFFF0\r
+#define TREE_PP_OPERATION_RESPONSE_BIOS_FAILURE 0xFFFFFFF1\r
+\r
+//\r
+// The return code for Sumbit TPM Request to Pre-OS Environment\r
+// and Sumbit TPM Request to Pre-OS Environment 2\r
+//\r
+#define TREE_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS 0\r
+#define TREE_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED 1\r
+#define TREE_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE 2\r
+#define TREE_PP_SUBMIT_REQUEST_TO_PREOS_BLOCKED_BY_BIOS_SETTINGS 3\r
+\r
+//\r
+// The return code for Get User Confirmation Status for Operation\r
+//\r
+#define TREE_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED 0\r
+#define TREE_PP_GET_USER_CONFIRMATION_BIOS_ONLY 1\r
+#define TREE_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION 2\r
+#define TREE_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_REQUIRED 3\r
+#define TREE_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_NOT_REQUIRED 4\r
+\r
+/**\r
+ Check and execute the requested physical presence command.\r
+\r
+ This API should be invoked in BIOS boot phase to process pending request.\r
+ \r
+ Caution: This function may receive untrusted input.\r
+ \r
+ If OperationRequest < 128, then ASSERT().\r
+\r
+ @param[in] PlatformAuth platform auth value. NULL means no platform auth change.\r
+ @param[in] OperationRequest TPM physical presence operation request.\r
+ @param[in, out] ManagementFlags BIOS TPM Management Flags.\r
+ @param[out] ResetRequired If reset is required to vendor settings in effect.\r
+ True, it indicates the reset is required.\r
+ False, it indicates the reset is not required.\r
+\r
+ @return TPM Operation Response to OS Environment.\r
+**/\r
+UINT32\r
+EFIAPI\r
+TrEEPpVendorLibExecutePendingRequest (\r
+ IN TPM2B_AUTH *PlatformAuth, OPTIONAL\r
+ IN UINT32 OperationRequest,\r
+ IN OUT UINT32 *ManagementFlags,\r
+ OUT BOOLEAN *ResetRequired\r
+ );\r
+\r
+/**\r
+ Check if there is a valid physical presence command request.\r
+\r
+ This API should be invoked in BIOS boot phase to process pending request.\r
+ \r
+ Caution: This function may receive untrusted input.\r
+\r
+ If OperationRequest < 128, then ASSERT().\r
+\r
+ @param[in] OperationRequest TPM physical presence operation request.\r
+ @param[in] ManagementFlags BIOS TPM Management Flags.\r
+ @param[out] RequestConfirmed If the physical presence operation command required user confirm from UI.\r
+ True, it indicates the command doesn't require user confirm.\r
+ False, it indicates the command need user confirm from UI.\r
+\r
+ @retval TRUE Physical Presence operation command is valid.\r
+ @retval FALSE Physical Presence operation command is invalid.\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+TrEEPpVendorLibHasValidRequest (\r
+ IN UINT32 OperationRequest,\r
+ IN UINT32 ManagementFlags,\r
+ OUT BOOLEAN *RequestConfirmed\r
+ );\r
+\r
+/**\r
+ The callback for TPM vendor specific physical presence which is called for\r
+ Submit TPM Operation Request to Pre-OS Environment and\r
+ Submit TPM Operation Request to Pre-OS Environment 2.\r
+\r
+ This API should be invoked in OS runtime phase to interface with ACPI method.\r
+\r
+ Caution: This function may receive untrusted input.\r
+ \r
+ If OperationRequest < 128, then ASSERT().\r
+\r
+ @param[in] OperationRequest TPM physical presence operation request.\r
+ @param[in] ManagementFlags BIOS TPM Management Flags.\r
+\r
+ @return Return Code for Submit TPM Operation Request to Pre-OS Environment and\r
+ Submit TPM Operation Request to Pre-OS Environment 2.\r
+**/\r
+UINT32\r
+EFIAPI\r
+TrEEPpVendorLibSubmitRequestToPreOSFunction (\r
+ IN UINT32 OperationRequest,\r
+ IN UINT32 ManagementFlags\r
+ );\r
+\r
+/**\r
+ The callback for TPM vendor specific physical presence which is called for\r
+ Get User Confirmation Status for Operation.\r
+\r
+ This API should be invoked in OS runtime phase to interface with ACPI method.\r
+\r
+ Caution: This function may receive untrusted input.\r
+ \r
+ If OperationRequest < 128, then ASSERT().\r
+\r
+ @param[in] OperationRequest TPM physical presence operation request.\r
+ @param[in] ManagementFlags BIOS TPM Management Flags.\r
+\r
+ @return Return Code for Get User Confirmation Status for Operation.\r
+**/\r
+UINT32\r
+EFIAPI\r
+TrEEPpVendorLibGetUserConfirmationStatusFunction (\r
+ IN UINT32 OperationRequest,\r
+ IN UINT32 ManagementFlags\r
+ );\r
+\r
+#endif\r