Commit 3598e9f0 authored by Al Viro's avatar Al Viro

arm: switch to ->regset_get()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3399d90c
...@@ -569,14 +569,9 @@ static int ptrace_sethbpregs(struct task_struct *tsk, long num, ...@@ -569,14 +569,9 @@ static int ptrace_sethbpregs(struct task_struct *tsk, long num,
static int gpr_get(struct task_struct *target, static int gpr_get(struct task_struct *target,
const struct user_regset *regset, const struct user_regset *regset,
unsigned int pos, unsigned int count, struct membuf to)
void *kbuf, void __user *ubuf)
{ {
struct pt_regs *regs = task_pt_regs(target); return membuf_write(&to, task_pt_regs(target), sizeof(struct pt_regs));
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
regs,
0, sizeof(*regs));
} }
static int gpr_set(struct task_struct *target, static int gpr_set(struct task_struct *target,
...@@ -602,12 +597,10 @@ static int gpr_set(struct task_struct *target, ...@@ -602,12 +597,10 @@ static int gpr_set(struct task_struct *target,
static int fpa_get(struct task_struct *target, static int fpa_get(struct task_struct *target,
const struct user_regset *regset, const struct user_regset *regset,
unsigned int pos, unsigned int count, struct membuf to)
void *kbuf, void __user *ubuf)
{ {
return user_regset_copyout(&pos, &count, &kbuf, &ubuf, return membuf_write(&to, &task_thread_info(target)->fpstate,
&task_thread_info(target)->fpstate, sizeof(struct user_fp));
0, sizeof(struct user_fp));
} }
static int fpa_set(struct task_struct *target, static int fpa_set(struct task_struct *target,
...@@ -642,41 +635,20 @@ static int fpa_set(struct task_struct *target, ...@@ -642,41 +635,20 @@ static int fpa_set(struct task_struct *target,
* vfp_set() ignores this chunk * vfp_set() ignores this chunk
* *
* 1 word for the FPSCR * 1 word for the FPSCR
*
* The bounds-checking logic built into user_regset_copyout and friends
* means that we can make a simple sequence of calls to map the relevant data
* to/from the specified slice of the user regset structure.
*/ */
static int vfp_get(struct task_struct *target, static int vfp_get(struct task_struct *target,
const struct user_regset *regset, const struct user_regset *regset,
unsigned int pos, unsigned int count, struct membuf to)
void *kbuf, void __user *ubuf)
{ {
int ret;
struct thread_info *thread = task_thread_info(target); struct thread_info *thread = task_thread_info(target);
struct vfp_hard_struct const *vfp = &thread->vfpstate.hard; struct vfp_hard_struct const *vfp = &thread->vfpstate.hard;
const size_t user_fpregs_offset = offsetof(struct user_vfp, fpregs);
const size_t user_fpscr_offset = offsetof(struct user_vfp, fpscr); const size_t user_fpscr_offset = offsetof(struct user_vfp, fpscr);
vfp_sync_hwstate(thread); vfp_sync_hwstate(thread);
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, membuf_write(&to, vfp->fpregs, sizeof(vfp->fpregs));
&vfp->fpregs, membuf_zero(&to, user_fpscr_offset - sizeof(vfp->fpregs));
user_fpregs_offset, return membuf_store(&to, vfp->fpscr);
user_fpregs_offset + sizeof(vfp->fpregs));
if (ret)
return ret;
ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
user_fpregs_offset + sizeof(vfp->fpregs),
user_fpscr_offset);
if (ret)
return ret;
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
&vfp->fpscr,
user_fpscr_offset,
user_fpscr_offset + sizeof(vfp->fpscr));
} }
/* /*
...@@ -739,7 +711,7 @@ static const struct user_regset arm_regsets[] = { ...@@ -739,7 +711,7 @@ static const struct user_regset arm_regsets[] = {
.n = ELF_NGREG, .n = ELF_NGREG,
.size = sizeof(u32), .size = sizeof(u32),
.align = sizeof(u32), .align = sizeof(u32),
.get = gpr_get, .regset_get = gpr_get,
.set = gpr_set .set = gpr_set
}, },
[REGSET_FPR] = { [REGSET_FPR] = {
...@@ -751,7 +723,7 @@ static const struct user_regset arm_regsets[] = { ...@@ -751,7 +723,7 @@ static const struct user_regset arm_regsets[] = {
.n = sizeof(struct user_fp) / sizeof(u32), .n = sizeof(struct user_fp) / sizeof(u32),
.size = sizeof(u32), .size = sizeof(u32),
.align = sizeof(u32), .align = sizeof(u32),
.get = fpa_get, .regset_get = fpa_get,
.set = fpa_set .set = fpa_set
}, },
#ifdef CONFIG_VFP #ifdef CONFIG_VFP
...@@ -764,7 +736,7 @@ static const struct user_regset arm_regsets[] = { ...@@ -764,7 +736,7 @@ static const struct user_regset arm_regsets[] = {
.n = ARM_VFPREGS_SIZE / sizeof(u32), .n = ARM_VFPREGS_SIZE / sizeof(u32),
.size = sizeof(u32), .size = sizeof(u32),
.align = sizeof(u32), .align = sizeof(u32),
.get = vfp_get, .regset_get = vfp_get,
.set = vfp_set .set = vfp_set
}, },
#endif /* CONFIG_VFP */ #endif /* CONFIG_VFP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment