sched/irq: add stack size judgment when detecting stack overflow

`up_check_intstack` exists only when CONFIG_ARCH_INTERRUPTSTACK
is greater than 0, so the irq should first determine whether
CONFIG_ARCH_INTERRUPTSTACK is greater than 0 to determine
whether up_check_intstack can be called.

Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
This commit is contained in:
guoshengyuan1
2025-10-13 09:33:46 +08:00
committed by Xiang Xiao
parent 10fd309452
commit 5874f46a5b

View File

@@ -158,7 +158,8 @@ void irq_dispatch(int irq, FAR void *context)
}
#endif
#if defined(CONFIG_STACKCHECK_MARGIN) && (CONFIG_STACKCHECK_MARGIN > 0)
#if defined(CONFIG_STACKCHECK_MARGIN) && (CONFIG_STACKCHECK_MARGIN > 0) && \
defined(CONFIG_ARCH_INTERRUPTSTACK) && (CONFIG_ARCH_INTERRUPTSTACK > 0)
DEBUGASSERT(up_check_intstack(this_cpu(),
CONFIG_STACKCHECK_MARGIN) == 0);
#endif