13 #ifndef __ASM_ARM_MMU_CONTEXT_H
14 #define __ASM_ARM_MMU_CONTEXT_H
16 #include <linux/compiler.h>
17 #include <linux/sched.h>
18 #include <asm/cacheflush.h>
19 #include <asm/cachetype.h>
20 #include <asm/proc-fns.h>
25 #ifdef CONFIG_CPU_HAS_ASID
42 #define ASID_MASK ((~0) << ASID_BITS)
43 #define ASID_FIRST_VERSION (1 << ASID_BITS)
51 static inline void switch_new_context(
struct mm_struct *mm)
58 cpu_switch_mm(mm->
pgd, mm);
62 static inline void check_and_switch_context(
struct mm_struct *mm,
80 cpu_switch_mm(mm->
pgd, mm);
93 switch_new_context(mm);
96 #define init_new_context(tsk,mm) (__init_new_context(tsk,mm),0)
98 #define finish_arch_post_lock_switch \
99 finish_arch_post_lock_switch
102 if (test_and_clear_thread_flag(TIF_SWITCH_MM))
103 switch_new_context(
current->mm);
110 static inline void check_and_switch_context(
struct mm_struct *mm,
126 cpu_switch_mm(mm->
pgd, mm);
129 #define finish_arch_post_lock_switch \
130 finish_arch_post_lock_switch
133 if (test_and_clear_thread_flag(TIF_SWITCH_MM)) {
135 cpu_switch_mm(mm->
pgd, mm);
141 #define init_new_context(tsk,mm) 0
145 #define destroy_context(mm) do { } while(0)
176 if (!cpumask_empty(mm_cpumask(next)) &&
178 __flush_icache_all();
180 if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) {
181 check_and_switch_context(next, tsk);
183 cpumask_clear_cpu(cpu, mm_cpumask(prev));
188 #define deactivate_mm(tsk,mm) do { } while (0)
189 #define activate_mm(prev,next) switch_mm(prev, next, NULL)