summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/syscall.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2013-09-06 20:24:48 +0200
committerRalf Baechle <ralf@linux-mips.org>2013-10-29 21:25:16 +0100
commit1d7bf993e0731b4ac790667c196b2a2d787f95c3 (patch)
tree235093a4593d6c68b87b5d602a2f1d0dde3ad085 /arch/mips/include/asm/syscall.h
parent0dfa95aaa817eec8473abf5465eae135b1cf1138 (diff)
MIPS: ftrace: Add support for syscall tracepoints.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/syscall.h')
-rw-r--r--arch/mips/include/asm/syscall.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 087df5f26f86..81c89132c59d 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -59,6 +59,25 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
}
}
+static inline long syscall_get_return_value(struct task_struct *task,
+ struct pt_regs *regs)
+{
+ return regs->regs[2];
+}
+
+static inline void syscall_set_return_value(struct task_struct *task,
+ struct pt_regs *regs,
+ int error, long val)
+{
+ if (error) {
+ regs->regs[2] = -error;
+ regs->regs[7] = -1;
+ } else {
+ regs->regs[2] = val;
+ regs->regs[7] = 0;
+ }
+}
+
static inline void syscall_get_arguments(struct task_struct *task,
struct pt_regs *regs,
unsigned int i, unsigned int n,