summaryrefslogtreecommitdiffstats
path: root/arch/csky
diff options
context:
space:
mode:
Diffstat (limited to 'arch/csky')
-rw-r--r--arch/csky/include/asm/syscall.h7
-rw-r--r--arch/csky/kernel/ptrace.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/arch/csky/include/asm/syscall.h b/arch/csky/include/asm/syscall.h
index 850b694a463e..8278658e74f9 100644
--- a/arch/csky/include/asm/syscall.h
+++ b/arch/csky/include/asm/syscall.h
@@ -17,6 +17,13 @@ syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
}
static inline void
+syscall_set_nr(struct task_struct *task, struct pt_regs *regs,
+ int sysno)
+{
+ regs_syscallid(regs) = sysno;
+}
+
+static inline void
syscall_rollback(struct task_struct *task, struct pt_regs *regs)
{
regs->a0 = regs->orig_a0;
diff --git a/arch/csky/kernel/ptrace.c b/arch/csky/kernel/ptrace.c
index 91bc74bb569f..313623a19ecb 100644
--- a/arch/csky/kernel/ptrace.c
+++ b/arch/csky/kernel/ptrace.c
@@ -215,7 +215,8 @@ long arch_ptrace(struct task_struct *child, long request,
asmlinkage void syscall_trace_enter(struct pt_regs *regs)
{
if (test_thread_flag(TIF_SYSCALL_TRACE))
- tracehook_report_syscall_entry(regs);
+ if (tracehook_report_syscall_entry(regs))
+ syscall_set_nr(current, regs, -1);
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
trace_sys_enter(regs, syscall_get_nr(current, regs));