SMP: Setting bit for wrong CPU. Assertion has cause false alarm crashes..
This commit is contained in:
parent
7d9287958f
commit
1780000777
2
arch
2
arch
@ -1 +1 @@
|
|||||||
Subproject commit bd833ac25f0f982a372d8d9df5e1634a6eb21b32
|
Subproject commit 5a6306b76aa6656c56f5c19cbf18757a295ee1bc
|
@ -216,7 +216,9 @@ enum tstate_e
|
|||||||
};
|
};
|
||||||
typedef enum tstate_e tstate_t;
|
typedef enum tstate_e tstate_t;
|
||||||
|
|
||||||
/* The following definitions are determined by tstate_t */
|
/* The following definitions are determined by tstate_t. Ordering of values
|
||||||
|
* in the enumeration is important!
|
||||||
|
*/
|
||||||
|
|
||||||
#define FIRST_READY_TO_RUN_STATE TSTATE_TASK_READYTORUN
|
#define FIRST_READY_TO_RUN_STATE TSTATE_TASK_READYTORUN
|
||||||
#define LAST_READY_TO_RUN_STATE TSTATE_TASK_RUNNING
|
#define LAST_READY_TO_RUN_STATE TSTATE_TASK_RUNNING
|
||||||
|
@ -275,7 +275,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb)
|
|||||||
switched = sched_addprioritized(btcb, tasklist);
|
switched = sched_addprioritized(btcb, tasklist);
|
||||||
|
|
||||||
/* If the selected task was the g_assignedtasks[] list, then a context
|
/* If the selected task was the g_assignedtasks[] list, then a context
|
||||||
* swith will occur.
|
* switch will occur.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (switched)
|
if (switched)
|
||||||
@ -304,12 +304,12 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb)
|
|||||||
|
|
||||||
if (btcb->lockcount > 0)
|
if (btcb->lockcount > 0)
|
||||||
{
|
{
|
||||||
spin_setbit(&g_cpu_lockset, this_cpu(), &g_cpu_locksetlock,
|
spin_setbit(&g_cpu_lockset, cpu, &g_cpu_locksetlock,
|
||||||
&g_cpu_schedlock);
|
&g_cpu_schedlock);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spin_clrbit(&g_cpu_lockset, this_cpu(), &g_cpu_locksetlock,
|
spin_clrbit(&g_cpu_lockset, cpu, &g_cpu_locksetlock,
|
||||||
&g_cpu_schedlock);
|
&g_cpu_schedlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,12 +319,12 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb)
|
|||||||
|
|
||||||
if (btcb->irqcount > 0)
|
if (btcb->irqcount > 0)
|
||||||
{
|
{
|
||||||
spin_setbit(&g_cpu_irqset, this_cpu(), &g_cpu_irqsetlock,
|
spin_setbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock,
|
||||||
&g_cpu_irqlock);
|
&g_cpu_irqlock);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spin_clrbit(&g_cpu_irqset, this_cpu(), &g_cpu_irqsetlock,
|
spin_clrbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock,
|
||||||
&g_cpu_irqlock);
|
&g_cpu_irqlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,11 +334,12 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb)
|
|||||||
* lifting machinery.
|
* lifting machinery.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
DEBUGASSERT(btcb->flink != NULL);
|
||||||
next = (FAR struct tcb_s *)btcb->flink;
|
next = (FAR struct tcb_s *)btcb->flink;
|
||||||
ASSERT(!spin_islocked(&g_cpu_schedlock) && next != NULL);
|
|
||||||
|
|
||||||
if ((next->flags & TCB_FLAG_CPU_ASSIGNED) != 0)
|
if ((next->flags & TCB_FLAG_CPU_ASSIGNED) != 0)
|
||||||
{
|
{
|
||||||
|
DEBUGASSERT(next->cpu == cpu);
|
||||||
next->task_state = TSTATE_TASK_ASSIGNED;
|
next->task_state = TSTATE_TASK_ASSIGNED;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user