aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820_64.c
diff options
context:
space:
mode:
authorYinghai Lu <Yinghai.Lu@Sun.COM>2008-02-01 11:49:41 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-01 11:49:41 -0500
commit25eff8d4cd7400372d490c392519c5b0064c03f7 (patch)
tree1d07ccfab1f58898dee245d48e7cca3c061b73cc /arch/x86/kernel/e820_64.c
parent24e1c13c93cbdd05e4b7ea921c0050b036555adc (diff)
x86_64: add debug name for early_res
helps debugging problems in this rather murky area of code. Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/e820_64.c')
-rw-r--r--arch/x86/kernel/e820_64.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
index c617174e8963..b74e83b214cc 100644
--- a/arch/x86/kernel/e820_64.c
+++ b/arch/x86/kernel/e820_64.c
@@ -54,30 +54,33 @@ static unsigned long __initdata end_user_pfn = MAXMEM>>PAGE_SHIFT;
54 54
55struct early_res { 55struct early_res {
56 unsigned long start, end; 56 unsigned long start, end;
57 char name[16];
57}; 58};
58static struct early_res early_res[MAX_EARLY_RES] __initdata = { 59static struct early_res early_res[MAX_EARLY_RES] __initdata = {
59 { 0, PAGE_SIZE }, /* BIOS data page */ 60 { 0, PAGE_SIZE, "BIOS data page" }, /* BIOS data page */
60#ifdef CONFIG_SMP 61#ifdef CONFIG_SMP
61 { SMP_TRAMPOLINE_BASE, SMP_TRAMPOLINE_BASE + 2*PAGE_SIZE }, 62 { SMP_TRAMPOLINE_BASE, SMP_TRAMPOLINE_BASE + 2*PAGE_SIZE, "SMP_TRAMPOLINE" },
62#endif 63#endif
63 {} 64 {}
64}; 65};
65 66
66void __init reserve_early(unsigned long start, unsigned long end) 67void __init reserve_early(unsigned long start, unsigned long end, char *name)
67{ 68{
68 int i; 69 int i;
69 struct early_res *r; 70 struct early_res *r;
70 for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) { 71 for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
71 r = &early_res[i]; 72 r = &early_res[i];
72 if (end > r->start && start < r->end) 73 if (end > r->start && start < r->end)
73 panic("Overlapping early reservations %lx-%lx to %lx-%lx\n", 74 panic("Overlapping early reservations %lx-%lx %s to %lx-%lx %s\n",
74 start, end, r->start, r->end); 75 start, end - 1, name?name:"", r->start, r->end - 1, r->name);
75 } 76 }
76 if (i >= MAX_EARLY_RES) 77 if (i >= MAX_EARLY_RES)
77 panic("Too many early reservations"); 78 panic("Too many early reservations");
78 r = &early_res[i]; 79 r = &early_res[i];
79 r->start = start; 80 r->start = start;
80 r->end = end; 81 r->end = end;
82 if (name)
83 strncpy(r->name, name, sizeof(r->name) - 1);
81} 84}
82 85
83void __init early_res_to_bootmem(void) 86void __init early_res_to_bootmem(void)
@@ -85,6 +88,8 @@ void __init early_res_to_bootmem(void)
85 int i; 88 int i;
86 for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) { 89 for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
87 struct early_res *r = &early_res[i]; 90 struct early_res *r = &early_res[i];
91 printk(KERN_INFO "early res: %d [%lx-%lx] %s\n", i,
92 r->start, r->end - 1, r->name);
88 reserve_bootmem_generic(r->start, r->end - r->start); 93 reserve_bootmem_generic(r->start, r->end - r->start);
89 } 94 }
90} 95}