[PATCH 3/5] score: Add and use _TOD_Is_set()

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jul 31 13:15:12 UTC 2013


---
 cpukit/rtems/src/clockgetsecondssinceepoch.c |    2 +-
 cpukit/rtems/src/clockgettod.c               |    2 +-
 cpukit/rtems/src/clockgettodtimeval.c        |    2 +-
 cpukit/rtems/src/taskwakewhen.c              |    2 +-
 cpukit/rtems/src/timerfirewhen.c             |    2 +-
 cpukit/rtems/src/timerserverfirewhen.c       |    2 +-
 cpukit/score/include/rtems/score/todimpl.h   |    5 +++++
 7 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/cpukit/rtems/src/clockgetsecondssinceepoch.c b/cpukit/rtems/src/clockgetsecondssinceepoch.c
index f8265c4..469d351 100644
--- a/cpukit/rtems/src/clockgetsecondssinceepoch.c
+++ b/cpukit/rtems/src/clockgetsecondssinceepoch.c
@@ -28,7 +28,7 @@ rtems_status_code rtems_clock_get_seconds_since_epoch(
   if ( !the_interval )
     return RTEMS_INVALID_ADDRESS;
 
-  if ( !_TOD.is_set )
+  if ( !_TOD_Is_set() )
     return RTEMS_NOT_DEFINED;
 
   *the_interval = _TOD_Seconds_since_epoch();
diff --git a/cpukit/rtems/src/clockgettod.c b/cpukit/rtems/src/clockgettod.c
index 41d29d4..e0aebe4 100644
--- a/cpukit/rtems/src/clockgettod.c
+++ b/cpukit/rtems/src/clockgettod.c
@@ -33,7 +33,7 @@ rtems_status_code rtems_clock_get_tod(
   if ( !time_buffer )
     return RTEMS_INVALID_ADDRESS;
 
-  if ( !_TOD.is_set )
+  if ( !_TOD_Is_set() )
     return RTEMS_NOT_DEFINED;
 
   /* Obtain the current time */
diff --git a/cpukit/rtems/src/clockgettodtimeval.c b/cpukit/rtems/src/clockgettodtimeval.c
index a742fc4..570e4bc 100644
--- a/cpukit/rtems/src/clockgettodtimeval.c
+++ b/cpukit/rtems/src/clockgettodtimeval.c
@@ -28,7 +28,7 @@ rtems_status_code rtems_clock_get_tod_timeval(
   if ( !time )
     return RTEMS_INVALID_ADDRESS;
 
-  if ( !_TOD.is_set )
+  if ( !_TOD_Is_set() )
     return RTEMS_NOT_DEFINED;
 
   _TOD_Get_timeval( time );
diff --git a/cpukit/rtems/src/taskwakewhen.c b/cpukit/rtems/src/taskwakewhen.c
index a63c496..64156da 100644
--- a/cpukit/rtems/src/taskwakewhen.c
+++ b/cpukit/rtems/src/taskwakewhen.c
@@ -30,7 +30,7 @@ rtems_status_code rtems_task_wake_when(
 {
   Watchdog_Interval   seconds;
 
-  if ( !_TOD.is_set )
+  if ( !_TOD_Is_set() )
     return RTEMS_NOT_DEFINED;
 
   if ( !time_buffer )
diff --git a/cpukit/rtems/src/timerfirewhen.c b/cpukit/rtems/src/timerfirewhen.c
index 68da48a..799742d 100644
--- a/cpukit/rtems/src/timerfirewhen.c
+++ b/cpukit/rtems/src/timerfirewhen.c
@@ -34,7 +34,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/cpukit/rtems/src/timerserverfirewhen.c b/cpukit/rtems/src/timerserverfirewhen.c
index 43f4fcf..9b97f05 100644
--- a/cpukit/rtems/src/timerserverfirewhen.c
+++ b/cpukit/rtems/src/timerserverfirewhen.c
@@ -55,7 +55,7 @@ rtems_status_code rtems_timer_server_fire_when(
   if ( !timer_server )
     return RTEMS_INCORRECT_STATE;
 
-  if ( !_TOD.is_set )
+  if ( !_TOD_Is_set() )
     return RTEMS_NOT_DEFINED;
 
   if ( !routine )
diff --git a/cpukit/score/include/rtems/score/todimpl.h b/cpukit/score/include/rtems/score/todimpl.h
index 34db063..0e2da2f 100644
--- a/cpukit/score/include/rtems/score/todimpl.h
+++ b/cpukit/score/include/rtems/score/todimpl.h
@@ -300,6 +300,11 @@ RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(
   _Timestamp_To_timeval( snapshot_as_timestamp_ptr, time );
 }
 
+RTEMS_INLINE_ROUTINE bool _TOD_Is_set( void )
+{
+  return _TOD.is_set;
+}
+
 /**@}*/
 
 #ifdef __cplusplus
-- 
1.7.7




More information about the devel mailing list