Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80450
b: refs/heads/master
c: d18d6d6
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Jan 30, 2008
1 parent 147ecc7 commit 225791c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd796ed0232a036f5ab14ac68d0a05f791ebcc3b
refs/heads/master: d18d6d65efc2f5a3ff9a41528fbcb716b2e32615
29 changes: 29 additions & 0 deletions trunk/arch/x86/mm/ioremap_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ void iounmap(volatile void __iomem *addr)
}
EXPORT_SYMBOL(iounmap);


int __initdata early_ioremap_debug;

static int __init early_ioremap_debug_setup(char *str)
{
early_ioremap_debug = 1;

return 1;
}
__setup("early_ioremap_debug", early_ioremap_debug_setup);

static __initdata int after_paging_init;
static __initdata unsigned long bm_pte[1024]
__attribute__((aligned(PAGE_SIZE)));
Expand All @@ -226,6 +237,9 @@ void __init early_ioremap_init(void)
{
unsigned long *pgd;

if (early_ioremap_debug)
printk("early_ioremap_init()\n");

pgd = early_ioremap_pgd(fix_to_virt(FIX_BTMAP_BEGIN));
*pgd = __pa(bm_pte) | _PAGE_TABLE;
memset(bm_pte, 0, sizeof(bm_pte));
Expand All @@ -236,6 +250,9 @@ void __init early_ioremap_clear(void)
{
unsigned long *pgd;

if (early_ioremap_debug)
printk("early_ioremap_clear()\n");

pgd = early_ioremap_pgd(fix_to_virt(FIX_BTMAP_BEGIN));
*pgd = 0;
__flush_tlb_all();
Expand Down Expand Up @@ -303,6 +320,11 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
WARN_ON(system_state != SYSTEM_BOOTING);

nesting = early_ioremap_nested;
if (early_ioremap_debug) {
printk("early_ioremap(%08lx, %08lx) [%d] => ",
phys_addr, size, nesting);
dump_stack();
}

/* Don't allow wraparound or zero size */
last_addr = phys_addr + size - 1;
Expand Down Expand Up @@ -343,6 +365,8 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
--idx;
--nrpages;
}
if (early_ioremap_debug)
printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0));

return (void*) (offset + fix_to_virt(idx0));
}
Expand All @@ -358,6 +382,11 @@ void __init early_iounmap(void *addr, unsigned long size)
nesting = --early_ioremap_nested;
WARN_ON(nesting < 0);

if (early_ioremap_debug) {
printk("early_iounmap(%p, %08lx) [%d]\n", addr, size, nesting);
dump_stack();
}

virt_addr = (unsigned long)addr;
if (virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)) {
WARN_ON(1);
Expand Down

0 comments on commit 225791c

Please sign in to comment.