File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -1237,6 +1237,22 @@ enum compat_regset {
1237
1237
REGSET_COMPAT_VFP ,
1238
1238
};
1239
1239
1240
+ static inline compat_ulong_t compat_get_user_reg (struct task_struct * task , int idx )
1241
+ {
1242
+ struct pt_regs * regs = task_pt_regs (task );
1243
+
1244
+ switch (idx ) {
1245
+ case 15 :
1246
+ return regs -> pc ;
1247
+ case 16 :
1248
+ return pstate_to_compat_psr (regs -> pstate );
1249
+ case 17 :
1250
+ return regs -> orig_x0 ;
1251
+ default :
1252
+ return regs -> regs [idx ];
1253
+ }
1254
+ }
1255
+
1240
1256
static int compat_gpr_get (struct task_struct * target ,
1241
1257
const struct user_regset * regset ,
1242
1258
unsigned int pos , unsigned int count ,
@@ -1255,23 +1271,7 @@ static int compat_gpr_get(struct task_struct *target,
1255
1271
return - EIO ;
1256
1272
1257
1273
for (i = 0 ; i < num_regs ; ++ i ) {
1258
- unsigned int idx = start + i ;
1259
- compat_ulong_t reg ;
1260
-
1261
- switch (idx ) {
1262
- case 15 :
1263
- reg = task_pt_regs (target )-> pc ;
1264
- break ;
1265
- case 16 :
1266
- reg = task_pt_regs (target )-> pstate ;
1267
- reg = pstate_to_compat_psr (reg );
1268
- break ;
1269
- case 17 :
1270
- reg = task_pt_regs (target )-> orig_x0 ;
1271
- break ;
1272
- default :
1273
- reg = task_pt_regs (target )-> regs [idx ];
1274
- }
1274
+ compat_ulong_t reg = compat_get_user_reg (target , start + i );
1275
1275
1276
1276
if (kbuf ) {
1277
1277
memcpy (kbuf , & reg , sizeof (reg ));
You can’t perform that action at this time.
0 commit comments