sched: The secondary idle threads should call nx_idle_trampoline

because nx_task_idle doesn't call sched_note_start. To avoid the
same error happen again in the furture, nx_task_idle is removed.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-07-22 02:21:47 +08:00 committed by Masayuki Ishikawa
parent a32506bbdf
commit 28eed285c8
7 changed files with 11 additions and 52 deletions

View File

@ -137,7 +137,7 @@ static void appdsp_boot(void)
/* Then transfer control to the IDLE task */
nx_idle_task(0, NULL);
nx_idle_trampoline();
}
/****************************************************************************

View File

@ -132,7 +132,7 @@ static void cpu1_boot(void)
/* Then transfer control to the IDLE task */
nx_idle_task(0, NULL);
nx_idle_trampoline();
}
/****************************************************************************

View File

@ -82,6 +82,10 @@
volatile static spinlock_t g_cpu1_boot;
extern int arm_pause_handler(int irq, void *c, FAR void *arg);
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: cpu1_boot
*
@ -134,7 +138,7 @@ static void cpu1_boot(void)
/* Then transfer control to the IDLE task */
nx_idle_task(0, NULL);
nx_idle_trampoline();
}
/****************************************************************************
@ -168,7 +172,7 @@ int up_cpu_start(int cpu)
{
struct tcb_s *tcb = current_task(cpu);
DPRINTF("cpu=%d\n",cpu);
DPRINTF("cpu=%d\n", cpu);
if (cpu != 1)
{

View File

@ -143,7 +143,7 @@ void k210_cpu_boot(int cpu)
/* Then transfer control to the IDLE task */
nx_idle_task(0, NULL);
nx_idle_trampoline();
}
/****************************************************************************

View File

@ -104,25 +104,6 @@ int nx_smp_start(void);
void nx_idle_trampoline(void);
#endif
/****************************************************************************
* Name: nx_idle_task
*
* Description:
* This is the common IDLE task for CPUs 1 through (CONFIG_SMP_NCPUS-1).
* It is equivalent to the CPU 0 IDLE logic in nx_start.c
*
* Input Parameters:
* Standard task arguments.
*
* Returned Value:
* This function does not return.
*
****************************************************************************/
#ifdef CONFIG_SMP
int nx_idle_task(int argc, FAR char *argv[]);
#endif
/****************************************************************************
* Name: nx_bringup
*

View File

@ -87,32 +87,6 @@ void nx_idle_trampoline(void)
sched_note_start(tcb);
#endif
/* Then transfer control to the IDLE task */
nx_idle_task(0, NULL);
/* The IDLE task should never return */
DEBUGPANIC();
}
/****************************************************************************
* Name: nx_idle_task
*
* Description:
* This is the common IDLE task for CPUs 1 through (CONFIG_SMP_NCPUS-1).
* It is equivalent to the CPU 0 IDLE logic in nx_start.c
*
* Input Parameters:
* Standard task arguments.
*
* Returned Value:
* This function does not return.
*
****************************************************************************/
int nx_idle_task(int argc, FAR char *argv[])
{
/* Enter the IDLE loop */
sinfo("CPU%d: Beginning Idle Loop\n", this_cpu());

View File

@ -450,12 +450,12 @@ void nx_start(void)
if (cpu > 0)
{
g_idletcb[cpu].cmn.start = nx_idle_trampoline;
g_idletcb[cpu].cmn.entry.main = nx_idle_task;
g_idletcb[cpu].cmn.entry.main = (main_t)nx_idle_trampoline;
}
else
#endif
{
g_idletcb[cpu].cmn.start = (start_t)nx_start;
g_idletcb[cpu].cmn.start = nx_start;
g_idletcb[cpu].cmn.entry.main = (main_t)nx_start;
}