missing user_stack_pointer() instances
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 14 Dec 2012 06:50:19 +0000 (01:50 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 Dec 2012 23:07:39 +0000 (18:07 -0500)
for the architectures that have usp in pt_regs and do not have
user_stack_pointer() already defined.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/avr32/include/asm/ptrace.h
arch/m32r/include/asm/ptrace.h
arch/microblaze/include/asm/ptrace.h
arch/mips/include/asm/ptrace.h
arch/score/include/asm/ptrace.h
arch/tile/include/asm/ptrace.h
arch/unicore32/include/asm/ptrace.h
arch/x86/um/asm/ptrace.h
arch/xtensa/include/asm/ptrace.h

index 8d3c412..630e4f9 100644 (file)
@@ -21,6 +21,7 @@
 #define user_mode(regs)                 (((regs)->sr & MODE_MASK) == MODE_USER)
 #define instruction_pointer(regs)       ((regs)->pc)
 #define profile_pc(regs)                instruction_pointer(regs)
+#define user_stack_pointer(regs)       ((regs)->sp)
 
 static __inline__ int valid_user_regs(struct pt_regs *regs)
 {
index c4432f1..56795d6 100644 (file)
@@ -134,6 +134,7 @@ extern void init_debug_traps(struct task_struct *);
 
 #define instruction_pointer(regs) ((regs)->bpc)
 #define profile_pc(regs) instruction_pointer(regs)
+#define user_stack_pointer(regs) ((regs)->spu)
 
 extern void withdraw_debug_trap(struct pt_regs *regs);
 
index 94e92c8..fa791e2 100644 (file)
@@ -60,6 +60,7 @@ struct pt_regs {
 
 #define instruction_pointer(regs)      ((regs)->pc)
 #define profile_pc(regs)               instruction_pointer(regs)
+#define user_stack_pointer(regs)       ((regs)->r1)
 
 static inline long regs_return_value(struct pt_regs *regs)
 {
index cec5e12..a3186f2 100644 (file)
@@ -49,6 +49,7 @@ static inline long regs_return_value(struct pt_regs *regs)
 
 #define instruction_pointer(regs) ((regs)->cp0_epc)
 #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_leave(struct pt_regs *regs);
index e89dc9b..99cd4ef 100644 (file)
@@ -83,6 +83,7 @@ struct task_struct;
 
 #define instruction_pointer(regs)      ((unsigned long)(regs)->cp0_epc)
 #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 int read_tsk_long(struct task_struct *, unsigned long, unsigned long *);
index 1a4fd9a..3f792b6 100644 (file)
@@ -36,6 +36,7 @@ typedef unsigned long pt_reg_t;
 
 #define instruction_pointer(regs) ((regs)->pc)
 #define profile_pc(regs) instruction_pointer(regs)
+#define user_stack_pointer(regs) ((regs)->sp)
 
 /* Does the process account for user or for system time? */
 #define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL)
index 726749d..9df53d9 100644 (file)
@@ -54,6 +54,7 @@ static inline int valid_user_regs(struct pt_regs *regs)
 }
 
 #define instruction_pointer(regs)      ((regs)->UCreg_pc)
+#define user_stack_pointer(regs)       ((regs)->UCreg_sp)
 
 #endif /* __ASSEMBLY__ */
 #endif
index 7551332..54f8102 100644 (file)
@@ -86,4 +86,5 @@ extern long arch_prctl(struct task_struct *task, int code,
                       unsigned long __user *addr);
 
 #endif
+#define user_stack_pointer(regs) PT_REGS_SP(regs)
 #endif /* __UM_X86_PTRACE_H */
index da21c17..43d0d5d 100644 (file)
@@ -63,6 +63,8 @@ struct pt_regs {
 #  define profile_pc(regs) instruction_pointer(regs)
 # endif
 
+#define user_stack_pointer(regs) ((regs)->areg[1])
+
 #else  /* __ASSEMBLY__ */
 
 # include <asm/asm-offsets.h>