summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2003-08-14 20:25:28 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2003-08-14 20:25:28 +0000
commit236b701440721cac9487ecee0dd7d8d8055e3db0 (patch)
tree89a675e7ba8bc38c234bfcd4fd5ea7cf828ebd0b /cpukit/libmisc
parentCorrecting to include PR numbers. (diff)
downloadrtems-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')
-rw-r--r--cpukit/libmisc/ChangeLog9
-rw-r--r--cpukit/libmisc/cpuuse/cpuuse.c31
2 files changed, 17 insertions, 23 deletions
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 <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.
+
2003-08-14 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* 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);
}