diff options
author | Srikar Dronamraju <srikar@linux.vnet.ibm.com> | 2012-02-07 23:53:13 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-02-13 23:01:38 -0500 |
commit | e62894273c7572cb1bec39096df605f42a66e964 (patch) | |
tree | 8f63f7c32b136f8eb89c3b9abfe290687f9a842b /arch/powerpc | |
parent | 454c0bfd0c6469276dec766e5b41efcf0ccf2619 (diff) |
powerpc: Implement GET_IP/SET_IP
With this change, helpers such as instruction_pointer() et al, get defined
in the generic header in terms of GET_IP
Removed the unnecessary definition of profile_pc in !CONFIG_SMP case as
suggested by Mike Frysinger.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/ptrace.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index 78a205162fd7..84cc7840cd18 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h | |||
@@ -83,8 +83,18 @@ struct pt_regs { | |||
83 | 83 | ||
84 | #ifndef __ASSEMBLY__ | 84 | #ifndef __ASSEMBLY__ |
85 | 85 | ||
86 | #define instruction_pointer(regs) ((regs)->nip) | 86 | #define GET_IP(regs) ((regs)->nip) |
87 | #define user_stack_pointer(regs) ((regs)->gpr[1]) | 87 | #define GET_USP(regs) ((regs)->gpr[1]) |
88 | #define GET_FP(regs) (0) | ||
89 | #define SET_FP(regs, val) | ||
90 | |||
91 | #ifdef CONFIG_SMP | ||
92 | extern unsigned long profile_pc(struct pt_regs *regs); | ||
93 | #define profile_pc profile_pc | ||
94 | #endif | ||
95 | |||
96 | #include <asm-generic/ptrace.h> | ||
97 | |||
88 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) | 98 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) |
89 | static inline int is_syscall_success(struct pt_regs *regs) | 99 | static inline int is_syscall_success(struct pt_regs *regs) |
90 | { | 100 | { |
@@ -99,12 +109,6 @@ static inline long regs_return_value(struct pt_regs *regs) | |||
99 | return -regs->gpr[3]; | 109 | return -regs->gpr[3]; |
100 | } | 110 | } |
101 | 111 | ||
102 | #ifdef CONFIG_SMP | ||
103 | extern unsigned long profile_pc(struct pt_regs *regs); | ||
104 | #else | ||
105 | #define profile_pc(regs) instruction_pointer(regs) | ||
106 | #endif | ||
107 | |||
108 | #ifdef __powerpc64__ | 112 | #ifdef __powerpc64__ |
109 | #define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1) | 113 | #define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1) |
110 | #else | 114 | #else |