acadia-newlib/newlib/libc
imp be517bd298 Ensure that all values of ns, us and ms work
for {n,u,m}stosbt

Integer overflows and wrong constants limited the accuracy of these
functions and created situatiosn where sbttoXs(Xstosbt(Y)) != Y. This
was especailly true in the ns case where we had millions of values
that were wrong.

Instead, used fixed constants because there's no way to say ceil(X)
for integer math. Document what these crazy constants are.

Also, use a shift one fewer left to avoid integer overflow causing
incorrect results, and adjust the equasion accordingly. Document this.

Allow times >= 1s to be well defined for these conversion functions
(at least the Xstosbt). There's too many users in the tree that they
work for >= 1s.

This fixes a failure on boot to program firmware on the mlx4
NIC. There was a msleep(1000) in the code. Prior to my recent rounding
changes, msleep(1000) worked, but msleep(1001) did not because the old
code rounded to just below 2^64 and the new code rounds to just above
it (overflowing, causing the msleep(1000) to really sleep 1ms).

A test program to test all cases will be committed shortly. The test
exaustively tries every value (thanks to bde for the test).

Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D18051
2018-12-04 07:39:15 +01:00
..
argz ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ctype newlib/libc/ctype/jp2uc.c: Declare "cs" variable as "const char *" 2018-10-11 16:32:14 +02:00
errno makedoc: make errors visible 2017-12-07 11:54:11 +00:00
iconv ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
include Ensure that all values of ns, us and ms work 2018-12-04 07:39:15 +01:00
locale newlib: Drop incorrect const qualifier from __loadlocale parameter 2018-10-10 11:18:20 +02:00
machine Fix issue with dst bias in memset 2018-11-08 16:45:19 +00:00
misc RISC-V: Do not use _init/_fini 2018-07-30 10:47:57 +02:00
posix Add generic implementation of fdopendir() 2018-10-11 08:29:17 +02:00
reent ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
search search: Fix Berkeley DB hash code for 16-bit targets. 2018-09-06 17:29:49 +02:00
signal Fix newlib functions perror()/psignal() not to use writev(). 2018-07-05 15:33:49 -04:00
ssp makedoc: make errors visible 2017-12-07 11:54:11 +00:00
stdio Use nanf("") instead of nanf(NULL) 2018-08-29 15:57:27 +02:00
stdio64 ansification: remove _EXFNPTR, _EXPARM 2018-01-17 11:47:27 -06:00
stdlib newlib: Build internal strtold code only if HAVE_LONG_DOUBLE defined 2018-10-10 18:01:22 +02:00
string Improve performance of strstr 2018-10-18 19:51:39 +02:00
sys Builtin enable return code with SYS_EXIT_EXTENDED 2018-11-26 10:07:55 -05:00
syscalls ansification: remove _HAVE_STDC 2018-01-17 11:47:30 -06:00
time newlib: strftime: fix over-enthusiastic fix from 0283642f35 2018-08-08 23:59:34 +02:00
unix Fix comparison between two character arrays 2018-07-30 09:36:49 +02:00
xdr xdr_private.h needs sys/types.h for u_char 2018-09-06 14:10:42 +02:00
Makefile.am ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
Makefile.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
aclocal.m4
configure Add --disable-newlib-fno-builtin to allow compilation without -fno-builtin for smaller and faster code. 2018-08-31 15:40:42 -04:00
configure.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
libc.in.xml ssp: add documentation 2017-11-29 11:25:45 -06:00
libc.texinfo ssp: add documentation 2017-11-29 11:25:45 -06:00
saber
sys.tex