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"
#endif
#include <rtems/counter.h>
#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_ */