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

sh: Fix up asm-generic/ptrace.h fallout.

There was an ordering issue with regards to instruction_pointer() being
used in profile_pc() prior to the asm-generic/ptrace.h include, which
subsequently provided the instruction_pointer() definition. In the
interest of simplicity we simply open-code the regs->pc deref for the
profile_pc() definition instead.

The FP functions were also broken due to a lack of a common regs->fp,
so provide a common GET_FP() that is safe for both architectures in order
to fix up the frame pointer helpers too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+4 -2
+4 -2
arch/sh/include/asm/ptrace.h
··· 41 41 42 42 #define user_mode(regs) (((regs)->sr & 0x40000000)==0) 43 43 #define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) 44 - #define GET_USP(regs) ((regs)->regs[15]) 44 + 45 + #define GET_FP(regs) ((regs)->regs[14]) 46 + #define GET_USP(regs) ((regs)->regs[15]) 45 47 46 48 extern void show_regs(struct pt_regs *); 47 49 ··· 133 131 134 132 static inline unsigned long profile_pc(struct pt_regs *regs) 135 133 { 136 - unsigned long pc = instruction_pointer(regs); 134 + unsigned long pc = regs->pc; 137 135 138 136 if (virt_addr_uncached(pc)) 139 137 return CAC_ADDR(pc);