Skip to content

Commit

Permalink
powerpc: Use correct ccr bit for syscall error status
Browse files Browse the repository at this point in the history
The powerpc implementations of syscall_get_error and
syscall_set_return_value should use CCR0:S0 (0x10000000) for testing
and setting syscall error status.  Fortunately these APIs don't seem
to be used at the moment.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Nathan Lynch authored and Benjamin Herrenschmidt committed Mar 19, 2010
1 parent d6a8536 commit 409d241
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/powerpc/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static inline void syscall_rollback(struct task_struct *task,
static inline long syscall_get_error(struct task_struct *task,
struct pt_regs *regs)
{
return (regs->ccr & 0x1000) ? -regs->gpr[3] : 0;
return (regs->ccr & 0x10000000) ? -regs->gpr[3] : 0;
}

static inline long syscall_get_return_value(struct task_struct *task,
Expand All @@ -44,10 +44,10 @@ static inline void syscall_set_return_value(struct task_struct *task,
int error, long val)
{
if (error) {
regs->ccr |= 0x1000L;
regs->ccr |= 0x10000000L;
regs->gpr[3] = -error;
} else {
regs->ccr &= ~0x1000L;
regs->ccr &= ~0x10000000L;
regs->gpr[3] = val;
}
}
Expand Down

0 comments on commit 409d241

Please sign in to comment.