]>
Commit | Line | Data |
---|---|---|
738ec565 | 1 | /** @file\r |
6812ef9f | 2 | HOB Library implementation for DxeCore driver.\r |
738ec565 | 3 | \r |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
738ec565 | 6 | \r |
738ec565 | 7 | **/\r |
8 | \r | |
c7d265a9 | 9 | #include <PiDxe.h>\r |
c892d846 | 10 | \r |
c7d265a9 | 11 | #include <Library/HobLib.h>\r |
12 | #include <Library/DebugLib.h>\r | |
13 | #include <Library/BaseMemoryLib.h>\r | |
6812ef9f | 14 | #include <Library/DxeCoreEntryPoint.h>\r |
738ec565 | 15 | \r |
16 | /**\r | |
17 | Returns the pointer to the HOB list.\r | |
18 | \r | |
19 | This function returns the pointer to first HOB in the list.\r | |
9095d37b | 20 | For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer\r |
3e5c3238 | 21 | to the HOB list. For the DXE phase, the HOB list pointer can be retrieved through\r |
22 | the EFI System Table by looking up theHOB list GUID in the System Configuration Table.\r | |
9095d37b LG |
23 | Since the System Configuration Table does not exist that the time the DXE Core is\r |
24 | launched, the DXE Core uses a global variable from the DXE Core Entry Point Library\r | |
3e5c3238 | 25 | to manage the pointer to the HOB list.\r |
9095d37b | 26 | \r |
3e5c3238 | 27 | If the pointer to the HOB list is NULL, then ASSERT().\r |
9095d37b | 28 | \r |
738ec565 | 29 | @return The pointer to the HOB list.\r |
30 | \r | |
31 | **/\r | |
32 | VOID *\r | |
33 | EFIAPI\r | |
34 | GetHobList (\r | |
35 | VOID\r | |
36 | )\r | |
37 | {\r | |
6f890d5b | 38 | ASSERT (gHobList != NULL);\r |
738ec565 | 39 | return gHobList;\r |
40 | }\r | |
41 | \r | |
42 | /**\r | |
43 | Returns the next instance of a HOB type from the starting HOB.\r | |
44 | \r | |
9095d37b | 45 | This function searches the first instance of a HOB type from the starting HOB pointer.\r |
738ec565 | 46 | If there does not exist such HOB type from the starting HOB pointer, it will return NULL.\r |
47 | In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r | |
48 | unconditionally: it returns HobStart back if HobStart itself meets the requirement;\r | |
49 | caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.\r | |
9095d37b | 50 | \r |
738ec565 | 51 | If HobStart is NULL, then ASSERT().\r |
52 | \r | |
53 | @param Type The HOB type to return.\r | |
54 | @param HobStart The starting HOB pointer to search from.\r | |
55 | \r | |
56 | @return The next instance of a HOB type from the starting HOB.\r | |
57 | \r | |
58 | **/\r | |
59 | VOID *\r | |
60 | EFIAPI\r | |
61 | GetNextHob (\r | |
2f88bd3a MK |
62 | IN UINT16 Type,\r |
63 | IN CONST VOID *HobStart\r | |
738ec565 | 64 | )\r |
65 | {\r | |
66 | EFI_PEI_HOB_POINTERS Hob;\r | |
67 | \r | |
68 | ASSERT (HobStart != NULL);\r | |
8693ca5d | 69 | \r |
2f88bd3a | 70 | Hob.Raw = (UINT8 *)HobStart;\r |
738ec565 | 71 | //\r |
72 | // Parse the HOB list until end of list or matching type is found.\r | |
73 | //\r | |
74 | while (!END_OF_HOB_LIST (Hob)) {\r | |
75 | if (Hob.Header->HobType == Type) {\r | |
76 | return Hob.Raw;\r | |
77 | }\r | |
2f88bd3a | 78 | \r |
738ec565 | 79 | Hob.Raw = GET_NEXT_HOB (Hob);\r |
80 | }\r | |
2f88bd3a | 81 | \r |
738ec565 | 82 | return NULL;\r |
83 | }\r | |
84 | \r | |
85 | /**\r | |
86 | Returns the first instance of a HOB type among the whole HOB list.\r | |
87 | \r | |
9095d37b LG |
88 | This function searches the first instance of a HOB type among the whole HOB list.\r |
89 | If there does not exist such HOB type in the HOB list, it will return NULL.\r | |
90 | \r | |
3e5c3238 | 91 | If the pointer to the HOB list is NULL, then ASSERT().\r |
738ec565 | 92 | \r |
93 | @param Type The HOB type to return.\r | |
94 | \r | |
95 | @return The next instance of a HOB type from the starting HOB.\r | |
96 | \r | |
97 | **/\r | |
98 | VOID *\r | |
99 | EFIAPI\r | |
100 | GetFirstHob (\r | |
2f88bd3a | 101 | IN UINT16 Type\r |
738ec565 | 102 | )\r |
103 | {\r | |
2f88bd3a | 104 | VOID *HobList;\r |
738ec565 | 105 | \r |
106 | HobList = GetHobList ();\r | |
107 | return GetNextHob (Type, HobList);\r | |
108 | }\r | |
109 | \r | |
110 | /**\r | |
3e5c3238 | 111 | Returns the next instance of the matched GUID HOB from the starting HOB.\r |
9095d37b LG |
112 | \r |
113 | This function searches the first instance of a HOB from the starting HOB pointer.\r | |
114 | Such HOB should satisfy two conditions:\r | |
115 | its HOB type is EFI_HOB_TYPE_GUID_EXTENSION, and its GUID Name equals to the input Guid.\r | |
116 | If such a HOB from the starting HOB pointer does not exist, it will return NULL.\r | |
738ec565 | 117 | Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()\r |
58380e9c | 118 | to extract the data section and its size information, respectively.\r |
738ec565 | 119 | In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r |
120 | unconditionally: it returns HobStart back if HobStart itself meets the requirement;\r | |
121 | caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.\r | |
9095d37b | 122 | \r |
738ec565 | 123 | If Guid is NULL, then ASSERT().\r |
124 | If HobStart is NULL, then ASSERT().\r | |
125 | \r | |
126 | @param Guid The GUID to match with in the HOB list.\r | |
127 | @param HobStart A pointer to a Guid.\r | |
128 | \r | |
129 | @return The next instance of the matched GUID HOB from the starting HOB.\r | |
130 | \r | |
131 | **/\r | |
132 | VOID *\r | |
133 | EFIAPI\r | |
134 | GetNextGuidHob (\r | |
2f88bd3a MK |
135 | IN CONST EFI_GUID *Guid,\r |
136 | IN CONST VOID *HobStart\r | |
738ec565 | 137 | )\r |
138 | {\r | |
139 | EFI_PEI_HOB_POINTERS GuidHob;\r | |
140 | \r | |
2f88bd3a | 141 | GuidHob.Raw = (UINT8 *)HobStart;\r |
738ec565 | 142 | while ((GuidHob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, GuidHob.Raw)) != NULL) {\r |
143 | if (CompareGuid (Guid, &GuidHob.Guid->Name)) {\r | |
144 | break;\r | |
145 | }\r | |
2f88bd3a | 146 | \r |
738ec565 | 147 | GuidHob.Raw = GET_NEXT_HOB (GuidHob);\r |
148 | }\r | |
2f88bd3a | 149 | \r |
738ec565 | 150 | return GuidHob.Raw;\r |
151 | }\r | |
152 | \r | |
153 | /**\r | |
3e5c3238 | 154 | Returns the first instance of the matched GUID HOB among the whole HOB list.\r |
9095d37b LG |
155 | \r |
156 | This function searches the first instance of a HOB among the whole HOB list.\r | |
738ec565 | 157 | Such HOB should satisfy two conditions:\r |
158 | its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.\r | |
58380e9c | 159 | If such a HOB from the starting HOB pointer does not exist, it will return NULL.\r |
738ec565 | 160 | Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()\r |
58380e9c | 161 | to extract the data section and its size information, respectively.\r |
9095d37b | 162 | \r |
3e5c3238 | 163 | If the pointer to the HOB list is NULL, then ASSERT().\r |
738ec565 | 164 | If Guid is NULL, then ASSERT().\r |
165 | \r | |
166 | @param Guid The GUID to match with in the HOB list.\r | |
167 | \r | |
168 | @return The first instance of the matched GUID HOB among the whole HOB list.\r | |
169 | \r | |
170 | **/\r | |
171 | VOID *\r | |
172 | EFIAPI\r | |
173 | GetFirstGuidHob (\r | |
2f88bd3a | 174 | IN CONST EFI_GUID *Guid\r |
738ec565 | 175 | )\r |
176 | {\r | |
2f88bd3a | 177 | VOID *HobList;\r |
738ec565 | 178 | \r |
179 | HobList = GetHobList ();\r | |
180 | return GetNextGuidHob (Guid, HobList);\r | |
181 | }\r | |
182 | \r | |
183 | /**\r | |
3e5c3238 | 184 | Get the system boot mode from the HOB list.\r |
738ec565 | 185 | \r |
9095d37b | 186 | This function returns the system boot mode information from the\r |
738ec565 | 187 | PHIT HOB in HOB list.\r |
188 | \r | |
3e5c3238 | 189 | If the pointer to the HOB list is NULL, then ASSERT().\r |
9095d37b | 190 | \r |
738ec565 | 191 | @param VOID\r |
192 | \r | |
193 | @return The Boot Mode.\r | |
194 | \r | |
195 | **/\r | |
196 | EFI_BOOT_MODE\r | |
197 | EFIAPI\r | |
198 | GetBootModeHob (\r | |
199 | VOID\r | |
200 | )\r | |
201 | {\r | |
2f88bd3a | 202 | EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;\r |
738ec565 | 203 | \r |
2f88bd3a | 204 | HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *)GetHobList ();\r |
738ec565 | 205 | \r |
2f88bd3a | 206 | return HandOffHob->BootMode;\r |
738ec565 | 207 | }\r |
3e5c3238 | 208 | \r |
738ec565 | 209 | /**\r |
210 | Builds a HOB for a loaded PE32 module.\r | |
211 | \r | |
212 | This function builds a HOB for a loaded PE32 module.\r | |
213 | It can only be invoked during PEI phase;\r | |
58380e9c | 214 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 215 | \r |
738ec565 | 216 | If ModuleName is NULL, then ASSERT().\r |
217 | If there is no additional space for HOB creation, then ASSERT().\r | |
218 | \r | |
219 | @param ModuleName The GUID File Name of the module.\r | |
220 | @param MemoryAllocationModule The 64 bit physical address of the module.\r | |
221 | @param ModuleLength The length of the module in bytes.\r | |
3e5c3238 | 222 | @param EntryPoint The 64 bit physical address of the module entry point.\r |
738ec565 | 223 | \r |
224 | **/\r | |
225 | VOID\r | |
226 | EFIAPI\r | |
227 | BuildModuleHob (\r | |
2f88bd3a MK |
228 | IN CONST EFI_GUID *ModuleName,\r |
229 | IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,\r | |
230 | IN UINT64 ModuleLength,\r | |
231 | IN EFI_PHYSICAL_ADDRESS EntryPoint\r | |
738ec565 | 232 | )\r |
233 | {\r | |
234 | //\r | |
235 | // PEI HOB is read only for DXE phase\r | |
236 | //\r | |
237 | ASSERT (FALSE);\r | |
238 | }\r | |
239 | \r | |
e4b0415d | 240 | /**\r |
f1e2b728 | 241 | Builds a HOB that describes a chunk of system memory with Owner GUID.\r |
e4b0415d HT |
242 | \r |
243 | This function builds a HOB that describes a chunk of system memory.\r | |
244 | It can only be invoked during PEI phase;\r | |
245 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
9095d37b | 246 | \r |
e4b0415d HT |
247 | If there is no additional space for HOB creation, then ASSERT().\r |
248 | \r | |
249 | @param ResourceType The type of resource described by this HOB.\r | |
250 | @param ResourceAttribute The resource attributes of the memory described by this HOB.\r | |
251 | @param PhysicalStart The 64 bit physical address of memory described by this HOB.\r | |
252 | @param NumberOfBytes The length of the memory described by this HOB in bytes.\r | |
f1e2b728 | 253 | @param OwnerGUID GUID for the owner of this resource.\r |
e4b0415d HT |
254 | \r |
255 | **/\r | |
256 | VOID\r | |
257 | EFIAPI\r | |
258 | BuildResourceDescriptorWithOwnerHob (\r | |
259 | IN EFI_RESOURCE_TYPE ResourceType,\r | |
260 | IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,\r | |
261 | IN EFI_PHYSICAL_ADDRESS PhysicalStart,\r | |
262 | IN UINT64 NumberOfBytes,\r | |
263 | IN EFI_GUID *OwnerGUID\r | |
264 | )\r | |
265 | {\r | |
f1e2b728 SZ |
266 | //\r |
267 | // PEI HOB is read only for DXE phase\r | |
268 | //\r | |
269 | ASSERT (FALSE);\r | |
270 | }\r | |
271 | \r | |
738ec565 | 272 | /**\r |
273 | Builds a HOB that describes a chunk of system memory.\r | |
274 | \r | |
275 | This function builds a HOB that describes a chunk of system memory.\r | |
276 | It can only be invoked during PEI phase;\r | |
58380e9c | 277 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 278 | \r |
738ec565 | 279 | If there is no additional space for HOB creation, then ASSERT().\r |
280 | \r | |
281 | @param ResourceType The type of resource described by this HOB.\r | |
282 | @param ResourceAttribute The resource attributes of the memory described by this HOB.\r | |
283 | @param PhysicalStart The 64 bit physical address of memory described by this HOB.\r | |
284 | @param NumberOfBytes The length of the memory described by this HOB in bytes.\r | |
285 | \r | |
286 | **/\r | |
287 | VOID\r | |
288 | EFIAPI\r | |
289 | BuildResourceDescriptorHob (\r | |
290 | IN EFI_RESOURCE_TYPE ResourceType,\r | |
291 | IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,\r | |
292 | IN EFI_PHYSICAL_ADDRESS PhysicalStart,\r | |
293 | IN UINT64 NumberOfBytes\r | |
294 | )\r | |
295 | {\r | |
296 | //\r | |
297 | // PEI HOB is read only for DXE phase\r | |
298 | //\r | |
299 | ASSERT (FALSE);\r | |
300 | }\r | |
301 | \r | |
302 | /**\r | |
9095d37b | 303 | Builds a customized HOB tagged with a GUID for identification and returns\r |
3e5c3238 | 304 | the start address of GUID HOB data.\r |
738ec565 | 305 | \r |
9095d37b LG |
306 | This function builds a customized HOB tagged with a GUID for identification\r |
307 | and returns the start address of GUID HOB data so that caller can fill the customized data.\r | |
738ec565 | 308 | The HOB Header and Name field is already stripped.\r |
58380e9c | 309 | It can only be invoked during PEI phase.\r |
310 | For DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r | |
9095d37b | 311 | \r |
738ec565 | 312 | If Guid is NULL, then ASSERT().\r |
313 | If there is no additional space for HOB creation, then ASSERT().\r | |
192764db LG |
314 | If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r |
315 | HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8.\r | |
738ec565 | 316 | \r |
317 | @param Guid The GUID to tag the customized HOB.\r | |
318 | @param DataLength The size of the data payload for the GUID HOB.\r | |
319 | \r | |
ef2635c3 RN |
320 | @retval NULL The GUID HOB could not be allocated.\r |
321 | @retval others The start address of GUID HOB data.\r | |
738ec565 | 322 | \r |
323 | **/\r | |
324 | VOID *\r | |
325 | EFIAPI\r | |
326 | BuildGuidHob (\r | |
2f88bd3a MK |
327 | IN CONST EFI_GUID *Guid,\r |
328 | IN UINTN DataLength\r | |
738ec565 | 329 | )\r |
330 | {\r | |
331 | //\r | |
332 | // PEI HOB is read only for DXE phase\r | |
333 | //\r | |
334 | ASSERT (FALSE);\r | |
335 | return NULL;\r | |
336 | }\r | |
337 | \r | |
338 | /**\r | |
9095d37b | 339 | Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB\r |
3e5c3238 | 340 | data field, and returns the start address of the GUID HOB data.\r |
738ec565 | 341 | \r |
3e5c3238 | 342 | This function builds a customized HOB tagged with a GUID for identification and copies the input\r |
9095d37b LG |
343 | data to the HOB data field and returns the start address of the GUID HOB data. It can only be\r |
344 | invoked during PEI phase; for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r | |
738ec565 | 345 | The HOB Header and Name field is already stripped.\r |
58380e9c | 346 | It can only be invoked during PEI phase.\r |
347 | For DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r | |
9095d37b | 348 | \r |
738ec565 | 349 | If Guid is NULL, then ASSERT().\r |
350 | If Data is NULL and DataLength > 0, then ASSERT().\r | |
351 | If there is no additional space for HOB creation, then ASSERT().\r | |
192764db LG |
352 | If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r |
353 | HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8.\r | |
738ec565 | 354 | \r |
355 | @param Guid The GUID to tag the customized HOB.\r | |
356 | @param Data The data to be copied into the data field of the GUID HOB.\r | |
357 | @param DataLength The size of the data payload for the GUID HOB.\r | |
358 | \r | |
ef2635c3 RN |
359 | @retval NULL The GUID HOB could not be allocated.\r |
360 | @retval others The start address of GUID HOB data.\r | |
738ec565 | 361 | \r |
362 | **/\r | |
363 | VOID *\r | |
364 | EFIAPI\r | |
365 | BuildGuidDataHob (\r | |
2f88bd3a MK |
366 | IN CONST EFI_GUID *Guid,\r |
367 | IN VOID *Data,\r | |
368 | IN UINTN DataLength\r | |
738ec565 | 369 | )\r |
370 | {\r | |
371 | //\r | |
372 | // PEI HOB is read only for DXE phase\r | |
373 | //\r | |
374 | ASSERT (FALSE);\r | |
375 | return NULL;\r | |
376 | }\r | |
377 | \r | |
378 | /**\r | |
379 | Builds a Firmware Volume HOB.\r | |
380 | \r | |
381 | This function builds a Firmware Volume HOB.\r | |
382 | It can only be invoked during PEI phase;\r | |
58380e9c | 383 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 384 | \r |
738ec565 | 385 | If there is no additional space for HOB creation, then ASSERT().\r |
471d6210 | 386 | If the FvImage buffer is not at its required alignment, then ASSERT().\r |
738ec565 | 387 | \r |
388 | @param BaseAddress The base address of the Firmware Volume.\r | |
389 | @param Length The size of the Firmware Volume in bytes.\r | |
390 | \r | |
391 | **/\r | |
392 | VOID\r | |
393 | EFIAPI\r | |
394 | BuildFvHob (\r | |
2f88bd3a MK |
395 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
396 | IN UINT64 Length\r | |
738ec565 | 397 | )\r |
398 | {\r | |
399 | //\r | |
400 | // PEI HOB is read only for DXE phase\r | |
401 | //\r | |
402 | ASSERT (FALSE);\r | |
403 | }\r | |
404 | \r | |
07ad9b81 | 405 | /**\r |
406 | Builds a EFI_HOB_TYPE_FV2 HOB.\r | |
407 | \r | |
408 | This function builds a EFI_HOB_TYPE_FV2 HOB.\r | |
409 | It can only be invoked during PEI phase;\r | |
58380e9c | 410 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 411 | \r |
07ad9b81 | 412 | If there is no additional space for HOB creation, then ASSERT().\r |
471d6210 | 413 | If the FvImage buffer is not at its required alignment, then ASSERT().\r |
07ad9b81 | 414 | \r |
415 | @param BaseAddress The base address of the Firmware Volume.\r | |
416 | @param Length The size of the Firmware Volume in bytes.\r | |
3e5c3238 | 417 | @param FvName The name of the Firmware Volume.\r |
07ad9b81 | 418 | @param FileName The name of the file.\r |
9095d37b | 419 | \r |
07ad9b81 | 420 | **/\r |
421 | VOID\r | |
422 | EFIAPI\r | |
423 | BuildFv2Hob (\r | |
2f88bd3a MK |
424 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
425 | IN UINT64 Length,\r | |
426 | IN CONST EFI_GUID *FvName,\r | |
427 | IN CONST EFI_GUID *FileName\r | |
07ad9b81 | 428 | )\r |
429 | {\r | |
430 | ASSERT (FALSE);\r | |
431 | }\r | |
432 | \r | |
5450086c SZ |
433 | /**\r |
434 | Builds a EFI_HOB_TYPE_FV3 HOB.\r | |
435 | \r | |
436 | This function builds a EFI_HOB_TYPE_FV3 HOB.\r | |
437 | It can only be invoked during PEI phase;\r | |
438 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
439 | \r | |
440 | If there is no additional space for HOB creation, then ASSERT().\r | |
441 | If the FvImage buffer is not at its required alignment, then ASSERT().\r | |
442 | \r | |
443 | @param BaseAddress The base address of the Firmware Volume.\r | |
444 | @param Length The size of the Firmware Volume in bytes.\r | |
445 | @param AuthenticationStatus The authentication status.\r | |
446 | @param ExtractedFv TRUE if the FV was extracted as a file within\r | |
447 | another firmware volume. FALSE otherwise.\r | |
448 | @param FvName The name of the Firmware Volume.\r | |
449 | Valid only if IsExtractedFv is TRUE.\r | |
450 | @param FileName The name of the file.\r | |
451 | Valid only if IsExtractedFv is TRUE.\r | |
452 | \r | |
453 | **/\r | |
454 | VOID\r | |
455 | EFIAPI\r | |
456 | BuildFv3Hob (\r | |
2f88bd3a MK |
457 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
458 | IN UINT64 Length,\r | |
459 | IN UINT32 AuthenticationStatus,\r | |
460 | IN BOOLEAN ExtractedFv,\r | |
461 | IN CONST EFI_GUID *FvName OPTIONAL,\r | |
462 | IN CONST EFI_GUID *FileName OPTIONAL\r | |
5450086c SZ |
463 | )\r |
464 | {\r | |
465 | ASSERT (FALSE);\r | |
466 | }\r | |
467 | \r | |
738ec565 | 468 | /**\r |
469 | Builds a Capsule Volume HOB.\r | |
470 | \r | |
471 | This function builds a Capsule Volume HOB.\r | |
472 | It can only be invoked during PEI phase;\r | |
58380e9c | 473 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 474 | \r |
c85cea80 | 475 | If the platform does not support Capsule Volume HOBs, then ASSERT().\r |
738ec565 | 476 | If there is no additional space for HOB creation, then ASSERT().\r |
477 | \r | |
478 | @param BaseAddress The base address of the Capsule Volume.\r | |
479 | @param Length The size of the Capsule Volume in bytes.\r | |
480 | \r | |
481 | **/\r | |
482 | VOID\r | |
483 | EFIAPI\r | |
484 | BuildCvHob (\r | |
2f88bd3a MK |
485 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
486 | IN UINT64 Length\r | |
738ec565 | 487 | )\r |
488 | {\r | |
489 | //\r | |
490 | // PEI HOB is read only for DXE phase\r | |
491 | //\r | |
492 | ASSERT (FALSE);\r | |
493 | }\r | |
494 | \r | |
495 | /**\r | |
496 | Builds a HOB for the CPU.\r | |
497 | \r | |
498 | This function builds a HOB for the CPU.\r | |
499 | It can only be invoked during PEI phase;\r | |
58380e9c | 500 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 501 | \r |
738ec565 | 502 | If there is no additional space for HOB creation, then ASSERT().\r |
503 | \r | |
504 | @param SizeOfMemorySpace The maximum physical memory addressability of the processor.\r | |
505 | @param SizeOfIoSpace The maximum physical I/O addressability of the processor.\r | |
506 | \r | |
507 | **/\r | |
508 | VOID\r | |
509 | EFIAPI\r | |
510 | BuildCpuHob (\r | |
2f88bd3a MK |
511 | IN UINT8 SizeOfMemorySpace,\r |
512 | IN UINT8 SizeOfIoSpace\r | |
738ec565 | 513 | )\r |
514 | {\r | |
515 | //\r | |
516 | // PEI HOB is read only for DXE phase\r | |
517 | //\r | |
518 | ASSERT (FALSE);\r | |
519 | }\r | |
520 | \r | |
521 | /**\r | |
522 | Builds a HOB for the Stack.\r | |
523 | \r | |
524 | This function builds a HOB for the stack.\r | |
525 | It can only be invoked during PEI phase;\r | |
58380e9c | 526 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 527 | \r |
738ec565 | 528 | If there is no additional space for HOB creation, then ASSERT().\r |
529 | \r | |
530 | @param BaseAddress The 64 bit physical address of the Stack.\r | |
531 | @param Length The length of the stack in bytes.\r | |
532 | \r | |
533 | **/\r | |
534 | VOID\r | |
535 | EFIAPI\r | |
536 | BuildStackHob (\r | |
2f88bd3a MK |
537 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
538 | IN UINT64 Length\r | |
738ec565 | 539 | )\r |
540 | {\r | |
541 | //\r | |
542 | // PEI HOB is read only for DXE phase\r | |
543 | //\r | |
544 | ASSERT (FALSE);\r | |
545 | }\r | |
546 | \r | |
547 | /**\r | |
548 | Builds a HOB for the BSP store.\r | |
549 | \r | |
550 | This function builds a HOB for BSP store.\r | |
551 | It can only be invoked during PEI phase;\r | |
58380e9c | 552 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 553 | \r |
738ec565 | 554 | If there is no additional space for HOB creation, then ASSERT().\r |
555 | \r | |
556 | @param BaseAddress The 64 bit physical address of the BSP.\r | |
557 | @param Length The length of the BSP store in bytes.\r | |
558 | @param MemoryType Type of memory allocated by this HOB.\r | |
559 | \r | |
560 | **/\r | |
561 | VOID\r | |
562 | EFIAPI\r | |
563 | BuildBspStoreHob (\r | |
2f88bd3a MK |
564 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
565 | IN UINT64 Length,\r | |
566 | IN EFI_MEMORY_TYPE MemoryType\r | |
738ec565 | 567 | )\r |
568 | {\r | |
569 | //\r | |
570 | // PEI HOB is read only for DXE phase\r | |
571 | //\r | |
572 | ASSERT (FALSE);\r | |
573 | }\r | |
574 | \r | |
575 | /**\r | |
576 | Builds a HOB for the memory allocation.\r | |
577 | \r | |
578 | This function builds a HOB for the memory allocation.\r | |
579 | It can only be invoked during PEI phase;\r | |
58380e9c | 580 | for DXE phase, it will ASSERT() because PEI HOB is read-only for DXE phase.\r |
9095d37b | 581 | \r |
738ec565 | 582 | If there is no additional space for HOB creation, then ASSERT().\r |
583 | \r | |
584 | @param BaseAddress The 64 bit physical address of the memory.\r | |
585 | @param Length The length of the memory allocation in bytes.\r | |
586 | @param MemoryType Type of memory allocated by this HOB.\r | |
587 | \r | |
588 | **/\r | |
589 | VOID\r | |
590 | EFIAPI\r | |
591 | BuildMemoryAllocationHob (\r | |
2f88bd3a MK |
592 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
593 | IN UINT64 Length,\r | |
594 | IN EFI_MEMORY_TYPE MemoryType\r | |
738ec565 | 595 | )\r |
596 | {\r | |
597 | //\r | |
598 | // PEI HOB is read only for DXE phase\r | |
599 | //\r | |
600 | ASSERT (FALSE);\r | |
601 | }\r |