Changeset 610e87d in rtems


Ignore:
Timestamp:
Mar 21, 2016, 9:36:20 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
300eaad
Parents:
be88976
Message:

rtems: Inline _Rate_monotonic_Reset_statistics()

Use inline function instead of macro.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/include/rtems/rtems/ratemonimpl.h

    rbe88976 r610e87d  
    172172);
    173173
    174 /**
    175  *  @brief _Rate_monotonic_Reset_wall_time_statistics
    176  *
    177  *  This method resets the statistics information for a period instance.
    178  */
    179 #define _Rate_monotonic_Reset_wall_time_statistics( _the_period ) \
    180    do { \
    181       /* set the minimums to a large value */ \
    182       _Timestamp_Set( \
    183         &(_the_period)->Statistics.min_wall_time, \
    184         0x7fffffff, \
    185         0x7fffffff \
    186       ); \
    187    } while (0)
    188 
    189 /**
    190  *  @brief Rate_monotonic_Reset_cpu_use_statistics
    191  *
    192  *  This helper method resets the period CPU usage statistics structure.
    193  */
    194 #define _Rate_monotonic_Reset_cpu_use_statistics( _the_period ) \
    195    do { \
    196       /* set the minimums to a large value */ \
    197       _Timestamp_Set( \
    198         &(_the_period)->Statistics.min_cpu_time, \
    199         0x7fffffff, \
    200         0x7fffffff \
    201       ); \
    202    } while (0)
    203 
    204 /**
    205  *  @brief Rate_monotonic_Reset_statistics
    206  *
    207  *  This helper method resets the period wall time statistics structure.
    208  */
    209 #define _Rate_monotonic_Reset_statistics( _the_period ) \
    210   do { \
    211     memset( \
    212       &(_the_period)->Statistics, \
    213       0, \
    214       sizeof( rtems_rate_monotonic_period_statistics ) \
    215     ); \
    216     _Rate_monotonic_Reset_cpu_use_statistics( _the_period ); \
    217     _Rate_monotonic_Reset_wall_time_statistics( _the_period ); \
    218   } while (0)
     174RTEMS_INLINE_ROUTINE void _Rate_monotonic_Reset_min_time(
     175  Timestamp_Control *min_time
     176)
     177{
     178  _Timestamp_Set( min_time, 0x7fffffff, 0x7fffffff );
     179}
     180
     181RTEMS_INLINE_ROUTINE void _Rate_monotonic_Reset_statistics(
     182  Rate_monotonic_Control *the_period
     183)
     184{
     185  Rate_monotonic_Statistics *statistics;
     186
     187  statistics = &the_period->Statistics;
     188  memset( statistics, 0, sizeof( *statistics ) );
     189  _Rate_monotonic_Reset_min_time( &statistics->min_wall_time );
     190  _Rate_monotonic_Reset_min_time( &statistics->min_cpu_time );
     191}
    219192
    220193/**@}*/
Note: See TracChangeset for help on using the changeset viewer.