diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-25 15:10:11 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-26 11:55:47 +0200 |
commit | 88c74ab115b5135d4d93050596905d6ee573dd1e (patch) | |
tree | 395b852dd384040e20a6f178e913dddccac436bf /cpukit/score/src | |
parent | score: Create object implementation header (diff) | |
download | rtems-88c74ab115b5135d4d93050596905d6ee573dd1e.tar.bz2 |
score: Merge tod implementation into one file
Delete TOD_MICROSECONDS_PER_SECOND, TOD_MICROSECONDS_TO_TICKS() and
TOD_MILLISECONDS_TO_TICKS().
Diffstat (limited to 'cpukit/score/src')
-rw-r--r-- | cpukit/score/src/coretod.c | 3 | ||||
-rw-r--r-- | cpukit/score/src/coretodget.c | 1 | ||||
-rw-r--r-- | cpukit/score/src/coretodgetuptimetimespec.c | 3 | ||||
-rw-r--r-- | cpukit/score/src/coretodmsecstoticks.c | 44 | ||||
-rw-r--r-- | cpukit/score/src/coretodset.c | 5 | ||||
-rw-r--r-- | cpukit/score/src/coretodtickle.c | 3 | ||||
-rw-r--r-- | cpukit/score/src/coretodtickspersec.c | 3 | ||||
-rw-r--r-- | cpukit/score/src/coretodusectoticks.c | 44 | ||||
-rw-r--r-- | cpukit/score/src/timespecaddto.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/timespecdivide.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/timespecdividebyinteger.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/timespecfromticks.c | 5 | ||||
-rw-r--r-- | cpukit/score/src/timespecisvalid.c | 3 | ||||
-rw-r--r-- | cpukit/score/src/timespeclessthan.c | 1 | ||||
-rw-r--r-- | cpukit/score/src/timespecsubtract.c | 3 | ||||
-rw-r--r-- | cpukit/score/src/timespectoticks.c | 6 | ||||
-rw-r--r-- | cpukit/score/src/ts64toticks.c | 1 |
17 files changed, 5 insertions, 126 deletions
diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c index 2f664b4b45..1dcf19fea7 100644 --- a/cpukit/score/src/coretod.c +++ b/cpukit/score/src/coretod.c @@ -18,10 +18,7 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/thread.h> #include <rtems/score/tod.h> -#include <rtems/score/watchdog.h> void _TOD_Handler_initialization(void) { diff --git a/cpukit/score/src/coretodget.c b/cpukit/score/src/coretodget.c index e58b9fee95..3e2cb4f4de 100644 --- a/cpukit/score/src/coretodget.c +++ b/cpukit/score/src/coretodget.c @@ -19,6 +19,7 @@ #endif #include <rtems/score/tod.h> +#include <rtems/score/isrlevel.h> #include <rtems/score/watchdogimpl.h> Timestamp_Control *_TOD_Get_with_nanoseconds( diff --git a/cpukit/score/src/coretodgetuptimetimespec.c b/cpukit/score/src/coretodgetuptimetimespec.c index 500acfd479..16e519e36b 100644 --- a/cpukit/score/src/coretodgetuptimetimespec.c +++ b/cpukit/score/src/coretodgetuptimetimespec.c @@ -18,9 +18,6 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/isr.h> -#include <rtems/score/timestamp.h> #include <rtems/score/tod.h> void _TOD_Get_uptime_as_timespec( diff --git a/cpukit/score/src/coretodmsecstoticks.c b/cpukit/score/src/coretodmsecstoticks.c deleted file mode 100644 index c55338ee47..0000000000 --- a/cpukit/score/src/coretodmsecstoticks.c +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file - * - * @brief Convert Microseconds to Ticks - * - * @ingroup ScoreTODConstants - */ - -/* COPYRIGHT (c) 1989-2011. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <rtems/system.h> -#include <rtems/config.h> -#include <rtems/score/tod.h> - -uint32_t TOD_MILLISECONDS_TO_TICKS( - uint32_t milliseconds -) -{ - uint32_t ticks; - uint32_t milliseconds_per_tick; - - /** - * We should ensure the ticks not be truncated by integer division. We - * need to have it be greater than or equal to the requested time. It - * should not be shorter. - */ - milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick(); - ticks = milliseconds / milliseconds_per_tick; - if ( (milliseconds % milliseconds_per_tick) != 0 ) - ticks += 1; - - return ticks; -} diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c index 5c5e9c452c..23ba2e6ce8 100644 --- a/cpukit/score/src/coretodset.c +++ b/cpukit/score/src/coretodset.c @@ -18,11 +18,8 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/thread.h> -#include <rtems/score/threaddispatch.h> -#include <rtems/score/timestamp.h> #include <rtems/score/tod.h> +#include <rtems/score/threaddispatch.h> #include <rtems/score/watchdogimpl.h> void _TOD_Set_with_timestamp( diff --git a/cpukit/score/src/coretodtickle.c b/cpukit/score/src/coretodtickle.c index d55c054a82..41644b980c 100644 --- a/cpukit/score/src/coretodtickle.c +++ b/cpukit/score/src/coretodtickle.c @@ -18,9 +18,6 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/thread.h> -#include <rtems/score/timestamp.h> #include <rtems/score/tod.h> #include <rtems/score/watchdogimpl.h> #include <rtems/config.h> diff --git a/cpukit/score/src/coretodtickspersec.c b/cpukit/score/src/coretodtickspersec.c index 3dc792a6d3..58e7e04c88 100644 --- a/cpukit/score/src/coretodtickspersec.c +++ b/cpukit/score/src/coretodtickspersec.c @@ -18,9 +18,8 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/config.h> #include <rtems/score/tod.h> +#include <rtems/config.h> uint32_t TOD_TICKS_PER_SECOND_method(void) { diff --git a/cpukit/score/src/coretodusectoticks.c b/cpukit/score/src/coretodusectoticks.c deleted file mode 100644 index 60d08b9280..0000000000 --- a/cpukit/score/src/coretodusectoticks.c +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file - * - * @brief Converts Microseconds to Ticks - * - * @ingroup ScoreTOD - */ - -/* COPYRIGHT (c) 1989-2011. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <rtems/system.h> -#include <rtems/config.h> -#include <rtems/score/tod.h> - -uint32_t TOD_MICROSECONDS_TO_TICKS( - uint32_t microseconds -) -{ - uint32_t ticks; - uint32_t microseconds_per_tick; - - /** - * We should ensure the ticks not be truncated by integer division. We - * need to have it be greater than or equal to the requested time. It - * should not be shorter. - */ - microseconds_per_tick = rtems_configuration_get_microseconds_per_tick(); - ticks = microseconds / microseconds_per_tick; - if ( (microseconds % microseconds_per_tick) != 0 ) - ticks += 1; - - return ticks; -} diff --git a/cpukit/score/src/timespecaddto.c b/cpukit/score/src/timespecaddto.c index a71e1d63bf..a1d6c871c0 100644 --- a/cpukit/score/src/timespecaddto.c +++ b/cpukit/score/src/timespecaddto.c @@ -18,8 +18,6 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <sys/types.h> #include <rtems/score/timespec.h> #include <rtems/score/tod.h> #include <rtems/score/watchdog.h> diff --git a/cpukit/score/src/timespecdivide.c b/cpukit/score/src/timespecdivide.c index e889dac1c9..3434fdf7f1 100644 --- a/cpukit/score/src/timespecdivide.c +++ b/cpukit/score/src/timespecdivide.c @@ -18,8 +18,6 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <sys/types.h> #include <rtems/score/timespec.h> #include <rtems/score/tod.h> diff --git a/cpukit/score/src/timespecdividebyinteger.c b/cpukit/score/src/timespecdividebyinteger.c index 33d21643ff..6d97dcbc41 100644 --- a/cpukit/score/src/timespecdividebyinteger.c +++ b/cpukit/score/src/timespecdividebyinteger.c @@ -19,8 +19,6 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <sys/types.h> #include <rtems/score/timespec.h> #include <rtems/score/tod.h> diff --git a/cpukit/score/src/timespecfromticks.c b/cpukit/score/src/timespecfromticks.c index dc11fbf3cd..3e994a03f2 100644 --- a/cpukit/score/src/timespecfromticks.c +++ b/cpukit/score/src/timespecfromticks.c @@ -18,12 +18,9 @@ #include "config.h" #endif -#include <time.h> - -#include <rtems/system.h> -#include <rtems/config.h> #include <rtems/score/timespec.h> #include <rtems/score/tod.h> +#include <rtems/config.h> void _Timespec_From_ticks( uint32_t ticks, diff --git a/cpukit/score/src/timespecisvalid.c b/cpukit/score/src/timespecisvalid.c index 4a0a247ba9..61dce72830 100644 --- a/cpukit/score/src/timespecisvalid.c +++ b/cpukit/score/src/timespecisvalid.c @@ -18,9 +18,6 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timespec.h> #include <rtems/score/tod.h> diff --git a/cpukit/score/src/timespeclessthan.c b/cpukit/score/src/timespeclessthan.c index c120ae97b6..885f40bb82 100644 --- a/cpukit/score/src/timespeclessthan.c +++ b/cpukit/score/src/timespeclessthan.c @@ -22,7 +22,6 @@ #include <rtems/system.h> #include <rtems/score/timespec.h> -#include <rtems/score/tod.h> bool _Timespec_Less_than( const struct timespec *lhs, diff --git a/cpukit/score/src/timespecsubtract.c b/cpukit/score/src/timespecsubtract.c index 391cbc0a90..8d29f17197 100644 --- a/cpukit/score/src/timespecsubtract.c +++ b/cpukit/score/src/timespecsubtract.c @@ -18,11 +18,8 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <sys/types.h> #include <rtems/score/timespec.h> #include <rtems/score/tod.h> -#include <rtems/score/watchdog.h> void _Timespec_Subtract( const struct timespec *start, diff --git a/cpukit/score/src/timespectoticks.c b/cpukit/score/src/timespectoticks.c index 4fe22f03f7..12eaadaa96 100644 --- a/cpukit/score/src/timespectoticks.c +++ b/cpukit/score/src/timespectoticks.c @@ -15,13 +15,9 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> -#include <rtems/config.h> #include <rtems/score/timespec.h> #include <rtems/score/tod.h> -#include <rtems/score/watchdog.h> +#include <rtems/config.h> /** * diff --git a/cpukit/score/src/ts64toticks.c b/cpukit/score/src/ts64toticks.c index f1b97587d2..365198dd26 100644 --- a/cpukit/score/src/ts64toticks.c +++ b/cpukit/score/src/ts64toticks.c @@ -23,7 +23,6 @@ #include <rtems/system.h> #include <rtems/config.h> #include <rtems/score/timestamp.h> -#include <rtems/score/tod.h> #if CPU_TIMESTAMP_USE_INT64 == TRUE uint32_t _Timestamp64_To_ticks( |