]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg/Tpm12CommandLib.h: Add TPM 1.2 commands used by TCG modules
authorMichael Kinney <michael.d.kinney@intel.com>
Thu, 21 Jan 2016 19:29:56 +0000 (19:29 +0000)
committermdkinney <mdkinney@Edk2>
Thu, 21 Jan 2016 19:29:56 +0000 (19:29 +0000)
Add the following APIs that are required by TcgPei and/or TcgDxe:
  Tpm12Extend()
  Tpm12PhysicalPresence()
  Tpm12ContinueSelfTest()
  Tpm12GetCapabilityFlagPermanent()
  Tpm12GetCapabilityFlagVolatile()

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19726 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/Include/Library/Tpm12CommandLib.h

index 037a1f34bca51891f30da1ff4fb606963b8a3908..f7c098f28341f6d52aaa7d0fb6c54076dbf0ebd7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This library is used by other modules to send TPM12 command.\r
 \r
-Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved. <BR>\r
+Copyright (c) 2013 - 2016, 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
@@ -138,4 +138,88 @@ Tpm12NvWriteValue (
   IN UINT8          *Data\r
   );\r
 \r
+/**\r
+Extend a TPM PCR.\r
+\r
+@param[in]  DigestToExtend    The 160 bit value representing the event to be recorded.\r
+@param[in]  PcrIndex          The PCR to be updated.\r
+@param[out] NewPcrValue       New PCR value after extend.\r
+\r
+@retval EFI_SUCCESS           Operation completed successfully.\r
+@retval EFI_TIMEOUT           The register can't run into the expected status in time.\r
+@retval EFI_BUFFER_TOO_SMALL  Response data buffer is too small.\r
+@retval EFI_DEVICE_ERROR      Unexpected device behavior.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Tpm12Extend (\r
+  IN  TPM_DIGEST    *DigestToExtend,\r
+  IN  TPM_PCRINDEX  PcrIndex,\r
+  OUT TPM_DIGEST    *NewPcrValue\r
+  );\r
+\r
+/**\r
+Send TSC_PhysicalPresence command to TPM.\r
+\r
+@param[in] PhysicalPresence   The state to set the TPMs Physical Presence flags.\r
+\r
+@retval EFI_SUCCESS           Operation completed successfully.\r
+@retval EFI_TIMEOUT           The register can't run into the expected status in time.\r
+@retval EFI_BUFFER_TOO_SMALL  Response data buffer is too small.\r
+@retval EFI_DEVICE_ERROR      Unexpected device behavior.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Tpm12PhysicalPresence (\r
+  IN      TPM_PHYSICAL_PRESENCE     PhysicalPresence\r
+  );\r
+\r
+/**\r
+Send TPM_ContinueSelfTest command to TPM.\r
+\r
+@retval EFI_SUCCESS           Operation completed successfully.\r
+@retval EFI_TIMEOUT           The register can't run into the expected status in time.\r
+@retval EFI_BUFFER_TOO_SMALL  Response data buffer is too small.\r
+@retval EFI_DEVICE_ERROR      Unexpected device behavior.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Tpm12ContinueSelfTest (\r
+  VOID\r
+  );\r
+\r
+/**\r
+Get TPM capability permanent flags.\r
+\r
+@param[out] TpmPermanentFlags   Pointer to the buffer for returned flag structure.\r
+\r
+@retval EFI_SUCCESS           Operation completed successfully.\r
+@retval EFI_TIMEOUT           The register can't run into the expected status in time.\r
+@retval EFI_BUFFER_TOO_SMALL  Response data buffer is too small.\r
+@retval EFI_DEVICE_ERROR      Unexpected device behavior.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Tpm12GetCapabilityFlagPermanent (\r
+  OUT TPM_PERMANENT_FLAGS  *TpmPermanentFlags\r
+  );\r
+\r
+/**\r
+Get TPM capability volatile flags.\r
+\r
+@param[out] VolatileFlags   Pointer to the buffer for returned flag structure.\r
+\r
+@retval EFI_SUCCESS      Operation completed successfully.\r
+@retval EFI_DEVICE_ERROR The command was unsuccessful.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Tpm12GetCapabilityFlagVolatile (\r
+  OUT TPM_STCLEAR_FLAGS                 *VolatileFlags\r
+  );\r
 #endif\r