summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coretod.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/coretod.c')
-rw-r--r--cpukit/score/src/coretod.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c
new file mode 100644
index 0000000000..4da8dd4b4f
--- /dev/null
+++ b/cpukit/score/src/coretod.c
@@ -0,0 +1,47 @@
+/*
+ * Time of Day (TOD) Handler
+ */
+
+/* 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/score/object.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/tod.h>
+#include <rtems/score/watchdog.h>
+
+/*PAGE
+ *
+ * _TOD_Handler_initialization
+ *
+ * This routine initializes the time of day handler.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ */
+
+void _TOD_Handler_initialization(void)
+{
+ /* POSIX format TOD (timespec) */
+ _Timestamp_Set( &_TOD_Now, TOD_SECONDS_1970_THROUGH_1988, 0 );
+
+ /* Uptime (timespec) */
+ _Timestamp_Set_to_zero( &_TOD_Uptime );
+
+ /* TOD has not been set */
+ _TOD_Is_set = false;
+ _TOD_Activate();
+}