diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-05-03 13:03:27 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-12-07 14:22:01 +0100 |
commit | 0a1f5df98e52b028bf8b4de3bf63e39702fa5f34 (patch) | |
tree | 7b3d8bfe7a9e760ee2bbb8916d3284f34edfec89 /cpukit/score/cpu/or1k/include/rtems/score/cpu.h | |
parent | ef23838543337105de4070ff2ef0d45b078f6812 (diff) |
Simplify _CPU_Counter_difference()
In order to simplify the use of CPU counter values it is beneficial to
have monotonic increasing values within the range of the CPU counter
ticks data type, e.g. 32-bit unsigned integer. This eases the use of
CPU counter timestamps in external tools which do not know the details
of the CPU counter hardware. The CPU counter is the fastest way to get
a time on an RTEMS system.
Such a CPU counter may be also used as the timecounter. Use it on SPARC
for this purpose to simplify the clock drivers.
Update #3456.
Diffstat (limited to 'cpukit/score/cpu/or1k/include/rtems/score/cpu.h')
-rw-r--r-- | cpukit/score/cpu/or1k/include/rtems/score/cpu.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cpukit/score/cpu/or1k/include/rtems/score/cpu.h b/cpukit/score/cpu/or1k/include/rtems/score/cpu.h index 0d1566a0c9..663a1755ba 100644 --- a/cpukit/score/cpu/or1k/include/rtems/score/cpu.h +++ b/cpukit/score/cpu/or1k/include/rtems/score/cpu.h @@ -712,10 +712,13 @@ uint32_t _CPU_Counter_frequency( void ); CPU_Counter_ticks _CPU_Counter_read( void ); -CPU_Counter_ticks _CPU_Counter_difference( +static inline CPU_Counter_ticks _CPU_Counter_difference( CPU_Counter_ticks second, CPU_Counter_ticks first -); +) +{ + return second - first; +} /** Type that can store a 32-bit integer or a pointer. */ typedef uintptr_t CPU_Uint32ptr; |