Skip to content

Commit

Permalink
freertos: always inline xPortSetInterruptMaskFromISR and vPortClearIn…
Browse files Browse the repository at this point in the history
…terruptMaskFromISR

These were called from IRAM context where the caller expect them to be inlined
and accessible when cache is disabled. This was not the case when compiled with -O0.

Closes #8301
  • Loading branch information
ESP-Marius committed Feb 7, 2022
1 parent 84d11d1 commit 8220b2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,14 @@ static inline void __attribute__((always_inline)) uxPortCompareSetExtram(volatil

// --------------------- Interrupts ------------------------

static inline UBaseType_t xPortSetInterruptMaskFromISR(void)
static inline UBaseType_t __attribute__((always_inline)) xPortSetInterruptMaskFromISR(void)
{
UBaseType_t prev_int_level = XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL);
portbenchmarkINTERRUPT_DISABLE();
return prev_int_level;
}

static inline void vPortClearInterruptMaskFromISR(UBaseType_t prev_level)
static inline void __attribute__((always_inline)) vPortClearInterruptMaskFromISR(UBaseType_t prev_level)
{
portbenchmarkINTERRUPT_RESTORE(prev_level);
XTOS_RESTORE_JUST_INTLEVEL((int) prev_level);
Expand Down
3 changes: 3 additions & 0 deletions tools/unit-test-app/configs/no_optimization_c3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_IDF_TARGET="esp32c3"
TEST_COMPONENTS=esp_ipc spi_flash
CONFIG_COMPILER_OPTIMIZATION_NONE=y
3 changes: 3 additions & 0 deletions tools/unit-test-app/configs/no_optimization_esp32
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_IDF_TARGET="esp32"
TEST_COMPONENTS=esp_ipc spi_flash
CONFIG_COMPILER_OPTIMIZATION_NONE=y

1 comment on commit 8220b2b

@ginkgm
Copy link
Collaborator

@ginkgm ginkgm commented on 8220b2b Apr 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target Branch Merged by commit Supported since IDF ver. Last N.A. IDF ver.
master 06d8a5b N.A. v5.0-dev
release/v4.4 c9ce438 v4.4.1 N.A.
release/v4.3 cd598bd N.A. v4.3.2

Please sign in to comment.