]>
Commit | Line | Data |
---|---|---|
738ec565 | 1 | /** @file\r |
6812ef9f | 2 | HOB Library implemenation for Dxe Phase.\r |
738ec565 | 3 | \r |
f1e2b728 | 4 | Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r |
19388d29 | 5 | This program and the accompanying materials\r |
3e5c3238 | 6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
738ec565 | 9 | \r |
3e5c3238 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
738ec565 | 12 | \r |
738ec565 | 13 | **/\r |
14 | \r | |
c7d265a9 | 15 | #include <PiDxe.h>\r |
c892d846 | 16 | \r |
c7d265a9 | 17 | #include <Guid/HobList.h>\r |
c892d846 | 18 | \r |
c7d265a9 | 19 | #include <Library/HobLib.h>\r |
20 | #include <Library/UefiLib.h>\r | |
21 | #include <Library/DebugLib.h>\r | |
22 | #include <Library/BaseMemoryLib.h>\r | |
738ec565 | 23 | \r |
fe467413 | 24 | VOID *mHobList = NULL;\r |
738ec565 | 25 | \r |
26 | /**\r | |
27 | The constructor function caches the pointer to HOB list.\r | |
28 | \r | |
29 | The constructor function gets the start address of HOB list from system configuration table.\r | |
30 | It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. \r | |
31 | \r | |
32 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
33 | @param SystemTable A pointer to the EFI System Table.\r | |
34 | \r | |
9e6fa6d2 LG |
35 | @retval EFI_SUCCESS The constructor successfully gets HobList.\r |
36 | @retval Other value The constructor can't get HobList.\r | |
738ec565 | 37 | \r |
38 | **/\r | |
39 | EFI_STATUS\r | |
40 | EFIAPI\r | |
41 | HobLibConstructor (\r | |
42 | IN EFI_HANDLE ImageHandle,\r | |
43 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
44 | )\r | |
45 | {\r | |
46 | EFI_STATUS Status;\r | |
47 | \r | |
6f890d5b | 48 | Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, &mHobList);\r |
738ec565 | 49 | ASSERT_EFI_ERROR (Status);\r |
50 | ASSERT (mHobList != NULL);\r | |
6812ef9f | 51 | \r |
9e6fa6d2 | 52 | return Status;\r |
738ec565 | 53 | }\r |
54 | \r | |
55 | /**\r | |
56 | Returns the pointer to the HOB list.\r | |
57 | \r | |
58 | This function returns the pointer to first HOB in the list.\r | |
3e5c3238 | 59 | For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer \r |
60 | to the HOB list. For the DXE phase, the HOB list pointer can be retrieved through\r | |
61 | the EFI System Table by looking up theHOB list GUID in the System Configuration Table.\r | |
62 | Since the System Configuration Table does not exist that the time the DXE Core is \r | |
63 | launched, the DXE Core uses a global variable from the DXE Core Entry Point Library \r | |
64 | to manage the pointer to the HOB list.\r | |
65 | \r | |
66 | If the pointer to the HOB list is NULL, then ASSERT().\r | |
67 | \r | |
738ec565 | 68 | @return The pointer to the HOB list.\r |
69 | \r | |
70 | **/\r | |
71 | VOID *\r | |
72 | EFIAPI\r | |
73 | GetHobList (\r | |
74 | VOID\r | |
75 | )\r | |
76 | {\r | |
6f890d5b | 77 | ASSERT (mHobList != NULL);\r |
738ec565 | 78 | return mHobList;\r |
79 | }\r | |
80 | \r | |
81 | /**\r | |
82 | Returns the next instance of a HOB type from the starting HOB.\r | |
83 | \r | |
84 | This function searches the first instance of a HOB type from the starting HOB pointer. \r | |
85 | If there does not exist such HOB type from the starting HOB pointer, it will return NULL.\r | |
86 | In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r | |
87 | unconditionally: it returns HobStart back if HobStart itself meets the requirement;\r | |
88 | caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.\r | |
3e5c3238 | 89 | \r |
738ec565 | 90 | If HobStart is NULL, then ASSERT().\r |
91 | \r | |
92 | @param Type The HOB type to return.\r | |
93 | @param HobStart The starting HOB pointer to search from.\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 | GetNextHob (\r | |
101 | IN UINT16 Type,\r | |
102 | IN CONST VOID *HobStart\r | |
103 | )\r | |
104 | {\r | |
105 | EFI_PEI_HOB_POINTERS Hob;\r | |
106 | \r | |
107 | ASSERT (HobStart != NULL);\r | |
108 | \r | |
109 | Hob.Raw = (UINT8 *) HobStart;\r | |
110 | //\r | |
111 | // Parse the HOB list until end of list or matching type is found.\r | |
112 | //\r | |
113 | while (!END_OF_HOB_LIST (Hob)) {\r | |
114 | if (Hob.Header->HobType == Type) {\r | |
115 | return Hob.Raw;\r | |
116 | }\r | |
117 | Hob.Raw = GET_NEXT_HOB (Hob);\r | |
118 | }\r | |
119 | return NULL;\r | |
120 | }\r | |
121 | \r | |
122 | /**\r | |
123 | Returns the first instance of a HOB type among the whole HOB list.\r | |
124 | \r | |
125 | This function searches the first instance of a HOB type among the whole HOB list. \r | |
126 | If there does not exist such HOB type in the HOB list, it will return NULL. \r | |
3e5c3238 | 127 | \r |
128 | If the pointer to the HOB list is NULL, then ASSERT().\r | |
738ec565 | 129 | \r |
130 | @param Type The HOB type to return.\r | |
131 | \r | |
132 | @return The next instance of a HOB type from the starting HOB.\r | |
133 | \r | |
134 | **/\r | |
135 | VOID *\r | |
136 | EFIAPI\r | |
137 | GetFirstHob (\r | |
138 | IN UINT16 Type\r | |
139 | )\r | |
140 | {\r | |
141 | VOID *HobList;\r | |
142 | \r | |
143 | HobList = GetHobList ();\r | |
144 | return GetNextHob (Type, HobList);\r | |
145 | }\r | |
146 | \r | |
147 | /**\r | |
3e5c3238 | 148 | Returns the next instance of the matched GUID HOB from the starting HOB.\r |
149 | \r | |
738ec565 | 150 | This function searches the first instance of a HOB from the starting HOB pointer. \r |
151 | Such HOB should satisfy two conditions: \r | |
152 | its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. \r | |
153 | If there does not exist such HOB from the starting HOB pointer, it will return NULL. \r | |
154 | Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()\r | |
58380e9c | 155 | to extract the data section and its size information, respectively.\r |
738ec565 | 156 | In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r |
157 | unconditionally: it returns HobStart back if HobStart itself meets the requirement;\r | |
158 | caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.\r | |
3e5c3238 | 159 | \r |
738ec565 | 160 | If Guid is NULL, then ASSERT().\r |
161 | If HobStart is NULL, then ASSERT().\r | |
162 | \r | |
163 | @param Guid The GUID to match with in the HOB list.\r | |
164 | @param HobStart A pointer to a Guid.\r | |
165 | \r | |
166 | @return The next instance of the matched GUID HOB from the starting HOB.\r | |
167 | \r | |
168 | **/\r | |
169 | VOID *\r | |
170 | EFIAPI\r | |
171 | GetNextGuidHob (\r | |
172 | IN CONST EFI_GUID *Guid,\r | |
173 | IN CONST VOID *HobStart\r | |
174 | )\r | |
175 | {\r | |
176 | EFI_PEI_HOB_POINTERS GuidHob;\r | |
177 | \r | |
178 | GuidHob.Raw = (UINT8 *) HobStart;\r | |
179 | while ((GuidHob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, GuidHob.Raw)) != NULL) {\r | |
180 | if (CompareGuid (Guid, &GuidHob.Guid->Name)) {\r | |
181 | break;\r | |
182 | }\r | |
183 | GuidHob.Raw = GET_NEXT_HOB (GuidHob);\r | |
184 | }\r | |
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 |
190 | \r | |
738ec565 | 191 | This function searches the first instance of a HOB among the whole HOB list. \r |
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 |
3e5c3238 | 197 | \r |
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 | |
209 | IN CONST EFI_GUID *Guid\r | |
210 | )\r | |
211 | {\r | |
212 | VOID *HobList;\r | |
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 |
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 |
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 | |
237 | EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;\r | |
238 | \r | |
239 | HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList ();\r | |
240 | \r | |
241 | return HandOffHob->BootMode;\r | |
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 | |
3e5c3238 | 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 | |
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 | |
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 | |
281 | \r | |
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 | |
3e5c3238 | 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 | |
3e5c3238 | 338 | Builds a customized HOB tagged with a GUID for identification and returns \r |
339 | the start address of GUID HOB data.\r | |
738ec565 | 340 | \r |
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 | |
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 | |
3e5c3238 | 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 | |
362 | IN CONST EFI_GUID *Guid,\r | |
363 | IN UINTN DataLength\r | |
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 | |
3e5c3238 | 374 | Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB \r |
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 |
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 | |
3e5c3238 | 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 | |
401 | IN CONST EFI_GUID *Guid,\r | |
402 | IN VOID *Data,\r | |
403 | IN UINTN DataLength\r | |
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 | |
3e5c3238 | 419 | \r |
738ec565 | 420 | If there is no additional space for HOB creation, then ASSERT().\r |
421 | \r | |
422 | @param BaseAddress The base address of the Firmware Volume.\r | |
423 | @param Length The size of the Firmware Volume in bytes.\r | |
424 | \r | |
425 | **/\r | |
426 | VOID\r | |
427 | EFIAPI\r | |
428 | BuildFvHob (\r | |
429 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
430 | IN UINT64 Length\r | |
431 | )\r | |
432 | {\r | |
433 | //\r | |
434 | // PEI HOB is read only for DXE phase\r | |
435 | //\r | |
436 | ASSERT (FALSE);\r | |
437 | }\r | |
438 | \r | |
07ad9b81 | 439 | /**\r |
440 | Builds a EFI_HOB_TYPE_FV2 HOB.\r | |
441 | \r | |
442 | This function builds a EFI_HOB_TYPE_FV2 HOB.\r | |
443 | It can only be invoked during PEI phase;\r | |
444 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
3e5c3238 | 445 | \r |
07ad9b81 | 446 | If there is no additional space for HOB creation, then ASSERT().\r |
447 | \r | |
448 | @param BaseAddress The base address of the Firmware Volume.\r | |
449 | @param Length The size of the Firmware Volume in bytes.\r | |
3e5c3238 | 450 | @param FvName The name of the Firmware Volume.\r |
07ad9b81 | 451 | @param FileName The name of the file.\r |
452 | \r | |
453 | **/\r | |
454 | VOID\r | |
455 | EFIAPI\r | |
456 | BuildFv2Hob (\r | |
457 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
458 | IN UINT64 Length,\r | |
459 | IN CONST EFI_GUID *FvName,\r | |
460 | IN CONST EFI_GUID *FileName\r | |
461 | )\r | |
462 | {\r | |
463 | ASSERT (FALSE);\r | |
464 | }\r | |
465 | \r | |
466 | \r | |
738ec565 | 467 | /**\r |
468 | Builds a Capsule Volume HOB.\r | |
469 | \r | |
470 | This function builds a Capsule Volume HOB.\r | |
471 | It can only be invoked during PEI phase;\r | |
472 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
3e5c3238 | 473 | \r |
c85cea80 | 474 | If the platform does not support Capsule Volume HOBs, then ASSERT().\r |
738ec565 | 475 | If there is no additional space for HOB creation, then ASSERT().\r |
476 | \r | |
477 | @param BaseAddress The base address of the Capsule Volume.\r | |
478 | @param Length The size of the Capsule Volume in bytes.\r | |
479 | \r | |
480 | **/\r | |
481 | VOID\r | |
482 | EFIAPI\r | |
483 | BuildCvHob (\r | |
484 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
485 | IN UINT64 Length\r | |
486 | )\r | |
487 | {\r | |
488 | //\r | |
489 | // PEI HOB is read only for DXE phase\r | |
490 | //\r | |
491 | ASSERT (FALSE);\r | |
492 | }\r | |
493 | \r | |
494 | /**\r | |
495 | Builds a HOB for the CPU.\r | |
496 | \r | |
497 | This function builds a HOB for the CPU.\r | |
498 | It can only be invoked during PEI phase;\r | |
499 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
3e5c3238 | 500 | \r |
738ec565 | 501 | If there is no additional space for HOB creation, then ASSERT().\r |
502 | \r | |
503 | @param SizeOfMemorySpace The maximum physical memory addressability of the processor.\r | |
504 | @param SizeOfIoSpace The maximum physical I/O addressability of the processor.\r | |
505 | \r | |
506 | **/\r | |
507 | VOID\r | |
508 | EFIAPI\r | |
509 | BuildCpuHob (\r | |
510 | IN UINT8 SizeOfMemorySpace,\r | |
511 | IN UINT8 SizeOfIoSpace\r | |
512 | )\r | |
513 | {\r | |
514 | //\r | |
515 | // PEI HOB is read only for DXE phase\r | |
516 | //\r | |
517 | ASSERT (FALSE);\r | |
518 | }\r | |
519 | \r | |
520 | /**\r | |
521 | Builds a HOB for the Stack.\r | |
522 | \r | |
523 | This function builds a HOB for the stack.\r | |
524 | It can only be invoked during PEI phase;\r | |
525 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
3e5c3238 | 526 | \r |
738ec565 | 527 | If there is no additional space for HOB creation, then ASSERT().\r |
528 | \r | |
529 | @param BaseAddress The 64 bit physical address of the Stack.\r | |
530 | @param Length The length of the stack in bytes.\r | |
531 | \r | |
532 | **/\r | |
533 | VOID\r | |
534 | EFIAPI\r | |
535 | BuildStackHob (\r | |
536 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
537 | IN UINT64 Length\r | |
538 | )\r | |
539 | {\r | |
540 | //\r | |
541 | // PEI HOB is read only for DXE phase\r | |
542 | //\r | |
543 | ASSERT (FALSE);\r | |
544 | }\r | |
545 | \r | |
546 | /**\r | |
547 | Builds a HOB for the BSP store.\r | |
548 | \r | |
549 | This function builds a HOB for BSP store.\r | |
550 | It can only be invoked during PEI phase;\r | |
551 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
3e5c3238 | 552 | \r |
738ec565 | 553 | If there is no additional space for HOB creation, then ASSERT().\r |
554 | \r | |
555 | @param BaseAddress The 64 bit physical address of the BSP.\r | |
556 | @param Length The length of the BSP store in bytes.\r | |
557 | @param MemoryType Type of memory allocated by this HOB.\r | |
558 | \r | |
559 | **/\r | |
560 | VOID\r | |
561 | EFIAPI\r | |
562 | BuildBspStoreHob (\r | |
563 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
564 | IN UINT64 Length,\r | |
565 | IN EFI_MEMORY_TYPE MemoryType\r | |
566 | )\r | |
567 | {\r | |
568 | //\r | |
569 | // PEI HOB is read only for DXE phase\r | |
570 | //\r | |
571 | ASSERT (FALSE);\r | |
572 | }\r | |
573 | \r | |
574 | /**\r | |
575 | Builds a HOB for the memory allocation.\r | |
576 | \r | |
577 | This function builds a HOB for the memory allocation.\r | |
578 | It can only be invoked during PEI phase;\r | |
579 | for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r | |
3e5c3238 | 580 | \r |
738ec565 | 581 | If there is no additional space for HOB creation, then ASSERT().\r |
582 | \r | |
583 | @param BaseAddress The 64 bit physical address of the memory.\r | |
584 | @param Length The length of the memory allocation in bytes.\r | |
585 | @param MemoryType Type of memory allocated by this HOB.\r | |
586 | \r | |
587 | **/\r | |
588 | VOID\r | |
589 | EFIAPI\r | |
590 | BuildMemoryAllocationHob (\r | |
591 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
592 | IN UINT64 Length,\r | |
593 | IN EFI_MEMORY_TYPE MemoryType\r | |
594 | )\r | |
595 | {\r | |
596 | //\r | |
597 | // PEI HOB is read only for DXE phase\r | |
598 | //\r | |
599 | ASSERT (FALSE);\r | |
600 | }\r |