diff options
Diffstat (limited to 'include/asm-um')
-rw-r--r-- | include/asm-um/page.h | 2 | ||||
-rw-r--r-- | include/asm-um/pgalloc.h | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index fe2374d..381f96b 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h @@ -79,6 +79,8 @@ typedef unsigned long phys_t; typedef struct { unsigned long pgprot; } pgprot_t; +typedef struct page *pgtable_t; + #define pgd_val(x) ((x).pgd) #define pgprot_val(x) ((x).pgprot) diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h index 4f3e62b..9062a6e 100644 --- a/include/asm-um/pgalloc.h +++ b/include/asm-um/pgalloc.h @@ -18,6 +18,7 @@ set_pmd(pmd, __pmd(_PAGE_TABLE + \ ((unsigned long long)page_to_pfn(pte) << \ (unsigned long long) PAGE_SHIFT))) +#define pmd_pgtable(pmd) pmd_page(pmd) /* * Allocate and free page tables. @@ -26,19 +27,24 @@ extern pgd_t *pgd_alloc(struct mm_struct *); extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); -extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); +extern pgtable_t pte_alloc_one(struct mm_struct *, unsigned long); static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) { free_page((unsigned long) pte); } -static inline void pte_free(struct mm_struct *mm, struct page *pte) +static inline void pte_free(struct mm_struct *mm, pgtable_t pte) { + pgtable_page_dtor(pte); __free_page(pte); } -#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) +#define __pte_free_tlb(tlb,pte) \ +do { \ + pgtable_page_dtor(pte); \ + tlb_remove_page((tlb),(pte)); \ +} while (0) #ifdef CONFIG_3_LEVEL_PGTABLES |