From c34bb0dcfa8ba1294cd5182349e1ddbe34f81bf4 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 13 Jun 2012 11:39:43 +0200 Subject: score: Fix performance issue for 64-bit timestamps The 64-bit timestamps were introduced to simplify the timestamp calculations. This works well since nearly all operations are additions. The previous _TOD_Tickle_ticks() implementation had a serious performance regression in case of 64-bit timestamps due to the usage of two 64-bit divisions which are quite expensive on some architectures. A new field seconds_trigger in TOD_Control is introduced to trigger the _Watchdog_Tickle_seconds() in _TOD_Tickle_ticks(). This avoids the 64-bit divisions completely and only 32-bit additions are used. --- cpukit/score/include/rtems/score/tod.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cpukit/score/include/rtems/score/tod.h') diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h index 06cc9003dd..cfb0fe776d 100644 --- a/cpukit/score/include/rtems/score/tod.h +++ b/cpukit/score/include/rtems/score/tod.h @@ -136,6 +136,15 @@ typedef struct { */ Timestamp_Control uptime; + /** + * @brief Time of day seconds trigger. + * + * This value specifies the nanoseconds since the last time of day second. + * It is updated and evaluated in _TOD_Tickle_ticks(). It is set in + * _TOD_Set_with_timestamp(). + */ + uint32_t seconds_trigger; + /** * @brief Indicates if the time of day is set. * -- cgit v1.2.3