Use rtems_counter_read() for get_cyclecount()

This commit is contained in:
Sebastian Huber 2018-08-30 10:44:25 +02:00
parent 0f9d58f58b
commit 3990b45e97

View File

@ -22,13 +22,14 @@
#error "the header file <machine/rtems-bsd-kernel-space.h> must be included first" #error "the header file <machine/rtems-bsd-kernel-space.h> must be included first"
#endif #endif
#include <rtems/counter.h>
#define cpu_spinwait() do { } while (0) #define cpu_spinwait() do { } while (0)
/* FIXME: This implementation is a security problem */ static __inline rtems_counter_ticks
static __inline uint64_t
get_cyclecount(void) get_cyclecount(void)
{ {
return rtems_clock_get_ticks_since_boot(); return rtems_counter_read();
} }
#endif /* _RTEMS_BSD_MACHINE_CPU_H_ */ #endif /* _RTEMS_BSD_MACHINE_CPU_H_ */