• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 - 2008, Intel Corporation. All rights reserved.<BR>
8   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   @par Revision Reference:
17   This PPI is introduced in PI Version 1.0.
18 
19 **/
20 
21 #ifndef __EFI_GUIDED_SECTION_EXTRACTION_PPI_H__
22 #define __EFI_GUIDED_SECTION_EXTRACTION_PPI_H__
23 
24 //
25 // Typically, protocol interface structures are identified
26 // by associating them with a GUID. Each instance of
27 // a protocol with a given GUID must have
28 // the same interface structure. While all instances of
29 // the GUIDed Section Extraction PPI must have
30 // the same interface structure, they do not all have
31 // te same GUID. The GUID that is associated with
32 // an instance of the GUIDed Section Extraction Protocol
33 // is used to correlate it with the GUIDed section type
34 // that it is intended to process.
35 //
36 
37 
38 typedef struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI   EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI;
39 
40 
41 /**
42   Processes the input section and returns the data contained therein
43   along with the authentication status.
44 
45   The ExtractSection() function processes the input section and
46   returns a pointer to the section contents. If the section being
47   extracted does not require processing (if the section
48   GuidedSectionHeader.Attributes has the
49   EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then
50   OutputBuffer is just updated to point to the start of the
51   section's contents. Otherwise, *Buffer must be allocated
52   from PEI permanent memory.
53 
54   @param This                   Indicates the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
55                                 instance.
56   @param InputSection           Buffer containing the input GUIDed section to be
57                                 processed.
58   @param OutputBuffer           *OutputBuffer is allocated from PEI permanent memory
59                                 and contains the new section stream.
60   @param OutputSize             A pointer to a caller-allocated UINTN in which
61                                 the size of *OutputBuffer allocation is stored.
62                                 If the function returns anything other than
63                                 EFI_SUCCESS, the value of *OutputSize is undefined.
64   @param AuthenticationStatus   A pointer to a caller-allocated UINT32 that indicates
65                                 the authentication status of the output buffer.
66                                 If the input section's
67                                 GuidedSectionHeader.Attributes field has the
68                                 EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit as clear,
69                                 *AuthenticationStatus must return zero. These bits
70                                 reflect the status of the extraction operation.
71                                 If the function returns anything other than EFI_SUCCESS,
72                                 the value of *AuthenticationStatus is undefined.
73 
74   @retval EFI_SUCCESS           The InputSection was successfully processed and the
75                                 section contents were returned.
76   @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to process the request.
77   @retval EFI_INVALID_PARAMETER The GUID in InputSection does not match this instance of the
78                                 GUIDed Section Extraction PPI.
79 **/
80 typedef
81 EFI_STATUS
82 (EFIAPI *EFI_PEI_EXTRACT_GUIDED_SECTION)(
83   IN  CONST  EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,
84   IN  CONST  VOID                                  *InputSection,
85   OUT VOID                                         **OutputBuffer,
86   OUT UINTN                                        *OutputSize,
87   OUT UINT32                                       *AuthenticationStatus
88 );
89 
90 ///
91 /// If a GUID-defined section is encountered when doing section extraction,
92 /// the PEI Foundation or the EFI_PEI_FILE_LOADER_PPI instance
93 /// calls the appropriate instance of the GUIDed Section
94 /// Extraction PPI to extract the section stream contained
95 /// therein.
96 ///
97 struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI {
98   EFI_PEI_EXTRACT_GUIDED_SECTION ExtractSection;
99 };
100 
101 
102 
103 #endif
104 
105