diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-26 14:04:22 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-30 09:53:22 +0200 |
commit | ff63d2dbf999a60bf6b112c6fc2328a42a9875d5 (patch) | |
tree | 2f8e5d4882539e09ebc2abc7dfb19a369f1d79e0 /cpukit/libmisc/cpuuse/cpuusagereport.c | |
parent | doc/user/conf.t: More clean ups (diff) | |
download | rtems-ff63d2dbf999a60bf6b112c6fc2328a42a9875d5.tar.bz2 |
smp: Use Thread_Control.is_executing
FIXME: This area needs proper locking.
Diffstat (limited to 'cpukit/libmisc/cpuuse/cpuusagereport.c')
-rw-r--r-- | cpukit/libmisc/cpuuse/cpuusagereport.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cpukit/libmisc/cpuuse/cpuusagereport.c b/cpukit/libmisc/cpuuse/cpuusagereport.c index 14945d7071..fcf7d26be4 100644 --- a/cpukit/libmisc/cpuuse/cpuusagereport.c +++ b/cpukit/libmisc/cpuuse/cpuusagereport.c @@ -41,13 +41,10 @@ return true; } #else - int cpu; - for ( cpu=0 ; cpu < rtems_smp_get_processor_count() ; cpu++ ) { - Per_CPU_Control *p = &_Per_CPU_Information[cpu]; - if ( p->executing->Object.id == the_thread->Object.id ) { - *time_of_context_switch = p->time_of_last_context_switch; - return true; - } + /* FIXME: Locking */ + if ( the_thread->is_executing ) { + *time_of_context_switch = the_thread->cpu->time_of_last_context_switch; + return true; } #endif return false; |