diff options
Diffstat (limited to 'include/asm-x86/i387.h')
-rw-r--r-- | include/asm-x86/i387.h | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h index 37672f79dcc8..96fa8449ff11 100644 --- a/include/asm-x86/i387.h +++ b/include/asm-x86/i387.h | |||
@@ -137,60 +137,6 @@ static inline void __save_init_fpu(struct task_struct *tsk) | |||
137 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | 137 | task_thread_info(tsk)->status &= ~TS_USEDFPU; |
138 | } | 138 | } |
139 | 139 | ||
140 | /* | ||
141 | * Signal frame handlers. | ||
142 | */ | ||
143 | |||
144 | static inline int save_i387(struct _fpstate __user *buf) | ||
145 | { | ||
146 | struct task_struct *tsk = current; | ||
147 | int err = 0; | ||
148 | |||
149 | BUILD_BUG_ON(sizeof(struct user_i387_struct) != | ||
150 | sizeof(tsk->thread.xstate->fxsave)); | ||
151 | |||
152 | if ((unsigned long)buf % 16) | ||
153 | printk("save_i387: bad fpstate %p\n", buf); | ||
154 | |||
155 | if (!used_math()) | ||
156 | return 0; | ||
157 | clear_used_math(); /* trigger finit */ | ||
158 | if (task_thread_info(tsk)->status & TS_USEDFPU) { | ||
159 | err = save_i387_checking((struct i387_fxsave_struct __user *) | ||
160 | buf); | ||
161 | if (err) | ||
162 | return err; | ||
163 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | ||
164 | stts(); | ||
165 | } else { | ||
166 | if (__copy_to_user(buf, &tsk->thread.xstate->fxsave, | ||
167 | sizeof(struct i387_fxsave_struct))) | ||
168 | return -1; | ||
169 | } | ||
170 | return 1; | ||
171 | } | ||
172 | |||
173 | /* | ||
174 | * This restores directly out of user space. Exceptions are handled. | ||
175 | */ | ||
176 | static inline int restore_i387(struct _fpstate __user *buf) | ||
177 | { | ||
178 | struct task_struct *tsk = current; | ||
179 | int err; | ||
180 | |||
181 | if (!used_math()) { | ||
182 | err = init_fpu(tsk); | ||
183 | if (err) | ||
184 | return err; | ||
185 | } | ||
186 | |||
187 | if (!(task_thread_info(current)->status & TS_USEDFPU)) { | ||
188 | clts(); | ||
189 | task_thread_info(current)->status |= TS_USEDFPU; | ||
190 | } | ||
191 | return restore_fpu_checking((__force struct i387_fxsave_struct *)buf); | ||
192 | } | ||
193 | |||
194 | #else /* CONFIG_X86_32 */ | 140 | #else /* CONFIG_X86_32 */ |
195 | 141 | ||
196 | extern void finit(void); | 142 | extern void finit(void); |