Commit 6024955e authored by David S. Miller's avatar David S. Miller

[SPARC]: ADd ERESTART_RESTARTBLOCK signal return handling.

parent 3694fbeb
...@@ -1019,6 +1019,9 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, ...@@ -1019,6 +1019,9 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
struct sigaction *sa) struct sigaction *sa)
{ {
switch(regs->u_regs[UREG_I0]) { switch(regs->u_regs[UREG_I0]) {
case ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn = do_no_restart_syscall;
/* fallthrough */
case ERESTARTNOHAND: case ERESTARTNOHAND:
no_system_call_restart: no_system_call_restart:
regs->u_regs[UREG_I0] = EINTR; regs->u_regs[UREG_I0] = EINTR;
...@@ -1084,6 +1087,13 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, ...@@ -1084,6 +1087,13 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
regs->npc -= 4; regs->npc -= 4;
restart_syscall = 0; restart_syscall = 0;
} }
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->pc -= 4;
regs->npc -= 4;
restart_syscall = 0;
}
current->exit_code = signr; current->exit_code = signr;
set_current_state(TASK_STOPPED); set_current_state(TASK_STOPPED);
...@@ -1184,6 +1194,12 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, ...@@ -1184,6 +1194,12 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
regs->pc -= 4; regs->pc -= 4;
regs->npc -= 4; regs->npc -= 4;
} }
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->pc -= 4;
regs->npc -= 4;
}
return 0; return 0;
} }
......
...@@ -573,6 +573,9 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, ...@@ -573,6 +573,9 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
struct sigaction *sa) struct sigaction *sa)
{ {
switch (regs->u_regs[UREG_I0]) { switch (regs->u_regs[UREG_I0]) {
case ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn = do_no_restart_syscall;
/* fallthrough */
case ERESTARTNOHAND: case ERESTARTNOHAND:
no_system_call_restart: no_system_call_restart:
regs->u_regs[UREG_I0] = EINTR; regs->u_regs[UREG_I0] = EINTR;
...@@ -634,6 +637,13 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs, ...@@ -634,6 +637,13 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs,
regs->tnpc -= 4; regs->tnpc -= 4;
restart_syscall = 0; restart_syscall = 0;
} }
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4;
regs->tnpc -= 4;
restart_syscall = 0;
}
current->exit_code = signr; current->exit_code = signr;
set_current_state(TASK_STOPPED); set_current_state(TASK_STOPPED);
...@@ -727,6 +737,12 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs, ...@@ -727,6 +737,12 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs,
regs->tpc -= 4; regs->tpc -= 4;
regs->tnpc -= 4; regs->tnpc -= 4;
} }
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4;
regs->tnpc -= 4;
}
return 0; return 0;
} }
......
...@@ -1253,6 +1253,9 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs ...@@ -1253,6 +1253,9 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs
struct sigaction *sa) struct sigaction *sa)
{ {
switch (regs->u_regs[UREG_I0]) { switch (regs->u_regs[UREG_I0]) {
case ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn = do_no_restart_syscall;
/* fallthrough */
case ERESTARTNOHAND: case ERESTARTNOHAND:
no_system_call_restart: no_system_call_restart:
regs->u_regs[UREG_I0] = EINTR; regs->u_regs[UREG_I0] = EINTR;
...@@ -1306,6 +1309,13 @@ int do_signal32(sigset_t *oldset, struct pt_regs * regs, ...@@ -1306,6 +1309,13 @@ int do_signal32(sigset_t *oldset, struct pt_regs * regs,
regs->tnpc -= 4; regs->tnpc -= 4;
restart_syscall = 0; restart_syscall = 0;
} }
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4;
regs->tnpc -= 4;
restart_syscall = 0;
}
current->exit_code = signr; current->exit_code = signr;
set_current_state(TASK_STOPPED); set_current_state(TASK_STOPPED);
...@@ -1398,6 +1408,12 @@ int do_signal32(sigset_t *oldset, struct pt_regs * regs, ...@@ -1398,6 +1408,12 @@ int do_signal32(sigset_t *oldset, struct pt_regs * regs,
regs->tpc -= 4; regs->tpc -= 4;
regs->tnpc -= 4; regs->tnpc -= 4;
} }
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4;
regs->tnpc -= 4;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment