diff options
Diffstat (limited to 'lib/lmb.c')
-rw-r--r-- | lib/lmb.c | 33 |
1 files changed, 22 insertions, 11 deletions
@@ -19,31 +19,42 @@ | |||
19 | 19 | ||
20 | struct lmb lmb; | 20 | struct lmb lmb; |
21 | 21 | ||
22 | static int lmb_debug; | ||
23 | |||
24 | static int __init early_lmb(char *p) | ||
25 | { | ||
26 | if (p && strstr(p, "debug")) | ||
27 | lmb_debug = 1; | ||
28 | return 0; | ||
29 | } | ||
30 | early_param("lmb", early_lmb); | ||
31 | |||
22 | void lmb_dump_all(void) | 32 | void lmb_dump_all(void) |
23 | { | 33 | { |
24 | #ifdef DEBUG | ||
25 | unsigned long i; | 34 | unsigned long i; |
26 | 35 | ||
27 | pr_debug("lmb_dump_all:\n"); | 36 | if (!lmb_debug) |
28 | pr_debug(" memory.cnt = 0x%lx\n", lmb.memory.cnt); | 37 | return; |
29 | pr_debug(" memory.size = 0x%llx\n", | 38 | |
39 | pr_info("lmb_dump_all:\n"); | ||
40 | pr_info(" memory.cnt = 0x%lx\n", lmb.memory.cnt); | ||
41 | pr_info(" memory.size = 0x%llx\n", | ||
30 | (unsigned long long)lmb.memory.size); | 42 | (unsigned long long)lmb.memory.size); |
31 | for (i=0; i < lmb.memory.cnt ;i++) { | 43 | for (i=0; i < lmb.memory.cnt ;i++) { |
32 | pr_debug(" memory.region[0x%x].base = 0x%llx\n", | 44 | pr_info(" memory.region[0x%lx].base = 0x%llx\n", |
33 | i, (unsigned long long)lmb.memory.region[i].base); | 45 | i, (unsigned long long)lmb.memory.region[i].base); |
34 | pr_debug(" .size = 0x%llx\n", | 46 | pr_info(" .size = 0x%llx\n", |
35 | (unsigned long long)lmb.memory.region[i].size); | 47 | (unsigned long long)lmb.memory.region[i].size); |
36 | } | 48 | } |
37 | 49 | ||
38 | pr_debug(" reserved.cnt = 0x%lx\n", lmb.reserved.cnt); | 50 | pr_info(" reserved.cnt = 0x%lx\n", lmb.reserved.cnt); |
39 | pr_debug(" reserved.size = 0x%lx\n", lmb.reserved.size); | 51 | pr_info(" reserved.size = 0x%lx\n", lmb.reserved.size); |
40 | for (i=0; i < lmb.reserved.cnt ;i++) { | 52 | for (i=0; i < lmb.reserved.cnt ;i++) { |
41 | pr_debug(" reserved.region[0x%x].base = 0x%llx\n", | 53 | pr_info(" reserved.region[0x%lx].base = 0x%llx\n", |
42 | i, (unsigned long long)lmb.reserved.region[i].base); | 54 | i, (unsigned long long)lmb.reserved.region[i].base); |
43 | pr_debug(" .size = 0x%llx\n", | 55 | pr_info(" .size = 0x%llx\n", |
44 | (unsigned long long)lmb.reserved.region[i].size); | 56 | (unsigned long long)lmb.reserved.region[i].size); |
45 | } | 57 | } |
46 | #endif /* DEBUG */ | ||
47 | } | 58 | } |
48 | 59 | ||
49 | static unsigned long lmb_addrs_overlap(u64 base1, u64 size1, u64 base2, | 60 | static unsigned long lmb_addrs_overlap(u64 base1, u64 size1, u64 base2, |