CMake style all changed files

Signed-off-by: Kent McLeod <kent@kry10.com>
This commit is contained in:
Kent McLeod 2026-03-12 11:19:51 +11:00 committed by Kent McLeod
parent bfb45ec550
commit 4cdc428082
19 changed files with 1076 additions and 1484 deletions

View file

@ -23,10 +23,5 @@ macro(sel4_configure_platform_settings)
endmacro()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
seL4
DEFAULT_MSG
KERNEL_PATH
KERNEL_HELPERS_PATH
KERNEL_CONFIG_PATH
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(seL4 DEFAULT_MSG KERNEL_PATH KERNEL_HELPERS_PATH
KERNEL_CONFIG_PATH)

View file

@ -4,30 +4,18 @@
# SPDX-License-Identifier: GPL-2.0-only
#
config_option(
KernelIsMCS KERNEL_MCS "Use the MCS kernel configuration, which is not verified." DEFAULT OFF
)
config_option(KernelIsMCS KERNEL_MCS "Use the MCS kernel configuration, which is not verified."
DEFAULT OFF)
# Error for unsupported MCS platforms
if(KernelIsMCS AND (NOT KernelPlatformSupportsMCS))
message(
FATAL_ERROR "KernelIsMCS selected, but platform: ${KernelPlatform} does not support it."
)
message(FATAL_ERROR "KernelIsMCS selected, but platform: ${KernelPlatform} does not support it.")
endif()
# Proof based configuration variables
set(CSPEC_DIR
"."
CACHE PATH ""
)
set(SKIP_MODIFIES
ON
CACHE BOOL ""
)
set(SORRY_BITFIELD_PROOFS
OFF
CACHE BOOL ""
)
set(CSPEC_DIR "." CACHE PATH "")
set(SKIP_MODIFIES ON CACHE BOOL "")
set(SORRY_BITFIELD_PROOFS OFF CACHE BOOL "")
find_file(UMM_TYPES umm_types.txt CMAKE_FIND_ROOT_PATH_BOTH)
set(force FORCE)
if(KernelVerificationBuild)
@ -48,8 +36,7 @@ set_property(
asid_pool_C
pte_C
user_data_C
user_data_device_C
)
user_data_device_C)
# These options are now set in seL4Config.cmake
if(DEFINED CALLED_declare_default_headers)
@ -57,13 +44,9 @@ if(DEFINED CALLED_declare_default_headers)
if("${KernelArch}" STREQUAL "riscv")
math(EXPR MAX_NUM_IRQ "${CONFIGURE_MAX_IRQ} + 2")
else()
if(DEFINED KernelMaxNumNodes
AND CONFIGURE_NUM_PPI GREATER "0"
AND "${KernelArch}" STREQUAL "arm"
)
math(EXPR MAX_NUM_IRQ
"(${KernelMaxNumNodes}-1)*${CONFIGURE_NUM_PPI} + ${CONFIGURE_MAX_IRQ}"
)
if(DEFINED KernelMaxNumNodes AND CONFIGURE_NUM_PPI GREATER "0" AND "${KernelArch}" STREQUAL
"arm")
math(EXPR MAX_NUM_IRQ "(${KernelMaxNumNodes}-1)*${CONFIGURE_NUM_PPI} + ${CONFIGURE_MAX_IRQ}")
else()
set(MAX_NUM_IRQ "${CONFIGURE_MAX_IRQ}")
endif()
@ -73,20 +56,15 @@ if(DEFINED CALLED_declare_default_headers)
math(EXPR BITS "${BITS} + 1")
math(EXPR MAX_NUM_IRQ "${MAX_NUM_IRQ} >> 1")
endwhile()
set(CONFIGURE_IRQ_SLOT_BITS
"${BITS}"
CACHE INTERNAL ""
)
set(CONFIGURE_IRQ_SLOT_BITS "${BITS}" CACHE INTERNAL "")
if(NOT DEFINED CONFIGURE_TIMER_PRECISION)
set(CONFIGURE_TIMER_PRECISION "0")
endif()
if(NOT DEFINED CONFIGURE_TIMER_OVERHEAD_TICKS)
set(CONFIGURE_TIMER_OVERHEAD_TICKS "0")
endif()
configure_file(
src/arch/${KernelArch}/platform_gen.h.in
${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/platform_gen.h @ONLY
)
configure_file(src/arch/${KernelArch}/platform_gen.h.in
${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/platform_gen.h @ONLY)
include_directories(include/plat/default)
endif()
@ -98,11 +76,8 @@ include(src/arch/${KernelArch}/config.cmake)
include(include/${KernelWordSize}/mode/config.cmake)
include(src/config.cmake)
set(KernelCustomDTS
""
CACHE FILEPATH "Provide a device tree file to use instead of the \
KernelPlatform's defaults"
)
set(KernelCustomDTS "" CACHE FILEPATH "Provide a device tree file to use instead of the \
KernelPlatform's defaults")
if(NOT "${KernelCustomDTS}" STREQUAL "")
if(NOT EXISTS ${KernelCustomDTS})
@ -126,100 +101,57 @@ config_string(
The root CNode needs at least enough space to contain seL4_NumInitialCaps \
plus enough room for all the Untyped Caps."
DEFAULT 12
UNQUOTE
)
UNQUOTE)
config_string(
KernelTimerTickMS TIMER_TICK_MS "Timer tick period in milliseconds"
DEFAULT 2
UNQUOTE
DEPENDS "NOT KernelIsMCS"
UNDEF_DISABLED
)
config_string(
KernelTimeSlice TIME_SLICE "Number of timer ticks until a thread is preempted."
DEFAULT 5
UNQUOTE
DEPENDS "NOT KernelIsMCS"
UNDEF_DISABLED
)
config_string(KernelTimerTickMS TIMER_TICK_MS "Timer tick period in milliseconds" DEFAULT 2 UNQUOTE
DEPENDS "NOT KernelIsMCS" UNDEF_DISABLED)
config_string(KernelTimeSlice TIME_SLICE "Number of timer ticks until a thread is preempted."
DEFAULT 5 UNQUOTE DEPENDS "NOT KernelIsMCS" UNDEF_DISABLED)
config_string(
KernelBootThreadTimeSlice BOOT_THREAD_TIME_SLICE
"Number of milliseconds until the boot thread is preempted."
DEFAULT 5
UNQUOTE
DEPENDS "KernelIsMCS"
UNDEF_DISABLED
)
"Number of milliseconds until the boot thread is preempted." DEFAULT 5 UNQUOTE
DEPENDS "KernelIsMCS" UNDEF_DISABLED)
config_string(
KernelRetypeFanOutLimit RETYPE_FAN_OUT_LIMIT
"Maximum number of objects that can be created in a single Retype() invocation."
DEFAULT 256
UNQUOTE
)
"Maximum number of objects that can be created in a single Retype() invocation." DEFAULT 256
UNQUOTE)
config_string(
KernelMaxNumWorkUnitsPerPreemption MAX_NUM_WORK_UNITS_PER_PREEMPTION
"Maximum number of work units (delete/revoke iterations) until the kernel checks for\
pending interrupts (and preempts the currently running syscall if interrupts are pending)."
DEFAULT 100
UNQUOTE
)
UNQUOTE)
config_string(
KernelResetChunkBits RESET_CHUNK_BITS
"Maximum size in bits of chunks of memory to zero before checking a preemption point."
DEFAULT 8
UNQUOTE
)
config_string(
KernelMaxNumBootinfoUntypedCaps MAX_NUM_BOOTINFO_UNTYPED_CAPS
"Max number of bootinfo untyped caps"
DEFAULT 230
UNQUOTE
)
"Maximum size in bits of chunks of memory to zero before checking a preemption point." DEFAULT 8
UNQUOTE)
config_string(KernelMaxNumBootinfoUntypedCaps MAX_NUM_BOOTINFO_UNTYPED_CAPS
"Max number of bootinfo untyped caps" DEFAULT 230 UNQUOTE)
config_option(KernelFastpath FASTPATH "Enable IPC fastpath" DEFAULT ON)
config_option(
KernelExceptionFastpath EXCEPTION_FASTPATH "Enable exception fastpath"
DEFAULT OFF
DEPENDS "NOT KernelVerificationBuild; KernelSel4ArchAarch64"
)
config_option(KernelExceptionFastpath EXCEPTION_FASTPATH "Enable exception fastpath" DEFAULT OFF
DEPENDS "NOT KernelVerificationBuild; KernelSel4ArchAarch64")
config_string(
KernelNumDomains NUM_DOMAINS "The number of scheduler domains in the system"
DEFAULT 1
UNQUOTE
)
config_string(KernelNumDomains NUM_DOMAINS "The number of scheduler domains in the system" DEFAULT 1
UNQUOTE)
config_option(
KernelSignalFastpath SIGNAL_FASTPATH "Enable notification signal fastpath"
DEFAULT OFF
KernelSignalFastpath SIGNAL_FASTPATH "Enable notification signal fastpath" DEFAULT OFF
DEPENDS "KernelIsMCS; KernelFastpath; KernelSel4ArchAarch64; NOT KernelVerificationBuild"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
find_file(
KernelDomainSchedule default_domain.c
PATHS src/config
CMAKE_FIND_ROOT_PATH_BOTH
find_file(KernelDomainSchedule default_domain.c PATHS src/config CMAKE_FIND_ROOT_PATH_BOTH
DOC "A C file providing the symbols ksDomSchedule and ksDomScheduleLength \
to be linked with the kernel as a scheduling configuration."
)
to be linked with the kernel as a scheduling configuration.")
if(SEL4_CONFIG_DEFAULT_ADVANCED)
mark_as_advanced(KernelDomainSchedule)
endif()
config_string(
KernelNumPriorities NUM_PRIORITIES "The number of priority levels per domain. Valid range 1-256"
DEFAULT 256
UNQUOTE
)
config_string(KernelNumPriorities NUM_PRIORITIES
"The number of priority levels per domain. Valid range 1-256" DEFAULT 256 UNQUOTE)
config_string(
KernelMaxNumNodes MAX_NUM_NODES "Max number of CPU cores to boot"
DEFAULT 1
DEPENDS "${KernelNumDomains} EQUAL 1"
UNQUOTE
)
config_string(KernelMaxNumNodes MAX_NUM_NODES "Max number of CPU cores to boot" DEFAULT 1
DEPENDS "${KernelNumDomains} EQUAL 1" UNQUOTE)
# Set CONFIG_ENABLE_SMP_SUPPORT as an alias of CONFIG_MAX_NUM_NODES > 1
if(KernelMaxNumNodes GREATER 1)
@ -235,8 +167,7 @@ config_string(
there is no guard below the stack so setting this too small will cause random\
memory corruption"
DEFAULT 12
UNQUOTE
)
UNQUOTE)
config_option(
KernelVerificationBuild
@ -244,8 +175,7 @@ config_option(
"When enabled this configuration option prevents the usage of any other options that\
would compromise the verification story of the kernel. Enabling this option does NOT\
imply you are using a verified kernel."
DEFAULT ON
)
DEFAULT ON)
config_option(
KernelBinaryVerificationBuild
@ -254,15 +184,11 @@ config_option(
interfere with binary verification. For example, it will disable some inter-procedural \
optimisations. Enabling this options does NOT imply that you are using a verified kernel."
DEFAULT OFF
DEPENDS "KernelVerificationBuild"
)
DEPENDS "KernelVerificationBuild")
config_option(
KernelDebugBuild DEBUG_BUILD "Enable debug facilities (symbols and assertions) in the kernel"
DEFAULT ON
DEPENDS "NOT KernelVerificationBuild"
DEFAULT_DISABLED OFF
)
DEFAULT ON DEPENDS "NOT KernelVerificationBuild" DEFAULT_DISABLED OFF)
config_option(
HardwareDebugAPI
@ -271,23 +197,16 @@ config_option(
allows userspace processes to set breakpoints, watchpoints and to \
single-step through thread execution."
DEFAULT OFF
DEPENDS "NOT KernelVerificationBuild;NOT KernelHardwareDebugAPIUnsupported"
)
DEPENDS "NOT KernelVerificationBuild;NOT KernelHardwareDebugAPIUnsupported")
config_option(
KernelPrinting PRINTING
"Allow the kernel to print out messages to the serial console during bootup and execution."
DEFAULT "${KernelDebugBuild}"
DEPENDS "NOT KernelVerificationBuild"
DEFAULT_DISABLED OFF
)
DEFAULT "${KernelDebugBuild}" DEPENDS "NOT KernelVerificationBuild" DEFAULT_DISABLED OFF)
config_option(
KernelInvocationReportErrorIPC KERNEL_INVOCATION_REPORT_ERROR_IPC
"Allows the kernel to write the userError to the IPC buffer"
DEFAULT OFF
DEPENDS "KernelPrinting"
DEFAULT_DISABLED OFF
)
"Allows the kernel to write the userError to the IPC buffer" DEFAULT OFF DEPENDS "KernelPrinting"
DEFAULT_DISABLED OFF)
config_choice(
KernelBenchmarks
@ -329,8 +248,7 @@ config_string(
different trace point identifiers which can be used."
DEFAULT 1
DEPENDS "NOT KernelVerificationBuild;KernelBenchmarksTracepoints" DEFAULT_DISABLED 0
UNQUOTE
)
UNQUOTE)
config_option(
KernelIRQReporting
@ -340,8 +258,7 @@ config_option(
messages are benign then use this config to turn them off."
DEFAULT ON
DEPENDS "KernelPrinting"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
config_option(
KernelColourPrinting
COLOUR_PRINTING
@ -351,16 +268,14 @@ config_option(
setting if your serial output is redirected to a file or pipe."
DEFAULT ON
DEPENDS "KernelPrinting"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
config_string(
KernelUserStackTraceLength USER_STACK_TRACE_LENGTH
"On a double fault the kernel can try and print out the users stack to aid \
debugging. This option determines how many words of stack should be printed."
DEFAULT 16
DEPENDS "KernelPrinting" DEFAULT_DISABLED 0
UNQUOTE
)
UNQUOTE)
config_choice(
KernelOptimisation
@ -370,8 +285,7 @@ config_choice(
"-Os;KernelOptimisationOS;KERNEL_OPT_LEVEL_OS"
"-O0;KernelOptimisationO0;KERNEL_OPT_LEVEL_O0"
"-O1;KernelOptimisationO1;KERNEL_OPT_LEVEL_O1"
"-O3;KernelOptimisationO3;KERNEL_OPT_LEVEL_O3"
)
"-O3;KernelOptimisationO3;KERNEL_OPT_LEVEL_O3")
config_option(
KernelOptimisationCloneFunctions
@ -385,16 +299,14 @@ config_option(
This currently only affects GCC builds."
DEFAULT ON
DEPENDS "NOT KernelBinaryVerificationBuild"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
config_option(
KernelFWholeProgram KERNEL_FWHOLE_PROGRAM
"Enable -fwhole-program when linking kernel. This should work modulo gcc bugs, which \
are not uncommon with -fwhole-program. Consider this feature experimental!"
DEFAULT OFF
DEPENDS "NOT KernelBinaryVerificationBuild"
)
DEPENDS "NOT KernelBinaryVerificationBuild")
config_option(
KernelDangerousCodeInjection DANGEROUS_CODE_INJECTION
@ -412,8 +324,7 @@ config_option(
cache line prefetcher, the DCU prefetcher and the DCU IP prefetcher. On the cortex \
a53 this disables the L1 Data prefetcher."
DEFAULT OFF
DEPENDS "KernelArchX86 OR KernelPlatformHikey"
)
DEPENDS "KernelArchX86 OR KernelPlatformHikey")
# Builds the kernel with support for an invocation to set the TLS_BASE
# of the currently running thread without a capability.
@ -430,75 +341,56 @@ config_string(
DEFAULT 1
UNQUOTE
DEPENDS "KernelIsMCS"
UNDEF_DISABLED
)
UNDEF_DISABLED)
config_string(
KernelStaticMaxPeriodUs KERNEL_STATIC_MAX_PERIOD_US
"Specifies a static maximum to which scheduling context can have \
either its period or budget configured."
DEFAULT 0
UNQUOTE
DEPENDS "KernelIsMCS"
UNDEF_DISABLED
)
either its period or budget configured." DEFAULT 0 UNQUOTE DEPENDS "KernelIsMCS" UNDEF_DISABLED)
config_option(
KernelClz32 CLZ_32 "Define a __clzsi2 function to count leading zeros for uint32_t arguments. \
Only needed on platforms which lack a builtin instruction." DEFAULT OFF
)
Only needed on platforms which lack a builtin instruction." DEFAULT OFF)
config_option(
KernelClz64 CLZ_64 "Define a __clzdi2 function to count leading zeros for uint64_t arguments. \
Only needed on platforms which lack a builtin instruction." DEFAULT OFF
)
Only needed on platforms which lack a builtin instruction." DEFAULT OFF)
config_option(
KernelCtz32 CTZ_32 "Define a __ctzsi2 function to count trailing zeros for uint32_t arguments. \
Only needed on platforms which lack a builtin instruction." DEFAULT OFF
)
Only needed on platforms which lack a builtin instruction." DEFAULT OFF)
config_option(
KernelCtz64 CTZ_64 "Define a __ctzdi2 function to count trailing zeros for uint64_t arguments. \
Only needed on platforms which lack a builtin instruction." DEFAULT OFF
)
Only needed on platforms which lack a builtin instruction." DEFAULT OFF)
config_option(
KernelClzNoBuiltin CLZ_NO_BUILTIN
"Expose implementations of clzl and clzll to verification by avoiding the use \
of __builtin_clzl and __builtin_clzll." DEFAULT OFF
)
of __builtin_clzl and __builtin_clzll." DEFAULT OFF)
config_option(
KernelCtzNoBuiltin CTZ_NO_BUILTIN
"Expose implementations of ctzl and ctzll to verification by avoiding the use \
of __builtin_ctzl and __builtin_ctzll." DEFAULT OFF
)
of __builtin_ctzl and __builtin_ctzll." DEFAULT OFF)
if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL ""))
set(KernelDTSIntermediate "${CMAKE_CURRENT_BINARY_DIR}/kernel.dts")
set(KernelDTBPath
"${CMAKE_CURRENT_BINARY_DIR}/kernel.dtb"
CACHE INTERNAL "Location of kernel DTB file"
)
set(KernelDTBPath "${CMAKE_CURRENT_BINARY_DIR}/kernel.dtb" CACHE INTERNAL
"Location of kernel DTB file")
set(compatibility_outfile "${CMAKE_CURRENT_BINARY_DIR}/kernel_compat.txt")
set(device_dest "${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/machine/devices_gen.h")
set(platform_yaml
"${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/machine/platform_gen.yaml"
CACHE INTERNAL "Location of platform YAML description"
)
set(platform_json
"${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/machine/platform_gen.json"
CACHE INTERNAL "Location of platform JSON description"
)
set(platform_yaml "${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/machine/platform_gen.yaml"
CACHE INTERNAL "Location of platform YAML description")
set(platform_json "${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/machine/platform_gen.json"
CACHE INTERNAL "Location of platform JSON description")
set(config_file "${CMAKE_CURRENT_SOURCE_DIR}/tools/hardware.yml")
set(config_schema "${CMAKE_CURRENT_SOURCE_DIR}/tools/hardware_schema.yml")
set(KernelCustomDTSOverlay
""
CACHE STRING
"Provide an additional list of overlays to append to the selected KernelPlatform's \
device tree during build time"
)
device tree during build time")
if(NOT "${KernelCustomDTSOverlay}" STREQUAL "")
foreach(dts_entry IN ITEMS ${KernelCustomDTSOverlay})
if(NOT EXISTS ${dts_entry})
@ -532,10 +424,8 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL ""))
file(APPEND "${KernelDTSIntermediate}" "${CONTENTS}")
endforeach()
# Compile DTS to DTB
execute_process(
COMMAND ${DTC_TOOL} -q -I dts -O dtb -o ${KernelDTBPath} ${KernelDTSIntermediate}
RESULT_VARIABLE error
)
execute_process(COMMAND ${DTC_TOOL} -q -I dts -O dtb -o ${KernelDTBPath}
${KernelDTSIntermediate} RESULT_VARIABLE error)
if(error)
message(FATAL_ERROR "Failed to compile DTS to DTB: ${KernelDTSIntermediate}")
endif()
@ -548,20 +438,13 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL ""))
set(STAT_ARGS "-c '%s'")
endif()
# Track the size of the DTB for downstream tools
execute_process(
COMMAND ${STAT_TOOL} ${STAT_ARGS} ${KernelDTBPath}
OUTPUT_VARIABLE KernelDTBSize
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE error
)
execute_process(COMMAND ${STAT_TOOL} ${STAT_ARGS} ${KernelDTBPath} OUTPUT_VARIABLE KernelDTBSize
OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE error)
if(error)
message(FATAL_ERROR "Failed to determine KernelDTBSize: ${KernelDTBPath}")
endif()
string(REPLACE "\'" "" KernelDTBSize ${KernelDTBSize})
set(KernelDTBSize
"${KernelDTBSize}"
CACHE INTERNAL "Size of DTB blob, in bytes"
)
set(KernelDTBSize "${KernelDTBSize}" CACHE INTERNAL "Size of DTB blob, in bytes")
endif()
set(deps ${KernelDTBPath} ${config_file} ${config_schema} ${HARDWARE_GEN_PATH})
@ -573,15 +456,14 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL ""))
execute_process(
COMMAND
${PYTHON3} "${HARDWARE_GEN_PATH}" --dtb "${KernelDTBPath}" --compat-strings
--compat-strings-out "${compatibility_outfile}" --c-header --header-out
"${device_dest}" --hardware-config "${config_file}" --hardware-schema
"${config_schema}" --yaml --yaml-out "${platform_yaml}" --sel4arch
"${KernelSel4Arch}" --addrspace-max "${KernelPaddrUserTop}" --json --json-out
"${platform_json}" --kernel-config-flags "CONFIG_PRINTING=${KernelPrinting}"
--compat-strings-out "${compatibility_outfile}" --c-header --header-out "${device_dest}"
--hardware-config "${config_file}" --hardware-schema "${config_schema}" --yaml --yaml-out
"${platform_yaml}" --sel4arch "${KernelSel4Arch}" --addrspace-max "${KernelPaddrUserTop}"
--json --json-out "${platform_json}" --kernel-config-flags
"CONFIG_PRINTING=${KernelPrinting}"
"CONFIG_ARM_HYPERVISOR_SUPPORT=${KernelArmHypervisorSupport}"
"CONFIG_ARM_SMMU=${KernelArmSMMU}" "CONFIG_TK1_SMMU=${KernelTk1SMMU}"
RESULT_VARIABLE error
)
RESULT_VARIABLE error)
if(error)
message(FATAL_ERROR "Failed to generate from DTB: ${device_dest}")
endif()
@ -590,11 +472,8 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL ""))
# Mark all file dependencies as CMake rerun dependencies.
set(cmake_deps ${deps} ${KernelDTSIntermediate} ${KernelDTSList} ${compatibility_outfile})
set_property(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS ${cmake_deps}
)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
${cmake_deps})
include(src/drivers/config.cmake)
endif()

View file

@ -39,10 +39,7 @@ macro(declare_seL4_arch)
# Use first architecture from list as default.
list(GET _arch_list 0 _default_KernelSel4Arch)
print_message_multiple_options_helper("architectures" "${_default_KernelSel4Arch}")
set(KernelSel4Arch
"${_default_KernelSel4Arch}"
CACHE STRING "" FORCE
)
set(KernelSel4Arch "${_default_KernelSel4Arch}" CACHE STRING "" FORCE)
elseif(NOT "${KernelSel4Arch}" IN_LIST _arch_list)
message(FATAL_ERROR "KernelSel4Arch '${KernelSel4Arch}' not in '${_arch_list}'")
endif()
@ -57,8 +54,7 @@ macro(declare_seL4_arch)
"riscv32;KernelSel4ArchRiscV32;ARCH_RISCV32"
"riscv64;KernelSel4ArchRiscV64;ARCH_RISCV64"
"x86_64;KernelSel4ArchX86_64;ARCH_X86_64"
"ia32;KernelSel4ArchIA32;ARCH_IA32"
)
"ia32;KernelSel4ArchIA32;ARCH_IA32")
if(KernelSel4ArchArmHyp)
# arm-hyp is basically aarch32. This should be cleaned up and aligned
@ -73,37 +69,17 @@ macro(declare_seL4_arch)
"Architecture to use when building the kernel"
"arm;KernelArchARM;ARCH_ARM;KernelSel4ArchAarch32 OR KernelSel4ArchAarch64"
"riscv;KernelArchRiscV;ARCH_RISCV;KernelSel4ArchRiscV32 OR KernelSel4ArchRiscV64"
"x86;KernelArchX86;ARCH_X86;KernelSel4ArchX86_64 OR KernelSel4ArchIA32"
)
"x86;KernelArchX86;ARCH_X86;KernelSel4ArchX86_64 OR KernelSel4ArchIA32")
# Set kernel mode options
if(KernelSel4ArchAarch32
OR KernelSel4ArchRiscV32
OR KernelSel4ArchIA32
)
if(KernelSel4ArchAarch32 OR KernelSel4ArchRiscV32 OR KernelSel4ArchIA32)
config_set(KernelWordSize WORD_SIZE 32)
set(Kernel64
OFF
CACHE INTERNAL ""
)
set(Kernel32
ON
CACHE INTERNAL ""
)
elseif(
KernelSel4ArchAarch64
OR KernelSel4ArchRiscV64
OR KernelSel4ArchX86_64
)
set(Kernel64 OFF CACHE INTERNAL "")
set(Kernel32 ON CACHE INTERNAL "")
elseif(KernelSel4ArchAarch64 OR KernelSel4ArchRiscV64 OR KernelSel4ArchX86_64)
config_set(KernelWordSize WORD_SIZE 64)
set(Kernel64
ON
CACHE INTERNAL ""
)
set(Kernel32
OFF
CACHE INTERNAL ""
)
set(Kernel64 ON CACHE INTERNAL "")
set(Kernel32 OFF CACHE INTERNAL "")
else()
message(FATAL_ERROR "unsupported seL4 architecture: '${KernelSel4Arch}'")
endif()
@ -121,20 +97,11 @@ endmacro()
macro(declare_platform name config1 config2 enable_test)
list(APPEND kernel_platforms "${name}\;${config1}\;${config2}\;${enable_test}")
if("${KernelPlatform}" STREQUAL ${name})
set(${config1}
ON
CACHE INTERNAL "" FORCE
)
set(${config1} ON CACHE INTERNAL "" FORCE)
# Write KernelPlatform into the cache in case it is only a local variable
set(KernelPlatform
${KernelPlatform}
CACHE STRING ""
)
set(KernelPlatform ${KernelPlatform} CACHE STRING "")
else()
set(${config1}
OFF
CACHE INTERNAL "" FORCE
)
set(${config1} OFF CACHE INTERNAL "" FORCE)
endif()
endmacro()
@ -159,8 +126,7 @@ macro(declare_default_headers)
""
"TIMER_FREQUENCY;MAX_IRQ;NUM_PPI;INTERRUPT_CONTROLLER;TIMER;SMMU;CLK_SHIFT;CLK_MAGIC;KERNEL_WCET;TIMER_PRECISION;TIMER_OVERHEAD_TICKS;MAX_SID;MAX_CB"
""
${ARGN}
)
${ARGN})
set(CALLED_declare_default_headers 1)
endmacro()
@ -180,8 +146,7 @@ foreach(
KernelArchArmV7a
KernelArchArmV7ve
KernelArchArmV8a
KernelAArch64SErrorIgnore
)
KernelAArch64SErrorIgnore)
unset(${var} CACHE)
set(${var} OFF)
endforeach()
@ -208,8 +173,7 @@ config_choice(KernelPlatform PLAT "Select the platform" ${kernel_platforms})
if("${KernelPlatform}" STREQUAL "")
message(FATAL_ERROR "Variable 'KernelPlatform' is not set - is PLATFORM '${PLATFORM}' correct? \
Valid platforms are '${KernelPlatform_all_strings}'"
)
Valid platforms are '${KernelPlatform_all_strings}'")
endif()
if("${KernelArch}" STREQUAL "")
@ -239,66 +203,30 @@ config_set(KernelAArch64SErrorIgnore AARCH64_SERROR_IGNORE "${KernelAArch64SErro
# actual armv to that, but leave armv7a config enabled for anything that
# checks directly against it
if(KernelArchArmV7ve)
set(KernelArmArmV
"armv7ve"
CACHE INTERNAL ""
)
set(KernelArmArmV "armv7ve" CACHE INTERNAL "")
elseif(KernelArchArmV7a)
set(KernelArmArmV
"armv7-a"
CACHE INTERNAL ""
)
set(KernelArmArmV "armv7-a" CACHE INTERNAL "")
elseif(KernelArchArmV8a)
set(KernelArmArmV
"armv8-a"
CACHE INTERNAL ""
)
set(KernelArmArmV "armv8-a" CACHE INTERNAL "")
endif()
if(KernelArmCortexA7)
set(KernelArmCPU
"cortex-a7"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a7" CACHE INTERNAL "")
elseif(KernelArmCortexA8)
set(KernelArmCPU
"cortex-a8"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a8" CACHE INTERNAL "")
elseif(KernelArmCortexA9)
set(KernelArmCPU
"cortex-a9"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a9" CACHE INTERNAL "")
elseif(KernelArmCortexA15)
set(KernelArmCPU
"cortex-a15"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a15" CACHE INTERNAL "")
elseif(KernelArmCortexA35)
set(KernelArmCPU
"cortex-a35"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a35" CACHE INTERNAL "")
elseif(KernelArmCortexA53)
set(KernelArmCPU
"cortex-a53"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a53" CACHE INTERNAL "")
elseif(KernelArmCortexA55)
set(KernelArmCPU
"cortex-a55"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a55" CACHE INTERNAL "")
elseif(KernelArmCortexA57)
set(KernelArmCPU
"cortex-a57"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a57" CACHE INTERNAL "")
elseif(KernelArmCortexA72)
set(KernelArmCPU
"cortex-a72"
CACHE INTERNAL ""
)
set(KernelArmCPU "cortex-a72" CACHE INTERNAL "")
endif()
if(KernelArchARM)
config_set(KernelArmMach ARM_MACH "${KernelArmMach}")
@ -311,8 +239,7 @@ else()
endif()
set(toolchain_outputfile "${CMAKE_BINARY_DIR}/${toolchain_file}")
if(("${CMAKE_TOOLCHAIN_FILE}" STREQUAL "") OR ("${CMAKE_TOOLCHAIN_FILE}" STREQUAL
"${toolchain_outputfile}")
)
"${toolchain_outputfile}"))
if(DEFINED CACHE{CROSS_COMPILER_PREFIX})
set(cross_prefix $CACHE{CROSS_COMPILER_PREFIX})
endif()
@ -324,13 +251,9 @@ if(("${CMAKE_TOOLCHAIN_FILE}" STREQUAL "") OR ("${CMAKE_TOOLCHAIN_FILE}" STREQUA
if(NOT "${filea}" STREQUAL "${fileb}")
message(
FATAL_ERROR
"Config changes have resulted in a different toolchain file. This is not supported"
)
"Config changes have resulted in a different toolchain file. This is not supported")
endif()
endif()
file(RENAME "${toolchain_outputfile}.temp" "${toolchain_outputfile}")
set(CMAKE_TOOLCHAIN_FILE
"${toolchain_outputfile}"
CACHE PATH ""
)
set(CMAKE_TOOLCHAIN_FILE "${toolchain_outputfile}" CACHE PATH "")
endif()

View file

@ -17,5 +17,4 @@ add_sources(
idle.c
kernel/thread.c
kernel/vspace.c
ASMFILES head.S traps.S hyp_traps.S idle.S
)
ASMFILES head.S traps.S hyp_traps.S idle.S)

View file

@ -17,5 +17,4 @@ add_sources(
idle.c
kernel/thread.c
kernel/vspace.c
ASMFILES head.S traps.S idle.S
)
ASMFILES head.S traps.S idle.S)

View file

@ -5,8 +5,5 @@
#
add_sources(
DEP "KernelArchArmV7a"
PREFIX src/arch/arm/armv/armv7-a
CFILES cache.c user_access.c tlb.c
ASMFILES machine_asm.S
)
DEP "KernelArchArmV7a" PREFIX src/arch/arm/armv/armv7-a CFILES cache.c user_access.c tlb.c
ASMFILES machine_asm.S)

View file

@ -4,9 +4,5 @@
# SPDX-License-Identifier: GPL-2.0-only
#
add_sources(
DEP "KernelArchArmV8a"
PREFIX src/arch/arm/armv/armv8-a/${KernelWordSize}
CFILES cache.c user_access.c
ASMFILES machine_asm.S
)
add_sources(DEP "KernelArchArmV8a" PREFIX src/arch/arm/armv/armv8-a/${KernelWordSize}
CFILES cache.c user_access.c ASMFILES machine_asm.S)

View file

@ -5,11 +5,7 @@
#
if(KernelSel4ArchAarch32)
set_property(
TARGET kernel_config_target
APPEND
PROPERTY TOPLEVELTYPES pde_C
)
set_property(TARGET kernel_config_target APPEND PROPERTY TOPLEVELTYPES pde_C)
endif()
set(KernelArmPASizeBits40 OFF)
@ -50,22 +46,16 @@ include(src/arch/arm/armv/armv8-a/config.cmake)
config_option(
KernelDebugDisableL2Cache DEBUG_DISABLE_L2_CACHE
"Do not enable the L2 cache on startup for debugging purposes."
DEFAULT OFF
DEPENDS "KernelArchARM"
)
"Do not enable the L2 cache on startup for debugging purposes." DEFAULT OFF
DEPENDS "KernelArchARM")
config_option(
KernelDebugDisableL1ICache DEBUG_DISABLE_L1_ICACHE
"Do not enable the L1 instruction cache on startup for debugging purposes."
DEFAULT OFF
DEPENDS "KernelArchARM;KernelDebugDisableL2Cache"
)
"Do not enable the L1 instruction cache on startup for debugging purposes." DEFAULT OFF
DEPENDS "KernelArchARM;KernelDebugDisableL2Cache")
config_option(
KernelDebugDisableL1DCache DEBUG_DISABLE_L1_DCACHE
"Do not enable the L1 data cache on startup for debugging purposes."
DEFAULT OFF
DEPENDS "KernelArchARM;KernelDebugDisableL2Cache"
)
"Do not enable the L1 data cache on startup for debugging purposes." DEFAULT OFF
DEPENDS "KernelArchARM;KernelDebugDisableL2Cache")
config_option(
KernelDebugDisableBranchPrediction
DEBUG_DISABLE_BRANCH_PREDICTION
@ -73,8 +63,7 @@ config_option(
This makes execution time more deterministic at the expense of dramatically decreasing \
performance. Primary use is for debugging."
DEFAULT OFF
DEPENDS "KernelArchARM"
)
DEPENDS "KernelArchARM")
if(NOT DEFINED KernelSel4ArchArmHyp)
# the current CMake scripts ensure that KernelSel4ArchArmHyp is always set
@ -110,8 +99,7 @@ config_option(
intercepted and delivered to the VM Monitor as fault messages"
DEFAULT ON
DEPENDS "KernelSel4ArchArmHyp;NOT KernelVerificationBuild"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
config_option(
KernelArmErrata430973
@ -121,8 +109,7 @@ config_option(
if code containing ARM/Thumb interworking branch is replaced by different code \
at the same virtual address."
DEFAULT OFF
DEPENDS "KernelArchARM;KernelArmCortexA8"
)
DEPENDS "KernelArchARM;KernelArmCortexA8")
config_option(
KernelArmErrata773022
@ -133,21 +120,13 @@ config_option(
incorrect instructions. The work around is to disable the loop buffer"
DEFAULT ON
DEPENDS "KernelArchARM;KernelArmCortexA15"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
config_option(
KernelArmSMMU ARM_SMMU "Enable SystemMMU"
DEFAULT ON
DEPENDS "KernelPlatformTx2"
DEFAULT_DISABLED OFF
)
config_option(KernelArmSMMU ARM_SMMU "Enable SystemMMU" DEFAULT ON DEPENDS "KernelPlatformTx2"
DEFAULT_DISABLED OFF)
config_option(
KernelTk1SMMU TK1_SMMU "Enable SystemMMU for the Tegra TK1 SoC"
DEFAULT OFF
DEPENDS "KernelPlatformTK1"
)
config_option(KernelTk1SMMU TK1_SMMU "Enable SystemMMU for the Tegra TK1 SoC" DEFAULT OFF
DEPENDS "KernelPlatformTK1")
config_option(
KernelArmEnableA9Prefetcher
@ -162,8 +141,7 @@ config_option(
no longer exist, it is not clear if this is just \
a document error or not."
DEFAULT OFF
DEPENDS "KernelArmCortexA9"
)
DEPENDS "KernelArmCortexA9")
config_option(
KernelArmExportPMUUser
@ -173,16 +151,14 @@ config_option(
WARNING: While useful for evaluating performance, \
this option opens timing and covert channels."
DEFAULT OFF
DEPENDS "KernelArchArmV7a OR KernelArchArmV8a;NOT KernelArmCortexA8"
)
DEPENDS "KernelArchArmV7a OR KernelArchArmV8a;NOT KernelArmCortexA8")
config_option(
KernelArmDisableWFIWFETraps DISABLE_WFI_WFE_TRAPS "Disable the trapping of WFI \
and WFE instructions when configuring the \
Hyp Configuration Registor (HCR) of a VCPU"
DEFAULT OFF
DEPENDS "KernelArchArmV7a OR KernelArchArmV8a;KernelArmHypervisorSupport"
)
DEPENDS "KernelArchArmV7a OR KernelArchArmV8a;KernelArmHypervisorSupport")
config_option(
KernelTk1SMMUInterruptEnable
SMMU_INTERRUPT_ENABLE
@ -195,8 +171,7 @@ config_option(
messages"
DEFAULT "${KernelDebugBuild}"
DEPENDS "KernelTk1SMMU"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
config_option(
KernelAArch32FPUEnableContextSwitch
@ -208,8 +183,7 @@ config_option(
software emulation of FPU/VFP from the C library (e.g. mfloat-abi=soft)."
DEFAULT ON
DEPENDS "KernelSel4ArchAarch32"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
config_option(
KernelAArch64UserCacheEnable
@ -218,8 +192,7 @@ config_option(
instruction or access to CTR_EL0 at EL0 using AArch64. \
When disabled, these operations will be trapped."
DEFAULT ON
DEPENDS "KernelSel4ArchAarch64"
)
DEPENDS "KernelSel4ArchAarch64")
config_option(
KernelAArch64SErrorIgnore
@ -228,8 +201,7 @@ config_option(
be caused by e.g. writes to read-only device registers or ECC errors. \
When this option is enabled SErrors will be ignored."
DEFAULT OFF
DEPENDS "KernelSel4ArchAarch64;NOT KernelVerificationBuild"
)
DEPENDS "KernelSel4ArchAarch64;NOT KernelVerificationBuild")
mark_as_advanced(KernelAArch64SErrorIgnore)
config_option(
@ -241,8 +213,7 @@ config_option(
secure monitor is a higher privilege level and can make any change in the \
system, the proofs can no longer be guaranteed."
DEFAULT OFF
DEPENDS "KernelSel4ArchAarch64"
)
DEPENDS "KernelSel4ArchAarch64")
config_choice(
KernelArmTLSReg
@ -252,8 +223,7 @@ config_choice(
- on aarch32: tpidruro \
- on aarch64: tpidru."
"tpidru;KernelArmTLSRegTPIDRU;ARM_TLS_REG_TPIDRU;KernelArchARM"
"tpidruro;KernelArmTLSRegTPIDRURO;ARM_TLS_REG_TPIDRURO;KernelArchARM"
)
"tpidruro;KernelArmTLSRegTPIDRURO;ARM_TLS_REG_TPIDRURO;KernelArchARM")
if(KernelArmTLSRegTPIDRURO)
set(KernelSetTLSBaseSelf ON)
@ -263,15 +233,8 @@ if(KernelAArch32FPUEnableContextSwitch OR KernelSel4ArchAarch64)
set(KernelHaveFPU ON)
endif()
if(KernelArmCortexA7
OR KernelArmCortexA8
OR KernelArmCortexA15
OR KernelArmCortexA35
OR KernelArmCortexA53
OR KernelArmCortexA55
OR KernelArmCortexA57
OR KernelArmCortexA72
)
if(KernelArmCortexA7 OR KernelArmCortexA8 OR KernelArmCortexA15 OR KernelArmCortexA35
OR KernelArmCortexA53 OR KernelArmCortexA55 OR KernelArmCortexA57 OR KernelArmCortexA72)
# According to https://developer.arm.com/documentation/100095/0001/functional-description/about-the-cortex-a72-processor-functions/components-of-the-processor
# the L1 instruction on the Cortex-A72 cache has a 64-byte cache line.
# Thus, 6 bits are needed.
@ -305,8 +268,7 @@ add_sources(
object/vcpu.c
object/smmu.c
object/smc.c
smp/ipi.c
)
smp/ipi.c)
add_bf_source_old("KernelArchARM" "structures.bf" "include/arch/arm" "arch/object")

View file

@ -10,8 +10,7 @@ config_string(
2, 3 and 4 levels on Sv32, Sv39, Sv48 RISC-V paging modes respectively."
DEFAULT 3
UNDEF_DISABLED UNQUOTE
DEPENDS "KernelArchRiscV"
)
DEPENDS "KernelArchRiscV")
set(_KernelRiscvExtD ON)
set(_KernelRiscvExtF ON)
@ -23,17 +22,11 @@ if(LLVM_TOOLCHAIN AND KernelSel4ArchRiscV32)
set(_KernelRiscvExtF OFF)
endif()
config_option(
KernelRiscvExtF RISCV_EXT_F "RISC-V extension for single-precision floating-point"
DEFAULT ${_KernelRiscvExtF}
DEPENDS "KernelArchRiscV"
)
config_option(KernelRiscvExtF RISCV_EXT_F "RISC-V extension for single-precision floating-point"
DEFAULT ${_KernelRiscvExtF} DEPENDS "KernelArchRiscV")
config_option(
KernelRiscvExtD RISCV_EXT_D "RISC-V extension for double-precision floating-point"
DEFAULT ${_KernelRiscvExtD}
DEPENDS "KernelArchRiscV"
)
config_option(KernelRiscvExtD RISCV_EXT_D "RISC-V extension for double-precision floating-point"
DEFAULT ${_KernelRiscvExtD} DEPENDS "KernelArchRiscV")
config_option(
KernelRiscvUseClintMtime
@ -45,8 +38,7 @@ config_option(
trap into M-mode software which then accesses the CLINT timer register. \
Note that this option requires S-mode access to the CLINT."
DEFAULT OFF
DEPENDS "KernelArchRiscV"
)
DEPENDS "KernelArchRiscV")
# Until RISC-V has instructions to count leading/trailing zeros, we provide
# library implementations. Platforms that implement the bit manipulation
@ -58,37 +50,19 @@ config_option(
# even when the platform has sutiable inline assembly, we do not make these the
# default.
if(KernelWordSize EQUAL 32)
set(KernelClz32
ON
CACHE BOOL ""
)
set(KernelCtz32
ON
CACHE BOOL ""
)
set(KernelClz32 ON CACHE BOOL "")
set(KernelCtz32 ON CACHE BOOL "")
if(KernelIsMCS)
# Used for long division in timer calculations.
set(KernelClz64
ON
CACHE BOOL ""
)
set(KernelClz64 ON CACHE BOOL "")
endif()
elseif(KernelWordSize EQUAL 64)
set(KernelClz64
ON
CACHE BOOL ""
)
set(KernelCtz64
ON
CACHE BOOL ""
)
set(KernelClz64 ON CACHE BOOL "")
set(KernelCtz64 ON CACHE BOOL "")
endif()
if(KernelSel4ArchRiscV32)
set(KernelPTLevels
2
CACHE STRING "" FORCE
)
set(KernelPTLevels 2 CACHE STRING "" FORCE)
endif()
if(KernelPTLevels EQUAL 2)
if(KernelSel4ArchRiscV32)
@ -117,10 +91,7 @@ if(KernelRiscvExtF)
endif()
# This is not supported on RISC-V
set(KernelHardwareDebugAPIUnsupported
ON
CACHE INTERNAL ""
)
set(KernelHardwareDebugAPIUnsupported ON CACHE INTERNAL "")
add_sources(
DEP "KernelArchRiscV"
@ -142,7 +113,6 @@ add_sources(
object/objecttype.c
object/tcb.c
smp/ipi.c
ASMFILES head.S traps.S idle.S
)
ASMFILES head.S traps.S idle.S)
add_bf_source_old("KernelArchRiscV" "structures.bf" "include/arch/riscv" "arch/object")

View file

@ -7,8 +7,7 @@
add_sources(
DEP "KernelSel4ArchIA32"
PREFIX src/arch/x86/32
CFILES
c_traps.c
CFILES c_traps.c
object/objecttype.c
kernel/thread.c
kernel/vspace.c
@ -18,5 +17,4 @@ add_sources(
machine/registerset.c
machine/capdl.c
smp/ipi.c
ASMFILES machine_asm.S traps.S head.S
)
ASMFILES machine_asm.S traps.S head.S)

View file

@ -7,8 +7,7 @@
add_sources(
DEP "KernelSel4ArchX86_64"
PREFIX src/arch/x86/64
CFILES
c_traps.c
CFILES c_traps.c
object/objecttype.c
kernel/thread.c
kernel/vspace.c
@ -18,5 +17,4 @@ add_sources(
machine/capdl.c
machine/registerset.c
smp/ipi.c
ASMFILES machine_asm.S traps.S head.S
)
ASMFILES machine_asm.S traps.S head.S)

View file

@ -5,11 +5,7 @@
#
if(KernelArchX86)
set_property(
TARGET kernel_config_target
APPEND
PROPERTY TOPLEVELTYPES pde_C
)
set_property(TARGET kernel_config_target APPEND PROPERTY TOPLEVELTYPES pde_C)
# x86 always has an FPU
set(KernelHaveFPU ON)
@ -17,11 +13,7 @@ endif()
# Add any top level types
if(KernelSel4ArchX86_64)
set_property(
TARGET kernel_config_target
APPEND
PROPERTY TOPLEVELTYPES pdpte_C pml4e_C
)
set_property(TARGET kernel_config_target APPEND PROPERTY TOPLEVELTYPES pdpte_C pml4e_C)
endif()
config_choice(
@ -35,8 +27,7 @@ config_choice(
"ivy;KernelX86MicroArchIvy;ARCH_X86_IVY;KernelArchX86"
"haswell;KernelX86MicroArchHaswell;ARCH_X86_HASWELL;KernelArchX86"
"broadwell;KernelX86MicroArchBroadwell;ARCH_X86_BROADWELL;KernelArchX86"
"skylake;KernelX86MicroArchSkylake;ARCH_X86_SKYLAKE;KernelArchX86"
)
"skylake;KernelX86MicroArchSkylake;ARCH_X86_SKYLAKE;KernelArchX86")
config_choice(
KernelIRQController
@ -46,8 +37,7 @@ config_choice(
PIC -> Use the legacy PIC controller. \
IOAPIC -> Use one or more IOAPIC controllers"
"IOAPIC;KernelIRQControllerIOAPIC;IRQ_IOAPIC;KernelArchX86"
"PIC;KernelIRQControllerPIC;IRQ_PIC;KernelArchX86"
)
"PIC;KernelIRQControllerPIC;IRQ_PIC;KernelArchX86")
config_string(
KernelMaxNumIOAPIC
@ -57,59 +47,38 @@ config_string(
the final IRQ controller."
DEFAULT 1
DEPENDS "KernelIRQControllerIOAPIC" DEFAULT_DISABLED 0
UNQUOTE
)
UNQUOTE)
config_choice(
KernelLAPICMode
KERNEL_LAPIC_MODE
"Select the mode local APIC will use. Not all machines support X2APIC mode."
"XAPIC;KernelLAPICModeXPAIC;XAPIC;KernelArchX86"
"X2APIC;KernelLAPICModeX2APIC;X2APIC;KernelArchX86"
)
"X2APIC;KernelLAPICModeX2APIC;X2APIC;KernelArchX86")
config_option(
KernelUseLogicalIDs USE_LOGICAL_IDS
"Use logical IDs to broadcast IPI between cores. Not all machines support logical \
IDs. In xAPIC mode only 8 cores can be addressed using logical IDs."
DEFAULT OFF
DEPENDS "NOT ${KernelMaxNumNodes} EQUAL 1;KernelArchX86"
)
DEPENDS "NOT ${KernelMaxNumNodes} EQUAL 1;KernelArchX86")
config_string(
KernelCacheLnSz CACHE_LN_SZ "Define cache line size for the current architecture"
DEFAULT 64
DEPENDS "KernelArchX86"
UNDEF_DISABLED UNQUOTE
)
config_string(KernelCacheLnSz CACHE_LN_SZ "Define cache line size for the current architecture"
DEFAULT 64 DEPENDS "KernelArchX86" UNDEF_DISABLED UNQUOTE)
config_option(
KernelVTX VTX "VTX support"
DEFAULT OFF
DEPENDS "KernelArchX86;NOT KernelVerificationBuild"
)
config_option(KernelVTX VTX "VTX support" DEFAULT OFF
DEPENDS "KernelArchX86;NOT KernelVerificationBuild")
config_option(
KernelX86_64VTX64BitGuests X86_64_VTX_64BIT_GUESTS "Support 64-bit guests"
DEFAULT OFF
DEPENDS "KernelArchX86;KernelVTX;NOT KernelVerificationBuild"
)
config_option(KernelX86_64VTX64BitGuests X86_64_VTX_64BIT_GUESTS "Support 64-bit guests" DEFAULT OFF
DEPENDS "KernelArchX86;KernelVTX;NOT KernelVerificationBuild")
config_option(
KernelIOMMU IOMMU "IOMMU support for VT-d enabled chipset"
DEFAULT ON
DEPENDS "KernelPlatPC99; NOT KernelVerificationBuild"
DEFAULT_DISABLED OFF
)
config_option(KernelIOMMU IOMMU "IOMMU support for VT-d enabled chipset" DEFAULT ON
DEPENDS "KernelPlatPC99; NOT KernelVerificationBuild" DEFAULT_DISABLED OFF)
config_string(
KernelMaxRMRREntries MAX_RMRR_ENTRIES
"Setsthe maximum number of Reserved Memory Region Reporting structures we support \
recording from the ACPI tables"
DEFAULT 32
DEPENDS "KernelIOMMU" DEFAULT_DISABLED 1
UNQUOTE
)
recording from the ACPI tables" DEFAULT 32 DEPENDS "KernelIOMMU" DEFAULT_DISABLED 1 UNQUOTE)
config_string(
KernelMaxVPIDs
@ -119,23 +88,16 @@ config_string(
will be run for optimum performance."
DEFAULT 1024
DEPENDS "KernelVTX" DEFAULT_DISABLED 0
UNQUOTE
)
UNQUOTE)
config_option(
KernelHugePage HUGE_PAGE
"Add support for 1GB huge page. Not all recent processor models support this feature."
DEFAULT ON
DEPENDS "KernelSel4ArchX86_64"
DEFAULT_DISABLED OFF
)
"Add support for 1GB huge page. Not all recent processor models support this feature." DEFAULT ON
DEPENDS "KernelSel4ArchX86_64" DEFAULT_DISABLED OFF)
config_option(
KernelSupportPCID SUPPORT_PCID
"Add support for PCIDs (aka hardware ASIDs). Not all processor models support this feature."
DEFAULT ON
DEPENDS "KernelSel4ArchX86_64"
DEFAULT_DISABLED OFF
)
DEFAULT ON DEPENDS "KernelSel4ArchX86_64" DEFAULT_DISABLED OFF)
config_choice(
KernelSyscall
@ -144,8 +106,7 @@ config_choice(
config should be set to the most efficient one that is support by the hardware the \
system will run on"
"syscall;KernelX86SyscallSyscall;SYSCALL;KernelSel4ArchX86_64"
"sysenter;KernelX86SyscallSysenter;SYSENTER;KernelArchX86"
)
"sysenter;KernelX86SyscallSysenter;SYSENTER;KernelArchX86")
config_choice(
KernelFPU
@ -157,8 +118,7 @@ config_choice(
of the xsave variants to save and restore. The actual size of the region is dependent on \
the features enabled."
"XSAVE;KernelFPUXSave;XSAVE;KernelArchX86"
"FXSAVE;KernelFPUFXSave;FXSAVE;KernelArchX86"
)
"FXSAVE;KernelFPUFXSave;FXSAVE;KernelArchX86")
config_choice(
KernelXSave
@ -178,8 +138,7 @@ config_choice(
"XSAVE;KernelXSaveXSave;XSAVE_XSAVE;KernelFPUXSave"
"XSAVES;KernelXSaveXSaveS;XSAVE_XSAVES;KernelFPUXSave"
"XSAVEOPT;KernelXSaveXSaveOpt;XSAVE_XSAVEOPT;KernelFPUXSave"
"XSAVEC;KernelXSaveXSaveC;XSAVE_XSAVEC;KernelFPUXSave"
)
"XSAVEC;KernelXSaveXSaveC;XSAVE_XSAVEC;KernelFPUXSave")
config_string(
KernelXSaveFeatureSet
@ -193,8 +152,7 @@ config_string(
FPU and SSE is guaranteed to exist if XSAVE exists."
DEFAULT 3
DEPENDS "KernelFPUXSave" DEFAULT_DISABLED 0
UNQUOTE
)
UNQUOTE)
if(KernelFPUXSave)
if("${KernelXSaveFeatureSet}" EQUAL 7)
@ -207,15 +165,12 @@ else()
endif()
config_string(
KernelXSaveSize
XSAVE_SIZE
"The size of the XSAVE region. This is dependent upon the features in \
KernelXSaveSize XSAVE_SIZE "The size of the XSAVE region. This is dependent upon the features in \
XSAVE_FEATURE_SET that have been requested. Default is 576 for the FPU and SSE
state, unless XSAVE is not in use then it should be 512 for the legacy FXSAVE region."
DEFAULT ${default_xsave_size}
DEPENDS "KernelArchX86" DEFAULT_DISABLED 0
UNQUOTE
)
UNQUOTE)
config_choice(
KernelFSGSBase
@ -226,8 +181,7 @@ config_choice(
IA32_FS/GS_BASE_MSR and fsgsbase instructions are available for 64-bit."
"inst;KernelFSGSBaseInst;FSGSBASE_INST;KernelSel4ArchX86_64"
"gdt;KernelFSGSBaseGDT;FSGSBASE_GDT;KernelSel4ArchIA32"
"msr;KernelFSGSBaseMSR;FSGSBASE_MSR;KernelArchX86"
)
"msr;KernelFSGSBaseMSR;FSGSBASE_MSR;KernelArchX86")
config_choice(
KernelMultibootGFXMode
@ -237,17 +191,12 @@ config_choice(
other mode"
"none;KernelMultibootGFXModeNone;MULTIBOOT_GRAPHICS_MODE_NONE;KernelArchX86"
"text;KernelMultibootGFXModeText;MULTIBOOT_GRAPHICS_MODE_TEXT;KernelArchX86"
"linear;KernelMultibootGFXModeLinear;MULTIBOOT_GRAPHICS_MODE_LINEAR;KernelArchX86"
)
"linear;KernelMultibootGFXModeLinear;MULTIBOOT_GRAPHICS_MODE_LINEAR;KernelArchX86")
config_string(
KernelMultibootGFXDepth MULTIBOOT_GRAPHICS_MODE_DEPTH
"The bits per pixel of the linear graphics mode to request. Value of zero indicates \
no preference."
DEFAULT 32
DEPENDS "KernelMultibootGFXModeLinear"
UNDEF_DISABLED UNQUOTE
)
no preference." DEFAULT 32 DEPENDS "KernelMultibootGFXModeLinear" UNDEF_DISABLED UNQUOTE)
config_string(
KernelMultibootGFXWidth
@ -257,8 +206,7 @@ config_string(
indicates no preference."
DEFAULT 0
DEPENDS "KernelMultibootGFXModeText OR KernelMultibootGFXModeLinear"
UNDEF_DISABLED UNQUOTE
)
UNDEF_DISABLED UNQUOTE)
config_string(
KernelMultibootGFXHeight
MULTIBOOT_GRAPHICS_MODE_HEIGHT
@ -267,16 +215,14 @@ config_string(
indicates no preference."
DEFAULT 0
DEPENDS "KernelMultibootGFXModeText OR KernelMultibootGFXModeLinear"
UNDEF_DISABLED UNQUOTE
)
UNDEF_DISABLED UNQUOTE)
config_option(
KernelMultiboot1Header
MULTIBOOT1_HEADER
"Inserts a header that indicates to the bootloader that the kernel supports a multiboot 1 boot header"
DEFAULT ON
DEPENDS "KernelArchX86"
)
DEPENDS "KernelArchX86")
config_option(
KernelMultiboot2Header
@ -284,8 +230,7 @@ config_option(
"Inserts a header that indicates to the bootloader that the kernel supports a multiboot 2 boot header. \
This is can be enabled together with a multiboot 1 header and the boot loader may use either one"
DEFAULT ON
DEPENDS "KernelArchX86"
)
DEPENDS "KernelArchX86")
config_option(
KernelSkimWindow
@ -295,8 +240,7 @@ config_option(
This only needs to be enabled if deploying to a vulnerable processor"
DEFAULT ON
DEPENDS "KernelSel4ArchX86_64"
DEFAULT_DISABLED OFF
)
DEFAULT_DISABLED OFF)
config_option(
KernelExportPMCUser
@ -308,8 +252,7 @@ config_option(
evalulating performance this option opens timing and covert
channels."
DEFAULT OFF
DEPENDS "KernelArchX86;NOT KernelVerificationBuild"
)
DEPENDS "KernelArchX86;NOT KernelVerificationBuild")
config_option(
KernelX86DangerousMSR
@ -318,8 +261,7 @@ config_option(
This is extremely dangerous as no checks are performed and exists
to aid debugging and benchmarking."
DEFAULT OFF
DEPENDS "KernelArchX86;NOT KernelVerificationBuild"
)
DEPENDS "KernelArchX86;NOT KernelVerificationBuild")
if(KernelArchX86 AND (NOT "${KernelMaxNumNodes}" EQUAL 1))
set(STIBDEP TRUE)
@ -343,8 +285,7 @@ config_choice(
"ibrs_none;KernelX86IBRSnone;KERNEL_X86_IBRS_NONE;KernelArchX86"
"ibrs_stibp;KernelX86IBRSSTIBP;KERNEL_X86_IBRS_STIBP;STIBPDEP"
"ibrs_basic;KernelX86IBRSBasic;KERNEL_X86_IBRS_BASIC;KernelArchX86"
"ibrs_all;KernelX86IBRSAll;KERNEL_X86_IBRS_ALL;KernelArchX86"
)
"ibrs_all;KernelX86IBRSAll;KERNEL_X86_IBRS_ALL;KernelArchX86")
if(KernelX86IBRSBasic OR KernelX86IBRSSTIBP)
# As the kernel has no function pointers or other indirect jumps except those
@ -362,8 +303,7 @@ config_option(
Note that in a multicore environment you should also enable STIBP to prevent
other cores retraining the branch predictor even after context switch."
DEFAULT OFF
DEPENDS "KernelArchX86"
)
DEPENDS "KernelArchX86")
config_option(
KernelX86RSBOnContextSwitch
@ -373,8 +313,7 @@ config_option(
largely pointless to flush the RSB without also doing an IBPB as the RSB is already
a harder attack vector."
DEFAULT OFF
DEPENDS "KernelArchX86"
)
DEPENDS "KernelArchX86")
if(KernelSel4ArchIA32)
set(KernelSetTLSBaseSelf ON)
@ -417,8 +356,7 @@ add_sources(
machine/registerset.c
benchmark/benchmark.c
smp/ipi.c
ASMFILES multiboot.S idle.S
)
ASMFILES multiboot.S idle.S)
add_bf_source_old("KernelArchX86" "structures.bf" "include/arch/x86" "arch/object")

View file

@ -5,8 +5,7 @@
#
add_sources(
CFILES
src/inlines.c
CFILES src/inlines.c
src/assert.c
src/util.c
src/string.c
@ -36,13 +35,6 @@ add_sources(
src/benchmark/benchmark_track.c
src/benchmark/benchmark_utilisation.c
src/smp/lock.c
src/smp/ipi.c
)
add_sources(
DEP KernelIsMCS
CFILES
src/object/reply.c
src/object/schedcontext.c
src/object/schedcontrol.c
src/kernel/sporadic.c
)
src/smp/ipi.c)
add_sources(DEP KernelIsMCS CFILES src/object/reply.c src/object/schedcontext.c
src/object/schedcontrol.c src/kernel/sporadic.c)

View file

@ -5,40 +5,19 @@
# SPDX-License-Identifier: GPL-2.0-only
#
register_driver(
compatibility_strings "brcm,bcm2835-aux-uart"
PREFIX src/drivers/serial
CFILES "bcm2835-aux-uart.c"
)
register_driver(compatibility_strings "brcm,bcm2835-aux-uart" PREFIX src/drivers/serial
CFILES "bcm2835-aux-uart.c")
register_driver(compatibility_strings "arm,pl011" PREFIX src/drivers/serial CFILES "pl011.c")
register_driver(
compatibility_strings "nvidia,tegra20-uart;ti,omap3-uart;snps,dw-apb-uart"
PREFIX src/drivers/serial
CFILES "tegra_omap3_dwapb.c"
)
register_driver(
compatibility_strings "fsl,imx6q-uart;fsl,imx6sx-uart"
PREFIX src/drivers/serial
CFILES "imx.c"
)
register_driver(
compatibility_strings "fsl,imx8qxp-lpuart;fsl,imx7ulp-lpuart"
PREFIX src/drivers/serial
CFILES "imx-lpuart.c"
)
register_driver(
compatibility_strings "samsung,exynos4210-uart"
PREFIX src/drivers/serial
CFILES "exynos4210-uart.c"
)
register_driver(
compatibility_strings "qcom,msm-uartdm"
PREFIX src/drivers/serial
CFILES "msm-uartdm.c"
)
register_driver(compatibility_strings "nvidia,tegra20-uart;ti,omap3-uart;snps,dw-apb-uart"
PREFIX src/drivers/serial CFILES "tegra_omap3_dwapb.c")
register_driver(compatibility_strings "fsl,imx6q-uart;fsl,imx6sx-uart" PREFIX src/drivers/serial
CFILES "imx.c")
register_driver(compatibility_strings "fsl,imx8qxp-lpuart;fsl,imx7ulp-lpuart"
PREFIX src/drivers/serial CFILES "imx-lpuart.c")
register_driver(compatibility_strings "samsung,exynos4210-uart" PREFIX src/drivers/serial
CFILES "exynos4210-uart.c")
register_driver(compatibility_strings "qcom,msm-uartdm" PREFIX src/drivers/serial
CFILES "msm-uartdm.c")
register_driver(compatibility_strings "xlnx,xuartps" PREFIX src/drivers/serial CFILES "xuartps.c")
register_driver(
compatibility_strings "amlogic,meson-gx-uart"
PREFIX src/drivers/serial
CFILES "meson-gx-uart.c"
)
register_driver(compatibility_strings "amlogic,meson-gx-uart" PREFIX src/drivers/serial
CFILES "meson-gx-uart.c")

View file

@ -4,51 +4,24 @@
# SPDX-License-Identifier: GPL-2.0-only
#
register_driver(
compatibility_strings "ti,am335x-timer"
PREFIX src/drivers/timer
CFILES "am335x-timer.c"
)
register_driver(
compatibility_strings "qcom,kpss-timer"
PREFIX src/drivers/timer
CFILES "kpss-timer.c"
)
register_driver(
compatibility_strings "samsung,exynos4210-mct"
PREFIX src/drivers/timer
CFILES "exynos4210-mct.c"
)
register_driver(
compatibility_strings "samsung,exynos4412-mct"
PREFIX src/drivers/timer
CFILES "exynos4412-mct.c"
)
register_driver(
compatibility_strings "ti,omap3430-timer"
PREFIX src/drivers/timer
CFILES "omap3430-timer.c"
)
register_driver(
compatibility_strings "arm,cortex-a9-twd-timer"
PREFIX src/drivers/timer
CFILES "priv_timer.c"
)
register_driver(
compatibility_strings "arm,cortex-a9-global-timer"
PREFIX src/drivers/timer
CFILES "global_timer.c"
)
register_driver(
compatibility_strings "arm,armv7-timer"
PREFIX src/drivers/timer
CFILES "generic_timer.c"
)
register_driver(
compatibility_strings "arm,armv8-timer"
PREFIX src/drivers/timer
CFILES "generic_timer.c"
)
register_driver(compatibility_strings "ti,am335x-timer" PREFIX src/drivers/timer
CFILES "am335x-timer.c")
register_driver(compatibility_strings "qcom,kpss-timer" PREFIX src/drivers/timer
CFILES "kpss-timer.c")
register_driver(compatibility_strings "samsung,exynos4210-mct" PREFIX src/drivers/timer
CFILES "exynos4210-mct.c")
register_driver(compatibility_strings "samsung,exynos4412-mct" PREFIX src/drivers/timer
CFILES "exynos4412-mct.c")
register_driver(compatibility_strings "ti,omap3430-timer" PREFIX src/drivers/timer
CFILES "omap3430-timer.c")
register_driver(compatibility_strings "arm,cortex-a9-twd-timer" PREFIX src/drivers/timer
CFILES "priv_timer.c")
register_driver(compatibility_strings "arm,cortex-a9-global-timer" PREFIX src/drivers/timer
CFILES "global_timer.c")
register_driver(compatibility_strings "arm,armv7-timer" PREFIX src/drivers/timer
CFILES "generic_timer.c")
register_driver(compatibility_strings "arm,armv8-timer" PREFIX src/drivers/timer
CFILES "generic_timer.c")
set(KernelArmHaveGenericTimer OFF)
@ -60,50 +33,54 @@ foreach(match_string IN ITEMS "arm,armv7-timer" "arm,armv8-timer")
endforeach()
config_option(
KernelArmExportPCNTUser EXPORT_PCNT_USER "PL0 access to generic timer CNTPCT and CNTFRQ. \
KernelArmExportPCNTUser
EXPORT_PCNT_USER
"PL0 access to generic timer CNTPCT and CNTFRQ. \
Grant user access to physical counter and counter \
frequency registers of the generic timer. \
WARNING: selecting this option opens a timing \
channel"
DEFAULT OFF
DEPENDS "KernelArmHaveGenericTimer"
)
DEPENDS "KernelArmHaveGenericTimer")
config_option(
KernelArmExportVCNTUser EXPORT_VCNT_USER "PL0 access to generic timer CNTVCT and CNTFRQ. \
KernelArmExportVCNTUser
EXPORT_VCNT_USER
"PL0 access to generic timer CNTVCT and CNTFRQ. \
Grant user access to virtual counter and counter \
frequency registers of the generic timer. \
WARNING: selecting this option opens a timing \
channel"
DEFAULT OFF
DEPENDS "KernelArmHaveGenericTimer"
)
DEPENDS "KernelArmHaveGenericTimer")
config_option(
KernelArmExportPTMRUser EXPORT_PTMR_USER "PL0 access to generic timer CNTP_CTL and CNTP_CVAL. \
KernelArmExportPTMRUser
EXPORT_PTMR_USER
"PL0 access to generic timer CNTP_CTL and CNTP_CVAL. \
Grant user access to physical timer registers of the generic timer. \
WARNING: selecting this option opens a storage channel and allows threads to easily \
corrupt these registers for each other, this should only be used for \
debugging / development purposes"
DEFAULT OFF
DEPENDS "KernelArmHaveGenericTimer"
)
DEPENDS "KernelArmHaveGenericTimer")
config_option(
KernelArmExportVTMRUser EXPORT_VTMR_USER "PL0 access to generic timer CNTV_CTL and CNTV_CVAL. \
KernelArmExportVTMRUser
EXPORT_VTMR_USER
"PL0 access to generic timer CNTV_CTL and CNTV_CVAL. \
Grant user access to virtual timer registers of the generic timer. \
WARNING: selecting this option opens a storage channel and allows threads to easily \
corrupt these registers for each other, this should only be used for \
debugging / development purposes"
DEFAULT OFF
DEPENDS "KernelArmHaveGenericTimer"
)
DEPENDS "KernelArmHaveGenericTimer")
config_option(
KernelArmVtimerUpdateVOffset VTIMER_UPDATE_VOFFSET
KernelArmVtimerUpdateVOffset
VTIMER_UPDATE_VOFFSET
"When set the kernel will update the VOFFSET \
register of a VCPU when restoring it so that its view of Virtual time hasn't increased while it \
was suspended. When unset the VOFFSET won't be updated other than by the read and write register api."
DEFAULT ON
DEPENDS "KernelArmHypervisorSupport"
)
DEPENDS "KernelArmHypervisorSupport")

View file

@ -18,11 +18,8 @@ if(KernelPlatformHifiveP550)
# the "cpus" node in the HiFive P550 device tree.
# The value for MAX_IRQ comes from the DTS "interrupt-controller" node which says
# "riscv,ndev = <0x208>".
declare_default_headers(
TIMER_FREQUENCY 1000000
MAX_IRQ 520
INTERRUPT_CONTROLLER drivers/irq/riscv_plic0.h
)
declare_default_headers(TIMER_FREQUENCY 1000000 MAX_IRQ 520
INTERRUPT_CONTROLLER drivers/irq/riscv_plic0.h)
else()
unset(KernelPlatformFirstHartID CACHE)
endif()

View file

@ -17,11 +17,8 @@ if(KernelPlatformBananapiF3)
# the "cpus" node in the Banana Pi F3 device tree.
# The value for MAX_IRQ comes from the DTS "interrupt-controller" node which says
# "riscv,ndev = <0x9f>".
declare_default_headers(
TIMER_FREQUENCY 24000000
MAX_IRQ 159
INTERRUPT_CONTROLLER drivers/irq/riscv_plic0.h
)
declare_default_headers(TIMER_FREQUENCY 24000000 MAX_IRQ 159
INTERRUPT_CONTROLLER drivers/irq/riscv_plic0.h)
else()
unset(KernelPlatformFirstHartID CACHE)
endif()

View file

@ -35,13 +35,10 @@ function(gen_invocation_header)
add_custom_command(
OUTPUT "${GEN_OUTPUT}"
COMMAND rm -f "${GEN_OUTPUT}"
COMMAND
"${PYTHON3}" "${INVOCATION_ID_GEN_PATH}"
--xml "${xml_absolute}" ${libsel4_setting} ${arch_setting}
--dest "${GEN_OUTPUT}"
COMMAND "${PYTHON3}" "${INVOCATION_ID_GEN_PATH}" --xml "${xml_absolute}" ${libsel4_setting}
${arch_setting} --dest "${GEN_OUTPUT}"
DEPENDS "${xml_absolute}" "${INVOCATION_ID_GEN_PATH}"
COMMENT "Generate invocation header ${GEN_OUTPUT}"
)
COMMENT "Generate invocation header ${GEN_OUTPUT}")
endfunction(gen_invocation_header)
# Adds files to the global sources list, but only if the supplied dependencies are met.
@ -76,7 +73,6 @@ endfunction(add_sources)
# separate where the bf file is located in the source, versus where it will get
# generated.
function(add_bf_source_old dep file prefix path)
list_append_if(
bf_declarations "${dep}" "${CMAKE_CURRENT_SOURCE_DIR}/${prefix}/${path}/${file}:${path}"
)
list_append_if(bf_declarations "${dep}"
"${CMAKE_CURRENT_SOURCE_DIR}/${prefix}/${path}/${file}:${path}")
endfunction(add_bf_source_old)