Skip to contentSkip to conversation

debug mmap: print actual ending addresses

PATCH New Elliott, Robert (Persistent Memory) 1 participant 1 message May 6, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 debug mmap: print actual ending addresses

For debug=mmap, print the actual ending address of each region rather than the address after the ending address.

This matches the lsmmap and lsefimmap command outputs.

Old:
mmap/efi/mmap.c:66: EFI memory region 0x1680000000-0x1c80000000: 0

lsefimmap output:
reserved 0000001680000000-0000001c7fffffff 00600000 24GiB UC WC WT WB NV

New:
mmap/efi/mmap.c:66: EFI memory region 0x1680000000-0x1c7fffffff: 0

---
 grub-core/mmap/efi/mmap.c     | 2 +-
 grub-core/mmap/i386/pc/mmap.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
grub-core/mmap/efi/mmap.c +1 -1
index bd495a1..e358708 100644
@@ -63,7 +63,7 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data,
       grub_dprintf ("mmap", "EFI memory region 0x%llx-0x%llx: %d\n",
 		    (unsigned long long) desc->physical_start,
 		    (unsigned long long) desc->physical_start
-		    + desc->num_pages * 4096, desc->type);
+		    + desc->num_pages * 4096 - 1, desc->type);
       switch (desc->type)
 	{
 	case GRUB_EFI_BOOT_SERVICES_CODE:
grub-core/mmap/i386/pc/mmap.c +1 -1
index 6099945..9de3801 100644
@@ -55,7 +55,7 @@ static int fill_hook (grub_uint64_t addr, grub_uint64_t size,
 		      grub_memory_type_t type, void *data)
 {
   struct grub_e820_mmap_entry **hookmmapcur = data;
-  grub_dprintf ("mmap", "mmap chunk %llx-%llx:%x\n", addr, addr + size, type);
+  grub_dprintf ("mmap", "mmap chunk %llx-%llx:%x\n", addr, addr + size - 1, type);
   (*hookmmapcur)->addr = addr;
   (*hookmmapcur)->len = size;
   (*hookmmapcur)->type = type;
Signature · 1 line
2.4.3