26CHAR8 *mMemoryTypeStr[] = {
27 "EfiReservedMemoryType",
30 "EfiBootServicesCode",
31 "EfiBootServicesData",
32 "EfiRuntimeServicesCode",
33 "EfiRuntimeServicesData",
34 "EfiConventionalMemory",
36 "EfiACPIReclaimMemory",
39 "EfiMemoryMappedIOPortSpace",
41 "EfiPersistentMemory",
45CHAR8 *mResource_Type_List[] = {
46 "EFI_RESOURCE_SYSTEM_MEMORY ",
47 "EFI_RESOURCE_MEMORY_MAPPED_IO ",
49 "EFI_RESOURCE_FIRMWARE_DEVICE ",
50 "EFI_RESOURCE_MEMORY_MAPPED_IO_PORT ",
51 "EFI_RESOURCE_MEMORY_RESERVED ",
52 "EFI_RESOURCE_IO_RESERVED ",
53 "EFI_RESOURCE_MAX_MEMORY_TYPE "
76 StartAddr = DataStart;
77 for (Index1 = 0; Index1 * ROW_LIMITER < DataSize; Index1++) {
78 DEBUG ((ErrorLevel,
" 0x%04p:", (DataStart - StartAddr)));
79 for (Index2 = 0; (Index2 < ROW_LIMITER) && (Index1 * ROW_LIMITER + Index2 < DataSize); Index2++) {
80 DEBUG ((ErrorLevel,
" %02x", *DataStart));
84 DEBUG ((ErrorLevel,
"\n"));
104 DEBUG ((DEBUG_ERROR,
" Invalid HOB. Full hex dump in below:\n"));
105 PrintHex (DEBUG_ERROR, HobStart, HobLength);
124 Hob.Raw = (UINT8 *)HobStart;
125 if (HobLength <
sizeof (*Hob.HandoffInformationTable)) {
129 DEBUG ((DEBUG_INFO,
" BootMode = 0x%x\n", Hob.HandoffInformationTable->
BootMode));
130 DEBUG ((DEBUG_INFO,
" EfiMemoryTop = 0x%lx\n", Hob.HandoffInformationTable->
EfiMemoryTop));
131 DEBUG ((DEBUG_INFO,
" EfiMemoryBottom = 0x%lx\n", Hob.HandoffInformationTable->
EfiMemoryBottom));
134 DEBUG ((DEBUG_INFO,
" EfiEndOfHobList = 0x%lx\n", Hob.HandoffInformationTable->
EfiEndOfHobList));
152 Hob.Raw = (UINT8 *)HobStart;
155 if (HobLength <
sizeof (*Hob.MemoryAllocationStack)) {
159 DEBUG ((DEBUG_INFO,
" Type = EFI_HOB_MEMORY_ALLOCATION_STACK\n"));
161 if (HobLength <
sizeof (*Hob.MemoryAllocationBspStore)) {
165 DEBUG ((DEBUG_INFO,
" Type = EFI_HOB_MEMORY_ALLOCATION_BSP_STORE\n"));
167 if (HobLength <
sizeof (*Hob.MemoryAllocationModule)) {
171 DEBUG ((DEBUG_INFO,
" Type = EFI_HOB_MEMORY_ALLOCATION_MODULE\n"));
172 DEBUG ((DEBUG_INFO,
" ModuleName = %g\n", &Hob.MemoryAllocationModule->
ModuleName));
173 DEBUG ((DEBUG_INFO,
" EntryPoint = 0x%lx\n", Hob.MemoryAllocationModule->
EntryPoint));
175 if (HobLength <
sizeof (*Hob.MemoryAllocation)) {
179 DEBUG ((DEBUG_INFO,
" Type = EFI_HOB_TYPE_MEMORY_ALLOCATION\n"));
203 Hob.Raw = (UINT8 *)HobStart;
204 ASSERT (HobLength >=
sizeof (*Hob.ResourceDescriptor));
206 DEBUG ((DEBUG_INFO,
" ResourceType = %a\n", mResource_Type_List[Hob.ResourceDescriptor->
ResourceType]));
208 DEBUG ((DEBUG_INFO,
" Owner = %g\n", &Hob.ResourceDescriptor->
Owner));
212 DEBUG ((DEBUG_INFO,
" PhysicalStart = 0x%lx\n", Hob.ResourceDescriptor->
PhysicalStart));
232 Hob.Raw = (UINT8 *)HobStart;
233 ASSERT (HobLength >=
sizeof (*Hob.Guid));
235 DataLength = GET_GUID_HOB_DATA_SIZE (Hob.Raw);
237 DEBUG ((DEBUG_INFO,
" Name = %g\n", &Hob.Guid->
Name));
238 DEBUG ((DEBUG_INFO,
" DataLength = 0x%x\n", DataLength));
239 PrintHex (DEBUG_VERBOSE, GET_GUID_HOB_DATA (Hob.Raw), DataLength);
257 Hob.Raw = (UINT8 *)HobStart;
258 ASSERT (HobLength >=
sizeof (*Hob.FirmwareVolume));
260 DEBUG ((DEBUG_INFO,
" BaseAddress = 0x%lx\n", Hob.FirmwareVolume->
BaseAddress));
261 DEBUG ((DEBUG_INFO,
" Length = 0x%lx\n", Hob.FirmwareVolume->
Length));
279 Hob.Raw = (UINT8 *)HobStart;
280 ASSERT (HobLength >=
sizeof (*Hob.Cpu));
300 UINT16 AllocationSize;
302 Hob.Raw = (UINT8 *)HobStart;
303 ASSERT (HobLength >=
sizeof (*Hob.Pool));
306 DEBUG ((DEBUG_INFO,
" AllocationSize = 0x%lx\n", AllocationSize));
327 Hob.Raw = (UINT8 *)HobStart;
328 ASSERT (HobLength >=
sizeof (*Hob.FirmwareVolume2));
330 DEBUG ((DEBUG_INFO,
" BaseAddress = 0x%lx\n", Hob.FirmwareVolume2->
BaseAddress));
331 DEBUG ((DEBUG_INFO,
" Length = 0x%lx\n", Hob.FirmwareVolume2->
Length));
332 DEBUG ((DEBUG_INFO,
" FvName = %g\n", &Hob.FirmwareVolume2->
FvName));
333 DEBUG ((DEBUG_INFO,
" FileName = %g\n", &Hob.FirmwareVolume2->
FileName));
351 Hob.Raw = (UINT8 *)HobStart;
352 ASSERT (HobLength >=
sizeof (*Hob.Capsule));
355 DEBUG ((DEBUG_INFO,
" Length = 0x%lx\n", Hob.Capsule->Length));
373 Hob.Raw = (UINT8 *)HobStart;
374 ASSERT (HobLength >=
sizeof (*Hob.FirmwareVolume3));
376 DEBUG ((DEBUG_INFO,
" BaseAddress = 0x%lx\n", Hob.FirmwareVolume3->
BaseAddress));
377 DEBUG ((DEBUG_INFO,
" Length = 0x%lx\n", Hob.FirmwareVolume3->
Length));
379 DEBUG ((DEBUG_INFO,
" ExtractedFv = %a\n", (Hob.FirmwareVolume3->
ExtractedFv ?
"True" :
"False")));
380 DEBUG ((DEBUG_INFO,
" FvName = %g\n", &Hob.FirmwareVolume3->
FvName));
381 DEBUG ((DEBUG_INFO,
" FileName = %g\n", &Hob.FirmwareVolume3->
FileName));
392 { EFI_HOB_TYPE_GUID_EXTENSION,
"EFI_HOB_TYPE_GUID_EXTENSION",
PrintGuidHob },
393 { EFI_HOB_TYPE_FV,
"EFI_HOB_TYPE_FV",
PrintFvHob },
394 { EFI_HOB_TYPE_CPU,
"EFI_HOB_TYPE_CPU",
PrintCpuHob },
396 { EFI_HOB_TYPE_FV2,
"EFI_HOB_TYPE_FV2",
PrintFv2Hob },
397 { EFI_HOB_TYPE_UEFI_CAPSULE,
"EFI_HOB_TYPE_UEFI_CAPSULE",
PrintCapsuleHob },
398 { EFI_HOB_TYPE_FV3,
"EFI_HOB_TYPE_FV3",
PrintFv3Hob }
420 ASSERT (HobStart !=
NULL);
422 Hob.Raw = (UINT8 *)HobStart;
423 DEBUG ((DEBUG_INFO,
"Print all Hob information from Hob 0x%p\n", Hob.Raw));
430 while (!END_OF_HOB_LIST (Hob)) {
434 for (Index = 0; Index <
ARRAY_SIZE (mHobHandles); Index++) {
435 if (Hob.Header->
HobType == mHobHandles[Index].Type) {
436 DEBUG ((DEBUG_INFO,
"HOB[%d]: Type = %a, Offset = 0x%p, Length = 0x%x\n", Count, mHobHandles[Index].Name, (Hob.Raw - (UINT8 *)HobStart), Hob.Header->
HobLength));
442 DEBUG ((DEBUG_INFO,
"HOB[%d]: Type = %d, Offset = 0x%p, Length = 0x%x\n", Count, Hob.Header->
HobType, (Hob.Raw - (UINT8 *)HobStart), Hob.Header->
HobLength));
448 if (PrintHandler !=
NULL) {
449 Status = PrintHandler (Hob.Raw, Hob.Header->
HobLength);
455 if ((PrintHandler ==
NULL) || EFI_ERROR (Status)) {
457 mHobHandles[Index].PrintHandler (Hob.Raw, Hob.Header->
HobLength);
459 DEBUG ((DEBUG_INFO,
" Unkown Hob type, full hex dump in below:\n"));
465 Hob.Raw = GET_NEXT_HOB (Hob);
468 DEBUG ((DEBUG_INFO,
"There are totally %d Hobs, the End Hob address is %p\n", Count, Hob.Raw));
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
BOOLEAN EFIAPI IsZeroGuid(IN CONST GUID *Guid)
EFI_STATUS PrintInvalidHob(IN VOID *HobStart, IN UINT16 HobLength)
VOID EFIAPI PrintHobList(IN CONST VOID *HobStart, IN HOB_PRINT_HANDLER PrintHandler)
EFI_STATUS PrintCapsuleHob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintMemoryAllocationHob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintCpuHob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintHex(IN UINT32 ErrorLevel, IN UINT8 *DataStart, IN UINT16 DataSize)
EFI_STATUS PrintGuidHob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintHandOffHob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintMemoryPoolHob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintFv2Hob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintFvHob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintResourceDiscriptorHob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS PrintFv3Hob(IN VOID *HobStart, IN UINT16 HobLength)
EFI_STATUS(* HOB_PRINT_HANDLER)(IN VOID *Hob, IN UINT16 HobLength)
#define ARRAY_SIZE(Array)
#define RETURN_INVALID_PARAMETER
#define DEBUG(Expression)
EFI_PHYSICAL_ADDRESS BaseAddress
UINT32 AuthenticationStatus
EFI_PHYSICAL_ADDRESS BaseAddress
EFI_PHYSICAL_ADDRESS BaseAddress
EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
EFI_PHYSICAL_ADDRESS EfiMemoryTop
EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop
EFI_PHYSICAL_ADDRESS EfiMemoryBottom
EFI_PHYSICAL_ADDRESS EfiEndOfHobList
EFI_PHYSICAL_ADDRESS MemoryBaseAddress
EFI_MEMORY_TYPE MemoryType
EFI_PHYSICAL_ADDRESS EntryPoint
EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
EFI_PHYSICAL_ADDRESS PhysicalStart
EFI_RESOURCE_TYPE ResourceType
EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
EFI_PHYSICAL_ADDRESS BaseAddress