2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2017-10-27 21:43:34 +08:00
|
|
|
zephyr_cc_option(-mlongcalls)
|
|
|
|
|
2019-10-24 23:08:21 +08:00
|
|
|
zephyr_library()
|
|
|
|
|
|
|
|
zephyr_library_sources(
|
|
|
|
cpu_idle.c
|
|
|
|
fatal.c
|
|
|
|
window_vectors.S
|
2023-12-07 05:42:05 +08:00
|
|
|
xtensa_asm2_util.S
|
2019-11-19 18:32:32 +08:00
|
|
|
irq_manage.c
|
2023-12-07 05:55:06 +08:00
|
|
|
thread.c
|
2023-12-09 05:42:59 +08:00
|
|
|
vector_handlers.c
|
2019-10-24 23:08:21 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_XTENSA_USE_CORE_CRT1 crt1.S)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)
|
2020-10-03 05:55:34 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_THREAD_LOCAL_STORAGE tls.c)
|
2021-01-07 14:11:11 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_XTENSA_ENABLE_BACKTRACE xtensa_backtrace.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_XTENSA_ENABLE_BACKTRACE debug_helpers_asm.S)
|
2021-10-21 09:53:04 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_DEBUG_COREDUMP coredump.c)
|
2022-06-06 22:49:27 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_TIMING_FUNCTIONS timing.c)
|
2021-10-27 03:58:21 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_GDBSTUB gdbstub.c)
|
2023-11-20 07:44:56 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_XTENSA_MMU ptables.c mmu.c)
|
2022-12-14 16:35:36 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.S)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_XTENSA_SYSCALL_USE_HELPER syscall_helper.c)
|
2023-09-28 19:59:53 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_LLEXT elf.c)
|
2023-12-09 02:09:31 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SMP smp.c)
|
2021-10-27 03:58:21 +08:00
|
|
|
|
2023-10-13 02:00:45 +08:00
|
|
|
zephyr_library_sources_ifdef(
|
|
|
|
CONFIG_KERNEL_VM_USE_CUSTOM_MEM_RANGE_CHECK
|
|
|
|
mem_manage.c
|
|
|
|
)
|
|
|
|
|
2022-01-21 08:27:46 +08:00
|
|
|
if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "xcc")
|
|
|
|
zephyr_library_sources(xcc_stubs.c)
|
|
|
|
endif()
|
|
|
|
|
2017-10-27 21:43:34 +08:00
|
|
|
add_subdirectory(startup)
|
2022-01-09 07:51:04 +08:00
|
|
|
|
|
|
|
# This produces a preprocessed and regenerated (in the sense of gcc
|
|
|
|
# -dM, supported by all Xtensa toolchains) core-isa.h file available
|
|
|
|
# as "core-isa-dM.h". This can be easily parsed by non-C tooling.
|
|
|
|
#
|
|
|
|
# Note that this adds the SOC/HAL include directory explicitly, they
|
2022-01-21 03:11:08 +08:00
|
|
|
# are the official places where we find core-isa.h. (Also that we
|
|
|
|
# undefine __XCC_ because that compiler actually trips an error trying
|
|
|
|
# to build this file to protect against mismatched versions.)
|
2022-01-09 07:51:04 +08:00
|
|
|
set(CORE_ISA_DM ${CMAKE_BINARY_DIR}/zephyr/include/generated/core-isa-dM.h)
|
|
|
|
set(CORE_ISA_IN ${CMAKE_BINARY_DIR}/zephyr/include/generated/core-isa-dM.c)
|
2022-01-21 03:11:08 +08:00
|
|
|
file(WRITE ${CORE_ISA_IN} "#include <xtensa/config/core-isa.h>\n")
|
2022-01-09 07:51:04 +08:00
|
|
|
add_custom_command(OUTPUT ${CORE_ISA_DM}
|
2022-01-21 03:11:08 +08:00
|
|
|
COMMAND ${CMAKE_C_COMPILER} -E -dM -U__XCC__
|
2022-01-09 07:51:04 +08:00
|
|
|
-I${ZEPHYR_XTENSA_MODULE_DIR}/zephyr/soc/${CONFIG_SOC}
|
|
|
|
-I${SOC_DIR}/${ARCH}/${SOC_PATH}
|
|
|
|
${CORE_ISA_IN} -o ${CORE_ISA_DM})
|
|
|
|
|
|
|
|
# Generates a list of device-specific scratch register choices
|
|
|
|
set(ZSR_H ${CMAKE_BINARY_DIR}/zephyr/include/generated/zsr.h)
|
|
|
|
add_custom_command(OUTPUT ${ZSR_H} DEPENDS ${CORE_ISA_DM}
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/gen_zsr.py
|
2023-02-17 03:25:48 +08:00
|
|
|
$<$<BOOL:${CONFIG_XTENSA_MMU}>:--mmu>
|
2022-01-09 07:51:04 +08:00
|
|
|
${CORE_ISA_DM} ${ZSR_H})
|
|
|
|
add_custom_target(zsr_h DEPENDS ${ZSR_H})
|
|
|
|
add_dependencies(zephyr_interface zsr_h)
|