From 2a2351b58f8e20d4829152f22892452f19034443 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 16 Dec 2019 09:35:03 -0800 Subject: [PATCH] soc: intel_s1000: add dummy sys_reboot() for test with XCC XCC does not seem to handle if(IS_ENABLED()) well which means XCC would not get rid of code even IS_ENABLED() is false. In this case, sys_reboot() call in ztest is in this situation so add a dummy version for ztest only. Signed-off-by: Daniel Leung --- soc/xtensa/intel_s1000/xcc/CMakeLists.txt | 1 + soc/xtensa/intel_s1000/xcc/ztest_fixes.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 soc/xtensa/intel_s1000/xcc/ztest_fixes.c diff --git a/soc/xtensa/intel_s1000/xcc/CMakeLists.txt b/soc/xtensa/intel_s1000/xcc/CMakeLists.txt index cdfd5f557c0..009b3882e93 100644 --- a/soc/xtensa/intel_s1000/xcc/CMakeLists.txt +++ b/soc/xtensa/intel_s1000/xcc/CMakeLists.txt @@ -3,3 +3,4 @@ zephyr_library_sources_ifdef(CONFIG_CPLUSPLUS cpp_fixes.c) zephyr_library_sources_ifdef(CONFIG_NEWLIB_LIBC newlib_fixes.c) zephyr_library_sources_ifdef(CONFIG_LOG_MINIMAL log_minimal_fixes.c) +zephyr_library_sources_ifdef(CONFIG_TEST ztest_fixes.c) diff --git a/soc/xtensa/intel_s1000/xcc/ztest_fixes.c b/soc/xtensa/intel_s1000/xcc/ztest_fixes.c new file mode 100644 index 00000000000..82b52a03fda --- /dev/null +++ b/soc/xtensa/intel_s1000/xcc/ztest_fixes.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2019, Intel Corporation. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#ifndef CONFIG_ZTEST_RETEST_IF_PASSED + +void sys_reboot(int type) +{ + ARG_UNUSED(type); +} + +#endif /* CONFIG_ZTEST_RETEST_IF_PASSED */