Go to the documentation of this file. 1 #ifndef __SPARC_PTRACE_H
2 #define __SPARC_PTRACE_H
4 #include <uapi/asm/ptrace.h>
6 #if defined(__sparc__) && defined(__arch64__)
10 #include <asm/switch_to.h>
12 static inline int pt_regs_trap_type(
struct pt_regs *
regs)
14 return regs->magic & 0x1ff;
17 static inline bool pt_regs_is_syscall(
struct pt_regs *
regs)
22 static inline bool pt_regs_clear_syscall(
struct pt_regs *regs)
27 #define arch_ptrace_stop_needed(exit_code, info) \
28 ({ flush_user_windows(); \
29 get_thread_wsaved() != 0; \
32 #define arch_ptrace_stop(exit_code, info) \
33 synchronize_user_stack()
35 struct global_reg_snapshot {
46 struct global_pmu_snapshot {
52 struct global_reg_snapshot
reg;
53 struct global_pmu_snapshot
pmu;
58 #define force_successful_syscall_return() \
59 do { current_thread_info()->syscall_noerror = 1; \
61 #define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
62 #define instruction_pointer(regs) ((regs)->tpc)
63 #define instruction_pointer_set(regs, val) ((regs)->tpc = (val))
64 #define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
70 static inline long regs_return_value(
struct pt_regs *regs)
77 #define profile_pc(regs) instruction_pointer(regs)
83 #include <asm/switch_to.h>
85 static inline bool pt_regs_is_syscall(
struct pt_regs *regs)
90 static inline bool pt_regs_clear_syscall(
struct pt_regs *regs)
95 #define arch_ptrace_stop_needed(exit_code, info) \
96 ({ flush_user_windows(); \
97 current_thread_info()->w_saved != 0; \
100 #define arch_ptrace_stop(exit_code, info) \
101 synchronize_user_stack()
103 #define user_mode(regs) (!((regs)->psr & PSR_PS))
104 #define instruction_pointer(regs) ((regs)->pc)
105 #define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
110 #define STACK_BIAS 2047
113 #define GR_SNAP_TSTATE 0x00
114 #define GR_SNAP_TPC 0x08
115 #define GR_SNAP_TNPC 0x10
116 #define GR_SNAP_O7 0x18
117 #define GR_SNAP_I7 0x20
118 #define GR_SNAP_RPC 0x28
119 #define GR_SNAP_THREAD 0x30
120 #define GR_SNAP_PAD1 0x38