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
6 * Copyright (C) 2009 Wind River Systems,
7 * written by Ralf Baechle <ralf@linux-mips.org>
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)->thread.cp2)
20 #define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2)
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
*);
30 #define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2)
31 #define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2)
33 #define cop2_present 1
34 #define cop2_lazy_restore 0
36 #elif defined(CONFIG_CPU_LOONGSON64)
38 #define cop2_present 1
39 #define cop2_lazy_restore 1
40 #define cop2_save(r) do { (void)(r); } while (0)
41 #define cop2_restore(r) do { (void)(r); } while (0)
45 #define cop2_present 0
46 #define cop2_lazy_restore 0
47 #define cop2_save(r) do { (void)(r); } while (0)
48 #define cop2_restore(r) do { (void)(r); } while (0)
59 extern int register_cu2_notifier(struct notifier_block
*nb
);
60 extern int cu2_notifier_call_chain(unsigned long val
, void *v
);
62 #define cu2_notifier(fn, pri) \
64 static struct notifier_block fn##_nb = { \
65 .notifier_call = fn, \
69 register_cu2_notifier(&fn##_nb); \
72 #endif /* __ASM_COP2_H */