aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 07:33:45 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:45 -0500
commitd18d6d65efc2f5a3ff9a41528fbcb716b2e32615 (patch)
treefebc36fa33bd172e22c5c7070564464c5da8e230
parentbd796ed0232a036f5ab14ac68d0a05f791ebcc3b (diff)
x86: early_ioremap(), debugging
add early_ioremap() debug printouts via the early_ioremap_debug boot option. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/mm/ioremap_32.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/x86/mm/ioremap_32.c b/arch/x86/mm/ioremap_32.c
index 4bcd5e065df4..30855c44818d 100644
--- a/arch/x86/mm/ioremap_32.c
+++ b/arch/x86/mm/ioremap_32.c
@@ -208,6 +208,17 @@ void iounmap(volatile void __iomem *addr)
208} 208}
209EXPORT_SYMBOL(iounmap); 209EXPORT_SYMBOL(iounmap);
210 210
211
212int __initdata early_ioremap_debug;
213
214static int __init early_ioremap_debug_setup(char *str)
215{
216 early_ioremap_debug = 1;
217
218 return 1;
219}
220__setup("early_ioremap_debug", early_ioremap_debug_setup);
221
211static __initdata int after_paging_init; 222static __initdata int after_paging_init;
212static __initdata unsigned long bm_pte[1024] 223static __initdata unsigned long bm_pte[1024]
213 __attribute__((aligned(PAGE_SIZE))); 224 __attribute__((aligned(PAGE_SIZE)));
@@ -226,6 +237,9 @@ void __init early_ioremap_init(void)
226{ 237{
227 unsigned long *pgd; 238 unsigned long *pgd;
228 239
240 if (early_ioremap_debug)
241 printk("early_ioremap_init()\n");
242
229 pgd = early_ioremap_pgd(fix_to_virt(FIX_BTMAP_BEGIN)); 243 pgd = early_ioremap_pgd(fix_to_virt(FIX_BTMAP_BEGIN));
230 *pgd = __pa(bm_pte) | _PAGE_TABLE; 244 *pgd = __pa(bm_pte) | _PAGE_TABLE;
231 memset(bm_pte, 0, sizeof(bm_pte)); 245 memset(bm_pte, 0, sizeof(bm_pte));
@@ -236,6 +250,9 @@ void __init early_ioremap_clear(void)
236{ 250{
237 unsigned long *pgd; 251 unsigned long *pgd;
238 252
253 if (early_ioremap_debug)
254 printk("early_ioremap_clear()\n");
255
239 pgd = early_ioremap_pgd(fix_to_virt(FIX_BTMAP_BEGIN)); 256 pgd = early_ioremap_pgd(fix_to_virt(FIX_BTMAP_BEGIN));
240 *pgd = 0; 257 *pgd = 0;
241 __flush_tlb_all(); 258 __flush_tlb_all();
@@ -303,6 +320,11 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
303 WARN_ON(system_state != SYSTEM_BOOTING); 320 WARN_ON(system_state != SYSTEM_BOOTING);
304 321
305 nesting = early_ioremap_nested; 322 nesting = early_ioremap_nested;
323 if (early_ioremap_debug) {
324 printk("early_ioremap(%08lx, %08lx) [%d] => ",
325 phys_addr, size, nesting);
326 dump_stack();
327 }
306 328
307 /* Don't allow wraparound or zero size */ 329 /* Don't allow wraparound or zero size */
308 last_addr = phys_addr + size - 1; 330 last_addr = phys_addr + size - 1;
@@ -343,6 +365,8 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
343 --idx; 365 --idx;
344 --nrpages; 366 --nrpages;
345 } 367 }
368 if (early_ioremap_debug)
369 printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0));
346 370
347 return (void*) (offset + fix_to_virt(idx0)); 371 return (void*) (offset + fix_to_virt(idx0));
348} 372}
@@ -358,6 +382,11 @@ void __init early_iounmap(void *addr, unsigned long size)
358 nesting = --early_ioremap_nested; 382 nesting = --early_ioremap_nested;
359 WARN_ON(nesting < 0); 383 WARN_ON(nesting < 0);
360 384
385 if (early_ioremap_debug) {
386 printk("early_iounmap(%p, %08lx) [%d]\n", addr, size, nesting);
387 dump_stack();
388 }
389
361 virt_addr = (unsigned long)addr; 390 virt_addr = (unsigned long)addr;
362 if (virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)) { 391 if (virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)) {
363 WARN_ON(1); 392 WARN_ON(1);