diff options
Diffstat (limited to 'arch/ia64/kernel/signal.c')
-rw-r--r-- | arch/ia64/kernel/signal.c | 54 |
1 files changed, 14 insertions, 40 deletions
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index e1821ca4c7df..7bdafc8788bd 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/unistd.h> | 21 | #include <linux/unistd.h> |
22 | #include <linux/wait.h> | 22 | #include <linux/wait.h> |
23 | 23 | ||
24 | #include <asm/ia32.h> | ||
25 | #include <asm/intrinsics.h> | 24 | #include <asm/intrinsics.h> |
26 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
27 | #include <asm/rse.h> | 26 | #include <asm/rse.h> |
@@ -425,14 +424,8 @@ static long | |||
425 | handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, | 424 | handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, |
426 | struct sigscratch *scr) | 425 | struct sigscratch *scr) |
427 | { | 426 | { |
428 | if (IS_IA32_PROCESS(&scr->pt)) { | 427 | if (!setup_frame(sig, ka, info, oldset, scr)) |
429 | /* send signal to IA-32 process */ | 428 | return 0; |
430 | if (!ia32_setup_frame1(sig, ka, info, oldset, &scr->pt)) | ||
431 | return 0; | ||
432 | } else | ||
433 | /* send signal to IA-64 process */ | ||
434 | if (!setup_frame(sig, ka, info, oldset, scr)) | ||
435 | return 0; | ||
436 | 429 | ||
437 | spin_lock_irq(¤t->sighand->siglock); | 430 | spin_lock_irq(¤t->sighand->siglock); |
438 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); | 431 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); |
@@ -462,7 +455,6 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall) | |||
462 | siginfo_t info; | 455 | siginfo_t info; |
463 | long restart = in_syscall; | 456 | long restart = in_syscall; |
464 | long errno = scr->pt.r8; | 457 | long errno = scr->pt.r8; |
465 | # define ERR_CODE(c) (IS_IA32_PROCESS(&scr->pt) ? -(c) : (c)) | ||
466 | 458 | ||
467 | /* | 459 | /* |
468 | * In the ia64_leave_kernel code path, we want the common case to go fast, which | 460 | * In the ia64_leave_kernel code path, we want the common case to go fast, which |
@@ -490,14 +482,7 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall) | |||
490 | * inferior call), thus it's important to check for restarting _after_ | 482 | * inferior call), thus it's important to check for restarting _after_ |
491 | * get_signal_to_deliver(). | 483 | * get_signal_to_deliver(). |
492 | */ | 484 | */ |
493 | if (IS_IA32_PROCESS(&scr->pt)) { | 485 | if ((long) scr->pt.r10 != -1) |
494 | if (in_syscall) { | ||
495 | if (errno >= 0) | ||
496 | restart = 0; | ||
497 | else | ||
498 | errno = -errno; | ||
499 | } | ||
500 | } else if ((long) scr->pt.r10 != -1) | ||
501 | /* | 486 | /* |
502 | * A system calls has to be restarted only if one of the error codes | 487 | * A system calls has to be restarted only if one of the error codes |
503 | * ERESTARTNOHAND, ERESTARTSYS, or ERESTARTNOINTR is returned. If r10 | 488 | * ERESTARTNOHAND, ERESTARTSYS, or ERESTARTNOINTR is returned. If r10 |
@@ -513,22 +498,18 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall) | |||
513 | switch (errno) { | 498 | switch (errno) { |
514 | case ERESTART_RESTARTBLOCK: | 499 | case ERESTART_RESTARTBLOCK: |
515 | case ERESTARTNOHAND: | 500 | case ERESTARTNOHAND: |
516 | scr->pt.r8 = ERR_CODE(EINTR); | 501 | scr->pt.r8 = EINTR; |
517 | /* note: scr->pt.r10 is already -1 */ | 502 | /* note: scr->pt.r10 is already -1 */ |
518 | break; | 503 | break; |
519 | 504 | ||
520 | case ERESTARTSYS: | 505 | case ERESTARTSYS: |
521 | if ((ka.sa.sa_flags & SA_RESTART) == 0) { | 506 | if ((ka.sa.sa_flags & SA_RESTART) == 0) { |
522 | scr->pt.r8 = ERR_CODE(EINTR); | 507 | scr->pt.r8 = EINTR; |
523 | /* note: scr->pt.r10 is already -1 */ | 508 | /* note: scr->pt.r10 is already -1 */ |
524 | break; | 509 | break; |
525 | } | 510 | } |
526 | case ERESTARTNOINTR: | 511 | case ERESTARTNOINTR: |
527 | if (IS_IA32_PROCESS(&scr->pt)) { | 512 | ia64_decrement_ip(&scr->pt); |
528 | scr->pt.r8 = scr->pt.r1; | ||
529 | scr->pt.cr_iip -= 2; | ||
530 | } else | ||
531 | ia64_decrement_ip(&scr->pt); | ||
532 | restart = 0; /* don't restart twice if handle_signal() fails... */ | 513 | restart = 0; /* don't restart twice if handle_signal() fails... */ |
533 | } | 514 | } |
534 | } | 515 | } |
@@ -555,21 +536,14 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall) | |||
555 | if (errno == ERESTARTNOHAND || errno == ERESTARTSYS || errno == ERESTARTNOINTR | 536 | if (errno == ERESTARTNOHAND || errno == ERESTARTSYS || errno == ERESTARTNOINTR |
556 | || errno == ERESTART_RESTARTBLOCK) | 537 | || errno == ERESTART_RESTARTBLOCK) |
557 | { | 538 | { |
558 | if (IS_IA32_PROCESS(&scr->pt)) { | 539 | /* |
559 | scr->pt.r8 = scr->pt.r1; | 540 | * Note: the syscall number is in r15 which is saved in |
560 | scr->pt.cr_iip -= 2; | 541 | * pt_regs so all we need to do here is adjust ip so that |
561 | if (errno == ERESTART_RESTARTBLOCK) | 542 | * the "break" instruction gets re-executed. |
562 | scr->pt.r8 = 0; /* x86 version of __NR_restart_syscall */ | 543 | */ |
563 | } else { | 544 | ia64_decrement_ip(&scr->pt); |
564 | /* | 545 | if (errno == ERESTART_RESTARTBLOCK) |
565 | * Note: the syscall number is in r15 which is saved in | 546 | scr->pt.r15 = __NR_restart_syscall; |
566 | * pt_regs so all we need to do here is adjust ip so that | ||
567 | * the "break" instruction gets re-executed. | ||
568 | */ | ||
569 | ia64_decrement_ip(&scr->pt); | ||
570 | if (errno == ERESTART_RESTARTBLOCK) | ||
571 | scr->pt.r15 = __NR_restart_syscall; | ||
572 | } | ||
573 | } | 547 | } |
574 | } | 548 | } |
575 | 549 | ||