Skip to content

Commit 3598e9f

Browse files
author
Al Viro
committed
arm: switch to ->regset_get()
Signed-off-by: Al Viro <[email protected]>
1 parent 3399d90 commit 3598e9f

File tree

1 file changed

+12
-40
lines changed

1 file changed

+12
-40
lines changed

arch/arm/kernel/ptrace.c

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -569,14 +569,9 @@ static int ptrace_sethbpregs(struct task_struct *tsk, long num,
569569

570570
static int gpr_get(struct task_struct *target,
571571
const struct user_regset *regset,
572-
unsigned int pos, unsigned int count,
573-
void *kbuf, void __user *ubuf)
572+
struct membuf to)
574573
{
575-
struct pt_regs *regs = task_pt_regs(target);
576-
577-
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
578-
regs,
579-
0, sizeof(*regs));
574+
return membuf_write(&to, task_pt_regs(target), sizeof(struct pt_regs));
580575
}
581576

582577
static int gpr_set(struct task_struct *target,
@@ -602,12 +597,10 @@ static int gpr_set(struct task_struct *target,
602597

603598
static int fpa_get(struct task_struct *target,
604599
const struct user_regset *regset,
605-
unsigned int pos, unsigned int count,
606-
void *kbuf, void __user *ubuf)
600+
struct membuf to)
607601
{
608-
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
609-
&task_thread_info(target)->fpstate,
610-
0, sizeof(struct user_fp));
602+
return membuf_write(&to, &task_thread_info(target)->fpstate,
603+
sizeof(struct user_fp));
611604
}
612605

613606
static int fpa_set(struct task_struct *target,
@@ -642,41 +635,20 @@ static int fpa_set(struct task_struct *target,
642635
* vfp_set() ignores this chunk
643636
*
644637
* 1 word for the FPSCR
645-
*
646-
* The bounds-checking logic built into user_regset_copyout and friends
647-
* means that we can make a simple sequence of calls to map the relevant data
648-
* to/from the specified slice of the user regset structure.
649638
*/
650639
static int vfp_get(struct task_struct *target,
651640
const struct user_regset *regset,
652-
unsigned int pos, unsigned int count,
653-
void *kbuf, void __user *ubuf)
641+
struct membuf to)
654642
{
655-
int ret;
656643
struct thread_info *thread = task_thread_info(target);
657644
struct vfp_hard_struct const *vfp = &thread->vfpstate.hard;
658-
const size_t user_fpregs_offset = offsetof(struct user_vfp, fpregs);
659645
const size_t user_fpscr_offset = offsetof(struct user_vfp, fpscr);
660646

661647
vfp_sync_hwstate(thread);
662648

663-
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
664-
&vfp->fpregs,
665-
user_fpregs_offset,
666-
user_fpregs_offset + sizeof(vfp->fpregs));
667-
if (ret)
668-
return ret;
669-
670-
ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
671-
user_fpregs_offset + sizeof(vfp->fpregs),
672-
user_fpscr_offset);
673-
if (ret)
674-
return ret;
675-
676-
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
677-
&vfp->fpscr,
678-
user_fpscr_offset,
679-
user_fpscr_offset + sizeof(vfp->fpscr));
649+
membuf_write(&to, vfp->fpregs, sizeof(vfp->fpregs));
650+
membuf_zero(&to, user_fpscr_offset - sizeof(vfp->fpregs));
651+
return membuf_store(&to, vfp->fpscr);
680652
}
681653

682654
/*
@@ -739,7 +711,7 @@ static const struct user_regset arm_regsets[] = {
739711
.n = ELF_NGREG,
740712
.size = sizeof(u32),
741713
.align = sizeof(u32),
742-
.get = gpr_get,
714+
.regset_get = gpr_get,
743715
.set = gpr_set
744716
},
745717
[REGSET_FPR] = {
@@ -751,7 +723,7 @@ static const struct user_regset arm_regsets[] = {
751723
.n = sizeof(struct user_fp) / sizeof(u32),
752724
.size = sizeof(u32),
753725
.align = sizeof(u32),
754-
.get = fpa_get,
726+
.regset_get = fpa_get,
755727
.set = fpa_set
756728
},
757729
#ifdef CONFIG_VFP
@@ -764,7 +736,7 @@ static const struct user_regset arm_regsets[] = {
764736
.n = ARM_VFPREGS_SIZE / sizeof(u32),
765737
.size = sizeof(u32),
766738
.align = sizeof(u32),
767-
.get = vfp_get,
739+
.regset_get = vfp_get,
768740
.set = vfp_set
769741
},
770742
#endif /* CONFIG_VFP */

0 commit comments

Comments
 (0)