]>
Commit | Line | Data |
---|---|---|
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 | |
2bbaeb0d | 7 | Copyright (c) 2006 - 2009, Intel Corporation\r |
c741cc2b | 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 | |
79964ac8 | 17 | @par Revision Reference:\r |
18 | This protocol is defined in Firmware Volume Specification.\r | |
19 | Version 0.9\r | |
20 | \r | |
21 | **/\r | |
22 | \r | |
23 | #ifndef _SECTION_EXTRACTION_PROTOCOL_H_\r | |
24 | #define _SECTION_EXTRACTION_PROTOCOL_H_\r | |
25 | \r | |
79964ac8 | 26 | //\r |
27 | // Protocol GUID definition\r | |
28 | //\r | |
29 | #define EFI_SECTION_EXTRACTION_PROTOCOL_GUID \\r | |
30 | { \\r | |
31 | 0x448F5DA4, 0x6DD7, 0x4FE1, {0x93, 0x07, 0x69, 0x22, 0x41, 0x92, 0x21, 0x5D } \\r | |
32 | }\r | |
33 | \r | |
34 | typedef struct _EFI_SECTION_EXTRACTION_PROTOCOL EFI_SECTION_EXTRACTION_PROTOCOL;\r | |
35 | \r | |
36 | //\r | |
37 | // Protocol member functions\r | |
38 | //\r | |
39 | /**\r | |
40 | Creates and returns a new section stream handle to represent the new section stream.\r | |
41 | \r | |
42 | @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r | |
43 | @param SectionStreamLength Size in bytes of the section stream.\r | |
44 | @param SectionStream Buffer containing the new section stream.\r | |
45 | @param SectionStreamHandle A pointer to a caller-allocated UINTN that,\r | |
46 | on output, contains the new section stream handle.\r | |
47 | \r | |
48 | @retval EFI_SUCCESS The SectionStream was successfully processed and\r | |
49 | the section stream handle was returned.\r | |
50 | @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to\r | |
51 | process the request.\r | |
52 | @retval EFI_INVALID_PARAMETER The section stream may be corrupt or the value\r | |
53 | of SectionStreamLength may be incorrect.\r | |
54 | \r | |
55 | **/\r | |
56 | typedef\r | |
57 | EFI_STATUS\r | |
69686d56 | 58 | (EFIAPI *EFI_OPEN_SECTION_STREAM)(\r |
79964ac8 | 59 | IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r |
60 | IN UINTN SectionStreamLength,\r | |
61 | IN VOID *SectionStream,\r | |
62 | OUT UINTN *SectionStreamHandle\r | |
63 | );\r | |
64 | \r | |
65 | /**\r | |
66 | Reads and returns a single section from a section stream.\r | |
67 | \r | |
68 | @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r | |
69 | @param SectionStreamHandle Indicates from which section stream to read.\r | |
5259c97d | 70 | @param SectionType Pointer to an EFI_SECTION_TYPE. If SectionType == NULL, the contents of the \r |
71 | entire section stream are returned in Buffer. If SectionType is not NULL, \r | |
72 | only the requested section is returned. EFI_SECTION_ALL matches all section \r | |
b4124f44 | 73 | types and can be used as a wild card to extract all sections in order.\r |
5259c97d | 74 | @param SectionDefinitionGuid Pointer to an EFI_GUID. If SectionType ==\r |
79964ac8 | 75 | EFI_SECTION_GUID_DEFINED, SectionDefinitionGuid indicates what section GUID\r |
5259c97d | 76 | to search for. If SectionType !=EFI_SECTION_GUID_DEFINED, then\r |
79964ac8 | 77 | SectionDefinitionGuid is unused and is ignored.\r |
78 | @param SectionInstance Indicates which instance of the requested section\r | |
79 | type to return when SectionType is not NULL.\r | |
80 | @param SectionStreamHandle A pointer to a caller-allocated UINTN that, on output,\r | |
81 | contains the new section stream handle.\r | |
82 | @param Buffer Pointer to a pointer to a buffer in which the section\r | |
83 | contents are returned.\r | |
84 | @param BufferSize Pointer to a caller-allocated UINTN.\r | |
85 | @param AuthenticationStatus Pointer to a caller-allocated UINT32 in\r | |
86 | which any meta-data from encapsulation GUID-defined sections is returned.\r | |
87 | \r | |
88 | @retval EFI_SUCCESS The SectionStream was successfully processed and\r | |
89 | the section contents were returned in Buffer.\r | |
90 | @retval EFI_PROTOCOL_ERROR A GUID-defined section was encountered in\r | |
91 | the section stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,\r | |
92 | but there was no corresponding GUIDed Section Extraction Protocol in\r | |
93 | the handle database.\r | |
94 | @retval EFI_NOT_FOUND An error was encountered when parsing the SectionStream,\r | |
95 | which indicates that the SectionStream is not correctly formatted.\r | |
96 | Or The requested section does not exist.\r | |
97 | @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process\r | |
98 | the request.\r | |
99 | @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r | |
920d2c23 LG |
100 | @retval EFI_WARN_BUFFER_TOO_SMALL The size of the input buffer is insufficient to contain the requested\r |
101 | section. The input buffer is filled and section contents are truncated.\r | |
79964ac8 | 102 | \r |
103 | **/\r | |
104 | typedef\r | |
105 | EFI_STATUS\r | |
69686d56 | 106 | (EFIAPI *EFI_GET_SECTION)(\r |
79964ac8 | 107 | IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r |
108 | IN UINTN SectionStreamHandle,\r | |
109 | IN EFI_SECTION_TYPE *SectionType,\r | |
110 | IN EFI_GUID *SectionDefinitionGuid,\r | |
111 | IN UINTN SectionInstance,\r | |
112 | IN VOID **Buffer,\r | |
113 | IN OUT UINTN *BufferSize,\r | |
114 | OUT UINT32 *AuthenticationStatus\r | |
115 | );\r | |
116 | \r | |
117 | /**\r | |
118 | Deletes a section stream handle and returns all associated resources to the system.\r | |
119 | \r | |
120 | @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r | |
121 | @param SectionStreamHandle Indicates the section stream to close.\r | |
122 | @retval EFI_SUCCESS The SectionStream was successfully processed and\r | |
123 | the section stream handle was returned.\r | |
124 | @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r | |
125 | \r | |
126 | **/\r | |
127 | typedef\r | |
128 | EFI_STATUS\r | |
69686d56 | 129 | (EFIAPI *EFI_CLOSE_SECTION_STREAM)(\r |
79964ac8 | 130 | IN EFI_SECTION_EXTRACTION_PROTOCOL *This,\r |
131 | IN UINTN SectionStreamHandle\r | |
132 | );\r | |
133 | \r | |
134 | //\r | |
135 | // Protocol definition\r | |
136 | //\r | |
79964ac8 | 137 | struct _EFI_SECTION_EXTRACTION_PROTOCOL {\r |
2bbaeb0d | 138 | ///\r |
139 | /// Takes a bounded stream of sections and returns a section stream handle.\r | |
140 | ///\r | |
79964ac8 | 141 | EFI_OPEN_SECTION_STREAM OpenSectionStream;\r |
2bbaeb0d | 142 | \r |
143 | ///\r | |
144 | /// Given a section stream handle, retrieves the requested section and\r | |
145 | /// meta-data from the section stream.\r | |
146 | ///\r | |
79964ac8 | 147 | EFI_GET_SECTION GetSection;\r |
2bbaeb0d | 148 | \r |
149 | ///\r | |
150 | /// Given a section stream handle, closes the section stream.\r | |
151 | ///\r | |
79964ac8 | 152 | EFI_CLOSE_SECTION_STREAM CloseSectionStream;\r |
153 | };\r | |
154 | \r | |
155 | extern EFI_GUID gEfiSectionExtractionProtocolGuid;\r | |
156 | \r | |
157 | #endif\r |