From 236b701440721cac9487ecee0dd7d8d8055e3db0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 14 Aug 2003 20:25:28 +0000 Subject: 2003-08-14 Joel Sherrill 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. --- cpukit/libmisc/ChangeLog | 9 +++++++++ cpukit/libmisc/cpuuse/cpuuse.c | 31 ++++++++----------------------- 2 files changed, 17 insertions(+), 23 deletions(-) (limited to 'cpukit/libmisc') diff --git a/cpukit/libmisc/ChangeLog b/cpukit/libmisc/ChangeLog index 715949e214..a86ded102f 100644 --- a/cpukit/libmisc/ChangeLog +++ b/cpukit/libmisc/ChangeLog @@ -1,3 +1,12 @@ +2003-08-14 Joel Sherrill + + 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. + 2003-08-14 Ralf Corsepius * fsmount/Makefile.am: Fix path to automake-includes. 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); } -- cgit v1.2.3