summaryrefslogtreecommitdiff
path: root/arch/arm/mm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r--arch/arm/mm/mmu.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 594d677b92c8..fd38662098cd 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -554,6 +554,7 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
const struct mem_type *type)
{
pmd_t *pmd = pmd_offset(pud, addr);
+ unsigned long pages_2m = 0, pages_4k = 0;
/*
* Try a section mapping - end, addr and phys must all be aligned
@@ -572,6 +573,8 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
phys += SECTION_SIZE;
} while (pmd++, addr += SECTION_SIZE, addr != end);
+ pages_2m += (end-addr) >> SECTION_SHIFT;
+
flush_pmd_entry(p);
} else {
/*
@@ -579,6 +582,12 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
* individual L1 entries.
*/
alloc_init_pte(pmd, addr, end, __phys_to_pfn(phys), type);
+ pages_4k += (end-addr) >> PAGE_SHIFT;
+ }
+
+ if ((addr < lowmem_limit) && (end < lowmem_limit)) {
+ update_page_count(PG_LEVEL_2M, pages_2m);
+ update_page_count(PG_LEVEL_4K, pages_4k);
}
}
@@ -757,7 +766,7 @@ static int __init early_vmalloc(char *arg)
}
early_param("vmalloc", early_vmalloc);
-static phys_addr_t lowmem_limit __initdata = 0;
+phys_addr_t lowmem_limit;
void __init sanity_check_meminfo(void)
{