newlib-cygwin/libgloss
Christoph Muellner 0cb40f415b RISC-V: Reliably initialize t0 in _times()
The current implementation does not reliably initialize t0 once.
Additionally the initialization requires two calls to _gettimeofday().
Let's sacrifice a byte to keep the initialization status
and reduce the maximum number of calls to _gettimeofday().

This has caused issues in an application that invokes clock().
The problematic situation is as follows:

1) The program calls clock() which calls _times().
2) _gettimeofday(&t0, 0) puts 0 in t0.tv_usec (because less than 1 us has
   elapsed since the beginning of time).
3) _gettimeofday(&t, 0) puts 1 in t.tv_usec (since now more than 1 us has
   elapsed since the beginning of time).
4) That call to clock() returns 1 (the value from step 3 minus the value in
   step 2).
5) The program does a second call to clock().
6) The code above still sees 0 in t0 so it tries to update t0 again and
   _gettimeofday(&t0, 0) puts 1 in t0.tv_usec.
7) The _gettimeofday(&t, 0) puts 1 in t.tv_usec (since less than 1us has
   elapsed since step 3).
8) clock() returns 0 (step 7 minus step 6) and indicates that time is
   moving backwards.

Signed-off-by: Christoph Muellner <cmuellner@gcc.gnu.org>
2021-08-04 11:44:33 +02:00
..
aarch64 libgloss: aarch64: Add support for Armv8-R AArch64 2020-09-30 11:08:46 +01:00
arc Add JLI support. 2017-06-14 14:51:22 +02:00
arm arm: Finish moving newlib to unified syntax for Thumb1 2020-03-02 13:33:11 +00:00
bfin ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
config libgloss: change 'q' flag to 'r' in ar call 2012-03-13 01:47:40 +00:00
cr16 ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
cris Revert previous change to sys/stat.h and fix cris libgloss 2019-08-19 18:01:45 -04:00
crx ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
csky Add C-SKY port for libgloss 2020-09-25 11:02:34 -04:00
d30v 2013-11-21 Daniel Ramirez <javamonn@gmail.com> 2013-11-21 16:42:17 +00:00
doc Add libgloss install-pdf and install-html targets. 2018-11-20 11:13:34 +01:00
epiphany ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fr30 Remove GPL licencsing 2010-12-17 10:13:31 +00:00
frv ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ft32 ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
hp74x [newlib] 2008-04-04 21:52:01 +00:00
i386 Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
i960 2013-11-21 Daniel Ramirez <javamonn@gmail.com> 2013-11-21 16:42:17 +00:00
iq2000 Fix builds on iq2000 and visium 2021-07-06 10:46:09 -04:00
libnosys ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
lm32 ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
m32c * m32c/sbrk.c (sbrk): Change to take ptrdiff_t, not int. 2009-07-08 20:54:19 +00:00
m32r Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
m68hc11 [newlib] 2008-04-04 21:52:01 +00:00
m68k libgloss: Fix lseek semihosting bug on nios2 and m68k 2020-02-06 11:02:38 +01:00
mcore ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
mep 2015-01-05 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> 2015-01-05 17:36:34 +00:00
microblaze libgloss: microblaze: adjust handlers to be weak. 2018-05-03 15:16:13 -04:00
mips Align _end symbol to at least 4 in all MIPS scripts 2019-07-30 09:38:13 +02:00
mn10200 2012-03-09 Jeff Johnston <jjohnstn@redhat.com> 2012-03-09 20:28:57 +00:00
mn10300 2012-03-09 Jeff Johnston <jjohnstn@redhat.com> 2012-03-09 20:28:57 +00:00
moxie Implement the unlink system call for the moxie simulator. 2019-12-14 05:27:38 -05:00
msp430 MSP430: Fix calculation of string length in sbrk.c 2020-09-04 15:05:17 +02:00
mt 2015-01-05 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> 2015-01-05 17:36:34 +00:00
nds32 Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
nios2 libgloss: Fix lseek semihosting bug on nios2 and m68k 2020-02-06 11:02:38 +01:00
or1k libgloss/or1k: Correct the IMMU SXE and UXE flags 2021-07-05 18:00:40 -04:00
pa [newlib] 2008-04-04 21:52:01 +00:00
pru libgloss: pru: Remove sim ld script 2021-06-09 14:15:56 -04:00
riscv RISC-V: Reliably initialize t0 in _times() 2021-08-04 11:44:33 +02:00
rl78 rl78: Don't output CR when LF is encountered in write(). 2015-12-16 13:38:38 -07:00
rs6000 2013-05-30 Jeff Johnston <jjohnstn@redhat.com> 2013-05-30 22:44:04 +00:00
rx Add a check that the data area does not overrun the stack. 2015-05-27 13:30:19 +02:00
sh * arm/elf-redboot.ld, iq2000/sim.ld, m68hc11/sim-valid-m68hc11.ld, 2005-05-20 15:45:45 +00:00
sparc Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
sparc_leon Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
spu ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
testsuite
tic6x ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
v850 Add comment in the v850's crt0.S file noting that separate LMA and VMA addresses for data sections are not currently supported. 2016-05-26 12:08:47 +01:00
visium Fix builds on iq2000 and visium 2021-07-06 10:46:09 -04:00
wince [newlib] 2008-04-04 21:52:01 +00:00
xc16x ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
xstormy16 ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ChangeLog Deprecate newlib and winsup ChangeLog files 2016-01-28 11:15:33 +01:00
ChangeLog-2015 Deprecate newlib and winsup ChangeLog files 2016-01-28 11:15:33 +01:00
Makefile.in Add libgloss install-pdf and install-html targets. 2018-11-20 11:13:34 +01:00
README 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:09:28 +00:00
acinclude.m4 2006-04-19 Jeff Johnston <jjohnstn@redhat.com> 2006-04-19 19:44:05 +00:00
aclocal.m4 2006-04-19 Jeff Johnston <jjohnstn@redhat.com> 2006-04-19 19:44:05 +00:00
close.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
configure Add C-SKY port for libgloss 2020-09-25 11:02:34 -04:00
configure.in Add C-SKY port for libgloss 2020-09-25 11:02:34 -04:00
debug.c
debug.h 2002-04-17 Joel Sherrill <joel@OARcorp.com> 2002-04-17 19:10:37 +00:00
fstat.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
getpid.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
glue.h
isatty.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
kill.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
lseek.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
multi-build.in Fix multido compilation on ARM 2017-10-09 19:03:52 +02:00
open.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
print.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
putnum.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
read.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
sbrk.c
stat.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
syscall.h 2007-11-06 Dave Brolley <brolley@redhat.com> 2007-11-06 23:07:06 +00:00
unlink.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
write.c ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00

README

bfin	- Analog Devices Blackfin processor.
sparc	- Fujitsu Sparclite board. Works on the ex930, ex931, ex933
hp74x	- Hewlett Packard HP742 board. Also some support for the hp743.
m68hc11 - Motorola 68HC11 or 68HC12 support.
m68k	- Motorola MVME135 and IDP board. For CPU32 systems.
mep	- Toshiba Media Processor.
pa	- WinBond and Oki boards with a PA.
mips	- R3000 support. Array Tech LSI33k based RAID disk controller.
lm32    - Lattice Mico32 simulator.
epiphany - Adapteva Epiphany multicore processor.
or1k	- OpenRISC 1000 processor.