blob: b17f38ee1ed45d01e7b7c282c9596b2b753b0890 [file] [log] [blame]
Ralf Baechle69f3a7d2009-11-24 01:24:58 +00001/*
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.
5 *
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
11
Ralf Baechle4483b152010-08-05 13:25:59 +010012#include <linux/notifier.h>
13
Jayachandran C2c952e02013-06-10 06:30:00 +000014#if defined(CONFIG_CPU_CAVIUM_OCTEON)
15
16extern void octeon_cop2_save(struct octeon_cop2_state *);
17extern void octeon_cop2_restore(struct octeon_cop2_state *);
18
19#define cop2_save(r) octeon_cop2_save(r)
20#define cop2_restore(r) octeon_cop2_restore(r)
21
22#define cop2_present 1
23#define cop2_lazy_restore 1
24
25#else
26
27#define cop2_present 0
28#define cop2_lazy_restore 0
29#define cop2_save(r)
30#define cop2_restore(r)
31#endif
32
Ralf Baechle69f3a7d2009-11-24 01:24:58 +000033enum cu2_ops {
34 CU2_EXCEPTION,
35 CU2_LWC2_OP,
36 CU2_LDC2_OP,
37 CU2_SWC2_OP,
38 CU2_SDC2_OP,
39};
40
41extern int register_cu2_notifier(struct notifier_block *nb);
42extern int cu2_notifier_call_chain(unsigned long val, void *v);
43
Ralf Baechle4483b152010-08-05 13:25:59 +010044#define cu2_notifier(fn, pri) \
45({ \
David Daney4c7106c2010-09-23 11:23:29 -070046 static struct notifier_block fn##_nb = { \
Ralf Baechle4483b152010-08-05 13:25:59 +010047 .notifier_call = fn, \
48 .priority = pri \
49 }; \
50 \
51 register_cu2_notifier(&fn##_nb); \
52})
53
Ralf Baechle69f3a7d2009-11-24 01:24:58 +000054#endif /* __ASM_COP2_H */