Skip to content

Commit

Permalink
sh: Fix up asm-generic/ptrace.h fallout.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Mundt committed May 31, 2011
1 parent 3f9b852 commit db7eba2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/sh/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@

#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
#define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15])
#define GET_USP(regs) ((regs)->regs[15])

#define GET_FP(regs) ((regs)->regs[14])
#define GET_USP(regs) ((regs)->regs[15])

extern void show_regs(struct pt_regs *);

Expand Down Expand Up @@ -131,7 +133,7 @@ extern void ptrace_triggered(struct perf_event *bp, int nmi,

static inline unsigned long profile_pc(struct pt_regs *regs)
{
unsigned long pc = instruction_pointer(regs);
unsigned long pc = regs->pc;

if (virt_addr_uncached(pc))
return CAC_ADDR(pc);
Expand Down

0 comments on commit db7eba2

Please sign in to comment.