aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/syscall_64.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-01-28 21:21:38 -0500
committerPaul Mundt <lethal@linux-sh.org>2009-01-28 21:56:03 -0500
commit03f07876df2565321871a2dbf33c5c737df185df (patch)
treec0c5d6d9a83e53acfc2052d99ff4e26f360af018 /arch/sh/include/asm/syscall_64.h
parent0f6dee232f84c11ec195721571763ccae1b82639 (diff)
sh: Fix up spurious syscall restarting.
The T-bit manipulation for syscall error checking had the side effect of spuriously returning ERESTART* errno values over EINTR. So, we simplify the error checking a bit and leave the T-bit alone. Reported-by: Kaz Kojima <kkojima@rr.iij4u.or.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/syscall_64.h')
-rw-r--r--arch/sh/include/asm/syscall_64.h22
1 files changed, 3 insertions, 19 deletions
diff --git a/arch/sh/include/asm/syscall_64.h b/arch/sh/include/asm/syscall_64.h
index e1143b9784d..c3561ca72be 100644
--- a/arch/sh/include/asm/syscall_64.h
+++ b/arch/sh/include/asm/syscall_64.h
@@ -21,23 +21,10 @@ static inline void syscall_rollback(struct task_struct *task,
21 */ 21 */
22} 22}
23 23
24static inline bool syscall_has_error(struct pt_regs *regs)
25{
26 return (regs->sr & 0x1) ? true : false;
27}
28static inline void syscall_set_error(struct pt_regs *regs)
29{
30 regs->sr |= 0x1;
31}
32static inline void syscall_clear_error(struct pt_regs *regs)
33{
34 regs->sr &= ~0x1;
35}
36
37static inline long syscall_get_error(struct task_struct *task, 24static inline long syscall_get_error(struct task_struct *task,
38 struct pt_regs *regs) 25 struct pt_regs *regs)
39{ 26{
40 return syscall_has_error(regs) ? regs->regs[9] : 0; 27 return IS_ERR_VALUE(regs->regs[9]) ? regs->regs[9] : 0;
41} 28}
42 29
43static inline long syscall_get_return_value(struct task_struct *task, 30static inline long syscall_get_return_value(struct task_struct *task,
@@ -50,13 +37,10 @@ static inline void syscall_set_return_value(struct task_struct *task,
50 struct pt_regs *regs, 37 struct pt_regs *regs,
51 int error, long val) 38 int error, long val)
52{ 39{
53 if (error) { 40 if (error)
54 syscall_set_error(regs);
55 regs->regs[9] = -error; 41 regs->regs[9] = -error;
56 } else { 42 else
57 syscall_clear_error(regs);
58 regs->regs[9] = val; 43 regs->regs[9] = val;
59 }
60} 44}
61 45
62static inline void syscall_get_arguments(struct task_struct *task, 46static inline void syscall_get_arguments(struct task_struct *task,