diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-09-28 14:42:12 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-09-28 14:42:12 +0000 |
commit | 3a42e6fd104c3544a677ffbbeda2fd59e1bbb100 (patch) | |
tree | 1fffb6c96058801bb8bdf1723a198d705e40fe91 /cpukit/score/src | |
parent | Housekeeping. (diff) | |
download | rtems-3a42e6fd104c3544a677ffbbeda2fd59e1bbb100.tar.bz2 |
2011-09-28 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1914/cpukit
* score/src/timespecgreaterthan.c, score/src/ts64greaterthan.c:
Removed files.
* score/Makefile.am: Reflect changes above.
* score/include/rtems/score/timespec.h,
score/include/rtems/score/timestamp.h,
score/include/rtems/score/timestamp64.h, score/src/ts64addto.c,
score/src/ts64divide.c, score/src/ts64dividebyinteger.c,
score/src/ts64equalto.c, score/src/ts64getnanoseconds.c,
score/src/ts64getseconds.c, score/src/ts64lessthan.c,
score/src/ts64set.c, score/src/ts64settozero.c,
score/src/ts64subtract.c, score/src/ts64toticks.c,
score/src/ts64totimespec.c: Use CPU_TIMESTAMP_USE_STRUCT_TIMESPEC,
CPU_TIMESTAMP_USE_INT64, and CPU_TIMESTAMP_USE_INT64_INLINE. Removed
copy and paste.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r-- | cpukit/score/src/timespecgreaterthan.c | 42 | ||||
-rw-r--r-- | cpukit/score/src/ts64addto.c | 12 | ||||
-rw-r--r-- | cpukit/score/src/ts64divide.c | 4 | ||||
-rw-r--r-- | cpukit/score/src/ts64dividebyinteger.c | 14 | ||||
-rw-r--r-- | cpukit/score/src/ts64equalto.c | 12 | ||||
-rw-r--r-- | cpukit/score/src/ts64getnanoseconds.c | 10 | ||||
-rw-r--r-- | cpukit/score/src/ts64getseconds.c | 10 | ||||
-rw-r--r-- | cpukit/score/src/ts64greaterthan.c | 34 | ||||
-rw-r--r-- | cpukit/score/src/ts64lessthan.c | 12 | ||||
-rw-r--r-- | cpukit/score/src/ts64set.c | 12 | ||||
-rw-r--r-- | cpukit/score/src/ts64settozero.c | 8 | ||||
-rw-r--r-- | cpukit/score/src/ts64subtract.c | 14 | ||||
-rw-r--r-- | cpukit/score/src/ts64toticks.c | 3 | ||||
-rw-r--r-- | cpukit/score/src/ts64totimespec.c | 13 |
14 files changed, 38 insertions, 162 deletions
diff --git a/cpukit/score/src/timespecgreaterthan.c b/cpukit/score/src/timespecgreaterthan.c deleted file mode 100644 index b0e7870ac6..0000000000 --- a/cpukit/score/src/timespecgreaterthan.c +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file score/src/timespecgreaterthan.c - */ - -/* - * COPYRIGHT (c) 1989-2007. - * 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. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/types.h> - -#include <rtems/system.h> -#include <rtems/score/timespec.h> -#include <rtems/score/tod.h> - -bool _Timespec_Greater_than( - const struct timespec *lhs, - const struct timespec *rhs -) -{ - if ( lhs->tv_sec > rhs->tv_sec ) - return true; - - if ( lhs->tv_sec < rhs->tv_sec ) - return false; - - /* ASSERT: lhs->tv_sec == rhs->tv_sec */ - if ( lhs->tv_nsec > rhs->tv_nsec ) - return true; - - return false; -} diff --git a/cpukit/score/src/ts64addto.c b/cpukit/score/src/ts64addto.c index 14439de0f3..35ff8e3698 100644 --- a/cpukit/score/src/ts64addto.c +++ b/cpukit/score/src/ts64addto.c @@ -17,18 +17,14 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE void _Timestamp64_Add_to( - Timestamp64_Control *_time, - Timestamp64_Control *_add + Timestamp64_Control *_time, + const Timestamp64_Control *_add ) { - *_time += *_add; + _Timestamp64_implementation_Add_to( _time, _add ); } #endif diff --git a/cpukit/score/src/ts64divide.c b/cpukit/score/src/ts64divide.c index 01e2661ac4..284a4f75a1 100644 --- a/cpukit/score/src/ts64divide.c +++ b/cpukit/score/src/ts64divide.c @@ -17,12 +17,10 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <sys/types.h> #include <rtems/score/timestamp.h> /* This method is never inlined. */ -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) +#if CPU_TIMESTAMP_USE_INT64 == TRUE || CPU_TIMESTAMP_USE_INT64_INLINE == TRUE void _Timestamp64_Divide( const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, diff --git a/cpukit/score/src/ts64dividebyinteger.c b/cpukit/score/src/ts64dividebyinteger.c index f815078322..72a9d65f1d 100644 --- a/cpukit/score/src/ts64dividebyinteger.c +++ b/cpukit/score/src/ts64dividebyinteger.c @@ -17,19 +17,15 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE void _Timestamp64_Divide_by_integer( - Timestamp64_Control *_time, - uint32_t _iterations, - Timestamp64_Control *_result + const Timestamp64_Control *_time, + uint32_t _iterations, + Timestamp64_Control *_result ) { - *_result = *_time / _iterations; + _Timestamp64_implementation_Divide_by_integer( _time, _iterations, _result ); } #endif diff --git a/cpukit/score/src/ts64equalto.c b/cpukit/score/src/ts64equalto.c index d6c9eca998..5172d0b2ad 100644 --- a/cpukit/score/src/ts64equalto.c +++ b/cpukit/score/src/ts64equalto.c @@ -17,18 +17,14 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE bool _Timestamp64_Equal_to( - Timestamp64_Control *_lhs, - Timestamp64_Control *_rhs + const Timestamp64_Control *_lhs, + const Timestamp64_Control *_rhs ) { - return (*(_lhs) == *(_rhs)); + _Timestamp64_implementation_Equal_to( _lhs, _rhs ); } #endif diff --git a/cpukit/score/src/ts64getnanoseconds.c b/cpukit/score/src/ts64getnanoseconds.c index f9d57a9ab1..6ab9b47892 100644 --- a/cpukit/score/src/ts64getnanoseconds.c +++ b/cpukit/score/src/ts64getnanoseconds.c @@ -17,17 +17,13 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE uint32_t _Timestamp64_Get_nanoseconds( - Timestamp64_Control *_time + const Timestamp64_Control *_time ) { - return *(_time) % 1000000000; + _Timestamp64_implementation_Get_nanoseconds( _time ); } #endif diff --git a/cpukit/score/src/ts64getseconds.c b/cpukit/score/src/ts64getseconds.c index f459ee07a5..54db036bcc 100644 --- a/cpukit/score/src/ts64getseconds.c +++ b/cpukit/score/src/ts64getseconds.c @@ -17,17 +17,13 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE uint32_t _Timestamp64_Get_seconds( - Timestamp64_Control *_time + const Timestamp64_Control *_time ) { - return *(_time) / 1000000000; + _Timestamp64_implementation_Get_seconds( _time ); } #endif diff --git a/cpukit/score/src/ts64greaterthan.c b/cpukit/score/src/ts64greaterthan.c deleted file mode 100644 index 571adca4c1..0000000000 --- a/cpukit/score/src/ts64greaterthan.c +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @file score/src/ts64greaterthan.c -*/ - -/* - * COPYRIGHT (c) 1989-2008. - * 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. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/types.h> - -#include <rtems/system.h> -#include <rtems/score/timestamp.h> - -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) -bool _Timestamp64_Greater_than( - Timestamp64_Control *_lhs, - Timestamp64_Control *_rhs -) -{ - return (*(_lhs) > *(_rhs)); -} -#endif diff --git a/cpukit/score/src/ts64lessthan.c b/cpukit/score/src/ts64lessthan.c index 1df5eb11f8..e0d6519c16 100644 --- a/cpukit/score/src/ts64lessthan.c +++ b/cpukit/score/src/ts64lessthan.c @@ -17,18 +17,14 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE bool _Timestamp64_Less_than( - Timestamp64_Control *_lhs, - Timestamp64_Control *_rhs + const Timestamp64_Control *_lhs, + const Timestamp64_Control *_rhs ) { - return (*(_lhs) < *(_rhs)); + _Timestamp64_implementation_Less_than( _lhs, _rhs ); } #endif diff --git a/cpukit/score/src/ts64set.c b/cpukit/score/src/ts64set.c index f4ed3c40e7..2a3aaca8fe 100644 --- a/cpukit/score/src/ts64set.c +++ b/cpukit/score/src/ts64set.c @@ -17,23 +17,15 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE void _Timestamp64_Set( Timestamp64_Control *_time, long _seconds, long _nanoseconds ) { - int64_t time; - - time = (int64_t)_seconds * 1000000000; - time += (int64_t)_nanoseconds; - *_time = time; + _Timestamp64_implementation_Set( _time, _seconds, _nanoseconds ); } #endif diff --git a/cpukit/score/src/ts64settozero.c b/cpukit/score/src/ts64settozero.c index f5cd78194d..b017e3e860 100644 --- a/cpukit/score/src/ts64settozero.c +++ b/cpukit/score/src/ts64settozero.c @@ -17,17 +17,13 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE void _Timestamp64_Set_to_zero( Timestamp64_Control *_time ) { - *_time = 0; + _Timestamp64_implementation_Set_to_zero( _time ); } #endif diff --git a/cpukit/score/src/ts64subtract.c b/cpukit/score/src/ts64subtract.c index be7445b2e6..a1ed20ed89 100644 --- a/cpukit/score/src/ts64subtract.c +++ b/cpukit/score/src/ts64subtract.c @@ -17,19 +17,15 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE void _Timestamp64_Subtract( - Timestamp64_Control *_start, - Timestamp64_Control *_end, - Timestamp64_Control *_result + const Timestamp64_Control *_start, + const Timestamp64_Control *_end, + Timestamp64_Control *_result ) { - *_result = *_end - *_start; + _Timestamp64_implementation_Subtract( _start, _end, _result ); } #endif diff --git a/cpukit/score/src/ts64toticks.c b/cpukit/score/src/ts64toticks.c index 273bcc15b4..f028f8892f 100644 --- a/cpukit/score/src/ts64toticks.c +++ b/cpukit/score/src/ts64toticks.c @@ -24,8 +24,7 @@ #include <rtems/score/timestamp.h> #include <rtems/score/tod.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE uint32_t _Timestamp64_To_ticks( const Timestamp64_Control *time ) diff --git a/cpukit/score/src/ts64totimespec.c b/cpukit/score/src/ts64totimespec.c index 92c2b690bc..b93c1db55d 100644 --- a/cpukit/score/src/ts64totimespec.c +++ b/cpukit/score/src/ts64totimespec.c @@ -17,19 +17,14 @@ #include "config.h" #endif -#include <sys/types.h> - -#include <rtems/system.h> #include <rtems/score/timestamp.h> -#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \ - !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE) +#if CPU_TIMESTAMP_USE_INT64 == TRUE void _Timestamp64_To_timespec( - Timestamp64_Control *_timestamp, - struct timespec *_timespec + const Timestamp64_Control *_timestamp, + struct timespec *_timespec ) { - _timespec->tv_sec = *_timestamp / 1000000000; - _timespec->tv_nsec = *_timestamp % 1000000000; + _Timestamp64_implementation_To_timespec( _timestamp, _timespec ); } #endif |