summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-09-06 15:16:19 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-09-06 15:16:19 +0000
commit7fea679b6f4c376cf068eaee987d3ff4e415b23e (patch)
treebbcdc26257c60b66b264d7b143692104fe4b6757 /c/src
parentdefault thread attributes: default value for inheritsched changed from (diff)
downloadrtems-7fea679b6f4c376cf068eaee987d3ff4e415b23e.tar.bz2
changed _TOD_Is_set from a function to a boolean variable
Diffstat (limited to 'c/src')
-rw-r--r--c/src/exec/rtems/src/clock.c6
-rw-r--r--c/src/exec/rtems/src/rtclock.c6
-rw-r--r--c/src/exec/rtems/src/rtemstimer.c2
-rw-r--r--c/src/exec/rtems/src/tasks.c2
-rw-r--r--c/src/exec/rtems/src/timer.c2
-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
13 files changed, 31 insertions, 57 deletions
diff --git a/c/src/exec/rtems/src/clock.c b/c/src/exec/rtems/src/clock.c
index f73401809c..4b7b5f5b31 100644
--- a/c/src/exec/rtems/src/clock.c
+++ b/c/src/exec/rtems/src/clock.c
@@ -48,14 +48,14 @@ rtems_status_code rtems_clock_get(
switch ( option ) {
case RTEMS_CLOCK_GET_TOD:
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
*(rtems_time_of_day *)time_buffer = _TOD_Current;
return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
*(rtems_interval *)time_buffer = _TOD_Seconds_since_epoch;
@@ -70,7 +70,7 @@ rtems_status_code rtems_clock_get(
return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_TIME_VALUE:
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
_ISR_Disable( level );
diff --git a/c/src/exec/rtems/src/rtclock.c b/c/src/exec/rtems/src/rtclock.c
index f73401809c..4b7b5f5b31 100644
--- a/c/src/exec/rtems/src/rtclock.c
+++ b/c/src/exec/rtems/src/rtclock.c
@@ -48,14 +48,14 @@ rtems_status_code rtems_clock_get(
switch ( option ) {
case RTEMS_CLOCK_GET_TOD:
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
*(rtems_time_of_day *)time_buffer = _TOD_Current;
return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
*(rtems_interval *)time_buffer = _TOD_Seconds_since_epoch;
@@ -70,7 +70,7 @@ rtems_status_code rtems_clock_get(
return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_TIME_VALUE:
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
_ISR_Disable( level );
diff --git a/c/src/exec/rtems/src/rtemstimer.c b/c/src/exec/rtems/src/rtemstimer.c
index 6c3005ffbe..40ee526f26 100644
--- a/c/src/exec/rtems/src/rtemstimer.c
+++ b/c/src/exec/rtems/src/rtemstimer.c
@@ -277,7 +277,7 @@ rtems_status_code rtems_timer_fire_when(
Objects_Locations location;
rtems_interval seconds;
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
if ( !_TOD_Validate( wall_time ) )
diff --git a/c/src/exec/rtems/src/tasks.c b/c/src/exec/rtems/src/tasks.c
index 403a26e0d4..2f78b015f4 100644
--- a/c/src/exec/rtems/src/tasks.c
+++ b/c/src/exec/rtems/src/tasks.c
@@ -1034,7 +1034,7 @@ rtems_time_of_day *time_buffer
{
Watchdog_Interval seconds;
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
time_buffer->ticks = 0;
diff --git a/c/src/exec/rtems/src/timer.c b/c/src/exec/rtems/src/timer.c
index 6c3005ffbe..40ee526f26 100644
--- a/c/src/exec/rtems/src/timer.c
+++ b/c/src/exec/rtems/src/timer.c
@@ -277,7 +277,7 @@ rtems_status_code rtems_timer_fire_when(
Objects_Locations location;
rtems_interval seconds;
- if ( !_TOD_Is_set() )
+ if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
if ( !_TOD_Validate( wall_time ) )
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();