diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-02-08 15:09:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:40:46 -0400 |
commit | ac66f3fd89ee20b73b3374e6343c5e36e3e3c51a (patch) | |
tree | 87143604da040f1fa41be8952a2a4fecb663dec7 /arch/x86/kernel/signal_32.c | |
parent | c3e6ff87a3ad9124a67e149e4f9c080626a0d83e (diff) |
x86: reduce trivial style differences in signal_32|64.c
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/signal_32.c')
-rw-r--r-- | arch/x86/kernel/signal_32.c | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index a393e3711e08..182269b752da 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c | |||
@@ -131,14 +131,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax | |||
131 | COPY_SEG(fs); | 131 | COPY_SEG(fs); |
132 | COPY_SEG(es); | 132 | COPY_SEG(es); |
133 | COPY_SEG(ds); | 133 | COPY_SEG(ds); |
134 | COPY(di); | 134 | COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); |
135 | COPY(si); | 135 | COPY(dx); COPY(cx); COPY(ip); |
136 | COPY(bp); | ||
137 | COPY(sp); | ||
138 | COPY(bx); | ||
139 | COPY(dx); | ||
140 | COPY(cx); | ||
141 | COPY(ip); | ||
142 | COPY_SEG_STRICT(cs); | 136 | COPY_SEG_STRICT(cs); |
143 | COPY_SEG_STRICT(ss); | 137 | COPY_SEG_STRICT(ss); |
144 | 138 | ||
@@ -412,7 +406,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
412 | ptrace_notify(SIGTRAP); | 406 | ptrace_notify(SIGTRAP); |
413 | 407 | ||
414 | #if DEBUG_SIG | 408 | #if DEBUG_SIG |
415 | printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", | 409 | printk("SIG deliver (%s:%d): sp=%p pc=%lx ra=%p\n", |
416 | current->comm, current->pid, frame, regs->ip, frame->pretcode); | 410 | current->comm, current->pid, frame, regs->ip, frame->pretcode); |
417 | #endif | 411 | #endif |
418 | 412 | ||
@@ -522,7 +516,7 @@ give_sigsegv: | |||
522 | 516 | ||
523 | static int | 517 | static int |
524 | handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | 518 | handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, |
525 | sigset_t *oldset, struct pt_regs * regs) | 519 | sigset_t *oldset, struct pt_regs *regs) |
526 | { | 520 | { |
527 | int ret; | 521 | int ret; |
528 | 522 | ||
@@ -530,20 +524,21 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
530 | if ((long)regs->orig_ax >= 0) { | 524 | if ((long)regs->orig_ax >= 0) { |
531 | /* If so, check system call restarting.. */ | 525 | /* If so, check system call restarting.. */ |
532 | switch (regs->ax) { | 526 | switch (regs->ax) { |
533 | case -ERESTART_RESTARTBLOCK: | 527 | case -ERESTART_RESTARTBLOCK: |
534 | case -ERESTARTNOHAND: | 528 | case -ERESTARTNOHAND: |
529 | regs->ax = -EINTR; | ||
530 | break; | ||
531 | |||
532 | case -ERESTARTSYS: | ||
533 | if (!(ka->sa.sa_flags & SA_RESTART)) { | ||
535 | regs->ax = -EINTR; | 534 | regs->ax = -EINTR; |
536 | break; | 535 | break; |
537 | 536 | } | |
538 | case -ERESTARTSYS: | 537 | /* fallthrough */ |
539 | if (!(ka->sa.sa_flags & SA_RESTART)) { | 538 | case -ERESTARTNOINTR: |
540 | regs->ax = -EINTR; | 539 | regs->ax = regs->orig_ax; |
541 | break; | 540 | regs->ip -= 2; |
542 | } | 541 | break; |
543 | /* fallthrough */ | ||
544 | case -ERESTARTNOINTR: | ||
545 | regs->ax = regs->orig_ax; | ||
546 | regs->ip -= 2; | ||
547 | } | 542 | } |
548 | } | 543 | } |
549 | 544 | ||
@@ -580,18 +575,17 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
580 | */ | 575 | */ |
581 | static void do_signal(struct pt_regs *regs) | 576 | static void do_signal(struct pt_regs *regs) |
582 | { | 577 | { |
578 | struct k_sigaction ka; | ||
583 | siginfo_t info; | 579 | siginfo_t info; |
584 | int signr; | 580 | int signr; |
585 | struct k_sigaction ka; | ||
586 | sigset_t *oldset; | 581 | sigset_t *oldset; |
587 | 582 | ||
588 | /* | 583 | /* |
589 | * We want the common case to go fast, which | 584 | * We want the common case to go fast, which is why we may in certain |
590 | * is why we may in certain cases get here from | 585 | * cases get here from kernel mode. Just return without doing anything |
591 | * kernel mode. Just return without doing anything | 586 | * if so. |
592 | * if so. vm86 regs switched out by assembly code | 587 | * X86_32: vm86 regs switched out by assembly code before reaching |
593 | * before reaching here, so testing against kernel | 588 | * here, so testing against kernel CS suffices. |
594 | * CS suffices. | ||
595 | */ | 589 | */ |
596 | if (!user_mode(regs)) | 590 | if (!user_mode(regs)) |
597 | return; | 591 | return; |
@@ -608,7 +602,7 @@ static void do_signal(struct pt_regs *regs) | |||
608 | * have been cleared if the watchpoint triggered | 602 | * have been cleared if the watchpoint triggered |
609 | * inside the kernel. | 603 | * inside the kernel. |
610 | */ | 604 | */ |
611 | if (unlikely(current->thread.debugreg7)) | 605 | if (current->thread.debugreg7) |
612 | set_debugreg(current->thread.debugreg7, 7); | 606 | set_debugreg(current->thread.debugreg7, 7); |
613 | 607 | ||
614 | /* Whee! Actually deliver the signal. */ | 608 | /* Whee! Actually deliver the signal. */ |
@@ -642,8 +636,10 @@ static void do_signal(struct pt_regs *regs) | |||
642 | } | 636 | } |
643 | } | 637 | } |
644 | 638 | ||
645 | /* if there's no signal to deliver, we just put the saved sigmask | 639 | /* |
646 | * back */ | 640 | * If there's no signal to deliver, we just put the saved sigmask |
641 | * back. | ||
642 | */ | ||
647 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | 643 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { |
648 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 644 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
649 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 645 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
@@ -654,12 +650,12 @@ static void do_signal(struct pt_regs *regs) | |||
654 | * notification of userspace execution resumption | 650 | * notification of userspace execution resumption |
655 | * - triggered by the TIF_WORK_MASK flags | 651 | * - triggered by the TIF_WORK_MASK flags |
656 | */ | 652 | */ |
657 | void do_notify_resume(struct pt_regs *regs, void *_unused, | 653 | void do_notify_resume(struct pt_regs *regs, void *unused, |
658 | __u32 thread_info_flags) | 654 | __u32 thread_info_flags) |
659 | { | 655 | { |
660 | /* Pending single-step? */ | 656 | /* Pending single-step? */ |
661 | if (thread_info_flags & _TIF_SINGLESTEP) { | 657 | if (thread_info_flags & _TIF_SINGLESTEP) { |
662 | regs->flags |= TF_MASK; | 658 | regs->flags |= X86_EFLAGS_TF; |
663 | clear_thread_flag(TIF_SINGLESTEP); | 659 | clear_thread_flag(TIF_SINGLESTEP); |
664 | } | 660 | } |
665 | 661 | ||