summaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/ptrace_64.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-12-16 21:55:44 -0800
committerDavid S. Miller <davem@davemloft.net>2008-12-16 21:55:44 -0800
commit878a5535957b563c447d32866a9e606c55fef091 (patch)
tree7b78655a3aee14afb302b039a1a3e51e6b220b54 /arch/sparc/include/asm/ptrace_64.h
parent410d2c8187ed969238ba98008c1d57307a56cfd8 (diff)
downloadkernel-uprobes-878a5535957b563c447d32866a9e606c55fef091.tar.gz
kernel-uprobes-878a5535957b563c447d32866a9e606c55fef091.tar.xz
kernel-uprobes-878a5535957b563c447d32866a9e606c55fef091.zip
sparc: We need to implement arch_ptrace_stop().
In order to always provide fully synchronized state to the debugger, we might need to do a synchronize_user_stack(). A pair of hooks, arch_ptrace_stop_needed() and arch_ptrace_stop(), exist to handle this kind of situation. It was created for the sake of IA64. Use them, to flush the kernel side cached register windows to the user stack, when necessary. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include/asm/ptrace_64.h')
-rw-r--r--arch/sparc/include/asm/ptrace_64.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/ptrace_64.h b/arch/sparc/include/asm/ptrace_64.h
index 84e969f06af..cd6fbfc2043 100644
--- a/arch/sparc/include/asm/ptrace_64.h
+++ b/arch/sparc/include/asm/ptrace_64.h
@@ -114,6 +114,7 @@ struct sparc_trapf {
#ifdef __KERNEL__
#include <linux/threads.h>
+#include <asm/system.h>
static inline int pt_regs_trap_type(struct pt_regs *regs)
{
@@ -130,6 +131,14 @@ static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
return (regs->tstate &= ~TSTATE_SYSCALL);
}
+#define arch_ptrace_stop_needed(exit_code, info) \
+({ flush_user_windows(); \
+ get_thread_wsaved() != 0; \
+})
+
+#define arch_ptrace_stop(exit_code, info) \
+ synchronize_user_stack()
+
struct global_reg_snapshot {
unsigned long tstate;
unsigned long tpc;