]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/GuidedSectionExtraction.h
Add PPI definitions introduced in PI1.0.
[mirror_edk2.git] / MdePkg / Include / Ppi / GuidedSectionExtraction.h
1 /* @file
2 If a GUID-defined section is encountered when doing section extraction,
3 the PEI Foundation or the EFI_PEI_FILE_LOADER_PPI instance
4 calls the appropriate instance of the GUIDed Section Extraction PPI
5 to extract the section stream contained therein..
6
7 Copyright (c) 2006 - 2007, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 Module Name: GuidedSectionExtraction.h
17
18 @par Revision Reference:
19 This PPI is defined in PI Version 1.00.
20
21 **/
22
23 #ifndef __EFI_GUIDED_SECTION_EXTRACTION_PPI_H__
24 #define __EFI_GUIDED_SECTION_EXTRACTION_PPI_H__
25
26 //
27 // Typically, protocol interface structures are identified
28 // by associating them with a GUID. Each instance of
29 // a protocol with a given GUID must have
30 // the same interface structure. While all instances of
31 // the GUIDed Section Extraction PPI must have
32 // the same interface structure, they do not all have
33 // te same GUID. The GUID that is associated with
34 // an instance of the GUIDed Section Extraction Protocol
35 // is used to correlate it with the GUIDed section type
36 // that it is intended to process.
37 //
38
39
40 typedef struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI;
41
42 //
43 // Bit values for AuthenticationStatus
44 //
45 #define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01
46 #define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02
47 #define EFI_AUTH_STATUS_NOT_TESTED 0x04
48 #define EFI_AUTH_STATUS_TEST_FAILED 0x08
49
50 /**
51 The ExtractSection() function processes the input section and
52 returns a pointer to the section contents. If the section being
53 extracted does not require processing (if the section
54 GuidedSectionHeader.Attributes has the
55 EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then
56 OutputBuffer is just updated to point to the start of the
57 section's contents. Otherwise, *Buffer must be allocated
58 from PEI permanent memory.
59
60 @param This Indicates the
61 EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI instance.
62 Buffer containing the input GUIDed section to be
63 processed. OutputBuffer OutputBuffer is
64 allocated from PEI permanent memory and contains
65 the new section stream.
66
67 @param OutputSize A pointer to a caller-allocated
68 UINTN in which the size of *OutputBuffer
69 allocation is stored. If the function
70 returns anything other than EFI_SUCCESS,
71 the value of OutputSize is undefined.
72
73 @param AuthenticationStatus A pointer to a caller-allocated
74 UINT32 that indicates the
75 authentication status of the
76 output buffer. If the input
77 section's GuidedSectionHeader.
78 Attributes field has the
79 EFI_GUIDED_SECTION_AUTH_STATUS_VALID
80 bit as clear,
81 AuthenticationStatus must return
82 zero. These bits reflect the
83 status of the extraction
84 operation. If the function
85 returns anything other than
86 EFI_SUCCESS, the value of
87 AuthenticationStatus is
88 undefined.
89
90 @retval EFI_SUCCESS The InputSection was
91 successfully processed and the
92 section contents were returned.
93
94 @retval EFI_OUT_OF_RESOURCES The system has insufficient
95 resources to process the request.
96
97 @reteval EFI_INVALID_PARAMETER The GUID in InputSection does
98 not match this instance of the
99 GUIDed Section Extraction PPI.
100 **/
101 typedef
102 EFI_STATUS
103 (EFIAPI *EFI_PEI_EXTRACT_GUIDED_SECTION)(
104 IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,
105 IN CONST VOID *InputSection,
106 OUT VOID **OutputBuffer,
107 OUT UINTN *OutputSize,
108 OUT UINT32 *AuthenticationStatus
109 );
110
111
112
113 /**
114 If a GUID-defined section is encountered when doing section extraction,
115 the PEI Foundation or the EFI_PEI_FILE_LOADER_PPI instance
116 calls the appropriate instance of the GUIDed Section
117 Extraction PPI to extract the section stream contained
118 therein.
119
120
121 @param ExtractSection Takes the GUIDed section as input and
122 produces the section stream data. See
123 the ExtractSection() function
124 description.
125
126 **/
127 struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI {
128 EFI_PEI_EXTRACT_GUIDED_SECTION ExtractSection;
129 };
130
131
132
133 #endif
134