diff options
Diffstat (limited to 'arch/powerpc/include/asm/ptrace.h')
-rw-r--r-- | arch/powerpc/include/asm/ptrace.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index 48223f9b8728..78a205162fd7 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h | |||
@@ -86,7 +86,18 @@ struct pt_regs { | |||
86 | #define instruction_pointer(regs) ((regs)->nip) | 86 | #define instruction_pointer(regs) ((regs)->nip) |
87 | #define user_stack_pointer(regs) ((regs)->gpr[1]) | 87 | #define user_stack_pointer(regs) ((regs)->gpr[1]) |
88 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) | 88 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) |
89 | #define regs_return_value(regs) ((regs)->gpr[3]) | 89 | static inline int is_syscall_success(struct pt_regs *regs) |
90 | { | ||
91 | return !(regs->ccr & 0x10000000); | ||
92 | } | ||
93 | |||
94 | static inline long regs_return_value(struct pt_regs *regs) | ||
95 | { | ||
96 | if (is_syscall_success(regs)) | ||
97 | return regs->gpr[3]; | ||
98 | else | ||
99 | return -regs->gpr[3]; | ||
100 | } | ||
90 | 101 | ||
91 | #ifdef CONFIG_SMP | 102 | #ifdef CONFIG_SMP |
92 | extern unsigned long profile_pc(struct pt_regs *regs); | 103 | extern unsigned long profile_pc(struct pt_regs *regs); |