SectionExtraction.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /** @file
  2. This file declares the Section Extraction PPI.
  3. This PPI is defined in PEI CIS version 0.91. It supports encapsulating sections,
  4. such as GUIDed sections used to authenticate the file encapsulation of other domain-specific wrapping.
  5. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  6. SPDX-License-Identifier: BSD-2-Clause-Patent
  7. **/
  8. #ifndef __SECTION_EXTRACTION_H__
  9. #define __SECTION_EXTRACTION_H__
  10. #define EFI_PEI_SECTION_EXTRACTION_PPI_GUID \
  11. { \
  12. 0x4F89E208, 0xE144, 0x4804, {0x9E, 0xC8, 0x0F, 0x89, 0x4F, 0x7E, 0x36, 0xD7 } \
  13. }
  14. typedef struct _EFI_PEI_SECTION_EXTRACTION_PPI EFI_PEI_SECTION_EXTRACTION_PPI;
  15. //
  16. // Bit values for AuthenticationStatus
  17. //
  18. #define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01
  19. #define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02
  20. #define EFI_AUTH_STATUS_NOT_TESTED 0x04
  21. #define EFI_AUTH_STATUS_TEST_FAILED 0x08
  22. /**
  23. The function is used to retrieve a section from within a section file.
  24. It will retrieve both encapsulation sections and leaf sections in their entirety,
  25. exclusive of the section header.
  26. @param PeiServices The pointer to the PEI Services Table.
  27. @param This Indicates the calling context
  28. @param SectionType The pointer to an EFI_SECTION_TYPE. If
  29. SectionType == NULL, the contents of the entire
  30. section are returned in Buffer. If SectionType
  31. is not NULL, only the requested section is returned.
  32. @param SectionDefinitionGuid The pointer to an EFI_GUID.
  33. If SectionType == EFI_SECTION_GUID_DEFINED,
  34. SectionDefinitionGuid indicates for which section
  35. GUID to search. If SectionType != EFI_SECTION_GUID_DEFINED,
  36. SectionDefinitionGuid is unused and is ignored.
  37. @param SectionInstance If SectionType is not NULL, indicates which
  38. instance of the requested section type to return.
  39. @param Buffer The pointer to a pointer to a buffer in which the
  40. section contents are returned.
  41. @param BufferSize A pointer to a caller-allocated UINT32. On input,
  42. *BufferSize indicates the size in bytes of the
  43. memory region pointed to by Buffer. On output,
  44. *BufferSize contains the number of bytes required
  45. to read the section.
  46. @param AuthenticationStatus A pointer to a caller-allocated UINT32 in
  47. which any metadata from encapsulating GUID-defined
  48. sections is returned.
  49. @retval EFI_SUCCESS The section was successfully processed, and the section
  50. contents were returned in Buffer.
  51. @retval EFI_PROTOCOL_ERROR A GUID-defined section was encountered in
  52. the file with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED
  53. bit set, but there was no corresponding GUIDed
  54. Section Extraction Protocol in the handle database.
  55. *Buffer is unmodified.
  56. @retval EFI_NOT_FOUND The requested section does not exist.*Buffer is
  57. unmodified.
  58. @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process
  59. the request.
  60. @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.
  61. @retval EFI_WARN_TOO_SMALL The size of the input buffer is insufficient to
  62. contain the requested section. The input buffer
  63. is filled and contents are section contents are
  64. truncated.
  65. **/
  66. typedef
  67. EFI_STATUS
  68. (EFIAPI *EFI_PEI_GET_SECTION)(
  69. IN EFI_PEI_SERVICES **PeiServices,
  70. IN EFI_PEI_SECTION_EXTRACTION_PPI *This,
  71. IN EFI_SECTION_TYPE *SectionType,
  72. IN EFI_GUID *SectionDefinitionGuid, OPTIONAL
  73. IN UINTN SectionInstance,
  74. IN VOID **Buffer,
  75. IN OUT UINT32 *BufferSize,
  76. OUT UINT32 *AuthenticationStatus
  77. );
  78. /**
  79. This PPI supports encapsulating sections, such as GUIDed sections used to
  80. authenticate the file encapsulation of other domain-specific wrapping.
  81. **/
  82. struct _EFI_PEI_SECTION_EXTRACTION_PPI {
  83. EFI_PEI_GET_SECTION GetSection; ///< Retrieves a section from within a section file.
  84. };
  85. extern EFI_GUID gEfiPeiSectionExtractionPpiGuid;
  86. #endif