summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coretodtickle.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-04-04 13:54:10 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-04-04 13:54:10 +0000
commitfc054cabb5bed1dfd99a3fa96297ba3293dd9f1d (patch)
tree2f8a54da1dedcc1f47081589b0773a1b7a0c7350 /cpukit/score/src/coretodtickle.c
parent2007-04-02 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-fc054cabb5bed1dfd99a3fa96297ba3293dd9f1d.tar.bz2
2007-04-04 Joel Sherrill <joel@OARcorp.com>
* score/Makefile.am, score/include/rtems/score/tod.h, score/inline/rtems/score/tod.inl: Make _TOD_Tickle_ticks a real non-inlined routine. It should only be used once so there is little advantage to inlining it. * score/src/coretodtickle.c: New file.
Diffstat (limited to 'cpukit/score/src/coretodtickle.c')
-rw-r--r--cpukit/score/src/coretodtickle.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/cpukit/score/src/coretodtickle.c b/cpukit/score/src/coretodtickle.c
new file mode 100644
index 0000000000..a9b12646f4
--- /dev/null
+++ b/cpukit/score/src/coretodtickle.c
@@ -0,0 +1,59 @@
+
+/*
+ * Time of Day (TOD) Handler -- Tickle Ticks
+ *
+ * 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 <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/tod.h>
+#include <rtems/score/watchdog.h>
+
+/*PAGE
+ *
+ * _TOD_Tickle_ticks
+ *
+ * This routine processes a clock tick.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ */
+
+void _TOD_Tickle_ticks( void )
+{
+ struct timespec tick;
+ uint32_t seconds;
+
+ /* Convert the tick quantum to a timespec */
+ tick.tv_nsec = _TOD_Microseconds_per_tick * 1000;
+ tick.tv_sec = 0;
+
+ /* Update the counter of ticks since boot */
+ _Watchdog_Ticks_since_boot += 1;
+
+ /* Update the timespec format uptime */
+ (void) _TOD_Add_timespec( &_TOD_Uptime, &tick );
+ /* we do not care how much the uptime changed */
+
+ /* Update the timespec format TOD */
+ seconds = _TOD_Add_timespec( &_TOD_Now, &tick );
+ while ( seconds ) {
+ _Watchdog_Tickle_seconds();
+ seconds--;
+ }
+}
+