Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: don't use asm-generic/ptrace.h

Doing the indirection through macros for the regs accessors just
makes them harder to read, so implement the helpers directly.

Note that only the helpers actually used are implemented now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Christoph Hellwig and committed by
Arnd Bergmann
045bd00f b42dfdea

+25 -4
+25 -4
arch/sh/include/asm/ptrace.h
··· 16 16 #define user_mode(regs) (((regs)->sr & 0x40000000)==0) 17 17 #define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) 18 18 19 - #define GET_FP(regs) ((regs)->regs[14]) 20 - #define GET_USP(regs) ((regs)->regs[15]) 19 + static inline unsigned long instruction_pointer(struct pt_regs *regs) 20 + { 21 + return regs->pc; 22 + } 23 + static inline void instruction_pointer_set(struct pt_regs *regs, 24 + unsigned long val) 25 + { 26 + regs->pc = val; 27 + } 28 + 29 + static inline unsigned long frame_pointer(struct pt_regs *regs) 30 + { 31 + return regs->regs[14]; 32 + } 33 + 34 + static inline unsigned long user_stack_pointer(struct pt_regs *regs) 35 + { 36 + return regs->regs[15]; 37 + } 38 + 39 + static inline void user_stack_pointer_set(struct pt_regs *regs, 40 + unsigned long val) 41 + { 42 + regs->regs[15] = val; 43 + } 21 44 22 45 #define arch_has_single_step() (1) 23 46 ··· 135 112 136 113 return pc; 137 114 } 138 - #define profile_pc profile_pc 139 115 140 - #include <asm-generic/ptrace.h> 141 116 #endif /* __ASM_SH_PTRACE_H */