diff options
author | Jonas Bonn <jonas@southpole.se> | 2012-03-02 04:05:24 -0500 |
---|---|---|
committer | Jonas Bonn <jonas@southpole.se> | 2012-03-06 04:37:00 -0500 |
commit | 6cbe5e95267449ea0b79c0b049342409949da3ac (patch) | |
tree | 21243a6c899b27f67338d77a28ccbe0f473272bc /arch/openrisc/include/asm/syscall.h | |
parent | 2f099a280e92c259598d8ed8da82c7ec2dd49845 (diff) |
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 <jonas@southpole.se>
Diffstat (limited to 'arch/openrisc/include/asm/syscall.h')
-rw-r--r-- | arch/openrisc/include/asm/syscall.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/openrisc/include/asm/syscall.h b/arch/openrisc/include/asm/syscall.h index 9f0337055d26..b752bb67891d 100644 --- a/arch/openrisc/include/asm/syscall.h +++ b/arch/openrisc/include/asm/syscall.h | |||
@@ -25,7 +25,7 @@ | |||
25 | static inline int | 25 | static inline int |
26 | syscall_get_nr(struct task_struct *task, struct pt_regs *regs) | 26 | syscall_get_nr(struct task_struct *task, struct pt_regs *regs) |
27 | { | 27 | { |
28 | return regs->syscallno ? regs->syscallno : -1; | 28 | return regs->orig_gpr11; |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline void | 31 | static inline void |
@@ -50,10 +50,7 @@ static inline void | |||
50 | syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, | 50 | syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, |
51 | int error, long val) | 51 | int error, long val) |
52 | { | 52 | { |
53 | if (error) | 53 | regs->gpr[11] = (long) error ?: val; |
54 | regs->gpr[11] = -error; | ||
55 | else | ||
56 | regs->gpr[11] = val; | ||
57 | } | 54 | } |
58 | 55 | ||
59 | static inline void | 56 | static inline void |