• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  *  Port on Texas Instruments TMS320C6x architecture
4  *
5  *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
6  *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
7  */
8 #ifndef _ASM_C6X_SWITCH_TO_H
9 #define _ASM_C6X_SWITCH_TO_H
10 
11 #include <linux/linkage.h>
12 
13 #define prepare_to_switch()    do { } while (0)
14 
15 struct task_struct;
16 struct thread_struct;
17 asmlinkage void *__switch_to(struct thread_struct *prev,
18 			     struct thread_struct *next,
19 			     struct task_struct *tsk);
20 
21 #define switch_to(prev, next, last)				\
22 	do {							\
23 		current->thread.wchan = (u_long) __builtin_return_address(0); \
24 		(last) = __switch_to(&(prev)->thread,		\
25 				     &(next)->thread, (prev));	\
26 		mb();						\
27 		current->thread.wchan = 0;			\
28 	} while (0)
29 
30 #endif /* _ASM_C6X_SWITCH_TO_H */
31