summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/ptrace.h
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-16 13:23:04 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-16 13:25:34 +0100
commit46479e698530b8197d601a23317b7c7654195338 (patch)
tree710b2758ecd7d8a6ada37724c5d4c8027d5f358f /arch/mips/include/asm/ptrace.h
parentBluetooth: Fix event sending with DISCOVERY_STOPPED state (diff)
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil... (diff)
downloadlinux-46479e698530b8197d601a23317b7c7654195338.tar.xz
linux-46479e698530b8197d601a23317b7c7654195338.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git
Conflicts: include/net/bluetooth/l2cap.h net/bluetooth/hci_conn.c net/bluetooth/l2cap_core.c
Diffstat (limited to 'arch/mips/include/asm/ptrace.h')
-rw-r--r--arch/mips/include/asm/ptrace.h14
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,
*/
#define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER)
-#define regs_return_value(_regs) ((_regs)->regs[2])
+static inline int is_syscall_success(struct pt_regs *regs)
+{
+ return !regs->regs[7];
+}
+
+static inline long regs_return_value(struct pt_regs *regs)
+{
+ if (is_syscall_success(regs))
+ return regs->regs[2];
+ else
+ return -regs->regs[2];
+}
+
#define instruction_pointer(regs) ((regs)->cp0_epc)
#define profile_pc(regs) instruction_pointer(regs)