diff options
Diffstat (limited to 'arch/x86/mm/ioremap.c')
-rw-r--r-- | arch/x86/mm/ioremap.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 83ed74affba9..55e127f71ed9 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -487,7 +487,12 @@ static int __init early_ioremap_debug_setup(char *str) | |||
487 | early_param("early_ioremap_debug", early_ioremap_debug_setup); | 487 | early_param("early_ioremap_debug", early_ioremap_debug_setup); |
488 | 488 | ||
489 | static __initdata int after_paging_init; | 489 | static __initdata int after_paging_init; |
490 | static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss; | 490 | #define __FIXADDR_TOP (-PAGE_SIZE) |
491 | static pte_t bm_pte[(__fix_to_virt(FIX_DBGP_BASE) | ||
492 | ^ __fix_to_virt(FIX_BTMAP_BEGIN)) >> PMD_SHIFT | ||
493 | ? PAGE_SIZE / sizeof(pte_t) : 0] __page_aligned_bss; | ||
494 | #undef __FIXADDR_TOP | ||
495 | static __initdata pte_t *bm_ptep; | ||
491 | 496 | ||
492 | static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) | 497 | static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) |
493 | { | 498 | { |
@@ -502,6 +507,8 @@ static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) | |||
502 | 507 | ||
503 | static inline pte_t * __init early_ioremap_pte(unsigned long addr) | 508 | static inline pte_t * __init early_ioremap_pte(unsigned long addr) |
504 | { | 509 | { |
510 | if (!sizeof(bm_pte)) | ||
511 | return &bm_ptep[pte_index(addr)]; | ||
505 | return &bm_pte[pte_index(addr)]; | 512 | return &bm_pte[pte_index(addr)]; |
506 | } | 513 | } |
507 | 514 | ||
@@ -519,8 +526,14 @@ void __init early_ioremap_init(void) | |||
519 | slot_virt[i] = fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i); | 526 | slot_virt[i] = fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i); |
520 | 527 | ||
521 | pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); | 528 | pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); |
522 | memset(bm_pte, 0, sizeof(bm_pte)); | 529 | if (sizeof(bm_pte)) { |
523 | pmd_populate_kernel(&init_mm, pmd, bm_pte); | 530 | memset(bm_pte, 0, sizeof(bm_pte)); |
531 | pmd_populate_kernel(&init_mm, pmd, bm_pte); | ||
532 | } else { | ||
533 | bm_ptep = pte_offset_kernel(pmd, 0); | ||
534 | if (early_ioremap_debug) | ||
535 | printk(KERN_INFO "bm_ptep=%p\n", bm_ptep); | ||
536 | } | ||
524 | 537 | ||
525 | /* | 538 | /* |
526 | * The boot-ioremap range spans multiple pmds, for which | 539 | * The boot-ioremap range spans multiple pmds, for which |