39 /*
40 * Ok, we need to do extra processing, enter the slow path.
41 */
42 fast_work_pending:
43 tst r1, #_TIF_KERNEL_TRACE @ flag can be set asynchronously
44 bne __sys_trace_return
45 str r0, [sp, #S_R0+S_OFF]! @ returned r0
46 work_pending:
47 tst r1, #_TIF_NEED_RESCHED @判断该进程是否需要被调度
48 bne work_resched @Yes, 释放CPU
49 tst r1, #_TIF_SIGPENDING|_TIF_NOTIFY_RESUME @判断是否有信号需要处理
50 beq no_work_pending @No, 返回.
51 mov r0, sp @ 'regs'
52 mov r2, why @ 'syscall'
53 bl do_notify_resume @去处理pending signal
54 b ret_slow_syscall @ Check work again 跳往ret_slow_syscall,再次开始检查.
55
56 work_resched:
57 bl schedule
58 /*
59 * "slow" syscall return path. "why" tells us if this was a real syscall.
60 */
61 ENTRY(ret_to_user)
62 ret_slow_syscall:
63 disable_irq @ disable interrupts
64 ldr r1, [tsk, #TI_FLAGS]
65 tst r1, #_TIF_WORK_MASK @判断该进程是否有需要处理的事物
66 bne work_pending @Yes, 跳往work_pending
67 no_work_pending:
68 /* perform architecture specific actions before user return */
69 arch_ret_to_user r1, lr @如果平台有特殊处理,在entry-macro.S中定义该函数。
70
71 restore_user_regs fast = 0, offset = 0 @顾名思义,restore user regs, usr_entry()的相反操作。下面详细介绍。
72 ENDPROC(ret_to_user)
|