summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2010-12-16 14:50:12 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2010-12-16 14:50:12 +0000
commit18657d189dbd7e56db2894cb78d7ab5a80c2c18f (patch)
tree8abfb63822239f3df800d1b4235662b40a7c864e /cpukit/score/src
parentAdded missing include file. (diff)
downloadrtems-18657d189dbd7e56db2894cb78d7ab5a80c2c18f.tar.bz2
2010-12-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
* score/src/watchdognanoseconds.c: New file. * score/Makefile.am: Reflect change above. * score/include/rtems/score/watchdog.h, score/src/coretodget.c, score/src/coretodgetuptime.c: Do not allow NULL as nanoseconds since last tick handler pointer.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/coretodget.c4
-rw-r--r--cpukit/score/src/coretodgetuptime.c4
-rw-r--r--cpukit/score/src/watchdognanoseconds.c31
3 files changed, 33 insertions, 6 deletions
diff --git a/cpukit/score/src/coretodget.c b/cpukit/score/src/coretodget.c
index dff46a0748..953f3cb753 100644
--- a/cpukit/score/src/coretodget.c
+++ b/cpukit/score/src/coretodget.c
@@ -45,11 +45,9 @@ void _TOD_Get(
/* assume time checked for NULL by caller */
/* _TOD_Now is the native current time */
- nanoseconds = 0;
_ISR_Disable( level );
now = _TOD_Now;
- if ( _Watchdog_Nanoseconds_since_tick_handler )
- nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
+ nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
_ISR_Enable( level );
_Timestamp_Set( &offset, 0, nanoseconds );
diff --git a/cpukit/score/src/coretodgetuptime.c b/cpukit/score/src/coretodgetuptime.c
index ea55a25796..c5d940b0c0 100644
--- a/cpukit/score/src/coretodgetuptime.c
+++ b/cpukit/score/src/coretodgetuptime.c
@@ -45,11 +45,9 @@ void _TOD_Get_uptime(
/* assume time checked for NULL by caller */
/* _TOD_Uptime is in native timestamp format */
- nanoseconds = 0;
_ISR_Disable( level );
up = _TOD_Uptime;
- if ( _Watchdog_Nanoseconds_since_tick_handler )
- nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
+ nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
_ISR_Enable( level );
_Timestamp_Set( &offset, 0, nanoseconds );
diff --git a/cpukit/score/src/watchdognanoseconds.c b/cpukit/score/src/watchdognanoseconds.c
new file mode 100644
index 0000000000..b3d3e7b028
--- /dev/null
+++ b/cpukit/score/src/watchdognanoseconds.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * 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/watchdog.h>
+
+Watchdog_Nanoseconds_since_last_tick_routine
+ _Watchdog_Nanoseconds_since_tick_handler =
+ _Watchdog_Nanoseconds_since_tick_default_handler;
+
+uint32_t _Watchdog_Nanoseconds_since_tick_default_handler( void )
+{
+ return 0;
+}