diff --git a/lib/system/freertos/sys.h b/lib/system/freertos/sys.h index d0d64b55..b4350576 100644 --- a/lib/system/freertos/sys.h +++ b/lib/system/freertos/sys.h @@ -18,6 +18,7 @@ #define __METAL_FREERTOS_SYS__H__ #include +#include #ifdef XLNX_PLATFORM #include @@ -33,6 +34,8 @@ extern "C" { #define METAL_MAX_DEVICE_REGIONS 1 #endif +#define metal_yield() metal_cpu_yield() + /** Structure for FreeRTOS libmetal runtime state. */ struct metal_state { diff --git a/lib/system/freertos/template/sys.h b/lib/system/freertos/template/sys.h index 2be8eb87..7ce091b4 100644 --- a/lib/system/freertos/template/sys.h +++ b/lib/system/freertos/template/sys.h @@ -16,10 +16,14 @@ #ifndef __METAL_FREERTOS_TEMPLATE_SYS__H__ #define __METAL_FREERTOS_TEMPLATE_SYS__H__ +#include + #ifdef __cplusplus extern "C" { #endif +#define metal_yield() metal_cpu_yield() + #ifdef METAL_INTERNAL void sys_irq_enable(unsigned int vector); diff --git a/lib/system/freertos/xlnx/sys.h b/lib/system/freertos/xlnx/sys.h index 065bf152..7d27de23 100644 --- a/lib/system/freertos/xlnx/sys.h +++ b/lib/system/freertos/xlnx/sys.h @@ -17,6 +17,8 @@ #ifndef __METAL_FREERTOS_XLNX_SYS__H__ #define __METAL_FREERTOS_XLNX_SYS__H__ +#include + #include "xscugic.h" #include "FreeRTOS.h" @@ -24,6 +26,8 @@ extern "C" { #endif +#define metal_yield() metal_cpu_yield() + #if defined(SDT) && defined(PLATFORM_ZYNQ) #define XPAR_SCUGIC_0_DIST_BASEADDR XPAR_SCUGIC_DIST_BASEADDR #endif diff --git a/lib/system/linux/sys.h b/lib/system/linux/sys.h index 993a3f8a..fe8f7ef5 100644 --- a/lib/system/linux/sys.h +++ b/lib/system/linux/sys.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,8 @@ extern "C" { #define METAL_INVALID_VADDR NULL #define MAX_PAGE_SIZES 32 +#define metal_yield() metal_cpu_yield() + struct metal_device; /** Structure of shared page or hugepage sized data. */ diff --git a/lib/system/nuttx/sys.h b/lib/system/nuttx/sys.h index de19568b..e188e866 100644 --- a/lib/system/nuttx/sys.h +++ b/lib/system/nuttx/sys.h @@ -16,10 +16,14 @@ #ifndef __METAL_NUTTX_SYS__H__ #define __METAL_NUTTX_SYS__H__ +#include + #ifdef __cplusplus extern "C" { #endif +#define metal_yield() metal_sleep_usec(1000) + #define METAL_INIT_DEFAULTS \ { \ .log_handler = (metal_log_handler)syslog, \ diff --git a/lib/system/zephyr/sys.h b/lib/system/zephyr/sys.h index 9c60ecdf..712fdfef 100644 --- a/lib/system/zephyr/sys.h +++ b/lib/system/zephyr/sys.h @@ -16,6 +16,7 @@ #ifndef __METAL_ZEPHYR_SYS__H__ #define __METAL_ZEPHYR_SYS__H__ +#include #include #include @@ -23,6 +24,8 @@ extern "C" { #endif +#define metal_yield() metal_cpu_yield() + #define METAL_INIT_DEFAULTS \ { \ .log_handler = metal_zephyr_log_handler, \