Fix some small pointer issues.

This commit is contained in:
Curle 2019-08-19 23:50:59 +01:00
parent f980acc136
commit 9308aaa300

View File

@ -143,7 +143,7 @@ size_t FetchInstalledMemory() {
}
// From Syncboot/memory.c
static const char Memory_Segments[16][27] = {
static const char Memory_Segments[20][27] = {
"EfiReservedMemoryType ",
"EfiLoaderCode ",
"EfiLoaderData ",
@ -173,17 +173,17 @@ void PrintMemoryMap() {
printf(L"MemMapSize: %qx, MemMapDescriptorSize: %1u, MemMapDescriptorVersion: %u\r\n", Memory_Info.MemoryMapSize, Memory_Info.MemoryMapDescriptorSize, Memory_Info.MemoryMapDescriptorVersion);
printf("MemMapSize: %qx, MemMapDescriptorSize: %1u, MemMapDescriptorVersion: %u\r\n", Memory_Info.MemoryMapSize, Memory_Info.MemoryMapDescriptorSize, Memory_Info.MemoryMapDescriptorVersion);
for (Piece = Memory_Info.MemoryMap;
Piece < (EFI_MEMORY_DESCRIPTOR*)((uint8_t*)Memory_Info.MemoryMap + Memory_Info.MemoryMapSize);
Piece = (EFI_MEMORY_DESCRIPTOR*)((UINT8*)Piece + Memory_Info.MemoryMapDescriptorSize)) {
if (line % 20 == 0) {
printf(L"# Memory Type Phys Addr Start Num Of Pages Attr\r\n");
printf("# Memory Type Phys Addr Start Num Of Pages Attr\r\n");
}
printf(L"%2hu: %s 0x%016qx 0x%qx 0x%qx\r\n", line, Memory_Segments[Piece->Type], Piece->PhysicalStart, Piece->NumberOfPages, Piece->Attribute);
printf("%2hu: %s 0x%016qx 0x%qx 0x%qx\r\n", line, Memory_Segments[Piece->Type], Piece->PhysicalStart, Piece->NumberOfPages, Piece->Attribute);
line++;
}
}