Skip to content

Commit

Permalink
cpumask: use mm_cpumask() wrapper: m32r
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Hirokazu Takata <[email protected]> (fixes)
  • Loading branch information
rustyrussell committed Sep 24, 2009
1 parent 56f8ba8 commit 49b9205
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions arch/m32r/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ static inline void switch_mm(struct mm_struct *prev,

if (prev != next) {
#ifdef CONFIG_SMP
cpu_set(cpu, next->cpu_vm_mask);
cpumask_set_cpu(cpu, mm_cpumask(next));
#endif /* CONFIG_SMP */
/* Set MPTB = next->pgd */
*(volatile unsigned long *)MPTB = (unsigned long)next->pgd;
activate_context(next);
}
#ifdef CONFIG_SMP
else
if (!cpu_test_and_set(cpu, next->cpu_vm_mask))
if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)))
activate_context(next);
#endif /* CONFIG_SMP */
}
Expand Down
8 changes: 4 additions & 4 deletions arch/m32r/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void smp_flush_tlb_mm(struct mm_struct *mm)
preempt_disable();
cpu_id = smp_processor_id();
mmc = &mm->context[cpu_id];
cpu_mask = mm->cpu_vm_mask;
cpu_mask = *mm_cpumask(mm);
cpu_clear(cpu_id, cpu_mask);

if (*mmc != NO_CONTEXT) {
Expand All @@ -273,7 +273,7 @@ void smp_flush_tlb_mm(struct mm_struct *mm)
if (mm == current->mm)
activate_context(mm);
else
cpu_clear(cpu_id, mm->cpu_vm_mask);
cpumask_clear_cpu(cpu_id, mm_cpumask(mm));
local_irq_restore(flags);
}
if (!cpus_empty(cpu_mask))
Expand Down Expand Up @@ -334,7 +334,7 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
preempt_disable();
cpu_id = smp_processor_id();
mmc = &mm->context[cpu_id];
cpu_mask = mm->cpu_vm_mask;
cpu_mask = *mm_cpumask(mm);
cpu_clear(cpu_id, cpu_mask);

#ifdef DEBUG_SMP
Expand Down Expand Up @@ -469,7 +469,7 @@ void smp_invalidate_interrupt(void)
if (flush_mm == current->active_mm)
activate_context(flush_mm);
else
cpu_clear(cpu_id, flush_mm->cpu_vm_mask);
cpumask_clear_cpu(cpu_id, mm_cpumask(flush_mm));
} else {
unsigned long va = flush_va;

Expand Down

0 comments on commit 49b9205

Please sign in to comment.