diff options
Diffstat (limited to 'arch/x86/kernel/process.h')
| -rw-r--r-- | arch/x86/kernel/process.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/kernel/process.h b/arch/x86/kernel/process.h new file mode 100644 index 000000000000..020fbfac3a27 --- /dev/null +++ b/arch/x86/kernel/process.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | ||
| 2 | // | ||
| 3 | // Code shared between 32 and 64 bit | ||
| 4 | |||
| 5 | void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p); | ||
| 6 | |||
| 7 | /* | ||
| 8 | * This needs to be inline to optimize for the common case where no extra | ||
| 9 | * work needs to be done. | ||
| 10 | */ | ||
| 11 | static inline void switch_to_extra(struct task_struct *prev, | ||
| 12 | struct task_struct *next) | ||
| 13 | { | ||
| 14 | unsigned long next_tif = task_thread_info(next)->flags; | ||
| 15 | unsigned long prev_tif = task_thread_info(prev)->flags; | ||
| 16 | |||
| 17 | /* | ||
| 18 | * __switch_to_xtra() handles debug registers, i/o bitmaps, | ||
| 19 | * speculation mitigations etc. | ||
| 20 | */ | ||
| 21 | if (unlikely(next_tif & _TIF_WORK_CTXSW_NEXT || | ||
| 22 | prev_tif & _TIF_WORK_CTXSW_PREV)) | ||
| 23 | __switch_to_xtra(prev, next); | ||
| 24 | } | ||
