x86/mm: Add TLB purge to free pmd/pte page interfaces
[linux/fpc-iii.git] / arch / arc / include / asm / switch_to.h
blob1b171ab5fec0523f5dec5b1732b3d1c97f1243d8
1 /*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
9 #ifndef _ASM_ARC_SWITCH_TO_H
10 #define _ASM_ARC_SWITCH_TO_H
12 #ifndef __ASSEMBLY__
14 #include <linux/sched.h>
16 #ifdef CONFIG_ARC_FPU_SAVE_RESTORE
18 extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
19 #define ARC_FPU_PREV(p, n) fpu_save_restore(p, n)
20 #define ARC_FPU_NEXT(t)
22 #else
24 #define ARC_FPU_PREV(p, n)
25 #define ARC_FPU_NEXT(n)
27 #endif /* !CONFIG_ARC_FPU_SAVE_RESTORE */
29 struct task_struct *__switch_to(struct task_struct *p, struct task_struct *n);
31 #define switch_to(prev, next, last) \
32 do { \
33 ARC_FPU_PREV(prev, next); \
34 last = __switch_to(prev, next);\
35 ARC_FPU_NEXT(next); \
36 mb(); \
37 } while (0)
39 #endif
41 #endif