summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/coretod.c2
-rw-r--r--cpukit/score/src/coretodmsecstoticks.c25
-rw-r--r--cpukit/score/src/coretodtickle.c3
-rw-r--r--cpukit/score/src/coretodtickspersec.c24
-rw-r--r--cpukit/score/src/coretodusectoticks.c25
5 files changed, 76 insertions, 3 deletions
diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c
index cf4ec8e334..6d0fc11b5a 100644
--- a/cpukit/score/src/coretod.c
+++ b/cpukit/score/src/coretod.c
@@ -38,8 +38,6 @@ void _TOD_Handler_initialization(
uint32_t microseconds_per_tick
)
{
- _TOD_Microseconds_per_tick = microseconds_per_tick;
-
/* POSIX format TOD (timespec) */
_Timestamp_Set( &_TOD_Now, TOD_SECONDS_1970_THROUGH_1988, 0 );
diff --git a/cpukit/score/src/coretodmsecstoticks.c b/cpukit/score/src/coretodmsecstoticks.c
new file mode 100644
index 0000000000..cddd3d646d
--- /dev/null
+++ b/cpukit/score/src/coretodmsecstoticks.c
@@ -0,0 +1,25 @@
+/* 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 <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/score/tod.h>
+
+uint32_t TOD_MILLISECONDS_TO_TICKS(
+ uint32_t milliseconds
+)
+{
+ return (milliseconds / rtems_configuration_get_milliseconds_per_tick());
+}
diff --git a/cpukit/score/src/coretodtickle.c b/cpukit/score/src/coretodtickle.c
index f4e5a4f69c..ddc8e4aac0 100644
--- a/cpukit/score/src/coretodtickle.c
+++ b/cpukit/score/src/coretodtickle.c
@@ -22,6 +22,7 @@
#include <rtems/score/timestamp.h>
#include <rtems/score/tod.h>
#include <rtems/score/watchdog.h>
+#include <rtems/config.h>
/*PAGE
*
@@ -40,7 +41,7 @@ void _TOD_Tickle_ticks( void )
uint32_t seconds;
/* Convert the tick quantum to a timestamp */
- _Timestamp_Set( &tick, 0, _TOD_Microseconds_per_tick * 1000 );
+ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() );
/* Update the counter of ticks since boot */
_Watchdog_Ticks_since_boot += 1;
diff --git a/cpukit/score/src/coretodtickspersec.c b/cpukit/score/src/coretodtickspersec.c
new file mode 100644
index 0000000000..ac6316ba7b
--- /dev/null
+++ b/cpukit/score/src/coretodtickspersec.c
@@ -0,0 +1,24 @@
+/* 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 <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/score/tod.h>
+
+uint32_t TOD_TICKS_PER_SECOND_method(void)
+{
+ return (TOD_MICROSECONDS_PER_SECOND /
+ rtems_configuration_get_microseconds_per_tick());
+}
diff --git a/cpukit/score/src/coretodusectoticks.c b/cpukit/score/src/coretodusectoticks.c
new file mode 100644
index 0000000000..be2cbd7024
--- /dev/null
+++ b/cpukit/score/src/coretodusectoticks.c
@@ -0,0 +1,25 @@
+/* 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 <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/score/tod.h>
+
+uint32_t TOD_MICROSECONDS_TO_TICKS(
+ uint32_t microseconds
+)
+{
+ return (microseconds / rtems_configuration_get_microseconds_per_tick());
+}