|
@@ -148,14 +148,13 @@ int peek_user(struct task_struct *child, long addr, long data)
|
|
|
int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
|
|
|
{
|
|
|
int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
|
|
|
- long fpregs[HOST_FP_SIZE];
|
|
|
+ struct user_i387_struct fpregs;
|
|
|
|
|
|
- BUG_ON(sizeof(*buf) != sizeof(fpregs));
|
|
|
- err = save_fp_registers(userspace_pid[cpu], fpregs);
|
|
|
+ err = save_fp_registers(userspace_pid[cpu], (unsigned long *) &fpregs);
|
|
|
if (err)
|
|
|
return err;
|
|
|
|
|
|
- n = copy_to_user(buf, fpregs, sizeof(fpregs));
|
|
|
+ n = copy_to_user(buf, &fpregs, sizeof(fpregs));
|
|
|
if(n > 0)
|
|
|
return -EFAULT;
|
|
|
|
|
@@ -165,27 +164,26 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
|
|
|
int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
|
|
|
{
|
|
|
int n, cpu = ((struct thread_info *) child->stack)->cpu;
|
|
|
- long fpregs[HOST_FP_SIZE];
|
|
|
+ struct user_i387_struct fpregs;
|
|
|
|
|
|
- BUG_ON(sizeof(*buf) != sizeof(fpregs));
|
|
|
- n = copy_from_user(fpregs, buf, sizeof(fpregs));
|
|
|
+ n = copy_from_user(&fpregs, buf, sizeof(fpregs));
|
|
|
if (n > 0)
|
|
|
return -EFAULT;
|
|
|
|
|
|
- return restore_fp_registers(userspace_pid[cpu], fpregs);
|
|
|
+ return restore_fp_registers(userspace_pid[cpu],
|
|
|
+ (unsigned long *) &fpregs);
|
|
|
}
|
|
|
|
|
|
int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
|
|
|
{
|
|
|
int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
|
|
|
- long fpregs[HOST_XFP_SIZE];
|
|
|
+ struct user_fxsr_struct fpregs;
|
|
|
|
|
|
- BUG_ON(sizeof(*buf) != sizeof(fpregs));
|
|
|
- err = save_fpx_registers(userspace_pid[cpu], fpregs);
|
|
|
+ err = save_fpx_registers(userspace_pid[cpu], (unsigned long *) &fpregs);
|
|
|
if (err)
|
|
|
return err;
|
|
|
|
|
|
- n = copy_to_user(buf, fpregs, sizeof(fpregs));
|
|
|
+ n = copy_to_user(buf, &fpregs, sizeof(fpregs));
|
|
|
if(n > 0)
|
|
|
return -EFAULT;
|
|
|
|
|
@@ -195,14 +193,14 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
|
|
|
int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
|
|
|
{
|
|
|
int n, cpu = ((struct thread_info *) child->stack)->cpu;
|
|
|
- long fpregs[HOST_XFP_SIZE];
|
|
|
+ struct user_fxsr_struct fpregs;
|
|
|
|
|
|
- BUG_ON(sizeof(*buf) != sizeof(fpregs));
|
|
|
- n = copy_from_user(fpregs, buf, sizeof(fpregs));
|
|
|
+ n = copy_from_user(&fpregs, buf, sizeof(fpregs));
|
|
|
if (n > 0)
|
|
|
return -EFAULT;
|
|
|
|
|
|
- return restore_fpx_registers(userspace_pid[cpu], fpregs);
|
|
|
+ return restore_fpx_registers(userspace_pid[cpu],
|
|
|
+ (unsigned long *) &fpregs);
|
|
|
}
|
|
|
|
|
|
long subarch_ptrace(struct task_struct *child, long request, long addr,
|