From 1e51fa5f4de9f15a99e3cb1fd1787f1861304e7e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 29 Jul 2013 17:25:50 +0200 Subject: score: Add and use _Thread_Update_cpu_time_used() Fix _times(). --- cpukit/score/src/threaddispatch.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'cpukit/score/src/threaddispatch.c') diff --git a/cpukit/score/src/threaddispatch.c b/cpukit/score/src/threaddispatch.c index c5d0a2199b..09b5dbe105 100644 --- a/cpukit/score/src/threaddispatch.c +++ b/cpukit/score/src/threaddispatch.c @@ -105,17 +105,10 @@ void _Thread_Dispatch( void ) _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ - { - Timestamp_Control uptime, ran; - _TOD_Get_uptime( &uptime ); - _Timestamp_Subtract( - &_Thread_Time_of_last_context_switch, - &uptime, - &ran - ); - _Timestamp_Add_to( &executing->cpu_time_used, &ran ); - _Thread_Time_of_last_context_switch = uptime; - } + _Thread_Update_cpu_time_used( + executing, + &_Thread_Time_of_last_context_switch + ); #else { _TOD_Get_uptime( &_Thread_Time_of_last_context_switch ); -- cgit v1.2.3