summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-11-26 16:38:06 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-11-26 16:38:06 +0000
commitc8f7b4e6ca8c9d1c17f2bf6a6278bc4d406b6835 (patch)
tree905e6115a43c8a635388f24a1c4b4adf055333ea /cpukit/score
parent2008-11-26 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-c8f7b4e6ca8c9d1c17f2bf6a6278bc4d406b6835.tar.bz2
2008-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/Makefile.am, score/include/rtems/score/watchdog.h: Add _Watchdog_Report and _Watchdog_Report_chain as debug assist routines. They are NOT to be used in directives. * score/src/watchdogreport.c, score/src/watchdogreportchain.c: New files.
Diffstat (limited to '')
-rw-r--r--cpukit/score/Makefile.am3
-rw-r--r--cpukit/score/include/rtems/score/watchdog.h40
-rw-r--r--cpukit/score/src/watchdogreport.c41
-rw-r--r--cpukit/score/src/watchdogreportchain.c50
4 files changed, 132 insertions, 2 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index a3a4d603a5..0ea422fce6 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -173,7 +173,8 @@ libscore_a_SOURCES += src/coretod.c src/coretodset.c src/coretodget.c \
## WATCHDOG_C_FILES
libscore_a_SOURCES += src/watchdog.c src/watchdogadjust.c \
- src/watchdoginsert.c src/watchdogremove.c src/watchdogtickle.c
+ src/watchdoginsert.c src/watchdogremove.c src/watchdogtickle.c \
+ src/watchdogreport.c src/watchdogreportchain.c
## USEREXT_C_FILES
libscore_a_SOURCES += src/userextaddapiset.c src/userextaddset.c \
diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h
index a1259ab4c4..5cc1498d5b 100644
--- a/cpukit/score/include/rtems/score/watchdog.h
+++ b/cpukit/score/include/rtems/score/watchdog.h
@@ -240,11 +240,49 @@ void _Watchdog_Insert (
*
* @param[in] header is the watchdog chain to tickle
*/
-
void _Watchdog_Tickle (
Chain_Control *header
);
+/**
+ * @brief Report Information on a Single Watchdog Instance
+ *
+ * This method prints a one line report on the watchdog instance
+ * provided. The @a name may be used to identify the watchdog and
+ * a space will be printed after @a name if it is not NULL.
+ *
+ * @param[in] name is a string to prefix the line with. If NULL,
+ * nothing is printed.
+ * @param[in] watch is the watchdog instance to be printed.
+ *
+ * @note This is a debug routine. It uses printk() and prudence should
+ * exercised when using it.
+ */
+void _Watchdog_Report(
+ const char *name,
+ Watchdog_Control *watch
+);
+
+/**
+ * @brief Report Information on a Watchdog Chain
+ *
+ * This method prints report on the watchdog chain provided.
+ * The @a name may be used to identify the watchdog chain and
+ * a space will be printed after @a name if it is not NULL.
+ *
+ * @param[in] name is a string to prefix the line with. If NULL,
+ * nothing is printed.
+ * @param[in] watch is the watchdog chain to be printed.
+ *
+ * @note This is a debug routine. It uses printk() and prudence should
+ * exercised when using it. It also disables interrupts so the
+ * chain can be traversed in a single atomic pass.
+ */
+void _Watchdog_Report_chain(
+ const char *name,
+ Chain_Control *header
+);
+
#ifndef __RTEMS_APPLICATION__
#include <rtems/score/watchdog.inl>
#endif
diff --git a/cpukit/score/src/watchdogreport.c b/cpukit/score/src/watchdogreport.c
new file mode 100644
index 0000000000..fb1885aa4e
--- /dev/null
+++ b/cpukit/score/src/watchdogreport.c
@@ -0,0 +1,41 @@
+/**
+ * @file watchdogreport.c
+ *
+ * This should only be used for debugging.
+ */
+
+/* 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/watchdog.h>
+#include <rtems/bspIo.h>
+
+void _Watchdog_Report(
+ const char *name,
+ Watchdog_Control *watch
+)
+{
+ printk(
+ "%s%s%4d %5d %p %p 0x%08x %p\n",
+ ((name) ? name : ""),
+ ((name) ? " " : ""),
+ watch->delta_interval,
+ watch->initial,
+ watch,
+ watch->routine,
+ watch->id,
+ watch->user_data
+ );
+}
diff --git a/cpukit/score/src/watchdogreportchain.c b/cpukit/score/src/watchdogreportchain.c
new file mode 100644
index 0000000000..20a5827f97
--- /dev/null
+++ b/cpukit/score/src/watchdogreportchain.c
@@ -0,0 +1,50 @@
+/**
+ * @file watchdogreportchain.c
+ *
+ * This should only be used for debugging.
+ */
+
+/* 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/watchdog.h>
+#include <rtems/score/isr.h>
+#include <rtems/bspIo.h>
+
+void _Watchdog_Report_chain(
+ const char *name,
+ Chain_Control *header
+)
+{
+ ISR_Level level;
+ Chain_Node *node;
+
+ _ISR_Disable( level );
+ printk( "Watchdog Chain: %s %p\n", name, header );
+ if ( !_Chain_Is_empty( header ) ) {
+ for ( node = header->first ;
+ node != _Chain_Tail(header) ;
+ node = node->next )
+ {
+ Watchdog_Control *watch = (Watchdog_Control *) node;
+
+ _Watchdog_Report( NULL, watch );
+ }
+ printk( "== end of %s \n", name );
+ } else {
+ printk( "Chain is empty\n" );
+ }
+ _ISR_Enable( level );
+}