Commit 5208ba24 authored by Al Viro's avatar Al Viro

missing user_stack_pointer() instances

for the architectures that have usp in pt_regs and do not have
user_stack_pointer() already defined.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ae903caa
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER) #define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER)
#define instruction_pointer(regs) ((regs)->pc) #define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(regs) ((regs)->sp)
static __inline__ int valid_user_regs(struct pt_regs *regs) static __inline__ int valid_user_regs(struct pt_regs *regs)
{ {
......
...@@ -134,6 +134,7 @@ extern void init_debug_traps(struct task_struct *); ...@@ -134,6 +134,7 @@ extern void init_debug_traps(struct task_struct *);
#define instruction_pointer(regs) ((regs)->bpc) #define instruction_pointer(regs) ((regs)->bpc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(regs) ((regs)->spu)
extern void withdraw_debug_trap(struct pt_regs *regs); extern void withdraw_debug_trap(struct pt_regs *regs);
......
...@@ -60,6 +60,7 @@ struct pt_regs { ...@@ -60,6 +60,7 @@ struct pt_regs {
#define instruction_pointer(regs) ((regs)->pc) #define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(regs) ((regs)->r1)
static inline long regs_return_value(struct pt_regs *regs) static inline long regs_return_value(struct pt_regs *regs)
{ {
......
...@@ -49,6 +49,7 @@ static inline long regs_return_value(struct pt_regs *regs) ...@@ -49,6 +49,7 @@ static inline long regs_return_value(struct pt_regs *regs)
#define instruction_pointer(regs) ((regs)->cp0_epc) #define instruction_pointer(regs) ((regs)->cp0_epc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(r) ((r)->regs[29])
extern asmlinkage void syscall_trace_enter(struct pt_regs *regs); extern asmlinkage void syscall_trace_enter(struct pt_regs *regs);
extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
......
...@@ -83,6 +83,7 @@ struct task_struct; ...@@ -83,6 +83,7 @@ struct task_struct;
#define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc) #define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(r) ((unsigned long)(r)->regs[0])
extern void do_syscall_trace(struct pt_regs *regs, int entryexit); extern void do_syscall_trace(struct pt_regs *regs, int entryexit);
extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *); extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *);
......
...@@ -36,6 +36,7 @@ typedef unsigned long pt_reg_t; ...@@ -36,6 +36,7 @@ typedef unsigned long pt_reg_t;
#define instruction_pointer(regs) ((regs)->pc) #define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(regs) ((regs)->sp)
/* Does the process account for user or for system time? */ /* Does the process account for user or for system time? */
#define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL) #define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL)
......
...@@ -54,6 +54,7 @@ static inline int valid_user_regs(struct pt_regs *regs) ...@@ -54,6 +54,7 @@ static inline int valid_user_regs(struct pt_regs *regs)
} }
#define instruction_pointer(regs) ((regs)->UCreg_pc) #define instruction_pointer(regs) ((regs)->UCreg_pc)
#define user_stack_pointer(regs) ((regs)->UCreg_sp)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif #endif
...@@ -86,4 +86,5 @@ extern long arch_prctl(struct task_struct *task, int code, ...@@ -86,4 +86,5 @@ extern long arch_prctl(struct task_struct *task, int code,
unsigned long __user *addr); unsigned long __user *addr);
#endif #endif
#define user_stack_pointer(regs) PT_REGS_SP(regs)
#endif /* __UM_X86_PTRACE_H */ #endif /* __UM_X86_PTRACE_H */
...@@ -63,6 +63,8 @@ struct pt_regs { ...@@ -63,6 +63,8 @@ struct pt_regs {
# define profile_pc(regs) instruction_pointer(regs) # define profile_pc(regs) instruction_pointer(regs)
# endif # endif
#define user_stack_pointer(regs) ((regs)->areg[1])
#else /* __ASSEMBLY__ */ #else /* __ASSEMBLY__ */
# include <asm/asm-offsets.h> # include <asm/asm-offsets.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment