Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56009
b: refs/heads/master
c: 0b62495
h: refs/heads/master
i:
  56007: 9a99fdf
v: v3
  • Loading branch information
Chris Dearman authored and Ralf Baechle committed May 11, 2007
1 parent 6990f68 commit 8ea22e6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d725cf3818b12a17d78b87a2de19e8eec17126ae
refs/heads/master: 0b6249567b4ecf6e9d5a8efcf149f3e7cf788cc0
23 changes: 3 additions & 20 deletions trunk/include/asm-mips/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <asm/mipsregs.h>
#include <asm/cpu.h>
#include <asm/cpu-features.h>
#include <asm/hazards.h>
#include <asm/bitops.h>
#include <asm/processor.h>
#include <asm/current.h>
Expand All @@ -38,34 +39,16 @@ extern void _init_fpu(void);
extern void _save_fp(struct task_struct *);
extern void _restore_fp(struct task_struct *);

#if defined(CONFIG_CPU_SB1)
#define __enable_fpu_hazard() \
do { \
asm(".set push \n\t" \
".set mips64 \n\t" \
".set noreorder \n\t" \
"ssnop \n\t" \
"bnezl $0, .+4 \n\t" \
"ssnop \n\t" \
".set pop"); \
} while (0)
#else
#define __enable_fpu_hazard() \
do { \
asm("nop;nop;nop;nop"); /* max. hazard */ \
} while (0)
#endif

#define __enable_fpu() \
do { \
set_c0_status(ST0_CU1); \
__enable_fpu_hazard(); \
enable_fpu_hazard(); \
} while (0)

#define __disable_fpu() \
do { \
clear_c0_status(ST0_CU1); \
/* We don't care about the c0 hazard here */ \
disable_fpu_hazard(); \
} while (0)

#define enable_fpu() \
Expand Down
32 changes: 32 additions & 0 deletions trunk/include/asm-mips/hazards.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,36 @@ ASMMACRO(back_to_back_c0_hazard,

#endif


/* FPU hazards */

#if defined(CONFIG_CPU_SB1)
ASMMACRO(enable_fpu_hazard,
.set push;
.set mips64;
.set noreorder;
_ssnop;
bnezl $0,.+4;
_ssnop
.set pop
)
ASMMACRO(disable_fpu_hazard,
)

#elif defined(CONFIG_CPU_MIPSR2)
ASMMACRO(enable_fpu_hazard,
_ehb
)
ASMMACRO(disable_fpu_hazard,
_ehb
)
#else
ASMMACRO(enable_fpu_hazard,
nop; nop; nop; nop
)
ASMMACRO(disable_fpu_hazard,
_ehb
)
#endif

#endif /* _ASM_HAZARDS_H */

0 comments on commit 8ea22e6

Please sign in to comment.