diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2012-10-18 13:54:15 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-12-12 16:48:52 +0100 |
commit | 970d032fec3f9687446595ee2569fb70b858a69f (patch) | |
tree | 18fdf6999d82569a14a41021328f459a7f4bbd97 /arch/mips/mm/pgtable-64.c | |
parent | f65aad41772f6a0022e9763fe06f47604449964c (diff) | |
download | op-kernel-dev-970d032fec3f9687446595ee2569fb70b858a69f.zip op-kernel-dev-970d032fec3f9687446595ee2569fb70b858a69f.tar.gz |
MIPS: Transparent Huge Pages support
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/pgtable-64.c')
-rw-r--r-- | arch/mips/mm/pgtable-64.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c index 2540779..ee331bb 100644 --- a/arch/mips/mm/pgtable-64.c +++ b/arch/mips/mm/pgtable-64.c @@ -11,6 +11,7 @@ #include <asm/fixmap.h> #include <asm/pgtable.h> #include <asm/pgalloc.h> +#include <asm/tlbflush.h> void pgd_init(unsigned long page) { @@ -61,6 +62,36 @@ void pmd_init(unsigned long addr, unsigned long pagetable) } #endif +#ifdef CONFIG_TRANSPARENT_HUGEPAGE + +void pmdp_splitting_flush(struct vm_area_struct *vma, + unsigned long address, + pmd_t *pmdp) +{ + if (!pmd_trans_splitting(*pmdp)) { + pmd_t pmd = pmd_mksplitting(*pmdp); + set_pmd_at(vma->vm_mm, address, pmdp, pmd); + } +} + +#endif + +pmd_t mk_pmd(struct page *page, pgprot_t prot) +{ + pmd_t pmd; + + pmd_val(pmd) = (page_to_pfn(page) << _PFN_SHIFT) | pgprot_val(prot); + + return pmd; +} + +void set_pmd_at(struct mm_struct *mm, unsigned long addr, + pmd_t *pmdp, pmd_t pmd) +{ + *pmdp = pmd; + flush_tlb_all(); +} + void __init pagetable_init(void) { unsigned long vaddr; |