drm/ast: Only warn about unsupported TX chips on Gen4 and later
[drm/drm-misc.git] / arch / csky / include / asm / mmu_context.h
blob95d99b30792c8067c0229514f8c149dd86185607
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __ASM_CSKY_MMU_CONTEXT_H
4 #define __ASM_CSKY_MMU_CONTEXT_H
6 #include <asm-generic/mm_hooks.h>
7 #include <asm/setup.h>
8 #include <asm/page.h>
9 #include <asm/cacheflush.h>
10 #include <asm/tlbflush.h>
12 #include <linux/errno.h>
13 #include <linux/sched.h>
14 #include <abi/ckmmu.h>
16 #define ASID_MASK ((1 << CONFIG_CPU_ASID_BITS) - 1)
17 #define cpu_asid(mm) (atomic64_read(&mm->context.asid) & ASID_MASK)
19 #define init_new_context(tsk,mm) ({ atomic64_set(&(mm)->context.asid, 0); 0; })
21 void check_and_switch_context(struct mm_struct *mm, unsigned int cpu);
23 static inline void
24 switch_mm(struct mm_struct *prev, struct mm_struct *next,
25 struct task_struct *tsk)
27 unsigned int cpu = smp_processor_id();
29 if (prev != next)
30 check_and_switch_context(next, cpu);
32 setup_pgd(next->pgd, next->context.asid.counter);
34 flush_icache_deferred(next);
37 #include <asm-generic/mmu_context.h>
39 #endif /* __ASM_CSKY_MMU_CONTEXT_H */