aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/fpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/fpu.h')
-rw-r--r--include/asm-mips/fpu.h23
1 files changed, 3 insertions, 20 deletions
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index b414a7d9db43..483685b1592e 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -16,6 +16,7 @@
16#include <asm/mipsregs.h> 16#include <asm/mipsregs.h>
17#include <asm/cpu.h> 17#include <asm/cpu.h>
18#include <asm/cpu-features.h> 18#include <asm/cpu-features.h>
19#include <asm/hazards.h>
19#include <asm/bitops.h> 20#include <asm/bitops.h>
20#include <asm/processor.h> 21#include <asm/processor.h>
21#include <asm/current.h> 22#include <asm/current.h>
@@ -38,34 +39,16 @@ extern void _init_fpu(void);
38extern void _save_fp(struct task_struct *); 39extern void _save_fp(struct task_struct *);
39extern void _restore_fp(struct task_struct *); 40extern void _restore_fp(struct task_struct *);
40 41
41#if defined(CONFIG_CPU_SB1)
42#define __enable_fpu_hazard() \
43do { \
44 asm(".set push \n\t" \
45 ".set mips64 \n\t" \
46 ".set noreorder \n\t" \
47 "ssnop \n\t" \
48 "bnezl $0, .+4 \n\t" \
49 "ssnop \n\t" \
50 ".set pop"); \
51} while (0)
52#else
53#define __enable_fpu_hazard() \
54do { \
55 asm("nop;nop;nop;nop"); /* max. hazard */ \
56} while (0)
57#endif
58
59#define __enable_fpu() \ 42#define __enable_fpu() \
60do { \ 43do { \
61 set_c0_status(ST0_CU1); \ 44 set_c0_status(ST0_CU1); \
62 __enable_fpu_hazard(); \ 45 enable_fpu_hazard(); \
63} while (0) 46} while (0)
64 47
65#define __disable_fpu() \ 48#define __disable_fpu() \
66do { \ 49do { \
67 clear_c0_status(ST0_CU1); \ 50 clear_c0_status(ST0_CU1); \
68 /* We don't care about the c0 hazard here */ \ 51 disable_fpu_hazard(); \
69} while (0) 52} while (0)
70 53
71#define enable_fpu() \ 54#define enable_fpu() \