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 fe2374d705d1..381f96b1c825 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h | |||
@@ -79,6 +79,8 @@ typedef unsigned long phys_t; | |||
79 | 79 | ||
80 | typedef struct { unsigned long pgprot; } pgprot_t; | 80 | typedef struct { unsigned long pgprot; } pgprot_t; |
81 | 81 | ||
82 | typedef struct page *pgtable_t; | ||
83 | |||
82 | #define pgd_val(x) ((x).pgd) | 84 | #define pgd_val(x) ((x).pgd) |
83 | #define pgprot_val(x) ((x).pgprot) | 85 | #define pgprot_val(x) ((x).pgprot) |
84 | 86 | ||
diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h index 4f3e62b02861..9062a6e72241 100644 --- a/include/asm-um/pgalloc.h +++ b/include/asm-um/pgalloc.h | |||
@@ -18,6 +18,7 @@ | |||
18 | set_pmd(pmd, __pmd(_PAGE_TABLE + \ | 18 | set_pmd(pmd, __pmd(_PAGE_TABLE + \ |
19 | ((unsigned long long)page_to_pfn(pte) << \ | 19 | ((unsigned long long)page_to_pfn(pte) << \ |
20 | (unsigned long long) PAGE_SHIFT))) | 20 | (unsigned long long) PAGE_SHIFT))) |
21 | #define pmd_pgtable(pmd) pmd_page(pmd) | ||
21 | 22 | ||
22 | /* | 23 | /* |
23 | * Allocate and free page tables. | 24 | * Allocate and free page tables. |
@@ -26,19 +27,24 @@ extern pgd_t *pgd_alloc(struct mm_struct *); | |||
26 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); | 27 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
27 | 28 | ||
28 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); | 29 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); |
29 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); | 30 | extern pgtable_t pte_alloc_one(struct mm_struct *, unsigned long); |
30 | 31 | ||
31 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) | 32 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
32 | { | 33 | { |
33 | free_page((unsigned long) pte); | 34 | free_page((unsigned long) pte); |
34 | } | 35 | } |
35 | 36 | ||
36 | static inline void pte_free(struct mm_struct *mm, struct page *pte) | 37 | static inline void pte_free(struct mm_struct *mm, pgtable_t pte) |
37 | { | 38 | { |
39 | pgtable_page_dtor(pte); | ||
38 | __free_page(pte); | 40 | __free_page(pte); |
39 | } | 41 | } |
40 | 42 | ||
41 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) | 43 | #define __pte_free_tlb(tlb,pte) \ |
44 | do { \ | ||
45 | pgtable_page_dtor(pte); \ | ||
46 | tlb_remove_page((tlb),(pte)); \ | ||
47 | } while (0) | ||
42 | 48 | ||
43 | #ifdef CONFIG_3_LEVEL_PGTABLES | 49 | #ifdef CONFIG_3_LEVEL_PGTABLES |
44 | 50 | ||