TcgMorLock.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /** @file
  2. TCG MOR (Memory Overwrite Request) Lock Control Driver header file.
  3. Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _EFI_TCG_MOR_LOCK_H_
  7. #define _EFI_TCG_MOR_LOCK_H_
  8. /**
  9. This service is a wrapper for the UEFI Runtime Service GetVariable().
  10. @param VariableName the name of the vendor's variable, it's a Null-Terminated Unicode String
  11. @param VendorGuid Unify identifier for vendor.
  12. @param Attributes Point to memory location to return the attributes of variable. If the point
  13. is NULL, the parameter would be ignored.
  14. @param DataSize As input, point to the maximum size of return Data-Buffer.
  15. As output, point to the actual size of the returned Data-Buffer.
  16. @param Data Point to return Data-Buffer.
  17. @retval EFI_SUCCESS The function completed successfully.
  18. @retval EFI_NOT_FOUND The variable was not found.
  19. @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. DataSize has
  20. been updated with the size needed to complete the request.
  21. @retval EFI_INVALID_PARAMETER VariableName is NULL.
  22. @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
  23. @retval EFI_INVALID_PARAMETER DataSize is NULL.
  24. @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL.
  25. @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
  26. @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
  27. **/
  28. EFI_STATUS
  29. EFIAPI
  30. InternalGetVariable (
  31. IN CHAR16 *VariableName,
  32. IN EFI_GUID *VendorGuid,
  33. OUT UINT32 *Attributes OPTIONAL,
  34. IN OUT UINTN *DataSize,
  35. OUT VOID *Data
  36. );
  37. /**
  38. This service is a wrapper for the UEFI Runtime Service SetVariable()
  39. @param VariableName the name of the vendor's variable, as a
  40. Null-Terminated Unicode String
  41. @param VendorGuid Unify identifier for vendor.
  42. @param Attributes Point to memory location to return the attributes of variable. If the point
  43. is NULL, the parameter would be ignored.
  44. @param DataSize The size in bytes of Data-Buffer.
  45. @param Data Point to the content of the variable.
  46. @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
  47. defined by the Attributes.
  48. @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the
  49. DataSize exceeds the maximum allowed.
  50. @retval EFI_INVALID_PARAMETER VariableName is an empty Unicode string.
  51. @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
  52. @retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.
  53. @retval EFI_WRITE_PROTECTED The variable in question is read-only.
  54. @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
  55. @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
  56. set but the AuthInfo does NOT pass the validation check carried
  57. out by the firmware.
  58. @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
  59. **/
  60. EFI_STATUS
  61. EFIAPI
  62. InternalSetVariable (
  63. IN CHAR16 *VariableName,
  64. IN EFI_GUID *VendorGuid,
  65. IN UINT32 Attributes,
  66. IN UINTN DataSize,
  67. IN VOID *Data
  68. );
  69. /**
  70. This service is a checker handler for the UEFI Runtime Service SetVariable()
  71. @param VariableName the name of the vendor's variable, as a
  72. Null-Terminated Unicode String
  73. @param VendorGuid Unify identifier for vendor.
  74. @param Attributes Point to memory location to return the attributes of variable. If the point
  75. is NULL, the parameter would be ignored.
  76. @param DataSize The size in bytes of Data-Buffer.
  77. @param Data Point to the content of the variable.
  78. @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
  79. defined by the Attributes.
  80. @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the
  81. DataSize exceeds the maximum allowed.
  82. @retval EFI_INVALID_PARAMETER VariableName is an empty Unicode string.
  83. @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
  84. @retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.
  85. @retval EFI_WRITE_PROTECTED The variable in question is read-only.
  86. @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
  87. @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
  88. set but the AuthInfo does NOT pass the validation check carried
  89. out by the firmware.
  90. @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
  91. **/
  92. EFI_STATUS
  93. EFIAPI
  94. SetVariableCheckHandlerMor (
  95. IN CHAR16 *VariableName,
  96. IN EFI_GUID *VendorGuid,
  97. IN UINT32 Attributes,
  98. IN UINTN DataSize,
  99. IN VOID *Data
  100. );
  101. /**
  102. Entry Point for MOR Lock Control driver.
  103. @param[in] ImageHandle Image handle of this driver.
  104. @param[in] SystemTable A Pointer to the EFI System Table.
  105. @retval EFI_SUCCESS
  106. @return Others Some error occurs.
  107. **/
  108. EFI_STATUS
  109. EFIAPI
  110. MorLockDriverInit (
  111. VOID
  112. );
  113. #endif