Linux 4.8-rc8
[linux/fpc-iii.git] / arch / c6x / include / asm / switch_to.h
blobaf6c71fe75ec19e2b557b8683f93dc7cc8811213
1 /*
2 * Port on Texas Instruments TMS320C6x architecture
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #ifndef _ASM_C6X_SWITCH_TO_H
12 #define _ASM_C6X_SWITCH_TO_H
14 #include <linux/linkage.h>
16 #define prepare_to_switch() do { } while (0)
18 struct task_struct;
19 struct thread_struct;
20 asmlinkage void *__switch_to(struct thread_struct *prev,
21 struct thread_struct *next,
22 struct task_struct *tsk);
24 #define switch_to(prev, next, last) \
25 do { \
26 current->thread.wchan = (u_long) __builtin_return_address(0); \
27 (last) = __switch_to(&(prev)->thread, \
28 &(next)->thread, (prev)); \
29 mb(); \
30 current->thread.wchan = 0; \
31 } while (0)
33 #endif /* _ASM_C6X_SWITCH_TO_H */