diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-12-10 22:13:28 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-12-10 22:13:28 +0000 |
commit | 9dc2c8d16e3d54daeb394d71b2455da114bbd5c9 (patch) | |
tree | 7e70e439c02af44198c2c9d3f1d490e865ae2ab9 /cpukit/rtems/src/ratemongetstatus.c | |
parent | 2008-12-09 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-9dc2c8d16e3d54daeb394d71b2455da114bbd5c9.tar.bz2 |
2008-12-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/include/rtems/rtems/ratemon.h,
rtems/include/rtems/rtems/types.h, rtems/src/ratemongetstatistics.c,
rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c,
rtems/src/ratemonreportstatistics.c,
score/include/rtems/score/thread.h, score/src/coretodgetuptime.c:
Make all Thread and Period Statistics use publicly defined types. Do
not leak the SuperCore Timestamp type through the APIs.
Diffstat (limited to 'cpukit/rtems/src/ratemongetstatus.c')
-rw-r--r-- | cpukit/rtems/src/ratemongetstatus.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/cpukit/rtems/src/ratemongetstatus.c b/cpukit/rtems/src/ratemongetstatus.c index 59b39e2917..eb307dad6a 100644 --- a/cpukit/rtems/src/ratemongetstatus.c +++ b/cpukit/rtems/src/ratemongetstatus.c @@ -52,6 +52,11 @@ rtems_status_code rtems_rate_monotonic_get_status( { Objects_Locations location; Rate_monotonic_Control *the_period; + #if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS) || \ + defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) + Timestamp_Control uptime; + Timestamp_Control temp; + #endif if ( !status ) return RTEMS_INVALID_ADDRESS; @@ -65,12 +70,12 @@ rtems_status_code rtems_rate_monotonic_get_status( if ( status->state == RATE_MONOTONIC_INACTIVE ) { #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS - _Timestamp_Set_to_zero( &status->since_last_period ); + _Timespec_Set_to_zero( &status->since_last_period ); #else status->since_last_period = 0; #endif #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS - _Timestamp_Set_to_zero( &status->executed_since_last_period ); + _Timespec_Set_to_zero( &status->executed_since_last_period ); #else status->executed_since_last_period = 0; #endif @@ -81,16 +86,12 @@ rtems_status_code rtems_rate_monotonic_get_status( */ #if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS) || \ defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) - Timestamp_Control uptime; _TOD_Get_uptime( &uptime ); #endif #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS - _Timestamp_Subtract( - &the_period->time_at_period, - &uptime, - &status->since_last_period - ); + _Timestamp_Subtract( &the_period->time_at_period, &uptime, &temp ); + _Timestamp_To_timespec( &temp, &status->since_last_period ); #else status->since_last_period = _Watchdog_Ticks_since_boot - the_period->time_at_period; @@ -100,8 +101,9 @@ rtems_status_code rtems_rate_monotonic_get_status( _Timestamp_Subtract( &_Thread_Time_of_last_context_switch, &uptime, - &status->executed_since_last_period + &temp ); + _Timestamp_To_timespec( &temp, &status->executed_since_last_period ); #else status->executed_since_last_period = the_period->owner->cpu_time_used - |