rtems: Inline _Rate_monotonic_Reset_statistics()

Use inline function instead of macro.
This commit is contained in:
Sebastian Huber
2016-03-21 10:36:20 +01:00
parent be88976440
commit 610e87d3c2

View File

@@ -171,51 +171,24 @@ void _Rate_monotonic_Restart(
Rate_monotonic_Control *the_period Rate_monotonic_Control *the_period
); );
/** RTEMS_INLINE_ROUTINE void _Rate_monotonic_Reset_min_time(
* @brief _Rate_monotonic_Reset_wall_time_statistics Timestamp_Control *min_time
* )
* This method resets the statistics information for a period instance. {
*/ _Timestamp_Set( min_time, 0x7fffffff, 0x7fffffff );
#define _Rate_monotonic_Reset_wall_time_statistics( _the_period ) \ }
do { \
/* set the minimums to a large value */ \
_Timestamp_Set( \
&(_the_period)->Statistics.min_wall_time, \
0x7fffffff, \
0x7fffffff \
); \
} while (0)
/** RTEMS_INLINE_ROUTINE void _Rate_monotonic_Reset_statistics(
* @brief Rate_monotonic_Reset_cpu_use_statistics Rate_monotonic_Control *the_period
* )
* This helper method resets the period CPU usage statistics structure. {
*/ Rate_monotonic_Statistics *statistics;
#define _Rate_monotonic_Reset_cpu_use_statistics( _the_period ) \
do { \
/* set the minimums to a large value */ \
_Timestamp_Set( \
&(_the_period)->Statistics.min_cpu_time, \
0x7fffffff, \
0x7fffffff \
); \
} while (0)
/** statistics = &the_period->Statistics;
* @brief Rate_monotonic_Reset_statistics memset( statistics, 0, sizeof( *statistics ) );
* _Rate_monotonic_Reset_min_time( &statistics->min_wall_time );
* This helper method resets the period wall time statistics structure. _Rate_monotonic_Reset_min_time( &statistics->min_cpu_time );
*/ }
#define _Rate_monotonic_Reset_statistics( _the_period ) \
do { \
memset( \
&(_the_period)->Statistics, \
0, \
sizeof( rtems_rate_monotonic_period_statistics ) \
); \
_Rate_monotonic_Reset_cpu_use_statistics( _the_period ); \
_Rate_monotonic_Reset_wall_time_statistics( _the_period ); \
} while (0)
/**@}*/ /**@}*/