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/timestamp.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'cpukit/score/include/rtems/score/timestamp.h') diff --git a/cpukit/score/include/rtems/score/timestamp.h b/cpukit/score/include/rtems/score/timestamp.h index b86090978e..83948b46e1 100644 --- a/cpukit/score/include/rtems/score/timestamp.h +++ b/cpukit/score/include/rtems/score/timestamp.h @@ -193,31 +193,6 @@ extern "C" { _Timestamp64_Add_to( _time, _add ) #endif -/** - * @brief Add to a Timestamp (At Clock Tick) - * - * This routine adds two timestamps. The second argument is added - * to the first. - * - * @node This routine places a special requirement on the addition - * operation. It must return the number of units that the - * seconds field changed as the result of the addition. Since this - * operation is ONLY used as part of processing a clock tick, - * it is generally safe to assume that only one second changed. - * - * @param[in] _time points to the base time to be added to - * @param[in] _add points to the timestamp to add to the first argument - * - * @return This method returns the number of seconds @a time increased by. - */ -#if CPU_TIMESTAMP_USE_STRUCT_TIMESPEC == TRUE - #define _Timestamp_Add_to_at_tick( _time, _add ) \ - _Timespec_Add_to( _time, _add ) -#else - #define _Timestamp_Add_to_at_tick( _time, _add ) \ - _Timestamp64_Add_to_at_tick( _time, _add ) -#endif - /** * @brief Convert Timestamp to Number of Ticks * -- cgit v1.2.3