From 16db540a59d92a2006ddb7d32e2f8727dfec22ca Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 12 Oct 2017 07:23:51 +0200 Subject: Use right time format in _times() Update #2740. Close #3179. --- cpukit/libcsupport/src/__times.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cpukit/libcsupport/src/__times.c b/cpukit/libcsupport/src/__times.c index 0aa7f26480..1cdd831f37 100644 --- a/cpukit/libcsupport/src/__times.c +++ b/cpukit/libcsupport/src/__times.c @@ -43,11 +43,9 @@ clock_t _times( struct tms *ptms ) { - uint32_t tick_interval; - struct bintime binuptime; - sbintime_t uptime; - struct bintime bin_cpu_time_used; - sbintime_t cpu_time_used; + uint32_t tick_interval; + sbintime_t uptime; + sbintime_t cpu_time_used; if ( !ptms ) rtems_set_errno_and_return_minus_one( EFAULT ); @@ -57,8 +55,7 @@ clock_t _times( ptms = memset( ptms, 0, sizeof( *ptms ) ); - _TOD_Get_zero_based_uptime( &binuptime ); - uptime = bttosbt( binuptime ); + _TOD_Get_zero_based_uptime( &uptime ); ptms->tms_stime = ((clock_t) uptime) / tick_interval; /* @@ -68,8 +65,7 @@ clock_t _times( * of ticks since boot and the number of ticks executed by this * this thread. */ - _Thread_Get_CPU_time_used( _Thread_Get_executing(), &bin_cpu_time_used ); - cpu_time_used = bttosbt( bin_cpu_time_used ); + _Thread_Get_CPU_time_used( _Thread_Get_executing(), &cpu_time_used ); ptms->tms_utime = ((clock_t) cpu_time_used) / tick_interval; return ptms->tms_stime; -- cgit v1.2.3