diff options
Diffstat (limited to 'include/asm-um/pgtable-3level.h')
-rw-r--r-- | include/asm-um/pgtable-3level.h | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h index 65e8bfc55fc4..786c25727289 100644 --- a/include/asm-um/pgtable-3level.h +++ b/include/asm-um/pgtable-3level.h | |||
@@ -57,35 +57,6 @@ static inline int pgd_newpage(pgd_t pgd) | |||
57 | 57 | ||
58 | static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } | 58 | static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } |
59 | 59 | ||
60 | |||
61 | #define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE)) | ||
62 | |||
63 | static inline pte_t pte_mknewprot(pte_t pte) | ||
64 | { | ||
65 | pte_set_bits(pte, _PAGE_NEWPROT); | ||
66 | return(pte); | ||
67 | } | ||
68 | |||
69 | static inline pte_t pte_mknewpage(pte_t pte) | ||
70 | { | ||
71 | pte_set_bits(pte, _PAGE_NEWPAGE); | ||
72 | return(pte); | ||
73 | } | ||
74 | |||
75 | static inline void set_pte(pte_t *pteptr, pte_t pteval) | ||
76 | { | ||
77 | pte_copy(*pteptr, pteval); | ||
78 | |||
79 | /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so | ||
80 | * fix_range knows to unmap it. _PAGE_NEWPROT is specific to | ||
81 | * mapped pages. | ||
82 | */ | ||
83 | |||
84 | *pteptr = pte_mknewpage(*pteptr); | ||
85 | if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); | ||
86 | } | ||
87 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | ||
88 | |||
89 | #define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) | 60 | #define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) |
90 | 61 | ||
91 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | 62 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) |
@@ -98,14 +69,11 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
98 | return pmd; | 69 | return pmd; |
99 | } | 70 | } |
100 | 71 | ||
101 | static inline void pmd_free(pmd_t *pmd){ | 72 | extern inline void pud_clear (pud_t *pud) |
102 | free_page((unsigned long) pmd); | 73 | { |
74 | set_pud(pud, __pud(0)); | ||
103 | } | 75 | } |
104 | 76 | ||
105 | #define __pmd_free_tlb(tlb,x) do { } while (0) | ||
106 | |||
107 | static inline void pud_clear (pud_t * pud) { } | ||
108 | |||
109 | #define pud_page(pud) \ | 77 | #define pud_page(pud) \ |
110 | ((struct page *) __va(pud_val(pud) & PAGE_MASK)) | 78 | ((struct page *) __va(pud_val(pud) & PAGE_MASK)) |
111 | 79 | ||
@@ -113,13 +81,6 @@ static inline void pud_clear (pud_t * pud) { } | |||
113 | #define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ | 81 | #define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ |
114 | pmd_index(address)) | 82 | pmd_index(address)) |
115 | 83 | ||
116 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | ||
117 | |||
118 | static inline int pte_none(pte_t pte) | ||
119 | { | ||
120 | return pte_is_zero(pte); | ||
121 | } | ||
122 | |||
123 | static inline unsigned long pte_pfn(pte_t pte) | 84 | static inline unsigned long pte_pfn(pte_t pte) |
124 | { | 85 | { |
125 | return phys_to_pfn(pte_val(pte)); | 86 | return phys_to_pfn(pte_val(pte)); |