From d541ba3ec0fd2de71ed3f9f2962189a4e6bde297 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 22 Jul 2002 20:26:51 +0000 Subject: 2002-07-22 Jeff Johnston * libc/machine/powerpc/time.c: Removed..renamed to times.c. * libc/machine/powerpc/times.c: New file. * libc/machine/powerpc/Makefile.am: Change time.c to times.c. * libc/machine/powerpc/Makefile.in: Regenerated. --- newlib/libc/machine/powerpc/Makefile.am | 2 +- newlib/libc/machine/powerpc/Makefile.in | 4 ++-- newlib/libc/machine/powerpc/time.c | 36 --------------------------------- newlib/libc/machine/powerpc/times.c | 36 +++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 newlib/libc/machine/powerpc/time.c create mode 100644 newlib/libc/machine/powerpc/times.c (limited to 'newlib/libc') diff --git a/newlib/libc/machine/powerpc/Makefile.am b/newlib/libc/machine/powerpc/Makefile.am index fd8a6530a..94962c73c 100644 --- a/newlib/libc/machine/powerpc/Makefile.am +++ b/newlib/libc/machine/powerpc/Makefile.am @@ -6,7 +6,7 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) noinst_LIBRARIES = lib.a -lib_a_SOURCES = setjmp.S time.c +lib_a_SOURCES = setjmp.S times.c lib_a_LIBADD = @extra_objs@ EXTRA_lib_a_SOURCES = @extra_sources@ lib_a_DEPENDENCIES = @extra_objs@ diff --git a/newlib/libc/machine/powerpc/Makefile.in b/newlib/libc/machine/powerpc/Makefile.in index 0f1d7c8ef..bb9a15b9c 100644 --- a/newlib/libc/machine/powerpc/Makefile.in +++ b/newlib/libc/machine/powerpc/Makefile.in @@ -91,7 +91,7 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) noinst_LIBRARIES = lib.a -lib_a_SOURCES = setjmp.S time.c +lib_a_SOURCES = setjmp.S times.c lib_a_LIBADD = @extra_objs@ EXTRA_lib_a_SOURCES = @extra_sources@ lib_a_DEPENDENCIES = @extra_objs@ @@ -110,7 +110,7 @@ LIBRARIES = $(noinst_LIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ -lib_a_OBJECTS = setjmp.o time.o +lib_a_OBJECTS = setjmp.o times.o CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) diff --git a/newlib/libc/machine/powerpc/time.c b/newlib/libc/machine/powerpc/time.c deleted file mode 100644 index 64f4ddcb8..000000000 --- a/newlib/libc/machine/powerpc/time.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Time support routines for PowerPC. - * - * Written by Aldy Hernandez. - */ - -#include <_ansi.h> -#include -#include -#include -#include - -clock_t -times (struct tms *tp) -{ - struct rusage usage; - union { - struct rusage r; - /* Newlib's rusage has only 2 fields. We need to make room for - when we call the system's rusage. This should be enough. */ - int filler[32]; - } host_ru; - - getrusage (RUSAGE_SELF, (void *)&host_ru); - - if (tp) - { - tp->tms_utime = host_ru.r.ru_utime.tv_sec * 1000 - + host_ru.r.ru_utime.tv_usec; - tp->tms_stime = host_ru.r.ru_stime.tv_sec * 1000 - + host_ru.r.ru_stime.tv_usec; - tp->tms_cutime = 0; /* user time, children */ - tp->tms_cstime = 0; /* system time, children */ - } - - return tp->tms_utime; -} diff --git a/newlib/libc/machine/powerpc/times.c b/newlib/libc/machine/powerpc/times.c new file mode 100644 index 000000000..64f4ddcb8 --- /dev/null +++ b/newlib/libc/machine/powerpc/times.c @@ -0,0 +1,36 @@ +/* Time support routines for PowerPC. + * + * Written by Aldy Hernandez. + */ + +#include <_ansi.h> +#include +#include +#include +#include + +clock_t +times (struct tms *tp) +{ + struct rusage usage; + union { + struct rusage r; + /* Newlib's rusage has only 2 fields. We need to make room for + when we call the system's rusage. This should be enough. */ + int filler[32]; + } host_ru; + + getrusage (RUSAGE_SELF, (void *)&host_ru); + + if (tp) + { + tp->tms_utime = host_ru.r.ru_utime.tv_sec * 1000 + + host_ru.r.ru_utime.tv_usec; + tp->tms_stime = host_ru.r.ru_stime.tv_sec * 1000 + + host_ru.r.ru_stime.tv_usec; + tp->tms_cutime = 0; /* user time, children */ + tp->tms_cstime = 0; /* system time, children */ + } + + return tp->tms_utime; +} -- cgit v1.2.3