diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2011-01-01 13:36:36 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-05 02:58:19 -0500 |
commit | eac676e531214f1e276645613acae7d7c4529035 (patch) | |
tree | ce1272ecf43494d7bf796b1083c98f5696d7af05 | |
parent | 1dee92bba36b491dbcc15e2cba40501403237f96 (diff) |
sh: correct definitions to access stack pointers
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 <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/include/asm/ptrace.h | 4 | ||||
-rw-r--r-- | arch/sh/include/asm/ptrace_32.h | 2 | ||||
-rw-r--r-- | arch/sh/include/asm/ptrace_64.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h index f6edc10aa0d3..de167d3a1a80 100644 --- a/arch/sh/include/asm/ptrace.h +++ b/arch/sh/include/asm/ptrace.h | |||
@@ -40,8 +40,8 @@ | |||
40 | #include <asm/system.h> | 40 | #include <asm/system.h> |
41 | 41 | ||
42 | #define user_mode(regs) (((regs)->sr & 0x40000000)==0) | 42 | #define user_mode(regs) (((regs)->sr & 0x40000000)==0) |
43 | #define user_stack_pointer(regs) ((unsigned long)(regs)->regs[15]) | 43 | #define user_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) |
44 | #define kernel_stack_pointer(regs) ((unsigned long)(regs)->regs[15]) | 44 | #define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) |
45 | #define instruction_pointer(regs) ((unsigned long)(regs)->pc) | 45 | #define instruction_pointer(regs) ((unsigned long)(regs)->pc) |
46 | 46 | ||
47 | extern void show_regs(struct pt_regs *); | 47 | extern void show_regs(struct pt_regs *); |
diff --git a/arch/sh/include/asm/ptrace_32.h b/arch/sh/include/asm/ptrace_32.h index 35d9e257558c..6c2239cca1a2 100644 --- a/arch/sh/include/asm/ptrace_32.h +++ b/arch/sh/include/asm/ptrace_32.h | |||
@@ -76,7 +76,7 @@ struct pt_dspregs { | |||
76 | #ifdef __KERNEL__ | 76 | #ifdef __KERNEL__ |
77 | 77 | ||
78 | #define MAX_REG_OFFSET offsetof(struct pt_regs, tra) | 78 | #define MAX_REG_OFFSET offsetof(struct pt_regs, tra) |
79 | #define regs_return_value(regs) ((regs)->regs[0]) | 79 | #define regs_return_value(_regs) ((_regs)->regs[0]) |
80 | 80 | ||
81 | #endif /* __KERNEL__ */ | 81 | #endif /* __KERNEL__ */ |
82 | 82 | ||
diff --git a/arch/sh/include/asm/ptrace_64.h b/arch/sh/include/asm/ptrace_64.h index d43c1cb0bbe7..bf9be7764d69 100644 --- a/arch/sh/include/asm/ptrace_64.h +++ b/arch/sh/include/asm/ptrace_64.h | |||
@@ -13,7 +13,7 @@ struct pt_regs { | |||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | 14 | ||
15 | #define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7]) | 15 | #define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7]) |
16 | #define regs_return_value(regs) ((regs)->regs[3]) | 16 | #define regs_return_value(_regs) ((_regs)->regs[3]) |
17 | 17 | ||
18 | #endif /* __KERNEL__ */ | 18 | #endif /* __KERNEL__ */ |
19 | 19 | ||