Skip to content

Commit

Permalink
sh: correct definitions to access stack pointers
Browse files Browse the repository at this point in the history
A definition like:

#define regs_return_value(regs)	((regs)->regs[0])

called with regs_return_value(foo) will be preprocessed to:

((foo)->foo[0])
        ^^^
So to fix this to ensure the preprocessor compiles such calls correctly.

Signed-off-by: Roel Kluin <[email protected]>
Signed-off-by: Paul Mundt <[email protected]>
  • Loading branch information
RoelKluin authored and pmundt committed Jan 5, 2011
1 parent 1dee92b commit eac676e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arch/sh/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
#include <asm/system.h>

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

extern void show_regs(struct pt_regs *);
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/include/asm/ptrace_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct pt_dspregs {
#ifdef __KERNEL__

#define MAX_REG_OFFSET offsetof(struct pt_regs, tra)
#define regs_return_value(regs) ((regs)->regs[0])
#define regs_return_value(_regs) ((_regs)->regs[0])

#endif /* __KERNEL__ */

Expand Down
2 changes: 1 addition & 1 deletion arch/sh/include/asm/ptrace_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct pt_regs {
#ifdef __KERNEL__

#define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7])
#define regs_return_value(regs) ((regs)->regs[3])
#define regs_return_value(_regs) ((_regs)->regs[3])

#endif /* __KERNEL__ */

Expand Down

0 comments on commit eac676e

Please sign in to comment.