aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-03-15 03:59:19 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-15 05:01:59 -0400
commitc61cf4cfe7c73c7aa62dde3ff82cd475b9c41481 (patch)
treee94be758a35e26c98b51aadbb64720e914bad048 /arch/x86/kernel/e820.c
parent6d7942dc2a70a7e74c352107b150265602671588 (diff)
x86: print out more info in e820_update_range()
Impact: help debug e820 bugs Try to print out more info, to catch wrong call parameters. Signed-off-by: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <49BCB557.3030000@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r--arch/x86/kernel/e820.c56
1 files changed, 35 insertions, 21 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 0c34ff49ff4d..fb638d9ce6d2 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -131,6 +131,31 @@ void __init e820_add_region(u64 start, u64 size, int type)
131 __e820_add_region(&e820, start, size, type); 131 __e820_add_region(&e820, start, size, type);
132} 132}
133 133
134static void __init e820_print_type(u32 type)
135{
136 switch (type) {
137 case E820_RAM:
138 case E820_RESERVED_KERN:
139 printk(KERN_CONT "(usable)");
140 break;
141 case E820_RESERVED:
142 printk(KERN_CONT "(reserved)");
143 break;
144 case E820_ACPI:
145 printk(KERN_CONT "(ACPI data)");
146 break;
147 case E820_NVS:
148 printk(KERN_CONT "(ACPI NVS)");
149 break;
150 case E820_UNUSABLE:
151 printk(KERN_CONT "(unusable)");
152 break;
153 default:
154 printk(KERN_CONT "type %u", type);
155 break;
156 }
157}
158
134void __init e820_print_map(char *who) 159void __init e820_print_map(char *who)
135{ 160{
136 int i; 161 int i;
@@ -140,27 +165,8 @@ void __init e820_print_map(char *who)
140 (unsigned long long) e820.map[i].addr, 165 (unsigned long long) e820.map[i].addr,
141 (unsigned long long) 166 (unsigned long long)
142 (e820.map[i].addr + e820.map[i].size)); 167 (e820.map[i].addr + e820.map[i].size));
143 switch (e820.map[i].type) { 168 e820_print_type(e820.map[i].type);
144 case E820_RAM: 169 printk(KERN_CONT "\n");
145 case E820_RESERVED_KERN:
146 printk(KERN_CONT "(usable)\n");
147 break;
148 case E820_RESERVED:
149 printk(KERN_CONT "(reserved)\n");
150 break;
151 case E820_ACPI:
152 printk(KERN_CONT "(ACPI data)\n");
153 break;
154 case E820_NVS:
155 printk(KERN_CONT "(ACPI NVS)\n");
156 break;
157 case E820_UNUSABLE:
158 printk("(unusable)\n");
159 break;
160 default:
161 printk(KERN_CONT "type %u\n", e820.map[i].type);
162 break;
163 }
164 } 170 }
165} 171}
166 172
@@ -437,6 +443,14 @@ static u64 __init __e820_update_range(struct e820map *e820x, u64 start,
437 size = ULLONG_MAX - start; 443 size = ULLONG_MAX - start;
438 444
439 end = start + size; 445 end = start + size;
446 printk(KERN_DEBUG "e820 update range: %016Lx - %016Lx ",
447 (unsigned long long) start,
448 (unsigned long long) end);
449 e820_print_type(old_type);
450 printk(KERN_CONT " ==> ");
451 e820_print_type(new_type);
452 printk(KERN_CONT "\n");
453
440 for (i = 0; i < e820x->nr_map; i++) { 454 for (i = 0; i < e820x->nr_map; i++) {
441 struct e820entry *ei = &e820x->map[i]; 455 struct e820entry *ei = &e820x->map[i];
442 u64 final_start, final_end; 456 u64 final_start, final_end;