diff options
author | Roland McGrath <roland@redhat.com> | 2008-01-30 07:31:49 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:49 -0500 |
commit | cc927a25bd704448b18b095c658cbfdd79dab865 (patch) | |
tree | c29d4cbe0482797af69686ef02a3b59c57f4ecb4 /arch | |
parent | 99f8ecdf4506010feda26ffe4ac0d23962947106 (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/i387_64.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/arch/x86/kernel/i387_64.c b/arch/x86/kernel/i387_64.c index bfaff28fb134..f335a76d7ea7 100644 --- a/arch/x86/kernel/i387_64.c +++ b/arch/x86/kernel/i387_64.c | |||
@@ -72,37 +72,6 @@ void init_fpu(struct task_struct *child) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * Signal frame handlers. | ||
76 | */ | ||
77 | |||
78 | int save_i387(struct _fpstate __user *buf) | ||
79 | { | ||
80 | struct task_struct *tsk = current; | ||
81 | int err = 0; | ||
82 | |||
83 | BUILD_BUG_ON(sizeof(struct user_i387_struct) != | ||
84 | sizeof(tsk->thread.i387.fxsave)); | ||
85 | |||
86 | if ((unsigned long)buf % 16) | ||
87 | printk("save_i387: bad fpstate %p\n",buf); | ||
88 | |||
89 | if (!used_math()) | ||
90 | return 0; | ||
91 | clear_used_math(); /* trigger finit */ | ||
92 | if (task_thread_info(tsk)->status & TS_USEDFPU) { | ||
93 | err = save_i387_checking((struct i387_fxsave_struct __user *)buf); | ||
94 | if (err) return err; | ||
95 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | ||
96 | stts(); | ||
97 | } else { | ||
98 | if (__copy_to_user(buf, &tsk->thread.i387.fxsave, | ||
99 | sizeof(struct i387_fxsave_struct))) | ||
100 | return -1; | ||
101 | } | ||
102 | return 1; | ||
103 | } | ||
104 | |||
105 | /* | ||
106 | * ptrace request handlers. | 75 | * ptrace request handlers. |
107 | */ | 76 | */ |
108 | 77 | ||