aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-10-30 17:59:31 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:37:12 -0500
commitca140fdadbe4c031a20a970f46163908d09a116b (patch)
tree5dff340fd0bb88751604d7d7ffdcb0fe55144005 /include
parentd16aafff2570abb557a5cb18c98027aabd602e22 (diff)
[PATCH] i386: little pgtable.h consolidation vs 2/3level
Join together some common functions (pmd_page{,_kernel}) over 2level and 3level pages. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/pgtable-2level.h5
-rw-r--r--include/asm-i386/pgtable-3level.h5
-rw-r--r--include/asm-i386/pgtable.h5
3 files changed, 5 insertions, 10 deletions
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
index fa07bd6c7529..74ef721b534d 100644
--- a/include/asm-i386/pgtable-2level.h
+++ b/include/asm-i386/pgtable-2level.h
@@ -26,11 +26,6 @@
26#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 26#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
27#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 27#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
28 28
29#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
30
31#define pmd_page_kernel(pmd) \
32((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
33
34/* 29/*
35 * All present user pages are user-executable: 30 * All present user pages are user-executable:
36 */ 31 */
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
index 2e3f4a344a2d..f1a8b454920a 100644
--- 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, pte_t pte)
74 */ 74 */
75static inline void pud_clear (pud_t * pud) { } 75static inline void pud_clear (pud_t * pud) { }
76 76
77#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
78
79#define pmd_page_kernel(pmd) \
80((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
81
82#define pud_page(pud) \ 77#define pud_page(pud) \
83((struct page *) __va(pud_val(pud) & PAGE_MASK)) 78((struct page *) __va(pud_val(pud) & PAGE_MASK))
84 79
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 0e3ec809352d..38ec33eb6f12 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -369,6 +369,11 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
369#define pte_offset_kernel(dir, address) \ 369#define pte_offset_kernel(dir, address) \
370 ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address)) 370 ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address))
371 371
372#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
373
374#define pmd_page_kernel(pmd) \
375 ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
376
372/* 377/*
373 * Helper function that returns the kernel pagetable entry controlling 378 * Helper function that returns the kernel pagetable entry controlling
374 * the virtual address 'address'. NULL means no pagetable entry present. 379 * the virtual address 'address'. NULL means no pagetable entry present.