aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-19 11:07:34 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-19 11:07:34 -0400
commit3197dac24f4f98808a47c68cdb8efeee8539add1 (patch)
tree6855c488c677d6be01e457161c3434628d0b2f10 /arch
parent710675d3609b1123a40db1eb28bf34041b1d37f2 (diff)
parent3aeb884b4ec442719a2d8aa15316415a7412efd8 (diff)
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.
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/kernel/signal.c9
-rw-r--r--arch/sh/kernel/traps.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c
index b32c35a7c0a3..e323e299878b 100644
--- a/arch/sh/kernel/signal.c
+++ b/arch/sh/kernel/signal.c
@@ -268,7 +268,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
268badframe: 268badframe:
269 force_sig(SIGSEGV, current); 269 force_sig(SIGSEGV, current);
270 return 0; 270 return 0;
271} 271}
272 272
273/* 273/*
274 * Set up a signal frame. 274 * Set up a signal frame.
@@ -481,7 +481,7 @@ give_sigsegv:
481 481
482static int 482static int
483handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, 483handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
484 sigset_t *oldset, struct pt_regs *regs) 484 sigset_t *oldset, struct pt_regs *regs, unsigned int save_r0)
485{ 485{
486 int ret; 486 int ret;
487 487
@@ -489,6 +489,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
489 if (regs->tra >= 0) { 489 if (regs->tra >= 0) {
490 /* If so, check system call restarting.. */ 490 /* If so, check system call restarting.. */
491 switch (regs->regs[0]) { 491 switch (regs->regs[0]) {
492 case -ERESTART_RESTARTBLOCK:
492 case -ERESTARTNOHAND: 493 case -ERESTARTNOHAND:
493 regs->regs[0] = -EINTR; 494 regs->regs[0] = -EINTR;
494 break; 495 break;
@@ -500,6 +501,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
500 } 501 }
501 /* fallthrough */ 502 /* fallthrough */
502 case -ERESTARTNOINTR: 503 case -ERESTARTNOINTR:
504 regs->regs[0] = save_r0;
503 regs->pc -= instruction_size( 505 regs->pc -= instruction_size(
504 ctrl_inw(regs->pc - 4)); 506 ctrl_inw(regs->pc - 4));
505 break; 507 break;
@@ -583,7 +585,8 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
583 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 585 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
584 if (signr > 0) { 586 if (signr > 0) {
585 /* Whee! Actually deliver the signal. */ 587 /* Whee! Actually deliver the signal. */
586 if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { 588 if (handle_signal(signr, &ka, &info, oldset,
589 regs, save_r0) == 0) {
587 /* a signal was successfully delivered; the saved 590 /* a signal was successfully delivered; the saved
588 * sigmask will have been stored in the signal frame, 591 * sigmask will have been stored in the signal frame,
589 * and will be restored by sigreturn, so we can simply 592 * and will be restored by sigreturn, so we can simply
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 5b75cb6f8f9b..8f18930d5bf8 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -83,6 +83,8 @@ void die(const char * str, struct pt_regs * regs, long err)
83{ 83{
84 static int die_counter; 84 static int die_counter;
85 85
86 oops_enter();
87
86 console_verbose(); 88 console_verbose();
87 spin_lock_irq(&die_lock); 89 spin_lock_irq(&die_lock);
88 bust_spinlocks(1); 90 bust_spinlocks(1);
@@ -112,6 +114,7 @@ void die(const char * str, struct pt_regs * regs, long err)
112 if (panic_on_oops) 114 if (panic_on_oops)
113 panic("Fatal exception"); 115 panic("Fatal exception");
114 116
117 oops_exit();
115 do_exit(SIGSEGV); 118 do_exit(SIGSEGV);
116} 119}
117 120