[PATCH v2 2/5] ptrace: powerpc: implementuser_single_step_siginfo()

From: Oleg Nesterov
Date: Thu Nov 12 2009 - 12:45:02 EST


Suggested by Roland.

Implement user_single_step_siginfo() for powerpc.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
Acked-by: Roland McGrath <roland@xxxxxxxxxx>
---

arch/powerpc/include/asm/ptrace.h | 2 ++
arch/powerpc/kernel/traps.c | 9 +++++++++
2 files changed, 11 insertions(+)

--- TH/arch/powerpc/include/asm/ptrace.h~2_PPC_HELPER 2009-11-10 01:03:23.000000000 +0100
+++ TH/arch/powerpc/include/asm/ptrace.h 2009-11-10 21:48:53.000000000 +0100
@@ -140,6 +140,8 @@ extern void user_enable_single_step(stru
extern void user_enable_block_step(struct task_struct *);
extern void user_disable_single_step(struct task_struct *);

+#define ARCH_HAS_USER_SINGLE_STEP_INFO
+
#endif /* __ASSEMBLY__ */

#endif /* __KERNEL__ */
--- TH/arch/powerpc/kernel/traps.c~2_PPC_HELPER 2009-11-10 01:06:41.000000000 +0100
+++ TH/arch/powerpc/kernel/traps.c 2009-11-10 21:52:45.000000000 +0100
@@ -174,6 +174,15 @@ int die(const char *str, struct pt_regs
return 0;
}

+void user_single_step_siginfo(struct task_struct *tsk,
+ struct pt_regs *regs, siginfo_t *info)
+{
+ memset(info, 0, sizeof(*info));
+ info->si_signo = SIGTRAP;
+ info->si_code = TRAP_TRACE;
+ info->si_addr = (void __user *)regs->nip;
+}
+
void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
{
siginfo_t info;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/