aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/kernel/signal_32.c6
-rw-r--r--arch/sh/kernel/signal_64.c18
2 files changed, 18 insertions, 6 deletions
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index be194d0bd7d2..69d09c0b3498 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -216,6 +216,9 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5,
216 sigset_t set; 216 sigset_t set;
217 int r0; 217 int r0;
218 218
219 /* Always make any pending restarted system calls return -EINTR */
220 current_thread_info()->restart_block.fn = do_no_restart_syscall;
221
219 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 222 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
220 goto badframe; 223 goto badframe;
221 224
@@ -250,6 +253,9 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
250 sigset_t set; 253 sigset_t set;
251 int r0; 254 int r0;
252 255
256 /* Always make any pending restarted system calls return -EINTR */
257 current_thread_info()->restart_block.fn = do_no_restart_syscall;
258
253 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 259 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
254 goto badframe; 260 goto badframe;
255 261
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index 37bd381a7aa3..0582ae4739ba 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -375,6 +375,9 @@ asmlinkage int sys_sigreturn(unsigned long r2, unsigned long r3,
375 sigset_t set; 375 sigset_t set;
376 long long ret; 376 long long ret;
377 377
378 /* Always make any pending restarted system calls return -EINTR */
379 current_thread_info()->restart_block.fn = do_no_restart_syscall;
380
378 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 381 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
379 goto badframe; 382 goto badframe;
380 383
@@ -412,6 +415,9 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
412 stack_t __user st; 415 stack_t __user st;
413 long long ret; 416 long long ret;
414 417
418 /* Always make any pending restarted system calls return -EINTR */
419 current_thread_info()->restart_block.fn = do_no_restart_syscall;
420
415 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 421 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
416 goto badframe; 422 goto badframe;
417 423
@@ -539,7 +545,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
539 * On SH5 all edited pointers are subject to NEFF 545 * On SH5 all edited pointers are subject to NEFF
540 */ 546 */
541 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? 547 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ?
542 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; 548 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR;
543 } else { 549 } else {
544 /* 550 /*
545 * Different approach on SH5. 551 * Different approach on SH5.
@@ -554,7 +560,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
554 */ 560 */
555 DEREF_REG_PR = (unsigned long) frame->retcode | 0x01; 561 DEREF_REG_PR = (unsigned long) frame->retcode | 0x01;
556 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? 562 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ?
557 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; 563 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR;
558 564
559 if (__copy_to_user(frame->retcode, 565 if (__copy_to_user(frame->retcode,
560 (unsigned long long)sa_default_restorer & (~1), 16) != 0) 566 (unsigned long long)sa_default_restorer & (~1), 16) != 0)
@@ -570,7 +576,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
570 */ 576 */
571 regs->regs[REG_SP] = (unsigned long) frame; 577 regs->regs[REG_SP] = (unsigned long) frame;
572 regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ? 578 regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ?
573 (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP]; 579 (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP];
574 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ 580 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
575 581
576 /* FIXME: 582 /* FIXME:
@@ -656,7 +662,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
656 * On SH5 all edited pointers are subject to NEFF 662 * On SH5 all edited pointers are subject to NEFF
657 */ 663 */
658 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? 664 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ?
659 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; 665 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR;
660 } else { 666 } else {
661 /* 667 /*
662 * Different approach on SH5. 668 * Different approach on SH5.
@@ -672,7 +678,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
672 678
673 DEREF_REG_PR = (unsigned long) frame->retcode | 0x01; 679 DEREF_REG_PR = (unsigned long) frame->retcode | 0x01;
674 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? 680 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ?
675 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; 681 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR;
676 682
677 if (__copy_to_user(frame->retcode, 683 if (__copy_to_user(frame->retcode,
678 (unsigned long long)sa_default_rt_restorer & (~1), 16) != 0) 684 (unsigned long long)sa_default_rt_restorer & (~1), 16) != 0)
@@ -687,7 +693,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
687 */ 693 */
688 regs->regs[REG_SP] = (unsigned long) frame; 694 regs->regs[REG_SP] = (unsigned long) frame;
689 regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ? 695 regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ?
690 (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP]; 696 (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP];
691 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ 697 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
692 regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info; 698 regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info;
693 regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext; 699 regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext;