mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
sched/misc/assert: Small flash-saving fixes
- Use shared string for "stack pointer out of range" to avoid duplicate in flash - Re-use already calculated stack_used instead of calling up_check_tcbstack again Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
parent
065da307f5
commit
5844ff5abb
1 changed files with 8 additions and 5 deletions
|
|
@ -168,6 +168,11 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
|
|
||||||
|
static void sp_out_of_range(uintptr_t sp)
|
||||||
|
{
|
||||||
|
_alert("ERROR: Stack pointer %" PRIxPTR " is not within the stack\n", sp);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: stack_dump
|
* Name: stack_dump
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
@ -285,8 +290,7 @@ static void dump_stacks(FAR struct tcb_s *rtcb, uintptr_t sp)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
force = true;
|
force = true;
|
||||||
_alert("ERROR: Stack pointer %" PRIxPTR "is not within the stack\n",
|
sp_out_of_range(sp);
|
||||||
sp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 0
|
#if CONFIG_ARCH_INTERRUPTSTACK > 0
|
||||||
|
|
@ -309,8 +313,7 @@ static void dump_stacks(FAR struct tcb_s *rtcb, uintptr_t sp)
|
||||||
up_getusrsp((FAR void *)running_regs()) : 0;
|
up_getusrsp((FAR void *)running_regs()) : 0;
|
||||||
if (tcbstack_sp < tcbstack_base || tcbstack_sp >= tcbstack_top)
|
if (tcbstack_sp < tcbstack_base || tcbstack_sp >= tcbstack_top)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer %" PRIxPTR " is not within the"
|
sp_out_of_range(tcbstack_sp);
|
||||||
" stack\n", tcbstack_sp);
|
|
||||||
|
|
||||||
tcbstack_sp = 0;
|
tcbstack_sp = 0;
|
||||||
force = true;
|
force = true;
|
||||||
|
|
@ -436,7 +439,7 @@ static void dump_task(FAR struct tcb_s *tcb, FAR void *arg)
|
||||||
, tcb->stack_base_ptr
|
, tcb->stack_base_ptr
|
||||||
, tcb->adj_stack_size
|
, tcb->adj_stack_size
|
||||||
#ifdef CONFIG_STACK_COLORATION
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
, up_check_tcbstack(tcb, tcb->adj_stack_size)
|
, stack_used
|
||||||
, stack_filled / 10, stack_filled % 10
|
, stack_filled / 10, stack_filled % 10
|
||||||
, (stack_filled >= 10 * 80 ? '!' : ' ')
|
, (stack_filled >= 10 * 80 ? '!' : ' ')
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue