From 6cbe5e95267449ea0b79c0b049342409949da3ac Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Fri, 2 Mar 2012 10:05:24 +0100 Subject: openrisc: sanitize use of orig_gpr11 The pt_regs struct had both a 'syscallno' field and an 'orig_gpr11' field and it wasn't really clear how these were supposed to be used. This patch removes the syscallno field altogether and makes orig_gpr11 work more like other architectures: keep track of syscall number in progress or hold -1 for non-syscall exceptions. Signed-off-by: Jonas Bonn --- arch/openrisc/include/asm/syscall.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'arch/openrisc/include/asm/syscall.h') diff --git a/arch/openrisc/include/asm/syscall.h b/arch/openrisc/include/asm/syscall.h index 9f0337055d2..b752bb67891 100644 --- a/arch/openrisc/include/asm/syscall.h +++ b/arch/openrisc/include/asm/syscall.h @@ -25,7 +25,7 @@ static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) { - return regs->syscallno ? regs->syscallno : -1; + return regs->orig_gpr11; } static inline void @@ -50,10 +50,7 @@ static inline void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, int error, long val) { - if (error) - regs->gpr[11] = -error; - else - regs->gpr[11] = val; + regs->gpr[11] = (long) error ?: val; } static inline void -- cgit v1.2.3-70-g09d2