]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] make x86 ptrace use init_fpu()
authorBrian Gerst <bgerst@didntduck.org>
Tue, 29 Oct 2002 08:30:13 +0000 (00:30 -0800)
committerChristoph Hellwig <hch@lst.de>
Tue, 29 Oct 2002 08:30:13 +0000 (00:30 -0800)
This fixes PTRACE_GETFPREGS to initilize the fpu struct correctly on
cpus with fxsr, as well as removing redundant code.

arch/i386/kernel/ptrace.c

index a10602335c56a2cf69b599a9e7d78d36ddbb695c..83b66b7d09eea0210fbfc1f3f80277c80d650bf1 100644 (file)
@@ -375,12 +375,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
                        break;
                }
                ret = 0;
-               if ( !child->used_math ) {
-                       /* Simulate an empty FPU. */
-                       set_fpu_cwd(child, 0x037f);
-                       set_fpu_swd(child, 0x0000);
-                       set_fpu_twd(child, 0xffff);
-               }
+               if (!child->used_math)
+                       init_fpu(child);
                get_fpregs((struct user_i387_struct *)data, child);
                break;
        }
@@ -403,13 +399,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
                        ret = -EIO;
                        break;
                }
-               if ( !child->used_math ) {
-                       /* Simulate an empty FPU. */
-                       set_fpu_cwd(child, 0x037f);
-                       set_fpu_swd(child, 0x0000);
-                       set_fpu_twd(child, 0xffff);
-                       set_fpu_mxcsr(child, 0x1f80);
-               }
+               if (!child->used_math)
+                       init_fpu(child);
                ret = get_fpxregs((struct user_fxsr_struct *)data, child);
                break;
        }