]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/GuidedSectionExtraction.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Ppi / GuidedSectionExtraction.h
CommitLineData
c311f86b 1/** @file\r
9095d37b
LG
2 If a GUID-defined section is encountered when doing section extraction,\r
3 the PEI Foundation or the EFI_PEI_FILE_LOADER_PPI instance\r
4 calls the appropriate instance of the GUIDed Section Extraction PPI\r
5 to extract the section stream contained therein.\r
5879b875 6\r
9095d37b 7 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
5879b875 9\r
5879b875 10 @par Revision Reference:\r
0047820e 11 This PPI is introduced in PI Version 1.0.\r
5879b875 12\r
13**/\r
14\r
15#ifndef __EFI_GUIDED_SECTION_EXTRACTION_PPI_H__\r
16#define __EFI_GUIDED_SECTION_EXTRACTION_PPI_H__\r
17\r
18//\r
9095d37b
LG
19// Typically, protocol interface structures are identified\r
20// by associating them with a GUID. Each instance of\r
21// a protocol with a given GUID must have\r
22// the same interface structure. While all instances of\r
23// the GUIDed Section Extraction PPI must have\r
24// the same interface structure, they do not all have\r
25// te same GUID. The GUID that is associated with\r
26// an instance of the GUIDed Section Extraction Protocol\r
27// is used to correlate it with the GUIDed section type\r
5879b875 28// that it is intended to process.\r
29//\r
30\r
31\r
00edb218 32typedef struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI;\r
5879b875 33\r
5879b875 34\r
35/**\r
9095d37b 36 Processes the input section and returns the data contained therein\r
d7132512
LG
37 along with the authentication status.\r
38\r
5879b875 39 The ExtractSection() function processes the input section and\r
00edb218 40 returns a pointer to the section contents. If the section being\r
5879b875 41 extracted does not require processing (if the section\r
00edb218
A
42 GuidedSectionHeader.Attributes has the\r
43 EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then\r
44 OutputBuffer is just updated to point to the start of the\r
5879b875 45 section's contents. Otherwise, *Buffer must be allocated\r
46 from PEI permanent memory.\r
47\r
dafa11b1 48 @param This Indicates the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI\r
49 instance.\r
50 @param InputSection Buffer containing the input GUIDed section to be\r
51 processed.\r
52 @param OutputBuffer *OutputBuffer is allocated from PEI permanent memory\r
53 and contains the new section stream.\r
54 @param OutputSize A pointer to a caller-allocated UINTN in which\r
55 the size of *OutputBuffer allocation is stored.\r
56 If the function returns anything other than\r
57 EFI_SUCCESS, the value of *OutputSize is undefined.\r
58 @param AuthenticationStatus A pointer to a caller-allocated UINT32 that indicates\r
59 the authentication status of the output buffer.\r
60 If the input section's\r
61 GuidedSectionHeader.Attributes field has the\r
62 EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit as clear,\r
63 *AuthenticationStatus must return zero. These bits\r
64 reflect the status of the extraction operation.\r
65 If the function returns anything other than EFI_SUCCESS,\r
66 the value of *AuthenticationStatus is undefined.\r
9095d37b 67\r
dafa11b1 68 @retval EFI_SUCCESS The InputSection was successfully processed and the\r
5879b875 69 section contents were returned.\r
dafa11b1 70 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process the request.\r
71 @retval EFI_INVALID_PARAMETER The GUID in InputSection does not match this instance of the\r
5879b875 72 GUIDed Section Extraction PPI.\r
73**/\r
74typedef\r
75EFI_STATUS\r
76(EFIAPI *EFI_PEI_EXTRACT_GUIDED_SECTION)(\r
dafa11b1 77 IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,\r
78 IN CONST VOID *InputSection,\r
79 OUT VOID **OutputBuffer,\r
80 OUT UINTN *OutputSize,\r
81 OUT UINT32 *AuthenticationStatus\r
5879b875 82);\r
83\r
dafa11b1 84///\r
85/// If a GUID-defined section is encountered when doing section extraction,\r
86/// the PEI Foundation or the EFI_PEI_FILE_LOADER_PPI instance\r
87/// calls the appropriate instance of the GUIDed Section\r
88/// Extraction PPI to extract the section stream contained\r
89/// therein.\r
9095d37b 90///\r
5879b875 91struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI {\r
00edb218 92 EFI_PEI_EXTRACT_GUIDED_SECTION ExtractSection;\r
5879b875 93};\r
94\r
95\r
96\r
97#endif\r
98\r