mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-13 19:29:21 +08:00
Use rtems_counter_read() for get_cyclecount()
This commit is contained in:
parent
0f9d58f58b
commit
3990b45e97
@ -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_ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user