[rtems-libbsd commit] Use rtems_counter_read() for get_cyclecount()
Sebastian Huber
sebh at rtems.org
Wed Sep 12 06:00:06 UTC 2018
Module: rtems-libbsd
Branch: master
Commit: 3990b45e97e074767dff75f5e710bb905e53e2d3
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=3990b45e97e074767dff75f5e710bb905e53e2d3
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Aug 30 10:44:25 2018 +0200
Use rtems_counter_read() for get_cyclecount()
---
rtemsbsd/include/machine/cpu.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/rtemsbsd/include/machine/cpu.h b/rtemsbsd/include/machine/cpu.h
index 3288132..6ae4b44 100644
--- a/rtemsbsd/include/machine/cpu.h
+++ b/rtemsbsd/include/machine/cpu.h
@@ -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_ */
More information about the vc
mailing list