aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2008-02-26 01:24:04 -0500
committerTony Luck <tony.luck@intel.com>2008-03-06 12:34:11 -0500
commit818c7e866f920b145424c2c46deda4b27c3fb316 (patch)
tree89261c628db7bf41c23a64d14364cdafee29e528
parent1ab40ec8f227a2b278a5151e60b7070a8bf5546d (diff)
[IA64] update efi region debugging to use MB, GB and TB as well as KB
When EFI_DEBUG is defined to a non-zero value in arch/ia64/kernel/efi.c, the efi memory regions are displayed. This patch enhances the display code in a few ways: 1. Use TB, GB and MB as well as KB as units. Although this introduces rounding errors (KB doesn't as size is always a multiple of 4Kb), it does make things a lot more readable. Also as the range is also shown, it is possible to note the exact size if it is important. In my experience, the size field is mostly useful for getting a general idea of the size of a region. On the rx2620 that I use, there actually is an 8TB region (though not backed by physical memory, and 8TB really is a lot more readable than 8589934592KB. 2. pad the size field with leading spaces to further improve readability ... ... ( 8MB) ... ( 928MB) ... ( 3MB) ... vs ... ... (8MB) ... (928MB) ... (3MB) ... 3. Pad the attr field out to 64bits using leading zeros, to further improve readability. ... mem05: type= 2, attr=0x0000000000000008, range=[0x0000000004000000-0x000000000481f000) ( 8MB) mem06: type= 7, attr=0x0000000000000008, range=[0x000000000481f000-0x000000003e876000) ( 928MB) mem07: type= 5, attr=0x8000000000000008, range=[0x000000003e876000-0x000000003eb8e000) ( 3MB) mem08: type= 4, attr=0x0000000000000008, range=[0x000000003eb8e000-0x000000003ee7a000) ( 2MB) ... ... mem05: type= 2, attr=0x8, range=[0x0000000004000000-0x000000000481f000) ( 8MB) mem06: type= 7, attr=0x8, range=[0x000000000481f000-0x000000003e876000) ( 928MB) mem07: type= 5, attr=0x8000000000000008, range=[0x000000003e876000-0x000000003eb8e000) ( 3MB) mem08: type= 4, attr=0x8, range=[0x000000003eb8e000-0x000000003ee7a000) ( 2MB) ... 4. Use %d instead of %u for the index field, as i is a signed int. N.B: This code is not compiled unless EFI_DEBUG is non 0. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/kernel/efi.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 78f50e81cd95..728d7247a1a6 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -543,12 +543,30 @@ efi_init (void)
543 for (i = 0, p = efi_map_start; p < efi_map_end; 543 for (i = 0, p = efi_map_start; p < efi_map_end;
544 ++i, p += efi_desc_size) 544 ++i, p += efi_desc_size)
545 { 545 {
546 const char *unit;
547 unsigned long size;
548
546 md = p; 549 md = p;
547 printk("mem%02u: type=%u, attr=0x%lx, " 550 size = md->num_pages << EFI_PAGE_SHIFT;
548 "range=[0x%016lx-0x%016lx) (%luMB)\n", 551
552 if ((size >> 40) > 0) {
553 size >>= 40;
554 unit = "TB";
555 } else if ((size >> 30) > 0) {
556 size >>= 30;
557 unit = "GB";
558 } else if ((size >> 20) > 0) {
559 size >>= 20;
560 unit = "MB";
561 } else {
562 size >>= 10;
563 unit = "KB";
564 }
565
566 printk("mem%02d: type=%2u, attr=0x%016lx, "
567 "range=[0x%016lx-0x%016lx) (%4lu%s)\n",
549 i, md->type, md->attribute, md->phys_addr, 568 i, md->type, md->attribute, md->phys_addr,
550 md->phys_addr + efi_md_size(md), 569 md->phys_addr + efi_md_size(md), size, unit);
551 md->num_pages >> (20 - EFI_PAGE_SHIFT));
552 } 570 }
553 } 571 }
554#endif 572#endif