]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
lmb: Rework lmb_dump_all() output
authorMichael Ellerman <michael@ellerman.id.au>
Wed, 14 Jan 2009 20:46:02 +0000 (20:46 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 11 Feb 2009 02:38:00 +0000 (13:38 +1100)
The lmb_dump_all() output didn't include the RMO size, which is
interesting on powerpc. The output was also a bit spacey and not well
aligned, and didn't show you the end addresses.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
lib/lmb.c

index 97e547037084dc22fc3fd93f5fd2aacd7419db02..e4a6482d8b26e5034805a401905480974e6dcd8c 100644 (file)
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -29,33 +29,33 @@ static int __init early_lmb(char *p)
 }
 early_param("lmb", early_lmb);
 
-void lmb_dump_all(void)
+static void lmb_dump(struct lmb_region *region, char *name)
 {
-       unsigned long i;
+       unsigned long long base, size;
+       int i;
+
+       pr_info(" %s.cnt  = 0x%lx\n", name, region->cnt);
+
+       for (i = 0; i < region->cnt; i++) {
+               base = region->region[i].base;
+               size = region->region[i].size;
+
+               pr_info(" %s[0x%x]\t0x%016llx - 0x%016llx, 0x%llx bytes\n",
+                   name, i, base, base + size - 1, size);
+       }
+}
 
+void lmb_dump_all(void)
+{
        if (!lmb_debug)
                return;
 
-       pr_info("lmb_dump_all:\n");
-       pr_info("    memory.cnt           = 0x%lx\n", lmb.memory.cnt);
-       pr_info("    memory.size                  = 0x%llx\n",
-           (unsigned long long)lmb.memory.size);
-       for (i=0; i < lmb.memory.cnt ;i++) {
-               pr_info("    memory.region[0x%lx].base       = 0x%llx\n",
-                   i, (unsigned long long)lmb.memory.region[i].base);
-               pr_info("                     .size     = 0x%llx\n",
-                   (unsigned long long)lmb.memory.region[i].size);
-       }
+       pr_info("LMB configuration:\n");
+       pr_info(" rmo_size    = 0x%llx\n", (unsigned long long)lmb.rmo_size);
+       pr_info(" memory.size = 0x%llx\n", (unsigned long long)lmb.memory.size);
 
-       pr_info("    reserved.cnt         = 0x%lx\n", lmb.reserved.cnt);
-       pr_info("    reserved.size        = 0x%llx\n",
-           (unsigned long long)lmb.memory.size);
-       for (i=0; i < lmb.reserved.cnt ;i++) {
-               pr_info("    reserved.region[0x%lx].base       = 0x%llx\n",
-                   i, (unsigned long long)lmb.reserved.region[i].base);
-               pr_info("                     .size     = 0x%llx\n",
-                   (unsigned long long)lmb.reserved.region[i].size);
-       }
+       lmb_dump(&lmb.memory, "memory");
+       lmb_dump(&lmb.reserved, "reserved");
 }
 
 static unsigned long lmb_addrs_overlap(u64 base1, u64 size1, u64 base2,