aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-um/pgtable-3level.h
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2005-09-03 18:57:41 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:06:22 -0400
commit08964c565b2fe49e338ffbe4907adcc19647ef16 (patch)
treedd37fefc7f654c8662154dd92efd0258e81a0ff4 /include/asm-um/pgtable-3level.h
parentc56004901fa5dcf55f92318f192ab3c0e87db2d1 (diff)
[PATCH] uml: merge duplicated page table code
There is a lot of code which is duplicated between the 2 and 3 level implementation, with the only difference that the 3-level implementation is a bit more generalized (instead of accessing directly pte_t.pte, it uses the appropriate access macros). So this code is joined together. As obvious, a "core code nice cleanup" is not a "stability-friendly patch" so usual care applies. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-um/pgtable-3level.h')
-rw-r--r--include/asm-um/pgtable-3level.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h
index 65e8bfc55fc4..32cd6236f245 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
58static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } 58static 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
63static inline pte_t pte_mknewprot(pte_t pte)
64{
65 pte_set_bits(pte, _PAGE_NEWPROT);
66 return(pte);
67}
68
69static inline pte_t pte_mknewpage(pte_t pte)
70{
71 pte_set_bits(pte, _PAGE_NEWPAGE);
72 return(pte);
73}
74
75static 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
91static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 62static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
@@ -113,13 +84,6 @@ static inline void pud_clear (pud_t * pud) { }
113#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ 84#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \
114 pmd_index(address)) 85 pmd_index(address))
115 86
116#define pte_page(x) pfn_to_page(pte_pfn(x))
117
118static inline int pte_none(pte_t pte)
119{
120 return pte_is_zero(pte);
121}
122
123static inline unsigned long pte_pfn(pte_t pte) 87static inline unsigned long pte_pfn(pte_t pte)
124{ 88{
125 return phys_to_pfn(pte_val(pte)); 89 return phys_to_pfn(pte_val(pte));