提交 58673b0c 编写于 作者: V vit9696

MmapDump: Fix OpenRuntime detect and print shrinked MMAP in any case

上级 9c609e5c
......@@ -50,7 +50,7 @@ UefiMain (
(UINT32) Address,
Status
));
} else if (FwRuntime->Revision != OC_FIRMWARE_RUNTIME_REVISION) {
} else if (!EFI_ERROR (Status) && FwRuntime->Revision != OC_FIRMWARE_RUNTIME_REVISION) {
DEBUG ((
DEBUG_WARN,
"MMDD: OpenRuntime has unexpected revision r%u instead of r%u\n",
......@@ -84,17 +84,17 @@ UefiMain (
OcSortMemoryMap (MemoryMapSize, MemoryMap, DescriptorSize);
DEBUG ((DEBUG_INFO, "MMDD: Dumping the original memory map\n"));
OcPrintMemoryMap (MemoryMapSize, MemoryMap, DescriptorSize);
DEBUG ((DEBUG_INFO, "MMDD: Dumping patched memory map\n"));
OcUpdateAttributes (Address, EfiRuntimeServicesCode, EFI_MEMORY_RO, EFI_MEMORY_XP);
Status = OcSplitMemoryMapByAttributes (OriginalSize, &MemoryMapSize, MemoryMap, DescriptorSize);
if (!EFI_ERROR (Status)) {
OcPrintMemoryMap (MemoryMapSize, MemoryMap, DescriptorSize);
DEBUG ((DEBUG_INFO, "MMDD: Dumping shrinked memory map\n"));
OcShrinkMemoryMap (&MemoryMapSize, MemoryMap, DescriptorSize);
DEBUG ((DEBUG_INFO, "MMDD: Dumping patched memory map\n"));
OcPrintMemoryMap (MemoryMapSize, MemoryMap, DescriptorSize);
} else {
DEBUG ((DEBUG_INFO, "MMDD: Cannot patch memory map - %r\n", Status));
}
DEBUG ((DEBUG_INFO, "MMDD: Dumping shrinked memory map\n"));
OcShrinkMemoryMap (&MemoryMapSize, MemoryMap, DescriptorSize);
OcPrintMemoryMap (MemoryMapSize, MemoryMap, DescriptorSize);
FreePool (MemoryMap);
} else {
DEBUG ((DEBUG_INFO, "MMDD: Unable to obtain memory map\n"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册