mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
arch assertions: Correct duplicated logic from commit dbf01d12b7. 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:
@@ -310,7 +310,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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 */
|
/* Disable interrupts on this CPU */
|
||||||
|
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (; ; )
|
for (; ; )
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ static void _up_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ static void xtensa_assert(int errorcode)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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 */
|
/* Blink the LEDs forever */
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ static void _up_assert(int errorcode) /* noreturn_function */
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ static void _up_assert(int errorcode) /* noreturn_function */
|
|||||||
|
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* 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();
|
(void)up_irq_save();
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|||||||
Reference in New Issue
Block a user