13 #ifndef _XTENSA_MMU_CONTEXT_H
14 #define _XTENSA_MMU_CONTEXT_H
21 #include <linux/sched.h>
23 #include <variant/core.h>
25 #include <asm/pgtable.h>
26 #include <asm/cacheflush.h>
27 #include <asm/tlbflush.h>
30 #if (XCHAL_HAVE_TLBS != 1)
31 # error "Linux must have an MMU!"
48 #define ASID_USER_FIRST 4
49 #define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1)
50 #define ASID_INSERT(x) (0x03020001 | (((x) & ASID_MASK) << 8))
52 static inline void set_rasid_register (
unsigned long val)
54 __asm__ __volatile__ (
" wsr %0, rasid\n\t"
55 " isync\n" : :
"a" (val));
58 static inline unsigned long get_rasid_register (
void)
61 __asm__ __volatile__ (
" rsr %0, rasid\n\t" :
"=a" (tmp));
66 __get_new_mmu_context(
struct mm_struct *mm)
79 set_rasid_register(ASID_INSERT(mm->
context));
80 invalidate_page_directory();
104 __get_new_mmu_context(next);
105 __load_mmu_context(next);
117 __get_new_mmu_context(next);
119 __load_mmu_context(next);
122 #define deactivate_mm(tsk, mm) do { } while(0)
130 invalidate_page_directory();