]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiHobLib.h
09aae87117314858544b2ae695f90b8528bf8537
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / Include / EfiHobLib.h
1 /*++
2
3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 EfiHobLib.h
15
16 Abstract:
17
18
19 --*/
20
21 #ifndef _EFI_HOB_LIB_H_
22 #define _EFI_HOB_LIB_H_
23
24 #include "PeiHob.h"
25
26 VOID *
27 GetHob (
28 IN UINT16 Type,
29 IN VOID *HobStart
30 )
31 /*++
32
33 Routine Description:
34
35 This function returns the first instance of a HOB type in a HOB list.
36
37 Arguments:
38
39 Type The HOB type to return.
40 HobStart The first HOB in the HOB list.
41
42 Returns:
43
44 HobStart There were no HOBs found with the requested type.
45 else Returns the first HOB with the matching type.
46
47 --*/
48 ;
49
50 UINTN
51 GetHobListSize (
52 IN VOID *HobStart
53 )
54 /*++
55
56 Routine Description:
57
58 Get size of hob list.
59
60 Arguments:
61
62 HobStart - Start pointer of hob list
63
64 Returns:
65
66 Size of hob list.
67
68 --*/
69 ;
70
71 UINT32
72 GetHobVersion (
73 IN VOID *HobStart
74 )
75 /*++
76
77 Routine Description:
78
79 Get hob version.
80
81 Arguments:
82
83 HobStart - Start pointer of hob list
84
85 Returns:
86
87 Hob version.
88
89 --*/
90 ;
91
92 EFI_STATUS
93 GetHobBootMode (
94 IN VOID *HobStart,
95 OUT EFI_BOOT_MODE *BootMode
96 )
97 /*++
98
99 Routine Description:
100
101 Get current boot mode.
102
103 Arguments:
104
105 HobStart - Start pointer of hob list
106
107 BootMode - Current boot mode recorded in PHIT hob
108
109 Returns:
110
111 EFI_NOT_FOUND - Invalid hob header
112
113 EFI_SUCCESS - Boot mode found
114
115 --*/
116 ;
117
118 EFI_STATUS
119 GetCpuHobInfo (
120 IN VOID *HobStart,
121 OUT UINT8 *SizeOfMemorySpace,
122 OUT UINT8 *SizeOfIoSpace
123 )
124 /*++
125
126 Routine Description:
127
128 Get information recorded in CPU hob (Memory space size, Io space size)
129
130 Arguments:
131
132 HobStart - Start pointer of hob list
133
134 SizeOfMemorySpace - Size of memory size
135
136 SizeOfIoSpace - Size of IO size
137
138 Returns:
139
140 EFI_NOT_FOUND - CPU hob not found
141
142 EFI_SUCCESS - CPU hob found and information got.
143
144 --*/
145 ;
146
147 EFI_STATUS
148 GetDxeCoreHobInfo (
149 IN VOID *HobStart,
150 OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
151 OUT UINT64 *Length,
152 OUT VOID **EntryPoint,
153 OUT EFI_GUID **FileName
154 )
155 /*++
156
157 Routine Description:
158
159 Get memory allocation hob created for DXE core and extract its information
160
161 Arguments:
162
163 HobStart - Start pointer of the hob list
164
165 BaseAddress - Start address of memory allocated for DXE core
166
167 Length - Length of memory allocated for DXE core
168
169 EntryPoint - DXE core file name
170
171 FileName - FileName
172
173 Returns:
174
175 EFI_NOT_FOUND - DxeCoreHob not found
176
177 EFI_SUCCESS - DxeCoreHob found and information got
178
179 --*/
180 ;
181
182 EFI_STATUS
183 GetNextFirmwareVolumeHob (
184 IN OUT VOID **HobStart,
185 OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
186 OUT UINT64 *Length
187 )
188 /*++
189
190 Routine Description:
191
192 Get next firmware volume hob from HobStart
193
194 Arguments:
195
196 HobStart - Start pointer of hob list
197
198 BaseAddress - Start address of next firmware volume
199
200 Length - Length of next firmware volume
201
202 Returns:
203
204 EFI_NOT_FOUND - Next firmware volume not found
205
206 EFI_SUCCESS - Next firmware volume found with address information
207
208 --*/
209 ;
210
211 #if (PI_SPECIFICATION_VERSION >= 0x00010000)
212 EFI_STATUS
213 GetNextFirmwareVolume2Hob (
214 IN OUT VOID **HobStart,
215 OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
216 OUT UINT64 *Length,
217 OUT EFI_GUID *FileName
218 );
219 #endif
220
221 EFI_STATUS
222 GetNextGuidHob (
223 IN OUT VOID **HobStart,
224 IN EFI_GUID * Guid,
225 OUT VOID **Buffer,
226 OUT UINTN *BufferSize OPTIONAL
227 )
228 /*++
229
230 Routine Description:
231 Get the next guid hob.
232
233 Arguments:
234 HobStart A pointer to the start hob.
235 Guid A pointer to a guid.
236 Buffer A pointer to the buffer.
237 BufferSize Buffer size.
238
239 Returns:
240 Status code.
241
242 EFI_NOT_FOUND - Next Guid hob not found
243
244 EFI_SUCCESS - Next Guid hob found and data for this Guid got
245
246 --*/
247 ;
248
249 EFI_STATUS
250 GetPalEntryHobInfo (
251 IN VOID *HobStart,
252 OUT EFI_PHYSICAL_ADDRESS *PalEntry
253 )
254 /*++
255
256 Routine Description:
257
258 Get PAL entry from PalEntryHob
259
260 Arguments:
261
262 HobStart - Start pointer of hob list
263
264 PalEntry - Pointer to PAL entry
265
266 Returns:
267
268 Status code.
269
270 --*/
271 ;
272
273 EFI_STATUS
274 GetIoPortSpaceAddressHobInfo (
275 IN VOID *HobStart,
276 OUT EFI_PHYSICAL_ADDRESS *IoPortSpaceAddress
277 )
278 /*++
279
280 Routine Description:
281
282 Get IO port space address from IoBaseHob.
283
284 Arguments:
285
286 HobStart - Start pointer of hob list
287
288 IoPortSpaceAddress - IO port space address
289
290 Returns:
291
292 Status code
293
294 --*/
295 ;
296
297 #endif