esp32s3: Fix faulty esp32s3-devkit:stack example

This defconfig is an example of the recorded stack and it became
faulty recently after the implementation of the `up_current_regs`
functions. The `noinstrument_function` directive must be used for
preventing it from being looped when instrumentation is enabled.
Also, this commit places `sched/instrument/stack_record.c` in IRAM.
This commit is contained in:
Tiago Medicci Serrano 2024-09-20 14:28:46 -03:00 committed by Xiang Xiao
parent 2b59a0a19b
commit 72acec7275
4 changed files with 6 additions and 2 deletions

View File

@ -429,11 +429,12 @@ int up_cpu_index(void);
# define up_cpu_index() (0)
#endif
static inline_function uint32_t *up_current_regs(void)
noinstrument_function static inline_function uint32_t *up_current_regs(void)
{
return (uint32_t *)g_current_regs[up_cpu_index()];
}
noinstrument_function
static inline_function void up_set_current_regs(uint32_t *regs)
{
g_current_regs[up_cpu_index()] = regs;
@ -449,7 +450,7 @@ static inline_function void up_set_current_regs(uint32_t *regs)
****************************************************************************/
#ifndef __ASSEMBLY__
noinstrument_function static inline bool up_interrupt_context(void)
noinstrument_function static inline_function bool up_interrupt_context(void)
{
#ifdef CONFIG_SMP
irqstate_t flags = up_irq_save();

View File

@ -102,6 +102,7 @@ SECTIONS
*libsched.a:sched_suspendscheduler.*(.literal .text .literal.* .text.*)
*libsched.a:sched_thistask.*(.literal .text .literal.* .text.*)
*libsched.a:spinlock.*(.literal .text .literal.* .text.*)
*libsched.a:stack_record.*(.literal .text .literal.* .text.*)
*libc.a:*lib_instrument.*(.literal .text .literal.* .text.*)

View File

@ -210,6 +210,7 @@ SECTIONS
*libsched.a:sched_suspendscheduler.*(.literal .text .literal.* .text.*)
*libsched.a:sched_thistask.*(.literal .text .literal.* .text.*)
*libsched.a:spinlock.*(.literal .text .literal.* .text.*)
*libsched.a:stack_record.*(.literal .text .literal.* .text.*)
#ifdef CONFIG_ESP32S3_SPEED_UP_ISR
*libarch.a:xtensa_switchcontext.*(.literal.up_switch_context .text.up_switch_context)

View File

@ -104,6 +104,7 @@ SECTIONS
*libsched.a:sched_thistask.*(.literal .text .literal.* .text.*)
*libsched.a:spinlock.*(.literal .text .literal.* .text.*)
*libsched.a:*sched_get_stackinfo.*(.literal .text .literal.* .text.*)
*libsched.a:stack_record.*(.literal .text .literal.* .text.*)
#ifdef CONFIG_ESP32S3_SPEED_UP_ISR
*libarch.a:xtensa_switchcontext.*(.literal.up_switch_context .text.up_switch_context)