aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/signal_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/signal_64.c')
-rw-r--r--arch/sh/kernel/signal_64.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index 1d62dfef77f1..ce3e851dffcb 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -43,6 +43,10 @@
43 43
44#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 44#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
45 45
46static void
47handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
48 sigset_t *oldset, struct pt_regs * regs);
49
46/* 50/*
47 * Note that 'init' is a special process: it doesn't get signals it doesn't 51 * Note that 'init' is a special process: it doesn't get signals it doesn't
48 * want to handle. Thus you cannot kill init even with a SIGKILL even by 52 * want to handle. Thus you cannot kill init even with a SIGKILL even by
@@ -371,6 +375,9 @@ asmlinkage int sys_sigreturn(unsigned long r2, unsigned long r3,
371 sigset_t set; 375 sigset_t set;
372 long long ret; 376 long long ret;
373 377
378 /* Always make any pending restarted system calls return -EINTR */
379 current_thread_info()->restart_block.fn = do_no_restart_syscall;
380
374 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 381 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
375 goto badframe; 382 goto badframe;
376 383
@@ -408,6 +415,9 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
408 stack_t __user st; 415 stack_t __user st;
409 long long ret; 416 long long ret;
410 417
418 /* Always make any pending restarted system calls return -EINTR */
419 current_thread_info()->restart_block.fn = do_no_restart_syscall;
420
411 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 421 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
412 goto badframe; 422 goto badframe;
413 423
@@ -535,7 +545,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
535 * On SH5 all edited pointers are subject to NEFF 545 * On SH5 all edited pointers are subject to NEFF
536 */ 546 */
537 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? 547 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ?
538 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; 548 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR;
539 } else { 549 } else {
540 /* 550 /*
541 * Different approach on SH5. 551 * Different approach on SH5.
@@ -550,10 +560,10 @@ static void setup_frame(int sig, struct k_sigaction *ka,
550 */ 560 */
551 DEREF_REG_PR = (unsigned long) frame->retcode | 0x01; 561 DEREF_REG_PR = (unsigned long) frame->retcode | 0x01;
552 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? 562 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ?
553 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; 563 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR;
554 564
555 if (__copy_to_user(frame->retcode, 565 if (__copy_to_user(frame->retcode,
556 (unsigned long long)sa_default_restorer & (~1), 16) != 0) 566 (void *)((unsigned long)sa_default_restorer & (~1)), 16) != 0)
557 goto give_sigsegv; 567 goto give_sigsegv;
558 568
559 /* Cohere the trampoline with the I-cache. */ 569 /* Cohere the trampoline with the I-cache. */
@@ -566,7 +576,7 @@ static void setup_frame(int sig, struct k_sigaction *ka,
566 */ 576 */
567 regs->regs[REG_SP] = (unsigned long) frame; 577 regs->regs[REG_SP] = (unsigned long) frame;
568 regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ? 578 regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ?
569 (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP]; 579 (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP];
570 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ 580 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
571 581
572 /* FIXME: 582 /* FIXME:
@@ -652,7 +662,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
652 * On SH5 all edited pointers are subject to NEFF 662 * On SH5 all edited pointers are subject to NEFF
653 */ 663 */
654 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? 664 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ?
655 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; 665 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR;
656 } else { 666 } else {
657 /* 667 /*
658 * Different approach on SH5. 668 * Different approach on SH5.
@@ -668,10 +678,10 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
668 678
669 DEREF_REG_PR = (unsigned long) frame->retcode | 0x01; 679 DEREF_REG_PR = (unsigned long) frame->retcode | 0x01;
670 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ? 680 DEREF_REG_PR = (DEREF_REG_PR & NEFF_SIGN) ?
671 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR; 681 (DEREF_REG_PR | NEFF_MASK) : DEREF_REG_PR;
672 682
673 if (__copy_to_user(frame->retcode, 683 if (__copy_to_user(frame->retcode,
674 (unsigned long long)sa_default_rt_restorer & (~1), 16) != 0) 684 (void *)((unsigned long)sa_default_rt_restorer & (~1)), 16) != 0)
675 goto give_sigsegv; 685 goto give_sigsegv;
676 686
677 flush_icache_range(DEREF_REG_PR-1, DEREF_REG_PR-1+15); 687 flush_icache_range(DEREF_REG_PR-1, DEREF_REG_PR-1+15);
@@ -683,7 +693,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
683 */ 693 */
684 regs->regs[REG_SP] = (unsigned long) frame; 694 regs->regs[REG_SP] = (unsigned long) frame;
685 regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ? 695 regs->regs[REG_SP] = (regs->regs[REG_SP] & NEFF_SIGN) ?
686 (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP]; 696 (regs->regs[REG_SP] | NEFF_MASK) : regs->regs[REG_SP];
687 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ 697 regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
688 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;
689 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;