]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/mips/kernel/ptrace.c
Merge branches 'for-4.2/i2c-hid', 'for-4.2/lenovo', 'for-4.2/plantronics', 'for-4...
[karo-tx-linux.git] / arch / mips / kernel / ptrace.c
index 7da6e324dd354a77991c4fe2dd998c07b998d956..e933a309f2ea5fa4498153a9b6a3caa0af4a1587 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <asm/byteorder.h>
 #include <asm/cpu.h>
+#include <asm/cpu-info.h>
 #include <asm/dsp.h>
 #include <asm/fpu.h>
 #include <asm/mipsregs.h>
@@ -157,6 +158,9 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
 {
        union fpureg *fregs;
        u64 fpr_val;
+       u32 fcr31;
+       u32 value;
+       u32 mask;
        int i;
 
        if (!access_ok(VERIFY_READ, data, 33 * 8))
@@ -170,8 +174,10 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
                set_fpr64(&fregs[i], 0, fpr_val);
        }
 
-       __get_user(child->thread.fpu.fcr31, data + 64);
-       child->thread.fpu.fcr31 &= ~FPU_CSR_ALL_X;
+       __get_user(value, data + 64);
+       fcr31 = child->thread.fpu.fcr31;
+       mask = boot_cpu_data.fpu_msk31;
+       child->thread.fpu.fcr31 = (value & ~mask) | (fcr31 & mask);
 
        /* FIR may not be written.  */