From 552020517ec91b40b581d1b21b3712139de9e460 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 17 May 2021 15:35:12 +0300 Subject: [PATCH 1/3] Kconfig: move compiler options to a separate file Signed-off-by: Kai Vehmanen --- Kconfig | 36 +++--------------------------------- Kconfig.xtos-build | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 Kconfig.xtos-build diff --git a/Kconfig b/Kconfig index 45a47f94c2ed..b3cb77af984c 100644 --- a/Kconfig +++ b/Kconfig @@ -127,39 +127,9 @@ config XT_INTERRUPT_LEVEL_5 rsource "src/Kconfig" -choice - prompt "Optimization" - default OPTIMIZE_FOR_PERFORMANCE - help - Controls how compiler should optimize binary. - This config should affect only compiler settings and is - not meant to be used for conditional compilation of code. - -config OPTIMIZE_FOR_PERFORMANCE - bool "Optimize for performance" - help - Apply compiler optimizations prioritizing performance. - It means -O2 for GCC or equivalent for other compilers. - -config OPTIMIZE_FOR_SIZE - bool "Optimize for size" - help - Apply compiler optimizations prioritizing binary size. - It means -Os for GCC or equivalent for other compilers. - -config OPTIMIZE_FOR_DEBUG - bool "Optimize for debug" - help - Apply compiler optimizations prioritizing debugging experience. - It means -Og for GCC or equivalent for other compilers. - -config OPTIMIZE_FOR_NONE - bool "Don't optimize" - help - Apply no compiler optimizations. - It means -O0 for GCC or equivalent for other compilers. - -endchoice +if !ZEPHYR_SOF_MODULE + rsource "Kconfig.xtos-build" +endif menu "Debug" diff --git a/Kconfig.xtos-build b/Kconfig.xtos-build new file mode 100644 index 000000000000..310154338ce4 --- /dev/null +++ b/Kconfig.xtos-build @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: BSD-3-Clause + +comment "XTOS options / compiler" + +choice + prompt "Optimization" + default OPTIMIZE_FOR_PERFORMANCE + help + Controls how compiler should optimize binary. + This config should affect only compiler settings and is + not meant to be used for conditional compilation of code. + +config OPTIMIZE_FOR_PERFORMANCE + bool "Optimize for performance" + help + Apply compiler optimizations prioritizing performance. + It means -O2 for GCC or equivalent for other compilers. + +config OPTIMIZE_FOR_SIZE + bool "Optimize for size" + help + Apply compiler optimizations prioritizing binary size. + It means -Os for GCC or equivalent for other compilers. + +config OPTIMIZE_FOR_DEBUG + bool "Optimize for debug" + help + Apply compiler optimizations prioritizing debugging experience. + It means -Og for GCC or equivalent for other compilers. + +config OPTIMIZE_FOR_NONE + bool "Don't optimize" + help + Apply no compiler optimizations. + It means -O0 for GCC or equivalent for other compilers. + +endchoice From 860d998feab4876b2864a62b8acacc26327c1ad1 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 17 May 2021 16:45:07 +0300 Subject: [PATCH 2/3] kconfig: move XTOS build specific debug options to a separate file Some of the DEBUG options are only used in the XTOS implementation and do not impact e.g. Zephyr builds. Make the split explicit by moving these options to a separate file. Signed-off-by: Kai Vehmanen --- Kconfig | 19 ++++--------------- Kconfig.xtos-dbg | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 Kconfig.xtos-dbg diff --git a/Kconfig b/Kconfig index b3cb77af984c..9b640132e374 100644 --- a/Kconfig +++ b/Kconfig @@ -145,12 +145,6 @@ config GDB_DEBUG help Select for GDB debugging -config DEBUG_HEAP - bool "Heap debug" - default n - help - Select for enable heap alloc debugging - config DEBUG_MEMORY_USAGE_SCAN bool "Memory usage scan" default y @@ -159,15 +153,6 @@ config DEBUG_MEMORY_USAGE_SCAN This feature does not affect standard memory operations, especially allocation and deallocation. -config DEBUG_BLOCK_FREE - bool "Blocks freeing debug" - default n - help - It enables checking if free was called multiple times on - already freed block of memory. Enabling this feature increases - number of memory writes and reads, due to checks for memory patterns - that may be performed on allocation and deallocation. - config DEBUG_LOCKS bool "Spinlock debug" default n @@ -218,4 +203,8 @@ config DSP_RESIDENCY_COUNTERS R0, R1, R2 are abstract states which can be used differently based on platform implementation. +if !ZEPHYR_SOF_MODULE + rsource "Kconfig.xtos-dbg" +endif + endmenu diff --git a/Kconfig.xtos-dbg b/Kconfig.xtos-dbg new file mode 100644 index 000000000000..3082d7cfad04 --- /dev/null +++ b/Kconfig.xtos-dbg @@ -0,0 +1,14 @@ +config DEBUG_HEAP + bool "Heap debug" + default n + help + Select for enable heap alloc debugging + +config DEBUG_BLOCK_FREE + bool "Blocks freeing debug" + default n + help + It enables checking if free was called multiple times on + already freed block of memory. Enabling this feature increases + number of memory writes and reads, due to checks for memory patterns + that may be performed on allocation and deallocation. From fcf33ec1a7b77bc3eadcf06985775037ae9c9a59 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 17 May 2021 16:56:19 +0300 Subject: [PATCH 3/3] kconfig: move BUILD_VM_ROM Kconfig.xtos-build The BUILD_VM_ROM option only affects SOF XTOS builds, so move the option to a separate file. Signed-off-by: Kai Vehmanen --- Kconfig | 6 ------ Kconfig.xtos-build | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Kconfig b/Kconfig index 9b640132e374..d2a95bdff05f 100644 --- a/Kconfig +++ b/Kconfig @@ -169,12 +169,6 @@ config DEBUG_LOCKS_VERBOSE In addition to DEBUG_LOCKS it also adds spinlock traces every time the lock is acquired. -config BUILD_VM_ROM - bool "Build VM ROM" - default n - help - Select if you want to build VM ROM - config DEBUG_IPC_COUNTERS bool "IPC counters" depends on CAVS diff --git a/Kconfig.xtos-build b/Kconfig.xtos-build index 310154338ce4..b2956a46bbf9 100644 --- a/Kconfig.xtos-build +++ b/Kconfig.xtos-build @@ -35,3 +35,9 @@ config OPTIMIZE_FOR_NONE It means -O0 for GCC or equivalent for other compilers. endchoice + +config BUILD_VM_ROM + bool "Build VM ROM" + default n + help + Select if you want to build VM ROM