+
+int get_fpregs32(struct user_i387_ia32_struct *buf, struct task_struct *tsk)
+{
+ struct pt_regs *regs = ((struct pt_regs *)tsk->thread.rsp0) - 1;
+ struct _fpreg *to;
+ const struct _fpxreg *from;
+ unsigned int i;
+
+ convert_fxsr_env_to_i387(tsk, regs,
+ (u32 *) buf, &tsk->thread.i387.fxsave);
+
+ to = (struct _fpreg *) buf->st_space;
+ from = (const struct _fpxreg *) &tsk->thread.i387.fxsave.st_space[0];
+ for (i = 0; i < 8; i++, to++, from++)
+ *to = *(const struct _fpreg *) from;
+
+ return 0;
+}
+
+int
+set_fpregs32(struct task_struct *tsk, const struct user_i387_ia32_struct *buf)
+{
+ struct _fpxreg *to;
+ const struct _fpreg *from;
+ unsigned int i;
+
+ convert_fxsr_env_from_i387(&tsk->thread.i387.fxsave, (u32 *) buf);
+
+ to = (struct _fpxreg *) &tsk->thread.i387.fxsave.st_space[0];
+ from = (const struct _fpreg *) buf->st_space;
+ for (i = 0; i < 8; i++, to++, from++)
+ *(struct _fpreg *) to = *from;
+
+ return 0;
+}