GNU Linux-libre 5.4.274-gnu1
[releases.git] / arch / unicore32 / include / asm / switch_to.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Task switching for PKUnity SoC and UniCore ISA
4  *
5  * Copyright (C) 2001-2012 GUAN Xue-tao
6  */
7 #ifndef __UNICORE_SWITCH_TO_H__
8 #define __UNICORE_SWITCH_TO_H__
9
10 struct task_struct;
11 struct thread_info;
12
13 /*
14  * switch_to(prev, next) should switch from task `prev' to `next'
15  * `prev' will never be the same as `next'.  schedule() itself
16  * contains the memory barrier to tell GCC not to cache `current'.
17  */
18 extern struct task_struct *__switch_to(struct task_struct *,
19                 struct thread_info *, struct thread_info *);
20
21 #define switch_to(prev, next, last)                                     \
22         do {                                                            \
23                 last = __switch_to(prev, task_thread_info(prev),        \
24                                         task_thread_info(next));        \
25         } while (0)
26
27 #endif /* __UNICORE_SWITCH_TO_H__ */