[PATCH] i386: little pgtable.h consolidation vs 2/3level

From: Paolo 'Blaisorblade' Giarrusso (blaisorblade_at_yahoo.it)
Date: 09/29/05

  • Next message: Paolo 'Blaisorblade' Giarrusso: "[PATCH 3/5] uml: clear SKAS0/3 flags when running in TT mode"
    Date:	Thu, 29 Sep 2005 20:42:28 +0200
    To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
    
    

    Join together some common functions (pmd_page{,_kernel}) over 2level and
    3level pages.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

    ---
     include/asm-i386/pgtable-2level.h |    5 -----
     include/asm-i386/pgtable-3level.h |    5 -----
     include/asm-i386/pgtable.h        |    5 +++++
     3 files changed, 5 insertions(+), 10 deletions(-)
    diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
    --- a/include/asm-i386/pgtable-2level.h
    +++ b/include/asm-i386/pgtable-2level.h
    @@ -26,11 +26,6 @@
     #define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
     #define pfn_pmd(pfn, prot)	__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
     
    -#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
    -
    -#define pmd_page_kernel(pmd) \
    -((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
    -
     /*
      * All present user pages are user-executable:
      */
    diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
    --- a/include/asm-i386/pgtable-3level.h
    +++ b/include/asm-i386/pgtable-3level.h
    @@ -74,11 +74,6 @@ static inline void set_pte(pte_t *ptep, 
      */
     static inline void pud_clear (pud_t * pud) { }
     
    -#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
    -
    -#define pmd_page_kernel(pmd) \
    -((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
    -
     #define pud_page(pud) \
     ((struct page *) __va(pud_val(pud) & PAGE_MASK))
     
    diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
    --- a/include/asm-i386/pgtable.h
    +++ b/include/asm-i386/pgtable.h
    @@ -368,6 +368,11 @@ static inline pte_t pte_modify(pte_t pte
     #define pte_offset_kernel(dir, address) \
     	((pte_t *) pmd_page_kernel(*(dir)) +  pte_index(address))
     
    +#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
    +
    +#define pmd_page_kernel(pmd) \
    +((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
    +
     /*
      * Helper function that returns the kernel pagetable entry controlling
      * the virtual address 'address'. NULL means no pagetable entry present.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Paolo 'Blaisorblade' Giarrusso: "[PATCH 3/5] uml: clear SKAS0/3 flags when running in TT mode"

    Relevant Pages

    • [PATCH 2/7] i386: little pgtable.h consolidation vs 2/3level
      ... Join together some common functions over 2level and ... Helper function that returns the kernel pagetable entry controlling ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: [patch 13/14] x86_64: Use common functions in cluster and physflat mode
      ... So we introduce some common functions in that can be reused in ... I would have consolidated the code in the first place when you put the physflat ... functions with copied body of the code which is what physflat did, ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)