Skip to content
Commit bce0eb9d authored by Andrew Boie's avatar Andrew Boie Committed by Anas Nashif
Browse files

riscv_machine_timer: fix k_cycle_get_32()



There are race conditions trying to coordinate the value between
the accumulated_cycle_count (updated at interrupt time) and
trying to compute the delta from the last interrupt using the
mtime registers. An unlucky call could result in the timestamp
appearing to move backwards in time.

the 'mtime' register isn't reset at every interrupt. Since we just
want a cycle counter, report its raw value.

Issue: ZEP-1546
Change-Id: I9f404b33214d6502fea47374fcf0ecbf84ef8136
Signed-off-by: default avatarAndrew Boie <andrew.p.boie@intel.com>
parent 48cea0e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment