From 3990b45e97e074767dff75f5e710bb905e53e2d3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 30 Aug 2018 10:44:25 +0200 Subject: Use rtems_counter_read() for get_cyclecount() --- rtemsbsd/include/machine/cpu.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'rtemsbsd') diff --git a/rtemsbsd/include/machine/cpu.h b/rtemsbsd/include/machine/cpu.h index 32881325..6ae4b448 100644 --- a/rtemsbsd/include/machine/cpu.h +++ b/rtemsbsd/include/machine/cpu.h @@ -22,13 +22,14 @@ #error "the header file must be included first" #endif +#include + #define cpu_spinwait() do { } while (0) -/* FIXME: This implementation is a security problem */ -static __inline uint64_t +static __inline rtems_counter_ticks get_cyclecount(void) { - return rtems_clock_get_ticks_since_boot(); + return rtems_counter_read(); } #endif /* _RTEMS_BSD_MACHINE_CPU_H_ */ -- cgit v1.2.3