arch assertions: Correct duplicated logic from commit dbf01d12b7321d1b48b68d3b69842a853b049376. Checking for PID == zero is not a valid way to test for the IDLE task in all configurations! This is only true in the single CPU configuration. In multiple CPU configurations, there will be a separate IDLE task for each CPU with a different PID.

This commit is contained in:
Gregory Nutt 2018-12-18 17:35:42 -06:00
parent a9626f3ad3
commit ec9265aa95
16 changed files with 16 additions and 16 deletions

View File

@ -310,7 +310,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (CURRENT_REGS || running_task()->pid == 0)
if (CURRENT_REGS || running_task()->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -367,7 +367,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (CURRENT_REGS || running_task()->pid == 0)
if (CURRENT_REGS || running_task()->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -395,7 +395,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (CURRENT_REGS || running_task()->pid == 0)
if (CURRENT_REGS || running_task()->flink == NULL)
{
/* Disable interrupts on this CPU */

View File

@ -389,7 +389,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (CURRENT_REGS || (running_task())->pid == 0)
if (CURRENT_REGS || (running_task())->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -374,7 +374,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (CURRENT_REGS || (running_task())->pid == 0)
if (CURRENT_REGS || (running_task())->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -87,7 +87,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (g_current_regs || running_task()->pid == 0)
if (g_current_regs || running_task()->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -294,7 +294,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (g_current_regs || (running_task())->pid == 0)
if (g_current_regs || (running_task())->flink == NULL)
{
(void)up_irq_save();
for (;;)

View File

@ -86,7 +86,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (g_current_regs || running_task()->pid == 0)
if (g_current_regs || running_task()->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -87,7 +87,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (g_current_regs || running_task()->pid == 0)
if (g_current_regs || running_task()->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -372,7 +372,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (CURRENT_REGS || running_task()->pid == 0)
if (CURRENT_REGS || running_task()->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -88,7 +88,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (g_current_regs || running_task()->pid == 0)
if (g_current_regs || running_task()->flink == NULL)
{
(void)up_irq_save();
for (;;)

View File

@ -87,7 +87,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (g_current_regs || running_task()->pid == 0)
if (g_current_regs || running_task()->flink == NULL)
{
(void)up_irq_save();
for (; ; )

View File

@ -255,7 +255,7 @@ static void _up_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (g_current_regs || (running_task())->pid == 0)
if (g_current_regs || (running_task())->flink == NULL)
{
(void)up_irq_save();
for (;;)

View File

@ -126,7 +126,7 @@ static void xtensa_assert(int errorcode)
/* Are we in an interrupt handler or the idle task? */
if (CURRENT_REGS || running_task()->pid == 0)
if (CURRENT_REGS || running_task()->flink == NULL)
{
/* Blink the LEDs forever */

View File

@ -87,7 +87,7 @@ static void _up_assert(int errorcode) /* noreturn_function */
/* Are we in an interrupt handler or the idle task? */
if (up_interrupt_context() || running_task()->pid == 0)
if (up_interrupt_context() || running_task()->flink == NULL)
{
(void)up_irq_save();
for (;;)

View File

@ -86,7 +86,7 @@ static void _up_assert(int errorcode) /* noreturn_function */
/* Are we in an interrupt handler or the idle task? */
if (up_interrupt_context() || running_task()->pid == 0)
if (up_interrupt_context() || running_task()->flink == NULL)
{
(void)up_irq_save();
for (;;)