aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/page.h1
-rw-r--r--include/asm-mips/pgalloc.h17
2 files changed, 13 insertions, 5 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 635aa44d2290..8735aa0b8963 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -90,6 +90,7 @@ typedef struct { unsigned long pte; } pte_t;
90#define pte_val(x) ((x).pte) 90#define pte_val(x) ((x).pte)
91#define __pte(x) ((pte_t) { (x) } ) 91#define __pte(x) ((pte_t) { (x) } )
92#endif 92#endif
93typedef struct page *pgtable_t;
93 94
94/* 95/*
95 * For 3-level pagetables we defines these ourselves, for 2-level the 96 * For 3-level pagetables we defines these ourselves, for 2-level the
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index c4efeced8396..1275831dda29 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -20,10 +20,11 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
20} 20}
21 21
22static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, 22static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
23 struct page *pte) 23 pgtable_t pte)
24{ 24{
25 set_pmd(pmd, __pmd((unsigned long)page_address(pte))); 25 set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
26} 26}
27#define pmd_pgtable(pmd) pmd_page(pmd)
27 28
28/* 29/*
29 * Initialize a new pmd table with invalid pointers. 30 * Initialize a new pmd table with invalid pointers.
@@ -79,9 +80,10 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
79 struct page *pte; 80 struct page *pte;
80 81
81 pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER); 82 pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER);
82 if (pte) 83 if (pte) {
83 clear_highpage(pte); 84 clear_highpage(pte);
84 85 pgtable_page_ctor(pte);
86 }
85 return pte; 87 return pte;
86} 88}
87 89
@@ -90,12 +92,17 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
90 free_pages((unsigned long)pte, PTE_ORDER); 92 free_pages((unsigned long)pte, PTE_ORDER);
91} 93}
92 94
93static inline void pte_free(struct mm_struct *mm, struct page *pte) 95static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
94{ 96{
97 pgtable_page_dtor(pte);
95 __free_pages(pte, PTE_ORDER); 98 __free_pages(pte, PTE_ORDER);
96} 99}
97 100
98#define __pte_free_tlb(tlb, pte) tlb_remove_page((tlb), (pte)) 101#define __pte_free_tlb(tlb,pte) \
102do { \
103 pgtable_page_dtor(pte); \
104 tlb_remove_page((tlb), pte); \
105} while (0)
99 106
100#ifdef CONFIG_32BIT 107#ifdef CONFIG_32BIT
101 108