diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-07-22 01:59:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-22 04:43:44 -0400 |
commit | 59438c9fc4f7a92c808c9049bc6b396f98bf954c (patch) | |
tree | b86d6072612075bc256038a3430d86ab04778d51 /include | |
parent | c2e3277f875b83e5adc34e96989d6d87ec5f80f7 (diff) |
x86: rename PTE_MASK to PTE_PFN_MASK
Rusty, in his peevish way, complained that macros defining constants
should have a name which somewhat accurately reflects the actual
purpose of the constant.
Aside from the fact that PTE_MASK gives no clue as to what's actually
being masked, and is misleadingly similar to the functionally entirely
different PMD_MASK, PUD_MASK and PGD_MASK, I don't really see what the
problem is.
But if this patch silences the incessent noise, then it will have
achieved its goal (TODO: write test-case).
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/page.h | 6 | ||||
-rw-r--r-- | include/asm-x86/paravirt.h | 2 | ||||
-rw-r--r-- | include/asm-x86/pgtable-3level.h | 8 | ||||
-rw-r--r-- | include/asm-x86/pgtable.h | 4 | ||||
-rw-r--r-- | include/asm-x86/pgtable_32.h | 4 | ||||
-rw-r--r-- | include/asm-x86/pgtable_64.h | 10 | ||||
-rw-r--r-- | include/asm-x86/xen/page.h | 2 |
7 files changed, 18 insertions, 18 deletions
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h index 05d9bea2bfd5..e99fb9fe6f8a 100644 --- a/include/asm-x86/page.h +++ b/include/asm-x86/page.h | |||
@@ -18,8 +18,8 @@ | |||
18 | (ie, 32-bit PAE). */ | 18 | (ie, 32-bit PAE). */ |
19 | #define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK) | 19 | #define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK) |
20 | 20 | ||
21 | /* PTE_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */ | 21 | /* PTE_PFN_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */ |
22 | #define PTE_MASK ((pteval_t)PHYSICAL_PAGE_MASK) | 22 | #define PTE_PFN_MASK ((pteval_t)PHYSICAL_PAGE_MASK) |
23 | 23 | ||
24 | #define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT) | 24 | #define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT) |
25 | #define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1)) | 25 | #define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1)) |
@@ -146,7 +146,7 @@ static inline pteval_t native_pte_val(pte_t pte) | |||
146 | 146 | ||
147 | static inline pteval_t native_pte_flags(pte_t pte) | 147 | static inline pteval_t native_pte_flags(pte_t pte) |
148 | { | 148 | { |
149 | return native_pte_val(pte) & ~PTE_MASK; | 149 | return native_pte_val(pte) & ~PTE_PFN_MASK; |
150 | } | 150 | } |
151 | 151 | ||
152 | #define pgprot_val(x) ((x).pgprot) | 152 | #define pgprot_val(x) ((x).pgprot) |
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index 5ca4639dc7dd..fbbde93f12d6 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -1089,7 +1089,7 @@ static inline pteval_t pte_flags(pte_t pte) | |||
1089 | pte.pte); | 1089 | pte.pte); |
1090 | 1090 | ||
1091 | #ifdef CONFIG_PARAVIRT_DEBUG | 1091 | #ifdef CONFIG_PARAVIRT_DEBUG |
1092 | BUG_ON(ret & PTE_MASK); | 1092 | BUG_ON(ret & PTE_PFN_MASK); |
1093 | #endif | 1093 | #endif |
1094 | return ret; | 1094 | return ret; |
1095 | } | 1095 | } |
diff --git a/include/asm-x86/pgtable-3level.h b/include/asm-x86/pgtable-3level.h index c93dbb6c2624..105057f34032 100644 --- a/include/asm-x86/pgtable-3level.h +++ b/include/asm-x86/pgtable-3level.h | |||
@@ -25,7 +25,7 @@ static inline int pud_none(pud_t pud) | |||
25 | 25 | ||
26 | static inline int pud_bad(pud_t pud) | 26 | static inline int pud_bad(pud_t pud) |
27 | { | 27 | { |
28 | return (pud_val(pud) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0; | 28 | return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0; |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline int pud_present(pud_t pud) | 31 | static inline int pud_present(pud_t pud) |
@@ -120,9 +120,9 @@ static inline void pud_clear(pud_t *pudp) | |||
120 | write_cr3(pgd); | 120 | write_cr3(pgd); |
121 | } | 121 | } |
122 | 122 | ||
123 | #define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_MASK)) | 123 | #define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_PFN_MASK)) |
124 | 124 | ||
125 | #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_MASK)) | 125 | #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK)) |
126 | 126 | ||
127 | 127 | ||
128 | /* Find an entry in the second-level page table.. */ | 128 | /* Find an entry in the second-level page table.. */ |
@@ -160,7 +160,7 @@ static inline int pte_none(pte_t pte) | |||
160 | 160 | ||
161 | static inline unsigned long pte_pfn(pte_t pte) | 161 | static inline unsigned long pte_pfn(pte_t pte) |
162 | { | 162 | { |
163 | return (pte_val(pte) & PTE_MASK) >> PAGE_SHIFT; | 163 | return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT; |
164 | } | 164 | } |
165 | 165 | ||
166 | /* | 166 | /* |
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index 96aa76e691d8..2b1746c92370 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h | |||
@@ -53,7 +53,7 @@ | |||
53 | _PAGE_DIRTY) | 53 | _PAGE_DIRTY) |
54 | 54 | ||
55 | /* Set of bits not changed in pte_modify */ | 55 | /* Set of bits not changed in pte_modify */ |
56 | #define _PAGE_CHG_MASK (PTE_MASK | _PAGE_PCD | _PAGE_PWT | \ | 56 | #define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \ |
57 | _PAGE_ACCESSED | _PAGE_DIRTY) | 57 | _PAGE_ACCESSED | _PAGE_DIRTY) |
58 | 58 | ||
59 | #define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) | 59 | #define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) |
@@ -286,7 +286,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | |||
286 | return __pgprot(preservebits | addbits); | 286 | return __pgprot(preservebits | addbits); |
287 | } | 287 | } |
288 | 288 | ||
289 | #define pte_pgprot(x) __pgprot(pte_flags(x) & ~PTE_MASK) | 289 | #define pte_pgprot(x) __pgprot(pte_flags(x) & ~PTE_PFN_MASK) |
290 | 290 | ||
291 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) | 291 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) |
292 | 292 | ||
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h index 0611abf96a5e..525b53e65b44 100644 --- a/include/asm-x86/pgtable_32.h +++ b/include/asm-x86/pgtable_32.h | |||
@@ -88,7 +88,7 @@ extern unsigned long pg0[]; | |||
88 | /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ | 88 | /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ |
89 | #define pmd_none(x) (!(unsigned long)pmd_val((x))) | 89 | #define pmd_none(x) (!(unsigned long)pmd_val((x))) |
90 | #define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT) | 90 | #define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT) |
91 | #define pmd_bad(x) ((pmd_val(x) & (~PTE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) | 91 | #define pmd_bad(x) ((pmd_val(x) & (~PTE_PFN_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) |
92 | 92 | ||
93 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) | 93 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) |
94 | 94 | ||
@@ -139,7 +139,7 @@ static inline int pud_large(pud_t pud) { return 0; } | |||
139 | #define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT)) | 139 | #define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT)) |
140 | 140 | ||
141 | #define pmd_page_vaddr(pmd) \ | 141 | #define pmd_page_vaddr(pmd) \ |
142 | ((unsigned long)__va(pmd_val((pmd)) & PTE_MASK)) | 142 | ((unsigned long)__va(pmd_val((pmd)) & PTE_PFN_MASK)) |
143 | 143 | ||
144 | #if defined(CONFIG_HIGHPTE) | 144 | #if defined(CONFIG_HIGHPTE) |
145 | #define pte_offset_map(dir, address) \ | 145 | #define pte_offset_map(dir, address) \ |
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h index 805d3128bfc4..ac5fff4cc58a 100644 --- a/include/asm-x86/pgtable_64.h +++ b/include/asm-x86/pgtable_64.h | |||
@@ -158,17 +158,17 @@ static inline void native_pgd_clear(pgd_t *pgd) | |||
158 | 158 | ||
159 | static inline int pgd_bad(pgd_t pgd) | 159 | static inline int pgd_bad(pgd_t pgd) |
160 | { | 160 | { |
161 | return (pgd_val(pgd) & ~(PTE_MASK | _PAGE_USER)) != _KERNPG_TABLE; | 161 | return (pgd_val(pgd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE; |
162 | } | 162 | } |
163 | 163 | ||
164 | static inline int pud_bad(pud_t pud) | 164 | static inline int pud_bad(pud_t pud) |
165 | { | 165 | { |
166 | return (pud_val(pud) & ~(PTE_MASK | _PAGE_USER)) != _KERNPG_TABLE; | 166 | return (pud_val(pud) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE; |
167 | } | 167 | } |
168 | 168 | ||
169 | static inline int pmd_bad(pmd_t pmd) | 169 | static inline int pmd_bad(pmd_t pmd) |
170 | { | 170 | { |
171 | return (pmd_val(pmd) & ~(PTE_MASK | _PAGE_USER)) != _KERNPG_TABLE; | 171 | return (pmd_val(pmd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE; |
172 | } | 172 | } |
173 | 173 | ||
174 | #define pte_none(x) (!pte_val((x))) | 174 | #define pte_none(x) (!pte_val((x))) |
@@ -193,7 +193,7 @@ static inline int pmd_bad(pmd_t pmd) | |||
193 | * Level 4 access. | 193 | * Level 4 access. |
194 | */ | 194 | */ |
195 | #define pgd_page_vaddr(pgd) \ | 195 | #define pgd_page_vaddr(pgd) \ |
196 | ((unsigned long)__va((unsigned long)pgd_val((pgd)) & PTE_MASK)) | 196 | ((unsigned long)__va((unsigned long)pgd_val((pgd)) & PTE_PFN_MASK)) |
197 | #define pgd_page(pgd) (pfn_to_page(pgd_val((pgd)) >> PAGE_SHIFT)) | 197 | #define pgd_page(pgd) (pfn_to_page(pgd_val((pgd)) >> PAGE_SHIFT)) |
198 | #define pgd_present(pgd) (pgd_val(pgd) & _PAGE_PRESENT) | 198 | #define pgd_present(pgd) (pgd_val(pgd) & _PAGE_PRESENT) |
199 | static inline int pgd_large(pgd_t pgd) { return 0; } | 199 | static inline int pgd_large(pgd_t pgd) { return 0; } |
@@ -216,7 +216,7 @@ static inline int pud_large(pud_t pte) | |||
216 | } | 216 | } |
217 | 217 | ||
218 | /* PMD - Level 2 access */ | 218 | /* PMD - Level 2 access */ |
219 | #define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val((pmd)) & PTE_MASK)) | 219 | #define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val((pmd)) & PTE_PFN_MASK)) |
220 | #define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT)) | 220 | #define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT)) |
221 | 221 | ||
222 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) | 222 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) |
diff --git a/include/asm-x86/xen/page.h b/include/asm-x86/xen/page.h index 05e678a86628..7b3835d3b77d 100644 --- a/include/asm-x86/xen/page.h +++ b/include/asm-x86/xen/page.h | |||
@@ -124,7 +124,7 @@ static inline unsigned long mfn_to_local_pfn(unsigned long mfn) | |||
124 | 124 | ||
125 | static inline unsigned long pte_mfn(pte_t pte) | 125 | static inline unsigned long pte_mfn(pte_t pte) |
126 | { | 126 | { |
127 | return (pte.pte & PTE_MASK) >> PAGE_SHIFT; | 127 | return (pte.pte & PTE_PFN_MASK) >> PAGE_SHIFT; |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot) | 130 | static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot) |