diff options
Diffstat (limited to 'arch/mips/include/asm/mmu_context.h')
-rw-r--r-- | arch/mips/include/asm/mmu_context.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h index 94414561de0e..a589585be21b 100644 --- a/arch/mips/include/asm/mmu_context.h +++ b/arch/mips/include/asm/mmu_context.h | |||
@@ -76,14 +76,14 @@ extern unsigned long pgd_current[]; | |||
76 | * All unused by hardware upper bits will be considered | 76 | * All unused by hardware upper bits will be considered |
77 | * as a software asid extension. | 77 | * as a software asid extension. |
78 | */ | 78 | */ |
79 | static unsigned long asid_version_mask(unsigned int cpu) | 79 | static inline u64 asid_version_mask(unsigned int cpu) |
80 | { | 80 | { |
81 | unsigned long asid_mask = cpu_asid_mask(&cpu_data[cpu]); | 81 | unsigned long asid_mask = cpu_asid_mask(&cpu_data[cpu]); |
82 | 82 | ||
83 | return ~(asid_mask | (asid_mask - 1)); | 83 | return ~(u64)(asid_mask | (asid_mask - 1)); |
84 | } | 84 | } |
85 | 85 | ||
86 | static unsigned long asid_first_version(unsigned int cpu) | 86 | static inline u64 asid_first_version(unsigned int cpu) |
87 | { | 87 | { |
88 | return ~asid_version_mask(cpu) + 1; | 88 | return ~asid_version_mask(cpu) + 1; |
89 | } | 89 | } |
@@ -102,14 +102,12 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
102 | static inline void | 102 | static inline void |
103 | get_new_mmu_context(struct mm_struct *mm, unsigned long cpu) | 103 | get_new_mmu_context(struct mm_struct *mm, unsigned long cpu) |
104 | { | 104 | { |
105 | unsigned long asid = asid_cache(cpu); | 105 | u64 asid = asid_cache(cpu); |
106 | 106 | ||
107 | if (!((asid += cpu_asid_inc()) & cpu_asid_mask(&cpu_data[cpu]))) { | 107 | if (!((asid += cpu_asid_inc()) & cpu_asid_mask(&cpu_data[cpu]))) { |
108 | if (cpu_has_vtag_icache) | 108 | if (cpu_has_vtag_icache) |
109 | flush_icache_all(); | 109 | flush_icache_all(); |
110 | local_flush_tlb_all(); /* start new asid cycle */ | 110 | local_flush_tlb_all(); /* start new asid cycle */ |
111 | if (!asid) /* fix version if needed */ | ||
112 | asid = asid_first_version(cpu); | ||
113 | } | 111 | } |
114 | 112 | ||
115 | cpu_context(cpu, mm) = asid_cache(cpu) = asid; | 113 | cpu_context(cpu, mm) = asid_cache(cpu) = asid; |