From 3a65b78f5fff84bf2a75ff5048b62ec3eebd51fd Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Thu, 25 Apr 2019 15:05:56 +0200 Subject: [PATCH] host: replace CONFIG_HOST and CONFIG_LIB with CONFIG_LIBRARY We don't need 3 symbols - they all are used in the same case. Signed-off-by: Janusz Jankowski --- src/arch/host/CMakeLists.txt | 3 +-- src/arch/host/config.h.in | 3 +-- src/arch/xtensa/include/arch/string.h | 4 ++-- src/audio/src_config.h | 2 +- src/include/sof/io.h | 2 +- src/include/sof/sof.h | 2 +- src/include/sof/trace.h | 4 ++-- src/lib/lib.c | 2 +- test/cmocka/src/audio/buffer/mock.c | 2 +- test/cmocka/src/audio/component/mock.c | 2 +- 10 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index e76dfed22..7d2f8226f 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -7,8 +7,7 @@ target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/platf target_include_directories(sof_options INTERFACE ${GENERATED_DIRECTORY}/include) # TODO: add Kconfig support also for testbench when it'll be decoupled from fw -set(CONFIG_HOST 1) -set(CONFIG_LIB 1) +set(CONFIG_LIBRARY 1) set(CONFIG_COMP_VOLUME 1) set(CONFIG_COMP_SRC 1) set(CONFIG_COMP_FIR 1) diff --git a/src/arch/host/config.h.in b/src/arch/host/config.h.in index 3bcd143a5..7d221075b 100644 --- a/src/arch/host/config.h.in +++ b/src/arch/host/config.h.in @@ -1,5 +1,4 @@ -#define CONFIG_HOST @CONFIG_HOST@ -#define CONFIG_LIB @CONFIG_LIB@ +#define CONFIG_LIBRARY @CONFIG_LIBRARY@ #define CONFIG_COMP_VOLUME @CONFIG_COMP_VOLUME@ #define CONFIG_COMP_SRC @CONFIG_COMP_SRC@ #define CONFIG_COMP_FIR @CONFIG_COMP_FIR@ diff --git a/src/arch/xtensa/include/arch/string.h b/src/arch/xtensa/include/arch/string.h index 653dcbf3f..ae496a0c5 100644 --- a/src/arch/xtensa/include/arch/string.h +++ b/src/arch/xtensa/include/arch/string.h @@ -72,7 +72,7 @@ static inline int arch_memcpy_s(void *dest, size_t dest_size, return -EINVAL; /* can't be use until full context switch will be supported */ -/* #if __XCC__ && !CONFIG_HOST +/* #if __XCC__ && !CONFIG_LIBRARY * __vec_memcpy(dest, src, src_size); * #else */ @@ -91,7 +91,7 @@ static inline int arch_memset_s(void *dest, size_t dest_size, if (count > dest_size) return -EINVAL; -#if __XCC__ && !CONFIG_HOST +#if __XCC__ && !CONFIG_LIBRARY if (!__vec_memset(dest, data, count)) return -ENOMEM; #else diff --git a/src/audio/src_config.h b/src/audio/src_config.h index 6014d42f3..e2a530055 100644 --- a/src/audio/src_config.h +++ b/src/audio/src_config.h @@ -66,7 +66,7 @@ #endif #else /* GCC */ -#if defined(CONFIG_HOST) +#if defined(CONFIG_LIBRARY) #define SRC_SHORT 0 /* Use high quality 32 bit filter coefficients */ #else #define SRC_SHORT 1 /* Use 16 bit filter coefficients for speed */ diff --git a/src/include/sof/io.h b/src/include/sof/io.h index d4b4e4c57..9baeca1d3 100644 --- a/src/include/sof/io.h +++ b/src/include/sof/io.h @@ -35,7 +35,7 @@ #include #include -#if CONFIG_LIB +#if CONFIG_LIBRARY static inline uint32_t io_reg_read(uint32_t reg) {return 0;} static inline void io_reg_write(uint32_t reg, uint32_t val) {} diff --git a/src/include/sof/sof.h b/src/include/sof/sof.h index cd755fdb6..7370e5c25 100644 --- a/src/include/sof/sof.h +++ b/src/include/sof/sof.h @@ -65,7 +65,7 @@ struct sa; */ #ifdef UNIT_TEST #define DECLARE_MODULE(init) -#elif CONFIG_HOST +#elif CONFIG_LIBRARY /* In case of shared libs components are initialised in dlopen */ #define DECLARE_MODULE(init) __attribute__((constructor)) \ static void _module_init(void) { init(); } diff --git a/src/include/sof/trace.h b/src/include/sof/trace.h index 8ee72058a..d4692276c 100644 --- a/src/include/sof/trace.h +++ b/src/include/sof/trace.h @@ -116,7 +116,7 @@ #define TRACE_CLASS_SOUNDWIRE (32 << 24) #define TRACE_CLASS_KEYWORD (33 << 24) -#ifdef CONFIG_HOST +#ifdef CONFIG_LIBRARY extern int test_bench_trace; char *get_trace_class(uint32_t trace_class); #define _log_message(mbox, atomic, level, comp_class, id_0, id_1, \ @@ -301,7 +301,7 @@ void trace_init(struct sof *sof); #define trace_error_value_atomic(x) trace_value_atomic(x) #endif -#ifndef CONFIG_HOST +#ifndef CONFIG_LIBRARY #define _DECLARE_LOG_ENTRY(lvl, format, comp_class, params, ids)\ __attribute__((section(".static_log." #lvl))) \ static const struct { \ diff --git a/src/lib/lib.c b/src/lib/lib.c index 1261f7850..ada2aaaad 100644 --- a/src/lib/lib.c +++ b/src/lib/lib.c @@ -59,7 +59,7 @@ void cmemcpy(void *dest, void *src, size_t size) } #endif -#if !CONFIG_HOST +#if !CONFIG_LIBRARY /* used by gcc - but uses arch_memcpy internally */ void *memcpy(void *dest, const void *src, size_t n) { diff --git a/test/cmocka/src/audio/buffer/mock.c b/test/cmocka/src/audio/buffer/mock.c index cb08de8ad..ab2405ab4 100644 --- a/test/cmocka/src/audio/buffer/mock.c +++ b/test/cmocka/src/audio/buffer/mock.c @@ -39,7 +39,7 @@ TRACE_IMPL() -#if !CONFIG_HOST +#if !CONFIG_LIBRARY void *rzalloc(int zone, uint32_t caps, size_t bytes) { diff --git a/test/cmocka/src/audio/component/mock.c b/test/cmocka/src/audio/component/mock.c index a278f983c..6eb079519 100644 --- a/test/cmocka/src/audio/component/mock.c +++ b/test/cmocka/src/audio/component/mock.c @@ -39,7 +39,7 @@ TRACE_IMPL() -#if !CONFIG_HOST +#if !CONFIG_LIBRARY void *rzalloc(int zone, uint32_t caps, size_t bytes) {