@@ -569,14 +569,9 @@ static int ptrace_sethbpregs(struct task_struct *tsk, long num,
569
569
570
570
static int gpr_get (struct task_struct * target ,
571
571
const struct user_regset * regset ,
572
- unsigned int pos , unsigned int count ,
573
- void * kbuf , void __user * ubuf )
572
+ struct membuf to )
574
573
{
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 ));
580
575
}
581
576
582
577
static int gpr_set (struct task_struct * target ,
@@ -602,12 +597,10 @@ static int gpr_set(struct task_struct *target,
602
597
603
598
static int fpa_get (struct task_struct * target ,
604
599
const struct user_regset * regset ,
605
- unsigned int pos , unsigned int count ,
606
- void * kbuf , void __user * ubuf )
600
+ struct membuf to )
607
601
{
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 ));
611
604
}
612
605
613
606
static int fpa_set (struct task_struct * target ,
@@ -642,41 +635,20 @@ static int fpa_set(struct task_struct *target,
642
635
* vfp_set() ignores this chunk
643
636
*
644
637
* 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.
649
638
*/
650
639
static int vfp_get (struct task_struct * target ,
651
640
const struct user_regset * regset ,
652
- unsigned int pos , unsigned int count ,
653
- void * kbuf , void __user * ubuf )
641
+ struct membuf to )
654
642
{
655
- int ret ;
656
643
struct thread_info * thread = task_thread_info (target );
657
644
struct vfp_hard_struct const * vfp = & thread -> vfpstate .hard ;
658
- const size_t user_fpregs_offset = offsetof(struct user_vfp , fpregs );
659
645
const size_t user_fpscr_offset = offsetof(struct user_vfp , fpscr );
660
646
661
647
vfp_sync_hwstate (thread );
662
648
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 );
680
652
}
681
653
682
654
/*
@@ -739,7 +711,7 @@ static const struct user_regset arm_regsets[] = {
739
711
.n = ELF_NGREG ,
740
712
.size = sizeof (u32 ),
741
713
.align = sizeof (u32 ),
742
- .get = gpr_get ,
714
+ .regset_get = gpr_get ,
743
715
.set = gpr_set
744
716
},
745
717
[REGSET_FPR ] = {
@@ -751,7 +723,7 @@ static const struct user_regset arm_regsets[] = {
751
723
.n = sizeof (struct user_fp ) / sizeof (u32 ),
752
724
.size = sizeof (u32 ),
753
725
.align = sizeof (u32 ),
754
- .get = fpa_get ,
726
+ .regset_get = fpa_get ,
755
727
.set = fpa_set
756
728
},
757
729
#ifdef CONFIG_VFP
@@ -764,7 +736,7 @@ static const struct user_regset arm_regsets[] = {
764
736
.n = ARM_VFPREGS_SIZE / sizeof (u32 ),
765
737
.size = sizeof (u32 ),
766
738
.align = sizeof (u32 ),
767
- .get = vfp_get ,
739
+ .regset_get = vfp_get ,
768
740
.set = vfp_set
769
741
},
770
742
#endif /* CONFIG_VFP */
0 commit comments