diff options
Diffstat (limited to 'arch/powerpc/include/asm/syscall.h')
-rw-r--r-- | arch/powerpc/include/asm/syscall.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h index 81abcf6a737b..38d62acfdce7 100644 --- a/arch/powerpc/include/asm/syscall.h +++ b/arch/powerpc/include/asm/syscall.h | |||
@@ -35,6 +35,16 @@ static inline void syscall_rollback(struct task_struct *task, | |||
35 | regs->gpr[3] = regs->orig_gpr3; | 35 | regs->gpr[3] = regs->orig_gpr3; |
36 | } | 36 | } |
37 | 37 | ||
38 | static inline long syscall_get_error(struct task_struct *task, | ||
39 | struct pt_regs *regs) | ||
40 | { | ||
41 | /* | ||
42 | * If the system call failed, | ||
43 | * regs->gpr[3] contains a positive ERRORCODE. | ||
44 | */ | ||
45 | return (regs->ccr & 0x10000000UL) ? -regs->gpr[3] : 0; | ||
46 | } | ||
47 | |||
38 | static inline long syscall_get_return_value(struct task_struct *task, | 48 | static inline long syscall_get_return_value(struct task_struct *task, |
39 | struct pt_regs *regs) | 49 | struct pt_regs *regs) |
40 | { | 50 | { |