Skip to content

Commit 7c3705d

Browse files
committed
arch/xtensa: Add XTENSA_CALL0_ABI kconfig
New ABI, much simpler, slightly bigger/slower code, but MUCH cleaner syscall entry. Signed-off-by: Andy Ross <andyross@google.com>
1 parent 8e7d434 commit 7c3705d

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

arch/xtensa/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ config SIMULATOR_XTENSA
1414
help
1515
Specify if the board configuration should be treated as a simulator.
1616

17+
config XTENSA_CALL0_ABI
18+
bool "Use non-windowed ABI"
19+
help
20+
When selected, all code will be built to use the CALL0 ABI
21+
instead of register windows (though the context management
22+
code will still exploit the extra registers for faster
23+
interrupt/exception handling -- this does not build a Zephyr
24+
to run on hardware that truly lacks register windows). This
25+
is required for userspace, as exception handling across a
26+
priviledge boundary must be able to spill the full context.
27+
For other systems, it improves context switch speed and
28+
stack usage at the expense of somewhat higher code size and
29+
execution time for function calls.
30+
1731
config SYS_CLOCK_HW_CYCLES_PER_SEC
1832
prompt "Hardware clock cycles per second, 2000000 for ISS"
1933
default 2000000

cmake/compiler/gcc/target.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ elseif("${ARCH}" STREQUAL "mips")
7878
include(${CMAKE_CURRENT_LIST_DIR}/target_mips.cmake)
7979
endif()
8080

81+
if(CONFIG_XTENSA_CALL0_ABI)
82+
list(APPEND TOOLCHAIN_C_FLAGS -mabi=call0)
83+
endif()
84+
8185
if(SYSROOT_DIR)
8286
# The toolchain has specified a sysroot dir, pass it to the compiler
8387
list(APPEND TOOLCHAIN_C_FLAGS

cmake/toolchain/xcc/common.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ set(NOSYSDEF_CFLAG "")
2222

2323
list(APPEND TOOLCHAIN_C_FLAGS -fms-extensions)
2424

25+
if(CONFIG_XTENSA_CALL0_ABI)
26+
list(APPEND TOOLCHAIN_C_FLAGS -mabi=call0)
27+
endif()
28+
2529
set(TOOLCHAIN_HAS_NEWLIB OFF CACHE BOOL "True if toolchain supports newlib")

0 commit comments

Comments
 (0)