TcgPpVendorLib.h 5.7 KB

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