Commit 3197dac2 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Handle -ERESTART_RESTARTBLOCK for restartable syscalls.
  sh: oops_enter()/oops_exit() in die().
  sh: Fix restartable syscall arg5 clobbering.
parents 710675d3 3aeb884b
...@@ -268,7 +268,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, ...@@ -268,7 +268,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
badframe: badframe:
force_sig(SIGSEGV, current); force_sig(SIGSEGV, current);
return 0; return 0;
} }
/* /*
* Set up a signal frame. * Set up a signal frame.
...@@ -481,7 +481,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -481,7 +481,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
static int static int
handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *oldset, struct pt_regs *regs) sigset_t *oldset, struct pt_regs *regs, unsigned int save_r0)
{ {
int ret; int ret;
...@@ -489,6 +489,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -489,6 +489,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
if (regs->tra >= 0) { if (regs->tra >= 0) {
/* If so, check system call restarting.. */ /* If so, check system call restarting.. */
switch (regs->regs[0]) { switch (regs->regs[0]) {
case -ERESTART_RESTARTBLOCK:
case -ERESTARTNOHAND: case -ERESTARTNOHAND:
regs->regs[0] = -EINTR; regs->regs[0] = -EINTR;
break; break;
...@@ -500,6 +501,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -500,6 +501,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
} }
/* fallthrough */ /* fallthrough */
case -ERESTARTNOINTR: case -ERESTARTNOINTR:
regs->regs[0] = save_r0;
regs->pc -= instruction_size( regs->pc -= instruction_size(
ctrl_inw(regs->pc - 4)); ctrl_inw(regs->pc - 4));
break; break;
...@@ -583,7 +585,8 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) ...@@ -583,7 +585,8 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
signr = get_signal_to_deliver(&info, &ka, regs, NULL); signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { if (handle_signal(signr, &ka, &info, oldset,
regs, save_r0) == 0) {
/* a signal was successfully delivered; the saved /* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame, * sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply * and will be restored by sigreturn, so we can simply
......
...@@ -83,6 +83,8 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -83,6 +83,8 @@ void die(const char * str, struct pt_regs * regs, long err)
{ {
static int die_counter; static int die_counter;
oops_enter();
console_verbose(); console_verbose();
spin_lock_irq(&die_lock); spin_lock_irq(&die_lock);
bust_spinlocks(1); bust_spinlocks(1);
...@@ -112,6 +114,7 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -112,6 +114,7 @@ void die(const char * str, struct pt_regs * regs, long err)
if (panic_on_oops) if (panic_on_oops)
panic("Fatal exception"); panic("Fatal exception");
oops_exit();
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
......
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