• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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" 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
97######################### config options of rootfs #####################
98source "kernel/common/rootfs/Kconfig"
99######################### config options of patchfs #####################
100source "kernel/common/patchfs/Kconfig"
101######################### config options of blackbox #####################
102source "kernel/common/blackbox/Kconfig"
103######################### config options of hidumper #####################
104source "kernel/common/hidumper/Kconfig"
105
106config QUICK_START
107    bool "Enable QUICK_START"
108    default n
109    depends on DRIVERS && FS_VFS
110    help
111      Answer Y to enable LiteOS support quick start.
112endmenu
113
114######################### config options of kernel #####################
115source "kernel/Kconfig"
116######################### config options of lib ########################
117source "lib/Kconfig"
118######################### config options of compatibility ##############
119menu "Compat"
120source "compat/posix/Kconfig"
121source "bsd/Kconfig"
122endmenu
123
124######################## config options of filesystem ##################
125menu "FileSystem"
126source "fs/vfs/Kconfig"
127source "fs/fat/Kconfig"
128source "fs/ramfs/Kconfig"
129source "fs/romfs/Kconfig"
130source "fs/nfs/Kconfig"
131source "fs/proc/Kconfig"
132source "fs/jffs2/Kconfig"
133source "fs/zpfs/Kconfig"
134config ENABLE_READ_BUFFER
135    bool "Enable read buffer Option"
136    default n
137    depends on FS_VFS
138    help
139      Answer Y to add enable read buffer Option.
140
141config MAX_VNODE_SIZE
142    int "Vnode max number"
143    range 0 512
144    default 512
145    depends on FS_VFS
146    help
147      vnode number, range from 0 to 512.
148
149config MAX_PATH_CACHE_SIZE
150    int "PathCache max number"
151    range 0 1024
152    default 512
153    depends on FS_VFS
154    help
155      pathCache number, range from 0 to 1024.
156endmenu
157
158######################## config options of net ############################
159source "net/Kconfig"
160
161######################## config options of debug ########################
162menu "Debug"
163config GDB
164    bool "Enable gdb functions"
165    default n
166    help
167      Answer Y to enable gdb functions.
168
169config PLATFORM_ADAPT
170    bool "Enable Os_adapt"
171    default y
172    help
173      Answer Y to add os_adapt.c to LiteOS.
174
175config ENABLE_OOM_LOOP_TASK
176    bool "Enable Oom loop task"
177    default n
178    depends on KERNEL_VM
179    help
180      Answer Y to enable oom loop kthread to check system out of memory.
181
182config DO_ALIGN
183    bool "Enable do align for hi3518e"
184    default y
185    depends on PLATFORM_HI3518EV200
186    help
187      Answer Y to enable do align for hi3518e.
188
189
190config ENABLE_MAGICKEY
191    bool "Enable MAGIC KEY"
192    default y
193    help
194      Answer Y to enable LiteOS Magic key.
195        ctrl + r : Magic key check switch;
196        ctrl + z : Show all magic op key;
197        ctrl + t : Show task information;
198        ctrl + p : System panic;
199        ctrl + e : Check system memory pool.
200
201config THUMB
202    bool "Enable Thumb"
203    default n
204    depends on ARCH_ARM
205    help
206      Answer Y to build thumb version.  This will make LiteOS smaller.
207
208config PLATFORM_DVFS
209    bool "Enable Dvfs"
210    default n
211    depends on  COMPAT_LINUXKPI
212    help
213      Answer Y to enable LiteOS support dynamic voltage and frequency scaling feature for
214      low power consumption.
215
216config SAVE_EXCINFO
217    bool "Enable Saving Exception Information"
218    default n
219    help
220      Answer Y to enable LiteOS support saving exception information to storage medium.
221
222config DEBUG_VERSION
223    bool "Enable a Debug Version"
224    default n
225    help
226      If you do not select this option that means you enable a release version for LiteOS.
227      It also means you do not want to use debug modules, like shell,telnet,tftp,nfs and
228      memory check, etc.
229      If you select this option that means you enable a debug version for LiteOS.
230      That means you want a opposite behaviour compared to release version.
231
232config DEBUG_KERNEL
233    bool "Enable Debug LiteOS Kernel Resource"
234    default n
235    depends on DEBUG_VERSION
236    help
237      If you select this option that means you enable debugging kernel resource.
238      It also means you want to get queue, mutex, semaphore, memory debug information.
239      That means you want a opposite behaviour compared to release version.
240
241config DEBUG_QUEUE
242    bool "Enable Queue Debugging"
243    default n
244    depends on DEBUG_KERNEL
245    help
246      Answer Y to enable debug queue.
247
248config DEBUG_DEADLOCK
249    bool "Enable Mutex Deadlock Debugging"
250    default n
251    depends on DEBUG_KERNEL
252    help
253      Answer Y to enable debug mutex deadlock.
254
255config DEBUG_SEMAPHORE
256    bool "Enable Semaphore Debugging"
257    default n
258    depends on DEBUG_KERNEL
259    help
260      Answer Y to enable debug semaphore.
261
262source "shell/Kconfig"
263config NET_LWIP_SACK_TFTP
264    bool "Enable Tftp"
265    default y
266    depends on SHELL && NET_LWIP_SACK && DEBUG_VERSION
267    help
268      Answer Y to enable LiteOS support tftp cmd and tftp tool.
269source "net/telnet/Kconfig"
270config SCHED_DEBUG
271    bool "Enable sched debug Feature"
272    default n
273    depends on DEBUG_VERSION
274    help
275      If you wish to build LiteOS with support for sched debug.
276
277config USER_INIT_DEBUG
278    bool "Enable user init Debug"
279    default n
280    depends on DEBUG_VERSION
281
282config SHELL_CMD_DEBUG
283    bool "Enable shell cmd Debug"
284    default n
285    depends on DEBUG_VERSION && SHELL
286
287config USB_DEBUG
288    bool "Enable USB Debug"
289    default n
290    depends on SHELL && DRIVERS_USB && DEBUG_VERSION
291    help
292      Answer Y to enable LiteOS support usb debug.
293      use shell command to open the specified debug level print.
294config MEM_DEBUG
295    bool "Enable MEM Debug"
296    default n
297    depends on DEBUG_VERSION
298    help
299      Answer Y to enable LiteOS support mem debug.
300
301config MEM_LEAKCHECK
302    bool "Enable Function call stack of Mem operation recorded"
303    default n
304    depends on DEBUG_VERSION && MEM_DEBUG
305    help
306      Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the infomations of mem node.
307config BASE_MEM_NODE_INTEGRITY_CHECK
308    bool "Enable integrity check or not"
309    default n
310    depends on DEBUG_VERSION && MEM_DEBUG
311config MEM_WATERLINE
312    bool "Enable memory pool waterline or not"
313    default n
314    depends on DEBUG_VERSION && MEM_DEBUG
315
316config VM_OVERLAP_CHECK
317    bool "Enable VM overlap check or not"
318    default n
319    depends on DEBUG_VERSION && MEM_DEBUG
320    help
321      Answer Y to enable vm overlap check.
322
323endmenu
324
325######################## config options os drivers ########################
326menu "Driver"
327config DRIVERS
328    bool "Enable Driver"
329    default y
330    help
331      Answer Y to enable LiteOS support driver.
332
333source "bsd/dev/usb/Kconfig"
334source "../../drivers/adapter/khdf/liteos/Kconfig"
335
336# Device driver Kconfig import
337source "$(DEVICE_PATH)/drivers/Kconfig"
338
339source "drivers/char/mem/Kconfig"
340source "drivers/char/quickstart/Kconfig"
341source "drivers/char/random/Kconfig"
342source "drivers/char/video/Kconfig"
343source "drivers/char/trace/Kconfig"
344
345source "../../drivers/liteos/tzdriver/Kconfig"
346source "../../drivers/liteos/hievent/Kconfig"
347
348endmenu
349
350menu "Security"
351source "security/Kconfig"
352endmenu
353
354menu "Test"
355config ENABLE_KERNEL_TEST
356    bool "Enable Kernel Test"
357    default n
358endmenu
359
360menu "Stack Smashing Protector (SSP) Compiler Feature"
361
362choice
363    prompt "Enable stack buffer overflow detection"
364    default  CC_STACKPROTECTOR_STRONG
365    ---help---
366    This option turns on the -fstack-protector GCC feature. This
367    feature puts, at the beginning of functions, a canary value on
368    the stack just before the return address, and validates
369    the value just before actually returning.  Stack based buffer
370    overflows (that need to overwrite this return address) now also
371    overwrite the canary, which gets detected and the attack is then
372    neutralized via a kernel panic.
373
374    This feature requires gcc version 4.2 or above, or a distribution
375    gcc with the feature backported. Older versions are automatically
376    detected and for those versions, this configuration option is
377    ignored. (and a warning is printed during bootup)
378
379config CC_NO_STACKPROTECTOR
380    bool "-fno-stack-protector"
381
382config CC_STACKPROTECTOR
383    bool "-fstack-protector"
384
385config CC_STACKPROTECTOR_STRONG
386    bool "-fstack-protector-strong"
387
388config CC_STACKPROTECTOR_ALL
389    bool "-fstack-protector-all"
390
391endchoice
392
393endmenu
394