summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/score')
-rw-r--r--c/src/exec/score/headers/tod.h7
-rw-r--r--c/src/exec/score/include/rtems/score/tod.h7
-rw-r--r--c/src/exec/score/inline/rtems/score/tod.inl15
-rw-r--r--c/src/exec/score/inline/tod.inl15
-rw-r--r--c/src/exec/score/macros/rtems/score/tod.inl9
-rw-r--r--c/src/exec/score/macros/tod.inl9
-rw-r--r--c/src/exec/score/src/coretod.c4
-rw-r--r--c/src/exec/score/src/tod.c4
8 files changed, 22 insertions, 48 deletions
diff --git a/c/src/exec/score/headers/tod.h b/c/src/exec/score/headers/tod.h
index 3788a74256..ea7a7855f1 100644
--- a/c/src/exec/score/headers/tod.h
+++ b/c/src/exec/score/headers/tod.h
@@ -68,6 +68,13 @@ typedef struct { /* RTEID style time/date */
} TOD_Control;
/*
+ * The following is TRUE if the application has set the current
+ * time of day, and FALSE otherwise.
+ */
+
+SCORE_EXTERN boolean _TOD_Is_set;
+
+/*
* The following contains the current time of day.
*/
diff --git a/c/src/exec/score/include/rtems/score/tod.h b/c/src/exec/score/include/rtems/score/tod.h
index 3788a74256..ea7a7855f1 100644
--- a/c/src/exec/score/include/rtems/score/tod.h
+++ b/c/src/exec/score/include/rtems/score/tod.h
@@ -68,6 +68,13 @@ typedef struct { /* RTEID style time/date */
} TOD_Control;
/*
+ * The following is TRUE if the application has set the current
+ * time of day, and FALSE otherwise.
+ */
+
+SCORE_EXTERN boolean _TOD_Is_set;
+
+/*
* The following contains the current time of day.
*/
diff --git a/c/src/exec/score/inline/rtems/score/tod.inl b/c/src/exec/score/inline/rtems/score/tod.inl
index 17e7f014e8..5fa9193419 100644
--- a/c/src/exec/score/inline/rtems/score/tod.inl
+++ b/c/src/exec/score/inline/rtems/score/tod.inl
@@ -19,21 +19,6 @@
/*PAGE
*
- * _TOD_Is_set
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the application has set the current
- * time of day, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _TOD_Is_set( void )
-{
- return _Watchdog_Is_active( &_TOD_Seconds_watchdog );
-}
-
-/*PAGE
- *
* _TOD_Tickle_ticks
*
* DESCRIPTION:
diff --git a/c/src/exec/score/inline/tod.inl b/c/src/exec/score/inline/tod.inl
index 17e7f014e8..5fa9193419 100644
--- a/c/src/exec/score/inline/tod.inl
+++ b/c/src/exec/score/inline/tod.inl
@@ -19,21 +19,6 @@
/*PAGE
*
- * _TOD_Is_set
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the application has set the current
- * time of day, and FALSE otherwise.
- */
-
-RTEMS_INLINE_ROUTINE boolean _TOD_Is_set( void )
-{
- return _Watchdog_Is_active( &_TOD_Seconds_watchdog );
-}
-
-/*PAGE
- *
* _TOD_Tickle_ticks
*
* DESCRIPTION:
diff --git a/c/src/exec/score/macros/rtems/score/tod.inl b/c/src/exec/score/macros/rtems/score/tod.inl
index 63c50bc515..17ac5395af 100644
--- a/c/src/exec/score/macros/rtems/score/tod.inl
+++ b/c/src/exec/score/macros/rtems/score/tod.inl
@@ -19,15 +19,6 @@
/*PAGE
*
- * _TOD_Is_set
- *
- */
-
-#define _TOD_Is_set() \
- _Watchdog_Is_active( &_TOD_Seconds_watchdog )
-
-/*PAGE
- *
* _TOD_Tickle_ticks
*
*/
diff --git a/c/src/exec/score/macros/tod.inl b/c/src/exec/score/macros/tod.inl
index 63c50bc515..17ac5395af 100644
--- a/c/src/exec/score/macros/tod.inl
+++ b/c/src/exec/score/macros/tod.inl
@@ -19,15 +19,6 @@
/*PAGE
*
- * _TOD_Is_set
- *
- */
-
-#define _TOD_Is_set() \
- _Watchdog_Is_active( &_TOD_Seconds_watchdog )
-
-/*PAGE
- *
* _TOD_Tickle_ticks
*
*/
diff --git a/c/src/exec/score/src/coretod.c b/c/src/exec/score/src/coretod.c
index 8c7fb93d79..9da6f11510 100644
--- a/c/src/exec/score/src/coretod.c
+++ b/c/src/exec/score/src/coretod.c
@@ -54,6 +54,9 @@ void _TOD_Handler_initialization(
TOD_MICROSECONDS_PER_SECOND / microseconds_per_tick;
_Watchdog_Initialize( &_TOD_Seconds_watchdog, _TOD_Tickle, 0, NULL );
+
+ _TOD_Is_set = FALSE;
+ _TOD_Activate( _TOD_Ticks_per_second );
}
/*PAGE
@@ -93,6 +96,7 @@ void _TOD_Set(
_TOD_Current = *the_tod;
_TOD_Seconds_since_epoch = seconds_since_epoch;
+ _TOD_Is_set = TRUE;
_TOD_Activate( ticks_until_next_second );
_Thread_Enable_dispatch();
diff --git a/c/src/exec/score/src/tod.c b/c/src/exec/score/src/tod.c
index 8c7fb93d79..9da6f11510 100644
--- a/c/src/exec/score/src/tod.c
+++ b/c/src/exec/score/src/tod.c
@@ -54,6 +54,9 @@ void _TOD_Handler_initialization(
TOD_MICROSECONDS_PER_SECOND / microseconds_per_tick;
_Watchdog_Initialize( &_TOD_Seconds_watchdog, _TOD_Tickle, 0, NULL );
+
+ _TOD_Is_set = FALSE;
+ _TOD_Activate( _TOD_Ticks_per_second );
}
/*PAGE
@@ -93,6 +96,7 @@ void _TOD_Set(
_TOD_Current = *the_tod;
_TOD_Seconds_since_epoch = seconds_since_epoch;
+ _TOD_Is_set = TRUE;
_TOD_Activate( ticks_until_next_second );
_Thread_Enable_dispatch();