Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 2009 Wind River Systems,
0007  *   written by Ralf Baechle <ralf@linux-mips.org>
0008  */
0009 #ifndef __ASM_COP2_H
0010 #define __ASM_COP2_H
0011 
0012 #include <linux/notifier.h>
0013 
0014 #if defined(CONFIG_CPU_CAVIUM_OCTEON)
0015 
0016 extern void octeon_cop2_save(struct octeon_cop2_state *);
0017 extern void octeon_cop2_restore(struct octeon_cop2_state *);
0018 
0019 #define cop2_save(r)        octeon_cop2_save(&(r)->thread.cp2)
0020 #define cop2_restore(r)     octeon_cop2_restore(&(r)->thread.cp2)
0021 
0022 #define cop2_present        1
0023 #define cop2_lazy_restore   1
0024 
0025 #elif defined(CONFIG_CPU_LOONGSON64)
0026 
0027 #define cop2_present        1
0028 #define cop2_lazy_restore   1
0029 #define cop2_save(r)        do { (void)(r); } while (0)
0030 #define cop2_restore(r)     do { (void)(r); } while (0)
0031 
0032 #else
0033 
0034 #define cop2_present        0
0035 #define cop2_lazy_restore   0
0036 #define cop2_save(r)        do { (void)(r); } while (0)
0037 #define cop2_restore(r)     do { (void)(r); } while (0)
0038 #endif
0039 
0040 enum cu2_ops {
0041     CU2_EXCEPTION,
0042     CU2_LWC2_OP,
0043     CU2_LDC2_OP,
0044     CU2_SWC2_OP,
0045     CU2_SDC2_OP,
0046 };
0047 
0048 extern int register_cu2_notifier(struct notifier_block *nb);
0049 extern int cu2_notifier_call_chain(unsigned long val, void *v);
0050 
0051 #define cu2_notifier(fn, pri)                       \
0052 ({                                  \
0053     static struct notifier_block fn##_nb = {            \
0054         .notifier_call = fn,                    \
0055         .priority = pri                     \
0056     };                              \
0057                                     \
0058     register_cu2_notifier(&fn##_nb);                \
0059 })
0060 
0061 #endif /* __ASM_COP2_H */