1# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. 2# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without modification, 5# are permitted provided that the following conditions are met: 6# 7# 1. Redistributions of source code must retain the above copyright notice, this list of 8# conditions and the following disclaimer. 9# 10# 2. Redistributions in binary form must reproduce the above copyright notice, this list 11# of conditions and the following disclaimer in the documentation and/or other materials 12# provided with the distribution. 13# 14# 3. Neither the name of the copyright holder nor the names of its contributors may be used 15# to endorse or promote products derived from this software without specific prior written 16# permission. 17# 18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 22# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 30mainmenu "Huawei LiteOS Configuration" 31 32menu "Compiler" 33choice 34 prompt "Compiler type" 35 default COMPILER_CLANG_LLVM 36 help 37 Choose compiler type. 38 39config COMPILER_GCC 40 bool "GCC" 41 42config CROSS_COMPILE 43 string "GCC cross-compile toolchain prefix" 44 depends on COMPILER_GCC 45 default "arm-linux-ohoseabi-" if ARCH_ARM_AARCH32 46 47config COMPILER_CLANG_LLVM 48 bool "Clang" 49 50config LLVM_TARGET 51 string "Clang LLVM target" 52 depends on COMPILER_CLANG_LLVM 53 default "arm-liteos-ohos" if ARCH_ARM_AARCH32 54 55endchoice 56 57config COMPILE_DEBUG 58 bool "Enable debug options" 59 default n 60 help 61 Answer Y to add -g option in compile command. 62 63config COMPILE_OPTIMIZE 64 bool "Enable code optimization options" 65 default y 66 help 67 Answer Y to add optimization options for efficient code. 68 The final binary size will be smaller and execute faster. 69 But the debugging experience may be worst somehow. 70 71config COMPILE_OPTIMIZE_SIZE 72 bool "Enable code size optimization options" if COMPILE_OPTIMIZE 73 default y 74 help 75 Answer Y to add optimization options for small code size. 76 The final binary size will be smaller. 77 But the compile time may be a bit longer. 78 79config COMPILE_LTO 80 bool "Enable link time optimization (LTO)" if COMPILE_OPTIMIZE_SIZE 81 default y 82 help 83 Answer Y to add lto options for more smaller code size. 84 The final binary size will be smaller. 85 But the compile time may be much longer. 86 87endmenu 88 89menu "Platform" 90 91######################### config options of bsp ##################### 92source "platform/Kconfig" 93 94######################### config options of cpu arch ################ 95source "arch/Kconfig" 96 97config QUICK_START 98 bool "Enable QUICK_START" 99 default n 100 depends on DRIVERS && FS_VFS 101 help 102 Answer Y to enable LiteOS support quick start. 103endmenu 104 105######################### config options of kernel ##################### 106source "kernel/Kconfig" 107######################### config options of lib ######################## 108source "lib/Kconfig" 109######################### config options of compatibility ############## 110menu "Compat" 111source "compat/posix/Kconfig" 112source "bsd/Kconfig" 113endmenu 114 115######################## config options of filesystem ################## 116menu "FileSystem" 117source "fs/Kconfig" 118endmenu 119 120######################## config options of net ############################ 121source "net/Kconfig" 122 123######################## config options of debug ######################## 124menu "Debug" 125config GDB 126 bool "Enable gdb functions" 127 default n 128 help 129 Answer Y to enable gdb functions. 130 131config PLATFORM_ADAPT 132 bool "Enable Os_adapt" 133 default y 134 help 135 Answer Y to add os_adapt.c to LiteOS. 136 137config ENABLE_OOM_LOOP_TASK 138 bool "Enable Oom loop task" 139 default n 140 depends on KERNEL_VM 141 help 142 Answer Y to enable oom loop kthread to check system out of memory. 143 144config DO_ALIGN 145 bool "Enable do align for hi3518e" 146 default y 147 depends on PLATFORM_HI3518EV200 148 help 149 Answer Y to enable do align for hi3518e. 150 151 152config ENABLE_MAGICKEY 153 bool "Enable MAGIC KEY" 154 default y 155 help 156 Answer Y to enable LiteOS Magic key. 157 ctrl + r : Magic key check switch; 158 ctrl + z : Show all magic op key; 159 ctrl + t : Show task information; 160 ctrl + p : System panic; 161 ctrl + e : Check system memory pool. 162 163config THUMB 164 bool "Enable Thumb" 165 default n 166 depends on ARCH_ARM 167 help 168 Answer Y to build thumb version. This will make LiteOS smaller. 169 170config PLATFORM_DVFS 171 bool "Enable Dvfs" 172 default n 173 depends on COMPAT_LINUXKPI 174 help 175 Answer Y to enable LiteOS support dynamic voltage and frequency scaling feature for 176 low power consumption. 177 178config SAVE_EXCINFO 179 bool "Enable Saving Exception Information" 180 default n 181 help 182 Answer Y to enable LiteOS support saving exception information to storage medium. 183 184config DEBUG_VERSION 185 bool "Enable a Debug Version" 186 default n 187 help 188 If you do not select this option that means you enable a release version for LiteOS. 189 It also means you do not want to use debug modules, like shell,telnet,tftp,nfs and 190 memory check, etc. 191 If you select this option that means you enable a debug version for LiteOS. 192 That means you want an opposite behaviour compared to release version. 193 194config DEBUG_KERNEL 195 bool "Enable Debug LiteOS Kernel Resource" 196 default n 197 depends on DEBUG_VERSION 198 help 199 If you select this option that means you enable debugging kernel resource. 200 It also means you want to get queue, mutex, semaphore, memory debug information. 201 That means you want an opposite behaviour compared to release version. 202 203config DEBUG_QUEUE 204 bool "Enable Queue Debugging" 205 default n 206 depends on DEBUG_KERNEL 207 help 208 Answer Y to enable debug queue. 209 210config DEBUG_DEADLOCK 211 bool "Enable Mutex Deadlock Debugging" 212 default n 213 depends on DEBUG_KERNEL 214 help 215 Answer Y to enable debug mutex deadlock. 216 217config DEBUG_SEMAPHORE 218 bool "Enable Semaphore Debugging" 219 default n 220 depends on DEBUG_KERNEL 221 help 222 Answer Y to enable debug semaphore. 223 224source "shell/Kconfig" 225config NET_LWIP_SACK_TFTP 226 bool "Enable Tftp" 227 default y 228 depends on SHELL && NET_LWIP_SACK && DEBUG_VERSION 229 help 230 Answer Y to enable LiteOS support tftp cmd and tftp tool. 231source "net/telnet/Kconfig" 232config SCHED_DEBUG 233 bool "Enable sched debug Feature" 234 default n 235 depends on DEBUG_VERSION 236 help 237 If you wish to build LiteOS with support for sched debug. 238config SCHED_EDF_DEBUG 239 bool "Enable sched EDF debug Feature" 240 default n 241 depends on SCHED_DEBUG 242 help 243 If you wish to build LiteOS with support for sched debug. 244config USER_INIT_DEBUG 245 bool "Enable user init Debug" 246 default n 247 depends on DEBUG_VERSION 248 249config SHELL_CMD_DEBUG 250 bool "Enable shell cmd Debug" 251 default n 252 depends on DEBUG_VERSION && SHELL 253 254config USB_DEBUG 255 bool "Enable USB Debug" 256 default n 257 depends on SHELL && DRIVERS_USB && DEBUG_VERSION 258 help 259 Answer Y to enable LiteOS support usb debug. 260 use shell command to open the specified debug level print. 261config MEM_DEBUG 262 bool "Enable MEM Debug" 263 default n 264 depends on DEBUG_VERSION 265 help 266 Answer Y to enable LiteOS support mem debug. 267 268config MEM_LEAKCHECK 269 bool "Enable Function call stack of Mem operation recorded" 270 default n 271 depends on DEBUG_VERSION && MEM_DEBUG 272 help 273 Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the information of mem node. 274config BASE_MEM_NODE_INTEGRITY_CHECK 275 bool "Enable integrity check or not" 276 default n 277 depends on DEBUG_VERSION && MEM_DEBUG 278config MEM_WATERLINE 279 bool "Enable memory pool waterline or not" 280 default n 281 depends on DEBUG_VERSION && MEM_DEBUG 282 283config VM_OVERLAP_CHECK 284 bool "Enable VM overlap check or not" 285 default n 286 depends on DEBUG_VERSION && MEM_DEBUG 287 help 288 Answer Y to enable vm overlap check. 289 290endmenu 291 292######################## config options os drivers ######################## 293menu "Driver" 294source "drivers/Kconfig" 295endmenu 296 297######################## config options os security ####################### 298menu "Security" 299source "security/Kconfig" 300endmenu 301 302menu "Test" 303config ENABLE_KERNEL_TEST 304 bool "Enable Kernel Test" 305 default n 306endmenu 307 308menu "Stack Smashing Protector (SSP) Compiler Feature" 309 310choice 311 prompt "Enable stack buffer overflow detection" 312 default CC_STACKPROTECTOR_STRONG 313 ---help--- 314 This option turns on the -fstack-protector GCC feature. This 315 feature puts, at the beginning of functions, a canary value on 316 the stack just before the return address, and validates 317 the value just before actually returning. Stack based buffer 318 overflows (that need to overwrite this return address) now also 319 overwrite the canary, which gets detected and the attack is then 320 neutralized via a kernel panic. 321 322 This feature requires gcc version 4.2 or above, or a distribution 323 gcc with the feature backported. Older versions are automatically 324 detected and for those versions, this configuration option is 325 ignored. (and a warning is printed during bootup) 326 327config CC_NO_STACKPROTECTOR 328 bool "-fno-stack-protector" 329 330config CC_STACKPROTECTOR 331 bool "-fstack-protector" 332 333config CC_STACKPROTECTOR_STRONG 334 bool "-fstack-protector-strong" 335 336config CC_STACKPROTECTOR_ALL 337 bool "-fstack-protector-all" 338 339endchoice 340 341endmenu 342