grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] debug mmap: print actual ending addresses


From: Elliott, Robert (Persistent Memory)
Subject: [PATCH] debug mmap: print actual ending addresses
Date: Fri, 6 May 2016 23:13:47 +0000

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(-)

diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c
index bd495a1..e358708 100644
--- a/grub-core/mmap/efi/mmap.c
+++ b/grub-core/mmap/efi/mmap.c
@@ -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:
diff --git a/grub-core/mmap/i386/pc/mmap.c b/grub-core/mmap/i386/pc/mmap.c
index 6099945..9de3801 100644
--- a/grub-core/mmap/i386/pc/mmap.c
+++ b/grub-core/mmap/i386/pc/mmap.c
@@ -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;
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]