x86: x86 i387 header cleanup
This moves some code into asm-x86/i387_64.h in preparation for unifying this code between 32 and 64. The 32-bit versions of some things are copied in some existing names changed to match 32-bit names and share code. For 64, save_i387 is moved into an inline from i387_64.c; this matches restore_i387, which is already an inline, and makes sense since there is exactly one caller (in signal_64.c). The save_i387 function could use more cosmetic cleanup, but it is just moved verbatim in this patch. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:

zatwierdzone przez
Ingo Molnar

rodzic
99f8ecdf45
commit
cc927a25bd
@@ -71,37 +71,6 @@ void init_fpu(struct task_struct *child)
|
||||
set_stopped_child_used_math(child);
|
||||
}
|
||||
|
||||
/*
|
||||
* Signal frame handlers.
|
||||
*/
|
||||
|
||||
int save_i387(struct _fpstate __user *buf)
|
||||
{
|
||||
struct task_struct *tsk = current;
|
||||
int err = 0;
|
||||
|
||||
BUILD_BUG_ON(sizeof(struct user_i387_struct) !=
|
||||
sizeof(tsk->thread.i387.fxsave));
|
||||
|
||||
if ((unsigned long)buf % 16)
|
||||
printk("save_i387: bad fpstate %p\n",buf);
|
||||
|
||||
if (!used_math())
|
||||
return 0;
|
||||
clear_used_math(); /* trigger finit */
|
||||
if (task_thread_info(tsk)->status & TS_USEDFPU) {
|
||||
err = save_i387_checking((struct i387_fxsave_struct __user *)buf);
|
||||
if (err) return err;
|
||||
task_thread_info(tsk)->status &= ~TS_USEDFPU;
|
||||
stts();
|
||||
} else {
|
||||
if (__copy_to_user(buf, &tsk->thread.i387.fxsave,
|
||||
sizeof(struct i387_fxsave_struct)))
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* ptrace request handlers.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user