aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-avr32/pgtable.h
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-08-15 10:12:18 -0400
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2007-08-15 10:36:56 -0400
commit6f834197a79d34d65ca44e9c77f2571edbcfb64b (patch)
tree3cd3bf8534e1f041cd94f16d205925b74186bea2 /include/asm-avr32/pgtable.h
parente7f3bac95e0bdfd520e065c4a29aad46190fcc99 (diff)
[AVR32] Fix bogus pte_page() definition
The current definition of pte_page() masks out valid bits from the physical address, causing vmalloc_to_page() to misbehave. This may lead to everything from mmap() silently accessing the wrong data to "invalid pte" errors dumped by the kernel. Also remove the now-unused definition of PTE_PHYS_MASK. Thanks to Matteo Vit for discovering this bug. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'include/asm-avr32/pgtable.h')
-rw-r--r--include/asm-avr32/pgtable.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/asm-avr32/pgtable.h b/include/asm-avr32/pgtable.h
index c07bdd10b891..018f6e2a0242 100644
--- a/include/asm-avr32/pgtable.h
+++ b/include/asm-avr32/pgtable.h
@@ -32,8 +32,6 @@
32#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 32#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
33#define FIRST_USER_ADDRESS 0 33#define FIRST_USER_ADDRESS 0
34 34
35#define PTE_PHYS_MASK 0x1ffff000
36
37#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
38extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 36extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
39extern void paging_init(void); 37extern void paging_init(void);
@@ -265,7 +263,7 @@ static inline pte_t pte_mkyoung(pte_t pte)
265 * trivial. 263 * trivial.
266 */ 264 */
267#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) 265#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
268#define pte_page(x) phys_to_page(pte_val(x) & PTE_PHYS_MASK) 266#define pte_page(x) (pfn_to_page(pte_pfn(x)))
269 267
270/* 268/*
271 * Mark the prot value as uncacheable and unbufferable 269 * Mark the prot value as uncacheable and unbufferable