From a75462f40cd7a3d38881b1f0597af1a8c752fd67 Mon Sep 17 00:00:00 2001 From: Arnaud Pouliquen Date: Thu, 24 Oct 2024 10:30:24 +0200 Subject: [PATCH] lib: processor: hosted: fix compilation warning in metal_cpu_yield MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix cross inclusion between metal/sys.h and /processor/hosted/cpu.h replacing metal_cpu_yield() by the zephyr k_yield(). Issue reported by Zephyr twister CI test: libmetal/lib/include/metal/processor/hosted/cpu.h:19:9: error: implicit declaration of function ‘metal_wait_usec’ 19 | metal_wait_usec(10); | ^~~~~~~~~~~~~~~ libmetal/lib/include/metal/system/zephyr/sys.h:46:20: error: conflicting types for ‘metal_wait_usec’; have ‘void(uint32_t)’ 46 | static inline void metal_wait_usec(uint32_t usec_to_wait) | ^~~~~~~~~~~~~~~ libmetal/lib/include/metal/processor/hosted/cpu.h:19:9: note: previous implicit declaration of ‘metal_wait_usec’ with type ‘void(uint32_t)’ {aka ‘void(unsigned int)’} 19 | metal_wait_usec(10); | ^~~~~~~~~~~~~~~ Signed-off-by: Arnaud Pouliquen --- lib/system/zephyr/sys.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/system/zephyr/sys.h b/lib/system/zephyr/sys.h index 712fdfef..fbb46d7b 100644 --- a/lib/system/zephyr/sys.h +++ b/lib/system/zephyr/sys.h @@ -16,7 +16,6 @@ #ifndef __METAL_ZEPHYR_SYS__H__ #define __METAL_ZEPHYR_SYS__H__ -#include #include #include @@ -24,7 +23,7 @@ extern "C" { #endif -#define metal_yield() metal_cpu_yield() +#define metal_yield() k_yield() #define METAL_INIT_DEFAULTS \ { \