@@ -134,26 +134,11 @@ void ptrace_disable(struct task_struct *child)
134
134
135
135
static int genregs_get (struct task_struct * target ,
136
136
const struct user_regset * regset ,
137
- unsigned int pos , unsigned int count ,
138
- void * kbuf , void __user * ubuf )
137
+ struct membuf to )
139
138
{
140
139
const struct pt_regs * regs = task_pt_regs (target );
141
- int ret ;
142
140
143
- ret = user_regset_copyout (& pos , & count , & kbuf , & ubuf ,
144
- regs -> regs ,
145
- 0 , 16 * sizeof (unsigned long ));
146
- if (!ret )
147
- /* PC, PR, SR, GBR, MACH, MACL, TRA */
148
- ret = user_regset_copyout (& pos , & count , & kbuf , & ubuf ,
149
- & regs -> pc ,
150
- offsetof(struct pt_regs , pc ),
151
- sizeof (struct pt_regs ));
152
- if (!ret )
153
- ret = user_regset_copyout_zero (& pos , & count , & kbuf , & ubuf ,
154
- sizeof (struct pt_regs ), -1 );
155
-
156
- return ret ;
141
+ return membuf_write (& to , regs , sizeof (struct pt_regs ));
157
142
}
158
143
159
144
static int genregs_set (struct task_struct * target ,
@@ -182,21 +167,16 @@ static int genregs_set(struct task_struct *target,
182
167
#ifdef CONFIG_SH_FPU
183
168
int fpregs_get (struct task_struct * target ,
184
169
const struct user_regset * regset ,
185
- unsigned int pos , unsigned int count ,
186
- void * kbuf , void __user * ubuf )
170
+ struct membuf to )
187
171
{
188
172
int ret ;
189
173
190
174
ret = init_fpu (target );
191
175
if (ret )
192
176
return ret ;
193
177
194
- if ((boot_cpu_data .flags & CPU_HAS_FPU ))
195
- return user_regset_copyout (& pos , & count , & kbuf , & ubuf ,
196
- & target -> thread .xstate -> hardfpu , 0 , -1 );
197
-
198
- return user_regset_copyout (& pos , & count , & kbuf , & ubuf ,
199
- & target -> thread .xstate -> softfpu , 0 , -1 );
178
+ return membuf_write (& to , target -> thread .xstate ,
179
+ sizeof (struct user_fpu_struct ));
200
180
}
201
181
202
182
static int fpregs_set (struct task_struct * target ,
@@ -230,20 +210,12 @@ static int fpregs_active(struct task_struct *target,
230
210
#ifdef CONFIG_SH_DSP
231
211
static int dspregs_get (struct task_struct * target ,
232
212
const struct user_regset * regset ,
233
- unsigned int pos , unsigned int count ,
234
- void * kbuf , void __user * ubuf )
213
+ struct membuf to )
235
214
{
236
215
const struct pt_dspregs * regs =
237
216
(struct pt_dspregs * )& target -> thread .dsp_status .dsp_regs ;
238
- int ret ;
239
217
240
- ret = user_regset_copyout (& pos , & count , & kbuf , & ubuf , regs ,
241
- 0 , sizeof (struct pt_dspregs ));
242
- if (!ret )
243
- ret = user_regset_copyout_zero (& pos , & count , & kbuf , & ubuf ,
244
- sizeof (struct pt_dspregs ), -1 );
245
-
246
- return ret ;
218
+ return membuf_write (& to , regs , sizeof (struct pt_dspregs ));
247
219
}
248
220
249
221
static int dspregs_set (struct task_struct * target ,
@@ -324,7 +296,7 @@ static const struct user_regset sh_regsets[] = {
324
296
.n = ELF_NGREG ,
325
297
.size = sizeof (long ),
326
298
.align = sizeof (long ),
327
- .get = genregs_get ,
299
+ .regset_get = genregs_get ,
328
300
.set = genregs_set ,
329
301
},
330
302
@@ -334,7 +306,7 @@ static const struct user_regset sh_regsets[] = {
334
306
.n = sizeof (struct user_fpu_struct ) / sizeof (long ),
335
307
.size = sizeof (long ),
336
308
.align = sizeof (long ),
337
- .get = fpregs_get ,
309
+ .regset_get = fpregs_get ,
338
310
.set = fpregs_set ,
339
311
.active = fpregs_active ,
340
312
},
@@ -345,7 +317,7 @@ static const struct user_regset sh_regsets[] = {
345
317
.n = sizeof (struct pt_dspregs ) / sizeof (long ),
346
318
.size = sizeof (long ),
347
319
.align = sizeof (long ),
348
- .get = dspregs_get ,
320
+ .regset_get = dspregs_get ,
349
321
.set = dspregs_set ,
350
322
.active = dspregs_active ,
351
323
},
0 commit comments