This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH 00/04] fix SPU time
- From: Patrick Mansfield <patmans at us dot ibm dot com>
- To: newlib at sourceware dot org
- Date: Wed, 14 Feb 2007 14:37:19 -0800
- Subject: [PATCH 00/04] fix SPU time
The removal of the "#ifdef HAVE_GETTIMEOFDAY" in newlib/libc/time/time.c
means libc versions will be normally be used rather than any libgloss
versions, and requires a gettimeofday().
In addition, since _gettimeofday_r() is in newlib/libc/reent/timer.c along
with times() (with an 's'), in order to link, newlib now requires both a
gettimeofday() and times() to be implemented in order to use time() or
gettimeofday().
This breaks spu time() - though the spu code was added after the removal of
the ifdef - and I think some other archs are broken (by code inspection,
like mips). If other archs are broken, it might be a good idea to revert
that change (and the configure.host changes).
This patchset fixes time() so it works again for spu, mainly by adding the
spu gettimeofday().
I built and tested time() and gettimeofday() for SPU with all these
patches applied. I didn't make doc, I'm not sure how that is done or if my
changes work with it.
patch 1: split gettimeofday_r and times_r out of reent/timer.c into their
own files, mainly so we only get link failures (on spu) when times() is
directly called.
patch 2: add spu gettimeofday (offload call)
patch 3: remove spu time, since it is no longer called (side note: we have
to leave the offload support in libspe / libspe2 of time for backwards
compatability, we should have always supported time() via usage of
gettimeofday()).
patch 4: newlib and libgloss ChangeLog
-- Patrick Mansfield