提交 0a267fa6 编写于 作者: A Al Viro 提交者: Russell King

ARM: 7472/1: pull all work_pending logics into C function

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 8d4150cc
...@@ -51,23 +51,10 @@ ret_fast_syscall: ...@@ -51,23 +51,10 @@ ret_fast_syscall:
fast_work_pending: fast_work_pending:
str r0, [sp, #S_R0+S_OFF]! @ returned r0 str r0, [sp, #S_R0+S_OFF]! @ returned r0
work_pending: work_pending:
tst r1, #_TIF_NEED_RESCHED
bne work_resched
/*
* TIF_SIGPENDING or TIF_NOTIFY_RESUME must've been set if we got here
*/
ldr r2, [sp, #S_PSR]
mov r0, sp @ 'regs' mov r0, sp @ 'regs'
tst r2, #15 @ are we returning to user mode?
bne no_work_pending @ no? just leave, then...
mov r2, why @ 'syscall' mov r2, why @ 'syscall'
tst r1, #_TIF_SIGPENDING @ delivering a signal? bl do_work_pending
movne why, #0 @ prevent further restarts b no_work_pending
bl do_notify_resume
b ret_slow_syscall @ Check work again
work_resched:
bl schedule
/* /*
* "slow" syscall return path. "why" tells us if this was a real syscall. * "slow" syscall return path. "why" tells us if this was a real syscall.
*/ */
......
...@@ -640,13 +640,24 @@ static void do_signal(struct pt_regs *regs, int syscall) ...@@ -640,13 +640,24 @@ static void do_signal(struct pt_regs *regs, int syscall)
} }
asmlinkage void asmlinkage void
do_notify_resume(struct pt_regs *regs, unsigned int thread_flags, int syscall) do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
{ {
if (thread_flags & _TIF_SIGPENDING) do {
do_signal(regs, syscall); if (likely(thread_flags & _TIF_NEED_RESCHED)) {
schedule();
if (thread_flags & _TIF_NOTIFY_RESUME) { } else {
clear_thread_flag(TIF_NOTIFY_RESUME); if (unlikely(!user_mode(regs)))
tracehook_notify_resume(regs); return;
} local_irq_enable();
if (thread_flags & _TIF_SIGPENDING) {
do_signal(regs, syscall);
syscall = 0;
} else {
clear_thread_flag(TIF_NOTIFY_RESUME);
tracehook_notify_resume(regs);
}
}
local_irq_disable();
thread_flags = current_thread_info()->flags;
} while (thread_flags & _TIF_WORK_MASK);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册