diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-19 12:47:55 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-07-28 06:11:52 -0400 |
commit | 0a267fa6a15d41c4061358bf2e67c633fdbffc90 (patch) | |
tree | e54ebbdd2c38824d154e7c0574fd563ef8072f9e /arch/arm | |
parent | 8d4150ccbb63419649a69fe04b46120a46d60da2 (diff) |
ARM: 7472/1: pull all work_pending logics into C function
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 17 | ||||
-rw-r--r-- | arch/arm/kernel/signal.c | 27 |
2 files changed, 21 insertions, 23 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 49d9f9305247..1873f653641c 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -51,23 +51,10 @@ ret_fast_syscall: | |||
51 | fast_work_pending: | 51 | fast_work_pending: |
52 | str r0, [sp, #S_R0+S_OFF]! @ returned r0 | 52 | str r0, [sp, #S_R0+S_OFF]! @ returned r0 |
53 | work_pending: | 53 | work_pending: |
54 | tst r1, #_TIF_NEED_RESCHED | ||
55 | bne work_resched | ||
56 | /* | ||
57 | * TIF_SIGPENDING or TIF_NOTIFY_RESUME must've been set if we got here | ||
58 | */ | ||
59 | ldr r2, [sp, #S_PSR] | ||
60 | mov r0, sp @ 'regs' | 54 | mov r0, sp @ 'regs' |
61 | tst r2, #15 @ are we returning to user mode? | ||
62 | bne no_work_pending @ no? just leave, then... | ||
63 | mov r2, why @ 'syscall' | 55 | mov r2, why @ 'syscall' |
64 | tst r1, #_TIF_SIGPENDING @ delivering a signal? | 56 | bl do_work_pending |
65 | movne why, #0 @ prevent further restarts | 57 | b no_work_pending |
66 | bl do_notify_resume | ||
67 | b ret_slow_syscall @ Check work again | ||
68 | |||
69 | work_resched: | ||
70 | bl schedule | ||
71 | /* | 58 | /* |
72 | * "slow" syscall return path. "why" tells us if this was a real syscall. | 59 | * "slow" syscall return path. "why" tells us if this was a real syscall. |
73 | */ | 60 | */ |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index fd2392a17ac1..8756e5dcd377 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -640,13 +640,24 @@ static void do_signal(struct pt_regs *regs, int syscall) | |||
640 | } | 640 | } |
641 | 641 | ||
642 | asmlinkage void | 642 | asmlinkage void |
643 | do_notify_resume(struct pt_regs *regs, unsigned int thread_flags, int syscall) | 643 | do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) |
644 | { | 644 | { |
645 | if (thread_flags & _TIF_SIGPENDING) | 645 | do { |
646 | do_signal(regs, syscall); | 646 | if (likely(thread_flags & _TIF_NEED_RESCHED)) { |
647 | 647 | schedule(); | |
648 | if (thread_flags & _TIF_NOTIFY_RESUME) { | 648 | } else { |
649 | clear_thread_flag(TIF_NOTIFY_RESUME); | 649 | if (unlikely(!user_mode(regs))) |
650 | tracehook_notify_resume(regs); | 650 | return; |
651 | } | 651 | local_irq_enable(); |
652 | if (thread_flags & _TIF_SIGPENDING) { | ||
653 | do_signal(regs, syscall); | ||
654 | syscall = 0; | ||
655 | } else { | ||
656 | clear_thread_flag(TIF_NOTIFY_RESUME); | ||
657 | tracehook_notify_resume(regs); | ||
658 | } | ||
659 | } | ||
660 | local_irq_disable(); | ||
661 | thread_flags = current_thread_info()->flags; | ||
662 | } while (thread_flags & _TIF_WORK_MASK); | ||
652 | } | 663 | } |