diff options
Diffstat (limited to 'arch/mips/include/asm/ptrace.h')
-rw-r--r-- | arch/mips/include/asm/ptrace.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h index 7b99c670e478..4b7f5252d2fd 100644 --- a/arch/mips/include/asm/ptrace.h +++ b/arch/mips/include/asm/ptrace.h | |||
@@ -137,7 +137,19 @@ extern int ptrace_set_watch_regs(struct task_struct *child, | |||
137 | */ | 137 | */ |
138 | #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) | 138 | #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) |
139 | 139 | ||
140 | #define regs_return_value(_regs) ((_regs)->regs[2]) | 140 | static inline int is_syscall_success(struct pt_regs *regs) |
141 | { | ||
142 | return !regs->regs[7]; | ||
143 | } | ||
144 | |||
145 | static inline long regs_return_value(struct pt_regs *regs) | ||
146 | { | ||
147 | if (is_syscall_success(regs)) | ||
148 | return regs->regs[2]; | ||
149 | else | ||
150 | return -regs->regs[2]; | ||
151 | } | ||
152 | |||
141 | #define instruction_pointer(regs) ((regs)->cp0_epc) | 153 | #define instruction_pointer(regs) ((regs)->cp0_epc) |
142 | #define profile_pc(regs) instruction_pointer(regs) | 154 | #define profile_pc(regs) instruction_pointer(regs) |
143 | 155 | ||