diff options
Diffstat (limited to 'arch/mips/loongson/loongson-3/cop2-ex.c')
| -rw-r--r-- | arch/mips/loongson/loongson-3/cop2-ex.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/mips/loongson/loongson-3/cop2-ex.c b/arch/mips/loongson/loongson-3/cop2-ex.c index 9182e8d2967c..b03e37d2071a 100644 --- a/arch/mips/loongson/loongson-3/cop2-ex.c +++ b/arch/mips/loongson/loongson-3/cop2-ex.c | |||
| @@ -22,13 +22,13 @@ | |||
| 22 | static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action, | 22 | static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action, |
| 23 | void *data) | 23 | void *data) |
| 24 | { | 24 | { |
| 25 | int fpu_enabled; | 25 | int fpu_owned; |
| 26 | int fr = !test_thread_flag(TIF_32BIT_FPREGS); | 26 | int fr = !test_thread_flag(TIF_32BIT_FPREGS); |
| 27 | 27 | ||
| 28 | switch (action) { | 28 | switch (action) { |
| 29 | case CU2_EXCEPTION: | 29 | case CU2_EXCEPTION: |
| 30 | preempt_disable(); | 30 | preempt_disable(); |
| 31 | fpu_enabled = read_c0_status() & ST0_CU1; | 31 | fpu_owned = __is_fpu_owner(); |
| 32 | if (!fr) | 32 | if (!fr) |
| 33 | set_c0_status(ST0_CU1 | ST0_CU2); | 33 | set_c0_status(ST0_CU1 | ST0_CU2); |
| 34 | else | 34 | else |
| @@ -39,8 +39,8 @@ static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action, | |||
| 39 | KSTK_STATUS(current) |= ST0_FR; | 39 | KSTK_STATUS(current) |= ST0_FR; |
| 40 | else | 40 | else |
| 41 | KSTK_STATUS(current) &= ~ST0_FR; | 41 | KSTK_STATUS(current) &= ~ST0_FR; |
| 42 | /* If FPU is enabled, we needn't init or restore fp */ | 42 | /* If FPU is owned, we needn't init or restore fp */ |
| 43 | if(!fpu_enabled) { | 43 | if (!fpu_owned) { |
| 44 | set_thread_flag(TIF_USEDFPU); | 44 | set_thread_flag(TIF_USEDFPU); |
| 45 | if (!used_math()) { | 45 | if (!used_math()) { |
| 46 | _init_fpu(); | 46 | _init_fpu(); |
