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