Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131001
b: refs/heads/master
c: 03f0787
h: refs/heads/master
i:
  130999: be4c102
v: v3
  • Loading branch information
Paul Mundt committed Jan 29, 2009
1 parent 7cb7d2b commit 44826a5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 45 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f6dee232f84c11ec195721571763ccae1b82639
refs/heads/master: 03f07876df2565321871a2dbf33c5c737df185df
22 changes: 3 additions & 19 deletions trunk/arch/sh/include/asm/syscall_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,10 @@ static inline void syscall_rollback(struct task_struct *task,
*/
}

static inline bool syscall_has_error(struct pt_regs *regs)
{
return (regs->sr & 0x1) ? true : false;
}
static inline void syscall_set_error(struct pt_regs *regs)
{
regs->sr |= 0x1;
}
static inline void syscall_clear_error(struct pt_regs *regs)
{
regs->sr &= ~0x1;
}

static inline long syscall_get_error(struct task_struct *task,
struct pt_regs *regs)
{
return syscall_has_error(regs) ? regs->regs[0] : 0;
return IS_ERR_VALUE(regs->regs[0]) ? regs->regs[0] : 0;
}

static inline long syscall_get_return_value(struct task_struct *task,
Expand All @@ -50,13 +37,10 @@ static inline void syscall_set_return_value(struct task_struct *task,
struct pt_regs *regs,
int error, long val)
{
if (error) {
syscall_set_error(regs);
if (error)
regs->regs[0] = -error;
} else {
syscall_clear_error(regs);
else
regs->regs[0] = val;
}
}

static inline void syscall_get_arguments(struct task_struct *task,
Expand Down
22 changes: 3 additions & 19 deletions trunk/arch/sh/include/asm/syscall_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,10 @@ static inline void syscall_rollback(struct task_struct *task,
*/
}

static inline bool syscall_has_error(struct pt_regs *regs)
{
return (regs->sr & 0x1) ? true : false;
}
static inline void syscall_set_error(struct pt_regs *regs)
{
regs->sr |= 0x1;
}
static inline void syscall_clear_error(struct pt_regs *regs)
{
regs->sr &= ~0x1;
}

static inline long syscall_get_error(struct task_struct *task,
struct pt_regs *regs)
{
return syscall_has_error(regs) ? regs->regs[9] : 0;
return IS_ERR_VALUE(regs->regs[9]) ? regs->regs[9] : 0;
}

static inline long syscall_get_return_value(struct task_struct *task,
Expand All @@ -50,13 +37,10 @@ static inline void syscall_set_return_value(struct task_struct *task,
struct pt_regs *regs,
int error, long val)
{
if (error) {
syscall_set_error(regs);
if (error)
regs->regs[9] = -error;
} else {
syscall_clear_error(regs);
else
regs->regs[9] = val;
}
}

static inline void syscall_get_arguments(struct task_struct *task,
Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/sh/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ handle_syscall_restart(unsigned long save_r0, struct pt_regs *regs,
case -ERESTARTNOHAND:
no_system_call_restart:
regs->regs[0] = -EINTR;
regs->sr |= 1;
break;

case -ERESTARTSYS:
Expand Down Expand Up @@ -589,8 +588,7 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)

signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) {
if (regs->sr & 1)
handle_syscall_restart(save_r0, regs, &ka.sa);
handle_syscall_restart(save_r0, regs, &ka.sa);

/* Whee! Actually deliver the signal. */
if (handle_signal(signr, &ka, &info, oldset,
Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/sh/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ handle_syscall_restart(struct pt_regs *regs, struct sigaction *sa)
case -ERESTARTNOHAND:
no_system_call_restart:
regs->regs[REG_RET] = -EINTR;
regs->sr |= 1;
break;

case -ERESTARTSYS:
Expand Down Expand Up @@ -109,8 +108,7 @@ static int do_signal(struct pt_regs *regs, sigset_t *oldset)

signr = get_signal_to_deliver(&info, &ka, regs, 0);
if (signr > 0) {
if (regs->sr & 1)
handle_syscall_restart(regs, &ka.sa);
handle_syscall_restart(regs, &ka.sa);

/* Whee! Actually deliver the signal. */
if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
Expand Down

0 comments on commit 44826a5

Please sign in to comment.