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