forked from seL4/sel4-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.cmake
91 lines (78 loc) · 3.13 KB
/
settings.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# Copyright 2018, Data61, CSIRO (ABN 41 687 119 230)
#
# SPDX-License-Identifier: BSD-2-Clause
#
include_guard(GLOBAL)
set(project_dir "${CMAKE_CURRENT_LIST_DIR}/../../")
file(GLOB project_modules ${project_dir}/projects/*)
list(
APPEND
CMAKE_MODULE_PATH
${project_dir}/kernel
${project_dir}/tools/seL4/cmake-tool/helpers/
${project_dir}/tools/seL4/elfloader-tool/
${project_modules}
)
set(POLLY_DIR ${project_dir}/tools/polly CACHE INTERNAL "")
include(application_settings)
# Deal with the top level target-triplet variables.
if(NOT TUT_BOARD)
message(
FATAL_ERROR
"Please select a board to compile for. Choose either pc or zynq7000\n\t`-DTUT_BOARD=<PREFERENCE>`"
)
endif()
# Set arch and board specific kernel parameters here.
if(${TUT_BOARD} STREQUAL "pc")
set(KernelArch "x86" CACHE STRING "" FORCE)
set(KernelPlatform "pc99" CACHE STRING "" FORCE)
if(${TUT_ARCH} STREQUAL "ia32")
set(KernelSel4Arch "ia32" CACHE STRING "" FORCE)
elseif(${TUT_ARCH} STREQUAL "x86_64")
set(KernelSel4Arch "x86_64" CACHE STRING "" FORCE)
else()
message(FATAL_ERROR "Unsupported PC architecture ${TUT_ARCH}")
endif()
elseif(${TUT_BOARD} STREQUAL "zynq7000")
# Do a quick check and warn the user if they haven't set
# -DARM/-DAARCH32/-DAARCH64.
if(
(NOT ARM)
AND (NOT AARCH32)
AND ((NOT CROSS_COMPILER_PREFIX) OR ("${CROSS_COMPILER_PREFIX}" STREQUAL ""))
)
message(
WARNING
"The target machine is an ARM machine. Unless you've defined -DCROSS_COMPILER_PREFIX, you may need to set one of:\n\t-DARM/-DAARCH32/-DAARCH64"
)
endif()
set(KernelArch "arm" CACHE STRING "" FORCE)
set(KernelSel4Arch "aarch32" CACHE STRING "" FORCE)
set(KernelPlatform "zynq7000" CACHE STRING "" FORCE)
ApplyData61ElfLoaderSettings(${KernelPlatform} ${KernelSel4Arch})
else()
message(FATAL_ERROR "Unsupported board ${TUT_BOARD}.")
endif()
include(${project_dir}/kernel/configs/seL4Config.cmake)
set(CapDLLoaderMaxObjects 20000 CACHE STRING "" FORCE)
set(KernelRootCNodeSizeBits 16 CACHE STRING "")
# For the tutorials that do initialize the plat support serial printing they still
# just want to use the kernel debug putchar if it exists
set(LibSel4PlatSupportUseDebugPutChar true CACHE BOOL "" FORCE)
# Just let the regular abort spin without calling DebugHalt to prevent needless
# confusing output from the kernel for a tutorial
set(LibSel4MuslcSysDebugHalt FALSE CACHE BOOL "" FORCE)
# Only configure a single domain for the domain scheduler
set(KernelNumDomains 1 CACHE STRING "" FORCE)
# We must build the debug kernel because the tutorials rely on seL4_DebugPutChar
# and they don't initialize a platsupport driver.
ApplyCommonReleaseVerificationSettings(FALSE FALSE)
# We will attempt to generate a simulation script, so try and generate a simulation
# compatible configuration
ApplyCommonSimulationSettings(${KernelSel4Arch})
if(FORCE_IOMMU)
set(KernelIOMMU ON CACHE BOOL "" FORCE)
endif()
find_package(sel4-tutorials REQUIRED)
sel4_tutorials_regenerate_tutorial(${project_dir}/${TUTORIAL_DIR})