mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 05:04:33 +02:00
spi flash: fix cache accessed while disabled issues at -O0
mask_get_id and gpio_hal_iomux_func_sel were called while cache is disabled, but were not inlined as expected at -0O. Force these functions to always be inlined.
This commit is contained in:
@@ -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)
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -380,7 +380,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) {
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user