]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Include/Library/Tcg2PpVendorLib.h
Add TPM2 support defined in trusted computing group.
[mirror_edk2.git] / SecurityPkg / Include / Library / Tcg2PpVendorLib.h
diff --git a/SecurityPkg/Include/Library/Tcg2PpVendorLib.h b/SecurityPkg/Include/Library/Tcg2PpVendorLib.h
new file mode 100644 (file)
index 0000000..2434750
--- /dev/null
@@ -0,0 +1,129 @@
+/** @file\r
+  Ihis library is to support TCG PC Client Platform Physical Presence Interface Specification\r
+  Family "2.0" part, >= 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 _TCG2_PP_VENDOR_LIB_H_\r
+#define _TCG2_PP_VENDOR_LIB_H_\r
+\r
+#include <IndustryStandard/Tpm20.h>\r
+#include <Protocol/Tcg2Protocol.h>\r
+#include <Library/Tcg2PhysicalPresenceLib.h>\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
+Tcg2PpVendorLibExecutePendingRequest (\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
+Tcg2PpVendorLibHasValidRequest (\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
+  @param[in]      RequestParameter Extra parameter from the passed package.\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
+Tcg2PpVendorLibSubmitRequestToPreOSFunction (\r
+  IN UINT32                 OperationRequest,\r
+  IN UINT32                 ManagementFlags,\r
+  IN UINT32                 RequestParameter\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
+Tcg2PpVendorLibGetUserConfirmationStatusFunction (\r
+  IN UINT32                 OperationRequest,\r
+  IN UINT32                 ManagementFlags\r
+  );\r
+\r
+#endif\r