diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2003-08-14 20:25:28 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2003-08-14 20:25:28 +0000 |
commit | 236b701440721cac9487ecee0dd7d8d8055e3db0 (patch) | |
tree | 89a675e7ba8bc38c234bfcd4fd5ea7cf828ebd0b /cpukit/libmisc/cpuuse | |
parent | Correcting to include PR numbers. (diff) | |
download | rtems-236b701440721cac9487ecee0dd7d8d8055e3db0.tar.bz2 |
2003-08-14 Joel Sherrill <joel@OARcorp.com>
PR 408/filesystem
* cpuuse/cpuuse.c: Added sync() service. As part of adding this
service, the new RTEMS service rtems_iterate_over_all_threads() was
also added. This new service makes it easier to iterate over all the
tasks/threads in a system and perform an action on them. This change
is to use the new thread iteration service.
Diffstat (limited to 'cpukit/libmisc/cpuuse')
-rw-r--r-- | cpukit/libmisc/cpuuse/cpuuse.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/cpukit/libmisc/cpuuse/cpuuse.c b/cpukit/libmisc/cpuuse/cpuuse.c index 7818446bab..9679732ee2 100644 --- a/cpukit/libmisc/cpuuse/cpuuse.c +++ b/cpukit/libmisc/cpuuse/cpuuse.c @@ -127,32 +127,17 @@ void CPU_usage_Dump( void ) * CPU_usage_Reset */ +static void CPU_usage_Per_thread_handler( + Thread_Control *the_thread +) +{ + the_thread->ticks_executed = 0; +} + void CPU_usage_Reset( void ) { - unsigned32 i; - unsigned32 api_index; - Thread_Control *the_thread; - Objects_Information *information; - CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot; - for ( api_index = 1 ; - api_index <= OBJECTS_APIS_LAST ; - api_index++ ) { - if ( !_Objects_Information_table[ api_index ] ) - continue; - information = _Objects_Information_table[ api_index ][ 1 ]; - if ( information ) { - for ( i=1 ; i <= information->maximum ; i++ ) { - the_thread = (Thread_Control *)information->local_table[ i ]; - - if ( !the_thread ) - continue; - - the_thread->ticks_executed = 0; - } - } - } - + rtems_iterate_over_all_threads(CPU_usage_Per_thread_handler); } |