]>
Commit | Line | Data |
---|---|---|
fb3df220 | 1 | /** @file\r |
50a64e5b | 2 | Provides services to create and parse HOBs. Only available for PEI\r |
3 | and DXE module types.\r | |
fb3df220 | 4 | \r |
f9eb929d | 5 | The HOB Library supports the efficient creation and searching of HOBs\r |
6 | defined in the PI Specification. \r | |
7 | A HOB is a Hand-Off Block, defined in the Framework architecture, that \r | |
8 | allows the PEI phase to pass information to the DXE phase. HOBs are position \r | |
9 | independent and can be relocated easily to different memory memory locations.\r | |
10 | \r | |
3e5c3238 | 11 | Copyright (c) 2006 - 2008, Intel Corporation<BR>\r |
50a64e5b | 12 | All rights reserved. This program and the accompanying materials\r |
13 | are licensed and made available under the terms and conditions of the BSD License\r | |
14 | which accompanies this distribution. The full text of the license may be found at\r | |
15 | http://opensource.org/licenses/bsd-license.php\r | |
fb3df220 | 16 | \r |
50a64e5b | 17 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
18 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
fb3df220 | 19 | \r |
fb3df220 | 20 | **/\r |
21 | \r | |
22 | #ifndef __HOB_LIB_H__\r | |
23 | #define __HOB_LIB_H__\r | |
24 | \r | |
25 | /**\r | |
26 | Returns the pointer to the HOB list.\r | |
27 | \r | |
28 | This function returns the pointer to first HOB in the list.\r | |
f9eb929d | 29 | For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer \r |
30 | to the HOB list. For the DXE phase, the HOB list pointer can be retrieved through\r | |
31 | the EFI System Table by looking up theHOB list GUID in the System Configuration Table.\r | |
32 | Since the System Configuration Table does not exist that the time the DXE Core is \r | |
33 | launched, the DXE Core uses a global variable from the DXE Core Entry Point Library \r | |
34 | to manage the pointer to the HOB list.\r | |
35 | \r | |
36 | If the pointer to the HOB list is NULL, then ASSERT().\r | |
3ecdcd11 | 37 | \r |
fb3df220 | 38 | @return The pointer to the HOB list.\r |
39 | \r | |
40 | **/\r | |
41 | VOID *\r | |
42 | EFIAPI\r | |
43 | GetHobList (\r | |
44 | VOID\r | |
ed66e1bc | 45 | );\r |
fb3df220 | 46 | \r |
47 | /**\r | |
48 | Returns the next instance of a HOB type from the starting HOB.\r | |
49 | \r | |
50 | This function searches the first instance of a HOB type from the starting HOB pointer. \r | |
51 | If there does not exist such HOB type from the starting HOB pointer, it will return NULL.\r | |
52 | In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r | |
53 | unconditionally: it returns HobStart back if HobStart itself meets the requirement;\r | |
54 | caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.\r | |
f9eb929d | 55 | \r |
fb3df220 | 56 | If HobStart is NULL, then ASSERT().\r |
57 | \r | |
58 | @param Type The HOB type to return.\r | |
59 | @param HobStart The starting HOB pointer to search from.\r | |
60 | \r | |
61 | @return The next instance of a HOB type from the starting HOB.\r | |
62 | \r | |
63 | **/\r | |
64 | VOID *\r | |
65 | EFIAPI\r | |
66 | GetNextHob (\r | |
67 | IN UINT16 Type,\r | |
68 | IN CONST VOID *HobStart\r | |
ed66e1bc | 69 | );\r |
fb3df220 | 70 | \r |
71 | /**\r | |
72 | Returns the first instance of a HOB type among the whole HOB list.\r | |
73 | \r | |
74 | This function searches the first instance of a HOB type among the whole HOB list. \r | |
75 | If there does not exist such HOB type in the HOB list, it will return NULL. \r | |
f9eb929d | 76 | \r |
77 | If the pointer to the HOB list is NULL, then ASSERT().\r | |
fb3df220 | 78 | \r |
79 | @param Type The HOB type to return.\r | |
80 | \r | |
81 | @return The next instance of a HOB type from the starting HOB.\r | |
82 | \r | |
83 | **/\r | |
84 | VOID *\r | |
85 | EFIAPI\r | |
86 | GetFirstHob (\r | |
87 | IN UINT16 Type\r | |
ed66e1bc | 88 | );\r |
fb3df220 | 89 | \r |
90 | /**\r | |
f9eb929d | 91 | Returns the next instance of the matched GUID HOB from the starting HOB.\r |
92 | \r | |
fb3df220 | 93 | This function searches the first instance of a HOB from the starting HOB pointer. \r |
94 | Such HOB should satisfy two conditions: \r | |
95 | its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. \r | |
96 | If there does not exist such HOB from the starting HOB pointer, it will return NULL. \r | |
97 | Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()\r | |
98 | to extract the data section and its size info respectively.\r | |
99 | In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r | |
100 | unconditionally: it returns HobStart back if HobStart itself meets the requirement;\r | |
101 | caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.\r | |
f9eb929d | 102 | \r |
fb3df220 | 103 | If Guid is NULL, then ASSERT().\r |
104 | If HobStart is NULL, then ASSERT().\r | |
105 | \r | |
106 | @param Guid The GUID to match with in the HOB list.\r | |
107 | @param HobStart A pointer to a Guid.\r | |
108 | \r | |
109 | @return The next instance of the matched GUID HOB from the starting HOB.\r | |
110 | \r | |
111 | **/\r | |
112 | VOID *\r | |
113 | EFIAPI\r | |
114 | GetNextGuidHob (\r | |
115 | IN CONST EFI_GUID *Guid,\r | |
116 | IN CONST VOID *HobStart\r | |
ed66e1bc | 117 | );\r |
fb3df220 | 118 | \r |
119 | /**\r | |
f9eb929d | 120 | Returns the first instance of the matched GUID HOB among the whole HOB list.\r |
121 | \r | |
fb3df220 | 122 | This function searches the first instance of a HOB among the whole HOB list. \r |
123 | Such HOB should satisfy two conditions:\r | |
124 | its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.\r | |
125 | If there does not exist such HOB from the starting HOB pointer, it will return NULL.\r | |
126 | Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()\r | |
127 | to extract the data section and its size info respectively.\r | |
f9eb929d | 128 | \r |
129 | If the pointer to the HOB list is NULL, then ASSERT().\r | |
fb3df220 | 130 | If Guid is NULL, then ASSERT().\r |
131 | \r | |
132 | @param Guid The GUID to match with in the HOB list.\r | |
133 | \r | |
134 | @return The first instance of the matched GUID HOB among the whole HOB list.\r | |
135 | \r | |
136 | **/\r | |
137 | VOID *\r | |
138 | EFIAPI\r | |
139 | GetFirstGuidHob (\r | |
140 | IN CONST EFI_GUID *Guid\r | |
ed66e1bc | 141 | );\r |
fb3df220 | 142 | \r |
143 | /**\r | |
f9eb929d | 144 | Get the system boot mode from the HOB list.\r |
fb3df220 | 145 | \r |
146 | This function returns the system boot mode information from the \r | |
147 | PHIT HOB in HOB list.\r | |
148 | \r | |
f9eb929d | 149 | If the pointer to the HOB list is NULL, then ASSERT().\r |
150 | \r | |
fb3df220 | 151 | @param VOID\r |
152 | \r | |
153 | @return The Boot Mode.\r | |
154 | \r | |
155 | **/\r | |
156 | EFI_BOOT_MODE\r | |
157 | EFIAPI\r | |
158 | GetBootModeHob (\r | |
159 | VOID\r | |
ed66e1bc | 160 | );\r |
fb3df220 | 161 | \r |
162 | /**\r | |
163 | Builds a HOB for a loaded PE32 module.\r | |
164 | \r | |
165 | This function builds a HOB for a loaded PE32 module.\r | |
166 | It can only be invoked during PEI phase;\r | |
167 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 168 | \r |
fb3df220 | 169 | If ModuleName is NULL, then ASSERT().\r |
170 | If there is no additional space for HOB creation, then ASSERT().\r | |
171 | \r | |
172 | @param ModuleName The GUID File Name of the module.\r | |
173 | @param MemoryAllocationModule The 64 bit physical address of the module.\r | |
174 | @param ModuleLength The length of the module in bytes.\r | |
175 | @param EntryPoint The 64 bit physical address of the module entry point.\r | |
176 | \r | |
177 | **/\r | |
178 | VOID\r | |
179 | EFIAPI\r | |
180 | BuildModuleHob (\r | |
181 | IN CONST EFI_GUID *ModuleName,\r | |
182 | IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,\r | |
183 | IN UINT64 ModuleLength,\r | |
184 | IN EFI_PHYSICAL_ADDRESS EntryPoint\r | |
ed66e1bc | 185 | );\r |
fb3df220 | 186 | \r |
187 | /**\r | |
188 | Builds a HOB that describes a chunk of system memory.\r | |
189 | \r | |
190 | This function builds a HOB that describes a chunk of system memory.\r | |
191 | It can only be invoked during PEI phase;\r | |
192 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 193 | \r |
fb3df220 | 194 | If there is no additional space for HOB creation, then ASSERT().\r |
195 | \r | |
196 | @param ResourceType The type of resource described by this HOB.\r | |
197 | @param ResourceAttribute The resource attributes of the memory described by this HOB.\r | |
198 | @param PhysicalStart The 64 bit physical address of memory described by this HOB.\r | |
199 | @param NumberOfBytes The length of the memory described by this HOB in bytes.\r | |
200 | \r | |
201 | **/\r | |
202 | VOID\r | |
203 | EFIAPI\r | |
204 | BuildResourceDescriptorHob (\r | |
205 | IN EFI_RESOURCE_TYPE ResourceType,\r | |
206 | IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,\r | |
207 | IN EFI_PHYSICAL_ADDRESS PhysicalStart,\r | |
208 | IN UINT64 NumberOfBytes\r | |
ed66e1bc | 209 | );\r |
fb3df220 | 210 | \r |
211 | /**\r | |
f9eb929d | 212 | Builds a customized HOB tagged with a GUID for identification and returns \r |
213 | the start address of GUID HOB data.\r | |
fb3df220 | 214 | \r |
215 | This function builds a customized HOB tagged with a GUID for identification \r | |
216 | and returns the start address of GUID HOB data so that caller can fill the customized data. \r | |
217 | The HOB Header and Name field is already stripped.\r | |
218 | It can only be invoked during PEI phase;\r | |
219 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 220 | \r |
fb3df220 | 221 | If Guid is NULL, then ASSERT().\r |
222 | If there is no additional space for HOB creation, then ASSERT().\r | |
223 | If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r | |
224 | \r | |
225 | @param Guid The GUID to tag the customized HOB.\r | |
226 | @param DataLength The size of the data payload for the GUID HOB.\r | |
227 | \r | |
228 | @return The start address of GUID HOB data.\r | |
229 | \r | |
230 | **/\r | |
231 | VOID *\r | |
232 | EFIAPI\r | |
233 | BuildGuidHob (\r | |
234 | IN CONST EFI_GUID *Guid,\r | |
235 | IN UINTN DataLength\r | |
ed66e1bc | 236 | );\r |
fb3df220 | 237 | \r |
238 | /**\r | |
f9eb929d | 239 | Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB \r |
240 | data field, and returns the start address of the GUID HOB data.\r | |
fb3df220 | 241 | \r |
f9eb929d | 242 | This function builds a customized HOB tagged with a GUID for identification and copies the input\r |
243 | data to the HOB data field and returns the start address of the GUID HOB data. It can only be \r | |
244 | invoked during PEI phase; for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. \r | |
fb3df220 | 245 | The HOB Header and Name field is already stripped.\r |
246 | It can only be invoked during PEI phase;\r | |
247 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 248 | \r |
fb3df220 | 249 | If Guid is NULL, then ASSERT().\r |
250 | If Data is NULL and DataLength > 0, then ASSERT().\r | |
251 | If there is no additional space for HOB creation, then ASSERT().\r | |
252 | If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r | |
253 | \r | |
254 | @param Guid The GUID to tag the customized HOB.\r | |
255 | @param Data The data to be copied into the data field of the GUID HOB.\r | |
256 | @param DataLength The size of the data payload for the GUID HOB.\r | |
257 | \r | |
258 | @return The start address of GUID HOB data.\r | |
259 | \r | |
260 | **/\r | |
261 | VOID *\r | |
262 | EFIAPI\r | |
263 | BuildGuidDataHob (\r | |
264 | IN CONST EFI_GUID *Guid,\r | |
265 | IN VOID *Data,\r | |
266 | IN UINTN DataLength\r | |
ed66e1bc | 267 | );\r |
fb3df220 | 268 | \r |
269 | /**\r | |
270 | Builds a Firmware Volume HOB.\r | |
271 | \r | |
272 | This function builds a Firmware Volume HOB.\r | |
273 | It can only be invoked during PEI phase;\r | |
274 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 275 | \r |
fb3df220 | 276 | If there is no additional space for HOB creation, then ASSERT().\r |
277 | \r | |
278 | @param BaseAddress The base address of the Firmware Volume.\r | |
279 | @param Length The size of the Firmware Volume in bytes.\r | |
280 | \r | |
281 | **/\r | |
282 | VOID\r | |
283 | EFIAPI\r | |
284 | BuildFvHob (\r | |
285 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
286 | IN UINT64 Length\r | |
ed66e1bc | 287 | );\r |
fb3df220 | 288 | \r |
b0d803fe | 289 | /**\r |
290 | Builds a EFI_HOB_TYPE_FV2 HOB.\r | |
291 | \r | |
292 | This function builds a EFI_HOB_TYPE_FV2 HOB.\r | |
293 | It can only be invoked during PEI phase;\r | |
294 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 295 | \r |
b0d803fe | 296 | If there is no additional space for HOB creation, then ASSERT().\r |
297 | \r | |
298 | @param BaseAddress The base address of the Firmware Volume.\r | |
299 | @param Length The size of the Firmware Volume in bytes.\r | |
f9eb929d | 300 | @param FvName The name of the Firmware Volume.\r |
b0d803fe | 301 | @param FileName The name of the file.\r |
302 | \r | |
303 | **/\r | |
304 | VOID\r | |
305 | EFIAPI\r | |
306 | BuildFv2Hob (\r | |
307 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
308 | IN UINT64 Length,\r | |
309 | IN CONST EFI_GUID *FvName,\r | |
310 | IN CONST EFI_GUID *FileName\r | |
ed66e1bc | 311 | );\r |
b0d803fe | 312 | \r |
fb3df220 | 313 | /**\r |
314 | Builds a Capsule Volume HOB.\r | |
315 | \r | |
316 | This function builds a Capsule Volume HOB.\r | |
317 | It can only be invoked during PEI phase;\r | |
318 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 319 | \r |
fb3df220 | 320 | If there is no additional space for HOB creation, then ASSERT().\r |
321 | \r | |
322 | @param BaseAddress The base address of the Capsule Volume.\r | |
323 | @param Length The size of the Capsule Volume in bytes.\r | |
324 | \r | |
325 | **/\r | |
326 | VOID\r | |
327 | EFIAPI\r | |
328 | BuildCvHob (\r | |
329 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
330 | IN UINT64 Length\r | |
ed66e1bc | 331 | );\r |
fb3df220 | 332 | \r |
333 | /**\r | |
334 | Builds a HOB for the CPU.\r | |
335 | \r | |
336 | This function builds a HOB for the CPU.\r | |
337 | It can only be invoked during PEI phase;\r | |
338 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 339 | \r |
fb3df220 | 340 | If there is no additional space for HOB creation, then ASSERT().\r |
341 | \r | |
342 | @param SizeOfMemorySpace The maximum physical memory addressability of the processor.\r | |
343 | @param SizeOfIoSpace The maximum physical I/O addressability of the processor.\r | |
344 | \r | |
345 | **/\r | |
346 | VOID\r | |
347 | EFIAPI\r | |
348 | BuildCpuHob (\r | |
349 | IN UINT8 SizeOfMemorySpace,\r | |
350 | IN UINT8 SizeOfIoSpace\r | |
ed66e1bc | 351 | );\r |
fb3df220 | 352 | \r |
353 | /**\r | |
354 | Builds a HOB for the Stack.\r | |
355 | \r | |
356 | This function builds a HOB for the stack.\r | |
357 | It can only be invoked during PEI phase;\r | |
358 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 359 | \r |
fb3df220 | 360 | If there is no additional space for HOB creation, then ASSERT().\r |
361 | \r | |
362 | @param BaseAddress The 64 bit physical address of the Stack.\r | |
363 | @param Length The length of the stack in bytes.\r | |
364 | \r | |
365 | **/\r | |
366 | VOID\r | |
367 | EFIAPI\r | |
368 | BuildStackHob (\r | |
369 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
370 | IN UINT64 Length\r | |
ed66e1bc | 371 | );\r |
fb3df220 | 372 | \r |
373 | /**\r | |
374 | Builds a HOB for the BSP store.\r | |
375 | \r | |
376 | This function builds a HOB for BSP store.\r | |
377 | It can only be invoked during PEI phase;\r | |
378 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 379 | \r |
fb3df220 | 380 | If there is no additional space for HOB creation, then ASSERT().\r |
381 | \r | |
382 | @param BaseAddress The 64 bit physical address of the BSP.\r | |
383 | @param Length The length of the BSP store in bytes.\r | |
384 | @param MemoryType Type of memory allocated by this HOB.\r | |
385 | \r | |
386 | **/\r | |
387 | VOID\r | |
388 | EFIAPI\r | |
389 | BuildBspStoreHob (\r | |
390 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
391 | IN UINT64 Length,\r | |
392 | IN EFI_MEMORY_TYPE MemoryType\r | |
ed66e1bc | 393 | );\r |
fb3df220 | 394 | \r |
395 | /**\r | |
396 | Builds a HOB for the memory allocation.\r | |
397 | \r | |
398 | This function builds a HOB for the memory allocation.\r | |
399 | It can only be invoked during PEI phase;\r | |
400 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
f9eb929d | 401 | \r |
fb3df220 | 402 | If there is no additional space for HOB creation, then ASSERT().\r |
403 | \r | |
404 | @param BaseAddress The 64 bit physical address of the memory.\r | |
405 | @param Length The length of the memory allocation in bytes.\r | |
406 | @param MemoryType Type of memory allocated by this HOB.\r | |
407 | \r | |
408 | **/\r | |
409 | VOID\r | |
410 | EFIAPI\r | |
411 | BuildMemoryAllocationHob (\r | |
412 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
413 | IN UINT64 Length,\r | |
414 | IN EFI_MEMORY_TYPE MemoryType\r | |
ed66e1bc | 415 | );\r |
fb3df220 | 416 | \r |
f9eb929d | 417 | /**\r |
418 | Returns the type of a HOB.\r | |
419 | \r | |
420 | This macro returns the HobType field from the HOB header for the \r | |
421 | HOB specified by Hob.\r | |
422 | \r | |
423 | @param Hob A pointer to a HOB.\r | |
424 | \r | |
2281e7a9 | 425 | @return HobType.\r |
f9eb929d | 426 | \r |
427 | **/\r | |
cc4aa464 | 428 | #define GET_HOB_TYPE(HobStart) \\r |
429 | ((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobType)\r | |
55f298c3 | 430 | \r |
f9eb929d | 431 | /**\r |
432 | Returns the length, in bytes, of a HOB.\r | |
433 | \r | |
434 | This macro returns the HobLength field from the HOB header for the \r | |
435 | HOB specified by Hob.\r | |
436 | \r | |
437 | @param Hob A pointer to a HOB.\r | |
438 | \r | |
2281e7a9 | 439 | @return HobLength.\r |
f9eb929d | 440 | \r |
441 | **/\r | |
cc4aa464 | 442 | #define GET_HOB_LENGTH(HobStart) \\r |
443 | ((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobLength)\r | |
55f298c3 | 444 | \r |
f9eb929d | 445 | /**\r |
446 | Returns a pointer to the next HOB in the HOB list.\r | |
447 | \r | |
448 | This macro returns a pointer to HOB that follows the \r | |
449 | HOB specified by Hob in the HOB List.\r | |
450 | \r | |
451 | @param Hob A pointer to a HOB.\r | |
452 | \r | |
453 | @return A pointer to the next HOB in the HOB list.\r | |
454 | \r | |
455 | **/\r | |
cc4aa464 | 456 | #define GET_NEXT_HOB(HobStart) \\r |
457 | (VOID *)(*(UINT8 **)&(HobStart) + GET_HOB_LENGTH (HobStart))\r | |
55f298c3 | 458 | \r |
f9eb929d | 459 | /**\r |
460 | Determines if a HOB is the last HOB in the HOB list.\r | |
461 | \r | |
462 | This macro determine if the HOB specified by Hob is the \r | |
463 | last HOB in the HOB list. If Hob is last HOB in the HOB list, \r | |
464 | then TRUE is returned. Otherwise, FALSE is returned.\r | |
465 | \r | |
466 | @param Hob A pointer to a HOB.\r | |
467 | \r | |
468 | @retval TRUE The HOB specified by Hob is the last HOB in the HOB list.\r | |
469 | @retval FALSE The HOB specified by Hob is not the last HOB in the HOB list.\r | |
470 | \r | |
471 | **/\r | |
46467499 | 472 | #define END_OF_HOB_LIST(Hob) (GET_HOB_TYPE (Hob) == (UINT16)EFI_HOB_TYPE_END_OF_HOB_LIST)\r |
146332ae | 473 | \r |
f9eb929d | 474 | /**\r |
475 | Returns a pointer to data buffer from a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.\r | |
476 | \r | |
477 | This macro returns a pointer to the data buffer in a HOB specified by Hob.\r | |
478 | Hob is assumed to be a HOB of type EFI_HOB_TYPE_GUID_EXTENSION. \r | |
479 | \r | |
7ca066f9 | 480 | @param GuidHob A pointer to a HOB.\r |
f9eb929d | 481 | \r |
2281e7a9 | 482 | @return A pointer to the data buffer in a HOB.\r |
f9eb929d | 483 | \r |
484 | **/\r | |
cc4aa464 | 485 | #define GET_GUID_HOB_DATA(HobStart) \\r |
486 | (VOID *)(*(UINT8 **)&(HobStart) + sizeof (EFI_HOB_GUID_TYPE))\r | |
55f298c3 | 487 | \r |
f9eb929d | 488 | /**\r |
489 | Returns the size of the data buffer from a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.\r | |
490 | \r | |
491 | This macro returns the size, in bytes, of the data buffer in a HOB specified by Hob.\r | |
492 | Hob is assumed to be a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.\r | |
493 | \r | |
7ca066f9 | 494 | @param GuidHob A pointer to a HOB.\r |
f9eb929d | 495 | \r |
2281e7a9 | 496 | @return The size of the data buffer.\r |
f9eb929d | 497 | **/\r |
cc4aa464 | 498 | #define GET_GUID_HOB_DATA_SIZE(HobStart) \\r |
499 | (UINT16)(GET_HOB_LENGTH (HobStart) - sizeof (EFI_HOB_GUID_TYPE))\r | |
146332ae | 500 | \r |
fb3df220 | 501 | #endif\r |