Linux 3.15-rc1
[linux/fpc-iii.git] / arch / mips / include / asm / cop2.h
blobc1516cc0285fac487631ee8ddde4afee0ffc202f
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2009 Wind River Systems,
7 * written by Ralf Baechle <ralf@linux-mips.org>
8 */
9 #ifndef __ASM_COP2_H
10 #define __ASM_COP2_H
12 #include <linux/notifier.h>
14 #if defined(CONFIG_CPU_CAVIUM_OCTEON)
16 extern void octeon_cop2_save(struct octeon_cop2_state *);
17 extern void octeon_cop2_restore(struct octeon_cop2_state *);
19 #define cop2_save(r) octeon_cop2_save(r)
20 #define cop2_restore(r) octeon_cop2_restore(r)
22 #define cop2_present 1
23 #define cop2_lazy_restore 1
25 #elif defined(CONFIG_CPU_XLP)
27 extern void nlm_cop2_save(struct nlm_cop2_state *);
28 extern void nlm_cop2_restore(struct nlm_cop2_state *);
29 #define cop2_save(r) nlm_cop2_save(r)
30 #define cop2_restore(r) nlm_cop2_restore(r)
32 #define cop2_present 1
33 #define cop2_lazy_restore 0
35 #else
37 #define cop2_present 0
38 #define cop2_lazy_restore 0
39 #define cop2_save(r)
40 #define cop2_restore(r)
41 #endif
43 enum cu2_ops {
44 CU2_EXCEPTION,
45 CU2_LWC2_OP,
46 CU2_LDC2_OP,
47 CU2_SWC2_OP,
48 CU2_SDC2_OP,
51 extern int register_cu2_notifier(struct notifier_block *nb);
52 extern int cu2_notifier_call_chain(unsigned long val, void *v);
54 #define cu2_notifier(fn, pri) \
55 ({ \
56 static struct notifier_block fn##_nb = { \
57 .notifier_call = fn, \
58 .priority = pri \
59 }; \
61 register_cu2_notifier(&fn##_nb); \
64 #endif /* __ASM_COP2_H */