--- zzzz-none-000/linux-3.10.107/arch/mips/include/asm/cop2.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/mips/include/asm/cop2.h 2021-02-04 17:41:59.000000000 +0000 @@ -11,6 +11,43 @@ #include +#if defined(CONFIG_CPU_CAVIUM_OCTEON) + +extern void octeon_cop2_save(struct octeon_cop2_state *); +extern void octeon_cop2_restore(struct octeon_cop2_state *); + +#define cop2_save(r) octeon_cop2_save(&(r)->thread.cp2) +#define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2) + +#define cop2_present 1 +#define cop2_lazy_restore 1 + +#elif defined(CONFIG_CPU_XLP) + +extern void nlm_cop2_save(struct nlm_cop2_state *); +extern void nlm_cop2_restore(struct nlm_cop2_state *); + +#define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2) +#define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2) + +#define cop2_present 1 +#define cop2_lazy_restore 0 + +#elif defined(CONFIG_CPU_LOONGSON3) + +#define cop2_present 1 +#define cop2_lazy_restore 1 +#define cop2_save(r) do { (void)(r); } while (0) +#define cop2_restore(r) do { (void)(r); } while (0) + +#else + +#define cop2_present 0 +#define cop2_lazy_restore 0 +#define cop2_save(r) do { (void)(r); } while (0) +#define cop2_restore(r) do { (void)(r); } while (0) +#endif + enum cu2_ops { CU2_EXCEPTION, CU2_LWC2_OP,