Home | History | Annotate | only in /src/lib/libc/arch/i386/gen
History log of /src/lib/libc/arch/i386/gen
RevisionDateAuthorComments
 1.30 26-Apr-2019  maya Unify signbitl implementations.
(Unclear why they were different, it was only the comments that
differed)

Add a comment describing why the generic version works for both 80-bit
and 128-bit double.
 1.29 15-Jul-2015  pooka branches: 1.29.16;
Don't include sigtramp or foocontext routines in rumprun mode. They won't
work (since a rump kernel does not provide NetBSD _lwp syscalls nor
signals), but they cause unwanted symbols to be pulled in when the
resulting libc is linked.

problem reported by Robert Gifford on rumpkernel-users
 1.28 15-Jul-2015  pooka Remove "objects built from C sources" comments. Everyone can see
they're built from C sources because the source files end in .c (???)
 1.27 26-Mar-2011  christos add fpgetprec/fpsetprec
 1.26 06-Dec-2009  uebayasi Rename ${SRCS.{alpha,arm,...}.gen} to ${LSRCS.{alpha,arm,...}.gen} because
they ended up in ${LSRCS}, not ${SRCS}. ${SRCS.*} namespace will be used
for more useful things. No functional changes intended.
 1.25 27-Jun-2006  drochner Build just the compatibility versions of frexp()/ldexp()/modf(), the
real implementation is in libm.
 1.24 06-Oct-2005  dogcow restore missing .S sources that disappeared in the last commit.
 1.23 05-Oct-2005  christos _setjmp and _longjmp are not compat functions. Noticed by Havard Eidnes
 1.22 13-Sep-2005  christos compat core reorg.
 1.21 15-Apr-2005  kleink Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.

IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
 1.20 04-Mar-2004  kleink branches: 1.20.6;
* Turn isinf(3) and isnan(3) into C99-style macros.
* Make it possible for ports to override these (i.e., VAX).
* Remove isnanl(), which was internal to libc only.
 1.19 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.18 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.17 24-Oct-2003  kleink * Since there is no single portable IEEE 754 format for a long double,
keep a common implementation of isinfl() and isnanl() to be used by
platforms where `long double' == `double'; move others into
machine-dependent code.
* In due course, consider __VFP_FP__ on arm.
 1.16 01-Aug-2003  lukem Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
 1.15 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.14 12-May-2003  kleink Rename ieee754_function.c to function_ieee754.c, following the convention
used in exec_format.c, loadfile_format.c, subsys_machdep.c etc.
Per discussion with Christos.
 1.13 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.12 19-Feb-2002  simonb Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
- Use the above for the __infinity and __nan constants on all
architectures that use the standard ieee754 representation of
those constants.
- Add a single copy of various ieee754 math functions (frexp, isinf,
isnan, ldexp and modf) that had numerous duplicates among the
arch-specific directories.
- Use the above functions on all architectures where the generic C
versions where used. Architectures that had local assembly
routines are untouched (for those functions only).
 1.11 13-Dec-2000  matt branches: 1.11.2;
Add __syscall.S back to sys/Makefile.inc. Remove from arch/i386/gen/
Makefile.inc. If your architecture doesn't have __syscall.S, *add it*.
 1.10 13-Dec-2000  matt Add __syscall.S to arch/i386/gen/Makefile.inc along with all the other
sys .S files. Remove from arch/i386/Makefile.inc since it doesn't belong
there.
 1.9 23-Dec-1999  kleink C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
 1.8 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.7 15-Jan-1999  bouyer Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
 1.6 26-Sep-1998  christos Add setjmp versioned bits (from Jason).
XXX: Someone needs to make setjmp/longjmp save and restore the signal stack!
 1.5 05-Nov-1997  cgd lint stubs for assembly routines.
 1.4 09-Apr-1995  mycroft branches: 1.4.10;
Add fpset{mask,round,sticky}().
 1.3 07-Apr-1995  jtc Added flt_rounds, fpget{round,mask,sticky}.
 1.2 25-Feb-1995  cgd don't forget inifinity.c
 1.1 25-Feb-1995  cgd need these for new gen/Makefile
 1.4.10.1 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for assembly routines.
 1.11.2.4 22-Mar-2002  nathanw Catch up to -current.
 1.11.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.11.2.2 13-Jul-2001  nathanw Make userlevel-only *context functions part of libpthread rather than libc.
 1.11.2.1 05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.20.6.1 19-Apr-2005  tron Pull up revision 1.21 (requested by kleink in ticket #163):
Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.
IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
 1.29.16.1 10-Jun-2019  christos Sync with HEAD
 1.5 13-Sep-2005  christos compat core reorg.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 13-Feb-1999  christos For don't mess up the stack before calling syscall when using PIC_PROLOGUE.
 1.2 08-Feb-1999  christos Amend for the PLT fixes, things broke last night with the changes to SYS.h
and cerror.S. In particular, the syscalls in the files committed below were
broken.
 1.1 26-Sep-1998  christos Add setjmp versioned bits (from Jason).
XXX: Someone needs to make setjmp/longjmp save and restore the signal stack!
 1.6 13-Sep-2005  christos compat core reorg.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 22-Feb-1999  christos Don't use 1: label; it is uses by the PIC_PROLOGUE macro and we jmp in the
wrong place!
 1.3 13-Feb-1999  christos For don't mess up the stack before calling syscall when using PIC_PROLOGUE.
 1.2 08-Feb-1999  christos Amend for the PLT fixes, things broke last night with the changes to SYS.h
and cerror.S. In particular, the syscalls in the files committed below were
broken.
 1.1 26-Sep-1998  christos Add setjmp versioned bits (from Jason).
XXX: Someone needs to make setjmp/longjmp save and restore the signal stack!
 1.1 05-Mar-2001  nathanw branches: 1.1.2;
file _context_u.S was initially added on branch nathanw_sa.
 1.1.2.2 13-Jul-2001  nathanw Make userlevel-only *context functions part of libpthread rather than libc.
 1.1.2.1 05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.9 02-Apr-2023  skrll Trailing whitespace
 1.8 31-Aug-2012  drochner Align the stack to a 16-byte boundary on LWP creation.
This is more than required by the ABI, but it makes programs using SSE
in a thread work without extra compiler flags or performance hit.
 1.7 24-Feb-2011  joerg branches: 1.7.4;
Allow storing and receiving the LWP private pointer via ucontext_t
on all platforms except VAX and IA64. Add fast access via register for
AMD64, i386 and SH3 ports. Use this fast access in libpthread to replace
the stack based pthread_self(). Implement skeleton support for Alpha,
HPPA, PowerPC, SPARC and SPARC64, but leave it disabled.

Ports that support this feature provide __HAVE____LWP_GETPRIVATE_FAST in
machine/types.h and a corresponding __lwp_getprivate_fast in
machine/mcontext.h.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.6 28-Apr-2008  martin branches: 1.6.8; 1.6.20;
Remove clause 3 and 4 from TNF licenses
 1.5 12-Jun-2005  lukem branches: 1.5.18;
Add missing __RCSID()
 1.4 30-May-2003  kleink Delint a use of uintptr_t; not strictly necessary with -current lint(1),
but consistent with makecontext.c.
 1.3 07-Apr-2003  kleink Make sure we reference getcontext() by its internal name.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 05-Mar-2001  nathanw branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.3 16-Jan-2003  thorpej Add missing notice.
 1.1.2.2 18-Dec-2001  nathanw Delint (Thanks to Havard for kicking my butt into doing this).
 1.1.2.1 05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.5.18.1 18-May-2008  yamt sync with head.
 1.6.20.1 05-Mar-2011  bouyer Sync with HEAD
 1.6.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6.8.1 28-Apr-2008  martin file _lwp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.7.4.1 30-Oct-2012  yamt sync with head
 1.9 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.8 05-Oct-2005  christos branches: 1.8.50; 1.8.62;
_setjmp and _longjmp are not compat functions. Noticed by Havard Eidnes
 1.7 15-Sep-2005  christos This is not used anymore; pointed out by uwe.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.4 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.3 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.2 20-Oct-1993  jtc Replaced instructions with immediate operands with compatible alternatives
saving a few bytes while the cycle count remains the same --- could
actually be faster, depending on the cache, prefetch queue, etc.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.8.62.1 10-Aug-2014  tls Rebase.
 1.8.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 04-Dec-1993  mycroft Clean up deleted files.
 1.3 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.2 20-Oct-1993  jtc Replaced instructions with immediate operands with compatible alternatives
saving a few bytes while the cycle count remains the same --- could
actually be faster, depending on the cache, prefetch queue, etc.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.9 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.8 07-Aug-2003  agc branches: 1.8.62; 1.8.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 23-Mar-2002  ross Fix minor syntax warnings.
 1.6 28-Jun-2001  atatat fix a grammatical error error
 1.5 16-Jul-1997  christos branches: 1.5.14;
RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.4 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.3 27-Jan-1994  mycroft Pedanticism.
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5.14.2 25-Apr-2002  nathanw Catch up to -current.
 1.5.14.1 08-Oct-2001  nathanw Catch up to -current.
 1.8.74.1 10-Aug-2014  tls Rebase.
 1.8.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 14-Dec-2000  mycroft Adjust to not use ALTENTRY().
 1.1 15-Jan-1999  bouyer Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 14-Dec-2000  mycroft Adjust to not use ALTENTRY().
 1.1 15-Jan-1999  bouyer Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
 1.7 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.6 07-Aug-2003  agc branches: 1.6.62; 1.6.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.4 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.3 21-Oct-1993  jtc Gcc helper functions should still use the ENTRY() macro so they will be
show up in profiled code. (The gcc helper functions in the other ports
do this allready).
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6.74.1 10-Aug-2014  tls Rebase.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 04-Dec-1993  mycroft Clean up deleted files.
 1.3 21-Oct-1993  jtc Gcc helper functions should still use the ENTRY() macro so they will be
show up in profiled code. (The gcc helper functions in the other ports
do this allready).
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.5 07-Aug-2003  agc branches: 1.5.62; 1.5.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.3 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5.74.1 10-Aug-2014  tls Rebase.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.6 07-Aug-2003  agc branches: 1.6.62; 1.6.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.4 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.3 21-Oct-1993  jtc Gcc helper functions should still use the ENTRY() macro so they will be
show up in profiled code. (The gcc helper functions in the other ports
do this allready).
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6.74.1 10-Aug-2014  tls Rebase.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 04-Dec-1993  mycroft Clean up deleted files.
 1.3 21-Oct-1993  jtc Gcc helper functions should still use the ENTRY() macro so they will be
show up in profiled code. (The gcc helper functions in the other ports
do this allready).
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.14 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.13 12-Sep-2013  joerg branches: 1.13.2;
Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
 1.12 22-May-2011  joerg branches: 1.12.4; 1.12.10;
Use a plain float constant, no need to deal with messy 0r prefix
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 22-Feb-1999  christos Don't use 1: label; it is uses by the PIC_PROLOGUE macro and we jmp in the
wrong place!
 1.9 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.8 28-Dec-1995  jtc Remove #include "SYS.h"; it is not needed (by normal assembly functions)
 1.7 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.6 27-Jan-1994  mycroft Pedanticism.
 1.5 06-Dec-1993  pk Remove spurious PIC_EPILOGUE and PIC_GOTOFF macros.
 1.4 21-Oct-1993  jtc Gcc helper functions should still use the ENTRY() macro so they will be
show up in profiled code. (The gcc helper functions in the other ports
do this allready).
 1.3 21-Oct-1993  jtc So many files in arch/i386 have been changed I might as well run my
remove unecessary trailing whitespace script.
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.12.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.2.1 10-Aug-2014  tls Rebase.
 1.5 04-Dec-1993  mycroft Clean up deleted files.
 1.4 21-Oct-1993  jtc Gcc helper functions should still use the ENTRY() macro so they will be
show up in profiled code. (The gcc helper functions in the other ports
do this allready).
 1.3 21-Oct-1993  jtc So many files in arch/i386 have been changed I might as well run my
remove unecessary trailing whitespace script.
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.10 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.9 30-Sep-2011  christos branches: 1.9.8; 1.9.18;
make rounding work
 1.8 29-Sep-2011  christos even shorter
 1.7 29-Sep-2011  christos add a simpler version
 1.6 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.5 09-Jan-1998  perry RCS Id Police.
 1.4 20-Jun-1995  pk Make PIC safe.
 1.3 09-Apr-1995  mycroft Another optimization.
 1.2 09-Apr-1995  mycroft Optimize.
 1.1 07-Apr-1995  jtc Added flt_rounds, fpget{round,mask,sticky}.
 1.9.18.1 10-Aug-2014  tls Rebase.
 1.9.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 02-Feb-2007  christos branches: 1.2.10;
ext_int bit is no more.
 1.1 28-Oct-2003  kleink branches: 1.1.16;
C99 7.12.3.1: add IEEE library portions of fpclassify. Don't build these
yet as the VAX implementation is still subject to discussion.
 1.1.16.1 07-May-2007  pavel Pull up following revision(s) (requested by manu in ticket #607):
lib/libc/arch/i386/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoa.c: revision 1.2-1.3
lib/libc/arch/x86_64/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoaimp.h: revision 1.6
sys/arch/m68k/include/ieee.h: revision 1.13
usr.bin/xlint/lint1/scan.l: revision 1.36-1.37
lib/libc/stdio/snprintf_ss.c: revision 1.4
lib/libc/arch/i386/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfscanf.c: revision 1.38
sys/arch/sparc/include/ieee.h: revision 1.11-1.12
lib/libc/gdtoa/dtoa.c: revision 1.4
lib/libc/stdio/Makefile.inc: revision 1.35
lib/libc/stdio/fvwrite.c: revision 1.17
lib/libc/arch/m68k/gen/fpclassifyl.c: revision 1.2
lib/libc/arch/i386/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfprintf.c: revision 1.55-1.57
lib/libc/stdio/vsnprintf_ss.c: revision 1.3
lib/libc/stdio/vfwprintf.c: revision 1.10
sys/arch/x86/include/ieee.h: revision 1.10
lib/libc/gdtoa/dmisc.c: revision 1.3
lib/libc/gdtoa/Makefile.inc: revision 1.5
sys/arch/hppa/include/ieee.h: revision 1.10
lib/libc/arch/x86_64/gen/fpclassifyl.c: revision 1.3
lib/libc/arch/i386/gen/fpclassifyl.c: revision 1.2
sys/sys/ieee754.h: revision 1.7
lib/libc/gdtoa/gdtoa.h: revision 1.7
include/stdio.h: revision 1.67-1.68
lib/libc/gdtoa/hdtoa.c: revision 1.1-1.4
lib/libc/gdtoa/ldtoa.c: revision 1.1-1.4
defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.
Fix for issue reported in PR lib/35401 as well as related overflow bugs.
deal with hex doubles.
Instead of abusing stdio to get a signal-safe version of sprintf, provide one.
remove __SAFE
add long double and hex double support from freebsd.
make this compile.
add new prototypes.
add the new files to the build. Note I am not bumping libc now, because
these are not used yet.
Merge the int bit with the high fraction bit. Add constants/macros
needed by gdtoa.
add constants used by gdtoa
since the int bit is merged, do the explicit math.
ext_int bit is no more.
ext_int bit is no more.
- merge change from freebsd
- add support for building as vfprintf.c
- XXX: we strdup to simplify the freeing logic. This should be fixed for
efficiency in the vfprintf case.
use vfwprintf.c
enable wide doubles.
some int -> size_t
deal with sparc64 that has 112 bits of mantissa.
make extended precision gdtoa friendly.
int/size_t changes
make this gdtoa friendly.
remove dup definition
use dtoa() instead of returning empty when we don't have extended precision
information.
Fix previous, add forgotten pointer dereference in the call to dtoa().
Add a cheesy workaround marked XXX for the situation where the
strtod() implementation available in the environment does not
handle hex floats.
Discussed with and suggested by christos
From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
vax does not have <machine/ieee.h> or long double
It would be nice if the compiler provided something like __IEEE_MATH__
bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
 1.2.10.1 18-May-2008  yamt sync with head.
 1.3.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3.8.1 28-Apr-2008  martin file fpclassifyl.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.5 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.4 13-Jan-2002  thorpej branches: 1.4.64; 1.4.76;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.3 09-Jan-1998  perry branches: 1.3.12;
RCS Id Police.
 1.2 09-Apr-1995  mycroft Another optimization.
 1.1 07-Apr-1995  jtc Added flt_rounds, fpget{round,mask,sticky}.
 1.3.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.76.1 10-Aug-2014  tls Rebase.
 1.4.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.1 26-Mar-2011  christos branches: 1.1.10; 1.1.20;
add fpgetprec/fpsetprec
 1.1.20.1 10-Aug-2014  tls Rebase.
 1.1.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.6 30-Sep-2011  christos branches: 1.6.8; 1.6.18;
make rounding work
 1.5 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.4 09-Jan-1998  perry branches: 1.4.12;
RCS Id Police.
 1.3 09-Apr-1995  mycroft Add fpset{mask,round,sticky}().
 1.2 09-Apr-1995  mycroft Another optimization.
 1.1 07-Apr-1995  jtc Added flt_rounds, fpget{round,mask,sticky}.
 1.4.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.6.18.1 10-Aug-2014  tls Rebase.
 1.6.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.6 13-Jan-2002  thorpej branches: 1.6.64; 1.6.76;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.5 09-Jan-1998  perry branches: 1.5.12;
RCS Id Police.
 1.4 09-Apr-1995  mycroft Reverse sense of exception bits.
 1.3 09-Apr-1995  mycroft Another optimization.
 1.2 09-Apr-1995  jtc ENTRY(fpgetmask) -> ENTRY(fpgetsticky)
 1.1 07-Apr-1995  jtc Added flt_rounds, fpget{round,mask,sticky}.
 1.5.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.6.76.1 10-Aug-2014  tls Rebase.
 1.6.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.4 13-Jan-2002  thorpej branches: 1.4.64; 1.4.76;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.3 09-Jan-1998  perry branches: 1.3.12;
RCS Id Police.
 1.2 09-Apr-1995  mycroft Stylistic change to match fpsetsticky().
 1.1 09-Apr-1995  mycroft Add fpset{mask,round,sticky}().
 1.3.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.76.1 10-Aug-2014  tls Rebase.
 1.4.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.1 26-Mar-2011  christos branches: 1.1.10; 1.1.20;
add fpgetprec/fpsetprec
 1.1.20.1 10-Aug-2014  tls Rebase.
 1.1.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.5 30-Sep-2011  christos branches: 1.5.8; 1.5.18;
don't use %edi!
 1.4 30-Sep-2011  christos make rounding work
 1.3 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.2 09-Jan-1998  perry branches: 1.2.12;
RCS Id Police.
 1.1 09-Apr-1995  mycroft Add fpset{mask,round,sticky}().
 1.2.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.18.1 10-Aug-2014  tls Rebase.
 1.5.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.6 13-Jan-2002  thorpej branches: 1.6.64; 1.6.76;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.5 09-Jan-1998  perry branches: 1.5.12;
RCS Id Police.
 1.4 09-Apr-1995  mycroft Reverse sense of exception bits.
 1.3 09-Apr-1995  mycroft Oops; need to use fnstenv/fldenv for this.
 1.2 09-Apr-1995  mycroft Fix typo.
 1.1 09-Apr-1995  mycroft Add fpset{mask,round,sticky}().
 1.5.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.6.76.1 10-Aug-2014  tls Rebase.
 1.6.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6 19-Feb-2002  simonb Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
- Use the above for the __infinity and __nan constants on all
architectures that use the standard ieee754 representation of
those constants.
- Add a single copy of various ieee754 math functions (frexp, isinf,
isnan, ldexp and modf) that had numerous duplicates among the
arch-specific directories.
- Use the above functions on all architectures where the generic C
versions where used. Architectures that had local assembly
routines are untouched (for those functions only).
 1.5 29-Aug-1999  mycroft branches: 1.5.10;
Trivial KNF.
 1.4 29-Aug-1999  mycroft Make the C version of frexp() consitent across platforms, and handle the
Inf/NaN case.
 1.3 10-Mar-1999  mycroft Use ieee.h structs and macros.
 1.2 13-Jul-1997  christos Fix RCSID's
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.6 19-Feb-2002  simonb Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
- Use the above for the __infinity and __nan constants on all
architectures that use the standard ieee754 representation of
those constants.
- Add a single copy of various ieee754 math functions (frexp, isinf,
isnan, ldexp and modf) that had numerous duplicates among the
arch-specific directories.
- Use the above functions on all architectures where the generic C
versions where used. Architectures that had local assembly
routines are untouched (for those functions only).
 1.5 13-Sep-2000  msaitoh branches: 1.5.2;
check LIBC_SCCS
 1.4 14-Nov-1998  christos delint
 1.3 26-Jul-1998  mycroft const poisoning.
 1.2 13-Jul-1997  christos Fix RCSID's
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 06-Jun-2011  drochner make sure the infinity returned by HUGE_VALL has the "implicit"
bit set, otherwise it is invalid
This code is unlikely to be hit because gcc (and clang) use
their builtins for these special values.
 1.3 06-Apr-2011  christos branches: 1.3.2;
fix long double infinity.
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.3.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 02-Feb-2007  christos branches: 1.2.10;
ext_int bit is no more.
 1.1 29-Oct-2003  kleink branches: 1.1.16;
C99 7.12.3.2: add library portions of isfinite, but don't build these just
yet.
 1.1.16.1 07-May-2007  pavel Pull up following revision(s) (requested by manu in ticket #607):
lib/libc/arch/i386/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoa.c: revision 1.2-1.3
lib/libc/arch/x86_64/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoaimp.h: revision 1.6
sys/arch/m68k/include/ieee.h: revision 1.13
usr.bin/xlint/lint1/scan.l: revision 1.36-1.37
lib/libc/stdio/snprintf_ss.c: revision 1.4
lib/libc/arch/i386/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfscanf.c: revision 1.38
sys/arch/sparc/include/ieee.h: revision 1.11-1.12
lib/libc/gdtoa/dtoa.c: revision 1.4
lib/libc/stdio/Makefile.inc: revision 1.35
lib/libc/stdio/fvwrite.c: revision 1.17
lib/libc/arch/m68k/gen/fpclassifyl.c: revision 1.2
lib/libc/arch/i386/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfprintf.c: revision 1.55-1.57
lib/libc/stdio/vsnprintf_ss.c: revision 1.3
lib/libc/stdio/vfwprintf.c: revision 1.10
sys/arch/x86/include/ieee.h: revision 1.10
lib/libc/gdtoa/dmisc.c: revision 1.3
lib/libc/gdtoa/Makefile.inc: revision 1.5
sys/arch/hppa/include/ieee.h: revision 1.10
lib/libc/arch/x86_64/gen/fpclassifyl.c: revision 1.3
lib/libc/arch/i386/gen/fpclassifyl.c: revision 1.2
sys/sys/ieee754.h: revision 1.7
lib/libc/gdtoa/gdtoa.h: revision 1.7
include/stdio.h: revision 1.67-1.68
lib/libc/gdtoa/hdtoa.c: revision 1.1-1.4
lib/libc/gdtoa/ldtoa.c: revision 1.1-1.4
defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.
Fix for issue reported in PR lib/35401 as well as related overflow bugs.
deal with hex doubles.
Instead of abusing stdio to get a signal-safe version of sprintf, provide one.
remove __SAFE
add long double and hex double support from freebsd.
make this compile.
add new prototypes.
add the new files to the build. Note I am not bumping libc now, because
these are not used yet.
Merge the int bit with the high fraction bit. Add constants/macros
needed by gdtoa.
add constants used by gdtoa
since the int bit is merged, do the explicit math.
ext_int bit is no more.
ext_int bit is no more.
- merge change from freebsd
- add support for building as vfprintf.c
- XXX: we strdup to simplify the freeing logic. This should be fixed for
efficiency in the vfprintf case.
use vfwprintf.c
enable wide doubles.
some int -> size_t
deal with sparc64 that has 112 bits of mantissa.
make extended precision gdtoa friendly.
int/size_t changes
make this gdtoa friendly.
remove dup definition
use dtoa() instead of returning empty when we don't have extended precision
information.
Fix previous, add forgotten pointer dereference in the call to dtoa().
Add a cheesy workaround marked XXX for the situation where the
strtod() implementation available in the environment does not
handle hex floats.
Discussed with and suggested by christos
From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
vax does not have <machine/ieee.h> or long double
It would be nice if the compiler provided something like __IEEE_MATH__
bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
 1.2.10.1 18-May-2008  yamt sync with head.
 1.3.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3.8.1 28-Apr-2008  martin file isfinitel.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.8 19-Feb-2002  simonb Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
- Use the above for the __infinity and __nan constants on all
architectures that use the standard ieee754 representation of
those constants.
- Add a single copy of various ieee754 math functions (frexp, isinf,
isnan, ldexp and modf) that had numerous duplicates among the
arch-specific directories.
- Use the above functions on all architectures where the generic C
versions where used. Architectures that had local assembly
routines are untouched (for those functions only).
 1.7 22-Jan-2000  mycroft branches: 1.7.6;
Delint.
 1.6 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.5 14-Nov-1998  christos delint
 1.4 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.3 13-Jul-1997  christos Add missing math.h include
Fix RCSIDs
 1.2 05-Feb-1996  jtc Add explicit return type
 1.1 07-Oct-1993  cgd branches: 1.1.4;
make an arch directory in libc, and move all machine dirs into it
 1.1.4.1 18-Apr-1995  jtc namespace protect isnan() and isinf()
 1.7.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.6 02-Feb-2007  christos since the int bit is merged, do the explicit math.
 1.5 04-Mar-2004  kleink branches: 1.5.16;
* Turn isinf(3) and isnan(3) into C99-style macros.
* Make it possible for ports to override these (i.e., VAX).
* Remove isnanl(), which was internal to libc only.
 1.4 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.3 27-Oct-2003  kleink Retire local union { floating-type; struct ieee_prec; } in favor of those
available from <machine/ieee.h>
 1.2 25-Oct-2003  kleink Update to account for separate handling of the explicit integer bit;
simplifies a little.
 1.1 24-Oct-2003  kleink * Since there is no single portable IEEE 754 format for a long double,
keep a common implementation of isinfl() and isnanl() to be used by
platforms where `long double' == `double'; move others into
machine-dependent code.
* In due course, consider __VFP_FP__ on arm.
 1.5.16.1 07-May-2007  pavel Pull up following revision(s) (requested by manu in ticket #607):
lib/libc/arch/i386/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoa.c: revision 1.2-1.3
lib/libc/arch/x86_64/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoaimp.h: revision 1.6
sys/arch/m68k/include/ieee.h: revision 1.13
usr.bin/xlint/lint1/scan.l: revision 1.36-1.37
lib/libc/stdio/snprintf_ss.c: revision 1.4
lib/libc/arch/i386/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfscanf.c: revision 1.38
sys/arch/sparc/include/ieee.h: revision 1.11-1.12
lib/libc/gdtoa/dtoa.c: revision 1.4
lib/libc/stdio/Makefile.inc: revision 1.35
lib/libc/stdio/fvwrite.c: revision 1.17
lib/libc/arch/m68k/gen/fpclassifyl.c: revision 1.2
lib/libc/arch/i386/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfprintf.c: revision 1.55-1.57
lib/libc/stdio/vsnprintf_ss.c: revision 1.3
lib/libc/stdio/vfwprintf.c: revision 1.10
sys/arch/x86/include/ieee.h: revision 1.10
lib/libc/gdtoa/dmisc.c: revision 1.3
lib/libc/gdtoa/Makefile.inc: revision 1.5
sys/arch/hppa/include/ieee.h: revision 1.10
lib/libc/arch/x86_64/gen/fpclassifyl.c: revision 1.3
lib/libc/arch/i386/gen/fpclassifyl.c: revision 1.2
sys/sys/ieee754.h: revision 1.7
lib/libc/gdtoa/gdtoa.h: revision 1.7
include/stdio.h: revision 1.67-1.68
lib/libc/gdtoa/hdtoa.c: revision 1.1-1.4
lib/libc/gdtoa/ldtoa.c: revision 1.1-1.4
defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.
Fix for issue reported in PR lib/35401 as well as related overflow bugs.
deal with hex doubles.
Instead of abusing stdio to get a signal-safe version of sprintf, provide one.
remove __SAFE
add long double and hex double support from freebsd.
make this compile.
add new prototypes.
add the new files to the build. Note I am not bumping libc now, because
these are not used yet.
Merge the int bit with the high fraction bit. Add constants/macros
needed by gdtoa.
add constants used by gdtoa
since the int bit is merged, do the explicit math.
ext_int bit is no more.
ext_int bit is no more.
- merge change from freebsd
- add support for building as vfprintf.c
- XXX: we strdup to simplify the freeing logic. This should be fixed for
efficiency in the vfprintf case.
use vfwprintf.c
enable wide doubles.
some int -> size_t
deal with sparc64 that has 112 bits of mantissa.
make extended precision gdtoa friendly.
int/size_t changes
make this gdtoa friendly.
remove dup definition
use dtoa() instead of returning empty when we don't have extended precision
information.
Fix previous, add forgotten pointer dereference in the call to dtoa().
Add a cheesy workaround marked XXX for the situation where the
strtod() implementation available in the environment does not
handle hex floats.
Discussed with and suggested by christos
From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
vax does not have <machine/ieee.h> or long double
It would be nice if the compiler provided something like __IEEE_MATH__
bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
 1.3 19-Feb-2002  simonb Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
- Use the above for the __infinity and __nan constants on all
architectures that use the standard ieee754 representation of
those constants.
- Add a single copy of various ieee754 math functions (frexp, isinf,
isnan, ldexp and modf) that had numerous duplicates among the
arch-specific directories.
- Use the above functions on all architectures where the generic C
versions where used. Architectures that had local assembly
routines are untouched (for those functions only).
 1.2 22-Jan-2000  mycroft branches: 1.2.6;
Delint.
 1.1 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.2.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.8 05-Jun-2011  christos Revert previous and make frach be 0xc0000000 for NAN's generated by strtold()
as suggested by tron.
 1.7 04-Jun-2011  christos Make NAN tests consistent with other platforms and FreeBSD.
 1.6 02-Feb-2007  christos branches: 1.6.34;
since the int bit is merged, do the explicit math.
 1.5 04-Mar-2004  kleink branches: 1.5.16;
* Turn isinf(3) and isnan(3) into C99-style macros.
* Make it possible for ports to override these (i.e., VAX).
* Remove isnanl(), which was internal to libc only.
 1.4 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.3 27-Oct-2003  kleink Retire local union { floating-type; struct ieee_prec; } in favor of those
available from <machine/ieee.h>
 1.2 25-Oct-2003  kleink Update to account for separate handling of the explicit integer bit;
simplifies a little.
 1.1 24-Oct-2003  kleink * Since there is no single portable IEEE 754 format for a long double,
keep a common implementation of isinfl() and isnanl() to be used by
platforms where `long double' == `double'; move others into
machine-dependent code.
* In due course, consider __VFP_FP__ on arm.
 1.5.16.1 07-May-2007  pavel Pull up following revision(s) (requested by manu in ticket #607):
lib/libc/arch/i386/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoa.c: revision 1.2-1.3
lib/libc/arch/x86_64/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoaimp.h: revision 1.6
sys/arch/m68k/include/ieee.h: revision 1.13
usr.bin/xlint/lint1/scan.l: revision 1.36-1.37
lib/libc/stdio/snprintf_ss.c: revision 1.4
lib/libc/arch/i386/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfscanf.c: revision 1.38
sys/arch/sparc/include/ieee.h: revision 1.11-1.12
lib/libc/gdtoa/dtoa.c: revision 1.4
lib/libc/stdio/Makefile.inc: revision 1.35
lib/libc/stdio/fvwrite.c: revision 1.17
lib/libc/arch/m68k/gen/fpclassifyl.c: revision 1.2
lib/libc/arch/i386/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfprintf.c: revision 1.55-1.57
lib/libc/stdio/vsnprintf_ss.c: revision 1.3
lib/libc/stdio/vfwprintf.c: revision 1.10
sys/arch/x86/include/ieee.h: revision 1.10
lib/libc/gdtoa/dmisc.c: revision 1.3
lib/libc/gdtoa/Makefile.inc: revision 1.5
sys/arch/hppa/include/ieee.h: revision 1.10
lib/libc/arch/x86_64/gen/fpclassifyl.c: revision 1.3
lib/libc/arch/i386/gen/fpclassifyl.c: revision 1.2
sys/sys/ieee754.h: revision 1.7
lib/libc/gdtoa/gdtoa.h: revision 1.7
include/stdio.h: revision 1.67-1.68
lib/libc/gdtoa/hdtoa.c: revision 1.1-1.4
lib/libc/gdtoa/ldtoa.c: revision 1.1-1.4
defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.
Fix for issue reported in PR lib/35401 as well as related overflow bugs.
deal with hex doubles.
Instead of abusing stdio to get a signal-safe version of sprintf, provide one.
remove __SAFE
add long double and hex double support from freebsd.
make this compile.
add new prototypes.
add the new files to the build. Note I am not bumping libc now, because
these are not used yet.
Merge the int bit with the high fraction bit. Add constants/macros
needed by gdtoa.
add constants used by gdtoa
since the int bit is merged, do the explicit math.
ext_int bit is no more.
ext_int bit is no more.
- merge change from freebsd
- add support for building as vfprintf.c
- XXX: we strdup to simplify the freeing logic. This should be fixed for
efficiency in the vfprintf case.
use vfwprintf.c
enable wide doubles.
some int -> size_t
deal with sparc64 that has 112 bits of mantissa.
make extended precision gdtoa friendly.
int/size_t changes
make this gdtoa friendly.
remove dup definition
use dtoa() instead of returning empty when we don't have extended precision
information.
Fix previous, add forgotten pointer dereference in the call to dtoa().
Add a cheesy workaround marked XXX for the situation where the
strtod() implementation available in the environment does not
handle hex floats.
Discussed with and suggested by christos
From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
vax does not have <machine/ieee.h> or long double
It would be nice if the compiler provided something like __IEEE_MATH__
bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
 1.6.34.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.8 27-Jun-2006  drochner Build just the compatibility versions of frexp()/ldexp()/modf(), the
real implementation is in libm.
 1.7 04-Nov-2001  lukem fix WARNS=2 (-Wshadow) warnings
 1.6 10-Mar-1999  mycroft branches: 1.6.12;
Just some minor cleanup.
 1.5 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.4 13-Jul-1997  christos Add missing math.h include
Fix RCSIDs
 1.3 20-Dec-1996  cgd __asm rather than asm, for lint
 1.2 17-Feb-1995  jtc branches: 1.2.2;
Remove extra "u" constraint that caused gcc 2.6.3 not to compile this file.
Note that gcc 2.4.5, the compiler we are currently using, still compiles it
correctly after this change.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2.2.2 17-Feb-1995  jtc Remove extra "u" constraint that caused gcc 2.6.3 not to compile this file.
Note that gcc 2.4.5, the compiler we are currently using, still compiles it
correctly after this change.
 1.2.2.1 17-Feb-1995  jtc file ldexp.c was added on branch ivory_soap on 1995-02-17 06:01:48 +0000
 1.6.12.1 14-Nov-2001  nathanw Catch up to -current.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 11-May-2006  mrg branches: 1.3.18;
in makecontext(), sp is unsigned * so don't assign signed *'s to it.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 05-Mar-2001  nathanw branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.2 28-Jan-2002  nathanw A little more linting.
 1.1.2.1 05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.3.18.1 18-May-2008  yamt sync with head.
 1.4.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4.8.1 28-Apr-2008  martin file makecontext.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.7 27-Jun-2006  drochner Build just the compatibility versions of frexp()/ldexp()/modf(), the
real implementation is in libm.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.4 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.3 27-Jan-1994  mycroft Pedanticism.
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4 22-Feb-2009  martin Make NAN a compile time constant (with help from the compiler). Suggested
by krister. Fixes PR 40695.
Make references to the old construct (which we can't remove for binary
compatibility reasons) emit a linker warning.
 1.3 15-Apr-2005  kleink branches: 1.3.2; 1.3.32;
Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.

IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
 1.2 19-Feb-2002  simonb Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
- Use the above for the __infinity and __nan constants on all
architectures that use the standard ieee754 representation of
those constants.
- Add a single copy of various ieee754 math functions (frexp, isinf,
isnan, ldexp and modf) that had numerous duplicates among the
arch-specific directories.
- Use the above functions on all architectures where the generic C
versions where used. Architectures that had local assembly
routines are untouched (for those functions only).
 1.1 23-Dec-1999  kleink branches: 1.1.6;
C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
 1.1.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.32.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.3.2.2 19-Apr-2005  tron Pull up revision 1.3 (requested by kleink in ticket #163):
Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.
IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
 1.3.2.1 15-Apr-2005  tron file nanf.c was added on branch netbsd-3 on 2005-04-19 12:30:50 +0000
 1.9 03-May-2025  riastradh libc/i386: Omit needless __PIC__ conditionals.

No binary change.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.8 23-May-2014  uebayasi branches: 1.8.36;
Put missing END() markers to set ELF symbol size.
 1.7 12-Sep-2013  joerg branches: 1.7.2;
Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
 1.6 28-Apr-2008  martin branches: 1.6.4; 1.6.8; 1.6.28;
Remove clause 3 and 4 from TNF licenses
 1.5 08-Nov-2006  drochner branches: 1.5.16;
-check for a NULL uc_link before calling setcontext(2); do a real exit(3)
instead with exit handlers and all that
-If setcontext(2) returns (which it shouldn't), do an _exit(-1) rather
than relying on a sensible return value to use as exit code. Makes
it less likely that an ucontext corruption goes unnoticed.
 1.4 26-Jan-2003  kleink Update stack frame allocation for XMM state having been added to
mcontext_t; spotted by Frank van der Linden.
While here, also align the on-stack ucontext as required.
 1.3 26-Jan-2003  fvdl Fix comment that wasn't closed because of a typo (but harmless, since followed
by another comment).
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 05-Mar-2001  nathanw branches: 1.1.2;
file resumecontext.S was initially added on branch nathanw_sa.
 1.1.2.1 05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.5.16.1 18-May-2008  yamt sync with head.
 1.6.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6.8.1 28-Apr-2008  martin file resumecontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.6.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.2.1 10-Aug-2014  tls Rebase.
 1.8.36.1 02-Aug-2025  perseant Sync with HEAD
 1.19 03-May-2025  riastradh libc/i386: Omit needless __PIC__ conditionals.

No binary change.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.18 04-Apr-2024  riastradh branches: 1.18.2;
i386 longjmp: Restore stack first, then signal mask.

Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp

PR lib/57946
 1.17 23-May-2014  uebayasi branches: 1.17.26; 1.17.34;
Fix previous.
 1.16 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.15 12-Sep-2013  joerg branches: 1.15.2;
Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
 1.14 13-Sep-2005  christos branches: 1.14.44; 1.14.50;
compat core reorg.
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 13-Feb-1999  christos For don't mess up the stack before calling syscall when using PIC_PROLOGUE.
 1.11 08-Feb-1999  christos Amend for the PLT fixes, things broke last night with the changes to SYS.h
and cerror.S. In particular, the syscalls in the files committed below were
broken.
 1.10 01-Jul-1998  thorpej Generate C labels with _C_LABEL().
 1.9 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.8 28-Dec-1995  jtc Remove #include "SYS.h"; it is not needed (by normal assembly functions)
 1.7 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.6 24-Dec-1994  jtc Replaced pops with adds.
 1.5 27-Jan-1994  mycroft Pedanticism.
 1.4 21-Oct-1993  jtc So many files in arch/i386 have been changed I might as well run my
remove unecessary trailing whitespace script.
 1.3 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.2 20-Oct-1993  jtc Replaced instructions with immediate operands with compatible alternatives
saving a few bytes while the cycle count remains the same --- could
actually be faster, depending on the cache, prefetch queue, etc.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.14.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.44.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.2.1 10-Aug-2014  tls Rebase.
 1.17.34.1 23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #795):

tests/lib/libc/setjmp/Makefile: revision 1.3
distrib/sets/lists/debug/mi: revision 1.425
lib/libc/arch/sh3/gen/setjmp.S: revision 1.12
lib/libc/arch/i386/gen/sigsetjmp.S: revision 1.19
lib/libc/arch/x86_64/gen/__setjmp14.S: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.10
tests/lib/libc/setjmp/t_sigstack.c: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.12
tests/lib/libc/setjmp/t_sigstack.c: revision 1.1
lib/libc/arch/sh3/gen/sigsetjmp.S: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.2
tests/lib/libc/setjmp/t_sigstack.c: revision 1.3
tests/lib/libc/setjmp/t_sigstack.c: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.5
tests/lib/libc/setjmp/t_sigstack.c: revision 1.6
lib/libc/arch/arm/gen/setjmp.S: revision 1.19
tests/lib/libc/setjmp/t_sigstack.c: revision 1.7
tests/lib/libc/setjmp/t_sigstack.c: revision 1.8
tests/lib/libc/setjmp/t_sigstack.c: revision 1.9
lib/libc/arch/i386/gen/setjmp.S: revision 1.18
lib/libc/arch/x86_64/gen/__sigsetjmp14.S: revision 1.4
distrib/sets/lists/tests/mi: revision 1.1306

longjmp(3): Add test for PR lib/57946.

longjmp(3): Paranoia: more error checking in PR lib/57946 test.

longjmp(3): Test signal mask vs stack restore with siglongjmp too.
PR lib/57946

longjmp(3) t_sigstack: Print which entry failed.
PR lib/57946

longjmp(3) t_sigstack: Note aarch64 seems to DTRT.
But only by code inspection; it appears to have another problem: on
re-entry, the signal handler is called on the normal stack, not on
the alternate signal stack.
PR lib/57946

longjmp(3) t_sigstack: Use a sigaltstack per handler entry.
longjmp evidently doesn't reset the state of whether the process is
executing on the alternate signal stack. So when we re-enter the
signal handler, the alternate stack appears to be still in use, and
the system chooses the original stack for the second call to the
signal handler -- which trips our assertion asking to verify that the
signal handler is always using an alternate stack.

Not strictly necessary for the signal handler to use an alternate
stack on re-entry, but this makes it clearer that the signal handler
itself is always using the alternate stack so we can verify that the
interrupted code is _not_ in the signal handler.
With this change, the test now passes on aarch64.
PR lib/57946

longjmp(3) t_sigstack: Fix fencepost error.
Extremely unlikely to cause trouble, but let's just turn that into
`never' to keep it easier for readers.
PR lib/57946

amd64 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use `xorl %eXX,%eXX' instead of `xorq %rXX,%rXX'.
=> Same effect, one byte shorter, breaks dep chain on more uarches.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946

i386 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946

arm longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Move the botched sp and lr tests earlier.
PR lib/57946
arm has been fixed

tests/lib/libc/setjmp/t_sigstack: Add missing comment for 1.10.
PR lib/57946

sh3: siglongjmp - restore register context first (PR lib/57946)
 1.17.26.1 23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #795):

tests/lib/libc/setjmp/Makefile: revision 1.3
distrib/sets/lists/debug/mi: revision 1.425
lib/libc/arch/sh3/gen/setjmp.S: revision 1.12
lib/libc/arch/i386/gen/sigsetjmp.S: revision 1.19
lib/libc/arch/x86_64/gen/__setjmp14.S: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.10
tests/lib/libc/setjmp/t_sigstack.c: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.12
tests/lib/libc/setjmp/t_sigstack.c: revision 1.1
lib/libc/arch/sh3/gen/sigsetjmp.S: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.2
tests/lib/libc/setjmp/t_sigstack.c: revision 1.3
tests/lib/libc/setjmp/t_sigstack.c: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.5
tests/lib/libc/setjmp/t_sigstack.c: revision 1.6
lib/libc/arch/arm/gen/setjmp.S: revision 1.19
tests/lib/libc/setjmp/t_sigstack.c: revision 1.7
tests/lib/libc/setjmp/t_sigstack.c: revision 1.8
tests/lib/libc/setjmp/t_sigstack.c: revision 1.9
lib/libc/arch/i386/gen/setjmp.S: revision 1.18
lib/libc/arch/x86_64/gen/__sigsetjmp14.S: revision 1.4
distrib/sets/lists/tests/mi: revision 1.1306 (patch)

longjmp(3): Add test for PR lib/57946.

longjmp(3): Paranoia: more error checking in PR lib/57946 test.

longjmp(3): Test signal mask vs stack restore with siglongjmp too.
PR lib/57946

longjmp(3) t_sigstack: Print which entry failed.
PR lib/57946

longjmp(3) t_sigstack: Note aarch64 seems to DTRT.
But only by code inspection; it appears to have another problem: on
re-entry, the signal handler is called on the normal stack, not on
the alternate signal stack.
PR lib/57946

longjmp(3) t_sigstack: Use a sigaltstack per handler entry.
longjmp evidently doesn't reset the state of whether the process is
executing on the alternate signal stack. So when we re-enter the
signal handler, the alternate stack appears to be still in use, and
the system chooses the original stack for the second call to the
signal handler -- which trips our assertion asking to verify that the
signal handler is always using an alternate stack.

Not strictly necessary for the signal handler to use an alternate
stack on re-entry, but this makes it clearer that the signal handler
itself is always using the alternate stack so we can verify that the
interrupted code is _not_ in the signal handler.
With this change, the test now passes on aarch64.
PR lib/57946

longjmp(3) t_sigstack: Fix fencepost error.
Extremely unlikely to cause trouble, but let's just turn that into
`never' to keep it easier for readers.
PR lib/57946

amd64 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use `xorl %eXX,%eXX' instead of `xorq %rXX,%rXX'.
=> Same effect, one byte shorter, breaks dep chain on more uarches.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946

i386 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946

arm longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Move the botched sp and lr tests earlier.
PR lib/57946
arm has been fixed

tests/lib/libc/setjmp/t_sigstack: Add missing comment for 1.10.
PR lib/57946

sh3: siglongjmp - restore register context first (PR lib/57946)
 1.18.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 01-Mar-1995  mycroft Clean up deleted files.
 1.4 21-Oct-1993  jtc So many files in arch/i386 have been changed I might as well run my
remove unecessary trailing whitespace script.
 1.3 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.2 20-Oct-1993  jtc Replaced instructions with immediate operands with compatible alternatives
saving a few bytes while the cycle count remains the same --- could
actually be faster, depending on the cache, prefetch queue, etc.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.3 26-Apr-2019  maya Unify signbitl implementations.
(Unclear why they were different, it was only the comments that
differed)

Add a comment describing why the generic version works for both 80-bit
and 128-bit double.
 1.2 28-Apr-2008  martin branches: 1.2.8; 1.2.64;
Remove clause 3 and 4 from TNF licenses
 1.1 15-Jan-2004  kleink branches: 1.1.30;
Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.1.30.1 18-May-2008  yamt sync with head.
 1.2.64.1 10-Jun-2019  christos Sync with HEAD
 1.2.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2.8.1 28-Apr-2008  martin file signbitl.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.20 03-May-2025  riastradh libc/i386: Omit needless __PIC__ conditionals.

No binary change.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.19 04-Apr-2024  riastradh branches: 1.19.2;
i386 longjmp: Restore stack first, then signal mask.

Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp

PR lib/57946
 1.18 23-May-2014  uebayasi branches: 1.18.26; 1.18.34;
Put missing END() markers to set ELF symbol size.
 1.17 12-Sep-2013  joerg branches: 1.17.2;
Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
 1.16 13-Sep-2005  christos branches: 1.16.44; 1.16.50;
compat core reorg.
 1.15 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.14 22-Feb-1999  christos Don't use 1: label; it is uses by the PIC_PROLOGUE macro and we jmp in the
wrong place!
 1.13 13-Feb-1999  christos For don't mess up the stack before calling syscall when using PIC_PROLOGUE.
 1.12 08-Feb-1999  christos Amend for the PLT fixes, things broke last night with the changes to SYS.h
and cerror.S. In particular, the syscalls in the files committed below were
broken.
 1.11 01-Jul-1998  thorpej Generate C labels with _C_LABEL().
 1.10 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.9 28-Dec-1995  jtc Remove #include "SYS.h"; it is not needed (by normal assembly functions)
 1.8 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.7 24-Dec-1994  jtc Exchange offsets of "saved signal mask" and "signal mask saved" so
that the layout of sigjmp_bufs and jmp_bufs are the same (except
for the "signal mask saved" appended to the end).
 1.6 27-Jan-1994  mycroft Pedanticism.
 1.5 21-Oct-1993  jtc Use PIC_PLT macro with the function calls (as was done with setjmp()).
 1.4 21-Oct-1993  jtc So many files in arch/i386 have been changed I might as well run my
remove unecessary trailing whitespace script.
 1.3 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.2 20-Oct-1993  jtc Replaced instructions with immediate operands with compatible alternatives
saving a few bytes while the cycle count remains the same --- could
actually be faster, depending on the cache, prefetch queue, etc.
 1.1 19-Oct-1993  jtc sigsetjmp() for the i386.
 1.16.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.44.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.2.1 10-Aug-2014  tls Rebase.
 1.18.34.1 23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #795):

tests/lib/libc/setjmp/Makefile: revision 1.3
distrib/sets/lists/debug/mi: revision 1.425
lib/libc/arch/sh3/gen/setjmp.S: revision 1.12
lib/libc/arch/i386/gen/sigsetjmp.S: revision 1.19
lib/libc/arch/x86_64/gen/__setjmp14.S: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.10
tests/lib/libc/setjmp/t_sigstack.c: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.12
tests/lib/libc/setjmp/t_sigstack.c: revision 1.1
lib/libc/arch/sh3/gen/sigsetjmp.S: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.2
tests/lib/libc/setjmp/t_sigstack.c: revision 1.3
tests/lib/libc/setjmp/t_sigstack.c: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.5
tests/lib/libc/setjmp/t_sigstack.c: revision 1.6
lib/libc/arch/arm/gen/setjmp.S: revision 1.19
tests/lib/libc/setjmp/t_sigstack.c: revision 1.7
tests/lib/libc/setjmp/t_sigstack.c: revision 1.8
tests/lib/libc/setjmp/t_sigstack.c: revision 1.9
lib/libc/arch/i386/gen/setjmp.S: revision 1.18
lib/libc/arch/x86_64/gen/__sigsetjmp14.S: revision 1.4
distrib/sets/lists/tests/mi: revision 1.1306

longjmp(3): Add test for PR lib/57946.

longjmp(3): Paranoia: more error checking in PR lib/57946 test.

longjmp(3): Test signal mask vs stack restore with siglongjmp too.
PR lib/57946

longjmp(3) t_sigstack: Print which entry failed.
PR lib/57946

longjmp(3) t_sigstack: Note aarch64 seems to DTRT.
But only by code inspection; it appears to have another problem: on
re-entry, the signal handler is called on the normal stack, not on
the alternate signal stack.
PR lib/57946

longjmp(3) t_sigstack: Use a sigaltstack per handler entry.
longjmp evidently doesn't reset the state of whether the process is
executing on the alternate signal stack. So when we re-enter the
signal handler, the alternate stack appears to be still in use, and
the system chooses the original stack for the second call to the
signal handler -- which trips our assertion asking to verify that the
signal handler is always using an alternate stack.

Not strictly necessary for the signal handler to use an alternate
stack on re-entry, but this makes it clearer that the signal handler
itself is always using the alternate stack so we can verify that the
interrupted code is _not_ in the signal handler.
With this change, the test now passes on aarch64.
PR lib/57946

longjmp(3) t_sigstack: Fix fencepost error.
Extremely unlikely to cause trouble, but let's just turn that into
`never' to keep it easier for readers.
PR lib/57946

amd64 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use `xorl %eXX,%eXX' instead of `xorq %rXX,%rXX'.
=> Same effect, one byte shorter, breaks dep chain on more uarches.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946

i386 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946

arm longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Move the botched sp and lr tests earlier.
PR lib/57946
arm has been fixed

tests/lib/libc/setjmp/t_sigstack: Add missing comment for 1.10.
PR lib/57946

sh3: siglongjmp - restore register context first (PR lib/57946)
 1.18.26.1 23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #795):

tests/lib/libc/setjmp/Makefile: revision 1.3
distrib/sets/lists/debug/mi: revision 1.425
lib/libc/arch/sh3/gen/setjmp.S: revision 1.12
lib/libc/arch/i386/gen/sigsetjmp.S: revision 1.19
lib/libc/arch/x86_64/gen/__setjmp14.S: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.10
tests/lib/libc/setjmp/t_sigstack.c: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.12
tests/lib/libc/setjmp/t_sigstack.c: revision 1.1
lib/libc/arch/sh3/gen/sigsetjmp.S: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.2
tests/lib/libc/setjmp/t_sigstack.c: revision 1.3
tests/lib/libc/setjmp/t_sigstack.c: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.5
tests/lib/libc/setjmp/t_sigstack.c: revision 1.6
lib/libc/arch/arm/gen/setjmp.S: revision 1.19
tests/lib/libc/setjmp/t_sigstack.c: revision 1.7
tests/lib/libc/setjmp/t_sigstack.c: revision 1.8
tests/lib/libc/setjmp/t_sigstack.c: revision 1.9
lib/libc/arch/i386/gen/setjmp.S: revision 1.18
lib/libc/arch/x86_64/gen/__sigsetjmp14.S: revision 1.4
distrib/sets/lists/tests/mi: revision 1.1306 (patch)

longjmp(3): Add test for PR lib/57946.

longjmp(3): Paranoia: more error checking in PR lib/57946 test.

longjmp(3): Test signal mask vs stack restore with siglongjmp too.
PR lib/57946

longjmp(3) t_sigstack: Print which entry failed.
PR lib/57946

longjmp(3) t_sigstack: Note aarch64 seems to DTRT.
But only by code inspection; it appears to have another problem: on
re-entry, the signal handler is called on the normal stack, not on
the alternate signal stack.
PR lib/57946

longjmp(3) t_sigstack: Use a sigaltstack per handler entry.
longjmp evidently doesn't reset the state of whether the process is
executing on the alternate signal stack. So when we re-enter the
signal handler, the alternate stack appears to be still in use, and
the system chooses the original stack for the second call to the
signal handler -- which trips our assertion asking to verify that the
signal handler is always using an alternate stack.

Not strictly necessary for the signal handler to use an alternate
stack on re-entry, but this makes it clearer that the signal handler
itself is always using the alternate stack so we can verify that the
interrupted code is _not_ in the signal handler.
With this change, the test now passes on aarch64.
PR lib/57946

longjmp(3) t_sigstack: Fix fencepost error.
Extremely unlikely to cause trouble, but let's just turn that into
`never' to keep it easier for readers.
PR lib/57946

amd64 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use `xorl %eXX,%eXX' instead of `xorq %rXX,%rXX'.
=> Same effect, one byte shorter, breaks dep chain on more uarches.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946

i386 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946

arm longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:
- Move the botched sp and lr tests earlier.
PR lib/57946
arm has been fixed

tests/lib/libc/setjmp/t_sigstack: Add missing comment for 1.10.
PR lib/57946

sh3: siglongjmp - restore register context first (PR lib/57946)
 1.19.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 01-Mar-1995  mycroft Clean up deleted files.
 1.5 21-Oct-1993  jtc Use PIC_PLT macro with the function calls (as was done with setjmp()).
 1.4 21-Oct-1993  jtc So many files in arch/i386 have been changed I might as well run my
remove unecessary trailing whitespace script.
 1.3 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.2 20-Oct-1993  jtc Replaced instructions with immediate operands with compatible alternatives
saving a few bytes while the cycle count remains the same --- could
actually be faster, depending on the cache, prefetch queue, etc.
 1.1 19-Oct-1993  jtc sigsetjmp() for the i386.
 1.9 03-May-2025  riastradh libc/i386: Omit needless __PIC__ conditionals.

No binary change.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.8 23-May-2014  uebayasi branches: 1.8.36;
Put missing END() markers to set ELF symbol size.
 1.7 12-Sep-2013  joerg branches: 1.7.2;
Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
 1.6 28-Apr-2008  martin branches: 1.6.4; 1.6.8; 1.6.28;
Remove clause 3 and 4 from TNF licenses
 1.5 07-Apr-2003  kleink branches: 1.5.30;
Make sure we reference getcontext() by its internal name.
 1.4 07-Apr-2003  kleink Fix stack pointer fixup of oucp (a relict from times when this
was implemented entirely different, and then bit rot commenced).
 1.3 26-Jan-2003  fvdl Fix wrong %esp fixup.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 05-Mar-2001  nathanw branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.5.30.1 18-May-2008  yamt sync with head.
 1.6.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6.8.1 28-Apr-2008  martin file swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.6.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.2.1 10-Aug-2014  tls Rebase.
 1.8.36.1 02-Aug-2025  perseant Sync with HEAD
 1.7 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.6 07-Aug-2003  agc branches: 1.6.62; 1.6.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 16-Jul-1997  christos RCSID fixes: Always use the NetBSD rcsid and the macro RCSID() defined in
<machine/asm.h>; Also syscalls should be protected using the SYSLIBC_SCCS
define not LIBC_SCCS
 1.4 28-Dec-1995  jtc Use <machine/asm.h> instead of DEFS.h
 1.3 21-Oct-1993  jtc Gcc helper functions should still use the ENTRY() macro so they will be
show up in profiled code. (The gcc helper functions in the other ports
do this allready).
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6.74.1 10-Aug-2014  tls Rebase.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 21-Oct-1993  jtc Gcc helper functions should still use the ENTRY() macro so they will be
show up in profiled code. (The gcc helper functions in the other ports
do this allready).
 1.2 21-Oct-1993  jtc Change instances of LIBC_RCS back to LIBC_SCCS. If we are going to change
th LIBC_RCS, the entire source tree should be updated at once.
Remove && !defined(lint) from conditionals around rcs id's. No one is
ever going to pass a *.s file through lint.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it

RSS XML Feed