summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/tod.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-08 19:41:31 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-08 19:41:31 +0000
commitc16bcc009b3bec9f653cefbe5247ef9d74352833 (patch)
treebbe12a1ed854be9a8ab090f774b0fc096bb76cc9 /cpukit/score/include/rtems/score/tod.h
parent2008-12-08 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-c16bcc009b3bec9f653cefbe5247ef9d74352833.tar.bz2
2008-12-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/__times.c, libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c, posix/src/clockgettime.c, posix/src/pthread.c, posix/src/timersettime.c, rtems/include/rtems/rtems/ratemon.h, rtems/src/clockgetsecondssinceepoch.c, rtems/src/clockgetuptime.c, rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c, rtems/src/ratemonreportstatistics.c, rtems/src/taskwakewhen.c, rtems/src/timerfirewhen.c, rtems/src/timerserver.c, rtems/src/timerserverfirewhen.c, score/Makefile.am, score/preinstall.am, score/include/rtems/score/thread.h, score/include/rtems/score/tod.h, score/src/coretod.c, score/src/coretodget.c, score/src/coretodgetuptime.c, score/src/coretodset.c, score/src/coretodtickle.c, score/src/threaddispatch.c, score/src/threadinitialize.c: Add SuperCore handler Timestamp to provide an opaque class for the representation and manipulation of uptime, time of day, and the difference between two timestamps. By using SuperCore Timestamp, it is clear which methods and APIs really have to be struct timespec and which can be in an optimized native format. * score/include/rtems/score/timestamp.h, score/src/coretodgetuptimetimespec.c: New files.
Diffstat (limited to 'cpukit/score/include/rtems/score/tod.h')
-rw-r--r--cpukit/score/include/rtems/score/tod.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h
index 6038b686d5..44d4df862e 100644
--- a/cpukit/score/include/rtems/score/tod.h
+++ b/cpukit/score/include/rtems/score/tod.h
@@ -23,7 +23,7 @@
extern "C" {
#endif
-#include <rtems/score/object.h>
+#include <rtems/score/timestamp.h>
#include <time.h>
/** @defgroup ScoreTODConstants TOD Constants
@@ -134,18 +134,19 @@ SCORE_EXTERN bool _TOD_Is_set;
/** @brief Current Time of Day (Timespec)
* The following contains the current time of day.
*/
-SCORE_EXTERN struct timespec _TOD_Now;
+SCORE_EXTERN Timestamp_Control _TOD_Now;
/** @brief Current Time of Day (Timespec)
* The following contains the running uptime.
*/
-SCORE_EXTERN struct timespec _TOD_Uptime;
+SCORE_EXTERN Timestamp_Control _TOD_Uptime;
/** @brief Seconds Since RTEMS Epoch
* The following contains the number of seconds from 00:00:00
* January 1, TOD_BASE_YEAR until the current time of day.
*/
-#define _TOD_Seconds_since_epoch (_TOD_Now.tv_sec)
+#define _TOD_Seconds_since_epoch() \
+ _Timestamp_Get_seconds(&_TOD_Now)
/** @brief Microseconds per Clock Tick
*
@@ -189,6 +190,17 @@ void _TOD_Get(
* @param[in] time is a pointer to the uptime to be returned
*/
void _TOD_Get_uptime(
+ Timestamp_Control *time
+);
+
+/** @brief _TOD_Get_uptime_as_timespec
+ *
+ * This routine returns the system uptime with potential accuracy
+ * to the nanosecond.
+ *
+ * @param[in] time is a pointer to the uptime to be returned
+ */
+void _TOD_Get_uptime_as_timespec(
struct timespec *time
);