summaryrefslogtreecommitdiff
path: root/arch/arm/mm/mmu.c
diff options
context:
space:
mode:
authorVinod Rex <vrex@nvidia.com>2011-10-07 11:30:35 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:18 -0800
commit3e6793f5b88bdbe33294bb50f7424c0a3af70b0a (patch)
tree472746a8ffb1d80d2ceb7376f578636d0b4ed2c2 /arch/arm/mm/mmu.c
parent25ff8cf8fae7de0a7a47afbe54ea4e298b93e66d (diff)
arm: mm: change_page_attr support
bug 865816 Adapted from x86 change_page_attr() implementation Change-Id: I398c9d460b841484de4fcfcac10ffffdf49a4a5a Reviewed-on: http://git-master/r/56769 Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Tested-by: Krishna Reddy <vdumpa@nvidia.com> Rebase-Id: Rddeccf358c948ba84af52316f084814ae53dca5e
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)
{