Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11083
b: refs/heads/master
c: 1d74f6b
h: refs/heads/master
i:
  11081: cf0ba88
  11079: f885b9e
v: v3
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent 30b61bb commit 07c0476
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 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: d547c5cc2186be9d74b0c595dc8059aef56cd445
refs/heads/master: 1d74f6bc85cbdc4601e5aea1e67ccbd259f0c7f4
10 changes: 7 additions & 3 deletions trunk/arch/mips/kernel/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <asm/branch.h>
#include <asm/cpu.h>
#include <asm/cpu-features.h>
#include <asm/fpu.h>
#include <asm/inst.h>
#include <asm/ptrace.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -161,10 +162,13 @@ int __compute_return_epc(struct pt_regs *regs)
* And now the FPA/cp1 branch instructions.
*/
case cop1_op:
if (!cpu_has_fpu)
fcr31 = current->thread.fpu.soft.fcr31;
else
preempt_disable();
if (is_fpu_owner())
asm volatile("cfc1\t%0,$31" : "=r" (fcr31));
else
fcr31 = current->thread.fpu.hard.fcr31;
preempt_enable();

bit = (insn.i_format.rt >> 2);
bit += (bit != 0);
bit += 23;
Expand Down
9 changes: 7 additions & 2 deletions trunk/include/asm-mips/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ do { \

#define clear_fpu_owner() clear_thread_flag(TIF_USEDFPU)

static inline int __is_fpu_owner(void)
{
return test_thread_flag(TIF_USEDFPU);
}

static inline int is_fpu_owner(void)
{
return cpu_has_fpu && test_thread_flag(TIF_USEDFPU);
return cpu_has_fpu && __is_fpu_owner();
}

static inline void own_fpu(void)
Expand Down Expand Up @@ -127,7 +132,7 @@ static inline void restore_fp(struct task_struct *tsk)
static inline fpureg_t *get_fpu_regs(struct task_struct *tsk)
{
if (cpu_has_fpu) {
if ((tsk == current) && is_fpu_owner())
if ((tsk == current) && __is_fpu_owner())
_save_fp(current);
return tsk->thread.fpu.hard.fpr;
}
Expand Down

0 comments on commit 07c0476

Please sign in to comment.