aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/page.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-02-10 07:19:59 -0500
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:30:31 -0400
commitc6e8b587718c486b55c2ebecc6de231a30beba35 (patch)
tree7c6162d449c69fb6425bd27ba341e2d874fb0a1b /include/asm-mips/page.h
parent57f0060b8a2bb2a70a4cce1a37d5e0158cea92a6 (diff)
Update MIPS to use the 4-level pagetable code thereby getting rid of
the compacrapability headers. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/page.h')
-rw-r--r--include/asm-mips/page.h42
1 files changed, 34 insertions, 8 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 652b6d67a571..ee25a779bf49 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -87,22 +87,48 @@ static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
87typedef struct { unsigned long pte; } pte_t; 87typedef struct { unsigned long pte; } pte_t;
88#define pte_val(x) ((x).pte) 88#define pte_val(x) ((x).pte)
89#endif 89#endif
90#define __pte(x) ((pte_t) { (x) } )
90 91
91typedef struct { unsigned long pmd; } pmd_t; 92/*
92typedef struct { unsigned long pgd; } pgd_t; 93 * For 3-level pagetables we defines these ourselves, for 2-level the
93typedef struct { unsigned long pgprot; } pgprot_t; 94 * definitions are supplied by <asm-generic/pgtable-nopmd.h>.
95 */
96#ifdef CONFIG_64BIT
94 97
98typedef struct { unsigned long pmd; } pmd_t;
95#define pmd_val(x) ((x).pmd) 99#define pmd_val(x) ((x).pmd)
96#define pgd_val(x) ((x).pgd) 100#define __pmd(x) ((pmd_t) { (x) } )
97#define pgprot_val(x) ((x).pgprot)
98 101
99#define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t))) 102#endif
100 103
101#define __pte(x) ((pte_t) { (x) } ) 104/*
102#define __pmd(x) ((pmd_t) { (x) } ) 105 * Right now we don't support 4-level pagetables, so all pud-related
106 * definitions come from <asm-generic/pgtable-nopud.h>.
107 */
108
109/*
110 * Finall the top of the hierarchy, the pgd
111 */
112typedef struct { unsigned long pgd; } pgd_t;
113#define pgd_val(x) ((x).pgd)
103#define __pgd(x) ((pgd_t) { (x) } ) 114#define __pgd(x) ((pgd_t) { (x) } )
115
116/*
117 * Manipulate page protection bits
118 */
119typedef struct { unsigned long pgprot; } pgprot_t;
120#define pgprot_val(x) ((x).pgprot)
104#define __pgprot(x) ((pgprot_t) { (x) } ) 121#define __pgprot(x) ((pgprot_t) { (x) } )
105 122
123/*
124 * On R4000-style MMUs where a TLB entry is mapping a adjacent even / odd
125 * pair of pages we only have a single global bit per pair of pages. When
126 * writing to the TLB make sure we always have the bit set for both pages
127 * or none. This macro is used to access the `buddy' of the pte we're just
128 * working on.
129 */
130#define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t)))
131
106#endif /* !__ASSEMBLY__ */ 132#endif /* !__ASSEMBLY__ */
107 133
108/* to align the pointer to the (next) page boundary */ 134/* to align the pointer to the (next) page boundary */