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