Commit f8542e1c authored by Brian Gerst's avatar Brian Gerst Committed by Christoph Hellwig

[PATCH] make x86 ptrace use init_fpu()

This fixes PTRACE_GETFPREGS to initilize the fpu struct correctly on
cpus with fxsr, as well as removing redundant code.
parent 22dda8bf
...@@ -375,12 +375,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -375,12 +375,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
break; break;
} }
ret = 0; ret = 0;
if ( !child->used_math ) { if (!child->used_math)
/* Simulate an empty FPU. */ init_fpu(child);
set_fpu_cwd(child, 0x037f);
set_fpu_swd(child, 0x0000);
set_fpu_twd(child, 0xffff);
}
get_fpregs((struct user_i387_struct *)data, child); get_fpregs((struct user_i387_struct *)data, child);
break; break;
} }
...@@ -403,13 +399,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -403,13 +399,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
ret = -EIO; ret = -EIO;
break; break;
} }
if ( !child->used_math ) { if (!child->used_math)
/* Simulate an empty FPU. */ init_fpu(child);
set_fpu_cwd(child, 0x037f);
set_fpu_swd(child, 0x0000);
set_fpu_twd(child, 0xffff);
set_fpu_mxcsr(child, 0x1f80);
}
ret = get_fpxregs((struct user_fxsr_struct *)data, child); ret = get_fpxregs((struct user_fxsr_struct *)data, child);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment