11 #include <linux/sched.h>
16 #include <asm/mmu_context.h>
18 #include <asm/tlbflush.h>
23 #ifdef CONFIG_ARM_LPAE
27 unsigned long ttbh = 0;
34 " mcrr p15, 0, %0, %1, c2 @ set TTBR0\n"
36 :
"r" (ttbl),
"r" (ttbh));
45 " mrc p15, 0, %0, c2, c0, 1 @ read TTBR1\n"
46 " mcr p15, 0, %0, c2, c0, 0 @ set TTBR0\n"
52 #ifdef CONFIG_PID_IN_CONTEXTIDR
60 if (cmd != THREAD_NOTIFY_SWITCH)
63 pid = task_pid_nr(thread->
task) << ASID_BITS;
65 " mrc p15, 0, %0, c13, c0, 1\n"
68 " mcr p15, 0, %0, c13, c0, 1\n"
69 :
"=r" (contextidr),
"+r" (pid)
80 static int __init contextidr_notifier_init(
void)
82 return thread_register_notifier(&contextidr_notifier_block);
97 static void flush_context(
void)
102 __flush_icache_all();
109 static void set_mm_context(
struct mm_struct *mm,
unsigned int asid)
126 cpumask_clear(mm_cpumask(mm));
140 static void reset_context(
void *
info)
150 set_mm_context(mm, asid);
153 cpu_switch_mm(mm->
pgd, mm);
158 static inline void set_mm_context(
struct mm_struct *mm,
unsigned int asid)
205 set_mm_context(mm, asid);