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

Function rtthread_startup

src/components.c:238–285  ·  view source on GitHub ↗

* @brief This function will call all levels of initialization functions to complete * the initialization of the system, and finally start the scheduler. * * @return Normally never returns. If 0 is returned, the scheduler failed. */

Source from the content-addressed store, hash-verified

236 * @return Normally never returns. If 0 is returned, the scheduler failed.
237 */
238int rtthread_startup(void)
239{
240#ifdef RT_USING_SMP
241 rt_hw_spin_lock_init(&_cpus_lock);
242#endif
243 rt_hw_local_irq_disable();
244
245 /* board level initialization
246 * NOTE: please initialize heap inside board initialization.
247 */
248 rt_hw_board_init();
249
250 /* show RT-Thread version */
251 rt_show_version();
252
253 /* timer system initialization */
254 rt_system_timer_init();
255
256 /* scheduler system initialization */
257 rt_system_scheduler_init();
258
259#ifdef RT_USING_SIGNALS
260 /* signal system initialization */
261 rt_system_signal_init();
262#endif /* RT_USING_SIGNALS */
263
264 /* create init_thread */
265 rt_application_init();
266
267 /* timer thread initialization */
268 rt_system_timer_thread_init();
269
270 /* idle thread initialization */
271 rt_thread_idle_init();
272
273 /* defunct thread initialization */
274 rt_thread_defunct_init();
275
276#ifdef RT_USING_SMP
277 rt_hw_spin_lock(&_cpus_lock);
278#endif /* RT_USING_SMP */
279
280 /* start scheduler */
281 rt_system_scheduler_start();
282
283 /* never reach here */
284 return 0;
285}
286#endif /* RT_USING_USER_MAIN */

Callers 3

$Sub$$mainFunction · 0.70
__low_level_initFunction · 0.70
entryFunction · 0.70

Calls 12

rt_show_versionFunction · 0.85
rt_system_timer_initFunction · 0.85
rt_system_signal_initFunction · 0.85
rt_thread_idle_initFunction · 0.85
rt_thread_defunct_initFunction · 0.85
rt_system_scheduler_initFunction · 0.70
rt_application_initFunction · 0.70
rt_hw_spin_lock_initFunction · 0.50
rt_hw_board_initFunction · 0.50
rt_hw_spin_lockFunction · 0.50

Tested by

no test coverage detected