xref: /OK3568_Linux_fs/kernel/arch/xtensa/include/asm/switch_to.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
3*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
4*4882a593Smuzhiyun  * for more details.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Copyright (C) 2001 - 2005 Tensilica Inc.
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #ifndef _XTENSA_SWITCH_TO_H
10*4882a593Smuzhiyun #define _XTENSA_SWITCH_TO_H
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun /* * switch_to(n) should switch tasks to task nr n, first
13*4882a593Smuzhiyun  * checking that n isn't the current task, in which case it does nothing.
14*4882a593Smuzhiyun  */
15*4882a593Smuzhiyun extern void *_switch_to(void *last, void *next);
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun #define switch_to(prev,next,last)		\
18*4882a593Smuzhiyun do {						\
19*4882a593Smuzhiyun 	(last) = _switch_to(prev, next);	\
20*4882a593Smuzhiyun } while(0)
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun #endif /* _XTENSA_SWITCH_TO_H */
23