Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36292
b: refs/heads/master
c: 0b89293
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Sep 27, 2006
1 parent 5d4fa51 commit e1c679d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 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: e96636ccfa373a00a0ee0558e1971baa7856d8b5
refs/heads/master: 0b8929354cdeddb17e81bfda903812c9adfd0b67
2 changes: 2 additions & 0 deletions trunk/arch/sh/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ work_notifysig:
bt/s restore_all
mov r15, r4
mov #0, r5
mov r12, r6 ! set arg2(save_r0)
mov.l 2f, r1
mova restore_all, r0
jmp @r1
Expand Down Expand Up @@ -534,6 +535,7 @@ syscall_call:
mov.l @r9, r8
jsr @r8 ! jump to specific syscall handler
nop
mov.l @(OFF_R0,r15), r12 ! save r0
mov.l r0, @(OFF_R0,r15) ! save the return value
!
syscall_exit:
Expand Down
16 changes: 10 additions & 6 deletions trunk/arch/sh/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))

asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset,
unsigned int save_r0);

/*
* Atomically swap in the new signal mask, and wait for a signal.
Expand All @@ -56,7 +57,7 @@ sys_sigsuspend(old_sigset_t mask,
while (1) {
current->state = TASK_INTERRUPTIBLE;
schedule();
if (do_signal(&regs, &saveset))
if (do_signal(&regs, &saveset, regs.regs[0]))
return -EINTR;
}
}
Expand Down Expand Up @@ -85,7 +86,7 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize,
while (1) {
current->state = TASK_INTERRUPTIBLE;
schedule();
if (do_signal(&regs, &saveset))
if (do_signal(&regs, &saveset, regs.regs[0]))
return -EINTR;
}
}
Expand Down Expand Up @@ -563,7 +564,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
* the kernel can handle, and then we build all the user-level signal handling
* stack-frames in one go after that.
*/
int do_signal(struct pt_regs *regs, sigset_t *oldset)
int do_signal(struct pt_regs *regs, sigset_t *oldset, unsigned int save_r0)
{
siginfo_t info;
int signr;
Expand Down Expand Up @@ -597,9 +598,12 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
/* Restart the system call - no handlers present */
if (regs->regs[0] == -ERESTARTNOHAND ||
regs->regs[0] == -ERESTARTSYS ||
regs->regs[0] == -ERESTARTNOINTR ||
regs->regs[0] == -ERESTART_RESTARTBLOCK) {
regs->regs[0] == -ERESTARTNOINTR) {
regs->regs[0] = save_r0;
regs->pc -= 2;
} else if (regs->regs[0] == -ERESTART_RESTARTBLOCK) {
regs->pc -= 2;
regs->regs[3] = __NR_restart_syscall;
}
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/kernel/syscalls.S
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

.data
ENTRY(sys_call_table)
.long sys_ni_syscall /* 0 - old "setup()" system call*/
.long sys_restart_syscall /* 0 - old "setup()" system call*/
.long sys_exit
.long sys_fork
.long sys_read
Expand Down

0 comments on commit e1c679d

Please sign in to comment.