diff options
author | Jeff Dike <jdike@addtoit.com> | 2005-09-04 02:57:41 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 11:06:22 +0400 |
commit | 08964c565b2fe49e338ffbe4907adcc19647ef16 (patch) | |
tree | dd37fefc7f654c8662154dd92efd0258e81a0ff4 /include/asm-um/pgtable-2level.h | |
parent | c56004901fa5dcf55f92318f192ab3c0e87db2d1 (diff) | |
download | linux-08964c565b2fe49e338ffbe4907adcc19647ef16.tar.xz |
[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-2level.h')
-rw-r--r-- | include/asm-um/pgtable-2level.h | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/include/asm-um/pgtable-2level.h b/include/asm-um/pgtable-2level.h index 9b3abc01d60e..ffe017f6b64b 100644 --- a/include/asm-um/pgtable-2level.h +++ b/include/asm-um/pgtable-2level.h @@ -35,35 +35,8 @@ static inline int pgd_newpage(pgd_t pgd) { return 0; } static inline void pgd_mkuptodate(pgd_t pgd) { } -#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE)) - -static inline pte_t pte_mknewprot(pte_t pte) -{ - pte_val(pte) |= _PAGE_NEWPROT; - return(pte); -} - -static inline pte_t pte_mknewpage(pte_t pte) -{ - pte_val(pte) |= _PAGE_NEWPAGE; - return(pte); -} - -static inline void set_pte(pte_t *pteptr, pte_t pteval) -{ - /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so - * fix_range knows to unmap it. _PAGE_NEWPROT is specific to - * mapped pages. - */ - *pteptr = pte_mknewpage(pteval); - if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); -} -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) - #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) -#define pte_page(x) pfn_to_page(pte_pfn(x)) -#define pte_none(x) !(pte_val(x) & ~_PAGE_NEWPAGE) #define pte_pfn(x) phys_to_pfn(pte_val(x)) #define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) #define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) |