diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-10 16:19:48 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-13 13:39:26 +0200 |
commit | 54cf0e34c5d6b8be0ce136eac7c4e11c1d487d7f (patch) | |
tree | fb6485f659b1fe4204893e9d442f7e5deda96db3 /cpukit/score/src | |
parent | score: Split _Watchdog_Adjust() (diff) | |
download | rtems-54cf0e34c5d6b8be0ce136eac7c4e11c1d487d7f.tar.bz2 |
score: Add Watchdog_Header
This type is intended to encapsulate all state to manage a watchdog
chain.
Update #2307.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r-- | cpukit/score/src/coretodset.c | 4 | ||||
-rw-r--r-- | cpukit/score/src/watchdog.c | 6 | ||||
-rw-r--r-- | cpukit/score/src/watchdogadjust.c | 8 | ||||
-rw-r--r-- | cpukit/score/src/watchdogadjusttochain.c | 13 | ||||
-rw-r--r-- | cpukit/score/src/watchdoginsert.c | 6 | ||||
-rw-r--r-- | cpukit/score/src/watchdogtickle.c | 9 |
6 files changed, 21 insertions, 25 deletions
diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c index 8c4ef8b135..7c7731aae0 100644 --- a/cpukit/score/src/coretodset.c +++ b/cpukit/score/src/coretodset.c @@ -31,12 +31,12 @@ void _TOD_Set_with_timestamp( Watchdog_Interval seconds_next = _Timestamp_Get_seconds( tod_as_timestamp ); Watchdog_Interval seconds_now; ISR_lock_Context lock_context; - Chain_Control *header; + Watchdog_Header *header; _Thread_Disable_dispatch(); seconds_now = _TOD_Seconds_since_epoch(); - header = &_Watchdog_Seconds_chain; + header = &_Watchdog_Seconds_header; if ( seconds_next < seconds_now ) _Watchdog_Adjust_backward( header, seconds_now - seconds_next ); diff --git a/cpukit/score/src/watchdog.c b/cpukit/score/src/watchdog.c index 4b093d52e1..0db60efe6b 100644 --- a/cpukit/score/src/watchdog.c +++ b/cpukit/score/src/watchdog.c @@ -21,8 +21,6 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/isr.h> #include <rtems/score/watchdogimpl.h> void _Watchdog_Handler_initialization( void ) @@ -31,6 +29,6 @@ void _Watchdog_Handler_initialization( void ) _Watchdog_Sync_level = 0; _Watchdog_Ticks_since_boot = 0; - _Chain_Initialize_empty( &_Watchdog_Ticks_chain ); - _Chain_Initialize_empty( &_Watchdog_Seconds_chain ); + _Watchdog_Header_initialize( &_Watchdog_Ticks_header ); + _Watchdog_Header_initialize( &_Watchdog_Seconds_header ); } diff --git a/cpukit/score/src/watchdogadjust.c b/cpukit/score/src/watchdogadjust.c index 5d841049dc..687f063482 100644 --- a/cpukit/score/src/watchdogadjust.c +++ b/cpukit/score/src/watchdogadjust.c @@ -23,7 +23,7 @@ #include <rtems/score/isrlevel.h> void _Watchdog_Adjust_backward( - Chain_Control *header, + Watchdog_Header *header, Watchdog_Interval units ) { @@ -31,7 +31,7 @@ void _Watchdog_Adjust_backward( _ISR_Disable( level ); - if ( !_Chain_Is_empty( header ) ) { + if ( !_Watchdog_Is_empty( header ) ) { _Watchdog_First( header )->delta_interval += units; } @@ -39,7 +39,7 @@ void _Watchdog_Adjust_backward( } void _Watchdog_Adjust_forward( - Chain_Control *header, + Watchdog_Header *header, Watchdog_Interval units ) { @@ -47,7 +47,7 @@ void _Watchdog_Adjust_forward( _ISR_Disable( level ); - while ( !_Chain_Is_empty( header ) && units > 0 ) { + while ( !_Watchdog_Is_empty( header ) && units > 0 ) { Watchdog_Control *first = _Watchdog_First( header ); if ( units < first->delta_interval ) { diff --git a/cpukit/score/src/watchdogadjusttochain.c b/cpukit/score/src/watchdogadjusttochain.c index 1cddcbc637..1926656ca3 100644 --- a/cpukit/score/src/watchdogadjusttochain.c +++ b/cpukit/score/src/watchdogadjusttochain.c @@ -18,14 +18,13 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/isr.h> #include <rtems/score/watchdogimpl.h> +#include <rtems/score/isrlevel.h> void _Watchdog_Adjust_to_chain( - Chain_Control *header, - Watchdog_Interval units_arg, - Chain_Control *to_fire + Watchdog_Header *header, + Watchdog_Interval units_arg, + Chain_Control *to_fire ) { @@ -36,7 +35,7 @@ void _Watchdog_Adjust_to_chain( _ISR_Disable( level ); while ( 1 ) { - if ( _Chain_Is_empty( header ) ) { + if ( _Watchdog_Is_empty( header ) ) { break; } first = _Watchdog_First( header ); @@ -63,7 +62,7 @@ void _Watchdog_Adjust_to_chain( _ISR_Flash( level ); - if ( _Chain_Is_empty( header ) ) + if ( _Watchdog_Is_empty( header ) ) break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) diff --git a/cpukit/score/src/watchdoginsert.c b/cpukit/score/src/watchdoginsert.c index 3169c80a37..272cac8db1 100644 --- a/cpukit/score/src/watchdoginsert.c +++ b/cpukit/score/src/watchdoginsert.c @@ -18,12 +18,12 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/isr.h> #include <rtems/score/watchdogimpl.h> +#include <rtems/score/isrlevel.h> +#include <rtems/score/percpu.h> void _Watchdog_Insert( - Chain_Control *header, + Watchdog_Header *header, Watchdog_Control *the_watchdog ) { diff --git a/cpukit/score/src/watchdogtickle.c b/cpukit/score/src/watchdogtickle.c index 8e410a5399..8c1a3a74b9 100644 --- a/cpukit/score/src/watchdogtickle.c +++ b/cpukit/score/src/watchdogtickle.c @@ -18,12 +18,11 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/isr.h> #include <rtems/score/watchdogimpl.h> +#include <rtems/score/isrlevel.h> void _Watchdog_Tickle( - Chain_Control *header + Watchdog_Header *header ) { ISR_Level level; @@ -38,7 +37,7 @@ void _Watchdog_Tickle( _ISR_Disable( level ); - if ( _Chain_Is_empty( header ) ) + if ( _Watchdog_Is_empty( header ) ) goto leave; the_watchdog = _Watchdog_First( header ); @@ -110,7 +109,7 @@ void _Watchdog_Tickle( _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); - } while ( !_Chain_Is_empty( header ) && + } while ( !_Watchdog_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: |