0001
0002 #ifndef __ASM_ARM_SWITCH_TO_H
0003 #define __ASM_ARM_SWITCH_TO_H
0004
0005 #include <linux/thread_info.h>
0006 #include <asm/smp_plat.h>
0007
0008
0009
0010
0011
0012
0013
0014 #if defined(CONFIG_PREEMPTION) && defined(CONFIG_SMP) && defined(CONFIG_CPU_V7)
0015 #define __complete_pending_tlbi() dsb(ish)
0016 #else
0017 #define __complete_pending_tlbi()
0018 #endif
0019
0020
0021
0022
0023
0024
0025 extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
0026
0027 #define switch_to(prev,next,last) \
0028 do { \
0029 __complete_pending_tlbi(); \
0030 if (IS_ENABLED(CONFIG_CURRENT_POINTER_IN_TPIDRURO) || is_smp()) \
0031 __this_cpu_write(__entry_task, next); \
0032 last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
0033 } while (0)
0034
0035 #endif