10d163575Sopenharmony_ci# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. 20d163575Sopenharmony_ci# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. 30d163575Sopenharmony_ci# 40d163575Sopenharmony_ci# Redistribution and use in source and binary forms, with or without modification, 50d163575Sopenharmony_ci# are permitted provided that the following conditions are met: 60d163575Sopenharmony_ci# 70d163575Sopenharmony_ci# 1. Redistributions of source code must retain the above copyright notice, this list of 80d163575Sopenharmony_ci# conditions and the following disclaimer. 90d163575Sopenharmony_ci# 100d163575Sopenharmony_ci# 2. Redistributions in binary form must reproduce the above copyright notice, this list 110d163575Sopenharmony_ci# of conditions and the following disclaimer in the documentation and/or other materials 120d163575Sopenharmony_ci# provided with the distribution. 130d163575Sopenharmony_ci# 140d163575Sopenharmony_ci# 3. Neither the name of the copyright holder nor the names of its contributors may be used 150d163575Sopenharmony_ci# to endorse or promote products derived from this software without specific prior written 160d163575Sopenharmony_ci# permission. 170d163575Sopenharmony_ci# 180d163575Sopenharmony_ci# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 190d163575Sopenharmony_ci# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 200d163575Sopenharmony_ci# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 210d163575Sopenharmony_ci# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 220d163575Sopenharmony_ci# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 230d163575Sopenharmony_ci# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 240d163575Sopenharmony_ci# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 250d163575Sopenharmony_ci# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 260d163575Sopenharmony_ci# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 270d163575Sopenharmony_ci# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 280d163575Sopenharmony_ci# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 290d163575Sopenharmony_ci 300d163575Sopenharmony_cimainmenu "Huawei LiteOS Configuration" 310d163575Sopenharmony_ci 320d163575Sopenharmony_cimenu "Compiler" 330d163575Sopenharmony_cichoice 340d163575Sopenharmony_ci prompt "Compiler type" 350d163575Sopenharmony_ci default COMPILER_CLANG_LLVM 360d163575Sopenharmony_ci help 370d163575Sopenharmony_ci Choose compiler type. 380d163575Sopenharmony_ci 390d163575Sopenharmony_ciconfig COMPILER_GCC 400d163575Sopenharmony_ci bool "GCC" 410d163575Sopenharmony_ci 420d163575Sopenharmony_ciconfig CROSS_COMPILE 430d163575Sopenharmony_ci string "GCC cross-compile toolchain prefix" 440d163575Sopenharmony_ci depends on COMPILER_GCC 450d163575Sopenharmony_ci default "arm-linux-ohoseabi-" if ARCH_ARM_AARCH32 460d163575Sopenharmony_ci 470d163575Sopenharmony_ciconfig COMPILER_CLANG_LLVM 480d163575Sopenharmony_ci bool "Clang" 490d163575Sopenharmony_ci 500d163575Sopenharmony_ciconfig LLVM_TARGET 510d163575Sopenharmony_ci string "Clang LLVM target" 520d163575Sopenharmony_ci depends on COMPILER_CLANG_LLVM 530d163575Sopenharmony_ci default "arm-liteos-ohos" if ARCH_ARM_AARCH32 540d163575Sopenharmony_ci 550d163575Sopenharmony_ciendchoice 560d163575Sopenharmony_ci 570d163575Sopenharmony_ciconfig COMPILE_DEBUG 580d163575Sopenharmony_ci bool "Enable debug options" 590d163575Sopenharmony_ci default n 600d163575Sopenharmony_ci help 610d163575Sopenharmony_ci Answer Y to add -g option in compile command. 620d163575Sopenharmony_ci 630d163575Sopenharmony_ciconfig COMPILE_OPTIMIZE 640d163575Sopenharmony_ci bool "Enable code optimization options" 650d163575Sopenharmony_ci default y 660d163575Sopenharmony_ci help 670d163575Sopenharmony_ci Answer Y to add optimization options for efficient code. 680d163575Sopenharmony_ci The final binary size will be smaller and execute faster. 690d163575Sopenharmony_ci But the debugging experience may be worst somehow. 700d163575Sopenharmony_ci 710d163575Sopenharmony_ciconfig COMPILE_OPTIMIZE_SIZE 720d163575Sopenharmony_ci bool "Enable code size optimization options" if COMPILE_OPTIMIZE 730d163575Sopenharmony_ci default y 740d163575Sopenharmony_ci help 750d163575Sopenharmony_ci Answer Y to add optimization options for small code size. 760d163575Sopenharmony_ci The final binary size will be smaller. 770d163575Sopenharmony_ci But the compile time may be a bit longer. 780d163575Sopenharmony_ci 790d163575Sopenharmony_ciconfig COMPILE_LTO 800d163575Sopenharmony_ci bool "Enable link time optimization (LTO)" if COMPILE_OPTIMIZE_SIZE 810d163575Sopenharmony_ci default y 820d163575Sopenharmony_ci help 830d163575Sopenharmony_ci Answer Y to add lto options for more smaller code size. 840d163575Sopenharmony_ci The final binary size will be smaller. 850d163575Sopenharmony_ci But the compile time may be much longer. 860d163575Sopenharmony_ci 870d163575Sopenharmony_ciendmenu 880d163575Sopenharmony_ci 890d163575Sopenharmony_cimenu "Platform" 900d163575Sopenharmony_ci 910d163575Sopenharmony_ci######################### config options of bsp ##################### 920d163575Sopenharmony_cisource "platform/Kconfig" 930d163575Sopenharmony_ci 940d163575Sopenharmony_ci######################### config options of cpu arch ################ 950d163575Sopenharmony_cisource "arch/Kconfig" 960d163575Sopenharmony_ci 970d163575Sopenharmony_ciconfig QUICK_START 980d163575Sopenharmony_ci bool "Enable QUICK_START" 990d163575Sopenharmony_ci default n 1000d163575Sopenharmony_ci depends on DRIVERS && FS_VFS 1010d163575Sopenharmony_ci help 1020d163575Sopenharmony_ci Answer Y to enable LiteOS support quick start. 1030d163575Sopenharmony_ciendmenu 1040d163575Sopenharmony_ci 1050d163575Sopenharmony_ci######################### config options of kernel ##################### 1060d163575Sopenharmony_cisource "kernel/Kconfig" 1070d163575Sopenharmony_ci######################### config options of lib ######################## 1080d163575Sopenharmony_cisource "lib/Kconfig" 1090d163575Sopenharmony_ci######################### config options of compatibility ############## 1100d163575Sopenharmony_cimenu "Compat" 1110d163575Sopenharmony_cisource "compat/posix/Kconfig" 1120d163575Sopenharmony_cisource "bsd/Kconfig" 1130d163575Sopenharmony_ciendmenu 1140d163575Sopenharmony_ci 1150d163575Sopenharmony_ci######################## config options of filesystem ################## 1160d163575Sopenharmony_cimenu "FileSystem" 1170d163575Sopenharmony_cisource "fs/Kconfig" 1180d163575Sopenharmony_ciendmenu 1190d163575Sopenharmony_ci 1200d163575Sopenharmony_ci######################## config options of net ############################ 1210d163575Sopenharmony_cisource "net/Kconfig" 1220d163575Sopenharmony_ci 1230d163575Sopenharmony_ci######################## config options of debug ######################## 1240d163575Sopenharmony_cimenu "Debug" 1250d163575Sopenharmony_ciconfig GDB 1260d163575Sopenharmony_ci bool "Enable gdb functions" 1270d163575Sopenharmony_ci default n 1280d163575Sopenharmony_ci help 1290d163575Sopenharmony_ci Answer Y to enable gdb functions. 1300d163575Sopenharmony_ci 1310d163575Sopenharmony_ciconfig PLATFORM_ADAPT 1320d163575Sopenharmony_ci bool "Enable Os_adapt" 1330d163575Sopenharmony_ci default y 1340d163575Sopenharmony_ci help 1350d163575Sopenharmony_ci Answer Y to add os_adapt.c to LiteOS. 1360d163575Sopenharmony_ci 1370d163575Sopenharmony_ciconfig ENABLE_OOM_LOOP_TASK 1380d163575Sopenharmony_ci bool "Enable Oom loop task" 1390d163575Sopenharmony_ci default n 1400d163575Sopenharmony_ci depends on KERNEL_VM 1410d163575Sopenharmony_ci help 1420d163575Sopenharmony_ci Answer Y to enable oom loop kthread to check system out of memory. 1430d163575Sopenharmony_ci 1440d163575Sopenharmony_ciconfig DO_ALIGN 1450d163575Sopenharmony_ci bool "Enable do align for hi3518e" 1460d163575Sopenharmony_ci default y 1470d163575Sopenharmony_ci depends on PLATFORM_HI3518EV200 1480d163575Sopenharmony_ci help 1490d163575Sopenharmony_ci Answer Y to enable do align for hi3518e. 1500d163575Sopenharmony_ci 1510d163575Sopenharmony_ci 1520d163575Sopenharmony_ciconfig ENABLE_MAGICKEY 1530d163575Sopenharmony_ci bool "Enable MAGIC KEY" 1540d163575Sopenharmony_ci default y 1550d163575Sopenharmony_ci help 1560d163575Sopenharmony_ci Answer Y to enable LiteOS Magic key. 1570d163575Sopenharmony_ci ctrl + r : Magic key check switch; 1580d163575Sopenharmony_ci ctrl + z : Show all magic op key; 1590d163575Sopenharmony_ci ctrl + t : Show task information; 1600d163575Sopenharmony_ci ctrl + p : System panic; 1610d163575Sopenharmony_ci ctrl + e : Check system memory pool. 1620d163575Sopenharmony_ci 1630d163575Sopenharmony_ciconfig THUMB 1640d163575Sopenharmony_ci bool "Enable Thumb" 1650d163575Sopenharmony_ci default n 1660d163575Sopenharmony_ci depends on ARCH_ARM 1670d163575Sopenharmony_ci help 1680d163575Sopenharmony_ci Answer Y to build thumb version. This will make LiteOS smaller. 1690d163575Sopenharmony_ci 1700d163575Sopenharmony_ciconfig PLATFORM_DVFS 1710d163575Sopenharmony_ci bool "Enable Dvfs" 1720d163575Sopenharmony_ci default n 1730d163575Sopenharmony_ci depends on COMPAT_LINUXKPI 1740d163575Sopenharmony_ci help 1750d163575Sopenharmony_ci Answer Y to enable LiteOS support dynamic voltage and frequency scaling feature for 1760d163575Sopenharmony_ci low power consumption. 1770d163575Sopenharmony_ci 1780d163575Sopenharmony_ciconfig SAVE_EXCINFO 1790d163575Sopenharmony_ci bool "Enable Saving Exception Information" 1800d163575Sopenharmony_ci default n 1810d163575Sopenharmony_ci help 1820d163575Sopenharmony_ci Answer Y to enable LiteOS support saving exception information to storage medium. 1830d163575Sopenharmony_ci 1840d163575Sopenharmony_ciconfig DEBUG_VERSION 1850d163575Sopenharmony_ci bool "Enable a Debug Version" 1860d163575Sopenharmony_ci default n 1870d163575Sopenharmony_ci help 1880d163575Sopenharmony_ci If you do not select this option that means you enable a release version for LiteOS. 1890d163575Sopenharmony_ci It also means you do not want to use debug modules, like shell,telnet,tftp,nfs and 1900d163575Sopenharmony_ci memory check, etc. 1910d163575Sopenharmony_ci If you select this option that means you enable a debug version for LiteOS. 1920d163575Sopenharmony_ci That means you want an opposite behaviour compared to release version. 1930d163575Sopenharmony_ci 1940d163575Sopenharmony_ciconfig DEBUG_KERNEL 1950d163575Sopenharmony_ci bool "Enable Debug LiteOS Kernel Resource" 1960d163575Sopenharmony_ci default n 1970d163575Sopenharmony_ci depends on DEBUG_VERSION 1980d163575Sopenharmony_ci help 1990d163575Sopenharmony_ci If you select this option that means you enable debugging kernel resource. 2000d163575Sopenharmony_ci It also means you want to get queue, mutex, semaphore, memory debug information. 2010d163575Sopenharmony_ci That means you want an opposite behaviour compared to release version. 2020d163575Sopenharmony_ci 2030d163575Sopenharmony_ciconfig DEBUG_QUEUE 2040d163575Sopenharmony_ci bool "Enable Queue Debugging" 2050d163575Sopenharmony_ci default n 2060d163575Sopenharmony_ci depends on DEBUG_KERNEL 2070d163575Sopenharmony_ci help 2080d163575Sopenharmony_ci Answer Y to enable debug queue. 2090d163575Sopenharmony_ci 2100d163575Sopenharmony_ciconfig DEBUG_DEADLOCK 2110d163575Sopenharmony_ci bool "Enable Mutex Deadlock Debugging" 2120d163575Sopenharmony_ci default n 2130d163575Sopenharmony_ci depends on DEBUG_KERNEL 2140d163575Sopenharmony_ci help 2150d163575Sopenharmony_ci Answer Y to enable debug mutex deadlock. 2160d163575Sopenharmony_ci 2170d163575Sopenharmony_ciconfig DEBUG_SEMAPHORE 2180d163575Sopenharmony_ci bool "Enable Semaphore Debugging" 2190d163575Sopenharmony_ci default n 2200d163575Sopenharmony_ci depends on DEBUG_KERNEL 2210d163575Sopenharmony_ci help 2220d163575Sopenharmony_ci Answer Y to enable debug semaphore. 2230d163575Sopenharmony_ci 2240d163575Sopenharmony_cisource "shell/Kconfig" 2250d163575Sopenharmony_ciconfig NET_LWIP_SACK_TFTP 2260d163575Sopenharmony_ci bool "Enable Tftp" 2270d163575Sopenharmony_ci default y 2280d163575Sopenharmony_ci depends on SHELL && NET_LWIP_SACK && DEBUG_VERSION 2290d163575Sopenharmony_ci help 2300d163575Sopenharmony_ci Answer Y to enable LiteOS support tftp cmd and tftp tool. 2310d163575Sopenharmony_cisource "net/telnet/Kconfig" 2320d163575Sopenharmony_ciconfig SCHED_DEBUG 2330d163575Sopenharmony_ci bool "Enable sched debug Feature" 2340d163575Sopenharmony_ci default n 2350d163575Sopenharmony_ci depends on DEBUG_VERSION 2360d163575Sopenharmony_ci help 2370d163575Sopenharmony_ci If you wish to build LiteOS with support for sched debug. 2380d163575Sopenharmony_ciconfig SCHED_EDF_DEBUG 2390d163575Sopenharmony_ci bool "Enable sched EDF debug Feature" 2400d163575Sopenharmony_ci default n 2410d163575Sopenharmony_ci depends on SCHED_DEBUG 2420d163575Sopenharmony_ci help 2430d163575Sopenharmony_ci If you wish to build LiteOS with support for sched debug. 2440d163575Sopenharmony_ciconfig USER_INIT_DEBUG 2450d163575Sopenharmony_ci bool "Enable user init Debug" 2460d163575Sopenharmony_ci default n 2470d163575Sopenharmony_ci depends on DEBUG_VERSION 2480d163575Sopenharmony_ci 2490d163575Sopenharmony_ciconfig SHELL_CMD_DEBUG 2500d163575Sopenharmony_ci bool "Enable shell cmd Debug" 2510d163575Sopenharmony_ci default n 2520d163575Sopenharmony_ci depends on DEBUG_VERSION && SHELL 2530d163575Sopenharmony_ci 2540d163575Sopenharmony_ciconfig USB_DEBUG 2550d163575Sopenharmony_ci bool "Enable USB Debug" 2560d163575Sopenharmony_ci default n 2570d163575Sopenharmony_ci depends on SHELL && DRIVERS_USB && DEBUG_VERSION 2580d163575Sopenharmony_ci help 2590d163575Sopenharmony_ci Answer Y to enable LiteOS support usb debug. 2600d163575Sopenharmony_ci use shell command to open the specified debug level print. 2610d163575Sopenharmony_ciconfig MEM_DEBUG 2620d163575Sopenharmony_ci bool "Enable MEM Debug" 2630d163575Sopenharmony_ci default n 2640d163575Sopenharmony_ci depends on DEBUG_VERSION 2650d163575Sopenharmony_ci help 2660d163575Sopenharmony_ci Answer Y to enable LiteOS support mem debug. 2670d163575Sopenharmony_ci 2680d163575Sopenharmony_ciconfig MEM_LEAKCHECK 2690d163575Sopenharmony_ci bool "Enable Function call stack of Mem operation recorded" 2700d163575Sopenharmony_ci default n 2710d163575Sopenharmony_ci depends on DEBUG_VERSION && MEM_DEBUG 2720d163575Sopenharmony_ci help 2730d163575Sopenharmony_ci 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. 2740d163575Sopenharmony_ciconfig BASE_MEM_NODE_INTEGRITY_CHECK 2750d163575Sopenharmony_ci bool "Enable integrity check or not" 2760d163575Sopenharmony_ci default n 2770d163575Sopenharmony_ci depends on DEBUG_VERSION && MEM_DEBUG 2780d163575Sopenharmony_ciconfig MEM_WATERLINE 2790d163575Sopenharmony_ci bool "Enable memory pool waterline or not" 2800d163575Sopenharmony_ci default n 2810d163575Sopenharmony_ci depends on DEBUG_VERSION && MEM_DEBUG 2820d163575Sopenharmony_ci 2830d163575Sopenharmony_ciconfig VM_OVERLAP_CHECK 2840d163575Sopenharmony_ci bool "Enable VM overlap check or not" 2850d163575Sopenharmony_ci default n 2860d163575Sopenharmony_ci depends on DEBUG_VERSION && MEM_DEBUG 2870d163575Sopenharmony_ci help 2880d163575Sopenharmony_ci Answer Y to enable vm overlap check. 2890d163575Sopenharmony_ci 2900d163575Sopenharmony_ciendmenu 2910d163575Sopenharmony_ci 2920d163575Sopenharmony_ci######################## config options os drivers ######################## 2930d163575Sopenharmony_cimenu "Driver" 2940d163575Sopenharmony_cisource "drivers/Kconfig" 2950d163575Sopenharmony_ciendmenu 2960d163575Sopenharmony_ci 2970d163575Sopenharmony_ci######################## config options os security ####################### 2980d163575Sopenharmony_cimenu "Security" 2990d163575Sopenharmony_cisource "security/Kconfig" 3000d163575Sopenharmony_ciendmenu 3010d163575Sopenharmony_ci 3020d163575Sopenharmony_cimenu "Test" 3030d163575Sopenharmony_ciconfig ENABLE_KERNEL_TEST 3040d163575Sopenharmony_ci bool "Enable Kernel Test" 3050d163575Sopenharmony_ci default n 3060d163575Sopenharmony_ciendmenu 3070d163575Sopenharmony_ci 3080d163575Sopenharmony_cimenu "Stack Smashing Protector (SSP) Compiler Feature" 3090d163575Sopenharmony_ci 3100d163575Sopenharmony_cichoice 3110d163575Sopenharmony_ci prompt "Enable stack buffer overflow detection" 3120d163575Sopenharmony_ci default CC_STACKPROTECTOR_STRONG 3130d163575Sopenharmony_ci ---help--- 3140d163575Sopenharmony_ci This option turns on the -fstack-protector GCC feature. This 3150d163575Sopenharmony_ci feature puts, at the beginning of functions, a canary value on 3160d163575Sopenharmony_ci the stack just before the return address, and validates 3170d163575Sopenharmony_ci the value just before actually returning. Stack based buffer 3180d163575Sopenharmony_ci overflows (that need to overwrite this return address) now also 3190d163575Sopenharmony_ci overwrite the canary, which gets detected and the attack is then 3200d163575Sopenharmony_ci neutralized via a kernel panic. 3210d163575Sopenharmony_ci 3220d163575Sopenharmony_ci This feature requires gcc version 4.2 or above, or a distribution 3230d163575Sopenharmony_ci gcc with the feature backported. Older versions are automatically 3240d163575Sopenharmony_ci detected and for those versions, this configuration option is 3250d163575Sopenharmony_ci ignored. (and a warning is printed during bootup) 3260d163575Sopenharmony_ci 3270d163575Sopenharmony_ciconfig CC_NO_STACKPROTECTOR 3280d163575Sopenharmony_ci bool "-fno-stack-protector" 3290d163575Sopenharmony_ci 3300d163575Sopenharmony_ciconfig CC_STACKPROTECTOR 3310d163575Sopenharmony_ci bool "-fstack-protector" 3320d163575Sopenharmony_ci 3330d163575Sopenharmony_ciconfig CC_STACKPROTECTOR_STRONG 3340d163575Sopenharmony_ci bool "-fstack-protector-strong" 3350d163575Sopenharmony_ci 3360d163575Sopenharmony_ciconfig CC_STACKPROTECTOR_ALL 3370d163575Sopenharmony_ci bool "-fstack-protector-all" 3380d163575Sopenharmony_ci 3390d163575Sopenharmony_ciendchoice 3400d163575Sopenharmony_ci 3410d163575Sopenharmony_ciendmenu 342