diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-09-24 01:37:35 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-09-24 01:37:35 -0400 |
commit | 1bec157a1f747d038026efabebdee4c929147b63 (patch) | |
tree | 500ff4ba3e45c5cfe40021ccb7cec5b56ef6e0bc /arch/sh/kernel/signal_64.c | |
parent | aa88f169d6fc4305125b6917d9d5f2e08211f011 (diff) |
sh: Force pending restarted system calls to return -EINTR.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/signal_64.c')
-rw-r--r-- | arch/sh/kernel/signal_64.c | 18 |
1 files changed, 12 insertions, 6 deletions
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; |