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.
This commit is contained in:
Sebastian Huber
2014-03-25 13:19:22 +01:00
parent e72bc923df
commit 9b44339c14
8 changed files with 1 additions and 169 deletions
+1 -1
View File
@@ -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 \
@@ -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
-41
View File
@@ -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 <rtems/system.h>
#include <rtems/score/watchdogimpl.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
);
}
-51
View File
@@ -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 <rtems/score/watchdogimpl.h>
#include <rtems/score/isr.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/bspIo.h>
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();
}
-6
View File
@@ -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 );
@@ -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.
@@ -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 ***
-12
View File
@@ -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" );