From 0a1f5df98e52b028bf8b4de3bf63e39702fa5f34 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 3 May 2018 13:03:27 +0200 Subject: 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. --- cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpukit/score/cpu/no_cpu/include') diff --git a/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h index 7ab09d990e..6b6094ae10 100644 --- a/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h +++ b/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h @@ -1219,10 +1219,13 @@ CPU_Counter_ticks _CPU_Counter_read( void ); * * @return Returns second minus first modulo counter period. */ -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; +} #ifdef RTEMS_SMP /** -- cgit v1.2.3