From 9b44339c14391b36fc53172a678c40b65f23f966 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 24 Mar 2014 07:53:45 +0100 Subject: score: Delete _Watchdog_Report() Delete _Watchdog_Report_chain(). These two functions use printk() with thread dispatching and interrupts disabled. So they are pretty useless in real applications. They are not part of the application APIs. They are only used in one test and do nothing useful in this test. --- cpukit/score/Makefile.am | 2 +- cpukit/score/include/rtems/score/watchdogimpl.h | 39 ------------------- cpukit/score/src/watchdogreport.c | 41 -------------------- cpukit/score/src/watchdogreportchain.c | 51 ------------------------- testsuites/sptests/spwatchdog/init.c | 6 --- testsuites/sptests/spwatchdog/spwatchdog.doc | 4 -- testsuites/sptests/spwatchdog/spwatchdog.scn | 15 -------- testsuites/sptests/spwatchdog/task1.c | 12 ------ 8 files changed, 1 insertion(+), 169 deletions(-) delete mode 100644 cpukit/score/src/watchdogreport.c delete mode 100644 cpukit/score/src/watchdogreportchain.c diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index aeee4b6b32..ed69b9b84b 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -321,7 +321,7 @@ 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/watchdogadjusttochain.c src/watchdoginsert.c src/watchdogremove.c \ - src/watchdogtickle.c src/watchdogreport.c src/watchdogreportchain.c + src/watchdogtickle.c ## USEREXT_C_FILES libscore_a_SOURCES += src/userextaddset.c \ diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h index 2709805e84..72b6b3b568 100644 --- a/cpukit/score/include/rtems/score/watchdogimpl.h +++ b/cpukit/score/include/rtems/score/watchdogimpl.h @@ -196,45 +196,6 @@ 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] header 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 -); - /** * This routine initializes the specified watchdog. The watchdog is * made inactive, the watchdog id and handler routine are set to the diff --git a/cpukit/score/src/watchdogreport.c b/cpukit/score/src/watchdogreport.c deleted file mode 100644 index 550be49a68..0000000000 --- a/cpukit/score/src/watchdogreport.c +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file watchdogreport.c - * - * @brief Report Information on a Single Watchdog Instance - * @ingroup ScoreWatchdog - */ - -/* - * 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.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -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 deleted file mode 100644 index edbc78197c..0000000000 --- a/cpukit/score/src/watchdogreportchain.c +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file - * - * @brief Report Information on a Watchdog Chain - * @ingroup ScoreWatchdog - */ - -/* 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.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -void _Watchdog_Report_chain( - const char *name, - Chain_Control *header -) -{ - ISR_Level level; - Chain_Node *node; - - _Thread_Disable_dispatch(); - _ISR_Disable( level ); - printk( "Watchdog Chain: %s %p\n", name, header ); - if ( !_Chain_Is_empty( header ) ) { - for ( node = _Chain_First( header ) ; - 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 ); - _Thread_Enable_dispatch(); -} diff --git a/testsuites/sptests/spwatchdog/init.c b/testsuites/sptests/spwatchdog/init.c index c104aecc0a..2b1bc3d83a 100644 --- a/testsuites/sptests/spwatchdog/init.c +++ b/testsuites/sptests/spwatchdog/init.c @@ -53,17 +53,11 @@ rtems_task Init( { rtems_time_of_day time; rtems_status_code status; - Chain_Control empty; TEST_BEGIN(); - puts( "INIT - report on empty watchdog chain" ); - test_watchdog_static_init(); - _Chain_Initialize_empty( &empty ); - _Watchdog_Report_chain( "Empty Chain", &empty ); - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); status = rtems_clock_set( &time ); diff --git a/testsuites/sptests/spwatchdog/spwatchdog.doc b/testsuites/sptests/spwatchdog/spwatchdog.doc index b5dd6cf512..b8080b2ea5 100644 --- a/testsuites/sptests/spwatchdog/spwatchdog.doc +++ b/testsuites/sptests/spwatchdog/spwatchdog.doc @@ -12,12 +12,8 @@ test set name: spwatchdog directives: - SCORE _Watchdog_Report - SCORE _Watchdog_Report_chain various timer, delay, and clock services concepts: + Ensure that the SCORE Watchdog routines operate properly. - -+ Ensure that the SCORE Watchdog reporting routines operate properly. diff --git a/testsuites/sptests/spwatchdog/spwatchdog.scn b/testsuites/sptests/spwatchdog/spwatchdog.scn index 622e99e8d2..15f85b5899 100644 --- a/testsuites/sptests/spwatchdog/spwatchdog.scn +++ b/testsuites/sptests/spwatchdog/spwatchdog.scn @@ -1,7 +1,4 @@ *** RTEMS WATCHDOG *** -INIT - report on empty watchdog chain -Watchdog Chain: Empty Chain 203753 -Chain is empt INIT - rtems_timer_create - creating timer 1 INIT - timer 1 has id (0x12010001) TA1 - rtems_timer_ident - identing timer 1 @@ -14,17 +11,5 @@ TA1 - rtems_timer_fire_after - timer 1 in 3 seconds TA1 - rtems_task_wake_after - 1 second TA1 - rtems_clock_get_tod - 09:00:04 12/31/1988 TA1 - rtems_timer_reset - timer 1 -TA1 - _Watchdog_Report_chain - with name -Watchdog Chain: _Watchdog_Ticks_chain 2030F1 - 300 300 2033B40 201391C 0x12010001 -== end of _Watchdog_Ticks_chain -TA1 - _Watchdog_Report_chain - no name -Watchdog Chain: 2030F1 - 300 300 2033B40 201391C 0x12010001 -== end of -TA1 - _Watchdog_Report - with name -first 300 300 2033B40 201391C 0x12010001 -TA1 - _Watchdog_Report - no name - 299 300 2033B40 201391C 0x12010001 TA1 - timer_deleting - timer 1 *** END OF RTEMS WATCHDOG PROGRAM *** diff --git a/testsuites/sptests/spwatchdog/task1.c b/testsuites/sptests/spwatchdog/task1.c index f17ae9d171..568ad86197 100644 --- a/testsuites/sptests/spwatchdog/task1.c +++ b/testsuites/sptests/spwatchdog/task1.c @@ -77,18 +77,6 @@ rtems_task Task_1( status = rtems_timer_reset( tmid ); directive_failed( status, "rtems_timer_reset" ); - puts( "TA1 - _Watchdog_Report_chain - with name" ); - _Watchdog_Report_chain( "_Watchdog_Ticks_chain", & _Watchdog_Ticks_chain ); - - puts( "TA1 - _Watchdog_Report_chain - no name" ); - _Watchdog_Report_chain( NULL, & _Watchdog_Ticks_chain); - - puts( "TA1 - _Watchdog_Report - with name" ); - _Watchdog_Report("first", (Watchdog_Control *)_Chain_First(&_Watchdog_Ticks_chain)); - - puts( "TA1 - _Watchdog_Report - no name" ); - _Watchdog_Report( NULL, (Watchdog_Control *)_Chain_First(&_Watchdog_Ticks_chain) ); - puts( "TA1 - timer_deleting - timer 1" ); status = rtems_timer_delete( tmid ); directive_failed( status, "rtems_timer_delete" ); -- cgit v1.2.3