MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _signal_entry

Function _signal_entry

src/signal.c:59–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59static void _signal_entry(void *parameter)
60{
61 RT_UNUSED(parameter);
62
63 rt_thread_t tid = rt_thread_self();
64
65 /* handle signal */
66 rt_thread_handle_sig(RT_FALSE);
67
68#ifdef RT_USING_SMP
69#else
70 /* return to thread */
71 tid->sp = tid->sig_ret;
72 tid->sig_ret = RT_NULL;
73#endif /* RT_USING_SMP */
74
75 LOG_D("switch back to: 0x%08x\n", tid->sp);
76 RT_SCHED_CTX(tid).stat &= ~RT_THREAD_STAT_SIGNAL;
77
78#ifdef RT_USING_SMP
79 rt_hw_context_switch_to((rt_uintptr_t)&parameter, tid);
80#else
81 rt_hw_context_switch_to((rt_uintptr_t)&(tid->sp));
82#endif /* RT_USING_SMP */
83}
84
85/*
86 * To deliver a signal to thread, there are cases:

Callers

nothing calls this directly

Calls 3

rt_thread_selfFunction · 0.85
rt_thread_handle_sigFunction · 0.85
rt_hw_context_switch_toFunction · 0.50

Tested by

no test coverage detected