Skip to content
Permalink
Browse files

arch: arc: build cache.c conditionally

Instead of the ifdef in the c file, exclude it from build completely
using cmake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information...
nashif committed Jun 20, 2019
1 parent fb4d9c0 commit fe03e39cdd7b7760369817c11e364001cfc4d7c6
Showing with 1 addition and 6 deletions.
  1. +1 −1 arch/arc/core/CMakeLists.txt
  2. +0 −5 arch/arc/core/cache.c
@@ -10,7 +10,6 @@ zephyr_library_sources(
fault.c
fault_s.S
irq_manage.c
cache.c
timestamp.c
isr_wrapper.S
regular_irq.S
@@ -21,6 +20,7 @@ zephyr_library_sources(
vector_table.c
)

zephyr_library_sources_ifdef(CONFIG_CACHE_FLUSHING cache.c)
zephyr_library_sources_ifdef(CONFIG_ARC_FIRQ fast_irq.S)

zephyr_library_sources_if_kconfig(irq_offload.c)
@@ -25,8 +25,6 @@
#include <init.h>
#include <stdbool.h>

#if defined(CONFIG_CACHE_FLUSHING)

#if (CONFIG_CACHE_LINE_SIZE == 0) && !defined(CONFIG_CACHE_LINE_SIZE_DETECT)
#error Cannot use this implementation with a cache line size of 0
#endif
@@ -171,6 +169,3 @@ static int init_dcache(struct device *unused)
}

SYS_INIT(init_dcache, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

#endif /* CONFIG_CACHE_FLUSHING */

0 comments on commit fe03e39

Please sign in to comment.
You can’t perform that action at this time.