diff options
Diffstat (limited to 'include/asm-mips/page.h')
-rw-r--r-- | include/asm-mips/page.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 219d359861f3..85b258ee7090 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -34,6 +34,8 @@ | |||
34 | 34 | ||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | 36 | ||
37 | #include <asm/cpu-features.h> | ||
38 | |||
37 | extern void clear_page(void * page); | 39 | extern void clear_page(void * page); |
38 | extern void copy_page(void * to, void * from); | 40 | extern void copy_page(void * to, void * from); |
39 | 41 | ||
@@ -53,7 +55,7 @@ static inline void clear_user_page(void *addr, unsigned long vaddr, | |||
53 | extern void (*flush_data_cache_page)(unsigned long addr); | 55 | extern void (*flush_data_cache_page)(unsigned long addr); |
54 | 56 | ||
55 | clear_page(addr); | 57 | clear_page(addr); |
56 | if (pages_do_alias((unsigned long) addr, vaddr)) | 58 | if (pages_do_alias((unsigned long) addr, vaddr & PAGE_MASK)) |
57 | flush_data_cache_page((unsigned long)addr); | 59 | flush_data_cache_page((unsigned long)addr); |
58 | } | 60 | } |
59 | 61 | ||
@@ -63,7 +65,8 @@ static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | |||
63 | extern void (*flush_data_cache_page)(unsigned long addr); | 65 | extern void (*flush_data_cache_page)(unsigned long addr); |
64 | 66 | ||
65 | copy_page(vto, vfrom); | 67 | copy_page(vto, vfrom); |
66 | if (pages_do_alias((unsigned long)vto, vaddr)) | 68 | if (!cpu_has_ic_fills_f_dc || |
69 | pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK)) | ||
67 | flush_data_cache_page((unsigned long)vto); | 70 | flush_data_cache_page((unsigned long)vto); |
68 | } | 71 | } |
69 | 72 | ||
@@ -74,15 +77,17 @@ static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | |||
74 | #ifdef CONFIG_CPU_MIPS32 | 77 | #ifdef CONFIG_CPU_MIPS32 |
75 | typedef struct { unsigned long pte_low, pte_high; } pte_t; | 78 | typedef struct { unsigned long pte_low, pte_high; } pte_t; |
76 | #define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) | 79 | #define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) |
80 | #define __pte(x) ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; }) | ||
77 | #else | 81 | #else |
78 | typedef struct { unsigned long long pte; } pte_t; | 82 | typedef struct { unsigned long long pte; } pte_t; |
79 | #define pte_val(x) ((x).pte) | 83 | #define pte_val(x) ((x).pte) |
84 | #define __pte(x) ((pte_t) { (x) } ) | ||
80 | #endif | 85 | #endif |
81 | #else | 86 | #else |
82 | typedef struct { unsigned long pte; } pte_t; | 87 | typedef struct { unsigned long pte; } pte_t; |
83 | #define pte_val(x) ((x).pte) | 88 | #define pte_val(x) ((x).pte) |
84 | #endif | ||
85 | #define __pte(x) ((pte_t) { (x) } ) | 89 | #define __pte(x) ((pte_t) { (x) } ) |
90 | #endif | ||
86 | 91 | ||
87 | /* | 92 | /* |
88 | * For 3-level pagetables we defines these ourselves, for 2-level the | 93 | * For 3-level pagetables we defines these ourselves, for 2-level the |