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