1# SPDX-License-Identifier: Apache-2.0 2 3zephyr_library() 4 5zephyr_library_sources( 6 cpu_idle.S 7 early_mem_funcs.S 8 fatal.c 9 irq_init.c 10 irq_manage.c 11 prep_c.c 12 reboot.c 13 reset.S 14 reset.c 15 switch.S 16 thread.c 17 vector_table.S 18) 19 20# Use large code model for addresses larger than 32 bits, 21# This is 10 characters long (0x12345678). We can't use a 22# simple numeric comparison because these values may be 23# beyond the numeric range of integers for cmake. 24 25string(LENGTH "x${CONFIG_SRAM_BASE_ADDRESS}" SRAM_LENGTH) 26string(LENGTH "x${CONFIG_KERNEL_VM_BASE}" KERNEL_VM_LENGTH) 27 28if(${SRAM_LENGTH} GREATER 11 OR ${KERNEL_VM_LENGTH} GREATER 11) 29 zephyr_cc_option(-mcmodel=large) 30endif() 31 32zephyr_library_sources_ifdef(CONFIG_LLEXT elf.c) 33zephyr_library_sources_ifdef(CONFIG_FPU_SHARING fpu.c fpu.S) 34zephyr_library_sources_ifdef(CONFIG_ARM_MMU mmu.c mmu.S) 35zephyr_library_sources_ifdef(CONFIG_ARM_MPU cortex_r/arm_mpu.c) 36zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.S) 37zephyr_library_sources_ifdef(CONFIG_GEN_SW_ISR_TABLE isr_wrapper.S) 38zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c) 39zephyr_library_sources_ifdef(CONFIG_THREAD_LOCAL_STORAGE tls.c) 40zephyr_library_sources_ifdef(CONFIG_HAS_ARM_SMCCC smccc-call.S) 41zephyr_library_sources_ifdef(CONFIG_AARCH64_IMAGE_HEADER header.S) 42zephyr_library_sources_ifdef(CONFIG_SEMIHOST semihost.c) 43zephyr_library_sources_ifdef(CONFIG_DEBUG_COREDUMP coredump.c) 44if ((CONFIG_MP_MAX_NUM_CPUS GREATER 1) OR (CONFIG_SMP)) 45 zephyr_library_sources(smp.c) 46endif () 47 48zephyr_cc_option_ifdef(CONFIG_USERSPACE -mno-outline-atomics) 49zephyr_cc_option_ifdef(CONFIG_FRAME_POINTER -mno-omit-leaf-frame-pointer) 50 51# GCC may generate ldp/stp instructions with the Advanced SIMD Qn registers for 52# consecutive 32-byte loads and stores. Saving and restoring the Advanced SIMD 53# context is very expensive, and it is preferable to keep it turned off by not 54# emitting these instructions for better context switching performance. 55 56if(CMAKE_C_COMPILER_ID STREQUAL "GNU") 57 zephyr_cc_option(-moverride=tune=no_ldp_stp_qregs) 58endif() 59 60add_subdirectory_ifdef(CONFIG_XEN xen) 61 62if(CONFIG_GEN_SW_ISR_TABLE) 63 if(CONFIG_DYNAMIC_INTERRUPTS) 64 zephyr_linker_sources(RWDATA swi_tables.ld) 65 else() 66 zephyr_linker_sources(RODATA swi_tables.ld) 67 endif() 68endif() 69