]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SectionExtraction.h
Updated IntelFrameworkPkg.nspd to add GUID/PPI/Protocol definitions.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SectionExtraction.h
CommitLineData
79964ac8 1/** @file\r
2 This file declares Section Extraction protocols.\r
3\r
4 This interface provides a means of decoding a set of sections into a linked list of\r
5 leaf sections. This provides for an extensible and flexible file format.\r
6\r
7 Copyright (c) 2007, Intel Corporation\r
8 All rights reserved. This program and the materials\r
9 are licensed and made available under the terms and conditions of the BSD License\r
10 which accompanies this distribution. The full text of the license may be found at\r
11 http://opensource.org/licenses/bsd-license.php\r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16 Module Name: SectionExtraction.h\r
17\r
18 @par Revision Reference:\r
19 This protocol is defined in Firmware Volume Specification.\r
20 Version 0.9\r
21\r
22**/\r
23\r
24#ifndef _SECTION_EXTRACTION_PROTOCOL_H_\r
25#define _SECTION_EXTRACTION_PROTOCOL_H_\r
26\r
27\r
28//\r
29// Protocol GUID definition\r
30//\r
31#define EFI_SECTION_EXTRACTION_PROTOCOL_GUID \\r
32 { \\r
33 0x448F5DA4, 0x6DD7, 0x4FE1, {0x93, 0x07, 0x69, 0x22, 0x41, 0x92, 0x21, 0x5D } \\r
34 }\r
35\r
36typedef struct _EFI_SECTION_EXTRACTION_PROTOCOL EFI_SECTION_EXTRACTION_PROTOCOL;\r
37\r
38//\r
39// Protocol member functions\r
40//\r
41/**\r
42 Creates and returns a new section stream handle to represent the new section stream.\r
43\r
44 @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
45 @param SectionStreamLength Size in bytes of the section stream.\r
46 @param SectionStream Buffer containing the new section stream.\r
47 @param SectionStreamHandle A pointer to a caller-allocated UINTN that,\r
48 on output, contains the new section stream handle.\r
49\r
50 @retval EFI_SUCCESS The SectionStream was successfully processed and\r
51 the section stream handle was returned.\r
52 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to\r
53 process the request.\r
54 @retval EFI_INVALID_PARAMETER The section stream may be corrupt or the value\r
55 of SectionStreamLength may be incorrect.\r
56\r
57**/\r
58typedef\r
59EFI_STATUS\r
60(EFIAPI *EFI_OPEN_SECTION_STREAM) (\r
61 IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r
62 IN UINTN SectionStreamLength,\r
63 IN VOID *SectionStream,\r
64 OUT UINTN *SectionStreamHandle\r
65 );\r
66\r
67/**\r
68 Reads and returns a single section from a section stream.\r
69\r
70 @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
71 @param SectionStreamHandle Indicates from which section stream to read.\r
72 @param SectionType Pointer to an EFI_SECTION_TYPE.\r
73 @param SectionDefinitionGuid Pointer to an EFI_GUID.If SectionType ==\r
74 EFI_SECTION_GUID_DEFINED, SectionDefinitionGuid indicates what section GUID\r
75 to search for.If SectionType !=EFI_SECTION_GUID_DEFINED, then\r
76 SectionDefinitionGuid is unused and is ignored.\r
77 @param SectionInstance Indicates which instance of the requested section\r
78 type to return when SectionType is not NULL.\r
79 @param SectionStreamHandle A pointer to a caller-allocated UINTN that, on output,\r
80 contains the new section stream handle.\r
81 @param Buffer Pointer to a pointer to a buffer in which the section\r
82 contents are returned.\r
83 @param BufferSize Pointer to a caller-allocated UINTN.\r
84 @param AuthenticationStatus Pointer to a caller-allocated UINT32 in\r
85 which any meta-data from encapsulation GUID-defined sections is returned.\r
86\r
87 @retval EFI_SUCCESS The SectionStream was successfully processed and\r
88 the section contents were returned in Buffer.\r
89 @retval EFI_PROTOCOL_ERROR A GUID-defined section was encountered in\r
90 the section stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,\r
91 but there was no corresponding GUIDed Section Extraction Protocol in\r
92 the handle database.\r
93 @retval EFI_NOT_FOUND An error was encountered when parsing the SectionStream,\r
94 which indicates that the SectionStream is not correctly formatted.\r
95 Or The requested section does not exist.\r
96 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process\r
97 the request.\r
98 @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
99 @retval EFI_BUFFER_TOO_SMALL The size of the input buffer is insufficient to\r
100 contain the requested section.\r
101\r
102**/\r
103typedef\r
104EFI_STATUS\r
105(EFIAPI *EFI_GET_SECTION) (\r
106 IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r
107 IN UINTN SectionStreamHandle,\r
108 IN EFI_SECTION_TYPE *SectionType,\r
109 IN EFI_GUID *SectionDefinitionGuid,\r
110 IN UINTN SectionInstance,\r
111 IN VOID **Buffer,\r
112 IN OUT UINTN *BufferSize,\r
113 OUT UINT32 *AuthenticationStatus\r
114 );\r
115\r
116/**\r
117 Deletes a section stream handle and returns all associated resources to the system.\r
118\r
119 @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
120 @param SectionStreamHandle Indicates the section stream to close.\r
121 @retval EFI_SUCCESS The SectionStream was successfully processed and\r
122 the section stream handle was returned.\r
123 @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
124\r
125**/\r
126typedef\r
127EFI_STATUS\r
128(EFIAPI *EFI_CLOSE_SECTION_STREAM) (\r
129 IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r
130 IN UINTN SectionStreamHandle\r
131 );\r
132\r
133//\r
134// Protocol definition\r
135//\r
136/**\r
137 @par Protocol Description:\r
138 The Section Extraction Protocol provides a simple method of extracting\r
139 sections from arbitrarily complex files.\r
140\r
141 @param OpenSectionStream\r
142 Takes a bounded stream of sections and returns a section stream handle.\r
143\r
144 @param GetSection\r
145 Given a section stream handle, retrieves the requested section and\r
146 meta-data from the section stream.\r
147\r
148 @param CloseSectionStream\r
149 Given a section stream handle, closes the section stream.\r
150\r
151**/\r
152struct _EFI_SECTION_EXTRACTION_PROTOCOL {\r
153 EFI_OPEN_SECTION_STREAM OpenSectionStream;\r
154 EFI_GET_SECTION GetSection;\r
155 EFI_CLOSE_SECTION_STREAM CloseSectionStream;\r
156};\r
157\r
158extern EFI_GUID gEfiSectionExtractionProtocolGuid;\r
159\r
160#endif\r