From b43314ae91722c0f74d3e2e2b4d186be9693a4c2 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 28 Jun 2002 18:51:35 +0000 Subject: 2002-06-28 Joel Sherrill * src/__times.c: Cleaned up comments, return more information, and eliminated the fatal error on clock not set since it cannot occur. --- c/src/exec/libcsupport/ChangeLog | 6 ++++++ c/src/exec/libcsupport/src/__times.c | 21 ++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'c') diff --git a/c/src/exec/libcsupport/ChangeLog b/c/src/exec/libcsupport/ChangeLog index 0b329cd4cc..8b29d6c61b 100755 --- a/c/src/exec/libcsupport/ChangeLog +++ b/c/src/exec/libcsupport/ChangeLog @@ -1,3 +1,9 @@ +2002-06-28 Joel Sherrill + + * src/__times.c: Cleaned up comments, return more information, + and eliminated the fatal error on clock not set since it cannot + occur. + 2002-06-27 Ralf Corsepius * configure.ac: Use AC_CONFIG_AUX_DIR(../..). diff --git a/c/src/exec/libcsupport/src/__times.c b/c/src/exec/libcsupport/src/__times.c index eab408e8d3..3b23f3764a 100644 --- a/c/src/exec/libcsupport/src/__times.c +++ b/c/src/exec/libcsupport/src/__times.c @@ -35,25 +35,20 @@ clock_t _times( return -1; } - /* "POSIX" does not seem to allow for not having a TOD */ - status = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks ); - if ( status != RTEMS_SUCCESSFUL ) { - assert( 0 ); - return -1; - } - /* - * RTEMS has no notion of system versus user time and although - * a way to keep track of per task CPU usage was added since - * 3.6.0, this routine does not utilize it yet. + * RTEMS technically has no notion of system versus user time + * since there is no separation of OS from application tasks. + * But we can at least make a distinction between the number + * of ticks since boot and the number of ticks executed by this + * this thread. */ - ptms->tms_utime = ticks; - ptms->tms_stime = 0; + ptms->tms_utime = _Thread_Executing->ticks_executed; + ptms->tms_stime = ticks; ptms->tms_cutime = 0; ptms->tms_cstime = 0; - return 0; + return ticks; } /* -- cgit v1.2.3