ptrace.h (e5451c8f8330e03ad3cfa16048b4daf961af434f) ptrace.h (e8f4aa6087fa80732382881ef7c0c96733bb1984)
1#ifndef __SPARC_PTRACE_H
2#define __SPARC_PTRACE_H
3
4#include <uapi/asm/ptrace.h>
5
6#if defined(__sparc__) && defined(__arch64__)
7#ifndef __ASSEMBLY__
8

--- 47 unchanged lines hidden (view full) ---

56 struct global_pmu_snapshot pmu;
57};
58
59extern union global_cpu_snapshot global_cpu_snapshot[NR_CPUS];
60
61#define force_successful_syscall_return() set_thread_noerror(1)
62#define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
63#define instruction_pointer(regs) ((regs)->tpc)
1#ifndef __SPARC_PTRACE_H
2#define __SPARC_PTRACE_H
3
4#include <uapi/asm/ptrace.h>
5
6#if defined(__sparc__) && defined(__arch64__)
7#ifndef __ASSEMBLY__
8

--- 47 unchanged lines hidden (view full) ---

56 struct global_pmu_snapshot pmu;
57};
58
59extern union global_cpu_snapshot global_cpu_snapshot[NR_CPUS];
60
61#define force_successful_syscall_return() set_thread_noerror(1)
62#define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
63#define instruction_pointer(regs) ((regs)->tpc)
64#define instruction_pointer_set(regs, val) ((regs)->tpc = (val))
64#define instruction_pointer_set(regs, val) do { \
65 (regs)->tpc = (val); \
66 (regs)->tnpc = (val)+4; \
67 } while (0)
65#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
66static inline int is_syscall_success(struct pt_regs *regs)
67{
68 return !(regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY));
69}
70
71static inline long regs_return_value(struct pt_regs *regs)
72{
73 return regs->u_regs[UREG_I0];
74}
75#ifdef CONFIG_SMP
76unsigned long profile_pc(struct pt_regs *);
77#else
78#define profile_pc(regs) instruction_pointer(regs)
79#endif
68#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
69static inline int is_syscall_success(struct pt_regs *regs)
70{
71 return !(regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY));
72}
73
74static inline long regs_return_value(struct pt_regs *regs)
75{
76 return regs->u_regs[UREG_I0];
77}
78#ifdef CONFIG_SMP
79unsigned long profile_pc(struct pt_regs *);
80#else
81#define profile_pc(regs) instruction_pointer(regs)
82#endif
83
84#define MAX_REG_OFFSET (offsetof(struct pt_regs, magic))
85
86extern int regs_query_register_offset(const char *name);
87
88/**
89 * regs_get_register() - get register value from its offset
90 * @regs: pt_regs from which register value is gotten
91 * @offset: offset number of the register.
92 *
93 * regs_get_register returns the value of a register whose
94 * offset from @regs. The @offset is the offset of the register
95 * in struct pt_regs. If @offset is bigger than MAX_REG_OFFSET,
96 * this returns 0.
97 */
98static inline unsigned long regs_get_register(struct pt_regs *regs,
99 unsigned long offset)
100{
101 if (unlikely(offset >= MAX_REG_OFFSET))
102 return 0;
103 if (offset == PT_V9_Y)
104 return *(unsigned int *)((unsigned long)regs + offset);
105 return *(unsigned long *)((unsigned long)regs + offset);
106}
107
108/* Valid only for Kernel mode traps. */
109static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
110{
111 return regs->u_regs[UREG_I6];
112}
80#else /* __ASSEMBLY__ */
81#endif /* __ASSEMBLY__ */
82#else /* (defined(__sparc__) && defined(__arch64__)) */
83#ifndef __ASSEMBLY__
84#include <asm/switch_to.h>
85
86static inline bool pt_regs_is_syscall(struct pt_regs *regs)
87{

--- 39 unchanged lines hidden ---
113#else /* __ASSEMBLY__ */
114#endif /* __ASSEMBLY__ */
115#else /* (defined(__sparc__) && defined(__arch64__)) */
116#ifndef __ASSEMBLY__
117#include <asm/switch_to.h>
118
119static inline bool pt_regs_is_syscall(struct pt_regs *regs)
120{

--- 39 unchanged lines hidden ---