diff --git a/include/arch/arc/v2/misc.h b/include/arch/arc/v2/misc.h index 802ed9a2920..7c5014648e5 100644 --- a/include/arch/arc/v2/misc.h +++ b/include/arch/arc/v2/misc.h @@ -22,7 +22,11 @@ extern "C" { extern unsigned int z_arc_cpu_sleep_mode; extern u32_t z_timer_cycle_get_32(void); -#define z_arch_k_cycle_get_32() z_timer_cycle_get_32() + +static inline u32_t z_arch_k_cycle_get_32(void) +{ + return z_timer_cycle_get_32(); +} #endif #ifdef __cplusplus diff --git a/include/arch/arm/misc.h b/include/arch/arm/misc.h index 02e37a359c1..7ca249292ad 100644 --- a/include/arch/arm/misc.h +++ b/include/arch/arm/misc.h @@ -20,7 +20,11 @@ extern "C" { #ifndef _ASMLANGUAGE extern u32_t z_timer_cycle_get_32(void); -#define z_arch_k_cycle_get_32() z_timer_cycle_get_32() + +static inline u32_t z_arch_k_cycle_get_32(void) +{ + return z_timer_cycle_get_32(); +} /** * @brief Explicitly nop operation. diff --git a/include/arch/nios2/arch.h b/include/arch/nios2/arch.h index 7633592a861..4c86113e4b0 100644 --- a/include/arch/nios2/arch.h +++ b/include/arch/nios2/arch.h @@ -199,7 +199,11 @@ enum nios2_exception_cause { extern u32_t z_timer_cycle_get_32(void); -#define z_arch_k_cycle_get_32() z_timer_cycle_get_32() + +static inline u32_t z_arch_k_cycle_get_32(void) +{ + return z_timer_cycle_get_32(); +} /** * @brief Explicitly nop operation. diff --git a/include/arch/posix/arch.h b/include/arch/posix/arch.h index f66314cedca..c75e6acc27e 100644 --- a/include/arch/posix/arch.h +++ b/include/arch/posix/arch.h @@ -45,7 +45,11 @@ struct __esf { typedef struct __esf z_arch_esf_t; extern u32_t z_timer_cycle_get_32(void); -#define z_arch_k_cycle_get_32() z_timer_cycle_get_32() + +static inline u32_t z_arch_k_cycle_get_32(void) +{ + return z_timer_cycle_get_32(); +} /** * @brief Explicitly nop operation. diff --git a/include/arch/riscv/arch.h b/include/arch/riscv/arch.h index a1ee4fc06e1..7cad980b31f 100644 --- a/include/arch/riscv/arch.h +++ b/include/arch/riscv/arch.h @@ -156,7 +156,11 @@ static ALWAYS_INLINE void z_arch_nop(void) extern u32_t z_timer_cycle_get_32(void); -#define z_arch_k_cycle_get_32() z_timer_cycle_get_32() + +static inline u32_t z_arch_k_cycle_get_32(void) +{ + return z_timer_cycle_get_32(); +} #ifdef __cplusplus } diff --git a/include/arch/x86/arch.h b/include/arch/x86/arch.h index d125bc5bf8a..a96e3ff0d7d 100644 --- a/include/arch/x86/arch.h +++ b/include/arch/x86/arch.h @@ -211,7 +211,11 @@ extern void z_arch_irq_enable(unsigned int irq); extern void z_arch_irq_disable(unsigned int irq); extern u32_t z_timer_cycle_get_32(void); -#define z_arch_k_cycle_get_32() z_timer_cycle_get_32() + +static inline u32_t z_arch_k_cycle_get_32(void) +{ + return z_timer_cycle_get_32(); +} /** * Returns true if interrupts were unlocked prior to the diff --git a/include/arch/xtensa/arch.h b/include/arch/xtensa/arch.h index 7ee5d2901c2..f71db2129ba 100644 --- a/include/arch/xtensa/arch.h +++ b/include/arch/xtensa/arch.h @@ -81,7 +81,11 @@ extern void z_irq_spurious(void *unused); #define XTENSA_ERR_NORET extern u32_t z_timer_cycle_get_32(void); -#define z_arch_k_cycle_get_32() z_timer_cycle_get_32() + +static inline u32_t z_arch_k_cycle_get_32(void) +{ + return z_timer_cycle_get_32(); +} /** * @brief Explicitly nop operation.