File tree Expand file tree Collapse file tree 3 files changed +3
-26
lines changed Expand file tree Collapse file tree 3 files changed +3
-26
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ int group_setuptaskfiles(FAR struct task_tcb_s *tcb,
66
66
FAR struct task_group_s * group = tcb -> cmn .group ;
67
67
int ret = OK ;
68
68
#ifndef CONFIG_FDCLONE_DISABLE
69
- FAR struct tcb_s * rtcb ;
69
+ FAR struct tcb_s * rtcb = this_task () ;
70
70
#endif
71
71
72
72
sched_trace_begin ();
@@ -77,20 +77,7 @@ int group_setuptaskfiles(FAR struct task_tcb_s *tcb,
77
77
#endif
78
78
79
79
#ifndef CONFIG_FDCLONE_DISABLE
80
-
81
- /* The The file descriptors of kernel threads should be clean and
82
- * should not be generated based on user threads. Instead, an idle
83
- * thread should be chosen.
84
- */
85
-
86
- if ((tcb -> cmn .flags & TCB_FLAG_TTYPE_MASK ) == TCB_FLAG_TTYPE_KERNEL )
87
- {
88
- rtcb = & g_idletcb [this_cpu ()];
89
- }
90
- else
91
- {
92
- rtcb = this_task ();
93
- }
80
+ DEBUGASSERT (rtcb -> group );
94
81
95
82
/* Duplicate the parent task's file descriptors */
96
83
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ volatile uint8_t g_nx_initstate; /* See enum nx_initstate_e */
209
209
* bringing up the rest of the system.
210
210
*/
211
211
212
- struct tcb_s g_idletcb [CONFIG_SMP_NCPUS ];
212
+ static struct tcb_s g_idletcb [CONFIG_SMP_NCPUS ];
213
213
214
214
/* This is the name of the idle task */
215
215
Original file line number Diff line number Diff line change @@ -204,16 +204,6 @@ extern FAR struct tcb_s *g_delivertasks[CONFIG_SMP_NCPUS];
204
204
205
205
extern FAR struct tcb_s * g_running_tasks [CONFIG_SMP_NCPUS ];
206
206
207
- /* This is an array of task control block (TCB) for the IDLE thread of each
208
- * CPU. For the non-SMP case, this is a a single TCB; For the SMP case,
209
- * there is one TCB per CPU. NOTE: The system boots on CPU0 into the IDLE
210
- * task. The IDLE task later starts the other CPUs and spawns the user
211
- * initialization task. That user initialization task is responsible for
212
- * bringing up the rest of the system.
213
- */
214
-
215
- extern struct tcb_s g_idletcb [CONFIG_SMP_NCPUS ];
216
-
217
207
/* This is the list of all tasks that are ready-to-run, but cannot be placed
218
208
* in the g_readytorun list because: (1) They are higher priority than the
219
209
* currently active task at the head of the g_readytorun list, and (2) the
You can’t perform that action at this time.
0 commit comments