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