aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/ptrace_32.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_32.h
parent410d2c8187ed969238ba98008c1d57307a56cfd8 (diff)
downloadkernel_samsung_aries-878a5535957b563c447d32866a9e606c55fef091.zip
kernel_samsung_aries-878a5535957b563c447d32866a9e606c55fef091.tar.gz
kernel_samsung_aries-878a5535957b563c447d32866a9e606c55fef091.tar.bz2
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_32.h')
-rw-r--r--arch/sparc/include/asm/ptrace_32.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/ptrace_32.h b/arch/sparc/include/asm/ptrace_32.h
index d409c4f..4cef450 100644
--- a/arch/sparc/include/asm/ptrace_32.h
+++ b/arch/sparc/include/asm/ptrace_32.h
@@ -62,6 +62,8 @@ struct sparc_stackf {
#ifdef __KERNEL__
+#include <asm/system.h>
+
static inline bool pt_regs_is_syscall(struct pt_regs *regs)
{
return (regs->psr & PSR_SYSCALL);
@@ -72,6 +74,14 @@ static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
return (regs->psr &= ~PSR_SYSCALL);
}
+#define arch_ptrace_stop_needed(exit_code, info) \
+({ flush_user_windows(); \
+ current_thread_info()->w_saved != 0; \
+})
+
+#define arch_ptrace_stop(exit_code, info) \
+ synchronize_user_stack()
+
#define user_mode(regs) (!((regs)->psr & PSR_PS))
#define instruction_pointer(regs) ((regs)->pc)
#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])