MCPcopy Create free account
hub / github.com/apache/nuttx / idle_group_initialize

Function idle_group_initialize

sched/init/nx_start.c:430–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428 ****************************************************************************/
429
430static void idle_group_initialize(void)
431{
432 FAR struct tcb_s *tcb;
433 int hashndx;
434 int i;
435
436 /* Assign the process ID(s) of ZERO to the idle task(s) */
437
438 for (i = 0; i < CONFIG_SMP_NCPUS; i++)
439 {
440 tcb = &g_idletcb[i];
441
442 hashndx = PIDHASH(i);
443 g_pidhash[hashndx] = tcb;
444
445 /* Allocate the IDLE group */
446
447 DEBUGVERIFY(
448 group_allocate(tcb, tcb->flags));
449
450 /* Initialize the task join */
451
452 nxtask_joininit(tcb);
453
454#ifdef CONFIG_SMP
455 /* Create a stack for all CPU IDLE threads (except CPU0 which already
456 * has a stack).
457 */
458
459 if (i > 0)
460 {
461 DEBUGVERIFY(up_cpu_idlestack(i, tcb, CONFIG_IDLETHREAD_STACKSIZE));
462 }
463#endif
464
465 /* Initialize the processor-specific portion of the TCB */
466
467 up_initial_state(tcb);
468
469 /* Initialize the thread local storage */
470
471 tls_init_info(tcb);
472
473 /* Complete initialization of the IDLE group. Suppress retention
474 * of child status in the IDLE group.
475 */
476
477 group_initialize(tcb);
478 tcb->group->tg_flags = GROUP_FLAG_NOCLDWAIT | GROUP_FLAG_PRIVILEGED;
479 }
480}
481
482/****************************************************************************
483 * Public Functions

Callers 1

nx_startFunction · 0.85

Calls 6

group_allocateFunction · 0.85
nxtask_joininitFunction · 0.85
tls_init_infoFunction · 0.85
group_initializeFunction · 0.85
up_cpu_idlestackFunction · 0.50
up_initial_stateFunction · 0.50

Tested by

no test coverage detected