Skip to content

Commit

Permalink
arch/xtensa: use arch atomic when enable iram heap
Browse files Browse the repository at this point in the history
S32C1I instructions may target cached, cache-bypass,
and data RAM memory locations. S32C1I instructions
are not permitted to access memory addresses in data ROM,
instruction memory or the address region allocated to
the XLMI port. Attempts to direct the S32C1I at these
addresses will cause an exception.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
  • Loading branch information
zyfeier committed Nov 15, 2024
1 parent 7ba0f11 commit c599baa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/xtensa/src/cmake/Toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,7 @@ endif()
if(CONFIG_DEBUG_SYMBOLS)
add_compile_options(${CONFIG_DEBUG_SYMBOLS_LEVEL})
endif()

if(CONFIG_LIBC_ARCH_ATOMIC)
add_compile_options(-D__STDC_NO_ATOMICS__)
endif()
1 change: 1 addition & 0 deletions arch/xtensa/src/esp32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ config ESP32_RTC_HEAP
config ESP32_IRAM_HEAP
bool "Use the rest of IRAM as a separate heap"
select ARCH_HAVE_EXTRA_HEAPS
select LIBC_ARCH_ATOMIC
default n

endmenu # Memory Configuration
Expand Down
4 changes: 4 additions & 0 deletions arch/xtensa/src/lx6/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION += $(CONFIG_DEBUG_SYMBOLS_LEVEL)
endif

ifeq ($(CONFIG_LIBC_ARCH_ATOMIC),y)
ARCHCPUFLAGS += -D__STDC_NO_ATOMICS__
endif

# Default toolchain
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
ARCHCFLAGS += -Wno-atomic-alignment
Expand Down
4 changes: 4 additions & 0 deletions arch/xtensa/src/lx7/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION += $(CONFIG_DEBUG_SYMBOLS_LEVEL)
endif

ifeq ($(CONFIG_LIBC_ARCH_ATOMIC),y)
ARCHCPUFLAGS += -D__STDC_NO_ATOMICS__
endif

# Default toolchain
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
ARCHCFLAGS += -Wno-atomic-alignment
Expand Down

0 comments on commit c599baa

Please sign in to comment.