/edk2/BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h

https://gitlab.com/envieidoc/Clover · C Header · 151 lines · 21 code · 10 blank · 120 comment · 0 complexity · f49ccb1e1c79f961bcdf900b2b02cccf MD5 · raw file

  1. /** @file
  2. This file declares GUIDed section extraction protocol.
  3. This interface provides a means of decoding a GUID defined encapsulation
  4. section. There may be multiple different GUIDs associated with the GUIDed
  5. section extraction protocol. That is, all instances of the GUIDed section
  6. extraction protocol must have the same interface structure.
  7. @par Revision Reference: PI
  8. Version 1.00.
  9. Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
  10. This program and the accompanying materials are licensed and made available
  11. under the terms and conditions of the BSD License which accompanies this
  12. distribution. The full text of the license may be found at
  13. http://opensource.org/licenses/bsd-license.php
  14. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  15. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  16. **/
  17. #ifndef __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
  18. #define __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
  19. //
  20. // Forward reference for pure ANSI compatability
  21. typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
  22. /**
  23. The ExtractSection() function processes the input section and
  24. allocates a buffer from the pool in which it returns the section
  25. contents. If the section being extracted contains
  26. authentication information (the section's
  27. GuidedSectionHeader.Attributes field has the
  28. EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values
  29. returned in AuthenticationStatus must reflect the results of
  30. the authentication operation. Depending on the algorithm and
  31. size of the encapsulated data, the time that is required to do
  32. a full authentication may be prohibitively long for some
  33. classes of systems. To indicate this, use
  34. EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by
  35. the security policy driver (see the Platform Initialization
  36. Driver Execution Environment Core Interface Specification for
  37. more details and the GUID definition). If the
  38. EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle
  39. database, then, if possible, full authentication should be
  40. skipped and the section contents simply returned in the
  41. OutputBuffer. In this case, the
  42. EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus
  43. must be set on return. ExtractSection() is callable only from
  44. TPL_NOTIFY and below. Behavior of ExtractSection() at any
  45. EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is
  46. defined in RaiseTPL() in the UEFI 2.0 specification.
  47. @param This Indicates the
  48. EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
  49. @param InputSection Buffer containing the input GUIDed section
  50. to be processed. OutputBuffer OutputBuffer
  51. is allocated from boot services pool
  52. memory and contains the new section
  53. stream. The caller is responsible for
  54. freeing this buffer.
  55. @param OutputSize A pointer to a caller-allocated UINTN in
  56. which the size of OutputBuffer allocation
  57. is stored. If the function returns
  58. anything other than EFI_SUCCESS, the value
  59. of OutputSize is undefined.
  60. @param AuthenticationStatus A pointer to a caller-allocated
  61. UINT32 that indicates the
  62. authentication status of the
  63. output buffer. If the input
  64. section's
  65. GuidedSectionHeader.Attributes
  66. field has the
  67. EFI_GUIDED_SECTION_AUTH_STATUS_VAL
  68. bit as clear, AuthenticationStatus
  69. must return zero. Both local bits
  70. (19:16) and aggregate bits (3:0)
  71. in AuthenticationStatus are
  72. returned by ExtractSection().
  73. These bits reflect the status of
  74. the extraction operation. The bit
  75. pattern in both regions must be
  76. the same, as the local and
  77. aggregate authentication statuses
  78. have equivalent meaning at this
  79. level. If the function returns
  80. anything other than EFI_SUCCESS,
  81. the value of AuthenticationStatus
  82. is undefined.
  83. @retval EFI_SUCCESS The InputSection was successfully
  84. processed and the section contents were
  85. returned.
  86. @retval EFI_OUT_OF_RESOURCES The system has insufficient
  87. resources to process the
  88. request.
  89. @retval EFI_INVALID_PARAMETER The GUID in InputSection does
  90. not match this instance of the
  91. GUIDed Section Extraction
  92. Protocol.
  93. **/
  94. typedef
  95. EFI_STATUS
  96. (EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(
  97. IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
  98. IN CONST VOID *InputSection,
  99. OUT VOID **OutputBuffer,
  100. OUT UINTN *OutputSize,
  101. OUT UINT32 *AuthenticationStatus
  102. );
  103. /**
  104. Takes the GUIDed section as input and produces the section
  105. stream data. See the ExtractSection() function description.
  106. **/
  107. struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
  108. EFI_EXTRACT_GUIDED_SECTION ExtractSection;
  109. };
  110. //
  111. // Protocol GUID definition. Each GUIDed section extraction protocol has the
  112. // same interface but with different GUID. All the GUIDs is defined here.
  113. // May add multiple GUIDs here.
  114. //
  115. #define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \
  116. { \
  117. 0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \
  118. }
  119. //
  120. // may add other GUID here
  121. //
  122. extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;
  123. #endif