lkml.org 
[lkml]   [2012]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] arch/tile: implement arch_ptrace using user_regset on tilegx
Date
This patch changes arch_ptrace on tilegx so that it uses the user_regset
to implement the PTRACE_GETREGS and PTRACE_SETREGS operations.

The ifdefs and the old code can be removed when user_regset support for
the older architectures is there.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
---
arch/tile/kernel/ptrace.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/tile/kernel/ptrace.c b/arch/tile/kernel/ptrace.c
index 0e68d06..9435dd1 100644
--- a/arch/tile/kernel/ptrace.c
+++ b/arch/tile/kernel/ptrace.c
@@ -196,18 +196,28 @@ long arch_ptrace(struct task_struct *child, long request,
break;

case PTRACE_GETREGS: /* Get all registers from the child. */
+#ifdef __tilegx__
+ ret = copy_regset_to_user(child, &tile_user_regset_view, REGSET_GPR,
+ 0, sizeof(struct pt_regs), datap);
+#else /* __tilegx__ */
if (copy_to_user(datap, getregs(child, &copyregs),
sizeof(struct pt_regs)) == 0) {
ret = 0;
}
+#endif /* __tilegx__ */
break;

case PTRACE_SETREGS: /* Set all registers in the child. */
+#ifdef __tilegx__
+ ret = copy_regset_from_user(child, &tile_user_regset_view, REGSET_GPR,
+ 0, sizeof(struct pt_regs), datap);
+#else /* __tilegx__ */
if (copy_from_user(&copyregs, datap,
sizeof(struct pt_regs)) == 0) {
putregs(child, &copyregs);
ret = 0;
}
+#endif /* __tilegx__ */
break;

case PTRACE_GETFPREGS: /* Get the child FPU state. */
--
1.7.1


\
 
 \ /
  Last update: 2012-12-15 06:21    [W:0.079 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site