]>
Commit | Line | Data |
---|---|---|
18fd8d65 | 1 | /** @file\r |
eceb3a4c LG |
2 | Extract Guided Section Library class defintions, \r |
3 | which can provide many handlers for the different guided section data.\r | |
18fd8d65 | 4 | \r |
eceb3a4c | 5 | Copyright (c) 2007 - 2008, Intel Corporation\r |
18fd8d65 LG |
6 | All rights reserved. This program and the accompanying materials \r |
7 | are licensed and made available under the terms and conditions of the BSD License \r | |
8 | which accompanies this distribution. The full text of the license may be found at \r | |
9 | http://opensource.org/licenses/bsd-license.php \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
13 | \r | |
18fd8d65 LG |
14 | **/\r |
15 | #ifndef __EXTRACT_GUIDED_SECTION_H__\r | |
16 | #define __EXTRACT_GUIDED_SECTION_H__\r | |
17 | \r | |
18 | /** | |
eceb3a4c | 19 | Get information for the input guided section data.\r |
18fd8d65 LG |
20 | It will ASSERT () if the pointer to OutputBufferSize is NULL.\r |
21 | It will ASSERT () if the pointer to ScratchBufferSize is NULL. | |
22 | It will ASSERT () if the pointer to SectionAttribute is NULL.\r | |
23 | \r | |
24 | @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r | |
25 | @param[out] OutputBufferSize The size of OutputBuffer.\r | |
26 | @param[out] ScratchBufferSize The size of ScratchBuffer.\r | |
27 | @param[out] SectionAttribute The attribute of the input guided section.\r | |
28 | ||
29 | @retval RETURN_SUCCESS Get the required information successfully.\r | |
eceb3a4c | 30 | @retval RETURN_INVALID_PARAMETER The input data is not the valid guided section.\r |
18fd8d65 LG |
31 | \r |
32 | **/\r | |
33 | typedef\r | |
34 | RETURN_STATUS\r | |
35 | (EFIAPI *EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)(\r | |
36 | IN CONST VOID *InputSection,\r | |
37 | OUT UINT32 *OutputBufferSize,\r | |
38 | OUT UINT32 *ScratchBufferSize,\r | |
39 | OUT UINT16 *SectionAttribute\r | |
40 | );\r | |
41 | \r | |
42 | /** | |
eceb3a4c | 43 | Extract data and Auth from the specific guided section. |
18fd8d65 LG |
44 | It will ASSERT () if the pointer to OutputBuffer is NULL.\r |
45 | It will ASSERT () if the pointer to AuthenticationStatus is NULL.\r | |
46 | \r | |
47 | @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r | |
eceb3a4c | 48 | @param[out] OutputBuffer OutputBuffer directly points to the start of the section's contents,\r |
18fd8d65 | 49 | if guided data is not prcessed. Otherwise,\r |
eceb3a4c | 50 | OutputBuffer contains the output data, which is allocated by the caller.\r |
18fd8d65 LG |
51 | @param[out] ScratchBuffer A pointer to a caller-allocated buffer for function internal use. \r |
52 | @param[out] AuthenticationStatus \r | |
53 | A pointer to a caller-allocated UINT32 that indicates the\r | |
54 | authentication status of the output buffer. | |
55 | ||
56 | @retval RETURN_SUCCESS Get the output data and AuthenticationStatus successfully.\r | |
eceb3a4c | 57 | @retval RETURN_INVALID_PARAMETER The input data is not the valid guided section.\r |
18fd8d65 LG |
58 | \r |
59 | **/\r | |
60 | typedef\r | |
61 | RETURN_STATUS\r | |
62 | (EFIAPI *EXTRACT_GUIDED_SECTION_DECODE_HANDLER)(\r | |
63 | IN CONST VOID *InputSection,\r | |
64 | OUT VOID **OutputBuffer,\r | |
65 | IN VOID *ScratchBuffer, OPTIONAL\r | |
66 | OUT UINT32 *AuthenticationStatus\r | |
67 | );\r | |
68 | \r | |
69 | /** | |
70 | Register Guided Section Extract and GetInfo Handler.\r | |
71 | \r | |
72 | @param[in] SectionGuid The guid matches this Extraction Handler. | |
eceb3a4c | 73 | @param[in] GetInfoHandler Handler to get information from guided section.\r |
18fd8d65 LG |
74 | @param[in] DecodeHandler Handler to extract guided section. |
75 | ||
76 | @retval RETURN_SUCCESS Register Guided Section Extract Handler successfully. | |
77 | @retval RETURN_OUT_OF_RESOURCES Resource is not enough to register new Handler. \r | |
eceb3a4c | 78 | @retval RETURN_INVALID_PARAMETER Pointer to Guid value is not valid.\r |
18fd8d65 LG |
79 | \r |
80 | **/\r | |
81 | RETURN_STATUS\r | |
82 | EFIAPI\r | |
83 | ExtractGuidedSectionRegisterHandlers (\r | |
84 | IN CONST GUID *SectionGuid,\r | |
85 | IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER GetInfoHandler,\r | |
86 | IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler\r | |
87 | );\r | |
88 | \r | |
89 | /** | |
0fa00159 | 90 | Get the supported exract guided section Handler guid table, which is maintained\r |
eceb3a4c | 91 | by library. The caller can directly get the guid table \r |
0fa00159 | 92 | without responsibility to allocate or free this table buffer. \r |
18fd8d65 LG |
93 | It will ASSERT () if ExtractHandlerGuidTable = NULL.\r |
94 | \r | |
eceb3a4c | 95 | @param[out] ExtractHandlerGuidTable The extract Handler guid pointer list. |
18fd8d65 | 96 | \r |
eceb3a4c | 97 | @return the number of the supported extract guided Handler. |
18fd8d65 LG |
98 | **/\r |
99 | UINTN\r | |
100 | EFIAPI\r | |
101 | ExtractGuidedSectionGetGuidList (\r | |
eceb3a4c | 102 | OUT GUID **ExtractHandlerGuidTable\r |
18fd8d65 LG |
103 | );\r |
104 | \r | |
105 | /** | |
106 | Get information from the guided section. This function first gets the guid value\r | |
107 | from guided section header, then match this guid in the registered extract Handler list\r | |
108 | to its corresponding getinfo Handler. \r | |
109 | If not found, RETURN_UNSUPPORTED will be return. \r | |
110 | If found, it will call the getinfo Handler to get the required size and attribute.\r | |
111 | \r | |
112 | It will ASSERT () if the pointer to OutputBufferSize is NULL.\r | |
113 | It will ASSERT () if the pointer to ScratchBufferSize is NULL. | |
114 | It will ASSERT () if the pointer to SectionAttribute is NULL.\r | |
115 | \r | |
116 | @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r | |
117 | @param[out] OutputBufferSize The size of OutputBuffer.\r | |
118 | @param[out] ScratchBufferSize The size of ScratchBuffer. \r | |
119 | @param[out] SectionAttribute The attribute of the input guided section.\r | |
120 | ||
121 | @retval RETURN_SUCCESS Get the required information successfully.\r | |
122 | @retval RETURN_UNSUPPORTED Guided section data is not supported.\r | |
eceb3a4c | 123 | @retval RETURN_INVALID_PARAMETER The input data is not the valid guided section.\r |
18fd8d65 LG |
124 | \r |
125 | **/\r | |
126 | RETURN_STATUS\r | |
127 | EFIAPI\r | |
128 | ExtractGuidedSectionGetInfo (\r | |
129 | IN CONST VOID *InputSection,\r | |
130 | OUT UINT32 *OutputBufferSize,\r | |
131 | OUT UINT32 *ScratchBufferSize,\r | |
132 | OUT UINT16 *SectionAttribute \r | |
133 | );\r | |
134 | \r | |
135 | /** | |
136 | Extract data from the guided section. This function first gets the guid value\r | |
137 | from guided section header, then match this guid in the registered extract Handler list\r | |
138 | to its corresponding extract Handler. \r | |
139 | If not found, RETURN_UNSUPPORTED will be return. \r | |
140 | If found, it will call this extract Handler to get output data and AuthenticationStatus. | |
141 | \r | |
142 | It will ASSERT () if the pointer to OutputBuffer is NULL.\r | |
143 | It will ASSERT () if the pointer to AuthenticationStatus is NULL.\r | |
144 | \r | |
145 | @param[in] InputSection Buffer containing the input GUIDed section to be processed. \r | |
146 | @param[out] OutputBuffer OutputBuffer to point the start of the section's contents \r | |
147 | if guided data is not required prcessing. Otherwise,\r | |
148 | OutputBuffer to contain the output data, which is \r | |
149 | allocated by the caller.\r | |
150 | @param[out] ScratchBuffer A pointer to a caller-allocated buffer for function internal use. \r | |
151 | @param[out] AuthenticationStatus \r | |
152 | A pointer to a caller-allocated UINT32 that indicates the\r | |
153 | authentication status of the output buffer. | |
154 | ||
d173d9c7 | 155 | @retval RETURN_SUCCESS Get the output data and AuthenticationStatus successfully.\r |
18fd8d65 | 156 | @retval RETURN_UNSUPPORTED Guided section data is not supported to be decoded.\r |
eceb3a4c | 157 | @retval RETURN_INVALID_PARAMETER The input data is not the valid guided section. |
18fd8d65 LG |
158 | **/\r |
159 | RETURN_STATUS\r | |
160 | EFIAPI\r | |
161 | ExtractGuidedSectionDecode (\r | |
162 | IN CONST VOID *InputSection,\r | |
163 | OUT VOID **OutputBuffer,\r | |
164 | OUT VOID *ScratchBuffer, OPTIONAL\r | |
165 | OUT UINT32 *AuthenticationStatus \r | |
166 | );\r | |
167 | \r | |
168 | #endif\r |