changed _TOD_Is_set from a function to a boolean variable

This commit is contained in:
Joel Sherrill
1996-09-06 15:16:19 +00:00
parent 65c421ffc5
commit 7fea679b6f
20 changed files with 47 additions and 86 deletions

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -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 ) )

View File

@@ -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;

View File

@@ -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 ) )

View File

@@ -67,6 +67,13 @@ typedef struct { /* RTEID style time/date */
unsigned32 ticks; /* elapsed ticks between secs */
} 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.
*/

View File

@@ -67,6 +67,13 @@ typedef struct { /* RTEID style time/date */
unsigned32 ticks; /* elapsed ticks between secs */
} 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.
*/

View File

@@ -17,21 +17,6 @@
#ifndef __TIME_OF_DAY_inl
#define __TIME_OF_DAY_inl
/*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

View File

@@ -17,21 +17,6 @@
#ifndef __TIME_OF_DAY_inl
#define __TIME_OF_DAY_inl
/*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

View File

@@ -17,15 +17,6 @@
#ifndef __TIME_OF_DAY_inl
#define __TIME_OF_DAY_inl
/*PAGE
*
* _TOD_Is_set
*
*/
#define _TOD_Is_set() \
_Watchdog_Is_active( &_TOD_Seconds_watchdog )
/*PAGE
*
* _TOD_Tickle_ticks

View File

@@ -17,15 +17,6 @@
#ifndef __TIME_OF_DAY_inl
#define __TIME_OF_DAY_inl
/*PAGE
*
* _TOD_Is_set
*
*/
#define _TOD_Is_set() \
_Watchdog_Is_active( &_TOD_Seconds_watchdog )
/*PAGE
*
* _TOD_Tickle_ticks

View File

@@ -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();

View File

@@ -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();

View File

@@ -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 );

View File

@@ -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 ) )

View File

@@ -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;

View File

@@ -67,6 +67,13 @@ typedef struct { /* RTEID style time/date */
unsigned32 ticks; /* elapsed ticks between secs */
} 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.
*/

View File

@@ -17,21 +17,6 @@
#ifndef __TIME_OF_DAY_inl
#define __TIME_OF_DAY_inl
/*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

View File

@@ -17,15 +17,6 @@
#ifndef __TIME_OF_DAY_inl
#define __TIME_OF_DAY_inl
/*PAGE
*
* _TOD_Is_set
*
*/
#define _TOD_Is_set() \
_Watchdog_Is_active( &_TOD_Seconds_watchdog )
/*PAGE
*
* _TOD_Tickle_ticks

View File

@@ -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();