Skip to content

Commit 9af6254

Browse files
simarkcmetcalf-tilera
authored andcommitted
arch/tile: implement arch_ptrace using user_regset on tile
This patch changes arch_ptrace on tile so that it uses user_regset to implement the PTRACE_GETREGS and PTRACE_SETREGS operations. Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca> Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
1 parent 7be6828 commit 9af6254

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

arch/tile/kernel/ptrace.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,15 @@ long arch_ptrace(struct task_struct *child, long request,
193193
break;
194194

195195
case PTRACE_GETREGS: /* Get all registers from the child. */
196-
if (copy_to_user(datap, getregs(child, &copyregs),
197-
sizeof(struct pt_regs)) == 0) {
198-
ret = 0;
199-
}
196+
ret = copy_regset_to_user(child, &tile_user_regset_view,
197+
REGSET_GPR, 0,
198+
sizeof(struct pt_regs), datap);
200199
break;
201200

202201
case PTRACE_SETREGS: /* Set all registers in the child. */
203-
if (copy_from_user(&copyregs, datap,
204-
sizeof(struct pt_regs)) == 0) {
205-
putregs(child, &copyregs);
206-
ret = 0;
207-
}
202+
ret = copy_regset_from_user(child, &tile_user_regset_view,
203+
REGSET_GPR, 0,
204+
sizeof(struct pt_regs), datap);
208205
break;
209206

210207
case PTRACE_GETFPREGS: /* Get the child FPU state. */

0 commit comments

Comments
 (0)