Skip to content

Commit

Permalink
Merge branch 'bugfix/inline_intrmask_from_isr' into 'master'
Browse files Browse the repository at this point in the history
freertos: always inline xPortSetInterruptMaskFromISR and vPortClearInterruptMaskFromISR

Closes IDFGH-6669

See merge request espressif/esp-idf!16970
  • Loading branch information
ESP-Marius committed Feb 23, 2022
2 parents 2ac0942 + ca6f76d commit 06d8a5b
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion components/driver/spi_bus_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ typedef struct spi_bus_lock_t spi_bus_lock_t;
#define REQUEST_BIT(mask) ((mask) << REQ_SHIFT)
#define PENDING_BIT(mask) ((mask) << PENDING_SHIFT)
#define DEV_MASK(id) (LOCK_BIT(1<<id) | PENDING_BIT(1<<id) | REQUEST_BIT(1<<id))
#define ID_DEV_MASK(mask) (ffs(mask) - 1)
#define ID_DEV_MASK(mask) (__builtin_ffs(mask) - 1)

#define REQ_MASK BIT1_MASK(REQ_SHIFT+MAX_DEV_NUM, REQ_SHIFT)
#define PEND_MASK BIT1_MASK(PENDING_SHIFT+MAX_DEV_NUM, PENDING_SHIFT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,14 @@ extern void _frxt_setup_switch( void ); //Defined in portasm.S

// --------------------- 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
2 changes: 1 addition & 1 deletion components/hal/esp32/include/hal/gpio_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ static inline void gpio_ll_iomux_in(gpio_dev_t *hw, uint32_t gpio, uint32_t sign
* @param pin_name Pin name to configure
* @param func Function to assign to the pin
*/
static inline void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
static inline __attribute__((always_inline)) void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
{
PIN_FUNC_SELECT(pin_name, func);
}
Expand Down
2 changes: 1 addition & 1 deletion components/hal/esp32c2/include/hal/gpio_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static inline void gpio_ll_iomux_in(gpio_dev_t *hw, uint32_t gpio, uint32_t sign
* @param pin_name Pin name to configure
* @param func Function to assign to the pin
*/
static inline void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
static inline __attribute__((always_inline)) void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
{
PIN_FUNC_SELECT(pin_name, func);
}
Expand Down
2 changes: 1 addition & 1 deletion components/hal/esp32c3/include/hal/gpio_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static inline void gpio_ll_iomux_in(gpio_dev_t *hw, uint32_t gpio, uint32_t sign
* @param pin_name Pin name to configure
* @param func Function to assign to the pin
*/
static inline void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
static inline __attribute__((always_inline)) void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
{
// Disable USB Serial JTAG if pins 18 or pins 19 needs to select an IOMUX function
if (pin_name == IO_MUX_GPIO18_REG || pin_name == IO_MUX_GPIO19_REG) {
Expand Down
2 changes: 1 addition & 1 deletion components/hal/esp32h2/include/hal/gpio_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static inline void gpio_ll_iomux_in(gpio_dev_t *hw, uint32_t gpio, uint32_t sign
* @param pin_name Pin name to configure
* @param func Function to assign to the pin
*/
static inline void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
static inline __attribute__((always_inline)) void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
{
if (pin_name == IO_MUX_GPIO18_REG || pin_name == IO_MUX_GPIO19_REG) {
CLEAR_PERI_REG_MASK(USB_DEVICE_CONF0_REG, USB_DEVICE_USB_PAD_ENABLE);
Expand Down
2 changes: 1 addition & 1 deletion components/hal/esp32s2/include/hal/gpio_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static inline void gpio_ll_iomux_in(gpio_dev_t *hw, uint32_t gpio, uint32_t sign
* @param pin_name Pin name to configure
* @param func Function to assign to the pin
*/
static inline void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
static inline __attribute__((always_inline)) void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
{
PIN_FUNC_SELECT(pin_name, func);
}
Expand Down
2 changes: 1 addition & 1 deletion components/hal/esp32s3/include/hal/gpio_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static inline void gpio_ll_iomux_in(gpio_dev_t *hw, uint32_t gpio, uint32_t sign
* @param pin_name Pin name to configure
* @param func Function to assign to the pin
*/
static inline void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
static inline __attribute__((always_inline)) void gpio_ll_iomux_func_sel(uint32_t pin_name, uint32_t func)
{
if (pin_name == IO_MUX_GPIO19_REG || pin_name == IO_MUX_GPIO20_REG) {
CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_USB_PAD_ENABLE);
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

0 comments on commit 06d8a5b

Please sign in to comment.