summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-05-31 23:27:45 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-05-31 23:27:45 +0000
commit5e7b6272fc10068c22bfedb18a26a23a37e9a7ff (patch)
tree16be850e6b7abcabe3b503f7c3669ddcef0b0805 /cpukit/score
parentadded checks to validate values passed to set attribute routines (diff)
downloadrtems-5e7b6272fc10068c22bfedb18a26a23a37e9a7ff.tar.bz2
renamed _TOD_Ticks_since_boot as _Watchdog_Ticks_since_boot so the Watchdog
Handler could timestamp the starting and stopping of timers. Since TOD is built on top of Watchdog, this avoided a circular dependency.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/include/rtems/score/tod.h7
-rw-r--r--cpukit/score/include/rtems/score/watchdog.h9
-rw-r--r--cpukit/score/inline/rtems/score/tod.inl2
-rw-r--r--cpukit/score/macros/rtems/score/tod.inl2
-rw-r--r--cpukit/score/src/coretod.c1
-rw-r--r--cpukit/score/src/watchdog.c6
6 files changed, 17 insertions, 10 deletions
diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h
index a1fc6ee446..3788a74256 100644
--- a/cpukit/score/include/rtems/score/tod.h
+++ b/cpukit/score/include/rtems/score/tod.h
@@ -81,13 +81,6 @@ SCORE_EXTERN TOD_Control _TOD_Current;
SCORE_EXTERN Watchdog_Interval _TOD_Seconds_since_epoch;
/*
- * The following contains the number of ticks since the
- * system was booted.
- */
-
-SCORE_EXTERN Watchdog_Interval _TOD_Ticks_since_boot;
-
-/*
* The following contains the number of microseconds per tick.
*/
diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h
index 8a43be1f1f..c77d9f1307 100644
--- a/cpukit/score/include/rtems/score/watchdog.h
+++ b/cpukit/score/include/rtems/score/watchdog.h
@@ -82,6 +82,8 @@ typedef struct {
Watchdog_States state;
Watchdog_Interval initial;
Watchdog_Interval delta_interval;
+ Watchdog_Interval start_time;
+ Watchdog_Interval stop_time;
Watchdog_Service_routine_entry routine;
Objects_Id id;
void *user_data;
@@ -96,6 +98,13 @@ SCORE_EXTERN volatile unsigned32 _Watchdog_Sync_level;
SCORE_EXTERN volatile unsigned32 _Watchdog_Sync_count;
/*
+ * The following contains the number of ticks since the
+ * system was booted.
+ */
+
+SCORE_EXTERN Watchdog_Interval _Watchdog_Ticks_since_boot;
+
+/*
* The following defines the watchdog chains which are managed
* on ticks and second boundaries.
*/
diff --git a/cpukit/score/inline/rtems/score/tod.inl b/cpukit/score/inline/rtems/score/tod.inl
index 5ed1e76d8f..3892dbdb98 100644
--- a/cpukit/score/inline/rtems/score/tod.inl
+++ b/cpukit/score/inline/rtems/score/tod.inl
@@ -45,7 +45,7 @@ STATIC INLINE boolean _TOD_Is_set( void )
STATIC INLINE void _TOD_Tickle_ticks( void )
{
_TOD_Current.ticks += 1;
- _TOD_Ticks_since_boot += 1;
+ _Watchdog_Ticks_since_boot += 1;
}
/*PAGE
diff --git a/cpukit/score/macros/rtems/score/tod.inl b/cpukit/score/macros/rtems/score/tod.inl
index ecab4e6eae..63c50bc515 100644
--- a/cpukit/score/macros/rtems/score/tod.inl
+++ b/cpukit/score/macros/rtems/score/tod.inl
@@ -34,7 +34,7 @@
#define _TOD_Tickle_ticks() \
_TOD_Current.ticks++; \
- _TOD_Ticks_since_boot++
+ _Watchdog_Ticks_since_boot++
/*PAGE
*
diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c
index 1a11034ceb..8c7fb93d79 100644
--- a/cpukit/score/src/coretod.c
+++ b/cpukit/score/src/coretod.c
@@ -37,7 +37,6 @@ void _TOD_Handler_initialization(
{
_TOD_Microseconds_per_tick = microseconds_per_tick;
- _TOD_Ticks_since_boot = 0;
_TOD_Seconds_since_epoch = 0;
_TOD_Current.year = TOD_BASE_YEAR;
diff --git a/cpukit/score/src/watchdog.c b/cpukit/score/src/watchdog.c
index 0f72bd3d5c..2ada0ff71e 100644
--- a/cpukit/score/src/watchdog.c
+++ b/cpukit/score/src/watchdog.c
@@ -32,6 +32,8 @@ void _Watchdog_Handler_initialization( void )
{
_Watchdog_Sync_count = 0;
_Watchdog_Sync_level = 0;
+ _Watchdog_Ticks_since_boot = 0;
+
_Chain_Initialize_empty( &_Watchdog_Ticks_chain );
_Chain_Initialize_empty( &_Watchdog_Seconds_chain );
}
@@ -82,6 +84,8 @@ Watchdog_States _Watchdog_Remove(
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
+ the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
+
_ISR_Enable( level );
return( previous_state );
}
@@ -200,6 +204,8 @@ restart:
_Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
+ the_watchdog->start_time = _Watchdog_Ticks_since_boot;
+
exit_insert:
_Watchdog_Sync_level = insert_isr_nest_level;
_Watchdog_Sync_count--;