diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-09-24 11:34:49 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-09-23 20:04:49 -0400 |
commit | 56f8ba83a52b9f9e3711eff8e54168ac14aa288f (patch) | |
tree | e030f7f3a191384268d86863ca43237a137e8f51 /arch/arm/include | |
parent | a6a01063de6298c60f2506dc7659403e02b4b224 (diff) |
cpumask: use mm_cpumask() wrapper: arm
Makes code futureproof against the impending change to mm->cpu_vm_mask.
It's also a chance to use the new cpumask_ ops which take a pointer
(the older ones are deprecated, but there's no hurry for arch code).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/cacheflush.h | 8 | ||||
-rw-r--r-- | arch/arm/include/asm/mmu_context.h | 7 | ||||
-rw-r--r-- | arch/arm/include/asm/tlbflush.h | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index 1a711ea8418b..fd03fb63a332 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h | |||
@@ -334,14 +334,14 @@ static inline void outer_flush_range(unsigned long start, unsigned long end) | |||
334 | #ifndef CONFIG_CPU_CACHE_VIPT | 334 | #ifndef CONFIG_CPU_CACHE_VIPT |
335 | static inline void flush_cache_mm(struct mm_struct *mm) | 335 | static inline void flush_cache_mm(struct mm_struct *mm) |
336 | { | 336 | { |
337 | if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) | 337 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm))) |
338 | __cpuc_flush_user_all(); | 338 | __cpuc_flush_user_all(); |
339 | } | 339 | } |
340 | 340 | ||
341 | static inline void | 341 | static inline void |
342 | flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) | 342 | flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) |
343 | { | 343 | { |
344 | if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) | 344 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) |
345 | __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end), | 345 | __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end), |
346 | vma->vm_flags); | 346 | vma->vm_flags); |
347 | } | 347 | } |
@@ -349,7 +349,7 @@ flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long | |||
349 | static inline void | 349 | static inline void |
350 | flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn) | 350 | flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn) |
351 | { | 351 | { |
352 | if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { | 352 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { |
353 | unsigned long addr = user_addr & PAGE_MASK; | 353 | unsigned long addr = user_addr & PAGE_MASK; |
354 | __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags); | 354 | __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags); |
355 | } | 355 | } |
@@ -360,7 +360,7 @@ flush_ptrace_access(struct vm_area_struct *vma, struct page *page, | |||
360 | unsigned long uaddr, void *kaddr, | 360 | unsigned long uaddr, void *kaddr, |
361 | unsigned long len, int write) | 361 | unsigned long len, int write) |
362 | { | 362 | { |
363 | if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { | 363 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { |
364 | unsigned long addr = (unsigned long)kaddr; | 364 | unsigned long addr = (unsigned long)kaddr; |
365 | __cpuc_coherent_kern_range(addr, addr + len); | 365 | __cpuc_coherent_kern_range(addr, addr + len); |
366 | } | 366 | } |
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index bcdb9291ef0c..de6cefb329dd 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h | |||
@@ -103,14 +103,15 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
103 | 103 | ||
104 | #ifdef CONFIG_SMP | 104 | #ifdef CONFIG_SMP |
105 | /* check for possible thread migration */ | 105 | /* check for possible thread migration */ |
106 | if (!cpus_empty(next->cpu_vm_mask) && !cpu_isset(cpu, next->cpu_vm_mask)) | 106 | if (!cpumask_empty(mm_cpumask(next)) && |
107 | !cpumask_test_cpu(cpu, mm_cpumask(next))) | ||
107 | __flush_icache_all(); | 108 | __flush_icache_all(); |
108 | #endif | 109 | #endif |
109 | if (!cpu_test_and_set(cpu, next->cpu_vm_mask) || prev != next) { | 110 | if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) { |
110 | check_context(next); | 111 | check_context(next); |
111 | cpu_switch_mm(next->pgd, next); | 112 | cpu_switch_mm(next->pgd, next); |
112 | if (cache_is_vivt()) | 113 | if (cache_is_vivt()) |
113 | cpu_clear(cpu, prev->cpu_vm_mask); | 114 | cpumask_clear_cpu(cpu, mm_cpumask(prev)); |
114 | } | 115 | } |
115 | #endif | 116 | #endif |
116 | } | 117 | } |
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index c964f3fc3bc5..a45ab5dd8255 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h | |||
@@ -350,7 +350,7 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) | |||
350 | if (tlb_flag(TLB_WB)) | 350 | if (tlb_flag(TLB_WB)) |
351 | dsb(); | 351 | dsb(); |
352 | 352 | ||
353 | if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) { | 353 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm))) { |
354 | if (tlb_flag(TLB_V3_FULL)) | 354 | if (tlb_flag(TLB_V3_FULL)) |
355 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc"); | 355 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc"); |
356 | if (tlb_flag(TLB_V4_U_FULL)) | 356 | if (tlb_flag(TLB_V4_U_FULL)) |
@@ -388,7 +388,7 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | |||
388 | if (tlb_flag(TLB_WB)) | 388 | if (tlb_flag(TLB_WB)) |
389 | dsb(); | 389 | dsb(); |
390 | 390 | ||
391 | if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { | 391 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { |
392 | if (tlb_flag(TLB_V3_PAGE)) | 392 | if (tlb_flag(TLB_V3_PAGE)) |
393 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (uaddr) : "cc"); | 393 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (uaddr) : "cc"); |
394 | if (tlb_flag(TLB_V4_U_PAGE)) | 394 | if (tlb_flag(TLB_V4_U_PAGE)) |