uml: tidy ptrace interface
Tidy the ptrace interface code. Removed a bunch of unused macros. Started converting register sets from arrays of longs to structures. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
46d7b522eb
commit
47906dd9e6
@@ -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,
|
||||
|
Reference in New Issue
Block a user