Home | History | Annotate | only in /src/lib/libc/arch
History log of /src/lib/libc/arch
RevisionDateAuthorComments
 1.3 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.2 15-Apr-2015  mrg remove various HAVE_GCC=45 fragments.
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.4 23-Jul-2023  skrll ENTRY / END indentation. NFCI.
 1.3 09-Mar-2019  christos Fix previous... We need to deal with a conditional branch.
 1.2 09-Mar-2019  christos We don't fit anymore thanks to jemalloc:
relocation truncated to fit: R_AARCH64_CONDBR19 against symbol `cerror'
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file SYS.h was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.5 23-Nov-2021  thorpej Because the PC is not a general purpose register on aarch64, we need
to use DWARF pseudo-register for the signal trampoline return address.

Adjust the style to match other platforms.
 1.4 17-Oct-2020  skrll Change x30 to lr for ease of reading

NFCI
 1.3 13-Oct-2020  kamil Decorate the aarch64 signal trampoline with CFI attributes easing unwinding

Now, the unwinders (in backtrace(3) and similar) can unwind properly
the stack from a signal handler.
 1.2 10-May-2020  skrll Don't futz with tpidr_el0 in {set,long}jmp as it breaks TLS as seen in
qemu
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.28;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.28.1 13-May-2020  martin Pull up following revision(s) (requested by skrll in ticket #901):

sys/arch/aarch64/include/setjmp.h: revision 1.2
lib/libc/arch/aarch64/genassym.cf: revision 1.2
lib/libc/arch/aarch64/gen/setjmp.S: revision 1.3
lib/libc/arch/aarch64/gen/_setjmp.S: revision 1.4

Don't futz with tpidr_el0 in {set,long}jmp as it breaks TLS as seen in
qemu
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file genassym.cf was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file arith.h was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.2 01-Aug-2018  ryo fix long double NaN definition.
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.24; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.24.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file gd_qnan.h was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.3 07-Jun-2024  riastradh libc: Pacify lint on aarch64.
 1.2 07-Jul-2015  matt Add the fpset* routines for tests
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.3 21-Nov-2018  skrll _REG_LR should be _lwp_exit
 1.2 04-Aug-2018  ryo need to set _UC_TLSBASE of uc_flags for _lwp_makecontext().
pointed out from skrll@. thanks.
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.24; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.24.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.24.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file _lwp.c was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.5 07-Oct-2021  skrll Fix the lib/libc/setjmp/t_setjmp:{,_}longjmp_zero test cases
 1.4 10-May-2020  skrll Don't futz with tpidr_el0 in {set,long}jmp as it breaks TLS as seen in
qemu
 1.3 28-Nov-2017  ryo branches: 1.3.6;
fix to work
* no need to check x29 != NULL. fp may be NULL.
* don't break in-use register x5.
 1.2 28-Nov-2017  ryo KNF. use tab
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file _setjmp.S was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.3.6.2 13-Oct-2021  martin Pull up following revision(s) (requested by skrll in ticket #1358):

lib/libc/arch/aarch64/gen/setjmp.S: revision 1.4
lib/libc/arch/aarch64/gen/_setjmp.S: revision 1.5

Fix the lib/libc/setjmp/t_setjmp:{,_}longjmp_zero test cases
 1.3.6.1 13-May-2020  martin Pull up following revision(s) (requested by skrll in ticket #901):

sys/arch/aarch64/include/setjmp.h: revision 1.2
lib/libc/arch/aarch64/genassym.cf: revision 1.2
lib/libc/arch/aarch64/gen/setjmp.S: revision 1.3
lib/libc/arch/aarch64/gen/_setjmp.S: revision 1.4

Don't futz with tpidr_el0 in {set,long}jmp as it breaks TLS as seen in
qemu
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file fabs_ieee754.S was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.2 08-Apr-2022  andvar fix various typos, mainly in comments, but also log messages, docs, game text.
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file flt_rounds.c was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.3 07-Jun-2024  riastradh libc: Pacify lint on aarch64.
 1.2 24-Dec-2016  maya don't use systm.h header, it's not available to userland.

as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.

ok riastradh
 1.1 05-Jul-2015  matt branches: 1.1.2;
Some test programs require these.
 1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.3 07-Jun-2024  riastradh libc: Pacify lint on aarch64.
 1.2 24-Dec-2016  maya don't use systm.h header, it's not available to userland.

as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.

ok riastradh
 1.1 05-Jul-2015  matt branches: 1.1.2;
Some test programs require these.
 1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.2 24-Dec-2016  maya don't use systm.h header, it's not available to userland.

as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.

ok riastradh
 1.1 05-Jul-2015  matt branches: 1.1.2;
Some test programs require these.
 1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.3 07-Jun-2024  riastradh libc: Pacify lint on aarch64.
 1.2 24-Dec-2016  maya don't use systm.h header, it's not available to userland.

as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.

ok riastradh
 1.1 07-Jul-2015  matt branches: 1.1.2;
Add the fpset* routines for tests
 1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.4 29-Oct-2024  riastradh fpsetround(3): Don't toggle all the other bits in fpcr on aarch64.

PR port-arm/58782: fpsetround flips all the other fpcsr bits on aarch64
 1.3 07-Jun-2024  riastradh branches: 1.3.2;
libc: Pacify lint on aarch64.
 1.2 24-Dec-2016  maya branches: 1.2.16; 1.2.24;
don't use systm.h header, it's not available to userland.

as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.

ok riastradh
 1.1 07-Jul-2015  matt branches: 1.1.2;
Add the fpset* routines for tests
 1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.2.24.1 01-Nov-2024  martin Pull up following revision(s) (requested by rin in ticket #996):

tests/lib/libc/gen/t_fpsetround.c: revision 1.7
tests/lib/libc/gen/t_fpsetround.c: revision 1.8
lib/libc/arch/aarch64/gen/fpsetround.c: revision 1.4

fpsetround(3): Test that this doesn't flip on FTZ by accident.
PR port-arm/58782: fpsetround flips all the other fpcsr bits on aarch64

fpsetround(3): Don't toggle all the other bits in fpcr on aarch64.
PR port-arm/58782: fpsetround flips all the other fpcsr bits on aarch64
 1.2.16.1 20-Nov-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1923):

tests/lib/libc/gen/t_fpsetround.c: revision 1.7
tests/lib/libc/gen/t_fpsetround.c: revision 1.8
lib/libc/arch/aarch64/gen/fpsetround.c: revision 1.4

fpsetround(3): Test that this doesn't flip on FTZ by accident.
PR port-arm/58782: fpsetround flips all the other fpcsr bits on aarch64

fpsetround(3): Don't toggle all the other bits in fpcr on aarch64.
PR port-arm/58782: fpsetround flips all the other fpcsr bits on aarch64
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 24-Dec-2016  maya don't use systm.h header, it's not available to userland.

as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.

ok riastradh
 1.1 07-Jul-2015  matt branches: 1.1.2;
Add the fpset* routines for tests
 1.1.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.2 16-Nov-2018  ryo fix type of argument for va_arg; don't round to 32bit.
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.24; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.24.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file makecontext.c was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file nanf.c was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file resumecontext.c was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.4 07-Oct-2021  skrll Fix the lib/libc/setjmp/t_setjmp:{,_}longjmp_zero test cases
 1.3 10-May-2020  skrll Don't futz with tpidr_el0 in {set,long}jmp as it breaks TLS as seen in
qemu
 1.2 28-Nov-2017  ryo branches: 1.2.6;
fix to work
* no need to check x29 != NULL. fp may be NULL.
* don't break in-use register x5.
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file setjmp.S was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.2.6.2 13-Oct-2021  martin Pull up following revision(s) (requested by skrll in ticket #1358):

lib/libc/arch/aarch64/gen/setjmp.S: revision 1.4
lib/libc/arch/aarch64/gen/_setjmp.S: revision 1.5

Fix the lib/libc/setjmp/t_setjmp:{,_}longjmp_zero test cases
 1.2.6.1 13-May-2020  martin Pull up following revision(s) (requested by skrll in ticket #901):

sys/arch/aarch64/include/setjmp.h: revision 1.2
lib/libc/arch/aarch64/genassym.cf: revision 1.2
lib/libc/arch/aarch64/gen/setjmp.S: revision 1.3
lib/libc/arch/aarch64/gen/_setjmp.S: revision 1.4

Don't futz with tpidr_el0 in {set,long}jmp as it breaks TLS as seen in
qemu
 1.2 12-Feb-2018  jakllsch Fix __siglongjmp14().

Fixes SIGINT causing ksh to "longjmp botch", presumably due to incorrect
magic number.
cvs: ----------------------------------------------------------------------
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file sigsetjmp.S was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.4 23-Nov-2018  skrll Update comments to help explain what's going on
 1.3 23-Nov-2018  skrll Fix so the setcontext call is via the PLT and libpthread can override
 1.2 21-Nov-2018  skrll Fix some register names in comments
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.24; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.24.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file swapcontext.S was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file aarch64-gcc.h was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file milieu.h was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.4 05-Oct-2022  nia libc: switch aarch64 to use softfloat functions from compiler_rt

The old definitions in qp.c being all grouped together in one file
causes problems when static linking with libgcc (i.e. cc --static-libgcc)
due to functions like __trunctfdf2 conflicting with libgcc, as seen in
PR 57021

We can also add some missing functions like __fixdfti for converting
a double to an int128_t, the lack of which is currently preventing webkit
from linking on aarch64, as seen in PR 57022

Unclear to me if libc is the right place for these functions, but
we can avoid breaking compatibility right now and maintain the status
quo while avoiding some obvious immediate problems.
nm output for libc shows no functions being removed by this change.
 1.3 27-Aug-2018  ryo delete __{ge,lt,gt,le,eq,ne,unordt}tf2.
these should not be defined in libc.

pointed out by joerg@. thanks.
 1.2 11-Aug-2018  ryo fix multiple definition of __{ge,lt,gt,le,eq,ne,unordt}tf2 in libc and libgcc.
this fixes the ATF call_once_static, call_once2_static, cxxruntime_static, static_destructor_static.
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.24; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.24.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file qp.c was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file softfloat-qp.h was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file softfloat-wrapper.c was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.2 06-Dec-2018  tih Summary: Align softfloat float128 with libgcc.

While libgcc adapts its float128 data structure to the endianness of
the architecture, the softfloat code in libc didn't. With both of
them handling the same values, softfloat must follow the toolchain.

OK: riastradh
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.24; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.24.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file softfloat.h was added on branch tls-maxphys on 2014-08-20 00:02:08 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 22-Nov-2018  ryo fix condition code. x1==0 is parent.
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.24; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.24.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file __clone.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file __sigaction14_sigtramp.c was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.7 23-Nov-2021  thorpej Because the PC is not a general purpose register on aarch64, we need
to use DWARF pseudo-register for the signal trampoline return address.

Adjust the style to match other platforms.
 1.6 24-Oct-2020  skrll Update the unwinder comment to better reflect ARM64
 1.5 24-Oct-2020  skrll s/ARM/ARM64/ in comment
 1.4 19-Oct-2020  kamil Restore SP from mcontext

Improves unwinding of multiple frames without frame pointer.
 1.3 17-Oct-2020  skrll Change x30 to lr for ease of reading

NFCI
 1.2 13-Oct-2020  kamil Decorate the aarch64 signal trampoline with CFI attributes easing unwinding

Now, the unwinders (in backtrace(3) and similar) can unwind properly
the stack from a signal handler.
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file __sigtramp2.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file __syscall.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file __vfork14.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 05-Feb-2019  mrg use adrp not adr, since the data is not pc-rel. fixes brk(2).
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file brk.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 12-Oct-2017  ryo return 0xffffffffffffffff (= -1). not 0x00000000ffffffff.
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file cerror.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.8; 1.1.12;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.1.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file exect.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file fork.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file getcontext.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 04-Feb-2018  skrll lower case 'ret' to avoid macro clash
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file pipe.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 20-Jul-2018  ryo fix a bug. no need postincrement here.
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.24; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 10-Jun-2019  christos Sync with HEAD
 1.1.24.1 28-Jul-2018  pgoyette Sync with HEAD
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file ptrace.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file sbrk.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1 10-Aug-2014  matt branches: 1.1.4;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file shmat.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.1 10-Aug-2014  matt branches: 1.1.4; 1.1.26;
Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
 1.1.26.1 21-Apr-2020  martin Sync with HEAD
 1.1.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.1 10-Aug-2014  tls file syscall.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.2 17-Oct-1996  cgd kill this. Just include <machine/asm.h> directly
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.21 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.20 26-Oct-2008  mrg branches: 1.20.4;
define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build.
 1.19 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.18 16-Sep-2005  drochner sigtramp1 moved to compat
 1.17 20-Apr-2005  jmc Don't use 'm4' here. Use $TOOL_M4 instead.
 1.16 25-May-2004  petrov Add current directory to inlcude pathes as it needed for generated assym.h.
 1.15 21-Mar-2004  matt Change longjmp to use setcontext instead of sigreturn14. Change setjmp
to use symbolic offsets via assym.h
 1.14 07-Oct-2003  skd Siginfo libc changes for alpha. Approved by thorpej@netbsd.org.
 1.13 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.12 27-Jan-2002  ross Drink ALL the Kool-Aid.

(Move -mieee from lib/ to bsd.*.mk; new var MKIEEEFP defaults to yes.)
 1.11 27-Jan-2002  thorpej On Alpha, build libc and libm with -mieee ... A metric crapload
of 3rd party software expects this.

XXX TODO: consider libm-fast for alpha that is not -mieee. Possibly
determine -mieee or not at run-time based on a bit in the executable
headers.
 1.10 15-Jan-1999  bouyer branches: 1.10.12;
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.9 04-Aug-1998  perry add memmove.S to libkern.
 1.8 22-Feb-1998  mycroft Copy up bcopy.S and memcpy.S.
 1.7 08-Nov-1997  thorpej LintAlpha* have been removed.
 1.6 21-Jun-1997  jtc branches: 1.6.2;
Simplify how division and remainder assembly source is generated
from divrem.m4.
 1.5 22-Dec-1996  cgd dd a bunch of files to LSRCS, which provide lint stubs for the functions
defined by machine-dependent assembly code.
 1.4 17-Oct-1996  cgd copy neither DEFS.h (it no longer exists) nor SYS.h (it's never been
necessary in libkern) to libkern any longer.
 1.3 15-Jul-1996  cgd add an assembly version of ffs().
 1.2 17-Apr-1996  cgd add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.6.2.1 08-Nov-1997  thorpej Update from trunk: LintAlpha* are gone.
 1.10.12.2 01-Aug-2002  nathanw Catch up to -current.
 1.10.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.20.4.2 26-Oct-2008  mrg define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build.
 1.20.4.1 26-Oct-2008  mrg file Makefile.inc was added on branch christos-time_t on 2008-10-26 07:43:08 +0000
 1.8 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.7 14-Jun-2000  cgd branches: 1.7.4;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.6 14-Jan-1999  kleink branches: 1.6.8;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.5 02-May-1997  kleink Consistency: distinguish between PSEUDO() and PSEUDO_NOERROR().
 1.4 17-Oct-1996  cgd update for new <machine/asm.h> and generally clean up:
rename SYSCALL_NOLABEL as CALLSYS_ERROR (for consistency with CALLSYS_NOERROR
now in asm.h), and implement it using CALLSYS_NOERROR.
reimplement SYSCALL, RSYSCALL, and PSEUDO to use the appropriate macros.
implement SYSCALL_NOERROR and RSYSCALL_NOERROR to do the same thing as
SYSCALL and RSYSCALL, but without the error checking/handling.
 1.3 15-Sep-1996  cgd reload GP _before_ error check+branch
 1.2 09-Sep-1996  cgd user better names for local labels, as suggested by Matt Thomas and
slightly tweaked.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.6.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.4.1 28-Jan-2002  nathanw Catch up to -current.
 1.3 21-Oct-2020  thorpej - Consistently use _REG_* defines from assym.h to mean register numbers,
not offsets (i.e. *8 to get the offset).
- Define and use SIZEOF_SIGINFO and UC_GREGS constants, rather than
hard-code magic numbers.

NFC -- same object code is generated.
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 21-Mar-2004  matt branches: 1.1.30;
Change longjmp to use setcontext instead of sigreturn14. Change setjmp
to use symbolic offsets via assym.h
 1.1.30.1 18-May-2008  yamt 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 genassym.cf was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.3 05-Nov-1997  cgd remove these, they are no longer necessary or appropriate
 1.2 13-Jul-1997  christos branches: 1.2.2;
Add missing stdlib.h include
 1.1 22-Dec-1996  cgd File which provides lint stubs for the functions defined by
machine-dependent assembly code, whose source files live in its directory.
(Not necessarily complete yet.)
 1.2.2.1 08-Nov-1997  thorpej Pull up from trunk: "...hey hey hey, goodbye!"
 1.22 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.21 28-Jun-2006  drochner build frexp/ldexp/modf in the "compat" part
(code is identical)
 1.20 16-Sep-2005  drochner some stuff went to compat
 1.19 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.18 04-Mar-2004  kleink branches: 1.18.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.17 01-Mar-2004  drochner we need a silly trampoline to make _resumecontext work
 1.16 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.15 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.14 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.13 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.12 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.11 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.10 21-Jan-2003  kleink Add swapcontext() lint stub.
 1.9 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 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 23-Dec-1999  kleink branches: 1.7.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.6 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.5 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 29-Sep-1998  thorpej Signal changes for Alpha.
 1.3 29-Apr-1995  cgd add entries for the float rounding and exception functions
 1.2 25-Feb-1995  cgd don't forget inifinity.c
 1.1 25-Feb-1995  cgd need these for new gen/Makefile
 1.7.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.7.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.7.6.1 17-Nov-2001  nathanw Alpha support for *context and LWPs.
 1.18.6.1 19-Apr-2005  tron Pull up revision 1.19 (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.8 25-May-2021  thorpej POSIX sez:
The longjmp() function shall not cause setjmp() to return 0; if val
is 0, setjmp() shall return 1.

Fixes the _longjmp_zero and longjmp_zero test cases in the t_setjmp
test on alpha.
 1.7 13-Mar-2013  martin branches: 1.7.36;
Remove clearing of ucontext_t, the only random register values now are
argument and scratch registers (which will be reloaded after return anyway).
 1.6 12-Mar-2013  martin Save the GP register value and restore it on longjmp.

While formally GP is not a callee-saved register, for static linking
the link time optimization described in section 3.2.3 of the "Calling
Standard for Alpha Systems" allows the caller to rely on GP being the
value needed within setjmp() - and not restore it after return if setjmp
and the call site share a GP value.

This fixes longjmp/setjmp for statically linked programs, e.g. /rescue/csh
or the static tcsh variant from pkgsrc.
 1.5 28-Apr-2008  martin branches: 1.5.4; 1.5.8; 1.5.24; 1.5.28; 1.5.30;
Remove clause 3 and 4 from TNF licenses
 1.4 14-Sep-2005  martin branches: 1.4.18;
Add missing <compat/include/setjmp.h>
 1.3 23-Mar-2004  simonb Put the jmpbuf's FPCR in the ucontext, not the other way around.
 1.2 23-Mar-2004  simonb Fix <tab> nits.
 1.1 21-Mar-2004  matt Change longjmp to use setcontext instead of sigreturn14. Change setjmp
to use symbolic offsets via assym.h
 1.4.18.1 18-May-2008  yamt sync with head.
 1.5.30.1 14-Mar-2013  riz Pull up following revision(s) (requested by martin in ticket #846):
lib/libc/arch/alpha/gen/__setjmp14.S: revision 1.6
lib/libc/arch/alpha/gen/__longjmp14.c: revision 1.6
lib/libc/arch/alpha/gen/__longjmp14.c: revision 1.7
Save the GP register value and restore it on longjmp.
While formally GP is not a callee-saved register, for static linking
the link time optimization described in section 3.2.3 of the "Calling
Standard for Alpha Systems" allows the caller to rely on GP being the
value needed within setjmp() - and not restore it after return if setjmp
and the call site share a GP value.
This fixes longjmp/setjmp for statically linked programs, e.g. /rescue/csh
or the static tcsh variant from pkgsrc.
Remove clearing of ucontext_t, the only random register values now are
argument and scratch registers (which will be reloaded after return anyway).
 1.5.28.1 23-Jun-2013  tls resync from head
 1.5.24.1 14-Mar-2013  riz Pull up following revision(s) (requested by martin in ticket #846):
lib/libc/arch/alpha/gen/__setjmp14.S: revision 1.6
lib/libc/arch/alpha/gen/__longjmp14.c: revision 1.6
lib/libc/arch/alpha/gen/__longjmp14.c: revision 1.7
Save the GP register value and restore it on longjmp.
While formally GP is not a callee-saved register, for static linking
the link time optimization described in section 3.2.3 of the "Calling
Standard for Alpha Systems" allows the caller to rely on GP being the
value needed within setjmp() - and not restore it after return if setjmp
and the call site share a GP value.
This fixes longjmp/setjmp for statically linked programs, e.g. /rescue/csh
or the static tcsh variant from pkgsrc.
Remove clearing of ucontext_t, the only random register values now are
argument and scratch registers (which will be reloaded after return anyway).
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file __longjmp14.c was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.5.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.36.1 31-May-2021  cjep sync with head
 1.9 06-Jul-2021  thorpej Ensure that the stack is always 16-byte aligned by rounding sizes as needed.

All changes from rin@ except swapcontext.S, which is from me (added
symbolic constants to make the code clearer).
 1.8 21-Oct-2020  thorpej - Consistently use _REG_* defines from assym.h to mean register numbers,
not offsets (i.e. *8 to get the offset).
- Define and use SIZEOF_SIGINFO and UC_GREGS constants, rather than
hard-code magic numbers.

NFC -- same object code is generated.
 1.7 23-Jan-2014  christos Use a constant in the text segment to avoid the .lit8 out of range relocation
error.
 1.6 12-Mar-2013  martin Save the GP register value and restore it on longjmp.

While formally GP is not a callee-saved register, for static linking
the link time optimization described in section 3.2.3 of the "Calling
Standard for Alpha Systems" allows the caller to rely on GP being the
value needed within setjmp() - and not restore it after return if setjmp
and the call site share a GP value.

This fixes longjmp/setjmp for statically linked programs, e.g. /rescue/csh
or the static tcsh variant from pkgsrc.
 1.5 12-Jun-2011  matt branches: 1.5.2; 1.5.4; 1.5.8; 1.5.10;
Use excb before and after the mt_fpcr/mf_fpcr instructions as specified
in the alpha ARM 4.7.8.1 (Accessing the FPCR):

Because Alpha floating-point hardware can overlap the execution of
a number of floating-point instructions, accessing the FPCR must
be synchronized with other floating-point instructions. An EXCB
instruction must be issued both prior to and after accessing the
FPCR to ensure that the FPCR access is synchronized with the
execution of previous and subsequent floating-point instructions;
otherwise synchronization is not ensured.

Use unions to convert between double and uint64_t to avoid casting.
 1.4 21-Mar-2004  matt branches: 1.4.54;
Change longjmp to use setcontext instead of sigreturn14. Change setjmp
to use symbolic offsets via assym.h
 1.3 07-Oct-2003  skd Siginfo libc changes for alpha. Approved by thorpej@netbsd.org.
 1.2 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 29-Sep-1998  thorpej branches: 1.1.8;
Signal changes for Alpha.
 1.1.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.54.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.5.10.1 14-Mar-2013  riz Pull up following revision(s) (requested by martin in ticket #846):
lib/libc/arch/alpha/gen/__setjmp14.S: revision 1.6
lib/libc/arch/alpha/gen/__longjmp14.c: revision 1.6
lib/libc/arch/alpha/gen/__longjmp14.c: revision 1.7
Save the GP register value and restore it on longjmp.
While formally GP is not a callee-saved register, for static linking
the link time optimization described in section 3.2.3 of the "Calling
Standard for Alpha Systems" allows the caller to rely on GP being the
value needed within setjmp() - and not restore it after return if setjmp
and the call site share a GP value.
This fixes longjmp/setjmp for statically linked programs, e.g. /rescue/csh
or the static tcsh variant from pkgsrc.
Remove clearing of ucontext_t, the only random register values now are
argument and scratch registers (which will be reloaded after return anyway).
 1.5.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.8.1 23-Jun-2013  tls resync from head
 1.5.4.1 14-Mar-2013  riz Pull up following revision(s) (requested by martin in ticket #846):
lib/libc/arch/alpha/gen/__setjmp14.S: revision 1.6
lib/libc/arch/alpha/gen/__longjmp14.c: revision 1.6
lib/libc/arch/alpha/gen/__longjmp14.c: revision 1.7
Save the GP register value and restore it on longjmp.
While formally GP is not a callee-saved register, for static linking
the link time optimization described in section 3.2.3 of the "Calling
Standard for Alpha Systems" allows the caller to rely on GP being the
value needed within setjmp() - and not restore it after return if setjmp
and the call site share a GP value.
This fixes longjmp/setjmp for statically linked programs, e.g. /rescue/csh
or the static tcsh variant from pkgsrc.
Remove clearing of ucontext_t, the only random register values now are
argument and scratch registers (which will be reloaded after return anyway).
 1.5.2.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.2 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 29-Sep-1998  thorpej branches: 1.1.8;
Signal changes for Alpha.
 1.1.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10 27-Apr-2025  riastradh lib/libc/arch/alpha: Say STACK_ALIGNBYTES, not 0xf, where relevant.

No functional change intended.

PR kern/59327: user stack pointer is not aligned properly
 1.9 27-Apr-2025  riastradh lib/libc/arch/alpha/gen/_lwp.c, makecontext.c: Sort includes.

No functional change intended.

Preparation for tidying for:

PR kern/59327: user stack pointer is not aligned properly
 1.8 06-Jul-2021  thorpej branches: 1.8.4;
Ensure that the stack is always 16-byte aligned by rounding sizes as needed.

All changes from rin@ except swapcontext.S, which is from me (added
symbolic constants to make the code clearer).
 1.7 12-Sep-2012  manu Fix the build, _UC_UNIQUE has been renamed _UC_TLSBASE
 1.6 24-Feb-2011  joerg branches: 1.6.4; 1.6.10;
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.5 28-Apr-2008  martin branches: 1.5.8; 1.5.20;
Remove clause 3 and 4 from TNF licenses
 1.4 12-Jun-2005  lukem branches: 1.4.18;
Add missing __RCSID()
 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 17-Nov-2001  nathanw branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.4 16-Jan-2003  thorpej Add missing notice.
 1.1.2.3 28-Jan-2002  nathanw Align the stack pointer.
 1.1.2.2 17-Dec-2001  nathanw Update to/to work with Klaus's mcontext code.
 1.1.2.1 17-Nov-2001  nathanw Alpha support for *context and LWPs.
 1.4.18.1 18-May-2008  yamt sync with head.
 1.5.20.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file _lwp.c was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.6.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.4.1 30-Oct-2012  yamt sync with head
 1.8.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 22-Apr-2008  dogcow branches: 1.3.8;
add matching END(). found via -Wa,--fatal-warnings
 1.2 01-Mar-2004  drochner branches: 1.2.30;
blow this up by sticking a copyright notice to it
 1.1 01-Mar-2004  drochner we need a silly trampoline to make _resumecontext work
 1.2.30.1 18-May-2008  yamt sync with head.
 1.3.8.2 22-Apr-2008  dogcow add matching END(). found via -Wa,--fatal-warnings
 1.3.8.1 22-Apr-2008  dogcow file _resumecontext.S was added on branch christos-time_t on 2008-04-22 04:47:45 +0000
 1.4 16-Sep-2005  drochner these went to compat
 1.3 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 17-Oct-1996  cgd branches: 1.2.12;
catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.2.12.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 22-Jan-1999  mycroft branches: 1.2.8;
Use insbl to reduce by 1 instruction.
 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.2.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.3 22-Jan-1999  mycroft branches: 1.3.8;
Whitespace fix.
 1.2 22-Jan-1999  mycroft Use insbl to reduce by 1 instruction.
 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.3.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9 21-Jan-2002  ross Don't intentionally enable integer overflow traps (ITOH Yasufumi)
Closes port-alpha/10065
 1.8 14-Jun-2000  cgd branches: 1.8.4;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.7 17-Oct-1996  cgd branches: 1.7.12;
catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.6 09-Sep-1996  cgd remove unused local label
 1.5 30-Sep-1995  cgd deal properly (i hope!) with registers' upper 32 bits, when doing
32-bit division and remainder. Sometimes, when optimizing, they could
have been different than previously expected (and could have caused
hokey results).
 1.4 30-Sep-1995  cgd kill some now-bogus XXX's
 1.3 14-Aug-1995  cgd save & restore the argument registers, too. from Trevor Blackwell
 1.2 25-Feb-1995  cgd strange corner cases:
(1) zero top 32 bits for 32-bit unsigned ops; 32-bit value can
be accidentally(?) sign-extended by the compiler/assembler.
(2) fix return value for mod's that cause traps
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.7.12.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.8.4.1 28-Jan-2002  nathanw Catch up to -current.
 1.4 07-Nov-2018  riastradh On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.

For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm. For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64. Need help from an itanium
wizard! Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.
 1.3 14-Jun-2000  cgd branches: 1.3.102; 1.3.104;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 17-Oct-1996  cgd branches: 1.2.12;
catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.2.12.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.104.1 10-Jun-2019  christos Sync with HEAD
 1.3.102.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.10 03-Aug-2014  wiz defintion -> definition
 1.9 12-Jun-2011  matt branches: 1.9.8; 1.9.18;
Use excb before and after the mt_fpcr/mf_fpcr instructions as specified
in the alpha ARM 4.7.8.1 (Accessing the FPCR):

Because Alpha floating-point hardware can overlap the execution of
a number of floating-point instructions, accessing the FPCR must
be synchronized with other floating-point instructions. An EXCB
instruction must be issued both prior to and after accessing the
FPCR to ensure that the FPCR access is synchronized with the
execution of previous and subsequent floating-point instructions;
otherwise synchronization is not ensured.

Use unions to convert between double and uint64_t to avoid casting.
 1.8 24-Dec-2005  perry branches: 1.8.42;
__asm__ -> __asm
 1.7 12-Jun-2005  lukem Add missing __RCSID()
 1.6 27-Jul-2003  mrg add a cast appease gcc3.3
 1.5 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.4 14-Jun-2000  cgd sweep of my licenses (userland files w/o only my copyright) for
consistency. (no functional changes)
 1.3 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 18-Jul-1997  thorpej branches: 1.2.10;
Pull in __flt_rounds() prototype.
 1.1 29-Apr-1995  cgd get & set FP rounding direction. these actually seem to work.
 1.2.10.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.8.42.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 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.5 12-Jun-2005  lukem Add missing __RCSID()
 1.4 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.3 26-Apr-2001  ross minor cleanup
 1.2 30-Apr-1999  ross branches: 1.2.10;
* New MI man page for fp{set,get}{round,sticky,mask}(3).
* Implement fpgetsticky() for alpha.
* Direct fpsetsticky() and fp{get,set}mask() into alpha kernel via sysarch(2).
* Define new sysarch(2) stub for above and install and distribute sysarch.h
for alpha. (The fpcr IS user mode r/w, but for reasons beyond the scope
of a commit message kernel calls are needed.) And much kernel Magick is
required before these do anything, but this way programs compiled under
1.4 will DTRT on future snapshots and releases.
 1.1 29-Apr-1995  cgd branches: 1.1.12;
functions to set FP exception masks & sticky exceptions. they abort, for now.
 1.1.12.1 30-Apr-1999  perry pullup 1.1->1.2 (ross)
 1.2.10.2 28-Jan-2002  nathanw Catch up to -current.
 1.2.10.1 08-Oct-2001  nathanw Catch up to -current.
 1.11 21-Mar-2012  he Add some casts to get rid of "bitwise op on signed value is non-portable"
warning from lint.
 1.10 12-Jun-2011  matt branches: 1.10.2;
Use excb before and after the mt_fpcr/mf_fpcr instructions as specified
in the alpha ARM 4.7.8.1 (Accessing the FPCR):

Because Alpha floating-point hardware can overlap the execution of
a number of floating-point instructions, accessing the FPCR must
be synchronized with other floating-point instructions. An EXCB
instruction must be issued both prior to and after accessing the
FPCR to ensure that the FPCR access is synchronized with the
execution of previous and subsequent floating-point instructions;
otherwise synchronization is not ensured.

Use unions to convert between double and uint64_t to avoid casting.
 1.9 24-Dec-2005  perry branches: 1.9.42;
__asm__ -> __asm
 1.8 12-Jun-2005  lukem Add missing __RCSID()
 1.7 27-Jul-2003  mrg add a cast appease gcc3.3
 1.6 26-Jul-2003  salo netbsd.org->NetBSD.org
 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 26-Apr-2001  ross remove the trapb ops bracketing mf_fpcr, in this one case they aren't needed
 1.3 14-Jun-2000  cgd branches: 1.3.4;
sweep of my licenses (userland files w/o only my copyright) for
consistency. (no functional changes)
 1.2 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 29-Apr-1995  cgd branches: 1.1.18;
get & set FP rounding direction. these actually seem to work.
 1.1.18.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.4.2 28-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 08-Oct-2001  nathanw Catch up to -current.
 1.9.42.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.9 10-May-2008  martin branches: 1.9.6;
Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.8 28-Apr-2008  martin branches: 1.8.2;
Remove clause 3 and 4 from TNF licenses
 1.7 12-Jun-2005  lukem Add missing __RCSID()
 1.6 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.5 26-Apr-2001  ross Complete rewrite. Call the new sysarch(ALPHA_FPGETSTICKY, ...).
 1.4 14-Jun-2000  cgd branches: 1.4.4;
sweep of my licenses (userland files w/o only my copyright) for
consistency. (no functional changes)
 1.3 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 30-Apr-1999  ross branches: 1.2.6;
* New MI man page for fp{set,get}{round,sticky,mask}(3).
* Implement fpgetsticky() for alpha.
* Direct fpsetsticky() and fp{get,set}mask() into alpha kernel via sysarch(2).
* Define new sysarch(2) stub for above and install and distribute sysarch.h
for alpha. (The fpcr IS user mode r/w, but for reasons beyond the scope
of a commit message kernel calls are needed.) And much kernel Magick is
required before these do anything, but this way programs compiled under
1.4 will DTRT on future snapshots and releases.
 1.1 29-Apr-1995  cgd branches: 1.1.12;
functions to set FP exception masks & sticky exceptions. they abort, for now.
 1.1.12.1 30-Apr-1999  perry pullup 1.1->1.2 (ross)
 1.2.6.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.4.2 28-Jan-2002  nathanw Catch up to -current.
 1.4.4.1 08-Oct-2001  nathanw Catch up to -current.
 1.8.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.9.6.2 10-May-2008  martin Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.9.6.1 10-May-2008  martin file fpgetsticky.c was added on branch christos-time_t on 2008-05-10 15:31:05 +0000
 1.5 02-Nov-2013  christos fix old style decls
 1.4 12-Jun-2005  lukem branches: 1.4.44; 1.4.50;
Add missing __RCSID()
 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 30-Apr-1999  ross branches: 1.2.10;
* New MI man page for fp{set,get}{round,sticky,mask}(3).
* Implement fpgetsticky() for alpha.
* Direct fpsetsticky() and fp{get,set}mask() into alpha kernel via sysarch(2).
* Define new sysarch(2) stub for above and install and distribute sysarch.h
for alpha. (The fpcr IS user mode r/w, but for reasons beyond the scope
of a commit message kernel calls are needed.) And much kernel Magick is
required before these do anything, but this way programs compiled under
1.4 will DTRT on future snapshots and releases.
 1.1 29-Apr-1995  cgd branches: 1.1.12;
functions to set FP exception masks & sticky exceptions. they abort, for now.
 1.1.12.1 30-Apr-1999  perry pullup 1.1->1.2 (ross)
 1.2.10.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.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.12 21-Mar-2012  he Add some casts to get rid of "bitwise op on signed value is non-portable"
warning from lint.
 1.11 12-Jun-2011  matt branches: 1.11.2;
Use excb before and after the mt_fpcr/mf_fpcr instructions as specified
in the alpha ARM 4.7.8.1 (Accessing the FPCR):

Because Alpha floating-point hardware can overlap the execution of
a number of floating-point instructions, accessing the FPCR must
be synchronized with other floating-point instructions. An EXCB
instruction must be issued both prior to and after accessing the
FPCR to ensure that the FPCR access is synchronized with the
execution of previous and subsequent floating-point instructions;
otherwise synchronization is not ensured.

Use unions to convert between double and uint64_t to avoid casting.
 1.10 24-Dec-2005  perry branches: 1.10.42;
__asm__ -> __asm
 1.9 12-Jun-2005  lukem Add missing __RCSID()
 1.8 27-Jul-2003  mrg add a cast appease gcc3.3
 1.7 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.6 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.5 26-Apr-2001  ross tweak barrier ops some more
 1.4 26-Apr-2001  ross Delete the trapb ops bracketing mf_fpcr, they aren't needed.
Change the trapb ops bracketing mt_fpcr to excb ops.
 1.3 14-Jun-2000  cgd branches: 1.3.4;
sweep of my licenses (userland files w/o only my copyright) for
consistency. (no functional changes)
 1.2 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 29-Apr-1995  cgd branches: 1.1.18;
get & set FP rounding direction. these actually seem to work.
 1.1.18.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.4.2 28-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 08-Oct-2001  nathanw Catch up to -current.
 1.10.42.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.11.2.1 17-Apr-2012  yamt sync with head
 1.5 02-Nov-2013  christos fix old style decls
 1.4 12-Jun-2005  lukem branches: 1.4.44; 1.4.50;
Add missing __RCSID()
 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 30-Apr-1999  ross branches: 1.2.10;
* New MI man page for fp{set,get}{round,sticky,mask}(3).
* Implement fpgetsticky() for alpha.
* Direct fpsetsticky() and fp{get,set}mask() into alpha kernel via sysarch(2).
* Define new sysarch(2) stub for above and install and distribute sysarch.h
for alpha. (The fpcr IS user mode r/w, but for reasons beyond the scope
of a commit message kernel calls are needed.) And much kernel Magick is
required before these do anything, but this way programs compiled under
1.4 will DTRT on future snapshots and releases.
 1.1 29-Apr-1995  cgd branches: 1.1.12;
functions to set FP exception masks & sticky exceptions. they abort, for now.
 1.1.12.1 30-Apr-1999  perry pullup 1.1->1.2 (ross)
 1.2.10.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.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.5 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.4 29-Aug-1999  mycroft branches: 1.4.10;
Trivial KNF.
 1.3 29-Aug-1999  mycroft Make the C version of frexp() consitent across platforms, and handle the
Inf/NaN case.
 1.2 10-Mar-1999  mycroft Just some minor cleanup.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.4.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.7 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.6 14-Jun-2000  cgd branches: 1.6.4;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.5 25-Apr-2000  erh branches: 1.5.2;
Fix unaligned accesses more correctly.
 1.4 25-Apr-2000  erh Fix unaligned accesses.
 1.3 14-Nov-1998  christos delint
 1.2 26-Jul-1998  mycroft const poisoning.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.5.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.4.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 22-Jan-2000  mycroft branches: 1.5.6;
Delint.
 1.4 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.3 14-Nov-1998  christos delint
 1.2 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.1 10-Feb-1995  cgd branches: 1.1.2;
libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.1.2.1 18-Apr-1995  jtc namespace protect isnan() and isinf()
 1.5.6.1 08-Mar-2002  nathanw Catch up to -current.
 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.11 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.10 08-Nov-2001  enami Fix -Wshadow warnings.
 1.9 30-Aug-1999  mycroft branches: 1.9.10;
Another microoptimization. Take advantage of the addition already having set
the flags for the <=0 comparison.
 1.8 30-Aug-1999  mycroft Reuse the trick of loading 0.0 (rather than 1.0) and then modifying the
exponent. It's a bit faster on some machines.
 1.7 30-Aug-1999  augustss Remove more unused mulexp variables.
 1.6 29-Aug-1999  mycroft ldexp(denormal, exp>1023) would generate the wrong result in all non-overflow
cases. Totally rework this code to fix this bug *and* make it faster.
 1.5 29-Aug-1999  mycroft Don't ever return -0.0.
 1.4 29-Aug-1999  mycroft Minor style change.
 1.3 29-Aug-1999  mycroft Sync with SPARC version.
 1.2 10-Mar-1999  mycroft Just some minor cleanup.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.9.10.2 08-Mar-2002  nathanw Catch up to -current.
 1.9.10.1 14-Nov-2001  nathanw Catch up to -current.
 1.9 27-Apr-2025  riastradh lib/libc/arch/alpha: Say STACK_ALIGNBYTES, not 0xf, where relevant.

No functional change intended.

PR kern/59327: user stack pointer is not aligned properly
 1.8 27-Apr-2025  riastradh lib/libc/arch/alpha/gen/_lwp.c, makecontext.c: Sort includes.

No functional change intended.

Preparation for tidying for:

PR kern/59327: user stack pointer is not aligned properly
 1.7 06-Jul-2021  thorpej branches: 1.7.4;
Ensure that the stack is always 16-byte aligned by rounding sizes as needed.

All changes from rin@ except swapcontext.S, which is from me (added
symbolic constants to make the code clearer).
 1.6 20-Sep-2011  joerg Explicitly add back __resumecontext wrapper
 1.5 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 01-Mar-2004  drochner branches: 1.3.30;
we need a silly trampoline to make _resumecontext work
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 17-Nov-2001  nathanw branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.3 06-Dec-2002  nathanw Set the PV register as well as the PC so that gp-loads work in the
called function.
 1.1.2.2 17-Dec-2001  nathanw Update to/to work with Klaus's mcontext code.
 1.1.2.1 17-Nov-2001  nathanw Alpha support for *context and LWPs.
 1.3.30.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:56 +0000
 1.7.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 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.3 14-Jun-2000  cgd branches: 1.3.4;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 13-Mar-2000  soren branches: 1.2.2;
Fix doubled 'the's.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.2.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.4.1 08-Mar-2002  nathanw Catch up to -current.
 1.5 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.4 15-Apr-2005  kleink branches: 1.4.2; 1.4.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.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 21-Jan-2002  ross Align __nanf[] object with (sigh) gnuisms
 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.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.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.4.2.2 19-Apr-2005  tron Pull up revision 1.4 (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.4.2.1 15-Apr-2005  tron file nanf.c was added on branch netbsd-3 on 2005-04-19 12:31:03 +0000
 1.5 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Nov-2006  drochner branches: 1.3.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.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 17-Nov-2001  nathanw branches: 1.1.2;
file resumecontext.c was initially added on branch nathanw_sa.
 1.1.2.2 17-Dec-2001  nathanw Update to/to work with Klaus's mcontext code.
 1.1.2.1 17-Nov-2001  nathanw Alpha support for *context and LWPs.
 1.3.16.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.5 16-Sep-2005  drochner these went to compat
 1.4 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.3 05-Dec-1997  thorpej branches: 1.3.8;
Make setjmp() work again after the changes to sigaltstack().
 1.2 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.3.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4 16-Sep-2005  drochner these went to compat
 1.3 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 17-Oct-1996  cgd branches: 1.2.12;
catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.2.12.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5 06-Jul-2021  thorpej Ensure that the stack is always 16-byte aligned by rounding sizes as needed.

All changes from rin@ except swapcontext.S, which is from me (added
symbolic constants to make the code clearer).
 1.4 21-Oct-2020  thorpej - Consistently use _REG_* defines from assym.h to mean register numbers,
not offsets (i.e. *8 to get the offset).
- Define and use SIZEOF_SIGINFO and UC_GREGS constants, rather than
hard-code magic numbers.

NFC -- same object code is generated.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 17-Nov-2001  nathanw branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.3 05-Nov-2002  nathanw Adjust the saved RA as well as the saved PC.
Fixes crash in test cu5.
 1.1.2.2 17-Dec-2001  nathanw Update to/to work with Klaus's mcontext code.
 1.1.2.1 17-Nov-2001  nathanw Alpha support for *context and LWPs.
 1.2.30.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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.1 05-Sep-2000  thorpej Move the Alpha _mcount() into a .S file so that it can be
pre-processed, like other Alpha assembly files.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 05-Sep-2000  thorpej Move the Alpha _mcount() into a .S file so that it can be
pre-processed, like other Alpha assembly files.
 1.2 05-Nov-1997  cgd remove these, they are no longer necessary or appropriate
 1.1 22-Dec-1996  cgd branches: 1.1.2;
File which provides lint stubs for the functions defined by
machine-dependent assembly code, whose source files live in its directory.
(Not necessarily complete yet.)
 1.1.2.1 08-Nov-1997  thorpej Pull up from trunk: "...hey hey hey, goodbye!"
 1.5 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.4 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.3 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.2 17-Apr-1996  cgd add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
 1.1 25-Feb-1995  cgd need these now, with new net Makefile.inc
 1.3 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.2 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 17-Apr-1996  cgd add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
 1.3 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.2 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 17-Apr-1996  cgd add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
 1.2 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.1 17-Apr-1996  cgd add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
 1.2 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.1 17-Apr-1996  cgd add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
 1.2 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.1 17-Apr-1996  cgd add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
 1.2 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.1 17-Apr-1996  cgd add assembler versions of the byte swap macros (only compile ntoh and
hton variants, not byte_swap variants, which are just included), and
copy them to libkern when appropriate.
 1.5 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.4 04-Aug-2008  matt branches: 1.4.6;
Add C99 functions imaxabs and imaxdiv.
 1.3 22-Mar-2006  drochner branches: 1.3.20;
build erand48_ieee754.c on everything but vax
 1.2 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1 05-Nov-1997  cgd branches: 1.1.2;
A foolish consistency... gen, net, and string all get MD sources
specified by including a Makefile.inc from the appropriate MD directory.
stdlib doesn't do that, but there's no reason that it shouldn't (and
it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>A foolish consistency... gen, net, and string all get MD sources
>specified by including a Makefile.inc from the appropriate MD directory.
>stdlib doesn't do that, but there's no reason that it shouldn't (and
>it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.1 05-Nov-1997  veego file Makefile.inc was added on branch netbsd-1-3 on 1997-11-08 21:56:35 +0000
 1.3.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.2 05-Nov-1997  cgd remove these, they are no longer necessary or appropriate
 1.1 22-Dec-1996  cgd branches: 1.1.2;
File which provides lint stubs for the functions defined by
machine-dependent assembly code, whose source files live in its directory.
(Not necessarily complete yet.)
 1.1.2.1 08-Nov-1997  thorpej Pull up from trunk: "...hey hey hey, goodbye!"
 1.6 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.5 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.4 15-Jul-1996  cgd add an assembly version of ffs().
 1.3 14-Aug-1995  cgd fast(!) bzero(), by Trevor Blackwell.
 1.2 13-Aug-1995  cgd bcopy is now a .S, add memcpy.S and memmove.S
 1.1 20-Mar-1995  mycroft Separate machine dependencies.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.3 17-Oct-1996  cgd branches: 1.3.12;
catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.2 26-Sep-1995  cgd return dest string pointer, not source string pointer!
 1.1 13-Aug-1995  cgd Alpha assembly language bcopy(), written by Trevor Blackwell
<tlb@eecs.harvard.edu>. I added support for using it as memcpy()
and memmove(), by compiling with the appropriate options.
 1.3.12.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 14-Aug-1995  cgd fast(!) bzero(), by Trevor Blackwell.
 1.7 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.6 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.5 14-Jun-2000  cgd sweep of my licenses (userland files w/o only my copyright) for
consistency. (no functional changes)
 1.4 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.3 17-Oct-1996  cgd branches: 1.3.12;
catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.2 15-Jul-1996  cgd pull up bug fix from libkern:
>frob the mask so that only the low set bit is set, to avoid lossage.
 1.1 15-Jul-1996  cgd add an assembly version of ffs().
 1.3.12.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 13-Aug-1995  cgd stubs to define things, and include the bcopy source
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 13-Aug-1995  cgd stubs to define things, and include the bcopy source
 1.2 05-Nov-1997  cgd remove these, they are no longer necessary or appropriate
 1.1 22-Dec-1996  cgd branches: 1.1.2;
File which provides lint stubs for the functions defined by
machine-dependent assembly code, whose source files live in its directory.
(Not necessarily complete yet.)
 1.1.2.1 08-Nov-1997  thorpej Pull up from trunk: "...hey hey hey, goodbye!"
 1.4 16-Sep-2005  drochner these went to compat
 1.3 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 02-Dec-1998  thorpej branches: 1.2.8;
Warn about references to the compatibility vfork() (i.e. the vfork() with
the 4.4BSD non-shared-address-space semantics), and direct the user to
include <unistd.h> to generate the correct reference.

This warning isn't about an ABI compatibility issue, but the new vfork() is
considerably faster.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.2.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 29-Apr-2007  msaitoh branches: 1.2.10;
fix typos
 1.1 17-Jul-2001  thorpej branches: 1.1.2;
Add a __clone(3) entry point.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 17-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:16:53 +0000
 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 __clone.S was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.2 16-Sep-2005  drochner these went to compat
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.8 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.7 28-Apr-2008  martin branches: 1.7.8;
Remove clause 3 and 4 from TNF licenses
 1.6 19-Feb-2006  christos branches: 1.6.18;
make these consistent.
 1.5 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.4 18-Oct-2003  christos sync with the x86 one.
 1.3 07-Oct-2003  skd Siginfo libc changes for alpha. Approved by thorpej@netbsd.org.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:27:54 +0000
 1.6.18.1 18-May-2008  yamt sync with head.
 1.7.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.5 16-Sep-2005  drochner these went to compat
 1.4 26-Mar-2004  drochner fix siginfo adaption -- the "compat_16" prefix
shouldn't be exposed as a symbol
 1.3 07-Oct-2003  skd Siginfo libc changes for alpha. Approved by thorpej@netbsd.org.
 1.2 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 29-Sep-1998  thorpej branches: 1.1.8;
Signal changes for Alpha.
 1.1.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4 16-Sep-2005  drochner these went to compat
 1.3 26-Mar-2004  drochner no need to define __HAVE_SIGINFO anymore
 1.2 07-Oct-2003  skd Siginfo libc changes for alpha. Approved by thorpej@netbsd.org.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:27:54 +0000
 1.8 20-Nov-2021  thorpej Use the DWARF pseudo-register for the signal trampoline return address.
 1.7 03-Nov-2021  thorpej CFI: Saved RA needs to point to the PC slot in the ucontext_t.
 1.6 03-Nov-2021  thorpej Set up the CFI in a slightly more rational way.
 1.5 21-Oct-2020  thorpej Fix typo (thanks kamil@ for pointing it out).
 1.4 21-Oct-2020  thorpej Add call frame unwind info to the Alpha signal trampoline. Using
kamil@'s test program:

Before:
Backtrace 2 stack frames.
0x120000a74 <handler+0x54> at ./test
0x3fffdca6550 <__sigtramp_siginfo_2> at /usr/lib/libc.so.12

After:
Backtrace 4 stack frames.
0x120000a74 <handler+0x54> at ./test
0x3fffdca6554 <__sigtramp_siginfo_2> at /usr/lib/libc.so.12
0x120000b10 <main+0x38> at ./test
0x1200009b4 <___start+0x1a4> at ./test
 1.3 21-Oct-2020  thorpej - Consistently use _REG_* defines from assym.h to mean register numbers,
not offsets (i.e. *8 to get the offset).
- Define and use SIZEOF_SIGINFO and UC_GREGS constants, rather than
hard-code magic numbers.

NFC -- same object code is generated.
 1.2 08-Nov-2006  drochner if setcontext(2) returns, _exit(2) with a return code of -1 instead
of relying on a sensible return value
 1.1 07-Oct-2003  skd Siginfo libc changes for alpha. Approved by thorpej@netbsd.org.
 1.1 13-Dec-2000  mycroft Add the obvious, trivial __syscall() stub.
 1.2 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 04-Jan-1998  thorpej branches: 1.1.8;
Add syscall stubs for __vfork14(). These are basically copies of Ovfork.S
with the syscall numbers changed.

Since 4.4BSD vfork(2) did not share address space, Ovfork.S could be changed
to be identical to fork.S (modulo syscall numbers). __vfork14.S, however,
needs to remain separate since with a shared address space, the stub needs to
pre-decrement the stack and do an indirect jump to the return address, so that
the shared stackframe is still there when the parent returns. (Obviously,
this does not apply to systems which to not build stackframes on leaf calls.)
 1.1.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9 07-May-2001  kleink Make the END() argument match the entry name.
 1.8 26-Jun-2000  kleink branches: 1.8.2;
Thinko in previous: we do always use an internal name.
 1.7 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.6 14-Jun-2000  cgd branches: 1.6.2;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.5 14-Jan-1999  kleink branches: 1.5.8;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.4 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.3 09-Sep-1996  cgd user better names for local labels, as suggested by Matt Thomas and
slightly tweaked.
 1.2 04-Nov-1995  cgd be more conservative when setting the gp
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.5.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.2.1 21-Aug-2000  kleink Pull up revs. 1.7-1.8 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.8.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.5 14-Jan-1999  kleink branches: 1.5.8;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.4 08-Nov-1996  cgd if _REENTRANT is defined, store the error value in (*__errno()), rather than
in errno directly, to support threads packages.
 1.3 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.2 09-Sep-1996  cgd user better names for local labels, as suggested by Matt Thomas and
slightly tweaked.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.5.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.3 14-Jun-2000  cgd branches: 1.3.86; 1.3.90;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 17-Oct-1996  cgd branches: 1.2.12;
catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.2.12.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.90.1 21-Apr-2017  bouyer Sync with HEAD
 1.3.86.1 20-Mar-2017  pgoyette Sync with HEAD
 1.5 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.4 07-May-2001  kleink Make the END() argument match the entry name.
 1.3 26-Jun-2000  kleink branches: 1.3.2;
Need an internal name for fork().
 1.2 14-Jun-2000  cgd branches: 1.2.2;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 10-Feb-1995  cgd branches: 1.1.20;
libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.1.20.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.2.1 21-Aug-2000  kleink Pull up rev. 1.3 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.4 21-Oct-2020  thorpej - Consistently use _REG_* defines from assym.h to mean register numbers,
not offsets (i.e. *8 to get the offset).
- Define and use SIZEOF_SIGINFO and UC_GREGS constants, rather than
hard-code magic numbers.

NFC -- same object code is generated.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 28-Jan-2002  nathanw branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 28-Jan-2002  nathanw Oops, forgot to commit this bit of Klaus's code.
 1.2.30.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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.2 16-Sep-2005  drochner these went to compat
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.4 07-May-2001  kleink Make the END() argument match the entry name.
 1.3 28-Sep-2000  kleink branches: 1.3.2;
Need an internal name for pipe(2).
 1.2 14-Jun-2000  cgd branches: 1.2.2;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 10-Feb-1995  cgd branches: 1.1.20;
libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.1.20.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.2.1 29-Sep-2000  kleink Pull up rev. 1.3 (approved by thorpej):
Add internal name for pipe().
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.4 08-Nov-1996  cgd branches: 1.4.10;
kill "IMPORT(errno, 4)" since it is unnecessary
 1.3 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.2 17-Sep-1996  cgd set the GP before accessing errno.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.4.10.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2 11-Nov-1996  mycroft Treat reboot() like a normal system call. From PR 2458.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.9 07-May-2001  kleink Make the END() argument match the entry name.
 1.8 26-Jun-2000  kleink branches: 1.8.2;
Thinko in previous: we do always use an internal name.
 1.7 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.6 14-Jun-2000  cgd branches: 1.6.2;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.5 14-Jan-1999  kleink branches: 1.5.8;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.4 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.3 09-Sep-1996  cgd user better names for local labels, as suggested by Matt Thomas and
slightly tweaked.
 1.2 04-Nov-1995  cgd be more conservative when setting the gp
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.5.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.2.1 21-Aug-2000  kleink Pull up revs. 1.7-1.8 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.8.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.3 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.2 14-Jun-2000  cgd branches: 1.2.4;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 10-Feb-1995  cgd branches: 1.1.20;
libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.1.20.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.1 07-Jul-2000  itohy Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.2 16-Sep-2005  drochner these went to compat
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.3 16-Sep-2005  drochner these went to compat
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.1 29-Sep-1998  thorpej Signal changes for Alpha.
 1.5 16-Sep-2005  drochner these went to compat
 1.4 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.3 02-Dec-1998  thorpej branches: 1.3.8;
Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.2 29-Sep-1998  thorpej Signal changes for Alpha.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.3.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6 16-Sep-2005  drochner these went to compat
 1.5 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.4 02-Dec-1998  thorpej branches: 1.4.8;
Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 29-Sep-1998  thorpej Signal changes for Alpha.
 1.2 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.4.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6 16-Sep-2005  drochner these went to compat
 1.5 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 1.4 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.3 02-Dec-1998  thorpej branches: 1.3.8;
Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.2 29-Sep-1998  thorpej Signal changes for Alpha.
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.3.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6 16-Sep-2005  drochner these went to compat
 1.5 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.4 02-Dec-1998  thorpej branches: 1.4.8;
Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 29-Sep-1998  thorpej Signal changes for Alpha.
 1.2 17-Oct-1996  cgd catch up with <machine/asm.h> changes, SYS.h changes, and the removal
of DEFS.h
 1.1 10-Feb-1995  cgd libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.4.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.2 14-Jun-2000  cgd branches: 1.2.104;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 10-Feb-1995  cgd branches: 1.1.20;
libc support for the alpha. more functions should be written in assembler,
but that's optimization. 8-)
 1.1.20.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.104.1 21-Apr-2020  martin Sync with HEAD
 1.29 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.28 20-Aug-2015  pooka In rumprun mode on ARM, don't build syscall or signal code into libc.
(like on x86)
 1.27 29-Jan-2014  joerg Include compiler-rt in libc, libm and libkern.
 1.26 17-Jan-2014  joerg Use generic version of fabs for softfloat.
 1.25 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.24 21-Aug-2013  matt If not earmv7, use -marm on all assembly files
 1.23 18-Aug-2013  skrll Revert previous.
 1.22 18-Aug-2013  skrll Only add in __aeabi_read_tp.S when building for earm.
 1.21 30-Apr-2013  matt Match against LIBC_MACHINE_ARCH for MKCOMPAT
 1.20 03-Feb-2013  matt Add support for earmhf and earmhfeb and add SRCS.hardfloat.
 1.19 29-Jan-2013  matt for earm*, add arm_initfini.c
 1.18 26-Jan-2013  matt When building for earm*, compile __aeabi_[df]cmpun.c and __aeabi_[il]div0.c
 1.17 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.16 27-Sep-2012  skrll Remove magic numbers.
 1.15 06-Aug-2012  matt branches: 1.15.2;
Use the generic fixuns ieee754 instead of the ones from softfloat.
 1.14 06-Aug-2012  matt Don't need -I${.CURDIR}/arch/arm anymore
 1.13 05-Aug-2012  matt Only compile __aeabi_*ldivmod for earm/earmeb.
 1.12 05-Aug-2012  matt For ARM EABI, we need -DDSOFTFLOAT_NEED_FIXUNS too.
 1.11 05-Aug-2012  matt Add __aeabi_uldivmod (unsigned long long div/mod).
Only use 32-bit softfloat if arm/armeb.
earm/earmeb will use the 64-bit softfloat.
 1.10 18-Nov-2011  joerg branches: 1.10.4;
Hook up TLS support on ARM. Tested by martin@, kernel support from matt@
 1.9 06-Jul-2010  mrg branches: 1.9.6;
remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.8 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.7 16-Oct-2005  christos move to the new compat layout.
 1.6 05-Oct-2003  matt Add SA_SIGINFO support for ARM.
 1.5 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.4 21-May-2002  bjh21 Import the 32-bit version of SoftFloat 2a and separate it and the 64-bit
version into different directories. Which version a given port uses is
controlled by the SOFTFLOAT_BITS make variable. This is set to 64 (which
uses the same code we had before) by default. 32-bit platforms that don't
need extended precision support might get better performance by using 32.

Set the ARM port to use the 32-bit version of SoftFloat, since this is more
than a factor of two faster than the 64-bit version. This should get the
floating-point performance back to what it was in 1.5.
 1.3 08-Mar-2001  bjh21 Re-instate __fixunssfsi() and __fixunsdfsi(), but only for arm32 with a.out
binaries, because libc's provided them there forever.
 1.2 07-Mar-2001  bjh21 Leave selection of APCS mode to the compiler -- future versions of cpp will
get it right.

Always include new softfloat code -- it seems OK on arm32.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 21-Jun-2002  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.9.6.4 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.9.6.3 23-Jan-2013  yamt sync with head
 1.9.6.2 30-Oct-2012  yamt sync with head
 1.9.6.1 17-Apr-2012  yamt sync with head
 1.10.4.1 28-Nov-2012  matt Pullup EABI changes.
 1.15.2.4 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.2.3 23-Jun-2013  tls resync from head
 1.15.2.2 25-Feb-2013  tls resync with head
 1.15.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.16 23-Jul-2023  skrll ENTRY / END indentation. NFCI.
 1.15 19-Aug-2013  matt Group all syscalls together.
 1.14 16-Aug-2013  matt Save r3 instead of r4 when calling CERROR in thumb mode.
 1.13 16-Aug-2013  matt Rework SYSTRAP for thumb.
Add END to PSEUDO_NOERROR and PSEUDO
 1.12 01-Aug-2013  matt Make __minbrk, __curbrk, and CERROR hidden and avoid using the GOT to access
them.
 1.11 18-Jul-2013  matt Remove non-__ELF__ defines
 1.10 14-Jan-2011  matt branches: 1.10.6; 1.10.12; 1.10.16;
Change __cerror to be marked hidden and change callers to avoid the PLT.
 1.9 21-Aug-2004  rearnsha branches: 1.9.16;
Use RET macro for returning from PSEUDO & PSEUDO_NOERROR
 1.8 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.7 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.6 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.5 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.4 10-Feb-2002  bjh21 Switch libc syscall veneers over to using our shiny new official SWI range.
 1.3 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.5 21-Jun-2002  nathanw Catch up to -current.
 1.1.2.4 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.2 28-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.9.16.1 28-Aug-2007  matt More thumb support
 1.10.16.1 23-Jul-2013  riastradh sync with HEAD
 1.10.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.6.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.2 06-Aug-2012  matt Moving this to <arm/aeabi.h> in sys
 1.1 06-Aug-2012  matt Mostly for reference, this header defines the "C" portion of the ARM
run time API for AAPCS (EABI).
 1.4 23-Nov-2021  thorpej Decorate the ARM signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.3 24-Oct-2020  skrll Provide _UC_REGS_* defines for all registers
 1.2 30-Apr-2013  skrll Don't hardcode offset in assembler. This ensures the return value in the
context is the correct value (0) on earm*
 1.1 27-Sep-2012  skrll branches: 1.1.2; 1.1.4; 1.1.6;
Remove magic numbers.
 1.1.6.2 28-Nov-2012  matt Pullup EABI changes.
 1.1.6.1 27-Sep-2012  matt file genassym.cf was added on branch matt-nb6-plus on 2012-11-28 02:21:41 +0000
 1.1.4.3 23-Jun-2013  tls resync from head
 1.1.4.2 27-Sep-2012  skrll Remove magic numbers.
 1.1.4.1 27-Sep-2012  skrll file genassym.cf was added on branch tls-maxphys on 2012-09-27 11:20:21 +0000
 1.1.2.3 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.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 27-Sep-2012  yamt file genassym.cf was added on branch yamt-pagecache on 2012-10-30 18:58:39 +0000
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.28 29-Jan-2014  joerg Include compiler-rt in libc, libm and libkern.
 1.27 17-Jan-2014  joerg Use generic version of fabs for softfloat.
 1.26 25-Dec-2013  joerg Explicitly enable FPU support.
 1.25 21-Aug-2013  matt divide.S need -marm
 1.24 20-Jun-2013  msaitoh Fix compile error.
 1.23 20-Jun-2013  matt modsi3/umodsi3 is not needed for earm since __aeabi_*divmod takes care of it.
 1.22 30-Apr-2013  matt Match against LIBC_MACHINE_ARCH for MKCOMPAT
 1.21 26-Jan-2013  matt When building for earm*, compile __aeabi_[df]cmpun.c and __aeabi_[il]div0.c
 1.20 30-Oct-2012  christos add new files to fix static linking
 1.19 10-Oct-2012  christos add split files
 1.18 30-Jul-2012  skrll branches: 1.18.2;
Backout previous. ld.so requires the division routines so this needs
more thought.
 1.17 11-Jul-2012  reinoud On the libc/libgcc clashes cleanup that removed divsi3.o from libc, ARM/evbarm
was forgotten. This patch fixes it making static binaries possible again!
 1.16 06-Dec-2009  uebayasi branches: 1.16.6; 1.16.8;
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.15 28-Jun-2006  drochner build frexp/ldexp/modf in the "compat" part (code is identical)
(These are the easy cases where no assembler implementations exist.)
 1.14 16-Oct-2005  christos compat shuffle.
 1.13 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.12 04-Mar-2004  kleink branches: 1.12.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.11 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.10 28-Oct-2003  kleink Retire FPA support from this file at last; suggested by Richard Earnshaw
and not objected to by port-arm.
 1.9 26-Oct-2003  kleink On FPA, switch back `long double' to double-precision. According to
Richard Earnshaw, extended-precision was never supported by the compiler.
 1.8 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.7 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.6 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.5 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.4 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.3 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 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 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.4 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.2 16-Nov-2001  thorpej Implement _lwp_makecontext().
 1.1.2.1 15-Nov-2001  thorpej ARM-specific makecontext(), _resumecontext(), swapcontext(),
and getcontext(). From Klaus Kein <kleink@netbsd.org>.
 1.12.6.1 19-Apr-2005  tron Pull up revision 1.13 (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.16.8.3 19-Nov-2012  riz Pull up following revision(s) (requested by christos in ticket #654):
common/lib/libc/arch/arm/gen/modsi3.S: revision 1.1
common/lib/libc/arch/arm/gen/umodsi3.S: revision 1.1
sys/lib/libkern/arch/arm/Makefile.inc: revision 1.11
sys/lib/libkern/arch/arm/Makefile.inc: revision 1.12
common/lib/libc/arch/arm/gen/divide.S: revision 1.1
lib/libc/arch/arm/gen/Makefile.inc: revision 1.20
common/lib/libc/arch/arm/gen/divsi3.S: revision 1.3
common/lib/libc/arch/arm/gen/udivsi3.S: revision 1.1
common/lib/libc/arch/arm/gen/divsi3.S: revision 1.4
Split out modsi3 and umodsi3 from the divsi3 file. This is so that
we don't get re-defined symbols in libc from libgcc in static linking.
Example: cc -pthread -static main-calls-pthread-create.c
add split files.
add new divsi3 related files.
add new files to fix static linking
split udivsi3 and divsi3 to fix static linking. This could be done better.
Fixes PR#47139
 1.16.8.2 31-Jul-2012  martin branches: 1.16.8.2.2;
Backout #416 (requested by skrll in ticket #416):
lib/libc/arch/arm/gen/Makefile.inc: revision 1.18
Backout previous (pulled up via #416) - it causes major regressions
and needs more thought.
 1.16.8.1 16-Jul-2012  riz Pull up following revision(s) (requested by reinoud in ticket #416):
lib/libc/arch/arm/gen/Makefile.inc: revision 1.17
On the libc/libgcc clashes cleanup that removed divsi3.o from libc, ARM/evbarm
was forgotten. This patch fixes it making static binaries possible again!
 1.16.8.2.2.1 28-Nov-2012  matt Merge from HEAD.
split udivsi3 and divsi3 to fix static linking.
 1.16.6.3 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.16.6.2 16-Jan-2013  yamt sync with (a bit old) head
 1.16.6.1 30-Oct-2012  yamt sync with head
 1.18.2.4 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.2.3 23-Jun-2013  tls resync from head
 1.18.2.2 25-Feb-2013  tls resync with head
 1.18.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1 26-Jan-2013  matt branches: 1.1.4; 1.1.10;
Add __aeabi_[fd]cmpun for IEEE unordered compares (requires by ARM RTABI).
 1.1.10.2 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.1.10.1 26-Jan-2013  yamt file __aeabi_dcmpun.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.4.2 25-Feb-2013  tls resync with head
 1.1.4.1 26-Jan-2013  tls file __aeabi_dcmpun.c was added on branch tls-maxphys on 2013-02-25 00:27:48 +0000
 1.1 26-Jan-2013  matt branches: 1.1.4; 1.1.10;
Add __aeabi_[fd]cmpun for IEEE unordered compares (requires by ARM RTABI).
 1.1.10.2 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.1.10.1 26-Jan-2013  yamt file __aeabi_fcmpun.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.4.2 25-Feb-2013  tls resync with head
 1.1.4.1 26-Jan-2013  tls file __aeabi_fcmpun.c was added on branch tls-maxphys on 2013-02-25 00:27:48 +0000
 1.7 16-Oct-2005  christos compat shuffle.
 1.6 21-Aug-2004  rearnsha Use RET and RETc macros for returning.
 1.5 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.4 17-Aug-2002  thorpej Local label fixup.
 1.3 13-Nov-2001  chris Update asm files to use sp instead of r13. Also tweak a couple of bits in the longjmp code to save an instruction.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.4 16-Oct-2005  christos compat shuffle.
 1.3 17-Aug-2002  thorpej Local label fixup.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.8 22-Mar-2012  he Follow the pattern from powerpc, make lint happy.
 1.7 21-Mar-2012  christos no need for linted annotations
 1.6 21-Mar-2012  bsh shut up lint(1)
 1.5 24-Feb-2011  joerg branches: 1.5.4; 1.5.8;
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.4 12-Jun-2005  lukem branches: 1.4.40;
Add missing __RCSID()
 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 16-Nov-2001  thorpej branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.2 16-Nov-2001  thorpej Make sure the stack provided to the new LWP is 8-byte aligned.
 1.1.2.1 16-Nov-2001  thorpej Implement _lwp_makecontext().
 1.4.40.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.8.1 28-Nov-2012  matt Pullup EABI changes.
 1.5.4.1 17-Apr-2012  yamt sync with head
 1.20 08-May-2025  uwe arm: setjmp - fix thumb

"mov" should be spelled "movs" for thumb in unified syntax
 1.19 06-May-2025  uwe arm/asm.h: revert PCREL_GET &c in previous (ok riastradh)

This change needs to be redone and re-verified. I have detailed some
issues in the PR, and it also turns out that some of the changes were
in the !_REENTRANT branch of #ifdef and thus not checked at all.
riastradh asked to back out the changes for now.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.18 03-May-2025  riastradh arm: Nix most __PIC__ conditionals in .S files.

New macros PCREL_GET(rN,label,pclabel) and PCREL_SYM(label,pclabel)
to enable this by the pattern:

ldr rN, label
#ifdef __PIC__
pclabel:
add rN, rN, pc
#endif
...
label:
#ifdef __PIC__
.word (label - (pclabel + 2*sizeof(instruction)))
#else
.word label
#endif

(sizeof(instruction) = 2 for thumb, 4 for non-thumb.)

No binary change in libc with MKPIE=no (i.e., testing both for
changes to the PIC build and changes to the non-PIC build).

In principle, assembly routines could improve instruction scheduling
by splitting up the ldr and add instructions. But in practice, the
maintenance and auditing burden likely makes this worthwhile by
improving legibility vs a tangle of in-line #ifdefs.

brk.S does things a little differently making it harder to unify.
Could redo it but I don't want to make changes without testing them
first.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.17 05-Dec-2020  skrll branches: 1.17.8;
spaces to tab
 1.16 30-Nov-2013  joerg Use PLT_SYM.
 1.15 21-Oct-2013  skrll Fix bug introduced in revision 1.13 which meant longjmp would never
work on EABI where VFP didn't exist.

Hi gimpy!
 1.14 12-Sep-2013  joerg 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.13 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.12 19-Apr-2013  matt A small optimization
 1.11 19-Apr-2013  skrll Actually fail if the magic number is found to be wrong in __longjmp.

Avoid overwriting the {,_}longjmp return value in __ARM_EABI__

ok matt@
 1.10 29-Jan-2013  matt AAPCS (EABI) requires that VFP D8-D15 are always saved, regardless whether
the soft float or hard float ABI is being used. However, if there isn't a
FPU that can't be done. So only save/restore them if a FPU is present. When
libc initializes, it does a sysctl to determine if there is a FPU and stores
the result which _setjmp/setjmp uses. If there was a FPU, the magic in the
jmp_buf is changed to reflect that the VFP registers were saved. longjmp uses
the magic to determine if it needs to restore the VFP registers.
 1.9 25-Jan-2013  matt Use __ARM_PCS_VFP to determine whether the VFP is being used.
 1.8 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.7 01-Aug-2012  matt branches: 1.7.2;
Add #error cases in case someone tries to compile hardfloat VFP libraries.
 1.6 21-Aug-2004  rearnsha branches: 1.6.16; 1.6.50;
Use RET and RETc macros for returning.
 1.5 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.4 17-Aug-2002  thorpej Local label fixup.
 1.3 13-Nov-2001  chris Update asm files to use sp instead of r13. Also tweak a couple of bits in the longjmp code to save an instruction.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.50.3 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.6.50.2 23-Jan-2013  yamt sync with head
 1.6.50.1 30-Oct-2012  yamt sync with head
 1.6.16.1 28-Aug-2007  matt More thumb support
 1.7.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.2.2 23-Jun-2013  tls resync from head
 1.7.2.1 25-Feb-2013  tls resync with head
 1.17.8.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Aug-2013  matt Thumbify & add END
 1.4 21-Aug-2004  rearnsha branches: 1.4.16; 1.4.50; 1.4.56;
Use RET and RETc macros for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 13-Nov-2001  chris Update arm libc files for 8 byte aligned stack.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.4.56.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.50.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.4.16.1 28-Aug-2007  matt More thumb support
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 21-Aug-2004  rearnsha Use RET and RETc macros for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 01-Jul-2002  bjh21 Avoid leaving junk in the top half of R0 on return.
This fixes port-arm/17440.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2; 1.1.4;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.4.1 02-Jul-2002  lukem Pull up revision 1.2 (requested by bjh21 in ticket #419):
Avoid leaving junk in the top half of R0 on return.
This fixes port-arm/17440.
 1.1.2.1 01-Aug-2002  nathanw Catch up to -current.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 21-Aug-2004  rearnsha Use RET and RETc macros for returning.
 1.2 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.7 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.6 21-Aug-2004  rearnsha Use RET and RETc macros for returning.
 1.5 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.4 17-Aug-2002  thorpej Local label fixup.
 1.3 13-Nov-2001  chris Update arm libc files for 8 byte aligned stack.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.4 17-Jan-2014  joerg GC
 1.3 16-May-2006  mrg branches: 1.3.44; 1.3.50;
make sure there is a prototype in scope.
 1.2 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 21-Jun-2002  nathanw Catch up to -current.
 1.3.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.6 08-Apr-2022  andvar fix various typos, mainly in comments, but also log messages, docs, game text.
 1.5 19-Mar-2015  joerg Call libc's fpgetround.
 1.4 21-Mar-2012  he branches: 1.4.10;
Use c89 function declaration.
 1.3 25-Feb-2006  wiz branches: 1.3.44;
Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"),
forwarded by jmc@openbsd.
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.3.44.1 17-Apr-2012  yamt sync with head
 1.4.10.1 21-Mar-2015  snj Pull up following revision(s) (requested by joerg in ticket #632):
lib/libc/arch/arm/gen/flt_rounds.c: revision 1.5
lib/libc/arch/mips/gen/flt_rounds.c: revision 1.9
lib/libc/arch/powerpc/gen/flt_rounds.c: revision 1.12
lib/libc/arch/powerpc64/gen/flt_rounds.c: revision 1.2
lib/libc/arch/sh3/gen/flt_rounds.c: revision 1.6
Call libc's fpgetround.
 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 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.6 28-Oct-2003  kleink Retire FPA support from this file at last; suggested by Richard Earnshaw
and not objected to by port-arm.
 1.5 26-Oct-2003  kleink On FPA, switch back `long double' to double-precision. According to
Richard Earnshaw, extended-precision was never supported by the compiler.
 1.4 25-Oct-2003  kleink Redo the VFP/endianness conditional logic of this file, making it easier
to read. No functional change except for the side-effect of fixing the
ARMEB FPA case, which wasn't supported anyway.
 1.3 19-Feb-2002  bjh21 Replace infinity.c with one in the style of the new ieee754_infinity.c, but
with extra #ifdefs for FPA-format doubles. This gets it compiling again.
 1.2 28-Oct-2001  bjh21 Handle machines using VFP-format doubles (as we do in ARM ELF) and big-endian
systems correctly.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.3 28-Oct-2003  kleink Retire FPA support from this file at last; suggested by Richard Earnshaw
and not objected to by port-arm.
 1.2 26-Oct-2003  kleink On FPA, switch back `long double' to double-precision. According to
Richard Earnshaw, extended-precision was never supported by the compiler.
 1.1 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 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 29-Oct-2001  bjh21 Change isnan() and isinf() to use a union to convert from double to
struct ieee_double, rather than a pointer cast. This seems to enable
GCC 2.95.3 to get the instruction dependencies right (the old one fell
foul of ANSI aliasing rules), and it also generates more sensible code in
general.

If this is the correct solution, it should be applied to the other ports.
If it's not, someone should come up with one that _is_ correct.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.5 26-Oct-2003  kleink On FPA, switch back `long double' to double-precision. According to
Richard Earnshaw, extended-precision was never supported by the compiler.
 1.4 25-Oct-2003  kleink Remove an unnecessary line continuation backslash from previous.
 1.3 25-Oct-2003  kleink Update for FPA 80-bit extended-precision format.
 1.2 25-Oct-2003  kleink Swap VFP and FPA sections to match the style of most other code;
no functional change.
 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.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 29-Oct-2001  bjh21 Change isnan() and isinf() to use a union to convert from double to
struct ieee_double, rather than a pointer cast. This seems to enable
GCC 2.95.3 to get the instruction dependencies right (the old one fell
foul of ANSI aliasing rules), and it also generates more sensible code in
general.

If this is the correct solution, it should be applied to the other ports.
If it's not, someone should come up with one that _is_ correct.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.4 26-Oct-2003  kleink On FPA, switch back `long double' to double-precision. According to
Richard Earnshaw, extended-precision was never supported by the compiler.
 1.3 25-Oct-2003  kleink Update for FPA 80-bit extended-precision format.
 1.2 25-Oct-2003  kleink Swap VFP and FPA sections to match the style of most other code;
no functional change.
 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.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 08-Nov-2001  bjh21 Rename a parameter to fix build problem with new toolchain.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.4 21-Mar-2012  christos no need for linted annotations
 1.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8; 1.3.26;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 15-Nov-2001  thorpej branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.2 16-Nov-2001  kleink As observed on the trunk: Update arm libc files for 8 byte aligned stack.
 1.1.2.1 15-Nov-2001  thorpej ARM-specific makecontext(), _resumecontext(), swapcontext(),
and getcontext(). From Klaus Kein <kleink@netbsd.org>.
 1.2.30.1 18-May-2008  yamt sync with head.
 1.3.26.1 28-Nov-2012  matt Pullup EABI changes.
 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 makecontext.c was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.3.4.1 17-Apr-2012  yamt sync with head
 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 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 08-Mar-2002  nathanw Catch up to -current.
 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 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.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.5 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Dec-2006  martin branches: 1.3.10;
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-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.2 18-Jan-2003  thorpej branches: 1.2.16;
Merge the nathanw_sa branch.
 1.1 15-Nov-2001  thorpej branches: 1.1.2;
file resumecontext.c was initially added on branch nathanw_sa.
 1.1.2.1 15-Nov-2001  thorpej ARM-specific makecontext(), _resumecontext(), swapcontext(),
and getcontext(). From Klaus Kein <kleink@netbsd.org>.
 1.2.16.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #264):
lib/libc/arch/sh5/gen/resumecontext.c: revision 1.2
lib/libc/arch/sh3/gen/resumecontext.c: revision 1.3
lib/libc/arch/sparc/gen/resumecontext.c: revision 1.3
lib/libc/arch/powerpc/gen/resumecontext.c: revision 1.3
lib/libc/arch/arm/gen/resumecontext.c: revision 1.3
lib/libc/arch/mips/gen/resumecontext.c: revision 1.3
lib/libc/arch/vax/gen/resumecontext.c: revision 1.2
lib/libc/arch/powerpc64/gen/resumecontext.c: revision 1.2
lib/libc/arch/hppa/gen/resumecontext.c: revision 1.2
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:
-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.3.10.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.22 08-May-2025  uwe arm: setjmp - fix thumb

"mov" should be spelled "movs" for thumb in unified syntax
 1.21 06-May-2025  uwe arm/asm.h: revert PCREL_GET &c in previous (ok riastradh)

This change needs to be redone and re-verified. I have detailed some
issues in the PR, and it also turns out that some of the changes were
in the !_REENTRANT branch of #ifdef and thus not checked at all.
riastradh asked to back out the changes for now.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.20 03-May-2025  riastradh arm: Nix most __PIC__ conditionals in .S files.

New macros PCREL_GET(rN,label,pclabel) and PCREL_SYM(label,pclabel)
to enable this by the pattern:

ldr rN, label
#ifdef __PIC__
pclabel:
add rN, rN, pc
#endif
...
label:
#ifdef __PIC__
.word (label - (pclabel + 2*sizeof(instruction)))
#else
.word label
#endif

(sizeof(instruction) = 2 for thumb, 4 for non-thumb.)

No binary change in libc with MKPIE=no (i.e., testing both for
changes to the PIC build and changes to the non-PIC build).

In principle, assembly routines could improve instruction scheduling
by splitting up the ldr and add instructions. But in practice, the
maintenance and auditing burden likely makes this worthwhile by
improving legibility vs a tangle of in-line #ifdefs.

brk.S does things a little differently making it harder to unify.
Could redo it but I don't want to make changes without testing them
first.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.19 06-May-2024  skrll branches: 1.19.2;
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
 1.18 13-Dec-2022  skrll branches: 1.18.2;
Trailing whitespace
 1.17 30-Nov-2013  joerg branches: 1.17.28;
Use PLT_SYM.
 1.16 12-Sep-2013  joerg 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.15 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.14 19-Apr-2013  matt A small optimization
 1.13 19-Apr-2013  skrll Actually fail if the magic number is found to be wrong in __longjmp.

Avoid overwriting the {,_}longjmp return value in __ARM_EABI__

ok matt@
 1.12 29-Jan-2013  matt AAPCS (EABI) requires that VFP D8-D15 are always saved, regardless whether
the soft float or hard float ABI is being used. However, if there isn't a
FPU that can't be done. So only save/restore them if a FPU is present. When
libc initializes, it does a sysctl to determine if there is a FPU and stores
the result which _setjmp/setjmp uses. If there was a FPU, the magic in the
jmp_buf is changed to reflect that the VFP registers were saved. longjmp uses
the magic to determine if it needs to restore the VFP registers.
 1.11 25-Jan-2013  matt Use __ARM_PCS_VFP to determine whether the VFP is being used.
 1.10 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.9 01-Aug-2012  matt branches: 1.9.2;
Add #error cases in case someone tries to compile hardfloat VFP libraries.
 1.8 16-Oct-2005  christos branches: 1.8.10; 1.8.44;
more renaming.
 1.7 16-Oct-2005  christos compat shuffle.
 1.6 21-Aug-2004  rearnsha Use RET and RETc macros for returning.
 1.5 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.4 17-Aug-2002  thorpej Local label fixup.
 1.3 13-Nov-2001  chris Update arm libc files for 8 byte aligned stack.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.8.44.3 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.8.44.2 23-Jan-2013  yamt sync with head
 1.8.44.1 30-Oct-2012  yamt sync with head
 1.8.10.1 28-Aug-2007  matt More thumb support
 1.9.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.2.2 23-Jun-2013  tls resync from head
 1.9.2.1 25-Feb-2013  tls resync with head
 1.17.28.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 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.19.2.1 02-Aug-2025  perseant Sync with HEAD
 1.8 30-Nov-2013  joerg Use PLT_SYM.
 1.7 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.6 19-Apr-2013  matt Ignore VFP bit in magic.
 1.5 16-Oct-2005  christos branches: 1.5.10; 1.5.44; 1.5.50;
more renaming.
 1.4 16-Oct-2005  christos compat shuffle.
 1.3 17-Aug-2002  thorpej Local label fixup.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5.50.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.50.1 23-Jun-2013  tls resync from head
 1.5.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.5.10.1 28-Aug-2007  matt More thumb support
 1.18 30-Jun-2021  skrll Do previous differtly by pushing two registers in the same way as the
_INVOKE_CERROR macro
 1.17 30-Jun-2021  rin Fix previous. For Thumb-1:
- sp cannot be manipulated directly
- {add,sub}s should be used instead of {add,sub}
 1.16 29-Jun-2021  rin Align sp to 8-byte boundary as required by EABI.

IIUC, this change only affects libc compiled for ``Thumb-mode userland'',
which we've not officially supported yet.
 1.15 21-Nov-2018  skrll branches: 1.15.2;
Fix a comment
 1.14 30-Nov-2013  joerg branches: 1.14.24; 1.14.26;
Use PLT_SYM.
 1.13 04-Sep-2013  matt Fix the .cfi correctly.
 1.12 04-Sep-2013  htodd Fix build by matching .cfi/#if.
 1.11 04-Sep-2013  matt only emit cfi if __ARM_EABI__ && __UNWIND_TABLES__
 1.10 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.9 28-Nov-2012  matt Add missing registers.
 1.8 27-Sep-2012  skrll Remove magic numbers.
 1.7 27-Sep-2012  skrll Fixup the stack pointer in the ucontext returned by getcontext.

This fixes the following tests

lib/libc/sys/t_swapcontext.c
lib/libpthread/t_swapcontext.c
 1.6 05-Aug-2012  skrll branches: 1.6.2;
Ensure stack alignment. "looks fine" matt@
 1.5 28-Apr-2008  martin branches: 1.5.4; 1.5.8; 1.5.24; 1.5.26;
Remove clause 3 and 4 from TNF licenses
 1.4 21-Aug-2004  rearnsha branches: 1.4.16; 1.4.24;
Use RET and RETc macros for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 15-Nov-2001  thorpej branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.2 18-Nov-2001  thorpej * Make this work with ELF.
* We don't appear to have an internal name for setcontext(), so
don't use one (i.e. call setcontext(), rather than _setcontext()).

XXX Namespace considerations wrt. the ucontext functions are not
consistent -- need to revisit.
 1.1.2.1 15-Nov-2001  thorpej ARM-specific makecontext(), _resumecontext(), swapcontext(),
and getcontext(). From Klaus Kein <kleink@netbsd.org>.
 1.4.24.1 18-May-2008  yamt sync with head.
 1.4.16.1 28-Aug-2007  matt More thumb support
 1.5.26.2 28-Nov-2012  matt Pullup EABI changes.
 1.5.26.1 01-Nov-2012  matt sync with netbsd-6-0-RELEASE.
 1.5.24.1 01-Oct-2012  riz Pull up following revision(s) (requested by skrll in ticket #576):
lib/libc/arch/arm/gen/swapcontext.S: revision 1.7
Fixup the stack pointer in the ucontext returned by getcontext.
This fixes the following tests
lib/libc/sys/t_swapcontext.c
lib/libpthread/t_swapcontext.c
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.5.4.3 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.5.4.2 16-Jan-2013  yamt sync with (a bit old) head
 1.5.4.1 30-Oct-2012  yamt sync with head
 1.6.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.2.2 25-Feb-2013  tls resync with head
 1.6.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.26.1 10-Jun-2019  christos Sync with HEAD
 1.14.24.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.15.2.1 08-Aug-2021  martin Pull up following revision(s) (requested by skrll in ticket #1329):

lib/libc/arch/arm/gen/swapcontext.S: revision 1.18
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S: revision 1.3
lib/libc/arch/arm/sys/__clone.S: revision 1.10
lib/libc/arch/arm/sys/__clone.S: revision 1.11
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S: revision 1.2
lib/libc/arch/arm/sys/__clone.S: revision 1.12
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S: revision 1.3
lib/libc/arch/arm/sys/__clone.S: revision 1.13
lib/libc/arch/arm/sys/__clone.S: revision 1.14
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S: revision 1.3
lib/libc/arch/arm/gen/swapcontext.S: revision 1.16
lib/libc/arch/arm/gen/swapcontext.S: revision 1.17

Align sp to 8-byte boundary as required by EABI.

This is especially important for non-leaf functions; GCC optimizes codes
based on assumption that sp is aligned properly.

Mostly fix broken earmv5 userland compiled by GCC10 due to alignment
faults in ld.elf_so, where {ld,st}rd are used for [sp, #8x].

No regression for ATF is observed for earmv[67]{,hf}{,eb}.

Align sp to 8-byte boundary as required by EABI.
IIUC, this change only affects libc compiled for ``Thumb-mode userland'',
which we've not officially supported yet.

Fix previous. For Thumb-1:
- sp cannot be manipulated directly
- {add,sub}s should be used instead of {add,sub}

Trailing whitespace

The _INVOKE_CERROR macro deals with thumb so simplify the code (at the
expense of a couple more instructions).

Do previous differently by pushing even number of registers and remove
strange r7 usage.

Do previous differtly by pushing two registers in the same way as the
_INVOKE_CERROR macro
 1.3 17-Jan-2014  joerg Use generic version of fabs for softfloat.
 1.2 30-Nov-2013  joerg fabsl alias.
 1.1 03-Feb-2013  matt branches: 1.1.4;
Add hardfloat version of fabs using the vabs.f64 instruction
 1.1.4.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.2 25-Feb-2013  tls resync with head
 1.1.4.1 03-Feb-2013  tls file fabs.S was added on branch tls-maxphys on 2013-02-25 00:27:48 +0000
 1.1 17-Jan-2014  joerg branches: 1.1.4; 1.1.8;
Use generic version of fabs for softfloat.
 1.1.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 17-Jan-2014  tls file fabs_ieee754.S was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1.4.2 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.1.4.1 17-Jan-2014  yamt file fabs_ieee754.S was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.7 02-Aug-2013  matt Use vmrs instead of mrc
 1.6 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.5 01-Aug-2012  matt branches: 1.5.2;
Error out if compiled with -mfp=vfp and -mhard-float
 1.4 21-Aug-2004  rearnsha branches: 1.4.50;
Use RET and RETc macros for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.50.3 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.4.50.2 23-Jan-2013  yamt sync with head
 1.4.50.1 30-Oct-2012  yamt sync with head
 1.5.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 25-Feb-2013  tls resync with head
 1.6 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.5 24-Jun-2012  christos branches: 1.5.2;
fix old style definitions; XXX: gcc should have picked them up but it did not.
 1.4 25-Feb-2006  wiz branches: 1.4.44;
Fix some typos.
 1.3 12-Jun-2005  lukem Add missing __RCSID()
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.44.2 23-Jan-2013  yamt sync with head
 1.4.44.1 30-Oct-2012  yamt sync with head
 1.5.2.1 25-Feb-2013  tls resync with head
 1.6 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.5 01-Aug-2012  matt branches: 1.5.2;
Error out if compiled with -mfp=vfp and -mhard-float
 1.4 21-Aug-2004  rearnsha branches: 1.4.50;
Use RET and RETc macros for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.50.2 23-Jan-2013  yamt sync with head
 1.4.50.1 30-Oct-2012  yamt sync with head
 1.5.2.1 25-Feb-2013  tls resync with head
 1.7 23-Jan-2014  joerg One vmsr is enough.
 1.6 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.5 01-Aug-2012  matt branches: 1.5.2;
Error out if compiled with -mfp=vfp and -mhard-float
 1.4 21-Aug-2004  rearnsha branches: 1.4.50;
Use RET and RETc macros for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.50.3 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.4.50.2 23-Jan-2013  yamt sync with head
 1.4.50.1 30-Oct-2012  yamt sync with head
 1.5.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 25-Feb-2013  tls resync with head
 1.8 03-Feb-2013  matt include <arm/vfpreg.h>
 1.7 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.6 25-Feb-2006  wiz branches: 1.6.44; 1.6.50;
Fix some typos.
 1.5 12-Jun-2005  lukem Add missing __RCSID()
 1.4 19-Mar-2002  bjh21 Only abort() if the user specifies a rounding mode other than FP_RN.
 1.3 19-Mar-2002  bjh21 ANSIfy.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.6.50.1 25-Feb-2013  tls resync with head
 1.6.44.2 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.6.44.1 23-Jan-2013  yamt sync with head
 1.6 11-Jan-2013  matt Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
 1.5 01-Aug-2012  matt branches: 1.5.2;
Error out if compiled with -mfp=vfp and -mhard-float
 1.4 21-Aug-2004  rearnsha branches: 1.4.50;
Use RET and RETc macros for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.50.2 23-Jan-2013  yamt sync with head
 1.4.50.1 30-Oct-2012  yamt sync with head
 1.5.2.1 25-Feb-2013  tls resync with head
 1.10 03-Mar-2025  christos don't abort, just fail.
 1.9 27-Feb-2025  christos use the latest version that does not abort on error.
 1.8 27-Feb-2025  christos PR/59063: Martin Husemann: Avoid using malloc through sysctlbyname by doing
the sysctl name to mib translation directly. Thanks martin@ for testing!
 1.7 08-Sep-2013  matt branches: 1.7.4; 1.7.40;
detect whether hw divide is present.
 1.6 08-Sep-2013  matt Detect presence of hardware divide.
 1.5 19-Aug-2013  matt Put the startup code in .text.startup
 1.4 16-Aug-2013  matt Make _libc_arm_fpu_present hidden
 1.3 30-Jul-2013  skrll include namespace.h - this fixes 48091
 1.2 31-Jan-2013  matt branches: 1.2.4;
Reorganize to appease lint.
 1.1 29-Jan-2013  matt Add a constructor for EABI to determine if a FPU is present on the system.
 1.2.4.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.4.2 25-Feb-2013  tls resync with head
 1.2.4.1 31-Jan-2013  tls file arm_initfini.c was added on branch tls-maxphys on 2013-02-25 00:27:49 +0000
 1.7.40.1 02-Aug-2025  perseant Sync with HEAD
 1.7.4.2 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.4.1 08-Sep-2013  yamt file arm_initfini.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1 16-Apr-2013  matt branches: 1.1.2; 1.1.8;
aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.1.8.2 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.1.8.1 16-Apr-2013  yamt file __aeabi_dcmpeq.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 16-Apr-2013  tls file __aeabi_dcmpeq.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.2 16-Apr-2013  matt branches: 1.2.2; 1.2.8;
Deal with arguments being NaNs
 1.1 16-Apr-2013  matt aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.2.8.2 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.2.8.1 16-Apr-2013  yamt file __aeabi_dcmpge.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.2.2.2 23-Jun-2013  tls resync from head
 1.2.2.1 16-Apr-2013  tls file __aeabi_dcmpge.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.2 16-Apr-2013  matt branches: 1.2.2; 1.2.8;
Deal with arguments being NaNs
 1.1 16-Apr-2013  matt aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.2.8.2 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.2.8.1 16-Apr-2013  yamt file __aeabi_dcmpgt.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.2.2.2 23-Jun-2013  tls resync from head
 1.2.2.1 16-Apr-2013  tls file __aeabi_dcmpgt.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.1 16-Apr-2013  matt branches: 1.1.2; 1.1.8;
aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.1.8.2 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.1.8.1 16-Apr-2013  yamt file __aeabi_dcmple.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 16-Apr-2013  tls file __aeabi_dcmple.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.1 16-Apr-2013  matt branches: 1.1.2; 1.1.8;
aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.1.8.2 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.1.8.1 16-Apr-2013  yamt file __aeabi_dcmplt.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 16-Apr-2013  tls file __aeabi_dcmplt.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.1 16-Apr-2013  matt branches: 1.1.2; 1.1.8;
aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.1.8.2 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.1.8.1 16-Apr-2013  yamt file __aeabi_dcmpun.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 16-Apr-2013  tls file __aeabi_dcmpun.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.1 16-Apr-2013  matt branches: 1.1.2; 1.1.8;
aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.1.8.2 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.1.8.1 16-Apr-2013  yamt file __aeabi_fcmpeq.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 16-Apr-2013  tls file __aeabi_fcmpeq.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.2 16-Apr-2013  matt branches: 1.2.2; 1.2.8;
Deal with arguments being NaNs
 1.1 16-Apr-2013  matt aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.2.8.2 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.2.8.1 16-Apr-2013  yamt file __aeabi_fcmpge.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.2.2.2 23-Jun-2013  tls resync from head
 1.2.2.1 16-Apr-2013  tls file __aeabi_fcmpge.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.2 16-Apr-2013  matt branches: 1.2.2; 1.2.8;
Deal with arguments being NaNs
 1.1 16-Apr-2013  matt aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.2.8.2 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.2.8.1 16-Apr-2013  yamt file __aeabi_fcmpgt.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.2.2.2 23-Jun-2013  tls resync from head
 1.2.2.1 16-Apr-2013  tls file __aeabi_fcmpgt.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.1 16-Apr-2013  matt branches: 1.1.2; 1.1.8;
aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.1.8.2 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.1.8.1 16-Apr-2013  yamt file __aeabi_fcmple.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 16-Apr-2013  tls file __aeabi_fcmple.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.1 16-Apr-2013  matt branches: 1.1.2; 1.1.8;
aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.1.8.2 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.1.8.1 16-Apr-2013  yamt file __aeabi_fcmplt.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 16-Apr-2013  tls file __aeabi_fcmplt.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.1 16-Apr-2013  matt branches: 1.1.2; 1.1.8;
aeabi floating compare ops are different from the normal gcc softfloat ones.
 1.1.8.2 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.1.8.1 16-Apr-2013  yamt file __aeabi_fcmpun.c was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.2.2 23-Jun-2013  tls resync from head
 1.1.2.1 16-Apr-2013  tls file __aeabi_fcmpun.c was added on branch tls-maxphys on 2013-06-23 06:21:04 +0000
 1.4 26-Jan-2013  matt Appease clang by making 64-bit literals use ULL
 1.3 24-Dec-2005  perry branches: 1.3.44; 1.3.50;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 21-Feb-2001  bjh21 Add support for ARM VFP-format doubles, conditional on __VFP_FP__.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.3.50.1 25-Feb-2013  tls resync with head
 1.3.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.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2 21-Apr-2002  bjh21 All the versions of softfloat-specialize were practically identical, so replace
them with a single one.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 25-Apr-2002  nathanw Catch up to -current.
 1.10 24-Apr-2013  matt Add #include <stdint.h>
 1.9 07-Jul-2011  matt branches: 1.9.2; 1.9.8;
Don't define a new enum. Just #define round_* to their FP_Rx instead.
 1.8 04-Jul-2011  matt Add __floatunsidf __floatunsisf __floatunsitf routines.
XXX i think they are correct but not sure.
 1.7 16-May-2006  mrg if SOFTFLOAT_FOR_GCC is not defined, don't declare float_detect_tininess.
 1.6 12-May-2002  bjh21 Add SIGFPE support to SoftFloat, so fpsetmask/fpgetmask now work. A new
variable, float_exception_mask (#defined to _softfloat_float_exception_mask)
contains the current exception mask.
Also make the argument to float_raise into an fp_except.
Also synchronise file header comments between files.
 1.5 06-May-2002  bjh21 Consistently declare the types of float_rounding_mode and float_exception_flags
as fp_rnd and fp_except respectively.
 1.4 10-Mar-2002  bjh21 Use the values from <machine/ieeefp.h> to define the exception flags, and
rounding modes, rather than different ones (oops).
 1.3 08-Mar-2001  bjh21 Re-instate __fixunssfsi() and __fixunsdfsi(), but only for arm32 with a.out
binaries, because libc's provided them there forever.
 1.2 08-Feb-2001  bjh21 branches: 1.2.2;
Don't declare functions that are provided elsewhere in libc.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.3 21-Jun-2002  nathanw Catch up to -current.
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.9.8.1 23-Jun-2013  tls resync from head
 1.9.2.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.4 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.3 04-Aug-2008  matt branches: 1.3.6;
Add C99 functions imaxabs and imaxdiv.
 1.2 22-Mar-2006  drochner branches: 1.2.20;
build erand48_ieee754.c on everything but vax
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.3.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.9 21-Aug-2013  matt Add -marm to those sources who aren't thumb friendly.
 1.8 30-Jul-2009  dsl branches: 1.8.6; 1.8.12;
If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.7 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.6 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.5 23-Nov-2002  chris Add arm asm version of memcmp, basically it's strncmp.S without the
check for *src != 0
 1.4 23-Nov-2002  chris Add an asm version of strncmp, based on strcmp.
Add RCSID to strcmp, also use numeric label, rather than named label for
loop.
 1.3 16-Nov-2002  rearnsha Add an assembler version of strcmp, based on example code from the ARM
ARM. As an example of the performance difference that this provides
a Dhrystone score on my Shark goes from 213k to 261k.
 1.2 11-Nov-2001  chris Update the libc version of ffs to make use of an optimsed asm version.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.8.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.6.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 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.6 09-Oct-2003  ichiro dont use __ARMEB__
It changed so that it might distinguish by BYTE_ORDER
 1.5 09-Oct-2003  ichiro support big endian
 1.4 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 17-Aug-2002  thorpej Local label fixup.
 1.2 23-Jan-2001  bjh21 branches: 1.2.2;
Correct licence to current TNF one.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.1 27-Aug-2002  nathanw Catch up to -current.
 1.3 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 08-Oct-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 14-Oct-2003  scw branches: 1.3.22; 1.3.30;
Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.3.30.1 18-May-2008  yamt sync with head.
 1.3.22.1 28-Aug-2007  matt More thumb support
 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 bzero.S was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.9 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.8 06-May-2005  rearnsha On ARMv5 reduce the value to the LSB before using CLZ. Otherwise we'll
calculate the position of the MSB not the LSB.
 1.7 21-Aug-2004  rearnsha branches: 1.7.2;
Add missing new line.
 1.6 21-Aug-2004  rearnsha Use RET to return.

If ARMv5 or later then use CLZ rather than long-winded tale-lookup.
 1.5 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.4 17-Aug-2002  thorpej Local label fixup.
 1.3 17-Aug-2002  chris correct comment, it's r0, not a0.
 1.2 13-Nov-2001  bjh21 branches: 1.2.2;
Fix .type directive to use the right name for L_ffs_table (pointed out by
Ian Fry).

Also, add RCSID and fix some comments.
 1.1 11-Nov-2001  chris Update the libc version of ffs to make use of an optimsed asm version.
 1.2.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.2.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.2.2.1 13-Nov-2001  nathanw file ffs.S was added on branch nathanw_sa on 2001-11-14 19:31:52 +0000
 1.7.2.1 07-May-2005  tron Pull up revision 1.8 (requested by rearnsha in ticket #255):
On ARMv5 reduce the value to the LSB before using CLZ. Otherwise we'll
calculate the position of the MSB not the LSB.
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.5 21-Aug-2004  rearnsha Use RET and RETc for returning.
 1.4 23-Oct-2003  scw Duh, fix the align-to-32-bits code.
 1.3 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.2 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.1 23-Nov-2002  chris branches: 1.1.2;
Add arm asm version of memcmp, basically it's strncmp.S without the
check for *src != 0
 1.1.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 23-Nov-2002  thorpej file memcmp.S was added on branch nathanw_sa on 2002-12-10 06:25:43 +0000
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 02-Jun-2005  scw Nuke trailing whitespace.
 1.1 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 02-Jun-2005  scw Nuke trailing whitespace.
 1.2 21-Aug-2004  rearnsha branches: 1.2.2;
Always use bx for returning (this code is always ARMv5TE.
 1.1 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.2.2.1 26-Aug-2007  bouyer Apply patch, requested by scw in ticket #1806:
lib/libc/arch/arm/string/memcpy_xscale.S: patch
sys/lib/libkern/arch/arm/memcpy_xscale.S: patch
Apply the patch, with some minor tweaks, supplied in PR/36513.
This prevents a possible prefetch past the end of the source buffer.
 1.7 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.6 02-Jun-2005  scw Nuke trailing whitespace.
 1.5 21-Aug-2004  rearnsha branches: 1.5.2;
Use RET and RETc for returning.
 1.4 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5.2.1 22-Jun-2007  liamjfoy Pull up following revision(s) (requested by scw in ticket #1805):
common/lib/libc/arch/arm/string/memmove.S: revision 1.2
Apply the patch supplied in PR/36512 to fix the buffer overlap check. The patch
to memmove.S was provided via patch.
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.5 21-Aug-2004  rearnsha Use RET and RETc for returning.
 1.4 14-Oct-2003  scw Xscale-optimised mem* routines. Contributed by Wasabi Systems.
(Note: memcmp/memset improvements also benefit non-Xscale).

memcmp() - Compare 32-bits at a time if possible. Special-case 6-byte
comparisons, for the benefit of the network stack.

memset() - More loop unrolling, plus use of 'strd' instruction,
bzero() results in > 100% speedup on Xscale.

memcpy() - Big-endian support, unrolled loops, 'strd/pld', plus special-
cases for very common length/alignment combinations.
Benchmarks show ~50% improvment on Xscale.

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
bcopy() don't overlap. Otherwise unchanged

XXX: The Xscale optimisations are not enabled by default, unless /etc/mk.conf
XXX: has the right compiler options. The intention is to pull them in via
XXX: something like libxscale.so, selected at runtime by ld.so.conf.
XXX: (Big-endian support is not affected by this).
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 17-Aug-2002  thorpej Local label fixup.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.1 27-Aug-2002  nathanw Catch up to -current.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 21-Aug-2004  rearnsha Use RET and RETc for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 23-Nov-2002  chris branches: 1.2.2;
Add an asm version of strncmp, based on strcmp.
Add RCSID to strcmp, also use numeric label, rather than named label for
loop.
 1.1 16-Nov-2002  rearnsha Add an assembler version of strcmp, based on example code from the ARM
ARM. As an example of the performance difference that this provides
a Dhrystone score on my Shark goes from 213k to 261k.
 1.2.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.2.2.1 23-Nov-2002  thorpej file strcmp.S was added on branch nathanw_sa on 2002-12-10 06:25:43 +0000
 1.1 23-Jan-2013  matt branches: 1.1.2; 1.1.6; 1.1.12;
Add simple version of strncat for ARM.
 1.1.12.2 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.1.12.1 23-Jan-2013  yamt file strncat_naive.S was added on branch yamt-pagecache on 2014-05-22 11:36:46 +0000
 1.1.6.2 25-Feb-2013  tls resync with head
 1.1.6.1 23-Jan-2013  tls file strncat_naive.S was added on branch tls-maxphys on 2013-02-25 00:27:49 +0000
 1.1.2.2 07-Feb-2013  matt Sync with HEAD
 1.1.2.1 23-Jan-2013  matt file strncat_naive.S was added on branch matt-nb6-plus on 2013-02-07 07:06:28 +0000
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 21-Aug-2004  rearnsha Use RET and RETc for returning.
 1.2 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.1 23-Nov-2002  chris branches: 1.1.2;
Add an asm version of strncmp, based on strcmp.
Add RCSID to strcmp, also use numeric label, rather than named label for
loop.
 1.1.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 23-Nov-2002  thorpej file strncmp.S was added on branch nathanw_sa on 2002-12-10 06:25:43 +0000
 1.8 16-Oct-2005  christos move to the new compat layout.
 1.7 21-Aug-2004  rearnsha Use RET and RETc for returning.
 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 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.4 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.3 09-Jan-2001  bjh21 branches: 1.3.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.2 09-Jan-2001  bjh21 Add some explanatory comments.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5 19-Aug-2013  matt Always compile as ARM even if -mthumb is given.
 1.4 17-Aug-2013  matt Enforce that this must be not compiled using Thumb1
 1.3 20-Nov-2012  matt Add $NetBSD$ tag. Use ip to save r1 instead of the stack.
 1.2 14-Feb-2012  matt branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Add workaround for ARM cores that don't properly implement the MRC instruction
used for reading the thread pointer. This is the corresponding change which
was made to <arm/mcontext.h>
 1.1 18-Nov-2011  joerg Hook up TLS support on ARM. Tested by martin@, kernel support from matt@
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 25-Feb-2013  tls resync with head
 1.2.6.1 20-Nov-2012  matt Don't push/pop r1 around SYSTRAP, save it in ip instead.
 1.2.4.4 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.2.4.3 16-Jan-2013  yamt sync with (a bit old) head
 1.2.4.2 17-Apr-2012  yamt sync with head
 1.2.4.1 14-Feb-2012  yamt file __aeabi_read_tp.S was added on branch yamt-pagecache on 2012-04-17 00:05:13 +0000
 1.2.2.1 24-Nov-2012  riz Pull up following revision(s) (requested by matt in ticket #701):
lib/libc/arch/arm/sys/__aeabi_read_tp.S: revision 1.3
Add $NetBSD$ tag. Use ip to save r1 instead of the stack.
 1.14 30-Jun-2021  skrll Do previous differtly by pushing two registers in the same way as the
_INVOKE_CERROR macro
 1.13 30-Jun-2021  skrll The _INVOKE_CERROR macro deals with thumb so simplify the code (at the
expense of a couple more instructions).
 1.12 30-Jun-2021  skrll Trailing whitespace
 1.11 30-Jun-2021  rin Fix previous. For Thumb-1:
- sp cannot be manipulated directly
- {add,sub}s should be used instead of {add,sub}
 1.10 29-Jun-2021  rin Align sp to 8-byte boundary as required by EABI.

IIUC, this change only affects libc compiled for ``Thumb-mode userland'',
which we've not officially supported yet.
 1.9 30-Nov-2013  joerg branches: 1.9.28;
Use PLT_SYM.
 1.8 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.7 01-Aug-2013  matt CERROR is now hidden so no need to call it via the PLT
 1.6 24-Apr-2006  snj branches: 1.6.10; 1.6.44; 1.6.50;
It's "its."
 1.5 21-Aug-2004  rearnsha Use RETc for returning. When v4T or later use BX for calling the target.
 1.4 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 27-Aug-2002  mycroft Do the appropriate PIC magic for the jump to _exit().
 1.2 17-Aug-2002  thorpej Local label fixup.
 1.1 22-Jul-2001  chris branches: 1.1.2; 1.1.4;
Add __clone() for arm.
 1.1.4.1 27-Aug-2002  lukem Pull up revision 1.3 (requested by mycroft in ticket #737):
Do the appropriate PIC magic for the jump to _exit().
 1.1.2.4 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 22-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:17:07 +0000
 1.6.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.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.6.10.1 28-Aug-2007  matt More thumb support
 1.9.28.1 08-Aug-2021  martin Pull up following revision(s) (requested by skrll in ticket #1329):

lib/libc/arch/arm/gen/swapcontext.S: revision 1.18
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S: revision 1.3
lib/libc/arch/arm/sys/__clone.S: revision 1.10
lib/libc/arch/arm/sys/__clone.S: revision 1.11
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S: revision 1.2
lib/libc/arch/arm/sys/__clone.S: revision 1.12
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S: revision 1.3
lib/libc/arch/arm/sys/__clone.S: revision 1.13
lib/libc/arch/arm/sys/__clone.S: revision 1.14
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S: revision 1.3
lib/libc/arch/arm/gen/swapcontext.S: revision 1.16
lib/libc/arch/arm/gen/swapcontext.S: revision 1.17

Align sp to 8-byte boundary as required by EABI.

This is especially important for non-leaf functions; GCC optimizes codes
based on assumption that sp is aligned properly.

Mostly fix broken earmv5 userland compiled by GCC10 due to alignment
faults in ld.elf_so, where {ld,st}rd are used for [sp, #8x].

No regression for ATF is observed for earmv[67]{,hf}{,eb}.

Align sp to 8-byte boundary as required by EABI.
IIUC, this change only affects libc compiled for ``Thumb-mode userland'',
which we've not officially supported yet.

Fix previous. For Thumb-1:
- sp cannot be manipulated directly
- {add,sub}s should be used instead of {add,sub}

Trailing whitespace

The _INVOKE_CERROR macro deals with thumb so simplify the code (at the
expense of a couple more instructions).

Do previous differently by pushing even number of registers and remove
strange r7 usage.

Do previous differtly by pushing two registers in the same way as the
_INVOKE_CERROR macro
 1.2 16-Oct-2005  christos move to the new compat layout.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.8 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.7 28-Apr-2008  martin branches: 1.7.8;
Remove clause 3 and 4 from TNF licenses
 1.6 19-Feb-2006  christos branches: 1.6.18;
make these consistent.
 1.5 12-Jun-2005  lukem Add missing __RCSID()
 1.4 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.3 05-Oct-2003  matt Add SA_SIGINFO support for ARM.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:27:55 +0000
 1.6.18.1 18-May-2008  yamt sync with head.
 1.7.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.5 16-Oct-2005  christos move to the new compat layout.
 1.4 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 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 09-Jan-2001  bjh21 Replace boiler-plate code sequences with macro invocations from SYS.h.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.3 16-Oct-2005  christos move to the new compat layout.
 1.2 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:27:55 +0000
 1.5 27-Nov-2021  skrll Trailing whitespace
 1.4 23-Nov-2021  thorpej Decorate the ARM signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.3 16-Aug-2013  matt Add END
 1.2 28-Apr-2008  martin branches: 1.2.4; 1.2.8; 1.2.28;
Remove clause 3 and 4 from TNF licenses
 1.1 05-Oct-2003  matt branches: 1.1.30;
Add SA_SIGINFO support for ARM.
 1.1.30.1 18-May-2008  yamt sync with head.
 1.2.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 __sigtramp2.S was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.2.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.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 09-Jan-2001  bjh21 Replace boiler-plate code sequences with macro invocations from SYS.h.
 1.2 09-Jan-2001  bjh21 Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.10 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.9 16-Aug-2013  matt Thumbify & optimize a little
 1.8 01-Aug-2013  matt CERROR is now hidden so no need to call it via the PLT
 1.7 21-Aug-2004  rearnsha branches: 1.7.16; 1.7.50; 1.7.56;
Use RET and RETc for returning.
 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 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.4 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.3 09-Jan-2001  bjh21 branches: 1.3.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.2 09-Jan-2001  bjh21 Add some explanatory comments.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.7.56.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.50.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.16.1 28-Aug-2007  matt More thumb support
 1.13 12-Sep-2013  joerg 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 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.11 01-Aug-2013  matt CERROR is now hidden so no need to call it via the PLT
 1.10 01-Aug-2013  matt Make __minbrk, __curbrk, and CERROR hidden and avoid using the GOT to access
them.
 1.9 13-May-2011  nonaka branches: 1.9.4; 1.9.10;
Use "_end" instead of "end" for consistency with other architectures.
 1.8 21-Aug-2004  rearnsha branches: 1.8.16;
Use RET and RETc for returning.
 1.7 26-Dec-2003  martin Use an unsigned comparison against minbrk.
From Steve Woodford, inspired by a similar change to other archs from
OpenBSD.
 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 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.4 17-Aug-2002  thorpej Local label fixup.
 1.3 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.2 09-Jan-2001  bjh21 branches: 1.2.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.2 27-Aug-2002  nathanw Catch up to -current.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.8.16.1 28-Aug-2007  matt More thumb support
 1.9.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.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.18 07-May-2025  uwe arm: asm.h - change GOT_INIT to take the normal asm label

Don't pass the label to use for the "current address" as the macro
parameter. It obscures its purpose and makes the use of local labels
extremely unobvious, so you are forced to invent a name that is mostly
useless otherwise:

GOT_INIT(r3, .Lgot.execsp_start, .Lpc.execsp_start)
GOT_INITSYM(.Lgot.execsp_start, .Lpc.execsp_start)
vs.
0: GOT_INIT(r3, .Lgot.execsp_start)
GOT_INITSYM(.Lgot.execsp_start, 0b)

Same object code is generated.
 1.17 07-May-2025  uwe arm: cerror.S - use GOT_SYM

Use GOT_SYM instead of open-coding it. It's defined in asm.h but
doesn't seem to be used anywhere, so perk it up.

While here, be consistent about declaring errno and use that as a
chance to provide a comment why #ifdef _REENTRANT is needed here.
 1.16 07-May-2025  uwe arm: cerror.S - factor out code to return -1

Do not repeat verbose ifdefed code that sets (long long){ r0, r1 } to
-1LL that indicates an error return from a syscall. Define it once as
a macro and use it. Fix the code to actually be compilable as thumb
("mov" vs "movs").

Modulo one fixed "mov" vs "movs" the same object code is generated for
all 8 permutations of (arm/thumb x non/reentrant x absolute/pic).
 1.15 06-May-2025  uwe arm/asm.h: revert PCREL_GET &c in previous (ok riastradh)

This change needs to be redone and re-verified. I have detailed some
issues in the PR, and it also turns out that some of the changes were
in the !_REENTRANT branch of #ifdef and thus not checked at all.
riastradh asked to back out the changes for now.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.14 03-May-2025  riastradh arm: Nix most __PIC__ conditionals in .S files.

New macros PCREL_GET(rN,label,pclabel) and PCREL_SYM(label,pclabel)
to enable this by the pattern:

ldr rN, label
#ifdef __PIC__
pclabel:
add rN, rN, pc
#endif
...
label:
#ifdef __PIC__
.word (label - (pclabel + 2*sizeof(instruction)))
#else
.word label
#endif

(sizeof(instruction) = 2 for thumb, 4 for non-thumb.)

No binary change in libc with MKPIE=no (i.e., testing both for
changes to the PIC build and changes to the non-PIC build).

In principle, assembly routines could improve instruction scheduling
by splitting up the ldr and add instructions. But in practice, the
maintenance and auditing burden likely makes this worthwhile by
improving legibility vs a tangle of in-line #ifdefs.

brk.S does things a little differently making it harder to unify.
Could redo it but I don't want to make changes without testing them
first.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.13 30-Nov-2013  joerg branches: 1.13.38;
Use PLT_SYM.
 1.12 12-Sep-2013  joerg 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.11 04-Sep-2013  matt only emit cfi if __ARM_EABI__ && __UNWIND_TABLES__
 1.10 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.9 01-Aug-2013  matt CERROR is now hidden so no need to call it via the PLT
 1.8 27-Feb-2012  joerg branches: 1.8.2;
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
 1.7 14-Jan-2011  matt branches: 1.7.6; 1.7.8;
Change __cerror to be marked hidden and change callers to avoid the PLT.
 1.6 21-Aug-2004  rearnsha branches: 1.6.16;
Use RET and RETc for returning.
 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 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 17-Aug-2002  thorpej Local label fixup.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.16.1 28-Aug-2007  matt More thumb support
 1.7.8.1 27-Feb-2012  riz Pull up following revision(s) (requested by joerg in ticket #57):
lib/libc/arch/arm/sys/cerror.S: revision 1.8
lib/libc/arch/vax/SYS.h: revision 1.12
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.3
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.4
lib/libc/arch/i386/sys/cerror.S: revision 1.16
lib/libc/arch/x86_64/sys/cerror.S: revision 1.5
lib/libc/arch/powerpc/sys/cerror.S: revision 1.10
lib/libc/arch/mips/sys/cerror.S: revision 1.17
lib/libc/arch/powerpc/sys/cerror.S: revision 1.9
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.7.6.2 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.6.1 17-Apr-2012  yamt sync with head
 1.8.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.38.1 02-Aug-2025  perseant Sync with HEAD
 1.5 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.4 07-Aug-2003  agc branches: 1.4.80; 1.4.84;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 09-Jan-2001  bjh21 Replace boiler-plate code sequences with macro invocations from SYS.h.
 1.2 09-Jan-2001  bjh21 Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.4.84.1 21-Apr-2017  bouyer Sync with HEAD
 1.4.80.1 20-Mar-2017  pgoyette Sync with HEAD
 1.7 16-Aug-2013  matt thumbify and add END
 1.6 21-Aug-2004  rearnsha branches: 1.6.50; 1.6.56;
Use RET and RETc for returning.
 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 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.2 09-Jan-2001  bjh21 Add some explanatory comments.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.6.56.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.50.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.10 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.9 01-Aug-2013  matt CERROR is now hidden so no need to call it via the PLT
 1.8 30-Apr-2013  skrll include assym.h
 1.7 30-Apr-2013  skrll Don't hardcode offset in assembler. This ensures the return value in the
context is the correct value (0) on earm*
 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 30-Mar-2008  chris branches: 1.5.2;
Use SYSTRAP macro, rather than inlining the swi instruction.

This makes sure the SWI will be in the NetBSD assigned range of swi
numbers.
 1.4 21-Aug-2004  rearnsha branches: 1.4.16;
Use RET and RETc for returning.
 1.3 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 15-Nov-2001  thorpej branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.2 18-Nov-2001  thorpej Make this file work with ELF.
 1.1.2.1 15-Nov-2001  thorpej ARM-specific makecontext(), _resumecontext(), swapcontext(),
and getcontext(). From Klaus Kein <kleink@netbsd.org>.
 1.4.16.1 28-Aug-2007  matt More thumb support
 1.5.2.1 18-May-2008  yamt sync with head.
 1.6.28.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.28.1 23-Jun-2013  tls resync from 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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:56 +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.2 16-Oct-2005  christos move to the new compat layout.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.8 16-Aug-2013  matt Use _INVOKE_CERROR
use stmia instead of two str
add END
 1.7 01-Aug-2013  matt CERROR is now hidden so no need to call it via the PLT
 1.6 21-Aug-2004  rearnsha branches: 1.6.16; 1.6.50; 1.6.56;
Use RET and RETc for returning.
 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 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.2 09-Jan-2001  bjh21 branches: 1.2.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.56.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.50.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.6.16.1 28-Aug-2007  matt More thumb support
 1.14 06-May-2025  uwe arm/asm.h: revert PCREL_GET &c in previous (ok riastradh)

This change needs to be redone and re-verified. I have detailed some
issues in the PR, and it also turns out that some of the changes were
in the !_REENTRANT branch of #ifdef and thus not checked at all.
riastradh asked to back out the changes for now.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.13 03-May-2025  riastradh arm: Nix most __PIC__ conditionals in .S files.

New macros PCREL_GET(rN,label,pclabel) and PCREL_SYM(label,pclabel)
to enable this by the pattern:

ldr rN, label
#ifdef __PIC__
pclabel:
add rN, rN, pc
#endif
...
label:
#ifdef __PIC__
.word (label - (pclabel + 2*sizeof(instruction)))
#else
.word label
#endif

(sizeof(instruction) = 2 for thumb, 4 for non-thumb.)

No binary change in libc with MKPIE=no (i.e., testing both for
changes to the PIC build and changes to the non-PIC build).

In principle, assembly routines could improve instruction scheduling
by splitting up the ldr and add instructions. But in practice, the
maintenance and auditing burden likely makes this worthwhile by
improving legibility vs a tangle of in-line #ifdefs.

brk.S does things a little differently making it harder to unify.
Could redo it but I don't want to make changes without testing them
first.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.12 30-Nov-2013  joerg branches: 1.12.38;
Use PLT_SYM.
 1.11 12-Sep-2013  joerg 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.10 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.9 01-Aug-2013  matt CERROR is now hidden so no need to call it via the PLT
 1.8 21-Aug-2004  rearnsha branches: 1.8.16; 1.8.50; 1.8.56;
Use RET and RETc for returning.
 1.7 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.6 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.5 17-Aug-2002  thorpej Local label fixup.
 1.4 13-Nov-2001  chris Update arm libc files for 8 byte aligned stack.
 1.3 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.2 09-Jan-2001  bjh21 branches: 1.2.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.2.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.8.56.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.50.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.8.16.1 28-Aug-2007  matt More thumb support
 1.12.38.1 02-Aug-2025  perseant Sync with HEAD
 1.14 06-May-2025  uwe arm/asm.h: revert PCREL_GET &c in previous (ok riastradh)

This change needs to be redone and re-verified. I have detailed some
issues in the PR, and it also turns out that some of the changes were
in the !_REENTRANT branch of #ifdef and thus not checked at all.
riastradh asked to back out the changes for now.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.13 03-May-2025  riastradh arm: Nix most __PIC__ conditionals in .S files.

New macros PCREL_GET(rN,label,pclabel) and PCREL_SYM(label,pclabel)
to enable this by the pattern:

ldr rN, label
#ifdef __PIC__
pclabel:
add rN, rN, pc
#endif
...
label:
#ifdef __PIC__
.word (label - (pclabel + 2*sizeof(instruction)))
#else
.word label
#endif

(sizeof(instruction) = 2 for thumb, 4 for non-thumb.)

No binary change in libc with MKPIE=no (i.e., testing both for
changes to the PIC build and changes to the non-PIC build).

In principle, assembly routines could improve instruction scheduling
by splitting up the ldr and add instructions. But in practice, the
maintenance and auditing burden likely makes this worthwhile by
improving legibility vs a tangle of in-line #ifdefs.

brk.S does things a little differently making it harder to unify.
Could redo it but I don't want to make changes without testing them
first.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.12 12-Sep-2013  joerg branches: 1.12.38;
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.11 03-Sep-2013  matt Use less got, add END(), make thumb tolerant.
 1.10 01-Aug-2013  matt Make __minbrk, __curbrk, and CERROR hidden and avoid using the GOT to access
them.
 1.9 13-May-2011  nonaka branches: 1.9.4; 1.9.10;
Use "_end" instead of "end" for consistency with other architectures.
 1.8 21-Aug-2004  rearnsha branches: 1.8.16;
Use RET and RETc for returning.
 1.7 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.6 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.5 17-Aug-2002  thorpej Local label fixup.
 1.4 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.3 05-May-2001  kleink Shameless hack to reference end when using a.out and _end when using ELF.
 1.2 09-Jan-2001  bjh21 branches: 1.2.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.2 27-Aug-2002  nathanw Catch up to -current.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.8.16.1 28-Aug-2007  matt More thumb support
 1.9.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.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.12.38.1 02-Aug-2025  perseant Sync with HEAD
 1.4 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.3 17-Aug-2002  thorpej Local label fixup.
 1.2 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.1.2.2 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.1.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2 16-Oct-2005  christos move to the new compat layout.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2 16-Oct-2005  christos move to the new compat layout.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.7 16-Oct-2005  christos move to the new compat layout.
 1.6 21-Aug-2004  rearnsha Use RET and RETc for returning.
 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 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.2 09-Jan-2001  bjh21 branches: 1.2.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.7 16-Oct-2005  christos move to the new compat layout.
 1.6 21-Aug-2004  rearnsha Use RET and RETc for returning.
 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 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.2 09-Jan-2001  bjh21 branches: 1.2.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.4 16-Oct-2005  christos move to the new compat layout.
 1.3 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 1.2 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.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.8 16-Oct-2005  christos move to the new compat layout.
 1.7 21-Aug-2004  rearnsha Use RET and RETc for returning.
 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 05-Apr-2003  bjh21 Use the correct instruction for returning ffrom a function (MOV rather
than MOVS).
 1.4 05-Apr-2003  bjh21 NetBSD/acorn26 has been using APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 16-Jul-2001  matt Changes needed for ARM ELF shared library support.
 1.2 09-Jan-2001  bjh21 branches: 1.2.2;
Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.4 07-Aug-2003  agc branches: 1.4.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 09-Jan-2001  bjh21 Replace boiler-plate code sequences with macro invocations from SYS.h.
 1.2 09-Jan-2001  bjh21 Use SYSTRAP() everywhere rather than coding SWI instructions directly.
 1.1 29-Dec-2000  bjh21 Create shared ARM source for libc, and move arm26 port over to using it.
The code is (almost) a direct copy of the current arm26 sources.
It's identical to the current arm32 sources, with the following exceptions:
- _C_LABEL is used on references to C labels from assembler.
- Function returns in assembler have APCS-26 versions in #ifdef __APCS_26__.
- It uses SoftFloat 2a rather than SoftFloat 1a.

The first two of these should be inconsequential. I believe that SoftFloat 2a
should work on arm32 and be backward-compatible with existing code, but this
is not obviously true. For now, arm32 remains using its own bits of libc.
 1.4.98.1 21-Apr-2020  martin Sync with HEAD
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.11 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.10 19-Feb-2014  skrll Provide a genassym.cf in libc for hppa and use it.
 1.9 21-Oct-2009  skrll branches: 1.9.6; 1.9.12;
G/C bcopy.m4 and references to it.
 1.8 26-Oct-2008  mrg branches: 1.8.4;
define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build.
 1.7 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.6 05-Jun-2005  chs remove sigtramp version 1, we haven't used it in a long time.
 1.5 18-Jul-2004  chs added new files for context, LWP and siginfo support.
 1.4 01-Jul-2004  skrll Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.8.4.2 26-Oct-2008  mrg define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build.
 1.8.4.1 26-Oct-2008  mrg file Makefile.inc was added on branch christos-time_t on 2008-10-26 07:43:08 +0000
 1.9.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.6.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.12 05-May-2020  skrll Mark __cerror as hidden to avoid using the PLT. This is required for new
binutils where the PLT stubs now use %t1 (%r22) which is used to pass
the errno to __cerror.
 1.11 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.10 05-May-2020  skrll Remove unnecesary #define/#undef _LOCORE
 1.9 06-Mar-2014  skrll Move to a flat space register convention. %sr[4-7] are all now the space
number allocated to the process. gcc produces (slightly) better code
with this convention.

Retain backwards compatiblity.

Welcome to 6.99.36
 1.8 24-Aug-2013  skrll Whitespace.
 1.7 03-Nov-2009  snj branches: 1.7.6; 1.7.12;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.6 18-Nov-2007  skrll Generate correct unwind info for syscall stubs by using LEAF_ENTRY instead
of ENTRY(foo,0) so that gdb can backtrace through the stubs.
 1.5 01-Jul-2004  skrll branches: 1.5.16;
Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.4 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.3 04-Jul-2002  thorpej Remove "_THREAD_SAFE" stuff that is not used on NetBSD.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5.16.1 09-Jan-2008  matt sync with HEAD
 1.7.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.6.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.5 20-Apr-2024  skrll Remove some magic numbers by using genassym.cf
 1.4 26-Jun-2022  skrll Decorate the HPPA signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.3 24-Oct-2020  skrll Add _UC_GREGS_* defines for all general registers
 1.2 15-Oct-2020  skrll Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.1 19-Feb-2014  skrll branches: 1.1.4; 1.1.8;
Provide a genassym.cf in libc for hppa and use it.
 1.1.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 19-Feb-2014  tls file genassym.cf was added on branch tls-maxphys on 2014-08-20 00:02:09 +0000
 1.1.4.2 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.1.4.1 19-Feb-2014  yamt file genassym.cf was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.15 28-Jun-2006  drochner build frexp/ldexp/modf in the "compat" part (code is identical)
(These are the easy cases where no assembler implementations exist.)
 1.14 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.13 19-Feb-2005  tsutsui branches: 1.13.2;
Add (missed) fabs.c to SRCS.
 1.12 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.11 18-Jul-2004  chs added new files for context, LWP and siginfo support.
 1.10 04-Mar-2004  kleink * 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.9 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.8 30-Oct-2003  kleink It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.7 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.6 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 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.4 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.3 26-Oct-2002  thorpej * Use the common ieee754_* routines (and add ones we were missing).
* Note that several routines are still missing for hppa.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.13.2.1 19-Apr-2005  tron Pull up revision 1.14 (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.7 13-Apr-2025  riastradh hppa longjmp: Use _UC_SIGMASK to restore signal mask.

This way, restoring the signal mask and restoring the stack pointer
happen atomically with respect to signal handler calls, whereas using
sigprocmask would restore the signal mask _before_ the stack pointer,
breaking sigaltstack.

The motivation for using sigprocmask first and then setcontext later,
rather than _UC_SIGMASK in setcontext, was to get SA-based libpthead
sigprocmask interposition. But that's long gone and unlikely to come
back.

Tested under qemu with:

atf-run /usr/tests/lib/libc/setjmp | atf-report
atf-run /usr/tests/lib/libpthread/t_siglongjmp | atf-report

PR lib/57946: longjmp fails to restore stack first before restoring
signal mask on most architectures
 1.6 25-Jan-2016  christos branches: 1.6.28;
use __register_t
 1.5 22-Mar-2012  skrll Shut lint up about dp.

From he@
 1.4 28-Apr-2008  martin branches: 1.4.4; 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 24-Dec-2005  perry branches: 1.3.18;
__asm__ -> __asm, __volatile__ -> __volatile
 1.2 14-Sep-2005  he Patterned after the other fixes for __longjmp14.c, include
<compat/include/setjmp.h> also here to make these build.
 1.1 18-Jul-2004  chs split __longjmp14() into a separate file and make it use setcontext()
instead of __sigreturn14(). translated from MIPS.
 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 __longjmp14.c was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.4.4.1 17-Apr-2012  yamt sync with head
 1.6.28.1 02-Aug-2025  perseant Sync with HEAD
 1.10 20-Apr-2024  skrll Remove some magic numbers by using genassym.cf
 1.9 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.8 04-May-2020  skrll Remove unnecesary #define/#undef _LOCORE
 1.7 03-May-2020  skrll Even more trailing whitespace
 1.6 16-Jul-2016  skrll No need to define PSW_MBS as machine/psl.h provides it for us
 1.5 28-Apr-2008  martin branches: 1.5.8; 1.5.46;
Remove clause 3 and 4 from TNF licenses
 1.4 18-Jul-2004  chs branches: 1.4.24;
split __longjmp14() into a separate file and make it use setcontext()
instead of __sigreturn14(). translated from MIPS.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4.24.1 18-May-2008  yamt sync with head.
 1.5.46.1 26-Jul-2016  pgoyette Sync with HEAD
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file __setjmp14.S was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 06-Jun-2002  fredette branches: 1.1.30;
Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.1.30.1 18-May-2008  yamt 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 __sigsetjmp14.S was added on branch christos-time_t on 2008-04-28 20:22:56 +0000
 1.7 25-Apr-2025  riastradh hppa _lwp_makecontext: Align stack pointer.

PR kern/59327: user stack pointer is not aligned properly
 1.6 25-Apr-2025  riastradh hppa _lwp_makecontext, makecontext: Sort includes.

No functional change intended.

PR kern/59327: user stack pointer is not aligned properly
 1.5 24-Feb-2011  joerg branches: 1.5.56;
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.4 07-Jan-2010  skrll branches: 1.4.2;
Deal with PLABELs in _lwp_makecontext
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 12-Jun-2005  lukem branches: 1.2.18;
Add missing __RCSID()
 1.1 18-Jul-2004  chs add *context and LWP support for hppa. translated from MIPS.
 1.2.18.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 _lwp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.2.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.56.1 02-Aug-2025  perseant Sync with HEAD
 1.4 12-Sep-2013  joerg 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.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8; 1.3.28;
Remove clause 3 and 4 from TNF licenses
 1.2 02-Dec-2007  skrll branches: 1.2.6;
Fix include files and change use LEAF_ENTRY_NOPROFILE function to fix
the unwind entry.
 1.1 18-Jul-2004  chs branches: 1.1.16;
add *context and LWP support for hppa. translated from MIPS.
 1.1.16.1 09-Jan-2008  matt sync with HEAD
 1.2.6.1 18-May-2008  yamt sync with head.
 1.3.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 _resumecontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.3.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 04-May-2024  skrll Remove magic numbers. NFCI.
 1.6 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.5 04-May-2020  skrll Remove unnecesary #define/#undef _LOCORE
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 18-Jul-2004  chs branches: 1.3.24;
call abort() if longjmperror() returns.
 1.2 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.3.24.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 _setjmp.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.6 08-Nov-2018  riastradh Try speling it rite, riasthradhdadhaa or whatever your name is.
 1.5 07-Nov-2018  riastradh On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.

For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm. For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64. Need help from an itanium
wizard! Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.
 1.4 24-Dec-2005  perry branches: 1.4.84; 1.4.86;
oops. __volatile -> volatile
 1.3 24-Dec-2005  perry __asm__ -> __asm, __volatile__ -> __volatile
 1.2 02-Dec-2005  skrll WARNS
 1.1 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.4.86.1 10-Jun-2019  christos Sync with HEAD
 1.4.84.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.5 23-Mar-2012  skrll Shut lint up.

From he@
 1.4 24-Dec-2005  perry branches: 1.4.44;
oops. __volatile -> volatile
 1.3 24-Dec-2005  perry __asm__ -> __asm, __volatile__ -> __volatile
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.4.44.1 17-Apr-2012  yamt sync with head
 1.2 30-Oct-2003  kleink It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.1 28-Oct-2003  kleink 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.5 23-Mar-2012  skrll Shut lint up.

From he@
 1.4 24-Dec-2005  perry branches: 1.4.44;
oops. __volatile -> volatile
 1.3 24-Dec-2005  perry __asm__ -> __asm, __volatile__ -> __volatile
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.4.44.1 17-Apr-2012  yamt sync with head
 1.5 23-Mar-2012  skrll Shut lint up.

From he@
 1.4 24-Dec-2005  perry branches: 1.4.44;
oops. __volatile -> volatile
 1.3 24-Dec-2005  perry __asm__ -> __asm, __volatile__ -> __volatile
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.4.44.1 17-Apr-2012  yamt sync with head
 1.5 23-Mar-2012  skrll Shut lint up.

From he@
 1.4 24-Dec-2005  perry branches: 1.4.44;
oops. __volatile -> volatile
 1.3 24-Dec-2005  perry __asm__ -> __asm, __volatile__ -> __volatile
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.4.44.1 17-Apr-2012  yamt sync with head
 1.6 23-Mar-2012  skrll Shut lint up.

From he@
 1.5 25-Jan-2009  skrll branches: 1.5.8;
Sprinkle the "memory" clobber register so the fpsr manipulation actually
happens.

Fixes the ieeefp/except regresion test.
 1.4 24-Dec-2005  perry branches: 1.4.26;
oops. __volatile -> volatile
 1.3 24-Dec-2005  perry __asm__ -> __asm, __volatile__ -> __volatile
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.4.26.1 26-Jan-2009  snj Pull up following revision(s) (requested by skrll in ticket #318):
lib/libc/arch/hppa/gen/fpsetmask.c: revision 1.5
lib/libc/arch/hppa/gen/fpsetround.c: revision 1.5
lib/libc/arch/hppa/gen/fpsetsticky.c: revision 1.5
Sprinkle the "memory" clobber register so the fpsr manipulation actually
happens.
Fixes the ieeefp/except regresion test.
 1.5.8.1 17-Apr-2012  yamt sync with head
 1.6 23-Mar-2012  skrll Shut lint up.

From he@
 1.5 25-Jan-2009  skrll branches: 1.5.8;
Sprinkle the "memory" clobber register so the fpsr manipulation actually
happens.

Fixes the ieeefp/except regresion test.
 1.4 24-Dec-2005  perry branches: 1.4.26;
oops. __volatile -> volatile
 1.3 24-Dec-2005  perry __asm__ -> __asm, __volatile__ -> __volatile
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.4.26.1 26-Jan-2009  snj Pull up following revision(s) (requested by skrll in ticket #318):
lib/libc/arch/hppa/gen/fpsetmask.c: revision 1.5
lib/libc/arch/hppa/gen/fpsetround.c: revision 1.5
lib/libc/arch/hppa/gen/fpsetsticky.c: revision 1.5
Sprinkle the "memory" clobber register so the fpsr manipulation actually
happens.
Fixes the ieeefp/except regresion test.
 1.5.8.1 17-Apr-2012  yamt sync with head
 1.6 23-Mar-2012  skrll Shut lint up.

From he@
 1.5 25-Jan-2009  skrll branches: 1.5.8;
Sprinkle the "memory" clobber register so the fpsr manipulation actually
happens.

Fixes the ieeefp/except regresion test.
 1.4 24-Dec-2005  perry branches: 1.4.26;
oops. __volatile -> volatile
 1.3 24-Dec-2005  perry __asm__ -> __asm, __volatile__ -> __volatile
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 24-Jul-2004  chs add missing FP functions, from openbsd.
 1.4.26.1 26-Jan-2009  snj Pull up following revision(s) (requested by skrll in ticket #318):
lib/libc/arch/hppa/gen/fpsetmask.c: revision 1.5
lib/libc/arch/hppa/gen/fpsetround.c: revision 1.5
lib/libc/arch/hppa/gen/fpsetsticky.c: revision 1.5
Sprinkle the "memory" clobber register so the fpsr manipulation actually
happens.
Fixes the ieeefp/except regresion test.
 1.5.8.1 17-Apr-2012  yamt sync with head
 1.2 26-Oct-2002  thorpej * Use the common ieee754_* routines (and add ones we were missing).
* Note that several routines are still missing for hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.2 30-Oct-2003  kleink It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.1 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.2 30-Oct-2003  kleink It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.1 29-Oct-2003  kleink C99 7.12.3.2: add library portions of isfinite, but don't build these just
yet.
 1.2 26-Oct-2002  thorpej * Use the common ieee754_* routines (and add ones we were missing).
* Note that several routines are still missing for hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4 30-Oct-2003  kleink It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.3 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.2 27-Oct-2003  kleink Retire local union { floating-type; struct ieee_prec; } in favor of those
available from <machine/ieee.h>
 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.2 26-Oct-2002  thorpej * Use the common ieee754_* routines (and add ones we were missing).
* Note that several routines are still missing for hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4 30-Oct-2003  kleink It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.3 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.2 27-Oct-2003  kleink Retire local union { floating-type; struct ieee_prec; } in favor of those
available from <machine/ieee.h>
 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.2 26-Oct-2002  thorpej * Use the common ieee754_* routines (and add ones we were missing).
* Note that several routines are still missing for hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.8 25-Apr-2025  riastradh hppa makecontext: Use STACK_ALIGNBYTES to refer to stack alignment.

No functional change intended -- just make it clearer and easier to
search.

PR kern/59327: user stack pointer is not aligned properly
 1.7 25-Apr-2025  riastradh hppa _lwp_makecontext, makecontext: Sort includes.

No functional change intended.

PR kern/59327: user stack pointer is not aligned properly
 1.6 22-Mar-2012  skrll branches: 1.6.44;
Shut lint up about dp.

From he@
 1.5 20-Sep-2011  joerg branches: 1.5.2;
Explicitly add back __resumecontext wrapper
 1.4 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 24-Dec-2005  perry branches: 1.2.18;
__asm__ -> __asm, __volatile__ -> __volatile
 1.1 18-Jul-2004  chs add *context and LWP support for hppa. translated from MIPS.
 1.2.18.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 makecontext.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.5.2.1 17-Apr-2012  yamt sync with head
 1.6.44.1 02-Aug-2025  perseant Sync with HEAD
 1.2 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.1 15-Apr-2005  kleink branches: 1.1.2; 1.1.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.1.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.1.2.2 19-Apr-2005  tron Pull up revision 1.1 (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.1.2.1 15-Apr-2005  tron file nanf.c was added on branch netbsd-3 on 2005-04-19 12:32:50 +0000
 1.5 24-Aug-2013  skrll Whitespace.
 1.4 19-Sep-2011  joerg branches: 1.4.2; 1.4.8;
Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 08-Dec-2006  martin branches: 1.2.10;
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-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.1 18-Jul-2004  chs branches: 1.1.10;
add *context and LWP support for hppa. translated from MIPS.
 1.1.10.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #264):
lib/libc/arch/sh5/gen/resumecontext.c: revision 1.2
lib/libc/arch/sh3/gen/resumecontext.c: revision 1.3
lib/libc/arch/sparc/gen/resumecontext.c: revision 1.3
lib/libc/arch/powerpc/gen/resumecontext.c: revision 1.3
lib/libc/arch/arm/gen/resumecontext.c: revision 1.3
lib/libc/arch/mips/gen/resumecontext.c: revision 1.3
lib/libc/arch/vax/gen/resumecontext.c: revision 1.2
lib/libc/arch/powerpc64/gen/resumecontext.c: revision 1.2
lib/libc/arch/hppa/gen/resumecontext.c: revision 1.2
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:
-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.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.2.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.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.8 15-Oct-2020  skrll Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.7 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.6 19-Feb-2014  skrll Provide a genassym.cf in libc for hppa and use it.
 1.5 12-Sep-2012  manu branches: 1.5.2;
setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@
 1.4 28-Apr-2008  martin branches: 1.4.4; 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 18-Nov-2007  skrll branches: 1.3.6;
Remove unused include.

Fix unwind info with S/ENTRY/LEAF_&/
 1.2 28-Oct-2007  skrll Set up the tail of the instruction address queue so that
we don't have to rely on luck for swapcontext(3) to work.

This fixes a problem pointed out to me by Chuck Silvers.
 1.1 18-Jul-2004  chs branches: 1.1.10; 1.1.12; 1.1.16;
add *context and LWP support for hppa. translated from MIPS.
 1.1.16.2 09-Jan-2008  matt sync with HEAD
 1.1.16.1 06-Nov-2007  matt sync with HEAD
 1.1.12.1 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.1.10.1 29-Oct-2007  pavel Pull up following revision (requested by skrll in ticket #955):
lib/libc/arch/hppa/gen/swapcontext.S: revision 1.2
Set up the tail of the instruction address queue so that
we don't have to rely on luck for swapcontext(3) to work.
This fixes a problem pointed out to me by Chuck Silvers.
 1.3.6.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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.4.2 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.4.4.1 30-Oct-2012  yamt sync with head
 1.5.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.3 04-Aug-2008  matt branches: 1.3.6;
Add C99 functions imaxabs and imaxdiv.
 1.2 22-Mar-2006  drochner branches: 1.2.20;
build erand48_ieee754.c on everything but vax
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.2.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.3.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.3 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.2 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.3 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.2 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.2 21-Oct-2009  skrll G/C bcopy.m4 and references to it.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.3 03-May-2020  skrll Even more trailing whitespace
 1.2 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.4 03-May-2020  skrll Even more trailing whitespace
 1.3 18-Jul-2004  chs add a missing return instruction.
 1.2 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.4 03-May-2020  skrll Even more trailing whitespace
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 06-Oct-2003  matt branches: 1.2.30;
Update to new assmbler needs. Add getcontext.S stub.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.2.30.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 strlcpy.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.3 11-Mar-2006  christos move to the new compat layout.
 1.2 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.8 05-May-2020  skrll Mark __cerror as hidden to avoid using the PLT. This is required for new
binutils where the PLT stubs now use %t1 (%r22) which is used to pass
the errno to __cerror.
 1.7 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.6 28-Apr-2008  martin branches: 1.6.8;
Remove clause 3 and 4 from TNF licenses
 1.5 18-Jul-2004  chs branches: 1.5.24;
replace these placeholders with real implementations.
translated from the mips version.
 1.4 01-Jul-2004  skrll Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5.24.1 18-May-2008  yamt 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 __clone.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2 11-Mar-2006  christos move to the new compat layout.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 12-Jun-2005  lukem branches: 1.3.18;
Add missing __RCSID()
 1.2 18-Jul-2004  chs add a siginfo signal trampoline and always use it.
 1.1 09-Jul-2002  thorpej New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 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 __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.5 11-Mar-2006  christos move to the new compat layout.
 1.4 17-May-2004  chs __sigreturn14 -> compat_16___sigreturn14
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 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.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4 05-Jun-2005  chs remove sigtramp version 1, we haven't used it in a long time.
 1.3 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.2 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.1 09-Jul-2002  thorpej New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.8 02-Feb-2024  andvar fix various typos in comments.
 1.7 26-Jun-2022  skrll Decorate the HPPA signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.6 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.5 06-Mar-2014  skrll Move to a flat space register convention. %sr[4-7] are all now the space
number allocated to the process. gcc produces (slightly) better code
with this convention.

Retain backwards compatiblity.

Welcome to 6.99.36
 1.4 03-Nov-2009  snj branches: 1.4.6; 1.4.12;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.3 22-Dec-2007  skrll Add a comment explaining stack layout and register contents.
 1.2 05-Jun-2005  chs branches: 1.2.10;
fix function name in end-marker.
 1.1 18-Jul-2004  chs add a siginfo signal trampoline and always use it.
 1.2.10.1 09-Jan-2008  matt sync with HEAD
 1.4.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.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.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.10 09-May-2020  skrll No need to .import __cerror as SYS.h does it
 1.9 05-May-2020  skrll Mark __cerror as hidden to avoid using the PLT. This is required for new
binutils where the PLT stubs now use %t1 (%r22) which is used to pass
the errno to __cerror.
 1.8 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.7 03-May-2020  skrll Trailing whitespace
 1.6 06-Mar-2014  skrll Move to a flat space register convention. %sr[4-7] are all now the space
number allocated to the process. gcc produces (slightly) better code
with this convention.

Retain backwards compatiblity.

Welcome to 6.99.36
 1.5 28-Apr-2008  martin branches: 1.5.4; 1.5.8; 1.5.28;
Remove clause 3 and 4 from TNF licenses
 1.4 01-Jul-2004  skrll branches: 1.4.24;
Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4.24.1 18-May-2008  yamt sync with head.
 1.5.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file __vfork14.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.5.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.9 10-May-2020  skrll Rename curbrk to __curbrk, and make it and __minbrk hidden
 1.8 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.7 03-May-2020  skrll Even more trailing whitespace
 1.6 12-Sep-2013  joerg 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.5 14-Mar-2012  skrll branches: 1.5.2;
Use the _end symbol rather than the end symbol. Prevents version info
problems in elflink.c for the heimdal libraries.
 1.4 03-Nov-2009  snj branches: 1.4.6; 1.4.8;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4.8.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by skrll in ticket #120):
lib/libc/arch/hppa/sys/brk.S: revision 1.5
lib/libc/arch/hppa/sys/sbrk.S: revision 1.5
Use the _end symbol rather than the end symbol. Prevents version info
problems in elflink.c for the heimdal libraries.
 1.4.6.2 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.4.6.1 17-Apr-2012  yamt sync with head
 1.5.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.5 12-Sep-2013  joerg 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.4 28-Apr-2008  martin branches: 1.4.4; 1.4.8; 1.4.28;
Remove clause 3 and 4 from TNF licenses
 1.3 18-Jul-2004  chs branches: 1.3.24;
save and restore %t1 around calling __errno, it's a caller-saved register.
 1.2 15-Jul-2004  skrll Add a copyright message.
 1.1 01-Jul-2004  skrll Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3.24.1 18-May-2008  yamt sync with head.
 1.4.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 cerror.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.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.3 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.2 03-Nov-2009  snj branches: 1.2.28; 1.2.32;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.2.32.1 21-Apr-2017  bouyer Sync with HEAD
 1.2.28.1 20-Mar-2017  pgoyette Sync with HEAD
 1.5 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.4 03-Nov-2009  snj Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.7 15-Oct-2020  skrll Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.6 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.5 19-Feb-2014  skrll Provide a genassym.cf in libc for hppa and use it.
 1.4 28-Apr-2008  martin branches: 1.4.4; 1.4.8; 1.4.28;
Remove clause 3 and 4 from TNF licenses
 1.3 18-Jul-2004  chs branches: 1.3.24;
replace these placeholders with real implementations.
translated from the mips version.
 1.2 01-Jul-2004  skrll Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.1 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.3.24.1 18-May-2008  yamt sync with head.
 1.4.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.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.2 11-Mar-2006  christos move to the new compat layout.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 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.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.8 06-Jun-2022  skrll Save and restore %r19 the "linkage table pointer register" across the call
to __cerror so if the ptrace syscall fails we can call __cerror again with
the correct %r19 value.

Do this even though the call of __cerror doesn't go via the PLT because
__cerror calls __errno which does.

Analysis and fix from Tom Lane in

port-hppa/56864: hppa: ptrace(2) dumps core when returning an error

I changed the location of where %r19 is stored on the stack to follow the
ABI.
 1.7 09-May-2020  skrll No need to .import __cerror as SYS.h does it
 1.6 28-Apr-2008  martin branches: 1.6.8; 1.6.66;
Remove clause 3 and 4 from TNF licenses
 1.5 02-Dec-2007  skrll branches: 1.5.6;
Implement ptrace.
 1.4 01-Jul-2004  skrll branches: 1.4.16;
Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4.16.1 09-Jan-2008  matt sync with HEAD
 1.5.6.1 18-May-2008  yamt sync with head.
 1.6.66.1 06-Jun-2022  martin Pull up following revision(s) (requested by skrll in ticket #1464):

lib/libc/arch/hppa/sys/ptrace.S: revision 1.8

Save and restore %r19 the "linkage table pointer register" across the call
to __cerror so if the ptrace syscall fails we can call __cerror again with
the correct %r19 value.

Do this even though the call of __cerror doesn't go via the PLT because
__cerror calls __errno which does.

Analysis and fix from Tom Lane in
PR port-hppa/56864: hppa: ptrace(2) dumps core when returning an error

I changed the location of where %r19 is stored on the stack to follow the
ABI.
 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 ptrace.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.8 10-May-2020  skrll Rename curbrk to __curbrk, and make it and __minbrk hidden
 1.7 05-May-2020  skrll Add a space before any non-nullified instruction. NFCI.
 1.6 12-Sep-2013  joerg 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.5 14-Mar-2012  skrll branches: 1.5.2;
Use the _end symbol rather than the end symbol. Prevents version info
problems in elflink.c for the heimdal libraries.
 1.4 03-Nov-2009  snj branches: 1.4.6; 1.4.8;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.4.8.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by skrll in ticket #120):
lib/libc/arch/hppa/sys/brk.S: revision 1.5
lib/libc/arch/hppa/sys/sbrk.S: revision 1.5
Use the _end symbol rather than the end symbol. Prevents version info
problems in elflink.c for the heimdal libraries.
 1.4.6.2 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.4.6.1 17-Apr-2012  yamt sync with head
 1.5.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 18-Jan-2003  thorpej These files are obsolete; setlogin() is now implemented in C with a
small syscall stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.3 18-Jul-2004  chs replace these placeholders with real implementations.
translated from the mips version.
 1.2 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.2 11-Mar-2006  christos move to the new compat layout.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.2 11-Mar-2006  christos move to the new compat layout.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5 11-Mar-2006  christos move to the new compat layout.
 1.4 01-Jul-2004  skrll Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5 11-Mar-2006  christos move to the new compat layout.
 1.4 01-Jul-2004  skrll Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5 11-Mar-2006  christos move to the new compat layout.
 1.4 01-Jul-2004  skrll Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.5 11-Mar-2006  christos move to the new compat layout.
 1.4 01-Jul-2004  skrll Add a cerror.S and re-work various syscalls and SYS.h to use __cerror.

With help from the OpenBSD version of SYS.h.
 1.3 06-Oct-2003  matt Update to new assmbler needs. Add getcontext.S stub.
 1.2 01-Jul-2002  fredette Changes to allow libc to compile as PIC on the hppa.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.3 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.2 03-Nov-2009  snj branches: 1.2.46;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.1 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.2.46.1 21-Apr-2020  martin Sync with HEAD
 1.2 24-Apr-1997  thorpej Garbage-collect unneeded file.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.23 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.22 12-Oct-2020  kamil Decorate the i386 signal trampoline with CFI attributes easing unwinding

Now, the unwinders (in backtrace(3) and similar) can unwind properly
the stack from a signal handler.
 1.21 15-Jul-2015  pooka 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.20 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.19 13-Sep-2005  christos compat core reorg.
 1.18 06-Sep-2003  christos Add __sigtramp2.S
 1.17 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.16 13-Dec-2000  matt branches: 1.16.2;
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.15 13-Dec-2000  enami KMSRCS is different from SRCS. Put __syscall.S in latter.
 1.14 12-Dec-2000  simonb Move __syscall.S to the arch specific Makefile.inc's where it is
implemented.
 1.13 10-Sep-1999  drochner SYS.h was nuked from libkern
 1.12 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.11 04-Aug-1998  perry add memcmp.S to libkern.
 1.10 04-Aug-1998  perry add memmove.S to libkern.
 1.9 22-Feb-1998  mycroft And rindex.S...
 1.8 22-Feb-1998  mycroft And index.S...
 1.7 22-Feb-1998  mycroft Copy strchr.S and strrchr.S as well.
 1.6 22-Feb-1998  mycroft Copy more files to libkern.
 1.5 09-Oct-1997  lukem rcsid police
 1.4 25-Apr-1997  thorpej DEFS.h is gone from here, don't copy it up to libkern. (It will be gone
from libkern soon, as well)
 1.3 04-Dec-1993  cgd update for .S and MACHINE_ARCH
 1.2 05-Nov-1993  cgd copy SYS.h and DEFS.h, too.
 1.1 15-Oct-1993  jtc Makefile.inc, basically a place to put KMSRC definition
 1.16.2.1 01-Aug-2002  nathanw Catch up to -current.
 1.25 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.24 12-Sep-2013  joerg branches: 1.24.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.23 28-Apr-2008  martin branches: 1.23.4; 1.23.8; 1.23.28;
Remove clause 3 and 4 from TNF licenses
 1.22 23-Nov-2007  dsl branches: 1.22.6;
Reorder the code for i386 and amd64 syscall stubs so that the 'jc' on error
is a forwards jump instead of a backwards jump that a P4 will mispredect (and
probably immediatly get a cache-line miss due to the way the code gets
aligned).
 1.21 09-Mar-2007  ad branches: 1.21.4;
If I686_LIBC is defined, make syscalls using the 'sysenter' instruction.
 1.20 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.19 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.18 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.17 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.16 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.15 19-Feb-2000  mycroft branches: 1.15.6;
A better fix for the stub-in-other-module problem:
Load the address of cerror through the GOT, so we can do a PIC_EPILOGUE and
leave the stack clean.
 1.14 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.13 07-Feb-1999  christos branches: 1.13.2;
Add PIC_PROLOGUE before the PLT call to cerror. ELF dynamic linking needs
this.
 1.12 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.11 02-May-1997  kleink Consistency: distinguish between PSEUDO() and PSEUDO_NOERROR().
 1.10 17-Oct-1996  jtc Added new macros:
SYSTRAP(x): Expands to the code used to call syscall x.
This is used to simplify other macros.

SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.

RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.
 1.9 28-Dec-1995  jtc Removed unused CALL macro
 1.8 28-Dec-1995  jtc Added macros definitions for use with ANSI preprocessors.
 1.7 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.6 31-Mar-1994  mycroft Add a .text and .align to SYSCALL().
 1.5 27-Jan-1994  mycroft One last tweak.
 1.4 27-Jan-1994  mycroft Stylistic changes.
 1.3 07-Jan-1994  pk PIC_*() macros moved to <machine/asm.h>
 1.2 06-Dec-1993  pk Use PIC_PLT() macro for error returns
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.13.2.1 22-Feb-2000  he Pull up revisions 1.14-1.15 (requested by mycroft):
Implement a better fix for the ``stubs in other shlibs'' problem.
With this fix the stack is left clean during the transition from
the stub to cerror().
 1.15.6.3 21-Jun-2002  nathanw Catch up to -current.
 1.15.6.2 22-Mar-2002  nathanw Catch up to -current.
 1.15.6.1 28-Jan-2002  nathanw Catch up to -current.
 1.21.4.1 09-Jan-2008  matt sync with HEAD
 1.22.6.1 18-May-2008  yamt sync with head.
 1.23.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.23.8.1 28-Apr-2008  martin file SYS.h was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.23.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.24.2.1 10-Aug-2014  tls Rebase.
 1.2 12-Oct-2020  kamil Fix typo
 1.1 12-Oct-2020  kamil Decorate the i386 signal trampoline with CFI attributes easing unwinding

Now, the unwinders (in backtrace(3) and similar) can unwind properly
the stack from a signal handler.
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.2 05-Jun-2011  christos Revert previous and make frach be 0xc0000000 for NAN's generated by strtold()
as suggested by tron.
 1.1 25-Jan-2006  kleink branches: 1.1.42;
Add machine-dependent definitions for gdtoa.
 1.1.42.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 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
 1.5 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.4 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.3 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.2 05-Nov-1997  cgd lint stubs for assembly routines.
 1.1 25-Feb-1995  cgd branches: 1.1.10;
need these now, with new net Makefile.inc
 1.1.10.1 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for assembly routines.
 1.6 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.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 16-Mar-1994  jtc [hn]to[nh][sl] functions used xchgb %h1,%b1 instead of the faster (on the
i486 & i586) rorw $8, %w1.
 1.3 12-Mar-1994  jtc Use RCSID macro.
 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 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.6 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.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 16-Mar-1994  jtc [hn]to[nh][sl] functions used xchgb %h1,%b1 instead of the faster (on the
i486 & i586) rorw $8, %w1.
 1.3 12-Mar-1994  jtc Use RCSID macro.
 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 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.6 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.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 16-Mar-1994  jtc [hn]to[nh][sl] functions used xchgb %h1,%b1 instead of the faster (on the
i486 & i586) rorw $8, %w1.
 1.3 12-Mar-1994  jtc Use RCSID macro.
 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 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.6 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.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 16-Mar-1994  jtc [hn]to[nh][sl] functions used xchgb %h1,%b1 instead of the faster (on the
i486 & i586) rorw $8, %w1.
 1.3 12-Mar-1994  jtc Use RCSID macro.
 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 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.9 11-Aug-2009  dsl Change NO_SRCS lines to specify .S in order to exclude the .c file from
SRCS but add it to LSRCS (sort of makes sense!).
 1.8 31-Jul-2009  dsl Don't remove imaxdiv.c
 1.7 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.6 04-Aug-2008  matt branches: 1.6.6;
Add C99 functions imaxabs and imaxdiv.
 1.5 22-Mar-2006  drochner branches: 1.5.20;
build erand48_ieee754.c on everything but vax
 1.4 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.3 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.2 05-Nov-1997  cgd branches: 1.2.2;
lint stubs for assembly routines.
 1.1 05-Nov-1997  cgd A foolish consistency... gen, net, and string all get MD sources
specified by including a Makefile.inc from the appropriate MD directory.
stdlib doesn't do that, but there's no reason that it shouldn't (and
it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.2.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>A foolish consistency... gen, net, and string all get MD sources
>specified by including a Makefile.inc from the appropriate MD directory.
>stdlib doesn't do that, but there's no reason that it shouldn't (and
>it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.2.2.1 05-Nov-1997  veego file Makefile.inc was added on branch netbsd-1-3 on 1997-11-08 21:56:37 +0000
 1.5.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.6.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.6.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.8 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.7 07-Aug-2003  agc branches: 1.7.62; 1.7.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 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.5 16-Mar-1994  jtc Smaller & Faster.
 1.4 12-Mar-1994  jtc Use RCSID macro.
 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 08-Oct-1993  jtc Provide an assembly language version of labs().
Since ints and longs are both 32 bits on a i386, we could alias abs()
and labs() together as mycroft did with memmove()/memcpy(), but I'm
waiting on an interpretation ruling to see if it is legal.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7.74.1 10-Aug-2014  tls Rebase.
 1.7.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 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 08-Oct-1993  jtc Provide an assembly language version of labs().
Since ints and longs are both 32 bits on a i386, we could alias abs()
and labs() together as mycroft did with memmove()/memcpy(), but I'm
waiting on an interpretation ruling to see if it is legal.
 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 12-Jun-2011  plunky branches: 1.9.8; 1.9.18;
Functions that return a struct or union, must set %eax to the value
of the original address of the callers area before it returns.

(System V ABI, i386 supplement, fourth edition, page 3-14)
 1.8 26-Jul-2003  salo branches: 1.8.54;
netbsd.org->NetBSD.org
 1.7 08-Jan-2001  lukem rcsid & whitespace police
 1.6 08-Jan-2001  fvdl Make these actually work (fixes PR 11914).
 1.5 28-Apr-1995  jtc branches: 1.5.20;
Winning Strategies has placed this code into the Public Domain
 1.4 12-Mar-1994  jtc Use RCSID macro.
 1.3 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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 08-Oct-1993  jtc Provide i386 versions of div and ldiv -- they are simpler than the C versions,
since the idiv instruction does the right thing wrt truncating towards zero.
 1.5.20.1 26-Jan-2001  jhawk Pull up revision 1.6 (requested by fvdl):
Implement workinf versions of div() and ldev(). Previously they returned
garbage, but were generally unused.
 1.8.54.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 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 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 08-Oct-1993  jtc Provide i386 versions of div and ldiv -- they are simpler than the C versions,
since the idiv instruction does the right thing wrt truncating towards zero.
 1.8 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.7 07-Aug-2003  agc branches: 1.7.62; 1.7.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 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.5 16-Mar-1994  jtc Smaller & Faster.
 1.4 12-Mar-1994  jtc Use RCSID macro.
 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 08-Oct-1993  jtc Provide an assembly language version of labs().
Since ints and longs are both 32 bits on a i386, we could alias abs()
and labs() together as mycroft did with memmove()/memcpy(), but I'm
waiting on an interpretation ruling to see if it is legal.
 1.7.74.1 10-Aug-2014  tls Rebase.
 1.7.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 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 08-Oct-1993  jtc Provide an assembly language version of labs().
Since ints and longs are both 32 bits on a i386, we could alias abs()
and labs() together as mycroft did with memmove()/memcpy(), but I'm
waiting on an interpretation ruling to see if it is legal.
 1.10 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.9 12-Jun-2011  plunky branches: 1.9.8; 1.9.18;
Functions that return a struct or union, must set %eax to the value
of the original address of the callers area before it returns.

(System V ABI, i386 supplement, fourth edition, page 3-14)
 1.8 26-Jul-2003  salo branches: 1.8.54;
netbsd.org->NetBSD.org
 1.7 08-Jan-2001  lukem rcsid & whitespace police
 1.6 08-Jan-2001  fvdl Make these actually work (fixes PR 11914).
 1.5 28-Apr-1995  jtc branches: 1.5.20;
Winning Strategies has placed this code into the Public Domain
 1.4 12-Mar-1994  jtc Use RCSID macro.
 1.3 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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 08-Oct-1993  jtc Provide i386 versions of div and ldiv -- they are simpler than the C versions,
since the idiv instruction does the right thing wrt truncating towards zero.
 1.5.20.1 26-Jan-2001  jhawk Pull up revision 1.6 (requested by fvdl):
Implement workinf versions of div() and ldev(). Previously they returned
garbage, but were generally unused.
 1.8.54.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 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 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 08-Oct-1993  jtc Provide i386 versions of div and ldiv -- they are simpler than the C versions,
since the idiv instruction does the right thing wrt truncating towards zero.
 1.6 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.5 04-Aug-2008  matt branches: 1.5.6; 1.5.26; 1.5.38;
Add C99 functions imaxabs and imaxdiv.
 1.4 07-Aug-2003  agc branches: 1.4.32;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 29-May-2001  kleink Fix renaming botch in previous.
 1.2 29-May-2001  kleink Add missing internal names and weak aliases to assembly versions.
 1.1 06-Mar-2000  kleink branches: 1.1.6;
Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.4.32.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.38.1 10-Aug-2014  tls Rebase.
 1.5.26.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.5.6.1 04-Aug-2008  matt file llabs.S was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.6 27-Jan-2020  ad Make x86 use the C versions of bcmp() and memcmp().
 1.5 30-Jul-2009  dsl branches: 1.5.46;
If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.4 17-Jul-2009  dsl Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
libc and kernel build ok for affected archs (i386, amd64, vax, sun3,
evbmips-eb) all seem ok.
(vax might lose an asm index() - but comments imply it is worse than the C)
 1.3 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.2 05-Nov-1997  cgd lint stubs for assembly routines.
 1.1 20-Mar-1995  mycroft branches: 1.1.10;
Separate machine dependencies.
 1.1.10.1 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for assembly routines.
 1.5.46.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.10 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.9 12-Nov-2007  ad branches: 1.9.36; 1.9.48;
Don't unconditionally clear the direction flag. The ABI says it must always
be clear when making a function call, and 'cld' takes about 50 clock cyles
on the P4.
 1.8 26-Jul-2003  salo branches: 1.8.22;
netbsd.org->NetBSD.org
 1.7 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.6 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.5 22-Mar-1994  jtc mem -> reg & reg->reg moves take the same time; so save a cycle by reading
the block length from the stack instead of caching it in a register.
 1.4 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.3 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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.8.22.1 09-Jan-2008  matt sync with HEAD
 1.9.48.1 10-Aug-2014  tls Rebase.
 1.9.36.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.15 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.14 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.13 03-Feb-2005  dsl Pull optimised code from memcpy.S
Maybe bcopy can be killed one day...
 1.12 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.11 29-Oct-2002  junyoung Save a jmp for memcpy(3).
 1.10 29-Oct-2002  junyoung memcpy(3) no longer deals with overlap case; it's now forward-only.
 1.9 29-Oct-2002  junyoung Get rid of pointer wraparound check. Ok'ed by TAMURA Kent.
 1.8 10-Jul-2002  kent Avoid redundant memory access.
Fix diagnostic code for bcopy().
 1.7 04-Jul-2002  kent memcpy/memmove/bcopy: Add diagnostic code to check pointer wraparound.
The code is enabled only when _DIAGNOSTIC is defined.
 1.6 12-Nov-1996  jtc branches: 1.6.14;
Changed the test that determines whether or not source and destination
memory regions are "potentially overlapping" to a test that determines
that the regions are actually overlapping. Because the code for the
overlapping case is seven instructions longer, this signifcantly
improves performance in the average case.
 1.5 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.4 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.3 10-Dec-1993  mycroft Share code.
 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.14.2 11-Nov-2002  nathanw Catch up to -current
 1.6.14.1 01-Aug-2002  nathanw Catch up to -current.
 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.12 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.11 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.10 03-Feb-2005  dsl A faster implementation.
'rep stos' is slow to setup on modern processors, so don't use it to
align the transfer.
Also not that 8 byte alignment is faster on Intel processors
 1.9 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.8 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.7 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.6 05-Feb-1995  mycroft Optimize better.
 1.5 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.4 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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.4 04-Dec-1993  mycroft Clean up deleted files.
 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 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.9 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.8 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.7 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.6 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.5 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.4 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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.4 04-Dec-1993  mycroft Clean up deleted files.
 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.14 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.13 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.12 04-Feb-2005  drochner switch to J.T.Conklin's optimized str* functions
(submitted per PR i386/25263)
 1.11 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.10 07-Aug-2000  ad %edx is free; use it instead of %ebx.
 1.9 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.8 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.7 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.6 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.5 14-Feb-1994  mycroft Style police. Use `je' and `jne' only on the result of an equality test;
use `jz' and `jnz' in all other cases.
 1.4 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.3 08-Dec-1993  jtc No reason these can't share code...
 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 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.16 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.15 02-Aug-2005  rpaulo Fix typos found by Giorgos Keramid and Steve Kargl on freebsd-arch mailing
list. They were found on libc x86_64 MD code, but I noticed that they are
present on i386 too.
 1.14 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.13 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.12 06-Feb-2005  christos PR/29248: Geoff C. Wing: memchr broken after latest commit.
Apply fix submitted by jtc: The problem was that his regression tests
never checked for characters with the high bit set. Change movl to movzbl
where it was not done yet. In addition strrchr.S missed a jump to Lzero.
 1.11 04-Feb-2005  drochner switch to J.T.Conklin's optimized str* functions
(submitted per PR i386/25263)
 1.10 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.9 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.8 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.7 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.6 24-Nov-1994  mycroft If len == 0, then the result must be 0 regardless of the other arguments.
 1.5 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.4 14-Feb-1994  mycroft Style police. Use `je' and `jne' only on the result of an equality test;
use `jz' and `jnz' in all other cases.
 1.3 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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 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.12 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.11 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.10 23-Mar-2002  ross Fix minor syntax warnings.
 1.9 19-May-1997  jtc branches: 1.9.14;
Use xorl/movb instead of movzbl when loading registers before computing
the return value.
 1.8 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.7 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.6 22-Mar-1994  jtc mem -> reg & reg->reg moves take the same time; so save a cycle by reading
the block length from the stack instead of caching it in a register.
 1.5 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.4 07-Feb-1994  jtc Use movzbl, not movsbl, to zero extend for unsigned comparison.
Fix from Bruce Evans.
 1.3 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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.9.14.1 25-Apr-2002  nathanw Catch up to -current.
 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.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.5 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.4 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.3 03-Feb-2005  dsl Bring code in from obsolesent bcopy.S
Optimise to avoid mis-predicted braches and 'rep movsb' for small %cx.
 1.2 09-Jan-1998  perry RCS Id Police.
 1.1 10-Dec-1993  mycroft Share code.
 1.8 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.7 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.6 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.5 03-Feb-2005  dsl Bring code in from obsolesent bcopy.S
Optimise to avoid mis-predicted braches and 'rep movsb' for small %cx.
 1.4 09-Jan-1998  perry RCS Id Police.
 1.3 10-Dec-1993  mycroft Share code.
 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.13 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.12 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.11 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.10 03-Feb-2005  dsl A faster implementation.
'rep stos' is slow to setup on modern processors, so don't use it to
align the transfer.
Also not that 8 byte alignment is faster on Intel processors
 1.9 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.8 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.7 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.6 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.5 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.4 10-Dec-1993  mycroft Shorten setup for longword operations a little.
 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.4 01-Mar-1995  mycroft Clean up deleted files.
 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.14 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.13 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.12 04-Feb-2005  drochner switch to J.T.Conklin's optimized str* functions
(submitted per PR i386/25263)
 1.11 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.10 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.9 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.8 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.7 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.6 14-Feb-1994  mycroft Style police. Use `je' and `jne' only on the result of an equality test;
use `jz' and `jnz' in all other cases.
 1.5 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.4 08-Dec-1993  jtc No reason these can't share code...
 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.4 01-Mar-1995  mycroft Clean up deleted files.
 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.14 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.13 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.12 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.11 04-Feb-2005  drochner switch to J.T.Conklin's optimized str* functions
(submitted per PR i386/25263)
 1.10 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.9 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.8 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.7 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.6 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.5 14-Feb-1994  mycroft Style police. Use `je' and `jne' only on the result of an equality test;
use `jz' and `jnz' in all other cases.
 1.4 14-Feb-1994  jtc Fix spelling mistake: cashe -> cache.
 1.3 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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.9 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.8 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.7 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.6 06-Feb-2005  christos PR/29248: Geoff C. Wing: memchr broken after latest commit.
Apply fix submitted by jtc: The problem was that his regression tests
never checked for characters with the high bit set. Change movl to movzbl
where it was not done yet. In addition strrchr.S missed a jump to Lzero.
 1.5 04-Feb-2005  drochner switch to J.T.Conklin's optimized str* functions
(submitted per PR i386/25263)
 1.4 09-Jan-1998  perry RCS Id Police.
 1.3 08-Dec-1993  jtc No reason these can't share code...
 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.18 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.17 02-Aug-2005  rpaulo Fix typos found by Giorgos Keramid and Steve Kargl on freebsd-arch mailing
list. They were found on libc x86_64 MD code, but I noticed that they are
present on i386 too.
 1.16 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.15 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.14 04-Feb-2005  drochner switch to J.T.Conklin's optimized str* functions
(submitted per PR i386/25263)
 1.13 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.12 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.11 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.10 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.9 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.8 14-Feb-1994  mycroft Style police. Use `je' and `jne' only on the result of an equality test;
use `jz' and `jnz' in all other cases.
 1.7 14-Feb-1994  jtc Fix spelling mistake: cashe -> cache.
 1.6 07-Feb-1994  jtc Use movzbl, not movsbl, to zero extend for unsigned comparison.
Fix from Bruce Evans.
 1.5 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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 08-Oct-1993  jtc Use "testb %cl,%cl" instead of "cmpb $0,%cl".
This saves three cycles per character, and reduces the size of the
function by eight bytes (the loop is unrolled eight times).
Thanks to davidg for pointing this out.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 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 08-Oct-1993  jtc Use "testb %cl,%cl" instead of "cmpb $0,%cl".
This saves three cycles per character, and reduces the size of the
function by eight bytes (the loop is unrolled eight times).
Thanks to davidg for pointing this out.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.12 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.11 15-Mar-2005  christos New strcpy.S from jtc. This should have been committed together with the
rest of the string changes before.
 1.10 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.9 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.8 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.7 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.6 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.5 14-Feb-1994  mycroft Style police. Use `je' and `jne' only on the result of an equality test;
use `jz' and `jnz' in all other cases.
 1.4 14-Feb-1994  jtc Fix spelling mistake: cashe -> cache.
 1.3 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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.12 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.11 02-Aug-2005  rpaulo Fix typos found by Giorgos Keramid and Steve Kargl on freebsd-arch mailing
list. They were found on libc x86_64 MD code, but I noticed that they are
present on i386 too.
 1.10 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.9 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.8 04-Feb-2005  drochner switch to J.T.Conklin's optimized str* functions
(submitted per PR i386/25263)
 1.7 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.6 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.5 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.4 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.3 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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.15 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.14 03-Aug-2005  rpaulo branches: 1.14.50; 1.14.62;
Fix another typo in comments found by Ricardo Nabinger Sanchez
on the freebsd-arch mailing list.
 1.13 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.12 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.11 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.10 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.9 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.8 14-Feb-1994  mycroft Style police. Use `je' and `jne' only on the result of an equality test;
use `jz' and `jnz' in all other cases.
 1.7 14-Feb-1994  jtc Performance improvement from Bruce Evans.
Removes one test instruction for each character.
 1.6 07-Feb-1994  jtc Use movzbl, not movsbl, to zero extend for unsigned comparison.
Fix from Bruce Evans.
 1.5 28-Jan-1994  jtc Fix spelling error in Copyright notice
 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 08-Oct-1993  jtc Use "testb %cl,%cl" instead of "cmpb $0,%cl".
This saves three cycles per character, and reduces the size of the
function by eight bytes (the loop is unrolled eight times).
Thanks to davidg for pointing this out.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.14.62.1 10-Aug-2014  tls Rebase.
 1.14.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 08-Oct-1993  jtc Use "testb %cl,%cl" instead of "cmpb $0,%cl".
This saves three cycles per character, and reduces the size of the
function by eight bytes (the loop is unrolled eight times).
Thanks to davidg for pointing this out.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.10 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.9 09-Feb-2005  christos Bring back the head versions. Apparently the problem is a pkgsrc issue
unrelated to strings.
 1.8 07-Feb-2005  christos Revert everything to 2005-02-03 until the code is properly tested. Building
kde3 breaks with the head code.
 1.7 06-Feb-2005  christos PR/29248: Geoff C. Wing: memchr broken after latest commit.
Apply fix submitted by jtc: The problem was that his regression tests
never checked for characters with the high bit set. Change movl to movzbl
where it was not done yet. In addition strrchr.S missed a jump to Lzero.
 1.6 04-Feb-2005  drochner switch to J.T.Conklin's optimized str* functions
(submitted per PR i386/25263)
 1.5 09-Jan-1998  perry RCS Id Police.
 1.4 08-Dec-1993  jtc No reason these can't share code...
 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.4 01-Mar-1995  mycroft Clean up deleted files.
 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.14 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.13 12-Nov-2007  ad branches: 1.13.36; 1.13.48;
Don't unconditionally clear the direction flag. The ABI says it must always
be clear when making a function call, and 'cld' takes about 50 clock cyles
on the P4.
 1.12 02-Aug-2005  rpaulo branches: 1.12.10;
Fix typos found by Giorgos Keramid and Steve Kargl on freebsd-arch mailing
list. They were found on libc x86_64 MD code, but I noticed that they are
present on i386 too.
 1.11 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.10 23-Aug-1999  kleink Use _ALIGN_TEXT from <machine/asm.h>.
 1.9 28-Apr-1995  jtc $Id: $ -> $NetBSD: $
 1.8 28-Apr-1995  jtc Winning Strategies has placed this code into the Public Domain
 1.7 12-Mar-1994  jtc Use RCSID macro for RCS ID's.
 1.6 14-Feb-1994  jtc Use "ror $8,%ax" instead of "xchg %al,%ah": equal on a i386, 1 cycle faster
on a i486, and 2 cycles faster on a iPentium.
 1.5 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.4 25-Nov-1993  jtc Remove special case for len == 0 --- It wasn't needed. By dropping the
conditional, the general case (where we are actually swapping bytes) is
a tiny bit faster.
 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 09-Jan-2008  matt sync with HEAD
 1.13.48.1 10-Aug-2014  tls Rebase.
 1.13.36.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5 01-Mar-1995  mycroft Clean up deleted files.
 1.4 25-Nov-1993  jtc Remove special case for len == 0 --- It wasn't needed. By dropping the
conditional, the general case (where we are actually swapping bytes) is
a tiny bit faster.
 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.17 13-Sep-2005  christos compat core reorg.
 1.16 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.15 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.14 08-Dec-2000  mycroft branches: 1.14.2;
Use the SYSTRAP() macro more uniformly.
 1.13 03-Apr-2000  mycroft Clean up.
* _REENTRANT is always defined.
* The vfork() stubs can use cerror.
 1.12 02-Dec-1998  thorpej Warn about references to the compatibility vfork() (i.e. the vfork() with
the 4.4BSD non-shared-address-space semantics), and direct the user to
include <unistd.h> to generate the correct reference.

This warning isn't about an ABI compatibility issue, but the new vfork() is
considerably faster.
 1.11 01-Oct-1998  kleink Add *__errno() redirection for _REENTRANT code.
 1.10 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 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 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.7 27-Jan-1994  mycroft Trivial speedup inspired by SPARC code.
 1.6 27-Jan-1994  mycroft Random cleanup.
 1.5 27-Jan-1994  mycroft Stylistic changes.
 1.4 24-Jan-1994  jtc Optimization tweaks:
Use testl %reg,%reg instead of cmpl $0,%reg
Use xorl %reg,%reg instead of movl $0,%reg
 1.3 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.2 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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.14.2.1 22-Mar-2002  nathanw Catch up to -current.
 1.4 04-Dec-1993  mycroft Clean up deleted files.
 1.3 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.2 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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7 03-May-2025  riastradh libc/i386: Omit needless __PIC__ conditionals.

No binary change.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.6 23-May-2014  uebayasi branches: 1.6.36;
Put missing END() markers to set ELF symbol size.
 1.5 12-Sep-2013  joerg branches: 1.5.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.4 18-Nov-2011  joerg branches: 1.4.6;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.3 18-Jul-2001  fvdl branches: 1.3.2; 1.3.60;
Fix call to _exit.
 1.2 17-Jul-2001  thorpej Simplify slightly.
 1.1 17-Jul-2001  fvdl __clone stub for i386
 1.3.60.2 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.3.60.1 17-Apr-2012  yamt sync with head
 1.3.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.3.2.1 18-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:17:37 +0000
 1.4.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 10-Aug-2014  tls Rebase.
 1.6.36.1 02-Aug-2025  perseant Sync with HEAD
 1.2 13-Sep-2005  christos compat core reorg.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.13 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.12 28-Apr-2008  martin branches: 1.12.8;
Remove clause 3 and 4 from TNF licenses
 1.11 19-Feb-2006  christos branches: 1.11.18;
make these consistent.
 1.10 13-Sep-2005  christos compat core reorg.
 1.9 12-Jun-2005  lukem Add missing __RCSID()
 1.8 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.7 12-Oct-2003  christos use matt's powerpc implementation. It is simpler than mine, and it does
matter as far as performance goes.
 1.6 12-Sep-2003  christos - don't define __LIBC12_SOURCE__
- need to SIG_IGN SIGSYS for the version check
- simplify code
 1.5 11-Sep-2003  christos No reason for __ in static variable.
 1.4 11-Sep-2003  christos For kernels that have COMPAT_16 enabled, detect that and use the old
sigcontext trampoline code when SA_SIGINFO is not set.
 1.3 06-Sep-2003  christos siginfo signal trampoline code.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:27:56 +0000
 1.11.18.1 18-May-2008  yamt sync with head.
 1.12.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.12.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.8 13-Sep-2005  christos compat core reorg.
 1.7 26-Mar-2004  drochner no need to define __HAVE_SIGINFO anymore
 1.6 12-Sep-2003  christos need __HAVE_SIGINFO to get the right flavor of the sigreturn symbol.
 1.5 12-Sep-2003  christos __sigreturn14 -> compat_16___sigreturn14; thanks yamt
 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 28-Sep-1999  kleink Oops, missed these in the mcount -> __mcount renaming.
 1.2 23-Aug-1999  kleink branches: 1.2.2;
Use _ALIGN_TEXT from <machine/asm.h>.
 1.1 26-Sep-1998  christos Fix signal mess. Change old syscalls to use the right signal numbers
and add a versioned copy of sigreturn (from Jason)
 1.2.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5 13-Sep-2005  christos compat core reorg.
 1.4 26-Mar-2004  drochner no need to define __HAVE_SIGINFO anymore
 1.3 12-Sep-2003  christos need __HAVE_SIGINFO to get the right flavor of the sigreturn symbol.
 1.2 12-Sep-2003  christos __sigreturn14 -> compat_16___sigreturn14; thanks yamt
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:27:57 +0000
 1.7 19-Oct-2020  kamil Restore ESP from mcontext

Improves unwinding of multiple frames without base pointer.
 1.6 12-Oct-2020  kamil Decorate the i386 signal trampoline with CFI attributes easing unwinding

Now, the unwinders (in backtrace(3) and similar) can unwind properly
the stack from a signal handler.
 1.5 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.4 28-Apr-2008  martin branches: 1.4.8; 1.4.28; 1.4.40;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Nov-2006  drochner branches: 1.3.16;
if setcontext(2) returns, _exit(2) with a return code of -1 instead
of relying on a sensible return value
 1.2 02-Aug-2006  jld Fix PR 34112, where a program could mysteriously exit on return from a
signal handler, by deriving the context pointer from the stack pointer
instead of trying to read it from where the sigaction function may have
overwritten it with arbitrary bits.

Fix provided by Matthias Drochner in the PR.
 1.1 06-Sep-2003  christos branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.10;
siginfo signal trampoline code.
 1.1.10.1 03-Aug-2006  tron Pull up following revision(s) (requested by jld in ticket #1447):
lib/libc/arch/i386/sys/__sigtramp2.S: revision 1.2
Fix PR 34112, where a program could mysteriously exit on return from a
signal handler, by deriving the context pointer from the stack pointer
instead of trying to read it from where the sigaction function may have
overwritten it with arbitrary bits.
Fix provided by Matthias Drochner in the PR.
 1.1.8.1 11-Aug-2006  riz Pull up following revision(s) (requested by jld in ticket #10667):
lib/libc/arch/i386/sys/__sigtramp2.S: revision 1.2
Fix PR 34112, where a program could mysteriously exit on return from a
signal handler, by deriving the context pointer from the stack pointer
instead of trying to read it from where the sigaction function may have
overwritten it with arbitrary bits.
Fix provided by Matthias Drochner in the PR.
 1.1.6.1 03-Aug-2006  tron Pull up following revision(s) (requested by jld in ticket #1447):
lib/libc/arch/i386/sys/__sigtramp2.S: revision 1.2
Fix PR 34112, where a program could mysteriously exit on return from a
signal handler, by deriving the context pointer from the stack pointer
instead of trying to read it from where the sigaction function may have
overwritten it with arbitrary bits.
Fix provided by Matthias Drochner in the PR.
 1.1.4.1 11-Aug-2006  riz Pull up following revision(s) (requested by jld in ticket #10667):
lib/libc/arch/i386/sys/__sigtramp2.S: revision 1.2
Fix PR 34112, where a program could mysteriously exit on return from a
signal handler, by deriving the context pointer from the stack pointer
instead of trying to read it from where the sigaction function may have
overwritten it with arbitrary bits.
Fix provided by Matthias Drochner in the PR.
 1.1.2.1 11-Aug-2006  riz Pull up following revision(s) (requested by jld in ticket #10667):
lib/libc/arch/i386/sys/__sigtramp2.S: revision 1.2
Fix PR 34112, where a program could mysteriously exit on return from a
signal handler, by deriving the context pointer from the stack pointer
instead of trying to read it from where the sigaction function may have
overwritten it with arbitrary bits.
Fix provided by Matthias Drochner in the PR.
 1.3.16.1 18-May-2008  yamt sync with head.
 1.4.40.1 10-Aug-2014  tls Rebase.
 1.4.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 __sigtramp2.S 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 18-Nov-2011  joerg branches: 1.4.6; 1.4.16;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.3 07-Aug-2003  agc branches: 1.3.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.1 10-Dec-2000  mycroft branches: 1.1.2;
Handle __syscall() in user-level code for i386.
 1.1.2.1 22-Mar-2002  nathanw Catch up to -current.
 1.3.56.1 17-Apr-2012  yamt sync with head
 1.4.16.1 10-Aug-2014  tls Rebase.
 1.4.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.9 18-Nov-2011  joerg branches: 1.9.6; 1.9.16;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.8 09-Mar-2007  ad branches: 1.8.36;
If I686_LIBC is defined, make syscalls using the 'sysenter' instruction.
 1.7 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.6 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.5 08-Dec-2000  mycroft branches: 1.5.2;
Use the SYSTRAP() macro more uniformly.
 1.4 03-Apr-2000  mycroft Clean up.
* _REENTRANT is always defined.
* The vfork() stubs can use cerror.
 1.3 01-Oct-1998  kleink Add *__errno() redirection for _REENTRANT code.
 1.2 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 1.1 04-Jan-1998  thorpej Add syscall stubs for __vfork14(). These are basically copies of Ovfork.S
with the syscall numbers changed.

Since 4.4BSD vfork(2) did not share address space, Ovfork.S could be changed
to be identical to fork.S (modulo syscall numbers). __vfork14.S, however,
needs to remain separate since with a shared address space, the stub needs to
pre-decrement the stack and do an indirect jump to the return address, so that
the shared stackframe is still there when the parent returns. (Obviously,
this does not apply to systems which to not build stackframes on leaf calls.)
 1.5.2.1 22-Mar-2002  nathanw Catch up to -current.
 1.8.36.1 17-Apr-2012  yamt sync with head
 1.9.16.1 10-Aug-2014  tls Rebase.
 1.9.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.23 12-Sep-2013  joerg branches: 1.23.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.22 18-Nov-2011  joerg branches: 1.22.6;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.21 09-Mar-2007  ad branches: 1.21.36;
If I686_LIBC is defined, make syscalls using the 'sysenter' instruction.
 1.20 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.19 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.18 06-May-2001  ross I have no idea why this syscall wrapper does some very un-unix-like
argument prefrobbing, in particular, it computes max(addr, __minbrk)
and uses that. The code is like this even in the ancient libc/i386 tree,
back to the earliest rev 1.2. I did not see it Lite 1, but I'm not totally
sure what the random site I found was serving up.
*
* However, I do know that it should use jb and not jl.
*
 1.17 08-Dec-2000  mycroft branches: 1.17.2;
Use the SYSTRAP() macro more uniformly.
 1.16 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.15 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.14 03-Apr-2000  mycroft branches: 1.14.4;
Clean up.
* _REENTRANT is always defined.
* The vfork() stubs can use cerror.
 1.13 03-Apr-2000  mycroft Repair syscall stubs that were not updated when the cerror interface was
modified.
 1.12 08-Feb-1999  christos branches: 1.12.2;
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 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 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 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.8 27-Jan-1994  mycroft Separate curbrk and mincrk.
 1.7 27-Jan-1994  mycroft Random cleanup.
 1.6 27-Jan-1994  mycroft SYS_brk --> SYS_break. Where's my axe?
 1.5 27-Jan-1994  mycroft More stylistic changes.
 1.4 24-Jan-1994  jtc Optimization tweaks:
Use testl %reg,%reg instead of cmpl $0,%reg
Use xorl %reg,%reg instead of movl $0,%reg
 1.3 06-Dec-1993  pk Use PIC_PLT for error returns.
Correct operand order in accessing `minbrk' and `curbrk'.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.12.2.1 05-May-2000  he Pull up revision 1.13 (requested by assar):
Repair syscall stubs which were not adapted when the cerror
interface was changed.
 1.14.4.1 21-Aug-2000  kleink Pull up revs. 1.15-1.16 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.17.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.17.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.21.36.2 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.21.36.1 17-Apr-2012  yamt sync with head
 1.22.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.2.1 10-Aug-2014  tls Rebase.
 1.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 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 23-May-2014  uebayasi branches: 1.18.36;
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 27-Feb-2012  joerg branches: 1.16.2;
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
 1.15 18-Nov-2011  joerg branches: 1.15.2;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.14 07-Aug-2003  agc branches: 1.14.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.13 03-Apr-2000  mycroft Clean up.
 1.12 19-Feb-2000  mycroft A better fix for the stub-in-other-module problem:
Load the address of cerror through the GOT, so we can do a PIC_EPILOGUE and
leave the stack clean.
 1.11 23-Jan-2000  mycroft Make cerror() work correctly for stubs in other shlibs -- e.g. libposix.
 1.10 07-Feb-1999  christos branches: 1.10.2;
Make cerror an entry and compensate for the PIC_PROLOGUE change in SYS.h
 1.9 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.8 01-Oct-1998  kleink (Fortunately harmless) typo in previous.
 1.7 01-Oct-1998  kleink Add *__errno() redirection for _REENTRANT code.
 1.6 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 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 02-Apr-1994  cgd have cerror DTRT on returns, w.r.t. quads and -1. it needs to be done
here (think of syscall(SYS_lseek,...)). also, kill bogus lseek thang.
 1.3 27-Jan-1994  mycroft Random cleanup.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.10.2.2 22-Feb-2000  he Pull up revision 1.12 (requested by mycroft):
Implement a better fix for the ``stubs in other shlibs'' problem.
With this fix the stack is left clean during the transition from
the stub to cerror().
 1.10.2.1 31-Jan-2000  he Pull up revision 1.11 (requested by mycroft):
Make cerror() work correctly for stubs in other shlibs -- e.g.
libposix.
 1.14.56.2 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.14.56.1 17-Apr-2012  yamt sync with head
 1.15.2.1 27-Feb-2012  riz Pull up following revision(s) (requested by joerg in ticket #57):
lib/libc/arch/arm/sys/cerror.S: revision 1.8
lib/libc/arch/vax/SYS.h: revision 1.12
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.3
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.4
lib/libc/arch/i386/sys/cerror.S: revision 1.16
lib/libc/arch/x86_64/sys/cerror.S: revision 1.5
lib/libc/arch/powerpc/sys/cerror.S: revision 1.10
lib/libc/arch/mips/sys/cerror.S: revision 1.17
lib/libc/arch/powerpc/sys/cerror.S: revision 1.9
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.16.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.2.1 10-Aug-2014  tls Rebase.
 1.18.36.1 02-Aug-2025  perseant Sync with HEAD
 1.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.16 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.15 23-May-2014  uebayasi branches: 1.15.6; 1.15.10;
Put missing END() markers to set ELF symbol size.
 1.14 18-Nov-2011  joerg branches: 1.14.6; 1.14.16;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.13 07-Aug-2003  agc branches: 1.13.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.11 08-Dec-2000  mycroft branches: 1.11.2;
Use the SYSTRAP() macro more uniformly.
 1.10 03-Apr-2000  mycroft Repair syscall stubs that were not updated when the cerror interface was
modified.
 1.9 08-Feb-1999  christos branches: 1.9.2;
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.8 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.7 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.6 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.5 27-Jan-1994  mycroft Random cleanup.
 1.4 27-Jan-1994  mycroft More stylistic changes.
 1.3 06-Dec-1993  pk Use PIC_PLT for error returns.
Correct operand order in accessing `minbrk' and `curbrk'.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.9.2.1 05-May-2000  he Pull up revision 1.10 (requested by assar):
Repair syscall stubs which were not adapted when the cerror
interface was changed.
 1.11.2.1 22-Mar-2002  nathanw Catch up to -current.
 1.13.56.1 17-Apr-2012  yamt sync with head
 1.14.16.1 10-Aug-2014  tls Rebase.
 1.14.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.10.1 21-Apr-2017  bouyer Sync with HEAD
 1.15.6.1 20-Mar-2017  pgoyette Sync with HEAD
 1.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 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 07-Aug-2003  agc branches: 1.9.62; 1.9.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.7 26-Jun-2000  kleink Need an internal name for fork().
 1.6 16-Jul-1997  christos branches: 1.6.12;
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.5 27-Jan-1994  mycroft Trivial speedup inspired by SPARC code.
 1.4 27-Jan-1994  mycroft Stylistic changes.
 1.3 24-Jan-1994  jtc Optimization tweaks:
Use testl %reg,%reg instead of cmpl $0,%reg
Use xorl %reg,%reg instead of movl $0,%reg
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6.12.1 21-Aug-2000  kleink Pull up rev. 1.7 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.9.74.1 10-Aug-2014  tls Rebase.
 1.9.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 Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.3 28-Apr-2008  martin branches: 1.3.8; 1.3.28; 1.3.40;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 05-Mar-2001  nathanw branches: 1.1.2;
file getcontext.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.2.30.1 18-May-2008  yamt sync with head.
 1.3.40.1 10-Aug-2014  tls Rebase.
 1.3.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2 02-Apr-1994  mycroft Clean up deleted files.
 1.1 31-Mar-1994  mycroft Need to set %edx to -1 before cerror, though perhaps we should have something
more generic for this.
 1.4 06-Oct-1994  mycroft Clean up deleted files.
 1.3 24-Jan-1994  jtc Optimization tweaks:
Use testl %reg,%reg instead of cmpl $0,%reg
Use xorl %reg,%reg instead of movl $0,%reg
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 13-Sep-2005  christos compat core reorg.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 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 28-Sep-2000  kleink Need an internal name for pipe(2).
 1.4 16-Jul-1997  christos branches: 1.4.12;
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 24-Jan-1994  jtc Optimization tweaks:
Use testl %reg,%reg instead of cmpl $0,%reg
Use xorl %reg,%reg instead of movl $0,%reg
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4.12.1 29-Sep-2000  kleink Pull up rev. 1.5 (approved by thorpej):
Add internal name for pipe().
 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.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 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 23-May-2014  uebayasi branches: 1.19.36;
Put missing END() markers to set ELF symbol size.
 1.18 12-Sep-2013  joerg branches: 1.18.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.17 18-Nov-2011  joerg branches: 1.17.6;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.16 07-Aug-2003  agc branches: 1.16.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.15 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.14 08-Dec-2000  mycroft branches: 1.14.2;
Use the SYSTRAP() macro more uniformly.
 1.13 03-Apr-2000  mycroft Clean up.
* _REENTRANT is always defined.
* The vfork() stubs can use cerror.
 1.12 03-Apr-2000  mycroft Repair syscall stubs that were not updated when the cerror interface was
modified.
 1.11 08-Feb-1999  christos branches: 1.11.2;
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 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.9 01-Oct-1998  kleink Add *__errno() redirection for _REENTRANT code.
 1.8 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 1.7 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.6 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.5 27-Jan-1994  mycroft Random cleanup.
 1.4 27-Jan-1994  mycroft More stylistic changes.
 1.3 06-Dec-1993  pk Use PIC_PLT for error returns.
Correct operand order in accessing `minbrk' and `curbrk'.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.11.2.2 09-Sep-2000  he Pull up revision 1.12 (requested by he):
Update old syscall stubs to match the new cerror interface.
Fixes PR#10789.
 1.11.2.1 05-May-2000  he Pull up revision 1.13 (requested by assar):
Repair syscall stubs which were not adapted when the cerror
interface was changed.
 1.14.2.1 22-Mar-2002  nathanw Catch up to -current.
 1.16.56.2 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.16.56.1 17-Apr-2012  yamt sync with head
 1.17.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.2.1 10-Aug-2014  tls Rebase.
 1.19.36.1 02-Aug-2025  perseant Sync with HEAD
 1.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.3 11-Nov-1996  mycroft Treat reboot() like a normal system call. From PR 2458.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 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 Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.22 23-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.21 12-Sep-2013  joerg branches: 1.21.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.20 18-Nov-2011  joerg branches: 1.20.6;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.19 02-Jul-2008  rmind branches: 1.19.2; 1.19.6;
Avoid calling a syscall when argument to sbrk(2) is zero.
OK by <ad>.
 1.18 09-Mar-2007  ad branches: 1.18.12;
If I686_LIBC is defined, make syscalls using the 'sysenter' instruction.
 1.17 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.16 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.15 08-Dec-2000  mycroft branches: 1.15.2;
Use the SYSTRAP() macro more uniformly.
 1.14 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.13 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.12 03-Apr-2000  mycroft branches: 1.12.4;
Clean up.
* _REENTRANT is always defined.
* The vfork() stubs can use cerror.
 1.11 03-Apr-2000  mycroft Repair syscall stubs that were not updated when the cerror interface was
modified.
 1.10 08-Feb-1999  christos branches: 1.10.2;
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.9 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.8 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.7 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.6 27-Jan-1994  mycroft Separate curbrk and mincrk.
 1.5 27-Jan-1994  mycroft Random cleanup.
 1.4 27-Jan-1994  mycroft SYS_brk --> SYS_break. Where's my axe?
 1.3 27-Jan-1994  mycroft More stylistic changes.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.10.2.1 05-May-2000  he Pull up revision 1.11 (requested by assar):
Repair syscall stubs which were not adapted when the cerror
interface was changed.
 1.12.4.1 21-Aug-2000  kleink Pull up revs. 1.13-1.14 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.15.2.1 22-Mar-2002  nathanw Catch up to -current.
 1.18.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.19.6.2 02-Jul-2008  rmind Avoid calling a syscall when argument to sbrk(2) is zero.
OK by <ad>.
 1.19.6.1 02-Jul-2008  rmind file sbrk.S was added on branch christos-time_t on 2008-07-02 20:07:44 +0000
 1.19.2.2 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.19.2.1 17-Apr-2012  yamt sync with head
 1.20.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.2.1 10-Aug-2014  tls Rebase.
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 01-Jul-1998  thorpej branches: 1.7.12;
Use _C_LABEL() to generate C labels.
 1.6 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.5 27-Jan-1994  mycroft Random cleanup.
 1.4 18-Dec-1993  jtc Fix bug #24 by renaming _logname_valid to __logname_valid.
 1.3 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source 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.12.1 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source 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.1 07-Jul-2000  itohy Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.2 13-Sep-2005  christos compat core reorg.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.3 13-Sep-2005  christos compat core reorg.
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.1 26-Sep-1998  christos Add a compat sigaction.
 1.7 13-Sep-2005  christos compat core reorg.
 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 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.4 26-Sep-1998  christos Fix signal mess. Change old syscalls to use the right signal numbers
and add a versioned copy of sigreturn (from Jason)
 1.3 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.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 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 Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.18 13-Sep-2005  christos compat core reorg.
 1.17 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.16 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.15 08-Dec-2000  mycroft branches: 1.15.2;
Use the SYSTRAP() macro more uniformly.
 1.14 03-Apr-2000  mycroft Repair syscall stubs that were not updated when the cerror interface was
modified.
 1.13 08-Feb-1999  christos branches: 1.13.2;
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.12 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.11 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.10 26-Sep-1998  christos Fix signal mess. Change old syscalls to use the right signal numbers
and add a versioned copy of sigreturn (from Jason)
 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 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.7 27-Jan-1994  mycroft Random cleanup.
 1.6 27-Jan-1994  mycroft Stylistic changes.
 1.5 27-Jan-1994  mycroft Fix bug jtc introduced.
 1.4 24-Jan-1994  jtc Optimization tweaks:
Use testl %reg,%reg instead of cmpl $0,%reg
Use xorl %reg,%reg instead of movl $0,%reg
 1.3 06-Dec-1993  pk Use PIC_PLT for error returns.
Correct operand order in accessing `minbrk' and `curbrk'.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.13.2.1 05-May-2000  he Pull up revision 1.14 (requested by assar):
Repair syscall stubs which were not adapted when the cerror
interface was changed.
 1.15.2.1 22-Mar-2002  nathanw Catch up to -current.
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.11 13-Sep-2005  christos compat core reorg.
 1.10 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 1.9 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.8 28-Sep-1999  kleink Oops, missed these in the mcount -> __mcount renaming.
 1.7 23-Aug-1999  kleink branches: 1.7.2;
Use _ALIGN_TEXT from <machine/asm.h>.
 1.6 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.5 26-Sep-1998  christos Fix signal mess. Change old syscalls to use the right signal numbers
and add a versioned copy of sigreturn (from Jason)
 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 30-Nov-1996  jtc PROF -> GPROF
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.16 13-Sep-2005  christos 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 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.13 08-Dec-2000  mycroft branches: 1.13.2;
Use the SYSTRAP() macro more uniformly.
 1.12 03-Apr-2000  mycroft Repair syscall stubs that were not updated when the cerror interface was
modified.
 1.11 08-Feb-1999  christos branches: 1.11.2;
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 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.9 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.8 26-Sep-1998  christos Fix signal mess. Change old syscalls to use the right signal numbers
and add a versioned copy of sigreturn (from Jason)
 1.7 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.6 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.5 27-Jan-1994  mycroft Random cleanup.
 1.4 27-Jan-1994  mycroft Stylistic changes.
 1.3 06-Dec-1993  pk Use PIC_PLT for error returns.
Correct operand order in accessing `minbrk' and `curbrk'.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.11.2.1 05-May-2000  he Pull up revision 1.12 (requested by assar):
Repair syscall stubs which were not adapted when the cerror
interface was changed.
 1.13.2.1 22-Mar-2002  nathanw Catch up to -current.
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.14 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.13 23-May-2014  uebayasi branches: 1.13.24;
Put missing END() markers to set ELF symbol size.
 1.12 18-Nov-2011  joerg branches: 1.12.6; 1.12.16;
Mark __cerror as hidden and exploit that to simplify assembler.
 1.11 07-Aug-2003  agc branches: 1.11.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 20-Mar-2002  ross use canonical indirect jmp & call syntax to squelch new as(1) warning
 1.9 03-Apr-2000  mycroft branches: 1.9.6;
Repair syscall stubs that were not updated when the cerror interface was
modified.
 1.8 08-Feb-1999  christos branches: 1.8.2;
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.7 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 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.5 26-Oct-1994  mycroft Use trap gate to enter kernel.
 1.4 27-Jan-1994  mycroft Random cleanup.
 1.3 06-Dec-1993  pk Use PIC_PLT for error returns.
Correct operand order in accessing `minbrk' and `curbrk'.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.8.2.1 05-May-2000  he Pull up revision 1.9 (requested by assar):
Repair syscall stubs which were not adapted when the cerror
interface was changed.
 1.9.6.1 22-Mar-2002  nathanw Catch up to -current.
 1.11.56.1 17-Apr-2012  yamt sync with head
 1.12.16.1 10-Aug-2014  tls Rebase.
 1.12.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.24.1 21-Apr-2020  martin Sync with HEAD
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 21-Oct-1993  jtc Move the old berkeley sccs id into the header comment like it is done
for other source files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.3 23-Sep-2006  cherry Towards ia64 libc. Round #2
 1.2 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.1 10-Sep-2006  cherry libc stubs added
 1.1 10-Sep-2006  cherry libc stubs added
 1.2 22-Sep-2006  cherry add ia64 libc MI bits.
 1.1 10-Sep-2006  cherry libc stubs added
 1.1 10-Sep-2006  cherry libc stubs added
 1.1 10-Sep-2006  cherry libc stubs added
 1.9 08-Nov-2018  riastradh Use the generic C fabs/fabsl on ia64 for now to unbreak the build.
 1.8 05-Aug-2016  scole branches: 1.8.12; 1.8.14;
PR port-ia64/51261

Add stubs for ia64 build
 1.7 30-Jun-2016  mrg branches: 1.7.2;
various ia64 updates:
- add a compat vfork because of stupid
- add a weak sbrk
- add a shmat syscall
- add an empty kvm implementation that links
- add missing fp stuff
 1.6 17-Apr-2015  martin Add set/longjmp and friends (nearly verbatim from FreeBSD).
Add a dummy _lwp_makecontext() function (enough to make autoconfigury
happy and gcc mknative work)
 1.5 27-Dec-2012  martin Add fpclassify{,d}
 1.4 23-Sep-2006  cherry branches: 1.4.42; 1.4.48;
Towards ia64 libc. Round #2
 1.3 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.2 22-Sep-2006  cherry add ia64 libc MI bits.
 1.1 10-Sep-2006  cherry libc stubs added
 1.4.48.1 25-Feb-2013  tls resync with head
 1.4.42.1 23-Jan-2013  yamt sync with head
 1.7.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.8.14.1 10-Jun-2019  christos Sync with HEAD
 1.8.12.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1 17-Apr-2015  martin Add set/longjmp and friends (nearly verbatim from FreeBSD).
Add a dummy _lwp_makecontext() function (enough to make autoconfigury
happy and gcc mknative work)
 1.1 17-Apr-2015  martin Add set/longjmp and friends (nearly verbatim from FreeBSD).
Add a dummy _lwp_makecontext() function (enough to make autoconfigury
happy and gcc mknative work)
 1.1 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.1 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.1 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.2 22-Nov-2016  scole For ski, break into debugger instead of exiting
 1.1 05-Aug-2016  scole branches: 1.1.2;
PR port-ia64/51261

Add stubs for ia64 build
 1.1.2.3 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.2 06-Aug-2016  pgoyette Sync with HEAD
 1.1.2.1 05-Aug-2016  pgoyette file fpgetsticky.c was added on branch pgoyette-localcount on 2016-08-06 00:19:02 +0000
 1.1 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.1 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.2 22-Nov-2016  scole For ski, break into debugger instead of exiting
 1.1 05-Aug-2016  scole branches: 1.1.2;
PR port-ia64/51261

Add stubs for ia64 build
 1.1.2.3 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.2 06-Aug-2016  pgoyette Sync with HEAD
 1.1.2.1 05-Aug-2016  pgoyette file fpsetsticky.c was added on branch pgoyette-localcount on 2016-08-06 00:19:02 +0000
 1.2 22-Nov-2016  scole For ski, break into debugger instead of exiting
 1.1 05-Aug-2016  scole branches: 1.1.2;
PR port-ia64/51261

Add stubs for ia64 build
 1.1.2.3 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.2 06-Aug-2016  pgoyette Sync with HEAD
 1.1.2.1 05-Aug-2016  pgoyette file getcontext.S was added on branch pgoyette-localcount on 2016-08-06 00:19:02 +0000
 1.2 22-Nov-2016  scole For ski, break into debugger instead of exiting
 1.1 05-Aug-2016  scole branches: 1.1.2;
PR port-ia64/51261

Add stubs for ia64 build
 1.1.2.3 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.2 06-Aug-2016  pgoyette Sync with HEAD
 1.1.2.1 05-Aug-2016  pgoyette file makecontext.c was added on branch pgoyette-localcount on 2016-08-06 00:19:02 +0000
 1.3 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.2 11-Oct-2023  skrll Trailing whitespace
 1.1 17-Apr-2015  martin Add set/longjmp and friends (nearly verbatim from FreeBSD).
Add a dummy _lwp_makecontext() function (enough to make autoconfigury
happy and gcc mknative work)
 1.1 17-Apr-2015  martin Add set/longjmp and friends (nearly verbatim from FreeBSD).
Add a dummy _lwp_makecontext() function (enough to make autoconfigury
happy and gcc mknative work)
 1.2 22-Nov-2016  scole For ski, break into debugger instead of exiting
 1.1 05-Aug-2016  scole branches: 1.1.2;
PR port-ia64/51261

Add stubs for ia64 build
 1.1.2.3 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.2 06-Aug-2016  pgoyette Sync with HEAD
 1.1.2.1 05-Aug-2016  pgoyette file swapcontext.S was added on branch pgoyette-localcount on 2016-08-06 00:19:02 +0000
 1.1 10-Sep-2006  cherry libc stubs added
 1.4 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.3 04-Aug-2008  matt branches: 1.3.6;
Add C99 functions imaxabs and imaxdiv.
 1.2 23-Sep-2006  cherry branches: 1.2.18;
Towards ia64 libc. Round #2
 1.1 10-Sep-2006  cherry libc stubs added
 1.2.18.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.3.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.4 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.3 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.2 22-Sep-2006  cherry add ia64 libc MI bits.
 1.1 10-Sep-2006  cherry libc stubs added
 1.3 22-Nov-2016  scole For ski, break into debugger instead of exiting
 1.2 05-Aug-2016  scole PR port-ia64/51261

Add stubs for ia64 build
 1.1 10-Sep-2006  cherry branches: 1.1.66;
libc stubs added
 1.1.66.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.66.1 06-Aug-2016  pgoyette Sync with HEAD
 1.3 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 22-Sep-2006  cherry branches: 1.1.16;
ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.1.16.1 18-May-2008  yamt 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 __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2 15-Oct-2020  skrll Trailing whitespace
 1.1 23-Sep-2006  cherry Towards ia64 libc. Round #2
 1.2 22-Sep-2006  cherry add ia64 libc MI bits.
 1.1 07-Jul-2006  cherry checkin libc asm stubs, #1
 1.2 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.1 10-Sep-2006  cherry libc stubs added
 1.2 23-Sep-2006  cherry Towards ia64 libc. Round #2
 1.1 10-Sep-2006  cherry libc stubs added
 1.2 22-Sep-2006  cherry ia64 libc MD stuff #1. Pushing in everything before my harddisk pops.
 1.1 10-Sep-2006  cherry libc stubs added
 1.3 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.2 10-Dec-2016  scole branches: 1.2.2;
Add exect stub so "build.sh distribution" will compile
 1.1 10-Sep-2006  cherry branches: 1.1.66;
libc stubs added
 1.1.66.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.66.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.2.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.2 23-Sep-2006  cherry Towards ia64 libc. Round #2
 1.1 10-Sep-2006  cherry libc stubs added
 1.1 10-Sep-2006  cherry libc stubs added
 1.2 23-Sep-2006  cherry Towards ia64 libc. Round #2
 1.1 10-Sep-2006  cherry libc stubs added
 1.3 22-Nov-2016  scole For ski, break into debugger instead of exiting
 1.2 05-Aug-2016  scole PR port-ia64/51261

Add stubs for ia64 build
 1.1 10-Sep-2006  cherry branches: 1.1.66;
libc stubs added
 1.1.66.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.66.1 06-Aug-2016  pgoyette Sync with HEAD
 1.3 30-Jun-2016  mrg various ia64 updates:
- add a compat vfork because of stupid
- add a weak sbrk
- add a shmat syscall
- add an empty kvm implementation that links
- add missing fp stuff
 1.2 23-Sep-2006  cherry Towards ia64 libc. Round #2
 1.1 10-Sep-2006  cherry libc stubs added
 1.2 30-Jun-2016  mrg various ia64 updates:
- add a compat vfork because of stupid
- add a weak sbrk
- add a shmat syscall
- add an empty kvm implementation that links
- add missing fp stuff
 1.1 10-Sep-2006  cherry libc stubs added
 1.3 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.2 22-Sep-2006  cherry branches: 1.2.84;
add ia64 libc MI bits.
 1.1 10-Sep-2006  cherry libc stubs added
 1.2.84.1 21-Apr-2020  martin Sync with HEAD
 1.2 28-Dec-1995  jtc removed :errfix; const qualifier makes it unnecessary
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines, with shared library support.
 1.3 13-Dec-1995  thorpej New-style RCS ids.
 1.2 29-Jan-1994  mycroft Just use definitions from machine/asm.h.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines, with shared library support.
 1.19 10-Sep-2025  nat Switch over m68k soffloat build to libc/softfloat.

m68k would previously use softfloat functions contained in libgcc_s.

This change aligns m68k with other platforms built with softfloat.

It is still possible to build the gcc_s softfloat impementation by setting
MKSOFFTFLOAT=yes MKLIBCSOFTFLOAT=no

Addresses PR/59393.
 1.18 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.17 04-Mar-2014  matt The fixuns* come from compiler_rt so softfloat doesn't need to provide them.
 1.16 18-Jul-2013  matt Move hardfloat support to its own directory
 1.15 17-Jul-2013  matt branches: 1.15.2;
Add genassym / assym.h support
 1.14 22-Nov-2011  joerg branches: 1.14.6;
Add TLS support for m68k.
 1.13 09-Feb-2008  mrg branches: 1.13.28;
m68k/Makefile.inc:
- add __mmap.S to SRCS.
- add _lwp_getprivate.S mremap.S to ASM.
sys/Makefile.inc:
- look for __glue.S as well as glue.S.
- introduce a new ASM_MD and set it to "_lwp_getprivate.S mremap.S".
this is used for assembler files that may have non-default
implementations.

now m68k and m68000 mostly build again.
 1.12 17-Jun-2006  uwe branches: 1.12.10;
G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.11 09-Mar-2006  christos Welcome to the new compat layout.
 1.10 26-Sep-2004  jmmv Add support to build the mac68k port with soft-float enabled (i.e., setting
MKSOFTFLOAT=yes). The main purpose of this feature is to let NetBSD work
in machines with the 68040LC chip (those that have the FPU bug).

All the work has been done by Bruce O'Neel <edoneel AT sdf.lonestar.org>,
with some very minor changes by me; the patches were being posted to the
port-mac68k mailing list. It has been tested for a long time by several
users, including me.

I have just verified that regular releases, as well as soft-float ones,
continue to build.

There have been no objections to this patch since I asked for them in July
in the port-mac68k list.
 1.9 22-Sep-2003  cl SA_SIGINFO support for m68k (libc)
 1.8 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.7 15-Jan-1999  bouyer branches: 1.7.12;
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 04-Aug-1998  perry add memmove.S to libkern.
 1.5 22-Feb-1998  mycroft Copy more files to libkern.
 1.4 01-Jun-1996  jtc Added ashldi3.S, ashrdi3.S, and lshrdi3.S to KMSRCS
 1.3 18-Apr-1996  cgd have copy-to-libkern copy strcat.S, not strcat.c
 1.2 13-Dec-1995  thorpej New-style RCS ids.
 1.1 29-Mar-1994  chopps Need for copy-to-libkern-machdep in ../../Makefile
 1.7.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.12.10.1 23-Mar-2008  matt sync with HEAD
 1.13.28.2 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.28.1 17-Apr-2012  yamt sync with head
 1.14.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.2.1 23-Jul-2013  riastradh sync with HEAD
 1.18 24-Jul-2013  matt Only jump to CERROR if carry is set, not clear.
 1.17 16-Jul-2013  matt Make CERROR hidden. Use END() appropriately.
 1.16 07-Aug-2003  agc branches: 1.16.56; 1.16.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.15 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.14 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.13 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.12 25-Oct-1999  thorpej branches: 1.12.8;
Add register prefixes.
 1.11 02-May-1999  kleink branches: 1.11.2;
Call cerror through the PLT.
 1.10 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.9 02-May-1997  kleink Consistency: distinguish between PSEUDO() and PSEUDO_NOERROR().
 1.8 08-Mar-1997  thorpej Define immediate values properly for the __STDC__ preprocessor case,
from Hiroshi HORIMOTO <horimoto@cs-aoi.cs.sist.ac.jp>, PR #3222.
 1.7 19-Nov-1996  jtc Fix typo
 1.6 17-Oct-1996  jtc Added new macros:
SYSTRAP(x): Expands to the code used to call syscall x.
This is used to simplify other macros.

SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.

RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.
 1.5 13-Dec-1995  thorpej New-style RCS ids.
 1.4 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.3 08-Feb-1994  chopps branches: 1.3.2;
handle __STDC__ preprocessor.
 1.2 30-Jan-1994  mycroft Use machine/asm.h for ENTRY() macros.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines, with shared library support.
 1.3.2.1 05-Aug-1994  mycroft update from trunk
 1.11.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.8.2 21-Jun-2002  nathanw Catch up to -current.
 1.12.8.1 28-Jan-2002  nathanw Catch up to -current.
 1.16.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.56.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.2 21-Nov-2021  thorpej Decorate the m68k signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Add genassym / assym.h support
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file genassym.cf was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file genassym.cf was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.6 20-Oct-2025  nat New port: mac68ksf - Macintosh 68k softfloat.

This commit is all the Makefile glue for the new port which is the mac68k
port with MKSOFTFLOAT set to "yes".

As posted here:
https://mail-index.netbsd.org/port-mac68k/2025/10/14/msg001037.html
 1.5 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.4 18-Jul-2013  matt ${MACHINE_ARCH} != "m68000" --> ${MACHINE_ARCH} == "m68k"
 1.3 21-Mar-2006  he branches: 1.3.44; 1.3.50; 1.3.56;
It's .endif, not .fi.
 1.2 20-Mar-2006  kleink Don't build extended-precision routines on m68000; from Havard.
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.3.56.1 23-Jul-2013  riastradh sync with HEAD
 1.3.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.41 20-Oct-2025  nat New port: mac68ksf - Macintosh 68k softfloat.

This commit is all the Makefile glue for the new port which is the mac68k
port with MKSOFTFLOAT set to "yes".

As posted here:
https://mail-index.netbsd.org/port-mac68k/2025/10/14/msg001037.html
 1.40 04-Oct-2025  nat flt_rounds.S is only used for gcc_s softfloat.

libc/softfloat (the default) uses softfloat/flt_rounds.c.
 1.39 10-Sep-2025  nat Switch over m68k soffloat build to libc/softfloat.

m68k would previously use softfloat functions contained in libgcc_s.

This change aligns m68k with other platforms built with softfloat.

It is still possible to build the gcc_s softfloat impementation by setting
MKSOFFTFLOAT=yes MKLIBCSOFTFLOAT=no

Addresses PR/59393.
 1.38 31-May-2020  rin Add m68k assembler version of __muldi3().

This is intended for 68060:
- GCC does not emit __muldi3() for 68020-40, that have 32 * 32 --> 64 mulul
- mulsl (and moveml), used in this code, are not implemented for 68010

In comparison with that from compiler_rt, this version saves:
- 12% of processing time
- 12 bytes of stack
- 50 bytes of code size
Also, slightly faster, memory saving, and smaller than libgcc version.

By examining with evcnt(9), __muldi3() is invoked more than 1000 times per
sec by kernel, which should justify to introduce assembler version of this
function.
 1.37 22-Apr-2020  rin Restrict usage of m68k assembler versions of {,u}divsi3 and {,u}divsi3 to
kernel and bootloader for 68010.

They requires a special calling convention to udivsi3, and cannot to be
mixed up in normal routines provided by libgcc or compiler_rt. Although,
there's no problem for using them in a controlled situation, i.e., kernel
and standalone programs.

Note that this does not affect at all m68k ports other than sun2, since
codes generated by gcc do not call these routines.

Assembler files are moved from common/lib/libc/arch/m68k/gen to
sys/lib/libkern/arch/m68k in order not to be compiled in libc.

Revert hack introduced to lib/libc/compiler_rt/Makefile.inc rev 1.37:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/compiler_rt/Makefile.inc#rev1.37

Proposed on port-sun2@ with no response...
(Again, this does not affect m68k ports other than sun2.)
http://mail-index.netbsd.org/port-sun2/2020/03/10/msg000102.html
 1.36 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.35 22-Mar-2017  chs branches: 1.35.12;
provide a common softfloat fenv implemenation and use it for softfloat builds.
restore ABI compatibility with previous releases for ieeefp.h on sh3.
add namespace.h protection for all the fenv interfaces.
use MKSOFTFLOAT on sh3 instead of assuming softfloat.
standardize on comparing MKSOFTFLOAT with "no".
remove the arm-specific softfloat fenv code (which also had several bugs).
fix logic errors in the arm hardfloat feraiseexcept() and feupdateenv().
 1.34 07-Oct-2016  christos branches: 1.34.2;
Sync with compat and remove dup implementations of ldexp and modf, switching
mips and m68k to the compat copies.
 1.33 18-Mar-2014  riastradh branches: 1.33.8;
Merge riastradh-drm2 to HEAD.
 1.32 18-Jul-2013  matt Cleanup. hardfloat stuff is now in its own directory
 1.31 22-Nov-2011  joerg branches: 1.31.6; 1.31.10;
Add TLS support for m68k.
 1.30 06-Dec-2009  uebayasi branches: 1.30.6;
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.29 28-Nov-2009  christos Add no/op routines for m68000 for the sticky, mask, and round settings.
 1.28 03-Jul-2006  drochner build frexp_ieee754 in the "compat" subtree
(The Makefile logics for ldexp and modf is too involved for me to deal
with this now.)
 1.27 09-Mar-2006  christos Welcome to the new compat layout.
 1.26 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.25 26-Sep-2004  jmmv branches: 1.25.2;
Add support to build the mac68k port with soft-float enabled (i.e., setting
MKSOFTFLOAT=yes). The main purpose of this feature is to let NetBSD work
in machines with the 68040LC chip (those that have the FPU bug).

All the work has been done by Bruce O'Neel <edoneel AT sdf.lonestar.org>,
with some very minor changes by me; the patches were being posted to the
port-mac68k mailing list. It has been tested for a long time by several
users, including me.

I have just verified that regular releases, as well as soft-float ones,
continue to build.

There have been no objections to this patch since I asked for them in July
in the port-mac68k list.
 1.24 04-Mar-2004  kleink * 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.23 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.22 26-Oct-2003  kleink Use the generic `long double' == `double' versions on m68000.
 1.21 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.20 25-Oct-2003  cl replace __longjmp14 asm-implementation with __longjmp14 C-implementation
uses setcontext instead of __sigreturn14
fixes longjmp/siglongjmp when !COMPAT_16
 1.19 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.18 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.17 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.16 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.15 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.14 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.13 13-Jun-2001  fredette Don't compile softfloat or integer support routines on 68000
machines, they have this support already in libgcc.
 1.12 23-Dec-1999  kleink branches: 1.12.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.11 29-Aug-1999  mycroft Reimplement the FSCALE version as C-with-assembler. (Make the compiler deal
with ABI crap.)
 1.10 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.9 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.8 05-Oct-1998  thorpej Update for signal changes.
 1.7 04-Nov-1997  is Fix typo, which resulted in always compiling the M68040/M68060-version
of ldexp.
 1.6 02-Oct-1997  is branches: 1.6.2;
ieee.h and ldexp.c taken from the powerpc port, for the benefit of
68040 and 68060 owners.
With ``make M68040=1'' or ``make M68060=1'', we build a libc where the ldexp()
doesn't use excessive amounts of system cpu time.
Without any of those defines, the normal assembler version using FSCALE is
included, for the benefit of M68020 and M68030 users, or M68040/M68060 users
where the ldexp performance is no bottleneck.
[Its not yet worked out how to include both library versions in a binary
distribution, but you can build your own from source now if you need it.]
For details, look at PR 3105.
 1.5 14-Jul-1997  veego Remove the duplicated __builtin_saveregs function.
We only need it in src/gnu/usr.bin/gcc/libgcc/libgcc2.c.
 1.4 03-May-1995  briggs m68k sig{set,long}jmp from Henric Jungheim (uhenric@mcl.ucsb.edu) as
followup to GNATS report port-amiga/1009.
Passes regression tests.
I added a NetBSD string and changed jbra to jra.
 1.3 07-Apr-1995  jtc Added __flt_rounds(), fp{get,set}{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.6.2.1 05-Nov-1997  mellon Pull rev 1.7 up from trunk (is)
 1.12.6.5 22-Mar-2002  nathanw Catch up to -current.
 1.12.6.4 08-Mar-2002  nathanw Catch up to -current.
 1.12.6.3 21-Nov-2001  scw _lwp_makecontext() for m68k, based on Nathan W's i386 implementation.

XXX: Nathan should decide on a copyright for both this and the i386 version.
 1.12.6.2 10-Nov-2001  scw Userland mcontext glue for Scheduler Activations on m68k.
From Klaus Klein <kleink@netbsd.org>.
 1.12.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.25.2.1 19-Apr-2005  tron Pull up revision 1.26 (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.30.6.2 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.30.6.1 17-Apr-2012  yamt sync with head
 1.31.10.1 23-Jul-2013  riastradh sync with HEAD
 1.31.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.8.2 26-Apr-2017  pgoyette Sync with HEAD
 1.33.8.1 04-Nov-2016  pgoyette Sync with HEAD
 1.34.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.35.12.1 10-Jun-2019  christos Sync with HEAD
 1.3 09-Mar-2006  christos Welcome to the new compat layout.
 1.2 14-Sep-2005  he Patterned after the other fixes for __longjmp14.c, include
<compat/include/setjmp.h> also here to make these build.
 1.1 25-Oct-2003  cl replace __longjmp14 asm-implementation with __longjmp14 C-implementation
uses setcontext instead of __sigreturn14
fixes longjmp/siglongjmp when !COMPAT_16
 1.7 09-Mar-2006  christos Welcome to the new compat layout.
 1.6 25-Oct-2003  cl replace __longjmp14 asm-implementation with __longjmp14 C-implementation
uses setcontext instead of __sigreturn14
fixes longjmp/siglongjmp when !COMPAT_16
 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 02-Dec-2000  scw Restore %a0 after the call to sigprogmask(2) since an ELF kernel
will stomp on it due to SVR4 ABI compliance...
 1.3 25-Oct-1999  thorpej branches: 1.3.6;
Add register prefixes.
 1.2 18-Oct-1999  itohy ELF PIC support.
Small optimization.
 1.1 05-Oct-1998  thorpej branches: 1.1.4;
Update for signal changes.
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.6.1 15-Dec-2002  he Pull up revision 1.4 (requested by scw):
Restore %a0 after the call to sigprocmask(2), since an ELF kernel
will stomp on it due to SVR4 ABI compliance. Fixes PR#18644.
 1.5 09-Mar-2006  christos Welcome to the new compat layout.
 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 25-Oct-1999  thorpej Add register prefixes.
 1.2 18-Oct-1999  itohy ELF PIC support.
 1.1 05-Oct-1998  thorpej branches: 1.1.4;
Update for signal changes.
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.9 02-Apr-2023  skrll branches: 1.9.2;
Trailing whitespace
 1.8 18-Mar-2012  christos fix lint
 1.7 22-Nov-2011  joerg Add TLS support for m68k.
 1.6 24-Feb-2011  joerg branches: 1.6.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.5 28-Apr-2008  martin branches: 1.5.8; 1.5.20;
Remove clause 3 and 4 from TNF licenses
 1.4 12-Jun-2005  lukem branches: 1.4.18;
Add missing __RCSID()
 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 21-Nov-2001  scw branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.2 16-Jan-2003  thorpej Add missing notice.
 1.1.2.1 21-Nov-2001  scw _lwp_makecontext() for m68k, based on Nathan W's i386 implementation.

XXX: Nathan should decide on a copyright for both this and the i386 version.
 1.4.18.1 18-May-2008  yamt sync with head.
 1.5.20.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.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.6.4.1 17-Apr-2012  yamt sync with head
 1.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.9 16-Jul-2013  matt Add END(func)
 1.8 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.7 07-Aug-2003  agc branches: 1.7.56; 1.7.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 25-Oct-1999  thorpej Add register prefixes.
 1.5 18-Oct-1999  itohy ELF PIC support.
 1.4 01-Jul-1998  thorpej branches: 1.4.4;
Use _C_LABEL() to generate C labels.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 17-Jul-2013  matt Use a more portable series of instructions.
 1.8 16-Jul-2013  matt Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, return the pointer in a0, too.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.7 16-Jul-2013  matt Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.7 16-Jul-2013  matt Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 25-Oct-1999  thorpej Add register prefixes.
 1.1 15-Jan-1999  bouyer branches: 1.1.4;
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.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 25-Oct-1999  thorpej Add register prefixes.
 1.1 15-Jan-1999  bouyer branches: 1.1.4;
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.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 25-Oct-1999  thorpej Add register prefixes.
 1.2 08-Feb-1999  is branches: 1.2.4;
68060 optimization, doesnt hurt others
 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.2.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.7 16-Jul-2013  matt branches: 1.7.2;
Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.7 16-Jul-2013  matt branches: 1.7.2;
Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.14 27-Jan-2019  dholland fix another mergeo
 1.13 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.12 07-Nov-2018  riastradh On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.

For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm. For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64. Need help from an itanium
wizard! Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.
 1.11 17-Jul-2013  matt branches: 1.11.26; 1.11.28;
Use __HAVE_FPU__ instead __HAVE_68881__
 1.10 16-Jul-2013  matt Add END(func)
 1.9 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.8 28-Apr-2008  martin branches: 1.8.4; 1.8.8; 1.8.28;
Remove clause 3 and 4 from TNF licenses
 1.7 18-May-2001  fredette branches: 1.7.32;
On m68000, all code is compiled softfloat, so functions
that return floats must do so in integer registers, as the
pre-SVR4 ABI code did. So in these functions we ignore
__SVR4_ABI__ if __HAVE_68881__ is not also set.
 1.6 25-Oct-1999  thorpej branches: 1.6.8;
Add register prefixes.
 1.5 02-May-1999  kleink branches: 1.5.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.4 30-Jul-1997  jtc Fix files using old TNF copyright notice
 1.3 26-Jun-1996  jtc new implementation that simply clears most significant bit
 1.2 13-Dec-1995  thorpej New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.5.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.7.32.1 18-May-2008  yamt sync with head.
 1.8.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8.8.1 28-Apr-2008  martin file fabs.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.8.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.11.28.1 10-Jun-2019  christos Sync with HEAD
 1.11.26.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.7 16-Jul-2013  matt branches: 1.7.2;
Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.7 16-Jul-2013  matt branches: 1.7.2;
Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.11 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.10 16-Jul-2013  matt branches: 1.10.2;
Add END(func)
 1.9 04-Dec-2000  is branches: 1.9.60; 1.9.66;
The mapping is, effectively, an exclusive or with 0x01. Replace.
Savings: 10 bytes of code/constant data, 1 machine instruction (including
one memory access).
 1.8 25-Oct-1999  thorpej Add register prefixes.
 1.7 13-Dec-1995  thorpej branches: 1.7.12;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.6 09-Apr-1995  mycroft Put jtc's notice back, since these are now roughly identical.
 1.5 09-Apr-1995  mycroft Actually, bitfields are faster on the '040; optimize for it, but adjust the
fields so that the mask and sticky bits are the same.
 1.4 09-Apr-1995  mycroft Rewrite these to use the accrued exception byte for sticky flags, and to
avoid expensive bitfield instructions.
 1.3 09-Apr-1995  mycroft Fix typo.
 1.2 09-Apr-1995  mycroft Optimize.
 1.1 07-Apr-1995  jtc Added __flt_rounds(), fp{get,set}{round,mask,sticky}().
 1.7.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.66.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.60.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.10.2.1 23-Jul-2013  riastradh sync with HEAD
 1.6 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.5 18-Jul-2013  matt Fix typo. Don't define map if it isn't used.
 1.4 16-Jul-2013  matt branches: 1.4.2;
Add END(func)
 1.3 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.2 26-Sep-2004  jmmv branches: 1.2.50; 1.2.56;
Add support to build the mac68k port with soft-float enabled (i.e., setting
MKSOFTFLOAT=yes). The main purpose of this feature is to let NetBSD work
in machines with the 68040LC chip (those that have the FPU bug).

All the work has been done by Bruce O'Neel <edoneel AT sdf.lonestar.org>,
with some very minor changes by me; the patches were being posted to the
port-mac68k mailing list. It has been tested for a long time by several
users, including me.

I have just verified that regular releases, as well as soft-float ones,
continue to build.

There have been no objections to this patch since I asked for them in July
in the port-mac68k list.
 1.1 17-May-2001  fredette branches: 1.1.2;
Added. These are part of the soft-float support on the 68010.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 17-May-2001  nathanw file flt_rounds_softfloat.S was added on branch nathanw_sa on 2001-10-08 20:17:39 +0000
 1.2.56.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.50.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.4.2.1 23-Jul-2013  riastradh sync with HEAD
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 17-Feb-2007  mhitch branches: 1.2.10;
From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
 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.2 20-Mar-2012  he Sprinkle some /* ARGSUSED */ before the dummy functions to appease lint.
 1.1 28-Nov-2009  christos branches: 1.1.6;
Add no/op routines for m68000 for the sticky, mask, and round settings.
 1.1.6.1 17-Apr-2012  yamt sync with head
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 13-Jan-2002  thorpej branches: 1.7.58; 1.7.64;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.6 25-Oct-1999  thorpej branches: 1.6.8;
Add register prefixes.
 1.5 13-Dec-1995  thorpej branches: 1.5.12;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.4 09-Apr-1995  mycroft Actually, bitfields are faster on the '040; optimize for it, but adjust the
fields so that the mask and sticky bits are the same.
 1.3 09-Apr-1995  mycroft Rewrite these to use the accrued exception byte for sticky flags, and to
avoid expensive bitfield instructions.
 1.2 09-Apr-1995  jtc removed commented-out #include <machine/asm.h>
 1.1 07-Apr-1995  jtc Added __flt_rounds(), fp{get,set}{round,mask,sticky}().
 1.5.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.8.1 28-Jan-2002  nathanw Catch up to -current.
 1.7.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.58.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.10 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.9 16-Jul-2013  matt branches: 1.9.2;
Add END(func)
 1.8 13-Jan-2002  thorpej branches: 1.8.58; 1.8.64;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.7 25-Oct-1999  thorpej branches: 1.7.8;
Add register prefixes.
 1.6 13-Dec-1995  thorpej branches: 1.6.12;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.5 09-Apr-1995  mycroft Put jtc's notice back, since these are now roughly identical.
 1.4 09-Apr-1995  mycroft Actually, bitfields are faster on the '040; optimize for it, but adjust the
fields so that the mask and sticky bits are the same.
 1.3 09-Apr-1995  mycroft Rewrite these to use the accrued exception byte for sticky flags, and to
avoid expensive bitfield instructions.
 1.2 09-Apr-1995  jtc removed commented-out #include <machine/asm.h>
 1.1 07-Apr-1995  jtc Added __flt_rounds(), fp{get,set}{round,mask,sticky}().
 1.6.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.8.1 28-Jan-2002  nathanw Catch up to -current.
 1.8.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.58.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.9.2.1 23-Jul-2013  riastradh sync with HEAD
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 13-Jan-2002  thorpej branches: 1.7.58; 1.7.64;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.6 25-Oct-1999  thorpej branches: 1.6.8;
Add register prefixes.
 1.5 13-Dec-1995  thorpej branches: 1.5.12;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.4 09-Apr-1995  mycroft Actually, bitfields are faster on the '040; optimize for it, but adjust the
fields so that the mask and sticky bits are the same.
 1.3 09-Apr-1995  mycroft Rewrite these to use the accrued exception byte for sticky flags, and to
avoid expensive bitfield instructions.
 1.2 09-Apr-1995  jtc removed commented-out #include <machine/asm.h>
 1.1 07-Apr-1995  jtc Added __flt_rounds(), fp{get,set}{round,mask,sticky}().
 1.5.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.8.1 28-Jan-2002  nathanw Catch up to -current.
 1.7.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.58.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.10 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.9 16-Jul-2013  matt branches: 1.9.2;
Add END(func)
 1.8 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.7 13-Jan-2002  thorpej branches: 1.7.58; 1.7.64;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.6 25-Oct-1999  thorpej branches: 1.6.8;
Add register prefixes.
 1.5 13-Dec-1995  thorpej branches: 1.5.12;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.4 09-Apr-1995  mycroft Actually, bitfields are faster on the '040; optimize for it, but adjust the
fields so that the mask and sticky bits are the same.
 1.3 09-Apr-1995  mycroft Rewrite these to use the accrued exception byte for sticky flags, and to
avoid expensive bitfield instructions.
 1.2 09-Apr-1995  jtc removed commented-out #include <machine/asm.h>
 1.1 07-Apr-1995  jtc Added __flt_rounds(), fp{get,set}{round,mask,sticky}().
 1.5.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.8.1 28-Jan-2002  nathanw Catch up to -current.
 1.7.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.58.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.9.2.1 23-Jul-2013  riastradh sync with HEAD
 1.11 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.10 16-Jul-2013  matt branches: 1.10.2;
Add END(func)
 1.9 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.8 13-Jan-2002  thorpej branches: 1.8.58; 1.8.64;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.7 25-Oct-1999  thorpej branches: 1.7.8;
Add register prefixes.
 1.6 13-Dec-1995  thorpej branches: 1.6.12;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.5 09-Apr-1995  mycroft Put jtc's notice back, since these are now roughly identical.
 1.4 09-Apr-1995  mycroft Actually, bitfields are faster on the '040; optimize for it, but adjust the
fields so that the mask and sticky bits are the same.
 1.3 09-Apr-1995  mycroft Rewrite these to use the accrued exception byte for sticky flags, and to
avoid expensive bitfield instructions.
 1.2 09-Apr-1995  jtc removed commented-out #include <machine/asm.h>
 1.1 07-Apr-1995  jtc Added __flt_rounds(), fp{get,set}{round,mask,sticky}().
 1.6.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.8.1 28-Jan-2002  nathanw Catch up to -current.
 1.8.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.58.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.10.2.1 23-Jul-2013  riastradh sync with HEAD
 1.10 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.9 16-Jul-2013  matt branches: 1.9.2;
Add END(func)
 1.8 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.7 13-Jan-2002  thorpej branches: 1.7.58; 1.7.64;
Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.6 25-Oct-1999  thorpej branches: 1.6.8;
Add register prefixes.
 1.5 13-Dec-1995  thorpej branches: 1.5.12;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.4 09-Apr-1995  mycroft Actually, bitfields are faster on the '040; optimize for it, but adjust the
fields so that the mask and sticky bits are the same.
 1.3 09-Apr-1995  mycroft Rewrite these to use the accrued exception byte for sticky flags, and to
avoid expensive bitfield instructions.
 1.2 09-Apr-1995  jtc removed commented-out #include <machine/asm.h>
 1.1 07-Apr-1995  jtc Added __flt_rounds(), fp{get,set}{round,mask,sticky}().
 1.5.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.8.1 28-Jan-2002  nathanw Catch up to -current.
 1.7.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.58.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.9.2.1 23-Jul-2013  riastradh sync with HEAD
 1.7 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.6 29-Aug-1999  mycroft branches: 1.6.10;
Trivial KNF.
 1.5 29-Aug-1999  mycroft Make the C version of frexp() consitent across platforms, and handle the
Inf/NaN case.
 1.4 10-Mar-1999  mycroft Use ieee.h structs and macros.
 1.3 13-Jul-1997  christos Fix RCSID's
 1.2 13-Dec-1995  thorpej New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.7 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.6 13-Sep-2000  msaitoh branches: 1.6.2;
check LIBC_SCCS
 1.5 14-Nov-1998  christos delint
 1.4 26-Jul-1998  mycroft const poisoning.
 1.3 13-Jul-1997  christos Fix RCSID's
 1.2 13-Dec-1995  thorpej New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6.2.1 08-Mar-2002  nathanw Catch up to -current.
 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.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 29-Oct-2003  kleink branches: 1.1.30;
C99 7.12.3.2: add library portions of isfinite, but don't build these just
yet.
 1.1.30.1 18-May-2008  yamt 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 isfinitel.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.9 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.8 22-Jan-2000  mycroft branches: 1.8.6;
Delint.
 1.7 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.6 14-Nov-1998  christos delint
 1.5 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.4 13-Jul-1997  christos Fix RCSID's
Add missing math.h include
 1.3 05-Feb-1996  jtc Add explicit return type
 1.2 13-Dec-1995  thorpej New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus branches: 1.1.4;
Machine-dependent files for generic m68k machines (copied from hp300)
 1.1.4.1 18-Apr-1995  jtc namespace protect isnan() and isinf()
 1.8.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.6 30-Jan-2009  mhitch The explicit integer bit is "don't care" for infinity, and now that it's
included in ext_frach, it needs to be masked off when testing for an
infinity value. Fixes the ieeefp/infinity regression test on the 68060
which clears the explicity integer bit when loading an infinity value.
 1.5 10-Jan-2008  martin branches: 1.5.10;
Modify the high part of the fraction so that we recognize our __infinityl
value.
XXX - seems like we could share this with LE archs
 1.4 04-Mar-2004  kleink branches: 1.4.22;
* 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.3 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.2 27-Oct-2003  kleink Retire local union { floating-type; struct ieee_prec; } in favor of those
available from <machine/ieee.h>
 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.4.22.1 23-Mar-2008  matt sync with HEAD
 1.5.10.1 02-Feb-2009  snj Pull up following revision(s) (requested by mhitch in ticket #385):
lib/libc/arch/m68k/gen/isinfl.c: revision 1.6
The explicit integer bit is "don't care" for infinity, and now that it's
included in ext_frach, it needs to be masked off when testing for an
infinity value. Fixes the ieeefp/infinity regression test on the 68060
which clears the explicity integer bit when loading an infinity value.
 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.5 04-Mar-2004  kleink * 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 28-Oct-2003  kleink Ignore the explicit integer bit here, too; otherwise an infinity with the
explicit integer bit set could be classified as NaN.
 1.3 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.2 27-Oct-2003  kleink Retire local union { floating-type; struct ieee_prec; } in favor of those
available from <machine/ieee.h>
 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.7 29-Aug-1999  mycroft Reimplement the FSCALE version as C-with-assembler. (Make the compiler deal
with ABI crap.)
 1.6 02-May-1999  kleink When using the SVR4 ABI, just return floating point values in fp0.
 1.5 09-Oct-1997  is Most calls of ldexp() won't be with a first parameter of 0.0. Don't penalize
them for a slight optimization of the zero case.
 1.4 25-Apr-1997  thorpej Use <machine/asm.h>
 1.3 26-Jun-1996  jtc branches: 1.3.2;
use fscalel instead of ftwotoxl/fmulx
 1.2 13-Dec-1995  thorpej New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.7 29-Aug-1999  mycroft Reimplement the FSCALE version as C-with-assembler. (Make the compiler deal
with ABI crap.)
 1.6 29-Aug-1999  mycroft Don't ever return -0.0.
 1.5 29-Aug-1999  mycroft Minor style change.
 1.4 10-Mar-1999  mycroft Just some minor cleanup.
 1.3 02-Oct-1997  is ieee.h and ldexp.c taken from the powerpc port, for the benefit of
68040 and 68060 owners.
With ``make M68040=1'' or ``make M68060=1'', we build a libc where the ldexp()
doesn't use excessive amounts of system cpu time.
Without any of those defines, the normal assembler version using FSCALE is
included, for the benefit of M68020 and M68030 users, or M68040/M68060 users
where the ldexp performance is no bottleneck.
[Its not yet worked out how to include both library versions in a binary
distribution, but you can build your own from source now if you need it.]
For details, look at PR 3105.
 1.2 13-Jul-1997  christos Fix RCSID's
Add missing math.h include
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 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 07-Nov-2001  drochner fix -Wshadow warnings
 1.6 30-Aug-1999  mycroft branches: 1.6.10;
Another microoptimization. Take advantage of the addition already having set
the flags for the <=0 comparison.
 1.5 30-Aug-1999  mycroft Reuse the trick of loading 0.0 (rather than 1.0) and then modifying the
exponent. It's a bit faster on some machines.
 1.4 30-Aug-1999  mycroft Nuke unused variable.
 1.3 29-Aug-1999  mycroft ldexp(denormal, exp>1023) would generate the wrong result in all non-overflow
cases. Totally rework this code to fix this bug *and* make it faster.
 1.2 29-Aug-1999  mycroft Oops; committed wrong version here.
 1.1 29-Aug-1999  mycroft Reimplement the FSCALE version as C-with-assembler. (Make the compiler deal
with ABI crap.)
 1.6.10.2 08-Mar-2002  nathanw Catch up to -current.
 1.6.10.1 14-Nov-2001  nathanw Catch up to -current.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 07-Nov-2001  drochner branches: 1.2.32;
-Wshadow fix
 1.1 29-Aug-1999  mycroft branches: 1.1.10;
Reimplement the FSCALE version as C-with-assembler. (Make the compiler deal
with ABI crap.)
 1.1.10.1 14-Nov-2001  nathanw Catch up to -current.
 1.2.32.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 ldexp_881.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 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 07-Nov-2001  drochner cpoy from the 040 version: -Wshadow warning fix
 1.1 17-May-2001  fredette branches: 1.1.2;
Added. These are part of the soft-float support on the 68010.
 1.1.2.4 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 17-May-2001  nathanw file ldexp_softfloat.c was added on branch nathanw_sa on 2001-10-08 20:17:40 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 09-Mar-2006  christos branches: 1.1.18;
Welcome to the new compat layout.
 1.1.18.1 18-May-2008  yamt 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 longjmp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.7 16-Jul-2013  matt Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.7 16-Jul-2013  matt Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 10-Nov-2001  scw branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.1 10-Nov-2001  scw Userland mcontext glue for Scheduler Activations on m68k.
From Klaus Klein <kleink@netbsd.org>.
 1.2.30.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 makecontext.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 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 17-May-2001  fredette branches: 1.1.2;
Added. These are part of the soft-float support on the 68010.
 1.1.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 17-May-2001  nathanw file modf_softfloat.c was added on branch nathanw_sa on 2001-10-08 20:17:40 +0000
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.10 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.9 16-Jul-2013  matt branches: 1.9.2;
Add END(func)
 1.8 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.7 07-Aug-2003  agc branches: 1.7.56; 1.7.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 25-Oct-1999  thorpej Add register prefixes.
 1.5 02-May-1999  kleink branches: 1.5.2;
Oops, typo.
 1.4 02-May-1999  kleink When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.5.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.56.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.9.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 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.10 17-Jul-2013  matt Use __HAVE_FPU__ instead __HAVE_68881__
 1.9 16-Jul-2013  matt Add END(func)
 1.8 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.7 07-Aug-2003  agc branches: 1.7.56; 1.7.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 18-May-2001  fredette On m68000, all code is compiled softfloat, so functions
that return floats must do so in integer registers, as the
pre-SVR4 ABI code did. So in these functions we ignore
__SVR4_ABI__ if __HAVE_68881__ is not also set.
 1.5 25-Oct-1999  thorpej branches: 1.5.8;
Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.7.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.56.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.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.10 17-Jul-2013  matt Use __HAVE_FPU__ instead __HAVE_68881__
 1.9 16-Jul-2013  matt Add END(func)
 1.8 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.7 07-Aug-2003  agc branches: 1.7.56; 1.7.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 18-May-2001  fredette On m68000, all code is compiled softfloat, so functions
that return floats must do so in integer registers, as the
pre-SVR4 ABI code did. So in these functions we ignore
__SVR4_ABI__ if __HAVE_68881__ is not also set.
 1.5 25-Oct-1999  thorpej branches: 1.5.8;
Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.7.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.56.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.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8 17-Jul-2013  matt Use assym.h
 1.7 16-Jul-2013  matt Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 28-Apr-2008  martin branches: 1.5.4; 1.5.8; 1.5.28;
Remove clause 3 and 4 from TNF licenses
 1.4 13-Dec-2006  martin branches: 1.4.10;
Pull over rev. 1.5 of the i386 version (../../i386/resumecontext.S),
quoting Matthias Drochner:

> -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.

This fixes regress/lib/libc/context for m68k.

Thanks to Steve Woodford for optimization hints.
 1.3 26-Jan-2003  kleink branches: 1.3.16;
Fix comment typo, and convert to C-style comments.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 10-Nov-2001  scw branches: 1.1.2;
file resumecontext.S was initially added on branch nathanw_sa.
 1.1.2.1 10-Nov-2001  scw Userland mcontext glue for Scheduler Activations on m68k.
From Klaus Klein <kleink@netbsd.org>.
 1.3.16.1 15-Dec-2006  tron Pull up following revision(s) (requested by martin in ticket #273):
lib/libc/arch/m68k/gen/resumecontext.S: revision 1.4
Pull over rev. 1.5 of the i386 version (../../i386/resumecontext.S),
quoting Matthias Drochner:
-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.
This fixes regress/lib/libc/context for m68k.
Thanks to Steve Woodford for optimization hints.
 1.4.10.1 18-May-2008  yamt sync with head.
 1.5.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.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.5.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.6 14-Jul-1997  veego Remove the duplicated __builtin_saveregs function.
We only need it in src/gnu/usr.bin/gcc/libgcc/libgcc2.c.
 1.5 14-Jul-1997  christos Builtin saveregs returns void *, not void.
 1.4 14-Jul-1997  christos Add missing prototypes. From Bernd.
 1.3 13-Jul-1997  christos Fix RCSID's
 1.2 13-Dec-1995  thorpej New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.15 17-Jul-2013  matt Use assym.h
 1.14 16-Jul-2013  matt Add END(func)
 1.13 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.12 09-Mar-2006  christos branches: 1.12.44; 1.12.50;
Welcome to the new compat layout.
 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 25-Oct-1999  thorpej Add register prefixes.
 1.9 18-Oct-1999  itohy ELF PIC support.
Small optimization.
 1.8 01-Jul-1998  thorpej branches: 1.8.4;
Use _C_LABEL() to generate C labels.
 1.7 05-Dec-1997  thorpej Use __sigaltstack14(), not sigaltstack().
 1.6 25-Apr-1997  thorpej Use <machine/asm.h>
 1.5 13-Dec-1995  thorpej branches: 1.5.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.4 05-Aug-1994  mycroft Revert this.
 1.3 04-Aug-1994  chopps inline call to sigreturn original idea from jason downs <downsj@CSOS.ORST.EDU>
we want this to be done for everything including non-PIC code as longjmp()
does non-standard things with regs and wouldn't like it if the user replaced
the sigreturn() stub.
 1.2 10-May-1994  chopps branches: 1.2.2;
update to use sigaltstack.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 05-Aug-1994  mycroft update from trunk
 1.5.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.8.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.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.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 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.10 16-Jul-2013  matt Add END(func)
 1.9 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.8 09-Mar-2006  christos branches: 1.8.44; 1.8.50;
Welcome to the new compat layout.
 1.7 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.6 25-Oct-1999  thorpej Add register prefixes.
 1.5 18-Oct-1999  itohy ELF PIC support.
 1.4 01-Jul-1998  thorpej branches: 1.4.4;
Use _C_LABEL() to generate C labels.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 03-May-1995  briggs m68k sig{set,long}jmp from Henric Jungheim (uhenric@mcl.ucsb.edu) as
followup to GNATS report port-amiga/1009.
Passes regression tests.
I added a NetBSD string and changed jbra to jra.
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.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.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6 17-Jul-2013  matt Use assym.h
 1.5 16-Jul-2013  matt Add END(func)
 1.4 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8; 1.3.28;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 10-Nov-2001  scw branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 10-Nov-2001  scw Userland mcontext glue for Scheduler Activations on m68k.
From Klaus Klein <kleink@netbsd.org>.
 1.2.30.1 18-May-2008  yamt sync with head.
 1.3.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.3.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.9 18-Jul-2013  matt Remove hardfloat now that it's someplace else.
 1.8 16-Jul-2013  matt branches: 1.8.2;
Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-May-1999  kleink branches: 1.4.2;
When using the SVR4 ABI, just return floating point values in fp0.
 1.3 25-Apr-1997  thorpej Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.8.2.1 23-Jul-2013  riastradh sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.7 16-Jul-2013  matt Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej branches: 1.2.2;
New-style RCS id's. In assmebly files, use the RCSID() macro where
appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add the Makefile
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file Makefile.inc was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file Makefile.inc was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file adddf3.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file adddf3.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file addsf3.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file addsf3.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.3 18-Mar-2014  riastradh branches: 1.3.4; 1.3.8;
Merge riastradh-drm2 to HEAD.
 1.2 18-Jul-2013  matt Update to compile on coldfire.
 1.1 17-Jul-2013  matt branches: 1.1.2;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.2.1 23-Jul-2013  riastradh sync with HEAD
 1.3.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 18-Mar-2014  tls file cmpdf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.3.4.2 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.3.4.1 18-Mar-2014  yamt file cmpdf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.3 18-Mar-2014  riastradh branches: 1.3.4; 1.3.8;
Merge riastradh-drm2 to HEAD.
 1.2 18-Jul-2013  matt Update to compile on coldfire.
 1.1 17-Jul-2013  matt branches: 1.1.2;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.2.1 23-Jul-2013  riastradh sync with HEAD
 1.3.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 18-Mar-2014  tls file cmpsf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.3.4.2 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.3.4.1 18-Mar-2014  yamt file cmpsf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file divdf3.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file divdf3.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file divsf3.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file divsf3.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file extendsfdf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file extendsfdf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file fixdfsi.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file fixdfsi.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.3 18-Mar-2014  riastradh branches: 1.3.4; 1.3.8;
Merge riastradh-drm2 to HEAD.
 1.2 18-Jul-2013  matt Update to compile on coldfire.
 1.1 17-Jul-2013  matt branches: 1.1.2;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.2.1 23-Jul-2013  riastradh sync with HEAD
 1.3.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 18-Mar-2014  tls file fixunsdfsi.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.3.4.2 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.3.4.1 18-Mar-2014  yamt file fixunsdfsi.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add for softfloat compatibility
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file fixunssfsi.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file fixunssfsi.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file fixunssfsi.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file floatsidf.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file floatsidf.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add for softfloat compatibility
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file floatunsidf.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file floatunsidf.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file floatunsidf.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.3 18-Mar-2014  riastradh branches: 1.3.4; 1.3.8;
Merge riastradh-drm2 to HEAD.
 1.2 19-Jul-2013  matt branches: 1.2.2;
Don't use the fs* variants, just use the f* ones.
 1.1 18-Jul-2013  matt Add for softfloat compatibility
 1.2.2.2 23-Jul-2013  riastradh sync with HEAD
 1.2.2.1 19-Jul-2013  riastradh file floatunsisf.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.3.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 18-Mar-2014  tls file floatunsisf.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.3.4.2 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.3.4.1 18-Mar-2014  yamt file floatunsisf.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file flt_rounds.c was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file flt_rounds.c was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file fpgetmask.c was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file fpgetmask.c was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file fpgetround.c was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file fpgetround.c was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file fpgetsticky.c was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file fpgetsticky.c was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file fpsetmask.c was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file fpsetmask.c was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file fpsetround.c was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file fpsetround.c was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file fpsetsticky.c was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file fpsetsticky.c was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file ldexp_881.c was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file ldexp_881.c was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add more softfloat compatible functions
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file ledf2.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file ledf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file ledf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add more softfloat compatible functions
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file lesf2.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file lesf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file lesf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add more softfloat compatible functions
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file ltdf2.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file ltdf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file ltdf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add more softfloat compatible functions
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file ltsf2.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file ltsf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file ltsf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.3 18-Mar-2014  riastradh branches: 1.3.4; 1.3.8;
Merge riastradh-drm2 to HEAD.
 1.2 18-Jul-2013  matt Update to compile on coldfire.
 1.1 17-Jul-2013  matt branches: 1.1.2;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.2.1 23-Jul-2013  riastradh sync with HEAD
 1.3.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 18-Mar-2014  tls file modf.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.3.4.2 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.3.4.1 18-Mar-2014  yamt file modf.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file muldf3.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file muldf3.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file mulsf3.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file mulsf3.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add more softfloat compatible functions
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file nedf2.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file nedf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file nedf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add more softfloat compatible functions
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file nesf2.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file nesf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file nesf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file subdf3.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file subdf3.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file subsf3.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file subsf3.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 17-Jul-2013  matt branches: 1.1.6; 1.1.10;
Move the hardfloat stuff to its own directory.
Rewrite fp{get,set}{mask,round,sticky} in C
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 17-Jul-2013  tls file truncdfsf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.1.6.2 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.1.6.1 17-Jul-2013  yamt file truncdfsf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add more softfloat compatible functions
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file unorddf2.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file unorddf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file unorddf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.2 18-Mar-2014  riastradh branches: 1.2.4; 1.2.8;
Merge riastradh-drm2 to HEAD.
 1.1 18-Jul-2013  matt branches: 1.1.2;
Add more softfloat compatible functions
 1.1.2.2 23-Jul-2013  riastradh sync with HEAD
 1.1.2.1 18-Jul-2013  riastradh file unordsf2.S was added on branch riastradh-drm2 on 2013-07-23 21:07:28 +0000
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 18-Mar-2014  tls file unordsf2.S was added on branch tls-maxphys on 2014-08-20 00:02:10 +0000
 1.2.4.2 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.2.4.1 18-Mar-2014  yamt file unordsf2.S was added on branch yamt-pagecache on 2014-05-22 11:36:47 +0000
 1.1 25-Feb-1995  cgd need these now, with new net Makefile.inc
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.7 18-Jul-2013  matt Use stack adjustment in the lnk instruction to adjust the stack.
Saves one word on the following moveml
 1.6 16-Jul-2013  matt branches: 1.6.2;
Add END(func)
 1.5 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.4 28-Apr-2008  martin branches: 1.4.4; 1.4.8; 1.4.28;
Remove clause 3 and 4 from TNF licenses
 1.3 25-Oct-1999  thorpej branches: 1.3.40;
Add register prefixes.
 1.2 30-Jul-1997  jtc branches: 1.2.6;
Fix files using old TNF copyright notice
 1.1 31-May-1996  jtc m68k assembly versions of 64 bit shift functions
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.40.1 18-May-2008  yamt sync with head.
 1.4.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 ashldi3.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.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.6.2.1 23-Jul-2013  riastradh sync with HEAD
 1.8 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.7 18-Jul-2013  matt Use stack adjustment in the lnk instruction to adjust the stack.
Saves one word on the following moveml
 1.6 16-Jul-2013  matt branches: 1.6.2;
Add END(func)
 1.5 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.4 28-Apr-2008  martin branches: 1.4.4; 1.4.8; 1.4.28;
Remove clause 3 and 4 from TNF licenses
 1.3 25-Oct-1999  thorpej branches: 1.3.40;
Add register prefixes.
 1.2 30-Jul-1997  jtc branches: 1.2.6;
Fix files using old TNF copyright notice
 1.1 31-May-1996  jtc m68k assembly versions of 64 bit shift functions
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.40.1 18-May-2008  yamt sync with head.
 1.4.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 ashrdi3.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.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.6.2.1 23-Jul-2013  riastradh sync with HEAD
 1.9 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.8 18-Jul-2013  matt Use stack adjustment in the lnk instruction to adjust the stack.
Saves one word on the following moveml
 1.7 16-Jul-2013  matt branches: 1.7.2;
Add END(func)
 1.6 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.5 28-Apr-2008  martin branches: 1.5.4; 1.5.8; 1.5.28;
Remove clause 3 and 4 from TNF licenses
 1.4 28-Nov-2000  scw branches: 1.4.34;
Add a missing `%' register prefix.
 1.3 25-Oct-1999  thorpej Add register prefixes.
 1.2 30-Jul-1997  jtc branches: 1.2.6;
Fix files using old TNF copyright notice
 1.1 31-May-1996  jtc m68k assembly versions of 64 bit shift functions
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.34.1 18-May-2008  yamt sync with head.
 1.5.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file lshrdi3.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.5.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 23-Jul-2013  riastradh sync with HEAD
 1.2 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 26-Sep-2004  jmmv Add support to build the mac68k port with soft-float enabled (i.e., setting
MKSOFTFLOAT=yes). The main purpose of this feature is to let NetBSD work
in machines with the 68040LC chip (those that have the FPU bug).

All the work has been done by Bruce O'Neel <edoneel AT sdf.lonestar.org>,
with some very minor changes by me; the patches were being posted to the
port-mac68k mailing list. It has been tested for a long time by several
users, including me.

I have just verified that regular releases, as well as soft-float ones,
continue to build.

There have been no objections to this patch since I asked for them in July
in the port-mac68k list.
 1.1 26-Sep-2004  jmmv Add support to build the mac68k port with soft-float enabled (i.e., setting
MKSOFTFLOAT=yes). The main purpose of this feature is to let NetBSD work
in machines with the 68040LC chip (those that have the FPU bug).

All the work has been done by Bruce O'Neel <edoneel AT sdf.lonestar.org>,
with some very minor changes by me; the patches were being posted to the
port-mac68k mailing list. It has been tested for a long time by several
users, including me.

I have just verified that regular releases, as well as soft-float ones,
continue to build.

There have been no objections to this patch since I asked for them in July
in the port-mac68k list.
 1.12 29-Sep-2025  nat Fix return values for softfloat functions to appease gcc.

Not sure if it is gcc and m68k only so it wrapped up in defines.
 1.11 17-Sep-2025  nat Shift the high word of floatx80 accordingly on m68k.

This is because gcc will store floatx80 as signbit(1)exponent(15) padding(32)
as opposed to sign and exponent in a short(16 bit) word.
 1.10 17-Sep-2025  nat Store 80 bit floats properly on m68k.

The libc/softfloat would store the high word as a short, where as gcc
will store it as a long with the sign and 15 bit exponent in the high bytes.

I had to use the __packed attribute as they were stored with an 8-byte
alignment....Why????
 1.9 06-Sep-2025  nat Fix byte ordering for extended longs for softfloat on m68k.

This helps many libc soft float libm tests pass.
 1.8 06-Sep-2025  nat Definition is static for libc soft float but not for libgcc_s.

NFCI
 1.7 01-Sep-2014  matt float32_is_signalling_nan needs a prototype if SOFTFLOATM68K_FOR_GCC is
defined.
 1.6 18-Mar-2014  riastradh branches: 1.6.4;
Merge riastradh-drm2 to HEAD.
 1.5 18-Jul-2013  matt Coldfire doesn't do FLOATX80
 1.4 07-Jul-2011  matt branches: 1.4.2; 1.4.8; 1.4.12;
Don't define a new enum. Just #define round_* to their FP_Rx instead.
 1.3 04-Jul-2011  matt Add __floatunsidf __floatunsisf __floatunsitf routines.
XXX i think they are correct but not sure.
 1.2 16-May-2006  mrg if SOFTFLOAT_FOR_GCC is not defined, don't declare float_detect_tininess.
 1.1 26-Sep-2004  jmmv Add support to build the mac68k port with soft-float enabled (i.e., setting
MKSOFTFLOAT=yes). The main purpose of this feature is to let NetBSD work
in machines with the 68040LC chip (those that have the FPU bug).

All the work has been done by Bruce O'Neel <edoneel AT sdf.lonestar.org>,
with some very minor changes by me; the patches were being posted to the
port-mac68k mailing list. It has been tested for a long time by several
users, including me.

I have just verified that regular releases, as well as soft-float ones,
continue to build.

There have been no objections to this patch since I asked for them in July
in the port-mac68k list.
 1.4.12.1 23-Jul-2013  riastradh sync with HEAD
 1.4.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.2.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.6.4.1 04-Feb-2015  snj Pull up following revision(s) (requested by chs in ticket #487):
lib/libc/arch/m68k/softfloat/softfloat.h: revision 1.7
float32_is_signalling_nan needs a prototype if SOFTFLOATM68K_FOR_GCC is
defined.
 1.7 11-Aug-2009  dsl Change NO_SRCS lines to specify .S in order to exclude the .c file from
SRCS but add it to LSRCS (sort of makes sense!).
 1.6 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.5 22-Mar-2006  drochner build erand48_ieee754.c on everything but vax
 1.4 11-Dec-2000  is Identical on m68k.
 1.3 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.2 16-Jan-2000  kleink (Re-)use the assembly version for labs(), too.
 1.1 05-Nov-1997  cgd branches: 1.1.2;
A foolish consistency... gen, net, and string all get MD sources
specified by including a Makefile.inc from the appropriate MD directory.
stdlib doesn't do that, but there's no reason that it shouldn't (and
it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>A foolish consistency... gen, net, and string all get MD sources
>specified by including a Makefile.inc from the appropriate MD directory.
>stdlib doesn't do that, but there's no reason that it shouldn't (and
>it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.1 05-Nov-1997  veego file Makefile.inc was added on branch netbsd-1-3 on 1997-11-08 21:56:38 +0000
 1.8 16-Jul-2013  matt WEAK_ALIAS is always present
Use END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 11-Dec-2000  is Identical on m68k.
 1.4 25-Oct-1999  thorpej Add register prefixes.
 1.3 25-Apr-1997  thorpej branches: 1.3.6;
Use <machine/asm.h>
 1.2 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2 17-Mar-1994  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.2 11-Dec-2000  is Identical on m68k.
 1.1 16-Jan-2000  kleink (Re-)use the assembly version for labs(), too.
 1.6 16-Jul-2013  matt WEAK_ALIAS is always present
Use END(func)
 1.5 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.4 04-Aug-2008  matt branches: 1.4.2; 1.4.6; 1.4.26;
Add C99 functions imaxabs and imaxdiv.
 1.3 07-Aug-2003  agc branches: 1.3.32;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 29-May-2001  kleink Add missing internal names and weak aliases to assembly versions.
 1.1 06-Mar-2000  kleink branches: 1.1.6;
Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.3.32.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.26.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file llabs.S was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.4.2.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.5 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.4 17-Jul-2009  dsl Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
libc and kernel build ok for affected archs (i386, amd64, vax, sun3,
evbmips-eb) all seem ok.
(vax might lose an asm index() - but comments imply it is worse than the C)
 1.3 05-Feb-2001  scottr Implement a significantly improved version of memccpy(), with thanks to
Ignatios Souvatzis for correcting the SVR4 ABI code and for a few
micro-optimizations that followed from these changes.
 1.2 21-Oct-1995  jtc branches: 1.2.18;
Assembly language implementation of strcat(). Derived by merging existing
strlen() and strcpy() functions.
 1.1 20-Mar-1995  mycroft Separate machine dependencies.
 1.2.18.1 26-Feb-2001  he Pull up revision 1.3 (requested by scottr):
Implement a significantly improved version of memccpy().
 1.14 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 17-May-2001  fredette On the 68010, we are forced to do bytewise compares
and copies if the two addresses aren't of the same
evenness.
 1.11 25-Oct-1999  thorpej branches: 1.11.8;
Add register prefixes.
 1.10 15-May-1997  jtc branches: 1.10.6;
Fix typo
 1.9 13-May-1997  jtc Change b{eq,ne,lt,le,gt,ge} -> j{eq,ne,lt,le,gt,ge}.
 1.8 13-May-1997  jtc Faster versions of bcmp(), bcopy(), bzero(), and memset().

The implementation of these functions is losely based on the original
BSD code plus versions I was working on which would yeild code tuned
for a particular m68k or coldfire family cpu, code space or run time
efficiency, etc. depending on the values of various macros.

My original code was intended for use in OS-less embedded systems.
Because NetBSD can not benefit from the considerable complexity, I've
removed the extraneous preprocessor goop. The resulting code is tuned
for the '020 - '060. It will not function on the '000 or coldfire.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.5 30-Nov-1996  jtc Add L prefix to local labels
 1.4 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.3 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.2 08-Feb-1995  mycroft Make the coding style more consistent.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.10.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.18 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.17 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.16 17-May-2001  fredette On the 68010, we are forced to do bytewise compares
and copies if the two addresses aren't of the same
evenness.
 1.15 25-Oct-1999  thorpej branches: 1.15.8;
Add register prefixes.
 1.14 02-May-1999  kleink branches: 1.14.2;
When using the SVR4 ABI, return pointer results in a0, too.
 1.13 15-May-1997  jtc Fixup reverse bcopy
 1.12 13-May-1997  jtc Change b{eq,ne,lt,le,gt,ge} -> j{eq,ne,lt,le,gt,ge}.
 1.11 13-May-1997  jtc Faster versions of bcmp(), bcopy(), bzero(), and memset().

The implementation of these functions is losely based on the original
BSD code plus versions I was working on which would yeild code tuned
for a particular m68k or coldfire family cpu, code space or run time
efficiency, etc. depending on the values of various macros.

My original code was intended for use in OS-less embedded systems.
Because NetBSD can not benefit from the considerable complexity, I've
removed the extraneous preprocessor goop. The resulting code is tuned
for the '020 - '060. It will not function on the '000 or coldfire.
 1.10 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.9 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.8 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.7 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.6 29-Jun-1995  jtc remove single quote from comment
 1.5 08-Feb-1995  mycroft Make the coding style more consistent.
 1.4 08-Feb-1995  mycroft size_t is unsigned.
 1.3 07-Dec-1993  mycroft Fix typo.
 1.2 06-Dec-1993  mycroft Add code for memcpy() and memmove().
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.14.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.12 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.9 13-May-1997  jtc branches: 1.9.6;
Change b{eq,ne,lt,le,gt,ge} -> j{eq,ne,lt,le,gt,ge}.
 1.8 13-May-1997  jtc Faster versions of bcmp(), bcopy(), bzero(), and memset().

The implementation of these functions is losely based on the original
BSD code plus versions I was working on which would yeild code tuned
for a particular m68k or coldfire family cpu, code space or run time
efficiency, etc. depending on the values of various macros.

My original code was intended for use in OS-less embedded systems.
Because NetBSD can not benefit from the considerable complexity, I've
removed the extraneous preprocessor goop. The resulting code is tuned
for the '020 - '060. It will not function on the '000 or coldfire.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.5 30-Nov-1996  jtc Add L prefix to local labels
 1.4 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.3 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.2 08-Feb-1995  mycroft Make the coding style more consistent.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.10 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.9 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.8 17-May-2001  fredette On the 68010 only, assemble a different version of
this function, since the 68010 doesn't have bit
instructions.
 1.7 25-Oct-1999  thorpej branches: 1.7.8;
Add register prefixes.
 1.6 04-Jan-1997  jtc branches: 1.6.6;
#include <machine/asm.h> instead of "DEFS.h"
 1.5 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.4 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.3 09-Sep-1994  mycroft Use bfffo rather than a slow loop.
 1.2 30-Nov-1993  paulus Changed beq's to jeq's, because (a) the jeq gets optimized to a short branch,
and (b) gas currently assembles the beq's wrongly.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.6.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.3 04-Dec-1993  mycroft Clean up deleted files.
 1.2 30-Nov-1993  paulus Changed beq's to jeq's, because (a) the jeq gets optimized to a short branch,
and (b) gas currently assembles the beq's wrongly.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.11 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.10 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.9 25-Oct-1999  thorpej Add register prefixes.
 1.8 02-May-1999  kleink branches: 1.8.2;
When using the SVR4 ABI, return pointer results in a0, too.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.5 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.4 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.3 08-Feb-1995  mycroft Make the coding style more consistent.
 1.2 08-Dec-1993  mycroft No reason these can't share code...
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.5 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.4 18-Jul-2013  matt Adjust for coldfire
 1.3 16-Jul-2013  matt branches: 1.3.2;
Add END(func)
 1.2 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.1 05-Feb-2001  scottr branches: 1.1.2; 1.1.62; 1.1.68;
Implement a significantly improved version of memccpy(), with thanks to
Ignatios Souvatzis for correcting the SVR4 ABI code and for a few
micro-optimizations that followed from these changes.

The overall improvement was measured at 3-4x for copies of at least
4 bytes on the 68030, and 8 bytes on the 68040. For smaller copies
the improvement was still measurable, if not as dramatic.
 1.1.68.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.62.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.1.2.2 26-Feb-2001  he Pull up revision 1.1 (new, requested by scottr):
Implement a significantly improved version of memccpy().
 1.1.2.1 05-Feb-2001  he file memccpy.S was added on branch netbsd-1-5 on 2001-02-26 16:32:19 +0000
 1.3.2.1 23-Jul-2013  riastradh sync with HEAD
 1.12 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 25-Oct-1999  thorpej Add register prefixes.
 1.9 13-May-1997  jtc branches: 1.9.6;
Change b{eq,ne,lt,le,gt,ge} -> j{eq,ne,lt,le,gt,ge}.
 1.8 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.7 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.6 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.5 08-Feb-1995  mycroft Make the coding style more consistent.
 1.4 06-Dec-1993  mycroft Fix a couple of nits.
 1.3 06-Dec-1993  mycroft More assembler code.
 1.2 06-Dec-1993  mycroft Fudged an addressing mode.
 1.1 06-Dec-1993  mycroft Initially cloned from bcmp.S.
 1.9.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 09-Jan-1998  perry RCS Id Police.
 1.2 07-Dec-1993  mycroft Fix typo.
 1.1 06-Dec-1993  mycroft #define the appropriate symbol and #include bcopy.S.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 09-Jan-1998  perry RCS Id Police.
 1.2 07-Dec-1993  mycroft Fix typo.
 1.1 06-Dec-1993  mycroft #define the appropriate symbol and #include bcopy.S.
 1.15 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.14 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.13 07-Sep-2001  fredette On the 68010, don't bother with the by-8-longwords loop, instead
only 16-bit align the region and use loop mode with longwords
to do the bulk of the work.

On the 68020+, fixed an optimization bug where all regions that start
on odd addresses would not be properly longword aligned.
 1.12 25-Oct-1999  thorpej branches: 1.12.8;
Add register prefixes.
 1.11 02-May-1999  kleink branches: 1.11.2;
When using the SVR4 ABI, return pointer results in a0, too.
 1.10 14-May-1997  jtc oops, bzero -> memset
 1.9 13-May-1997  jtc Change b{eq,ne,lt,le,gt,ge} -> j{eq,ne,lt,le,gt,ge}.
 1.8 13-May-1997  jtc Faster versions of bcmp(), bcopy(), bzero(), and memset().

The implementation of these functions is losely based on the original
BSD code plus versions I was working on which would yeild code tuned
for a particular m68k or coldfire family cpu, code space or run time
efficiency, etc. depending on the values of various macros.

My original code was intended for use in OS-less embedded systems.
Because NetBSD can not benefit from the considerable complexity, I've
removed the extraneous preprocessor goop. The resulting code is tuned
for the '020 - '060. It will not function on the '000 or coldfire.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.5 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.4 08-Feb-1995  mycroft Make the coding style more consistent.
 1.3 07-Dec-1993  mycroft Fix a bug, and speed up by a few cycles.
 1.2 06-Dec-1993  mycroft Fix a couple of nits.
 1.1 06-Dec-1993  mycroft More assembler code.
 1.11.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.11 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.10 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.9 25-Oct-1999  thorpej Add register prefixes.
 1.8 02-May-1999  kleink branches: 1.8.2;
When using the SVR4 ABI, return pointer results in a0, too.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.5 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.4 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.3 08-Feb-1995  mycroft Make the coding style more consistent.
 1.2 08-Dec-1993  mycroft No reason these can't share code...
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.11 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.10 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.9 25-Oct-1999  thorpej Add register prefixes.
 1.8 02-May-1999  kleink branches: 1.8.2;
When using the SVR4 ABI, return pointer results in a0, too.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.5 03-Jan-1997  jtc Add L prefix on local labels
 1.4 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.3 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.2 17-Nov-1995  jtc fix stupid typo
 1.1 21-Oct-1995  jtc Assembly language implementation of strcat(). Derived by merging existing
strlen() and strcpy() functions.
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 09-Jan-1998  perry RCS Id Police.
 1.1 08-Dec-1993  mycroft No reason these can't share code...
 1.18 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.17 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.16 17-May-2001  fredette Use the EXTBL macro where we want the extbl instruction.
On the 68010 this expands to an extw/extl combination.
 1.15 28-Nov-2000  is branches: 1.15.2;
Another change by Hiroshi Horimoto.
 1.14 27-Oct-1999  is Fix spelling of contributors name
 1.13 25-Oct-1999  thorpej Add register prefixes.
 1.12 24-Jul-1997  jtc branches: 1.12.6;
Revert last change, some folks have reported problems
 1.11 21-Jul-1997  jtc Use insn sequence found by superoptimizer to compute return value. This
avoids the relatively expensive scc and ext instructions.
 1.10 18-May-1997  jtc I removed the extra instructions which compute the return value in Hiroshi
Horitomo's implementation a bit too hastily. They are required to handle
the unsigned comparison required by the standard.
 1.9 18-May-1997  jtc New implementations of strcmp() and strncmp().

This code uses subb instead of cmpb to compare chars. When they are
not equal, the function's return value is computed by sign extending
the difference. The basic idea was contributed by Hiroshi Horitomo
<horimoto@cs-aoi.cs.sist.ac.jp> in PR #3223, but his implementation
used additional instructions to compute the return value.

Also, the series of insns used to compare one pair of characters has
been unrolled 4 times. This helps the 680[23]0, where the cost of a
taken branch is significantly more than that of a not-taken branch.
 1.8 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.7 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.6 03-Jan-1997  jtc Add L prefix on local labels
 1.5 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.4 28-Nov-1995  thorpej Fix a typo.
 1.3 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.2 08-Feb-1995  mycroft Make the coding style more consistent.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.12.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.11 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.10 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.9 25-Oct-1999  thorpej Add register prefixes.
 1.8 02-May-1999  kleink branches: 1.8.2;
When using the SVR4 ABI, return pointer results in a0, too.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.5 03-Jan-1997  jtc Add L prefix on local labels
 1.4 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.3 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.2 08-Feb-1995  mycroft Make the coding style more consistent.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.11 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.10 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.9 25-Oct-1999  thorpej Add register prefixes.
 1.8 04-Jan-1997  jtc branches: 1.8.6;
#include <machine/asm.h> instead of "DEFS.h"
 1.7 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.6 03-Jan-1997  jtc Add L prefix on local labels
 1.5 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.4 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.3 21-Oct-1995  jtc Rewrite to remove instruction in inside of loop. Instead of maintaining a
count, subtract the start address from the end address.
 1.2 08-Feb-1995  mycroft Make the coding style more consistent.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.8.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.16 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.15 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.14 17-May-2001  fredette Use the EXTBL macro where we want the extbl instruction.
On the 68010 this expands to an extw/extl combination.
 1.13 27-Oct-1999  is branches: 1.13.8;
Fix spelling of contributors name
 1.12 25-Oct-1999  thorpej Add register prefixes.
 1.11 24-Jul-1997  jtc branches: 1.11.6;
Revert last change, some folks have reported problems
 1.10 21-Jul-1997  jtc Use insn sequence found by superoptimizer to compute return value. This
avoids the relatively expensive scc and ext instructions.
 1.9 18-May-1997  jtc I removed the extra instructions which compute the return value in Hiroshi
Horitomo's implementation a bit too hastily. They are required to handle
the unsigned comparison required by the standard.
 1.8 18-May-1997  jtc New implementations of strcmp() and strncmp().

This code uses subb instead of cmpb to compare chars. When they are
not equal, the function's return value is computed by sign extending
the difference. The basic idea was contributed by Hiroshi Horitomo
<horimoto@cs-aoi.cs.sist.ac.jp> in PR #3223, but his implementation
used additional instructions to compute the return value.

Also, the series of insns used to compare one pair of characters has
been unrolled 4 times. This helps the 680[23]0, where the cost of a
taken branch is significantly more than that of a not-taken branch.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.5 03-Jan-1997  jtc Add L prefix on local labels
 1.4 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.3 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.2 08-Feb-1995  mycroft Make the coding style more consistent.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.11.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.13.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.13 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.12 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.11 27-Nov-2000  is Use dbeq loops, code submitted by Hiroshi Horimoto in PR 3223, integrated
and tested by Allen Briggs.
Needs 1/3 less time on 68030, 45% less time on 68040.
XXX On 68060, 1/2 less time for the padding part, but 40% more time on the
copy part. I've stared at the 68060 User Manual, but can't understand why;
must be some wierd (branch) cache interaction.
 1.10 25-Oct-1999  thorpej Add register prefixes.
 1.9 02-May-1999  kleink branches: 1.9.2;
When using the SVR4 ABI, return pointer results in a0, too.
 1.8 13-May-1997  jtc Change b{eq,ne,lt,le,gt,ge} -> j{eq,ne,lt,le,gt,ge}.
 1.7 04-Jan-1997  jtc #include <machine/asm.h> instead of "DEFS.h"
 1.6 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.5 03-Jan-1997  jtc Add L prefix on local labels
 1.4 28-Nov-1995  thorpej Fix a brain-o by me; if I'm going to use stuff in <machine/asm.h>, I better
darn well include it in the right place. "Hello, McFly!"
 1.3 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.2 08-Feb-1995  mycroft Make the coding style more consistent.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.9.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300)
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 09-Jan-1998  perry RCS Id Police.
 1.1 08-Dec-1993  mycroft No reason these can't share code...
 1.11 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.10 18-Jul-2013  matt Adjust for coldfire
 1.9 16-Jul-2013  matt branches: 1.9.2;
Add END(func)
 1.8 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.7 25-Oct-1999  thorpej branches: 1.7.66; 1.7.72;
Add register prefixes.
 1.6 04-Jan-1997  jtc branches: 1.6.6;
#include <machine/asm.h> instead of "DEFS.h"
 1.5 04-Jan-1997  jtc Use jCC instead of bCC, as the assembler will then use the (smaller,
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
 1.4 17-Nov-1995  thorpej New style RCS ids, and employ the RCSID() macro.
 1.3 08-Feb-1995  mycroft Make the coding style more consistent.
 1.2 07-Jan-1995  mycroft Need to divide count by 2.
 1.1 06-Dec-1993  mycroft Assembler version.
 1.6.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.72.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.66.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.9.2.1 23-Jul-2013  riastradh sync with HEAD
 1.14 09-Mar-2006  christos Welcome to the new compat layout.
 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 07-Dec-2000  scw Use A1 to save the return address, since A0 is no longer preserved across
system calls.
 1.11 25-Oct-1999  thorpej Add register prefixes.
 1.10 18-Oct-1999  itohy ELF PIC support.
 1.9 02-May-1999  kleink branches: 1.9.2;
We can shave off a register-register move when using the SVR4 ABI: __errno()
will return its pointer result in a0.
 1.8 02-Dec-1998  thorpej Warn about references to the compatibility vfork() (i.e. the vfork() with
the 4.4BSD non-shared-address-space semantics), and direct the user to
include <unistd.h> to generate the correct reference.

This warning isn't about an ABI compatibility issue, but the new vfork() is
considerably faster.
 1.7 06-Oct-1998  kleink Add *__errno() redirection for _REENTRANT code. Also, some movel vs. movl
consistency.
 1.6 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 1.5 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.4 27-Jan-1994  mycroft Trivial speedup inspired by SPARC code.
 1.3 27-Jan-1994  mycroft Random cleanup.
 1.2 04-Dec-1993  briggs Ovfork doesn't get .even any other way, so we must explicitly give it
one.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.9.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.5 16-Jul-2013  matt Use SYSTRAP.
Don't use the PLT to call CERROR
Use LEA_LCL / GOT_SETUP
Remove non-__ELF__ code.
Make __minbrk and __curbrk hidden and avoid using the GOT for them.
Convert to motorola syntax.
 1.4 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8; 1.3.28;
Remove clause 3 and 4 from TNF licenses
 1.2 20-Jul-2001  scw branches: 1.2.2; 1.2.34;
Compensate for the syscall args stack cleanup in the clone.
(Pointed out by Matthias Pfaller)
 1.1 19-Jul-2001  scw clone(2) syscall frontend for m68k.
 1.2.34.1 18-May-2008  yamt sync with head.
 1.2.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.2.2.1 20-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:17:47 +0000
 1.3.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 __clone.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.3.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.2 16-Jul-2013  matt Add END(func)
 1.1 22-Nov-2011  joerg branches: 1.1.4; 1.1.8;
Add TLS support for m68k.
 1.1.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.4.3 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.1.4.2 17-Apr-2012  yamt sync with head
 1.1.4.1 22-Nov-2011  yamt file __m68k_read_tp.S was added on branch yamt-pagecache on 2012-04-17 00:05:13 +0000
 1.3 16-Jul-2013  matt Add END(func)
 1.2 28-Apr-2008  martin branches: 1.2.4; 1.2.8; 1.2.28;
Remove clause 3 and 4 from TNF licenses
 1.1 31-Dec-2007  martin branches: 1.1.2; 1.1.6;
Add missing stubs for syscalls returning addresses.
We can now run on a kernel that does not copy the syscall return value
to register A0.
As discussed in PR port-m68k/37631.
 1.1.6.1 18-May-2008  yamt sync with head.
 1.1.2.2 09-Jan-2008  matt sync with HEAD
 1.1.2.1 31-Dec-2007  matt file __mmap.S was added on branch matt-armv6 on 2008-01-09 01:33:57 +0000
 1.2.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 __mmap.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2.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.2 09-Mar-2006  christos Welcome to the new compat layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.10 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.9 28-Apr-2008  martin branches: 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 18-May-2006  christos branches: 1.8.18;
change __weak_extern to __weak_reference so that gcc4 works.
 1.7 19-Feb-2006  christos make these consistent.
 1.6 12-Jun-2005  lukem Add missing __RCSID()
 1.5 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.4 18-Oct-2003  christos Userland portion of SIGTRAMP_VALID() commit.
 1.3 22-Sep-2003  cl SA_SIGINFO support for m68k (libc)
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:27:57 +0000
 1.8.18.1 18-May-2008  yamt sync with head.
 1.9.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.10 09-Mar-2006  christos Welcome to the new compat layout.
 1.9 26-Mar-2004  drochner no need to define __HAVE_SIGINFO anymore
 1.8 22-Sep-2003  cl SA_SIGINFO support for m68k (libc)
 1.7 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.6 30-May-2002  thorpej Make this work with an ISO C preprocessor.
 1.5 22-Jan-2002  aymeric Redefine ENTRY properly for both ELF and a.out
Now we can compile profiled m68k programs that use libc.
 1.4 25-Oct-1999  thorpej branches: 1.4.8;
Add register prefixes.
 1.3 02-May-1999  kleink branches: 1.3.2;
Call cerror through the PLT.
 1.2 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.1 05-Oct-1998  thorpej Update for signal changes.
 1.3.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.8.2 21-Jun-2002  nathanw Catch up to -current.
 1.4.8.1 28-Jan-2002  nathanw Catch up to -current.
 1.4 09-Mar-2006  christos Welcome to the new compat layout.
 1.3 26-Mar-2004  drochner no need to define __HAVE_SIGINFO anymore
 1.2 22-Sep-2003  cl SA_SIGINFO support for m68k (libc)
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:27:57 +0000
 1.5 21-Nov-2021  thorpej Decorate the m68k signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.4 16-Jul-2013  matt Add END(func)
Use SYSTRAP
 1.3 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.2 02-May-2008  martin branches: 1.2.4; 1.2.8; 1.2.28;
Fix nested comment and move to 2 clause license
 1.1 22-Sep-2003  cl branches: 1.1.30;
SA_SIGINFO support for m68k (libc)
 1.1.30.1 18-May-2008  yamt sync with head.
 1.2.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.2 02-May-2008  martin Fix nested comment and move to 2 clause license
 1.2.8.1 02-May-2008  martin file __sigtramp2.S was added on branch christos-time_t on 2008-05-02 18:34:18 +0000
 1.2.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.1 13-Dec-2000  scw The bare minimum to get m68k libc working again...
 1.12 12-Sep-2013  joerg 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.11 16-Jul-2013  matt Use SYSTRAP.
Don't use the PLT to call CERROR
Use LEA_LCL / GOT_SETUP
Remove non-__ELF__ code.
Make __minbrk and __curbrk hidden and avoid using the GOT for them.
Convert to motorola syntax.
 1.10 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.9 07-Aug-2003  agc branches: 1.9.56; 1.9.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 07-Dec-2000  scw The last change broke things if SYS___vfork14 returned an error; fix it.
 1.7 02-Dec-2000  scw Save the return address in %a1 across the vfork syscall instead of %a0.
 1.6 25-Oct-1999  thorpej Add register prefixes.
 1.5 18-Oct-1999  itohy ELF PIC support.
 1.4 02-May-1999  kleink branches: 1.4.2;
We can shave off a register-register move when using the SVR4 ABI: __errno()
will return its pointer result in a0.
 1.3 06-Oct-1998  kleink Add *__errno() redirection for _REENTRANT code. Also, some movel vs. movl
consistency.
 1.2 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 1.1 04-Jan-1998  thorpej Add syscall stubs for __vfork14(). These are basically copies of Ovfork.S
with the syscall numbers changed.

Since 4.4BSD vfork(2) did not share address space, Ovfork.S could be changed
to be identical to fork.S (modulo syscall numbers). __vfork14.S, however,
needs to remain separate since with a shared address space, the stub needs to
pre-decrement the stack and do an indirect jump to the return address, so that
the shared stackframe is still there when the parent returns. (Obviously,
this does not apply to systems which to not build stackframes on leaf calls.)
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.56.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.3 16-Jul-2013  matt Add END(func)
Use SYSTRAP
 1.2 28-Apr-2008  martin branches: 1.2.4; 1.2.8; 1.2.28;
Remove clause 3 and 4 from TNF licenses
 1.1 31-Dec-2007  martin branches: 1.1.2; 1.1.6;
Add missing stubs for syscalls returning addresses.
We can now run on a kernel that does not copy the syscall return value
to register A0.
As discussed in PR port-m68k/37631.
 1.1.6.1 18-May-2008  yamt sync with head.
 1.1.2.2 09-Jan-2008  matt sync with HEAD
 1.1.2.1 31-Dec-2007  matt file _lwp_getprivate.S was added on branch matt-armv6 on 2008-01-09 01:33:58 +0000
 1.2.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 _lwp_getprivate.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2.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.19 12-Sep-2013  joerg 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.18 24-Jul-2013  matt Only jump to CERROR if carry is set, not clear.
 1.17 16-Jul-2013  matt Use SYSTRAP.
Don't use the PLT to call CERROR
Use LEA_LCL / GOT_SETUP
Remove non-__ELF__ code.
Make __minbrk and __curbrk hidden and avoid using the GOT for them.
Convert to motorola syntax.
 1.16 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.15 26-Dec-2003  martin branches: 1.15.56; 1.15.62;
Use an unsigned comparison against minbrk.
From OpenBSD, changed by Miod Vallat.
 1.14 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.13 05-May-2001  kleink Shameless hack to reference end when using a.out and _end when using ELF.
 1.12 26-Jun-2000  kleink branches: 1.12.2;
Thinko in previous: we do always use an internal name.
 1.11 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.10 25-Oct-1999  thorpej branches: 1.10.6;
Add register prefixes.
 1.9 18-Oct-1999  itohy ELF PIC support.
 1.8 02-May-1999  kleink branches: 1.8.2;
Call cerror through the PLT.
 1.7 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 1.5 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.4 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.3 27-Jan-1994  mycroft branches: 1.3.2;
Separate curbrk and mincrk.
 1.2 27-Jan-1994  mycroft Random cleanup.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.3.2.1 05-Aug-1994  mycroft update from trunk
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.6.1 22-Aug-2000  kleink Pull up revs. 1.11-1.12 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.12.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.15.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.18 12-Sep-2013  joerg 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.17 16-Jul-2013  matt Use SYSTRAP.
Don't use the PLT to call CERROR
Use LEA_LCL / GOT_SETUP
Remove non-__ELF__ code.
Make __minbrk and __curbrk hidden and avoid using the GOT for them.
Convert to motorola syntax.
 1.16 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.15 03-Oct-2009  phx branches: 1.15.6; 1.15.12;
SystemV-R4 ABI for M68k returns pointers in %a0, so we have to make sure
that CERROR returns -1 in %a0 in addition to %d0 and %d1, to make functions
like mmap(2), mremap(2), shmat(2) or sbrk(2) return -1 in case of an error.
A side effect of this bug was a segfault caused by jemalloc, when mmap()
failed.
 1.14 07-Aug-2003  agc branches: 1.14.38; 1.14.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.13 25-Oct-1999  thorpej Add register prefixes.
 1.12 18-Oct-1999  itohy ELF PIC support.
 1.11 02-May-1999  kleink branches: 1.11.2;
We can shave off a register-register move when using the SVR4 ABI: __errno()
will return its pointer result in a0.
 1.10 29-Apr-1999  kleink Declare cerror using _ENTRY() to get, among other things, a .type statement.
 1.9 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.8 06-Oct-1998  kleink Declare one of {__errno,errno}, depending on _REENTRANT.
 1.7 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 1.6 07-Nov-1996  jtc Change __REENTRANT to _REENTRANT, the latter is used Solaris and I can
think of no good reason to be different.
 1.5 07-Nov-1996  jtc Changed so that when __REENTRANT is defined, cerror calls __errno()
for the address of a variable used to store the error number instead
of writing to the global errno.

In a multi-threaded program, __errno() will return a pointer to a
thread-specific variable.
 1.4 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.3 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.2 02-Apr-1994  cgd branches: 1.2.2;
have cerror DTRT on returns, w.r.t. quads and -1. it needs to be done
here (think of syscall(SYS_lseek,...)). also, kill bogus lseek thang.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.2.2.1 05-Aug-1994  mycroft update from trunk
 1.11.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.14.46.1 21-Apr-2010  matt sync to netbsd-5
 1.14.38.1 10-Oct-2009  sborrill Pull up the following revisions(s) (requested by phx in ticket #1085):
lib/libc/arch/m68k/sys/cerror.S: revision 1.15

Ensure functions like mmap(2), mremap(2), shmat(2) or sbrk(2) return -1 in
case of an error. A side benefit of this is to fix a segfault caused by
jemalloc when mmap() failed.
 1.15.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.6.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.9 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.8 16-Jul-2013  matt branches: 1.8.10; 1.8.14;
Use SYSTRAP
Use a branch for CERROR (avoid the PLT)
 1.7 07-Aug-2003  agc branches: 1.7.56; 1.7.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 25-Oct-1999  thorpej Add register prefixes.
 1.5 02-May-1999  kleink branches: 1.5.2;
Call cerror through the PLT.
 1.4 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.3 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.2 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.1 25-Nov-1993  paulus branches: 1.1.2;
Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.1.2.1 05-Aug-1994  mycroft update from trunk
 1.5.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.56.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.8.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.8.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.8 16-Jul-2013  matt Add END(func)
 1.7 07-Aug-2003  agc branches: 1.7.56; 1.7.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.5 26-Jun-2000  kleink Need an internal name for fork().
 1.4 25-Oct-1999  thorpej branches: 1.4.6;
Add register prefixes.
 1.3 13-Dec-1995  thorpej branches: 1.3.12;
New-style RCS ids. Use the RCSID() macro where appropriate.
 1.2 27-Jan-1994  mycroft Trivial speedup inspired by SPARC code.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.3.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.6.1 22-Aug-2000  kleink Pull up rev. 1.5 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.7.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.6 17-Jul-2013  matt Use assym.h
 1.5 16-Jul-2013  matt Add END(func)
 1.4 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8; 1.3.28;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 10-Nov-2001  scw branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 10-Nov-2001  scw Userland mcontext glue for Scheduler Activations on m68k.
From Klaus Klein <kleink@netbsd.org>.
 1.2.30.1 18-May-2008  yamt sync with head.
 1.3.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.3.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.2 02-Apr-1994  mycroft Clean up deleted files.
 1.1 31-Mar-1994  mycroft Set d1 to -1 before cerror.
 1.3 16-Jul-2013  matt Add END(func)
 1.2 28-Apr-2008  martin branches: 1.2.4; 1.2.8; 1.2.28;
Remove clause 3 and 4 from TNF licenses
 1.1 31-Dec-2007  martin branches: 1.1.2; 1.1.6;
Add missing stubs for syscalls returning addresses.
We can now run on a kernel that does not copy the syscall return value
to register A0.
As discussed in PR port-m68k/37631.
 1.1.6.1 18-May-2008  yamt sync with head.
 1.1.2.2 09-Jan-2008  matt sync with HEAD
 1.1.2.1 31-Dec-2007  matt file mremap.S was added on branch matt-armv6 on 2008-01-09 01:33:59 +0000
 1.2.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 mremap.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2.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.2 09-Mar-2006  christos Welcome to the new compat layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.8 16-Jul-2013  matt Add END(func)
 1.7 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.6 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 02-Oct-2000  kleink Whitespace botch in previous, noticed by Leo Weppelman and Thorsten Frueauf.
 1.4 28-Sep-2000  kleink Need an internal name for pipe(2).
 1.3 25-Oct-1999  thorpej branches: 1.3.6;
Add register prefixes.
 1.2 13-Dec-1995  thorpej branches: 1.2.12;
New-style RCS ids. Use the RCSID() macro where appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.2.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.6.2 03-Oct-2000  kleink Pull up rev. 1.5 (approved by thorpej):
Fix whitespace botch in previous.
 1.3.6.1 29-Sep-2000  kleink Pull up rev. 1.4 (approved by thorpej):
Add internal name for pipe().
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.15 12-Sep-2013  joerg 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 24-Jul-2013  matt Only jump to CERROR if carry is set, not clear.
 1.13 16-Jul-2013  matt Use SYSTRAP.
Don't use the PLT to call CERROR
Use LEA_LCL / GOT_SETUP
Remove non-__ELF__ code.
Make __minbrk and __curbrk hidden and avoid using the GOT for them.
Convert to motorola syntax.
 1.12 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.11 07-Aug-2003  agc branches: 1.11.56; 1.11.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 25-Oct-1999  thorpej Add register prefixes.
 1.9 18-Oct-1999  itohy ELF PIC support.
 1.8 02-May-1999  kleink branches: 1.8.2;
Call cerror through the PLT.
 1.7 02-May-1999  kleink We can shave off a register-register move when using the SVR4 ABI: __errno()
will return its pointer result in a0.
 1.6 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.5 06-Oct-1998  kleink Add *__errno() redirection for _REENTRANT code. Also, some movel vs. movl
consistency.
 1.4 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 1.3 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.2 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.1 25-Nov-1993  paulus branches: 1.1.2;
Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.1.2.1 05-Aug-1994  mycroft update from trunk
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.3 11-Nov-1996  mycroft Treat reboot() like a normal system call. From PR 2458.
 1.2 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.17 24-Jul-2013  matt Only jump to CERROR if carry is set, not clear.
 1.16 16-Jul-2013  matt Use SYSTRAP.
Don't use the PLT to call CERROR
Use LEA_LCL / GOT_SETUP
Remove non-__ELF__ code.
Make __minbrk and __curbrk hidden and avoid using the GOT for them.
Convert to motorola syntax.
 1.15 16-Jul-2013  matt Convert to normal Motorola syntax for addressing.
%r@ -> (%r)
%r@- -> -(%r)
%r@+ -> (%r)+
%r@(n) n(%r)
etc.
No object differences.
 1.14 07-Aug-2003  agc branches: 1.14.56; 1.14.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.13 05-May-2001  kleink Shameless hack to reference end when using a.out and _end when using ELF.
 1.12 26-Jun-2000  kleink branches: 1.12.2;
Thinko in previous: we do always use an internal name.
 1.11 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.10 25-Oct-1999  thorpej branches: 1.10.6;
Add register prefixes.
 1.9 18-Oct-1999  itohy ELF PIC support.
 1.8 02-May-1999  kleink branches: 1.8.2;
Call cerror through the PLT.
 1.7 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 01-Jul-1998  thorpej Use _C_LABEL() to generate C labels.
 1.5 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.4 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.3 27-Jan-1994  mycroft branches: 1.3.2;
Separate curbrk and mincrk.
 1.2 27-Jan-1994  mycroft Random cleanup.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.3.2.1 05-Aug-1994  mycroft update from trunk
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.6.1 22-Aug-2000  kleink Pull up revs. 1.11-1.12 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.12.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.14.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.56.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.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 25-Oct-1999  thorpej branches: 1.7.8;
Add register prefixes.
 1.6 18-Oct-1999  itohy ELF PIC support.
 1.5 01-Jul-1998  thorpej branches: 1.5.4;
Use _C_LABEL() to generate C labels.
 1.4 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.3 27-Jan-1994  mycroft Random cleanup.
 1.2 18-Dec-1993  jtc Fix bug #24 by renaming _logname_valid to __logname_valid.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.5.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.8.1 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.3 16-Jul-2013  matt Add END(func)
 1.2 28-Apr-2008  martin branches: 1.2.4; 1.2.8; 1.2.28;
Remove clause 3 and 4 from TNF licenses
 1.1 07-Jul-2000  itohy branches: 1.1.34;
Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.1.34.1 18-May-2008  yamt sync with head.
 1.2.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 shmat.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2.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.2 09-Mar-2006  christos Welcome to the new compat layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.3 09-Mar-2006  christos Welcome to the new compat layout.
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.1 05-Oct-1998  thorpej Update for signal changes.
 1.7 09-Mar-2006  christos Welcome to the new compat layout.
 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 25-Oct-1999  thorpej Add register prefixes.
 1.4 02-Dec-1998  thorpej branches: 1.4.4;
Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 05-Oct-1998  thorpej Update for signal changes.
 1.2 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.4.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.11 09-Mar-2006  christos Welcome to the new compat layout.
 1.10 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.9 25-Oct-1999  thorpej Add register prefixes.
 1.8 02-May-1999  kleink branches: 1.8.2;
Call cerror through the PLT.
 1.7 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.5 05-Oct-1998  thorpej Update for signal changes.
 1.4 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.3 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.2 27-Jan-1994  mycroft branches: 1.2.2;
Random cleanup.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.2.2.1 05-Aug-1994  mycroft update from trunk
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.14 09-Mar-2006  christos Welcome to the new compat layout.
 1.13 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 1.12 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.11 30-May-2002  thorpej Make this work with an ISO C preprocessor.
 1.10 22-Jan-2002  aymeric Redefine ENTRY properly for both ELF and a.out
Now we can compile profiled m68k programs that use libc.
 1.9 28-Nov-2000  scw branches: 1.9.2;
Add missing register prefixes.
 1.8 02-May-1999  kleink Call cerror through the PLT.
 1.7 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.5 05-Oct-1998  thorpej Update for signal changes.
 1.4 30-Nov-1996  jtc PROF -> GPROF
 1.3 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.2 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.1 25-Nov-1993  paulus branches: 1.1.2;
Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.1.2.1 05-Aug-1994  mycroft update from trunk
 1.9.2.2 21-Jun-2002  nathanw Catch up to -current.
 1.9.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.11 09-Mar-2006  christos Welcome to the new compat layout.
 1.10 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.9 25-Oct-1999  thorpej Add register prefixes.
 1.8 02-May-1999  kleink branches: 1.8.2;
Call cerror through the PLT.
 1.7 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.5 05-Oct-1998  thorpej Update for signal changes.
 1.4 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.3 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.2 27-Jan-1994  mycroft branches: 1.2.2;
Random cleanup.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.2.2.1 05-Aug-1994  mycroft update from trunk
 1.8.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.10 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.9 24-Jul-2013  matt branches: 1.9.26;
Only jump to CERROR if carry is set, not clear.
 1.8 16-Jul-2013  matt Use SYSTRAP
Use a branch for CERROR (avoid the PLT)
 1.7 07-Aug-2003  agc branches: 1.7.56; 1.7.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 25-Oct-1999  thorpej Add register prefixes.
 1.5 02-May-1999  kleink branches: 1.5.2;
Call cerror through the PLT.
 1.4 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.3 13-Dec-1995  thorpej New-style RCS ids. Use the RCSID() macro where appropriate.
 1.2 04-Aug-1994  chopps fixed ld.so to properly save all regs when binding PIC functions. We no
longer need the special case (PIC) code to push args when calling cerror.
 1.1 25-Nov-1993  paulus branches: 1.1.2;
Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.1.2.1 05-Aug-1994  mycroft update from trunk
 1.5.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.56.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.9.26.1 21-Apr-2020  martin Sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 25-Nov-1993  paulus Machine-dependent files for generic m68k machines (copied from hp300),
modified to support shared libraries.
 1.2 19-Oct-2001  tv Remove files beginning with ":", which is invalid on other host OS's
(particularly those made by Microsoft). These ex/vi-macro files are not
actually needed at this point, anyway....
 1.1 24-May-1994  glass branches: 1.1.26;
libc support for mips. libkern hooks are disabled
 1.1.26.1 16-Nov-2001  thorpej Fix merge errors from last sync w/ -current.
 1.16 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.15 25-Apr-2021  christos Use ${MACHINE_MIPS64}
 1.14 24-Jan-2016  christos assym.h needs _KERNTYPES
 1.13 30-Jan-2014  joerg Use fixunssfsi and fixunsdfsi from compiler-rt.
 1.12 09-Jul-2011  matt branches: 1.12.2; 1.12.8;
Don't build tf (long double) if building for O32.
 1.11 09-Jul-2011  matt Add ieee754 versions of the compiler runtime functions
__fixuns{sf,df,tf}{si,di}.
Add an ieee754 version of the compiler runtime function __floatuntfdi
 1.10 26-Jan-2011  pooka Add support for the Extensible MIPS ("eMIPS") platform. The
NetBSD/emips port runs on Xilinx and Beecube FPGA systems and the
Giano system simulator.

eMIPS is a platform developed at Microsoft Research for researching
reconfigurable computing. eMIPS allows dynamic loading and scheduling
of application-specific circuits for the purpose of accelerating
computations based on the current workload.

NetBSD eMIPS support for NetBSD 4.x was written at Microsoft Research
by Alessandro Forin and Neil Pittman. Microsoft Corporation has
donated full copyright to The NetBSD Foundation.

Platform support for eMIPS is the first part of Microsoft's
contribution. The second part includes the hardware accelerator
framework and will be proposed on tech-kern soon.
 1.9 14-Dec-2009  matt branches: 1.9.2;
Merge from matt-nb5-mips64.
 1.8 17-Jun-2006  uwe branches: 1.8.34;
G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.7 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.6 02-Nov-2003  christos Add userland portion of siginfo for mips. Many thanks to simon for letting
me use his machines down under.
 1.5 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.4 05-Mar-2000  shin branches: 1.4.6;
remove MIPS SOFTFLOAT.
 1.3 29-Sep-1999  takemura Hpcmips needs completely FPU instruction free user land.
XXX, this modification is kinda ad-hoc.
 1.2 16-Sep-1996  jonathan branches: 1.2.8;
Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.2.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.6.1 01-Aug-2002  nathanw Catch up to -current.
 1.8.34.3 29-Apr-2011  matt Pull in true (128-bit) long double support for MIPS from -current.
 1.8.34.2 27-Aug-2009  matt Add MKSOFTFLOAT support for mips and mips64. Some more work is needed to
complete support FLOAT128.
 1.8.34.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.9.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.12.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.2.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.21 23-Jul-2023  skrll Indentation consistency. NFCI.
 1.20 25-Feb-2017  joerg Switch from __ABICALLS__ to __mips_abicalls like upstream GCC does in
the generic MIPS target logic.
 1.19 14-Dec-2009  matt branches: 1.19.28; 1.19.32;
Merge from matt-nb5-mips64.
 1.18 29-Oct-2003  pooka branches: 1.18.46;
caps "Jonathan STone" in comment less dramatically
 1.17 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.16 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.15 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.14 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.13 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.12 23-Mar-2000  mycroft branches: 1.12.6;
Do a little rearrangement here. No functional change, but it's a little
clearer what's going on.
The assembler still whines about the lack of `.cprestore' when profiling,
but I'm not going there right now.
 1.11 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.10 17-Jun-1997  jonathan #include <machine/machAsmDefs.h> -> #include <mips/asm.h>
 1.9 02-May-1997  kleink Consistency: distinguish between PSEUDO() and PSEUDO_NOERROR().
 1.8 15-Mar-1997  jonathan Remove lint (missing END() directive) in NOERROR syscalls.
 1.7 19-Oct-1996  jonathan Rewrite from scratch.
 1.6 19-Oct-1996  jtc Added new macros:
SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.

RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.

These macros simply call SYSCALL / RSYSCALL, and serve as placeholders
until an optimized implementation is done.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 12-Dec-1994  dean underscore changes
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.12.6.3 11-Nov-2002  nathanw Catch up to -current
 1.12.6.2 21-Jun-2002  nathanw Catch up to -current.
 1.12.6.1 28-Jan-2002  nathanw Catch up to -current.
 1.18.46.3 05-Sep-2009  matt LP64 cleanup --> s/la/PTR_LA/
 1.18.46.2 18-Aug-2009  matt Remove PIC_xCALL - unused
Fix NewABI PIC_* macros (now that a NewABI toolchain mostly works).
 1.18.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.19.32.1 21-Apr-2017  bouyer Sync with HEAD
 1.19.28.1 20-Mar-2017  pgoyette Sync with HEAD
 1.5 18-Nov-2021  thorpej Decorate the MIPS signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.4 15-Oct-2020  skrll Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.3 12-Aug-2016  skrll Provide _OFFSETOF_UC_GREGS_GP and use _OFFSETOF_UC_GREGS_* in getcontext
 1.2 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.1 16-Aug-2009  matt branches: 1.1.2;
file genassym.cf was initially added on branch matt-nb5-mips64.
 1.1.2.3 03-Sep-2009  matt Make sure STACK_T_SIZE is dual-register_t aligned.
 1.1.2.2 18-Aug-2009  matt Add _OFFSETOF_SC_MASK13 for compat setjmp/longjmp.
 1.1.2.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.5 25-Apr-2021  christos Use ${MACHINE_MIPS64}
 1.4 20-Jan-2011  matt Remove CPUFLAGS?= since it's no longer needed.
 1.3 18-Jan-2011  matt branches: 1.3.2;
Cleanup the o32 compat build test.
 1.2 17-Jan-2011  matt Make the MIPS N32/N64 ABIs properly support 128-bit long doubles. With this
change, we should be fully conformant with the N32 and N64 ABIs.
Add {fpclassify,infinity,isnan,ininf,signbit}l_ieee754.c back to lib/libc/gen.
Note that infinityl_ieee754.c will work with either 64-bit, 80-bit, or
128-bit long doubles.
 1.1 15-Mar-2006  kleink branches: 1.1.34;
Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1.34.1 29-Apr-2011  matt Pull in true (128-bit) long double support for MIPS from -current.
 1.3.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.2 17-Jan-2011  matt Make the MIPS N32/N64 ABIs properly support 128-bit long doubles. With this
change, we should be fully conformant with the N32 and N64 ABIs.
Add {fpclassify,infinity,isnan,ininf,signbit}l_ieee754.c back to lib/libc/gen.
Note that infinityl_ieee754.c will work with either 64-bit, 80-bit, or
128-bit long doubles.
 1.1 25-Jan-2006  kleink branches: 1.1.34;
Add machine-dependent definitions for gdtoa.
 1.1.34.1 29-Apr-2011  matt Pull in true (128-bit) long double support for MIPS from -current.
 1.35 07-Oct-2016  christos Sync with compat and remove dup implementations of ldexp and modf, switching
mips and m68k to the compat copies.
 1.34 24-Jan-2016  christos branches: 1.34.2;
cache stuff needs _KERNTYPES
 1.33 15-Mar-2011  matt Properly support the MIPS TLS ABI.
 1.32 17-Jan-2011  matt Make the MIPS N32/N64 ABIs properly support 128-bit long doubles. With this
change, we should be fully conformant with the N32 and N64 ABIs.
Add {fpclassify,infinity,isnan,ininf,signbit}l_ieee754.c back to lib/libc/gen.
Note that infinityl_ieee754.c will work with either 64-bit, 80-bit, or
128-bit long doubles.
 1.31 03-Sep-2010  matt Pullup fixes from matt-nb5-mips64.
This makes setjmp/longjmp work again.
 1.30 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.29 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.28 03-Jul-2006  drochner branches: 1.28.34;
build frexp_ieee754 in the "compat" subtree
(There are assembler versions of ldexp and modf which need to be checked.
I'm in doubt they are metter than those in libm.)
 1.27 07-Oct-2005  tsutsui Follow compat libc changes on i386:
> _setjmp and _longjmp are not compat functions. Noticed by Havard Eidnes
 1.26 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.25 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.24 23-Mar-2004  simonb branches: 1.24.6;
Actually compile __longjmp14.c.
 1.23 04-Mar-2004  kleink * 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.22 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.21 26-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.20 25-Oct-2003  he Correct another typo.
 1.19 25-Oct-2003  kleink Pasto in previous.
 1.18 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.17 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.16 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.15 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.14 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.13 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.12 05-Mar-2000  shin branches: 1.12.6;
remove MIPS SOFTFLOAT.
 1.11 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.10 29-Sep-1999  takemura Hpcmips needs completely FPU instruction free user land.
XXX, this modification is kinda ad-hoc.
 1.9 29-Aug-1999  mycroft branches: 1.9.2;
Use C versions of isinf() and isnan(). The assembler code is basically
identical, but was endian-dependent.
 1.8 18-Jan-1999  castor * Fix typo in Makefile.inc -- byte_swap_2.4 -> byte_swap_4.S
* Change bytes_swap_4.S to have consistent NLEAF and END for swap routine.
 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 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.5 17-Oct-1997  jonathan Cacheflush support code for mips CPUs.
Used by GCC's lexical-closure trampoline code.
 1.4 15-Dec-1995  jonathan Add sigsetjmp.S for mips, and add it to the makefile.
 1.3 11-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,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.9.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.6.4 22-Mar-2002  nathanw Catch up to -current.
 1.12.6.3 08-Mar-2002  nathanw Catch up to -current.
 1.12.6.2 28-Nov-2001  wdk Add _lwp.c and _resumecontext.S
 1.12.6.1 21-Nov-2001  wdk ucontext support Klaus Klein <kleink@netbsd.org>
 1.24.6.1 19-Apr-2005  tron Pull up revision 1.25 (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.28.34.3 29-Apr-2011  matt Pull in true (128-bit) long double support for MIPS from -current.
 1.28.34.2 27-Jan-2010  matt Don't use cfc1/ctc1 in softfloat. Use the "common" fabs/modf/ldexp when
using softfloat.
 1.28.34.1 05-Sep-2009  matt Add an assmebly version of bswap64
 1.34.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.6 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.5 14-Sep-2005  martin Add missing <compat/include/setjmp.h>
 1.4 03-Jul-2004  simonb Copy the sparc/sparc64 __longjmp14() way of dealing with signal masks:
* Restore the signal mask with sigprocmask() instead of _UC_SIGMASK,
* since libpthread may want to interpose on signal handling.

Fixes regress/lib/libpthread/siglongjmp1.
 1.3 03-Jul-2004  simonb Catch up with changes to __fpregset_t.
In __longjmp14(), copy the FP CSR from the correct array and array slot.

Completes fix for PR port-mips/25942.
 1.2 23-Mar-2004  simonb branches: 1.2.2;
Restore the PC as well; also use mcontext register defines for accessing
the mcontext.
 1.1 23-Mar-2004  simonb Use setcontext() instead of sigreturn() to implement longjmp().
 1.2.2.1 04-Jul-2004  he Pull up revisions 1.3-1.4 (requested by simonb in tickets #591 and #592):
Changes fixing PR#25942:
o Catch up with changes to __fpregset_t. In __longjmp14(),
copy the FP CSR from the correct array and array slot.
o Copy the sparc/sparc64 __longjmp14() way of dealing with
the signal mask: Restore the signal mask with sigprocmask()
instead of _UC_SIGMASK, since libpthread may want to
interpose on signal handling.
 1.11 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.10 23-Mar-2004  simonb Use setcontext() instead of sigreturn() to implement longjmp().
 1.9 26-Nov-2003  he Hide the register number constants behind an _R_ prefix, and also
rename FPBASE to _FPBASE, so that we avoid polluting the user's
name space when e.g. <sys/ptrace.h> is included. Previously, the
PC symbol in mips/regnum.h would conflict with the declaration of
the external variable by the same name in termcap.h, as discovered
by the ``okheaders'' regression test.
 1.8 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.7 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.6 05-Mar-2000  shin branches: 1.6.6;
remove MIPS SOFTFLOAT.
 1.5 11-Oct-1999  shin adjust #endif position (SOFTFLOAT)
 1.4 29-Sep-1999  takemura Hpcmips needs completely FPU instruction free user land.
XXX, this modification is kinda ad-hoc.
 1.3 31-Jan-1999  castor branches: 1.3.4;
Regularize with removal of genpubassym.cf. Structure offsets
now obtained from signal.h
 1.2 15-Jan-1999  castor Userland support for 64-bit safe sigcontexts.
 1.1 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.6.1 11-Nov-2002  nathanw Catch up to -current
 1.5 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 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 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.2 15-Jan-1999  castor branches: 1.2.12;
Userland support for 64-bit safe sigcontexts.
 1.1 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.2.12.1 11-Nov-2002  nathanw Catch up to -current
 1.11 25-Apr-2025  riastradh mips _lwp_makecontext: Align sp.

PR kern/59327: user stack pointer is not aligned properly
 1.10 24-Apr-2025  riastradh lib/libc/arch/mips/gen/_lwp.c: Sort includes.

No functional change intended.

Preparation for:

PR kern/59327: user stack pointer is not aligned properly
 1.9 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.8 29-Apr-2011  matt branches: 1.8.56;
Use correct CALLFRAME_SIZ depending on ABI.
 1.7 15-Mar-2011  matt Properly support the MIPS TLS ABI.
 1.6 24-Feb-2011  joerg 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.5 28-Apr-2008  martin branches: 1.5.8; 1.5.14; 1.5.20;
Remove clause 3 and 4 from TNF licenses
 1.4 12-Jun-2005  lukem branches: 1.4.20;
Add missing __RCSID()
 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 20-Nov-2001  wdk branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.3 02-Jan-2002  wdk Leave space for a callframe when bootstrapping a new LWP. The function
called my save the register passed arguments back onto the stack frame that
it assumed the caller created for it. For this reason we have to ensure
24 bytes (the standard call frame size) of stack space is writable *ABOVE*
the stack pointer for a newly create LWP.

XXX: We cannot include <machine/asm.h> to declare CALLFRAME_SIZ since
it isn't Lint-proof
 1.1.2.2 24-Nov-2001  wdk MIPS ABI calls require function target address to be stored in $t9
which is later used for calculating the correct $gp value for PIC
references

Therefore if we are forcing the program counter to call a function, we must
set the same address in the $t9 register
 1.1.2.1 20-Nov-2001  wdk MIPS specific context functions and LWP support

Compile tested only.
 1.4.20.1 18-May-2008  yamt sync with head.
 1.5.20.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.14.2 29-Apr-2011  matt Both N32/N64 use 64-bit stack slots.
 1.5.14.1 29-Apr-2011  matt Pull in fixes from -current.
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.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.8.56.1 02-Aug-2025  perseant Sync with HEAD
 1.14 25-Apr-2025  riastradh mips __resumecontext: Align private stack frame size.

On mips64, UCONTEXT_SIZE is 664=0x298 (n32) or 744=0x2e8 (n64), but
sp is required to have 16-byte alignment in the ABI, so we need to
round the stack frame allocation up to 0x2a0 or 0x2f0.

No functional change intended on mips o32. Unlikely to have a
practical change on mips n32/n64, but possible if signal delivery
wins a race -- until we fix sp alignment in signal handler calls,
coming soon.

Based on a patch by rin@.

PR kern/59327: user stack pointer is not aligned properly
 1.13 15-Oct-2020  skrll branches: 1.13.8;
Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.12 15-Oct-2020  skrll Trailing whitespace
 1.11 21-Sep-2016  skrll Fix for [on]{32,64}

/usr/tests/lib/libc/sys/t_getcontext
/usr/tests/lib/libc/sys/t_swapcontext
/usr/tests/lib/libc/sys/t_ucontext
/usr/tests/lib/libpthread/t_swapcontext

All pass now.

Changes amount to

- saving GP from caller in context for n{32,64}
- performing (the equivalient of) PIC_PROLOGUE for swapcontext and
__resumecontext
- Call setcontext via the PLT in __resumecontext
 1.10 13-Aug-2016  skrll Add a NOP_L
 1.9 13-Aug-2016  skrll PIC_TAILCALL on n32/n64 would mess up GP, so just use SYSTRAP to call
setcontext.

Fixes tests/lib/libc/sys/t_getcontext.c:setcontext_link
 1.8 12-Aug-2016  skrll Trailing whitespace
 1.7 12-Sep-2012  manu branches: 1.7.14;
setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@
 1.6 14-Dec-2009  matt branches: 1.6.6;
Merge from matt-nb5-mips64.
 1.5 28-Apr-2008  martin branches: 1.5.8; 1.5.14;
Remove clause 3 and 4 from TNF licenses
 1.4 01-Mar-2004  drochner branches: 1.4.32;
optimize this: we can use %ra for relocation directly
(saves 1 insn)
 1.3 01-Mar-2004  drochner get the offset to gp right
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 28-Nov-2001  wdk branches: 1.1.2;
file _resumecontext.S was initially added on branch nathanw_sa.
 1.1.2.2 05-Jan-2003  wdk Tidy up delay slot usage
 1.1.2.1 28-Nov-2001  wdk _resumecontext was called by forcing the return address of a newly
created context. The global pointer calculation requires the function
address to be in $t9 - because it was not a proper ABI call to
_resumecontext we need a helper function to build the correct $gp
 1.4.32.1 18-May-2008  yamt sync with head.
 1.5.14.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.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.6.1 30-Oct-2012  yamt sync with head
 1.7.14.1 04-Nov-2016  pgoyette Sync with HEAD
 1.13.8.1 02-Aug-2025  perseant Sync with HEAD
 1.27 22-Apr-2025  riastradh mips: Fix _longjmp(..., 0) so _setjmp returns 1 as intended.

_setjmp (like setjmp and sigsetjmp) is only permitted to return 0 the
first time around.

PR port-mips/59285: _longjmp(..., 0) makes setjmp return 0, not 1
 1.26 15-Oct-2020  skrll branches: 1.26.8;
Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.25 15-Oct-2020  skrll Trailing whitespace
 1.24 08-Jul-2012  matt Slight optimization.
 1.23 09-Mar-2011  tsutsui branches: 1.23.4;
Reorder insns to fix more load delay hazard botches on R3000.
Fixes floating point exceptions in _longjmp() during /etc/rc and
now NWS-3470D boots up to multi user with -current userland binaries.

Also fill BDslots in error path properly.
 1.22 03-Sep-2010  matt Pullup fixes from matt-nb5-mips64.
This makes setjmp/longjmp work again.
 1.21 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.20 07-Oct-2005  tsutsui branches: 1.20.34;
Follow compat libc changes on i386:
> _setjmp and _longjmp are not compat functions. Noticed by Havard Eidnes
 1.19 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.18 26-Nov-2003  he Hide the register number constants behind an _R_ prefix, and also
rename FPBASE to _FPBASE, so that we avoid polluting the user's
name space when e.g. <sys/ptrace.h> is included. Previously, the
PC symbol in mips/regnum.h would conflict with the declaration of
the external variable by the same name in termcap.h, as discovered
by the ``okheaders'' regression test.
 1.17 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.16 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.15 05-Mar-2000  shin branches: 1.15.6;
remove MIPS SOFTFLOAT.
 1.14 11-Oct-1999  shin remove extra lw (SOFTFLOAT)
 1.13 11-Oct-1999  shin adjust #endif position (SOFTFLOAT)
 1.12 29-Sep-1999  takemura Hpcmips needs completely FPU instruction free user land.
XXX, this modification is kinda ad-hoc.
 1.11 05-Feb-1999  jonathan branches: 1.11.4;
_setjmp.S needs OFFSETOF_SC_{FP,}REGS, so include <machine/signal.h>
even tho _setjmp()/_longjmp() don't manipulate signals. (more thought?)
 1.10 15-Jan-1999  castor Userland support for 64-bit safe sigcontexts.
 1.9 28-May-1998  simonb Remove single ' from comment to keep cross-assemblers happy; fixes PR 5451.
 1.8 07-Jul-1997  jonathan Back out previous revision, which is reported to break signal-handing
in the GNU awk in our tree.
Leave the change in but commented out, it may be a ld.so problem.
 1.7 18-Jun-1997  jonathan Add .set noreorder/.set reorder around .cpload
 1.6 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.5 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.4 22-Dec-1995  jonathan Change mips assembly code for {,_,sig}setjmp.S to get register names
from <machine/regnum.h>, not <machine/reg.h> (which also defines structs.)
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.11.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.6.1 11-Nov-2002  nathanw Catch up to -current
 1.20.34.6 29-Apr-2011  matt Pull in fixes from -current.
 1.20.34.5 03-Feb-2010  matt Fix setjmp/longjmp (longjmp(a,v) was not returning v)
Fix __setjmp14 to not mark fp as used when running softfloat.
 1.20.34.4 27-Jan-2010  matt Don't use cfc1/ctc1 in softfloat. Use the "common" fabs/modf/ldexp when
using softfloat.
 1.20.34.3 12-Dec-2009  cliff #ifndef SOFTFLOAT_FOR_GCC around blocks of FP code.
 1.20.34.2 18-Aug-2009  matt Make arch/gen/_setjmp.S and compat/arch/gen/compat_setjmp.S as identical
as possible.
Use RCSID. Use FP_L/FP_S
 1.20.34.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.23.4.1 30-Oct-2012  yamt sync with head
 1.26.8.1 02-Aug-2025  perseant Sync with HEAD
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.3 27-Feb-2001  cgd branches: 1.3.2;
make these more amenable to being copied into libkern. (Gee, why wasn't
this done before? it's not like it was hard...)
 1.2 27-Feb-2001  cgd pull up <machine/endian.h> and use BYTE_ORDER to decide endianness,
rather than MIPSEL and MIPSEB definitions.
 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.3.2.1 11-Nov-2002  nathanw Catch up to -current
 1.7 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.4 27-Feb-2001  cgd branches: 1.4.2;
make these more amenable to being copied into libkern. (Gee, why wasn't
this done before? it's not like it was hard...)
 1.3 27-Feb-2001  cgd pull up <machine/endian.h> and use BYTE_ORDER to decide endianness,
rather than MIPSEL and MIPSEB definitions.
 1.2 18-Jan-1999  castor * Fix typo in Makefile.inc -- byte_swap_2.4 -> byte_swap_4.S
* Change bytes_swap_4.S to have consistent NLEAF and END for swap routine.
 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.2.1 11-Nov-2002  nathanw Catch up to -current
 1.6 29-Mar-2012  christos nbytes is now size_t
 1.5 29-Mar-2012  christos fix lint, should nbytes be changed to size_t to match with the struct passed?
 1.4 28-Apr-2008  martin branches: 1.4.4; 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 10-Jan-1999  simonb branches: 1.3.46;
s/vm_offset_t/vaddr_t/
 1.2 25-Feb-1998  perry change second parm of sysarch() from char * to void *
 1.1 17-Oct-1997  jonathan Cacheflush support code for mips CPUs.
Used by GCC's lexical-closure trampoline code.
 1.3.46.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 cacheflush.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.4.1 17-Apr-2012  yamt sync with head
 1.9 07-Nov-2018  riastradh On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.

For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm. For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64. Need help from an itanium
wizard! Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.
 1.8 14-Dec-2009  matt branches: 1.8.44; 1.8.46;
Merge from matt-nb5-mips64.
 1.7 07-Aug-2003  agc branches: 1.7.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.5 17-Sep-1996  jonathan branches: 1.5.16;
* Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.16.1 11-Nov-2002  nathanw Catch up to -current
 1.7.46.2 18-Aug-2009  matt Cleanup/Add RCSIDs.
Cleanup/fix setjmp
Cleanup includes. (assym.h is your friend)
 1.7.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.8.46.1 10-Jun-2019  christos Sync with HEAD
 1.8.44.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.9 19-Mar-2015  joerg Call libc's fpgetround.
 1.8 17-Sep-2014  joerg Explicitly set noat around instructions using $at.
 1.7 24-Jun-2012  christos branches: 1.7.10;
fix old style definitions; XXX: gcc should have picked them up but it did not.
 1.6 03-Sep-2010  matt branches: 1.6.6;
Pullup fixes from matt-nb5-mips64.
This makes setjmp/longjmp work again.
 1.5 24-Dec-2005  perry branches: 1.5.34;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 1.3 18-Oct-1997  jonathan Prototype __flt_rounds().
 1.2 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 11-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.5.34.1 27-Jan-2010  matt Don't use cfc1/ctc1 in softfloat. Use the "common" fabs/modf/ldexp when
using softfloat.
 1.6.6.1 30-Oct-2012  yamt sync with head
 1.7.10.1 21-Mar-2015  snj Pull up following revision(s) (requested by joerg in ticket #632):
lib/libc/arch/arm/gen/flt_rounds.c: revision 1.5
lib/libc/arch/mips/gen/flt_rounds.c: revision 1.9
lib/libc/arch/powerpc/gen/flt_rounds.c: revision 1.12
lib/libc/arch/powerpc64/gen/flt_rounds.c: revision 1.2
lib/libc/arch/sh3/gen/flt_rounds.c: revision 1.6
Call libc's fpgetround.
 1.9 17-Sep-2014  joerg Explicitly set noat around instructions using $at.
 1.8 20-Mar-2012  matt Revert unneeded casts.
 1.7 20-Mar-2012  he Cast to unsigned int before doing shift operations, to appease lint.
 1.6 19-Mar-2012  matt Convert to C89 definitions.
Cleanup up type usage.
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 16-Sep-1996  jonathan branches: 1.2.16;
Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 11-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.16.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.7 17-Sep-2014  joerg Explicitly set noat around instructions using $at.
 1.6 19-Mar-2012  matt Convert to C89 definitions.
Cleanup up type usage.
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 16-Sep-1996  jonathan branches: 1.2.16;
Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 11-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.16.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.9 17-Sep-2014  joerg Explicitly set noat around instructions using $at.
 1.8 20-Mar-2012  matt Revert unneeded casts.
 1.7 20-Mar-2012  he Cast to unsigned int before doing shift operations, to appease lint.
 1.6 19-Mar-2012  matt Convert to C89 definitions.
Cleanup up type usage.
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 16-Sep-1996  jonathan branches: 1.2.16;
Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 11-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.16.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.10 27-Feb-2017  chs fix asm operands: "ctc1" uses the register as an input, not an output.
 1.9 17-Sep-2014  joerg branches: 1.9.2; 1.9.4;
Explicitly set noat around instructions using $at.
 1.8 20-Mar-2012  matt Revert unneeded casts.
 1.7 20-Mar-2012  he Cast to unsigned int before doing shift operations, to appease lint.
 1.6 19-Mar-2012  matt Convert to C89 definitions.
Cleanup up type usage.
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 16-Sep-1996  jonathan branches: 1.2.16;
Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 11-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.16.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.9.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.9.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.8 27-Feb-2017  chs fix asm operands: "ctc1" uses the register as an input, not an output.
 1.7 17-Sep-2014  joerg branches: 1.7.2; 1.7.4;
Explicitly set noat around instructions using $at.
 1.6 19-Mar-2012  matt Convert to C89 definitions.
Cleanup up type usage.
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 16-Sep-1996  jonathan branches: 1.2.16;
Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 11-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.16.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.7.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.7.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.10 27-Feb-2017  chs fix asm operands: "ctc1" uses the register as an input, not an output.
 1.9 17-Sep-2014  joerg branches: 1.9.2; 1.9.4;
Explicitly set noat around instructions using $at.
 1.8 20-Mar-2012  matt Revert unneeded casts.
 1.7 20-Mar-2012  he Cast to unsigned int before doing shift operations, to appease lint.
 1.6 19-Mar-2012  matt Convert to C89 definitions.
Cleanup up type usage.
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 16-Sep-1996  jonathan branches: 1.2.16;
Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 11-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.16.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.9.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.9.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.7 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.6 29-Aug-1999  mycroft branches: 1.6.10;
Trivial KNF.
 1.5 29-Aug-1999  mycroft Make the C version of frexp() consitent across platforms, and handle the
Inf/NaN case.
 1.4 29-Aug-1999  mycroft Use ieee.h.
 1.3 13-Jul-1997  christos Fix RCSID's
 1.2 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.6.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.2 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 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 14-Nov-1998  christos branches: 1.5.12;
delint
 1.4 26-Jul-1998  mycroft const poisoning.
 1.3 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.2 28-Jun-1995  jonathan *** empty log message ***
 1.1 18-Jan-1995  mellon +Infinity for MIPS
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.7 29-Aug-1999  mycroft Use C versions of isinf() and isnan(). The assembler code is basically
identical, but was endian-dependent.
 1.6 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 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 Use C versions of isinf() and isnan(). The assembler code is basically
identical, but was endian-dependent.
 1.2.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 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 Use C versions of isinf() and isnan(). The assembler code is basically
identical, but was endian-dependent.
 1.2.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.10 17-Sep-2014  joerg Use canonical three operand form of add.d.
 1.9 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.8 07-Aug-2003  agc branches: 1.8.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.6 05-Nov-2002  thorpej t4 -> ta0
 1.5 17-Sep-1996  jonathan branches: 1.5.16;
* Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.16.1 11-Nov-2002  nathanw Catch up to -current
 1.8.46.2 18-Aug-2009  matt Cleanup/Add RCSIDs.
Cleanup/fix setjmp
Cleanup includes. (assym.h is your friend)
 1.8.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.7 24-Apr-2025  riastradh mips longjmp: Use _UC_SIGMASK to restore signal mask.

This way, restoring the signal mask and restoring the stack pointer
happen atomically with respect to signal handler calls, whereas using
sigprocmask would restore the signal mask _before_ the stack pointer,
breaking sigaltstack.

The motivation for using sigprocmask first and then setcontext later,
rather than _UC_SIGMASK in setcontext, was to get SA-based libpthead
sigprocmask interposition. But that's long gone and unlikely to come
back.

PR lib/57946: longjmp fails to restore stack first before restoring
signal mask on most architectures
 1.6 24-Jan-2016  christos branches: 1.6.28;
Use namespace protected types.
 1.5 29-Mar-2012  christos make constant explicitly unsigned
 1.4 03-Sep-2010  matt branches: 1.4.6;
Pullup fixes from matt-nb5-mips64.
This makes setjmp/longjmp work again.
 1.3 16-Feb-2009  lukem fix -Wsign-compare issue
 1.2 28-Apr-2008  martin branches: 1.2.8; 1.2.10; 1.2.14;
Remove clause 3 and 4 from TNF licenses
 1.1 17-Sep-2005  tsutsui branches: 1.1.20;
Switch mips to the new libc compat code layout.
 1.1.20.1 18-May-2008  yamt sync with head.
 1.2.14.3 29-Apr-2011  matt Pull in fixes from -current.
 1.2.14.2 30-Apr-2010  matt Semantic change: Use _REG_x with gregs, no binary difference
 1.2.14.1 30-Apr-2010  matt For N32/N64, GP is callee-saved
 1.2.10.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.2.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2.8.1 28-Apr-2008  martin file longjmp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.6.1 17-Apr-2012  yamt sync with head
 1.6.28.1 02-Aug-2025  perseant Sync with HEAD
 1.10 24-Apr-2025  riastradh mips/makecontext.c: Use STACK_ALIGNBYTES for clarity.

No functional change intended.

Tidying to make stack alignment more obvious, prompted by:

PR kern/59327: user stack pointer is not aligned properly

Part of a patch by rin@.
 1.9 24-Apr-2025  riastradh mips/makecontext.c: Sort includes.

No functional change intended.

Preparation for:

PR kern/59327: user stack pointer is not aligned properly
 1.8 10-Aug-2016  skrll branches: 1.8.26;
Fix comments
 1.7 20-Sep-2011  joerg Explicitly add back __resumecontext wrapper
 1.6 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.5 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.4 28-Apr-2008  martin branches: 1.4.8; 1.4.14;
Remove clause 3 and 4 from TNF licenses
 1.3 19-Jan-2003  matt branches: 1.3.32;
Cast with uintptr_t instead of u_long.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 20-Nov-2001  wdk branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.5 28-Nov-2001  wdk _resumecontext was called by forcing the return address of a newly
created context. The global pointer calculation requires the function
address to be in $t9 - because it was not a proper ABI call to
_resumecontext we need a helper function to build the correct $gp
 1.1.2.4 24-Nov-2001  wdk MIPS ABI calls require function target address to be stored in $t9
which is later used for calculating the correct $gp value for PIC
references

Therefore if we are forcing the program counter to call a function, we must
set the same address in the $t9 register
 1.1.2.3 21-Nov-2001  wdk Fix Lint warnings
 1.1.2.2 21-Nov-2001  wdk ucontext support Klaus Klein <kleink@netbsd.org>
 1.1.2.1 20-Nov-2001  wdk MIPS specific context functions and LWP support

Compile tested only.
 1.3.32.1 18-May-2008  yamt sync with head.
 1.4.14.2 18-Aug-2009  matt Dont case pointers to __greg_t, use intptr_t (pointers on mips are signed)
 1.4.14.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 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.8.26.1 02-Aug-2025  perseant Sync with HEAD
 1.11 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.10 07-Aug-2003  agc branches: 1.10.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.8 19-Aug-1997  jonathan branches: 1.8.14;
Do a .cpload if compiling with PIC.
Examining the .so output from binutils 2.8 and 2.8.1 shows the
li.d $f2, 4503599627370496e0
is (incorrectly?) emitted as GP-relative loads when PIC is in effect.
 1.7 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.6 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.5 29-Sep-1995  jonathan Copy the input argument to $f0 so we handle negative inputs properly
in the tail.

Doesn't yet handle +/- inf as cleanly as other implementations.
 1.4 25-Sep-1995  jonathan The old mips modf didn't work (pr 1048). This replaces it with
a version that does work on little-endian MIPS CPUs. Not tested on
big-endian MIPS; the "li.d" may be byteorder-dependent.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8.14.1 11-Nov-2002  nathanw Catch up to -current
 1.10.46.2 18-Aug-2009  matt Cleanup/Add RCSIDs.
Cleanup/fix setjmp
Cleanup includes. (assym.h is your friend)
 1.10.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 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; 1.3.36;
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.36.1 29-Apr-2011  matt Use GCC builtin for NAN (sync with 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.5 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Dec-2006  martin branches: 1.3.12;
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-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.2 18-Jan-2003  thorpej branches: 1.2.16;
Merge the nathanw_sa branch.
 1.1 20-Nov-2001  wdk branches: 1.1.2;
file resumecontext.c was initially added on branch nathanw_sa.
 1.1.2.2 21-Nov-2001  wdk ucontext support Klaus Klein <kleink@netbsd.org>
 1.1.2.1 20-Nov-2001  wdk MIPS specific context functions and LWP support

Compile tested only.
 1.2.16.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #264):
lib/libc/arch/sh5/gen/resumecontext.c: revision 1.2
lib/libc/arch/sh3/gen/resumecontext.c: revision 1.3
lib/libc/arch/sparc/gen/resumecontext.c: revision 1.3
lib/libc/arch/powerpc/gen/resumecontext.c: revision 1.3
lib/libc/arch/arm/gen/resumecontext.c: revision 1.3
lib/libc/arch/mips/gen/resumecontext.c: revision 1.3
lib/libc/arch/vax/gen/resumecontext.c: revision 1.2
lib/libc/arch/powerpc64/gen/resumecontext.c: revision 1.2
lib/libc/arch/hppa/gen/resumecontext.c: revision 1.2
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:
-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.3.12.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.20 15-Oct-2020  skrll Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.19 03-Sep-2010  matt Pullup fixes from matt-nb5-mips64.
This makes setjmp/longjmp work again.
 1.18 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.17 17-Sep-2005  tsutsui branches: 1.17.34;
Switch mips to the new libc compat code layout.
 1.16 26-Nov-2003  he Hide the register number constants behind an _R_ prefix, and also
rename FPBASE to _FPBASE, so that we avoid polluting the user's
name space when e.g. <sys/ptrace.h> is included. Previously, the
PC symbol in mips/regnum.h would conflict with the declaration of
the external variable by the same name in termcap.h, as discovered
by the ``okheaders'' regression test.
 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 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.13 05-Mar-2000  shin branches: 1.13.6;
remove MIPS SOFTFLOAT.
 1.12 11-Oct-1999  shin adjust #endif position (SOFTFLOAT)
 1.11 29-Sep-1999  takemura Hpcmips needs completely FPU instruction free user land.
XXX, this modification is kinda ad-hoc.
 1.10 31-Jan-1999  castor branches: 1.10.4;
Regularize with removal of genpubassym.cf. Structure offsets
now obtained from signal.h
 1.9 15-Jan-1999  castor Userland support for 64-bit safe sigcontexts.
 1.8 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.7 05-Dec-1997  thorpej Use __sigaltstack14(), not sigaltstack().
 1.6 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.5 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.4 22-Dec-1995  jonathan Change mips assembly code for {,_,sig}setjmp.S to get register names
from <machine/regnum.h>, not <machine/reg.h> (which also defines structs.)
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.10.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.13.6.1 11-Nov-2002  nathanw Catch up to -current
 1.17.34.7 30-Apr-2010  matt When .set reorder, the move goes before the jump, not after.
 1.17.34.6 03-Feb-2010  matt Cleanup #ifdefs.
 1.17.34.5 03-Feb-2010  matt Fix setjmp/longjmp (longjmp(a,v) was not returning v)
Fix __setjmp14 to not mark fp as used when running softfloat.
 1.17.34.4 27-Jan-2010  matt Don't use cfc1/ctc1 in softfloat. Use the "common" fabs/modf/ldexp when
using softfloat.
 1.17.34.3 12-Dec-2009  cliff #ifndef SOFTFLOAT_FOR_GCC around blocks of FP code.
 1.17.34.2 18-Aug-2009  matt Cleanup/Add RCSIDs.
Cleanup/fix setjmp
Cleanup includes. (assym.h is your friend)
 1.17.34.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.2 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.2 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.4 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.3 22-Feb-2000  mycroft Do the minimum work to make this compile with -Werror.
 1.2 26-Dec-1999  shin fix name space pollution by adding prefix '_mips_'.
closes PR 8770.
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.5 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.4 25-Feb-2000  mycroft Remove pointless #ifdef.
 1.3 22-Feb-2000  mycroft Do the minimum work to make this compile with -Werror.
 1.2 26-Dec-1999  shin fix name space pollution by adding prefix '_mips_'.
closes PR 8770.
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.4 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.3 22-Feb-2000  mycroft Do the minimum work to make this compile with -Werror.
 1.2 26-Dec-1999  shin fix name space pollution by adding prefix '_mips_'.
closes PR 8770.
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.5 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.4 22-Feb-2000  mycroft Fix bogons.
 1.3 22-Feb-2000  mycroft Do the minimum work to make this compile with -Werror.
 1.2 26-Dec-1999  shin fix name space pollution by adding prefix '_mips_'.
closes PR 8770.
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.5 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.4 22-Feb-2000  mycroft Fix bogons.
 1.3 22-Feb-2000  mycroft Do the minimum work to make this compile with -Werror.
 1.2 26-Dec-1999  shin fix name space pollution by adding prefix '_mips_'.
closes PR 8770.
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.5 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.4 22-Feb-2000  mycroft Fix bogons.
 1.3 22-Feb-2000  mycroft Do the minimum work to make this compile with -Werror.
 1.2 26-Dec-1999  shin fix name space pollution by adding prefix '_mips_'.
closes PR 8770.
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.3 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.2 22-Jan-2000  mycroft Delint.
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.2 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.4 11-Jan-2009  christos merge christos-time_t
 1.3 13-Mar-2000  soren branches: 1.3.2; 1.3.16;
Fix doubled 'the's.
 1.2 05-Mar-2000  shin remove unused files (MIPS SOFTFLOAT).
 1.1 16-Sep-1999  takemura branches: 1.1.1;
Initial revision
 1.1.1.1 16-Sep-1999  takemura Import NetBSD/hpcmips source files from hpcmips repository.
file list:
sys/arch/hpcmips/
distrib/hpcmips/
etc/etc.hpcmips/
lib/libc/arch/mips/fplib/
lib/libc/arch/mips/fplib/Makefile.inc
lib/libc/arch/mips/fplib/environment.h
lib/libc/arch/mips/fplib/fplib_glue.c
lib/libc/arch/mips/fplib/fplib_libc.c
lib/libc/arch/mips/fplib/hpcmips-gcc.h
lib/libc/arch/mips/fplib/softfloat-macros.h
lib/libc/arch/mips/fplib/softfloat-specialize.h
lib/libc/arch/mips/fplib/softfloat.c
lib/libc/arch/mips/fplib/softfloat.h
lib/libc/arch/mips/gen/ieee.h
lib/libc/arch/mips/gen/sf_fabs.c
lib/libc/arch/mips/gen/sf_flt_rounds.c
lib/libc/arch/mips/gen/sf_fpgetmask.c
lib/libc/arch/mips/gen/sf_fpgetround.c
lib/libc/arch/mips/gen/sf_fpgetsticky.c
lib/libc/arch/mips/gen/sf_fpsetmask.c
lib/libc/arch/mips/gen/sf_fpsetround.c
lib/libc/arch/mips/gen/sf_fpsetsticky.c
lib/libc/arch/mips/gen/sf_isinf.c
lib/libc/arch/mips/gen/sf_ldexp.c
lib/libc/arch/mips/gen/sf_modf.c
 1.3.16.1 04-Jan-2009  christos merge with head.
 1.3.2.3 13-Aug-2002  nathanw Catch up to -current.
 1.3.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.3.2.1 16-Nov-2001  thorpej Fix merge errors from last sync w/ -current.
 1.9 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.8 17-Sep-2005  tsutsui branches: 1.8.34;
Switch mips to the new libc compat code layout.
 1.7 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.6 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.5 31-Jan-1999  castor branches: 1.5.12;
Regularize with removal of genpubassym.cf. Structure offsets
now obtained from signal.h
 1.4 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.3 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.2 22-Dec-1995  jonathan Change mips assembly code for {,_,sig}setjmp.S to get register names
from <machine/regnum.h>, not <machine/reg.h> (which also defines structs.)
 1.1 15-Dec-1995  jonathan Add sigsetjmp.S for mips, and add it to the makefile.
 1.5.12.1 11-Nov-2002  nathanw Catch up to -current
 1.8.34.3 23-Aug-2009  matt savemask goes into the slot at _JBLEN
 1.8.34.2 18-Aug-2009  matt Cleanup/Add RCSIDs.
Cleanup/fix setjmp
Cleanup includes. (assym.h is your friend)
 1.8.34.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.8 15-Oct-2020  skrll Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.7 21-Sep-2016  skrll Fix for [on]{32,64}

/usr/tests/lib/libc/sys/t_getcontext
/usr/tests/lib/libc/sys/t_swapcontext
/usr/tests/lib/libc/sys/t_ucontext
/usr/tests/lib/libpthread/t_swapcontext

All pass now.

Changes amount to

- saving GP from caller in context for n{32,64}
- performing (the equivalient of) PIC_PROLOGUE for swapcontext and
__resumecontext
- Call setcontext via the PLT in __resumecontext
 1.6 21-Sep-2016  skrll Trailing whitespace.
 1.5 12-Sep-2012  manu branches: 1.5.14;
setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@
 1.4 14-Dec-2009  matt branches: 1.4.6;
Merge from matt-nb5-mips64.
 1.3 28-Apr-2008  martin branches: 1.3.8; 1.3.14;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.32;
Merge the nathanw_sa branch.
 1.1 20-Nov-2001  wdk branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.5 05-Jan-2003  wdk Tidy up delay slot usage
 1.1.2.4 20-Nov-2002  wdk Be debugger friendly:
When saving register passed argumants (in a0 and a1) for later use,
place them in their respective place in the stack frame
and not elsewhere.
 1.1.2.3 24-Nov-2001  wdk Use inline syscalls for [gs]etcontext instead of calling the library
functions which are just simple wrappers around the same sycall
 1.1.2.2 21-Nov-2001  wdk ucontext support Klaus Klein <kleink@netbsd.org>
 1.1.2.1 20-Nov-2001  wdk MIPS specific context functions and LWP support

Compile tested only.
 1.2.32.1 18-May-2008  yamt sync with head.
 1.3.14.4 18-Aug-2009  uebayasi REGSZ -> SZREG
 1.3.14.3 18-Aug-2009  uebayasi Include assym.h. Fix build.
 1.3.14.2 18-Aug-2009  matt Cleanup/Add RCSIDs.
Cleanup/fix setjmp
Cleanup includes. (assym.h is your friend)
 1.3.14.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4.6.1 30-Oct-2012  yamt sync with head
 1.5.14.1 04-Nov-2016  pgoyette Sync with HEAD
 1.4 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.3 01-Aug-2003  lukem branches: 1.3.46;
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.2 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.1 25-Feb-1995  cgd need these now, with new net Makefile.inc
 1.3.46.1 29-Apr-2011  matt Pull in fixes from -current.
 1.6 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.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.6 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.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.2 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.1 27-Aug-2009  matt branches: 1.1.2;
file milieu.h was initially added on branch matt-nb5-mips64.
 1.1.2.1 27-Aug-2009  matt Add MKSOFTFLOAT support for mips and mips64. Some more work is needed to
complete support FLOAT128.
 1.5 27-Jun-2011  matt Fix softfloat for mips*el
 1.4 25-Feb-2011  pooka fix my whitespace copypaste
 1.3 25-Feb-2011  pooka Fix LE softfloat (mostly theoretical) and comment.

from Alessandro Forin
 1.2 14-Dec-2009  matt branches: 1.2.2;
Merge from matt-nb5-mips64.
 1.1 27-Aug-2009  matt branches: 1.1.2;
file mips-gcc.h was initially added on branch matt-nb5-mips64.
 1.1.2.3 01-Jun-2011  matt Kill a section copied from arm-gcc.h. MIPS is "normal" (well, more normal)
than ARM for FP.
 1.1.2.2 29-Apr-2011  matt Pull in true (128-bit) long double support for MIPS from -current.
 1.1.2.1 27-Aug-2009  matt Add MKSOFTFLOAT support for mips and mips64. Some more work is needed to
complete support FLOAT128.
 1.2.2.1 05-Mar-2011  bouyer Sync with HEAD
 1.5 07-Jul-2011  matt Don't define a new enum. Just #define round_* to their FP_Rx instead.
 1.4 04-Jul-2011  matt Add __floatunsidf __floatunsisf __floatunsitf routines.
XXX i think they are correct but not sure.
 1.3 17-Jan-2011  matt Make the MIPS N32/N64 ABIs properly support 128-bit long doubles. With this
change, we should be fully conformant with the N32 and N64 ABIs.
Add {fpclassify,infinity,isnan,ininf,signbit}l_ieee754.c back to lib/libc/gen.
Note that infinityl_ieee754.c will work with either 64-bit, 80-bit, or
128-bit long doubles.
 1.2 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.1 27-Aug-2009  matt branches: 1.1.2;
file softfloat.h was initially added on branch matt-nb5-mips64.
 1.1.2.3 20-May-2011  matt Fix botched definition of float128_to_uint32_round_to_zero
 1.1.2.2 29-Apr-2011  matt Pull in true (128-bit) long double support for MIPS from -current.
 1.1.2.1 27-Aug-2009  matt Add MKSOFTFLOAT support for mips and mips64. Some more work is needed to
complete support FLOAT128.
 1.5 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.4 04-Aug-2008  matt branches: 1.4.6;
Add C99 functions imaxabs and imaxdiv.
 1.3 22-Mar-2006  drochner branches: 1.3.22;
build erand48_ieee754.c on everything but vax
 1.2 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1 05-Nov-1997  cgd branches: 1.1.2;
A foolish consistency... gen, net, and string all get MD sources
specified by including a Makefile.inc from the appropriate MD directory.
stdlib doesn't do that, but there's no reason that it shouldn't (and
it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>A foolish consistency... gen, net, and string all get MD sources
>specified by including a Makefile.inc from the appropriate MD directory.
>stdlib doesn't do that, but there's no reason that it shouldn't (and
>it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.1 05-Nov-1997  veego file Makefile.inc was added on branch netbsd-1-3 on 1997-11-08 21:56:39 +0000
 1.3.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.6 02-Nov-2024  jakllsch Fix mips build failure caused by new ffsl.c
 1.5 14-Dec-2009  matt branches: 1.5.58;
Merge from matt-nb5-mips64.
 1.4 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.3 17-Jul-2009  dsl Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
libc and kernel build ok for affected archs (i386, amd64, vax, sun3,
evbmips-eb) all seem ok.
(vax might lose an asm index() - but comments imply it is worse than the C)
 1.2 10-Oct-2000  jeffs branches: 1.2.50;
Make memcpy and memmove use bcopy assembly for mips. Tweak forward copy
code for backward copy to make overlap copy faster. This happens in
some SW like sleepycat db. Use temp labels in order to not confused
the profiling tools.
 1.1 20-Mar-1995  mycroft Separate machine dependencies.
 1.2.50.1 18-Aug-2009  matt Enable use of memset2.c/bzero2.c
Cleanup RCSIDs
 1.5.58.1 02-Aug-2025  perseant Sync with HEAD
 1.9 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.8 07-Aug-2003  agc branches: 1.8.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.6 20-Oct-1997  jonathan branches: 1.6.14;
Pull up endian-independent changes from locore, userland bcopy.S.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.6.14.1 11-Nov-2002  nathanw Catch up to -current
 1.8.46.2 18-Aug-2009  matt Enable use of memset2.c/bzero2.c
Cleanup RCSIDs
 1.8.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.10 21-Dec-2005  christos moved to common.
 1.9 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.8 10-Oct-2000  jeffs branches: 1.8.2;
Make memcpy and memmove use bcopy assembly for mips. Tweak forward copy
code for backward copy to make overlap copy faster. This happens in
some SW like sleepycat db. Use temp labels in order to not confused
the profiling tools.
 1.7 18-Oct-1997  jonathan Pull up endian diffs from kernel bcopy().
 1.6 09-Aug-1997  jonathan Substitute Mach 3.0 kernel bcopy() which is unrolled for aligned copies.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8.2.1 11-Nov-2002  nathanw Catch up to -current
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.10 14-Dec-2009  matt Fix typo.
 1.9 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.8 07-Aug-2003  agc branches: 1.8.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.6 19-Oct-1997  jonathan branches: 1.6.14;
Pull up ambi-endian diffs from kernel bzero().
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.6.14.1 11-Nov-2002  nathanw Catch up to -current
 1.8.46.3 29-Apr-2011  matt Pull in fixes from -current.
 1.8.46.2 18-Aug-2009  matt Checkin a fix for 8byte access even though we are now using the C version.
 1.8.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.7 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.6 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.5 17-Sep-1996  jonathan branches: 1.5.16;
* Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.16.1 11-Nov-2002  nathanw Catch up to -current
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.9 17-Jul-2009  dsl Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
libc and kernel build ok for affected archs (i386, amd64, vax, sun3,
evbmips-eb) all seem ok.
(vax might lose an asm index() - but comments imply it is worse than the C)
 1.8 22-Apr-2005  simonb branches: 1.8.34;
Branch to a local symbol instead of a global symbol.
 1.7 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.6 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.5 17-Sep-1996  jonathan branches: 1.5.16;
* Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.16.1 11-Nov-2002  nathanw Catch up to -current
 1.8.34.2 18-Aug-2009  matt Enable use of memset2.c/bzero2.c
Cleanup RCSIDs
 1.8.34.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 10-Oct-2000  jeffs Make memcpy and memmove use bcopy assembly for mips. Tweak forward copy
code for backward copy to make overlap copy faster. This happens in
some SW like sleepycat db. Use temp labels in order to not confused
the profiling tools.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 10-Oct-2000  jeffs Make memcpy and memmove use bcopy assembly for mips. Tweak forward copy
code for backward copy to make overlap copy faster. This happens in
some SW like sleepycat db. Use temp labels in order to not confused
the profiling tools.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 15-Mar-1999  jonathan Assembly-coded, word-at-a-time unrolled memset().
 1.8 17-Jul-2009  dsl Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
libc and kernel build ok for affected archs (i386, amd64, vax, sun3,
evbmips-eb) all seem ok.
(vax might lose an asm index() - but comments imply it is worse than the C)
 1.7 07-Aug-2003  agc branches: 1.7.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.5 17-Sep-1996  jonathan branches: 1.5.16;
* Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.16.1 11-Nov-2002  nathanw Catch up to -current
 1.7.46.2 18-Aug-2009  matt Enable use of memset2.c/bzero2.c
Cleanup RCSIDs
 1.7.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.7 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.6 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.5 17-Sep-1996  jonathan branches: 1.5.16;
* Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.16.1 11-Nov-2002  nathanw Catch up to -current
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.7 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.6 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.5 17-Sep-1996  jonathan branches: 1.5.16;
* Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.16.1 11-Nov-2002  nathanw Catch up to -current
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.11 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.10 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.9 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.8 13-Dec-2000  simonb branches: 1.8.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.7 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 02-Dec-1998  thorpej Warn about references to the compatibility vfork() (i.e. the vfork() with
the 4.4BSD non-shared-address-space semantics), and direct the user to
include <unistd.h> to generate the correct reference.

This warning isn't about an ABI compatibility issue, but the new vfork() is
considerably faster.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8.2.1 11-Nov-2002  nathanw Catch up to -current
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.7 28-Apr-2008  martin branches: 1.7.8; 1.7.14;
Remove clause 3 and 4 from TNF licenses
 1.6 08-Feb-2003  simonb branches: 1.6.32;
Fix a tyop in a comment.
 1.5 08-Feb-2003  cgd * fix handling of invalid arguments (was jumping to wrong label!)
(found by... running the regress test!)
* clean up punctuation.
* create a proper frame for the child fn that follows the o32 calling
conventions. In particular, leave 4 stack slots that the child
fn can write on, put the GP above them, and invoke .cprestore
properly in light of the child fn arg area. (realized it was a
problem upon inspection, verified using the regress test compiled
-O0.)
 1.4 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.3 20-Jul-2001  thorpej branches: 1.3.2;
Duh, call the clone's entry point w/ jal, so that when it returns,
it returns to the correct $ra (not the parent's!!).
 1.2 17-Jul-2001  thorpej Cosmetic change.
 1.1 17-Jul-2001  thorpej Add a __clone(2) entry point.
 1.3.2.3 11-Nov-2002  nathanw Catch up to -current
 1.3.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.3.2.1 20-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:17:49 +0000
 1.6.32.1 18-May-2008  yamt sync with head.
 1.7.14.2 19-Aug-2009  matt Make this a bit closer to the orignal. Make the disassembled diff easier.
 1.7.14.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.7.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7.8.1 28-Apr-2008  martin file __clone.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.8 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.7 28-Apr-2008  martin branches: 1.7.8;
Remove clause 3 and 4 from TNF licenses
 1.6 19-Feb-2006  christos branches: 1.6.20;
make these consistent.
 1.5 12-Jun-2005  lukem Add missing __RCSID()
 1.4 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.3 02-Nov-2003  christos Add userland portion of siginfo for mips. Many thanks to simon for letting
me use his machines down under.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:27:58 +0000
 1.6.20.1 18-May-2008  yamt sync with head.
 1.7.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.5 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.4 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 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 13-Dec-2000  simonb Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.1 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.3 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.2 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:27:58 +0000
 1.5 07-Apr-2022  andvar s/psuedo/pseudo/
 1.4 18-Nov-2021  thorpej Decorate the MIPS signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.3 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.2 28-Apr-2008  martin branches: 1.2.8; 1.2.14;
Remove clause 3 and 4 from TNF licenses
 1.1 02-Nov-2003  christos branches: 1.1.32;
Add userland portion of siginfo for mips. Many thanks to simon for letting
me use his machines down under.
 1.1.32.1 18-May-2008  yamt sync with head.
 1.2.14.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 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 __sigtramp2.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.4 19-Feb-2021  simonb Remove the incorrect register shuffle - we pass SYS___syscall as the
syscall number in v0 and pass all the original __syscall() args in their
original slots/regs.
 1.3 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.2 31-Jan-2014  matt branches: 1.2.26;
Since N32/N64 pass the first 8 arguments in registers, we can load all
the arguments into those registers before invoking the syscall having
the kernel syscall handler from having to do that.
 1.1 13-Dec-2000  simonb branches: 1.1.60; 1.1.66;
Another bare minimum __syscall.
 1.1.66.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.60.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.2.26.1 21-Apr-2020  martin Sync with HEAD
 1.6 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.5 07-Aug-2003  agc branches: 1.5.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.3 13-Dec-2000  simonb branches: 1.3.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.2 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.1 04-Jan-1998  thorpej Add syscall stubs for __vfork14(). These are basically copies of Ovfork.S
with the syscall numbers changed.

Since 4.4BSD vfork(2) did not share address space, Ovfork.S could be changed
to be identical to fork.S (modulo syscall numbers). __vfork14.S, however,
needs to remain separate since with a shared address space, the stub needs to
pre-decrement the stack and do an indirect jump to the return address, so that
the shared stackframe is still there when the parent returns. (Obviously,
this does not apply to systems which to not build stackframes on leaf calls.)
 1.3.2.1 11-Nov-2002  nathanw Catch up to -current
 1.5.46.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.5.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.18 12-Dec-2010  tsutsui brk(2) should update __curbrk, not __minbrk or garbage.
 1.17 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.16 07-Aug-2003  agc branches: 1.16.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.15 23-May-2003  simonb Match END label with LEAF label.
 1.14 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.13 13-Dec-2000  simonb branches: 1.13.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.12 04-Jul-2000  kleink Missed in previous: replace the previously used _brk label with an ordinary
local label; problem noticed by Matthias Drochner.
 1.11 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.10 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.9 31-Mar-1999  kleink branches: 1.9.10;
Change references to `end' to `_end' as not to invade (or being invaded by)
the user's name space.
 1.8 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.7 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.6 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.5 25-Sep-1995  jonathan Fix an old bug, whereby ASMSTR() was used before #including "SYS.h", where
it was defined.
 1.4 20-Mar-1995  mycroft SYS_brk -> SYS_break, and other (minor) changes.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.9.10.1 22-Aug-2000  kleink Pull up revs. 1.10-1.12 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.13.2.1 11-Nov-2002  nathanw Catch up to -current
 1.16.46.4 29-Apr-2011  matt Pull in fixes from -current.
 1.16.46.3 05-Sep-2009  matt LP64 cleanup --> s/la/PTR_LA/
 1.16.46.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.16.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.21 03-Dec-2022  skrll Trailing whitespace
 1.20 06-Feb-2021  simonb For mips n32/n64 explicitly save the GP reg on the stack, and
restore it _after_ the call to __errno(). Fixes sending the
__errno() call off to nowhereland when this code is included
in another library (eg __posix_cerror() in libposix). Failure
picked up by the ATF lib/libposix/posix1/t_rename test.
 1.19 12-Sep-2013  joerg branches: 1.19.18; 1.19.28;
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.18 27-Feb-2012  tsutsui branches: 1.18.2;
Fix pasto.
 1.17 27-Feb-2012  joerg Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
 1.16 17-Jan-2011  matt branches: 1.16.6; 1.16.8;
Make __cerror hidden.
 1.15 03-Sep-2010  matt Pullup fixes from matt-nb5-mips64.
This makes setjmp/longjmp work again.
 1.14 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.13 07-Aug-2003  agc branches: 1.13.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 07-Feb-2003  cgd looks like nobody ever seriously tried the _REENTRANT version of this
code (which, uh, seems the default for a fresh build)... it wasn't
setting up v1 properly (the instruction to set up v1 was after the
return jump, in "reorder" code... i.e. after the end of the function).
That would break error returns from 64-bit syscalls (e.g. checks
in dd and who knows what else) to see if input or output are pipes.
It looks like the non-_REENTRANT version was broken (on the nathanw-sa
branch) in rev 1.9.2.1 and fixed in 1.9.2.2, but the _REENTRANT version
was never fixed, and the broken bits were merged back on to the trunk.
 1.11 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.10 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.9 13-Dec-2000  simonb branches: 1.9.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.8 29-May-2000  castor Make __cerror be LEAF_NOPROFILE. I relies upon having v0 and v1 be unchanged
from the caller. From Ethan Solomita <ethan@geocast.com>
 1.7 14-Jan-1999  kleink branches: 1.7.8;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 25-Jul-1998  jonathan From Arne Juul <arnej@math.ntnu.no>:
Explicilty reload the mips-ABIcall GOT/$gp in cerror().
cerror() gets called from outside libc (e.g., from libposix's rename(),
and if we don't load $t9, cerror() makes wild references using
the libposix $gp and coredumps.
 1.5 17-Sep-1996  jonathan branches: 1.5.4;
* Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.4.1 27-Sep-1998  cgd pull up rev 1.6 from trunk (jonathan).
 1.7.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.2.3 20-Nov-2002  wdk Tidy up stack frame
 1.9.2.2 11-Nov-2002  nathanw Catch up to -current
 1.9.2.1 02-Jan-2002  wdk Use __errno() in order to be thread compliant.

Fixes bug in errno1 thread regression test
 1.13.46.5 16-Mar-2010  matt Restore GP before calling __errno() and then do a normal return (since gp is
only used to obtain address of __errno and never used afterwards). Otherwise
since __errno overwrites t3 we would restore a bogus gp value.

Bug reported by Juli Mallett from FreeBSD.
 1.13.46.4 05-Sep-2009  matt LP64 cleanup --> s/la/PTR_LA/
 1.13.46.3 24-Aug-2009  matt Fix an O32'ism. Store the error into the S0 slot, not the arguments array
above us (since that doesn't always exist in NewABI).
 1.13.46.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.13.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.16.8.2 27-Feb-2012  bouyer Pull up following revision(s) (requested by oster in ticket #61):
lib/libc/arch/mips/sys/cerror.S: revision 1.18
Fix pasto.
 1.16.8.1 27-Feb-2012  riz Pull up following revision(s) (requested by joerg in ticket #57):
lib/libc/arch/arm/sys/cerror.S: revision 1.8
lib/libc/arch/vax/SYS.h: revision 1.12
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.3
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.4
lib/libc/arch/i386/sys/cerror.S: revision 1.16
lib/libc/arch/x86_64/sys/cerror.S: revision 1.5
lib/libc/arch/powerpc/sys/cerror.S: revision 1.10
lib/libc/arch/mips/sys/cerror.S: revision 1.17
lib/libc/arch/powerpc/sys/cerror.S: revision 1.9
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.16.6.2 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.16.6.1 17-Apr-2012  yamt sync with head
 1.18.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.28.1 06-Feb-2021  martin Pull up following revision(s) (requested by simonb in ticket #1199):

lib/libc/arch/mips/sys/cerror.S: revision 1.20

For mips n32/n64 explicitly save the GP reg on the stack, and
restore it _after_ the call to __errno(). Fixes sending the
__errno() call off to nowhereland when this code is included
in another library (eg __posix_cerror() in libposix). Failure
picked up by the ATF lib/libposix/posix1/t_rename test.
 1.19.18.1 06-Feb-2021  martin Pull up following revision(s) (requested by simonb in ticket #1648):

lib/libc/arch/mips/sys/cerror.S: revision 1.20

For mips n32/n64 explicitly save the GP reg on the stack, and
restore it _after_ the call to __errno(). Fixes sending the
__errno() call off to nowhereland when this code is included
in another library (eg __posix_cerror() in libposix). Failure
picked up by the ATF lib/libposix/posix1/t_rename test.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.11 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.10 14-Dec-2009  matt branches: 1.10.28; 1.10.32;
Merge from matt-nb5-mips64.
 1.9 07-Aug-2003  agc branches: 1.9.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.7 13-Dec-2000  simonb branches: 1.7.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.6 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.7.2.1 11-Nov-2002  nathanw Catch up to -current
 1.9.46.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.9.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.10.32.1 21-Apr-2017  bouyer Sync with HEAD
 1.10.28.1 20-Mar-2017  pgoyette Sync with HEAD
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.12 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.11 07-Aug-2003  agc branches: 1.11.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.9 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.8 13-Dec-2000  simonb branches: 1.8.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.7 26-Jun-2000  kleink Need an internal name for fork().
 1.6 14-Jan-1999  kleink branches: 1.6.10;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.6.10.1 22-Aug-2000  kleink Pull up rev. 1.7 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.8.2.1 11-Nov-2002  nathanw Catch up to -current
 1.11.46.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.11.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.7 15-Oct-2020  skrll Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
 1.6 12-Aug-2016  skrll Provide _OFFSETOF_UC_GREGS_GP and use _OFFSETOF_UC_GREGS_* in getcontext
 1.5 10-Aug-2016  skrll We need to save the GP of the caller in the context for n32/n64
 1.4 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.3 28-Apr-2008  martin branches: 1.3.8; 1.3.14;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.32;
Merge the nathanw_sa branch.
 1.1 20-Nov-2001  wdk branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.4 05-Jan-2003  wdk Tidy up delay slot usage
 1.1.2.3 24-Nov-2001  wdk No PIC references in function, so remove PIC_PROLOGUE setup.
Also guarantees patent $gp is saved with the context instead of the $gp
local to _getcontext().
 1.1.2.2 21-Nov-2001  wdk ucontext support Klaus Klein <kleink@netbsd.org>
 1.1.2.1 20-Nov-2001  wdk MIPS specific context functions and LWP support

Compile tested only.
 1.2.32.1 18-May-2008  yamt sync with head.
 1.3.14.2 18-Aug-2009  uebayasi Include assym.h for _OFFSETOF_UC_GREGS.
 1.3.14.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.2 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.12 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.11 22-Apr-2005  simonb branches: 1.11.34;
Use the same function name in the LEAF() and END() directives.
 1.10 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.9 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.8 13-Dec-2000  simonb branches: 1.8.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.7 28-Sep-2000  kleink Need an internal name for pipe(2).
 1.6 14-Jan-1999  kleink branches: 1.6.10;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.6.10.1 29-Sep-2000  kleink Pull up rev. 1.7 (approved by thorpej):
Add internal name for pipe().
 1.8.2.1 11-Nov-2002  nathanw Catch up to -current
 1.11.34.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.11.34.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.10 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.9 07-Aug-2003  agc branches: 1.9.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.7 13-Dec-2000  simonb branches: 1.7.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.6 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.7.2.1 11-Nov-2002  nathanw Catch up to -current
 1.9.46.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.9.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.6 11-Nov-1996  mycroft Treat reboot() like a normal system call. From PR 2458.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.19 26-Jun-2013  matt Use t1 instead of v1
 1.18 12-Dec-2010  tsutsui branches: 1.18.6; 1.18.12;
We can't assume syscall retains t0, unless it's documented as ABI.
 1.17 14-Dec-2009  matt Merge from matt-nb5-mips64.
 1.16 22-Apr-2005  simonb branches: 1.16.34;
Use the same function name in the LEAF() and END() directives.
 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 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.13 13-Dec-2000  simonb branches: 1.13.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.12 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.11 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.10 31-Mar-1999  kleink branches: 1.10.10;
Change references to `end' to `_end' as not to invade (or being invaded by)
the user's name space.
 1.9 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.8 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.7 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.6 25-Sep-1995  jonathan Fix an old bug, whereby ASMSTR() was used before #including "SYS.h", where
it was defined.
 1.5 20-Mar-1995  mycroft SYS_brk -> SYS_break, and other (minor) changes.
 1.4 15-Dec-1994  mycroft More underscores...
 1.3 28-Nov-1994  dean more underscore changes.
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.10.10.1 22-Aug-2000  kleink Pull up revs. 1.11-1.12 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.13.2.1 11-Nov-2002  nathanw Catch up to -current
 1.16.34.4 29-Apr-2011  matt Pull in fixes from -current.
 1.16.34.3 05-Sep-2009  matt LP64 cleanup --> s/la/PTR_LA/
 1.16.34.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.16.34.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.18.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.6.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.5 01-Mar-1995  mycroft Clean up deleted files.
 1.4 15-Dec-1994  mycroft More underscores...
 1.3 28-Nov-1994  dean more underscore changes.
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.10 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.9 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.8 13-Dec-2000  simonb branches: 1.8.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.7 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 16-Oct-1996  jonathan Add missing "t9, " to "la" insn in error-return case.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8.2.1 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.1 07-Jul-2000  itohy Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.2 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.3 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.1 28-Sep-1998  thorpej sigaction() that calls the compat syscall (jonathan forgot to commit this).
 1.12 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 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 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.9 13-Dec-2000  simonb branches: 1.9.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.8 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.7 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.6 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.9.2.1 11-Nov-2002  nathanw Catch up to -current
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.12 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 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 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.9 13-Dec-2000  simonb branches: 1.9.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.8 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.7 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.6 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.9.2.1 11-Nov-2002  nathanw Catch up to -current
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.9 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 1.8 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 1.7 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.6 13-Dec-2000  simonb Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.5 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.4 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.3 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.2 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.12 17-Sep-2005  tsutsui Switch mips to the new libc compat code layout.
 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 10-Nov-2002  thorpej ABICALLS -> __ABICALLS__
 1.9 13-Dec-2000  simonb branches: 1.9.2;
Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.8 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.7 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.6 27-Sep-1998  jonathan mips libc stubs for sig*14 signal API (128bit sigset_t),
plus backward-compatibility for the old 1.3 libc entrypoints.
 1.5 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.4 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.9.2.1 11-Nov-2002  nathanw Catch up to -current
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 15-Dec-1994  mycroft More underscores...
 1.2 14-Nov-1994  dean Prepended underscores
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.8 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.7 31-Jan-2014  matt branches: 1.7.26;
Since N32/N64 pass the first 8 arguments in registers, we can load all
the arguments into those registers before invoking the syscall having
the kernel syscall handler from having to do that.
 1.6 14-Dec-2009  matt branches: 1.6.6; 1.6.12;
Merge from matt-nb5-mips64.
 1.5 07-Aug-2003  agc branches: 1.5.46;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 13-Dec-2000  simonb Remove all the .abicalls assembler directives - "SYS.h" already has that.
 1.3 17-Sep-1996  jonathan * Add Mips ABI changes for ELf shared library support.
From OpenBSD, patched into NetBSD by <bouyer@ensta.fr>.
* Include generic NetBSD/mips <mips/*.h> files, instead of old Sprite names.
 1.2 16-Sep-1996  jonathan Add NetBSD RCSid headers, and change assembly-code LIBC_SCCS id tag string
from "Id:" to "NetBSD:".
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.5.46.2 18-Aug-2009  matt Cleanup RCSIDs.
Use SYSTRAP instead li v0, SYS_*; syscall since that's what SYSTRAP does.
 1.5.46.1 16-Aug-2009  matt Move to new ABI agnostic mechanisms. Get rid of magic constants.
Use genassym.cf to generate them.
 1.6.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.6.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.26.1 21-Apr-2020  martin Sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 24-May-1994  glass libc support for mips. libkern hooks are disabled
 1.3 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.2 05-Sep-2014  matt The OpenRISC calling standard only passes 6 parameters by register. Any
others are passed on the stack. NetBSD syscalls use up to 8 parameters
so that could mean two left on the stack for the kernel to access. It's
easier for the kernel if userland could fetch into registers beforehand.
So we generate sysassym.h which contains the number of arguments for each
syscall and then use that to determine how many arguments need to be fetched
from the stack.
 1.1 03-Sep-2014  matt New files for OR1K support
 1.2 05-Sep-2014  matt The OpenRISC calling standard only passes 6 parameters by register. Any
others are passed on the stack. NetBSD syscalls use up to 8 parameters
so that could mean two left on the stack for the kernel to access. It's
easier for the kernel if userland could fetch into registers beforehand.
So we generate sysassym.h which contains the number of arguments for each
syscall and then use that to determine how many arguments need to be fetched
from the stack.
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 05-Sep-2014  matt The OpenRISC calling standard only passes 6 parameters by register. Any
others are passed on the stack. NetBSD syscalls use up to 8 parameters
so that could mean two left on the stack for the kernel to access. It's
easier for the kernel if userland could fetch into registers beforehand.
So we generate sysassym.h which contains the number of arguments for each
syscall and then use that to determine how many arguments need to be fetched
from the stack.
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.2 14-Sep-2023  rin libc/arch: Fix copy-paste; or1k, powerpc64, riscv are not powerpc ;)
 1.1 03-Sep-2014  matt New files for OR1K support
 1.2 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.2 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.1 03-Sep-2014  matt branches: 1.1.28;
New files for OR1K support
 1.1.28.1 02-Aug-2025  perseant Sync with HEAD
 1.1 03-Sep-2014  matt New files for OR1K support
 1.2 19-Mar-2015  joerg Call libc's fpgetround.
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.2 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.2 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.1 03-Sep-2014  matt branches: 1.1.16;
New files for OR1K support
 1.1.16.1 21-Apr-2020  martin Sync with HEAD
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.2 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.1 03-Sep-2014  matt branches: 1.1.2; 1.1.4;
New files for OR1K support
 1.1.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.1.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.1 03-Sep-2014  matt New files for OR1K support
 1.15 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.14 30-Aug-2013  matt Use a constructor to get the cache_info.
However memset can be called before the constructor is called, just treat
those as simple fills.
Add CACHE_INFO_DCACHE_LINE_SIZE to assym.h and use it
 1.13 17-Jan-2011  matt branches: 1.13.6; 1.13.12;
Kill _NOREGNAMES. Everything should be using %rX now. If it doesn't it
soon will.
 1.12 16-Jan-2011  matt Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
 1.11 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.10 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.9 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.8 09-Dec-2004  simonb libgcc has __fixunsdfsi and __fixunssfsi, so don't build
the softfloat versions of these.

Fixes PR toolchain/24509 from Masao Uebayashi.
 1.7 25-Sep-2003  matt Add siginfo signal trampoline.
 1.6 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.5 20-Feb-2002  eeh Add bzero.S and strlen.S to the stuff that gets installed in libkern.
 1.4 25-Nov-2001  mjl Add PPC assembler routines for ffs(3), bzero(3) and memset(3).
 1.3 18-Jun-2001  simonb Compile in soft-float support if MKSOFTFLOAT != "no".
 1.2 17-Apr-1999  ws branches: 1.2.10;
Modify syncicache on PowerPC from an inline to a real function.
Support different cache line sizes with the same object code in userland.
While here, move the function to implementation name space.
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.2.10.5 01-Aug-2002  nathanw Catch up to -current.
 1.2.10.4 22-Mar-2002  nathanw Catch up to -current.
 1.2.10.3 08-Mar-2002  nathanw Catch up to -current.
 1.2.10.2 28-Jan-2002  nathanw Catch up to -current.
 1.2.10.1 08-Oct-2001  nathanw Catch up to -current.
 1.13.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.6.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 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.12 15-Jan-2011  matt branches: 1.12.24;
Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.11 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.10 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.9 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.8 14-Jan-2002  thorpej branches: 1.8.2;
* Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.7 14-Jan-1999  kleink branches: 1.7.12;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 25-May-1998  ws Use asm.h defines for labels
 1.5 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.4 03-Feb-1998  thorpej Clean up _SYSCALL_NOERROR() a bit.
 1.3 16-Jul-1997  kleink Fix typo from last commit: `bnlsr' vs. 'bnslr'.
 1.2 02-May-1997  kleink Consistency: distinguish between PSEUDO() and PSEUDO_NOERROR().
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.7.12.3 01-Aug-2002  nathanw Catch up to -current.
 1.7.12.2 21-Jun-2002  nathanw Catch up to -current.
 1.7.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.8.2.1 23-Jul-2004  tron Pull up revision 1.11 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.12.24.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.6 21-Nov-2021  thorpej Decorate the powerpc signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.5 28-Feb-2018  uwe PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.

(oops, forgot to commit this along with swapcontext.S)
 1.4 30-Aug-2013  matt branches: 1.4.4; 1.4.18;
Use a constructor to get the cache_info.
However memset can be called before the constructor is called, just treat
those as simple fills.
Add CACHE_INFO_DCACHE_LINE_SIZE to assym.h and use it
 1.3 18-Jan-2011  matt branches: 1.3.6; 1.3.8; 1.3.12;
Change to deal with callframe changes
 1.2 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.1 14-Jan-2011  matt Generate symbol constants for UC_GREGS_* and CALLFRAME*.
 1.3.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 13-Mar-2018  snj Pull up following revision(s) (requested by uwe in ticket #1534):
lib/libc/arch/powerpc/genassym.cf: 1.5 via patch
lib/libc/arch/powerpc/gen/swapcontext.S: 1.8 via patch
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
 1.3.6.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.4.18.1 01-Mar-2018  martin Pull up following revision(s) (requested by uwe in ticket #596):
lib/libc/arch/powerpc/genassym.cf: revision 1.5
lib/libc/arch/powerpc/gen/swapcontext.S: revision 1.8
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
(oops, forgot to commit this along with swapcontext.S)
 1.4.4.1 03-Mar-2018  snj Pull up following revision(s) (requested by uwe in ticket #1576):
lib/libc/arch/powerpc/genassym.cf: 1.8 1.5
lib/libc/arch/powerpc/gen/swapcontext.S: 1.8
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.26 28-Jan-2014  macallan split fabs.c into hardfloat .S and softfloat .c as requested by joerg
 1.25 12-Mar-2011  matt branches: 1.25.4; 1.25.10;
Add PPC TLS support. Add -D_LIBC_SOURCE for tls.c and _lwp.c (powerpc)
so that __lwp_gettcb_fast and __lwp_settcb inlines are define.
 1.24 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.23 28-Jun-2006  drochner build frexp/ldexp/modf in the "compat" part (code is identical)
(These are the easy cases where no assembler implementations exist.)
 1.22 18-Feb-2006  matt *setjmp14 are not compat, plain setjmp/sigsetjmp are the compat versions.
Exchange the files.
 1.21 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.20 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.19 04-Mar-2004  kleink branches: 1.19.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.18 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.17 23-Nov-2003  scw s/!=/==/

The last fix wasn't quite right, but happened to work for me due
to stale dependencies...

Reported by Markus W Kilbinger.
 1.16 21-Nov-2003  scw Don't compile fp*.c if doing a soft-float build.
 1.15 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.14 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.13 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.12 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.11 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.10 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.9 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.8 25-May-2001  simonb Handle soft-float case, code from David Querbach of Real-Time Systems Inc.
 1.7 23-Dec-1999  kleink branches: 1.7.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.6 07-Jul-1999  danw add the ieeefp functions
 1.5 17-Apr-1999  ws Modify syncicache on PowerPC from an inline to a real function.
Support different cache line sizes with the same object code in userland.
While here, move the function to implementation name space.
 1.4 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.3 26-Nov-1998  sakamoto Add frexp.c and modf.c.
 1.2 03-Oct-1998  tsubai New signal stuff for PowerPC.
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.7.6.4 22-Mar-2002  nathanw Catch up to -current.
 1.7.6.3 08-Mar-2002  nathanw Catch up to -current.
 1.7.6.2 08-Nov-2001  briggs Build resumecontext.c _lwp.c getcontext.S makecontext.c swapcontext.S
 1.7.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.19.6.1 19-Apr-2005  tron Pull up revision 1.20 (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.25.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.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.6 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.5 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.4 18-Feb-2006  matt *setjmp14 are not compat, plain setjmp/sigsetjmp are the compat versions.
Exchange the files.
 1.3 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.2 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.1 03-Oct-1998  tsubai branches: 1.1.12; 1.1.14;
New signal stuff for PowerPC.
 1.1.14.1 23-Jul-2004  tron Pull up revision 1.2 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.1.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.6 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.5 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.4 18-Feb-2006  matt *setjmp14 are not compat, plain setjmp/sigsetjmp are the compat versions.
Exchange the files.
 1.3 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.2 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.1 03-Oct-1998  tsubai branches: 1.1.12; 1.1.14;
New signal stuff for PowerPC.
 1.1.14.1 23-Jul-2004  tron Pull up revision 1.2 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.1.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.9 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.8 22-Jun-2020  rin branches: 1.8.8;
Turn on _UC_TLSBASE for sure in the same manner as other ports.
No functional changes since that flag is turned on via getcontext(2).
 1.7 22-Mar-2012  matt Make lint happy.
While here, make sure the top of stack is aligned properly.
 1.6 12-Mar-2011  matt branches: 1.6.4;
Add PPC TLS support. Add -D_LIBC_SOURCE for tls.c and _lwp.c (powerpc)
so that __lwp_gettcb_fast and __lwp_settcb inlines are define.
 1.5 24-Feb-2011  joerg 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.4 12-Jun-2005  lukem branches: 1.4.40;
Add missing __RCSID()
 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 08-Nov-2001  briggs branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.1 08-Nov-2001  briggs _lwp_makecontext()
 1.4.40.1 05-Mar-2011  bouyer Sync with HEAD
 1.6.4.1 17-Apr-2012  yamt sync with head
 1.8.8.1 02-Aug-2025  perseant Sync with HEAD
 1.3 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.2 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.1 29-Mar-1997  thorpej branches: 1.1.14; 1.1.16;
Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.1.16.1 23-Jul-2004  tron Pull up revision 1.2 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.1.14.1 01-Aug-2002  nathanw Catch up to -current.
 1.3 25-May-2001  simonb Handle soft-float case, code from David Querbach of Real-Time Systems Inc.
 1.2 25-May-1998  ws branches: 1.2.12;
Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.2.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.5 28-Jan-2014  macallan split fabs.c into hardfloat .S and softfloat .c as requested by joerg
 1.4 24-Dec-2005  perry branches: 1.4.44; 1.4.50;
__asm__ -> __asm
 1.3 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 25-May-2001  tsubai branches: 1.2.2;
Correct input and output of asm.
 1.1 25-May-2001  simonb Handle soft-float case, code from David Querbach of Real-Time Systems Inc.
 1.2.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.2.2.1 25-May-2001  nathanw file fabs.c was added on branch nathanw_sa on 2001-10-08 20:17:54 +0000
 1.4.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.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.2 07-Nov-2018  riastradh On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.

For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm. For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64. Need help from an itanium
wizard! Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.
 1.1 28-Jan-2014  macallan branches: 1.1.4; 1.1.8; 1.1.28; 1.1.30;
split fabs.c into hardfloat .S and softfloat .c as requested by joerg
 1.1.30.1 10-Jun-2019  christos Sync with HEAD
 1.1.28.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 28-Jan-2014  tls file fabs_ieee754.S was added on branch tls-maxphys on 2014-08-20 00:02:11 +0000
 1.1.4.2 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.1.4.1 28-Jan-2014  yamt file fabs_ieee754.S was added on branch yamt-pagecache on 2014-05-22 11:36:48 +0000
 1.2 28-Jan-2014  macallan no need to duplicate the generic fabs_ieee754.c here
 1.1 28-Jan-2014  macallan split fabs.c into hardfloat .S and softfloat .c as requested by joerg
 1.12 19-Mar-2015  joerg Call libc's fpgetround.
 1.11 10-Jul-2011  matt branches: 1.11.20;
Don't use "f" with non-fp types. Use a union to go between
double and uint64_t. Makes clang happy.
 1.10 24-Dec-2005  perry __asm__ -> __asm
 1.9 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.8 12-Jun-2005  lukem Add missing __RCSID()
 1.7 04-Apr-2004  matt Suppress a lint warning.
 1.6 22-Feb-2002  kleink Do without stfiwx; per PEM32 Rev. 1 it's an optional part of the UISA,
and not implemented on the 601.
 1.5 25-May-2001  simonb Handle soft-float case, from the arm flt_rounds.c.
 1.4 07-Jul-1999  danw branches: 1.4.10;
mark an asm statement volatile so it doesn't get optimized out
 1.3 09-Aug-1998  tsubai s/asm/__asm/
 1.2 03-Feb-1998  mycroft Need float.h for prototypes.
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.4.10.3 22-Mar-2002  nathanw Catch up to -current.
 1.4.10.2 08-Mar-2002  nathanw Catch up to -current.
 1.4.10.1 08-Oct-2001  nathanw Catch up to -current.
 1.11.20.1 21-Mar-2015  snj Pull up following revision(s) (requested by joerg in ticket #632):
lib/libc/arch/arm/gen/flt_rounds.c: revision 1.5
lib/libc/arch/mips/gen/flt_rounds.c: revision 1.9
lib/libc/arch/powerpc/gen/flt_rounds.c: revision 1.12
lib/libc/arch/powerpc64/gen/flt_rounds.c: revision 1.2
lib/libc/arch/sh3/gen/flt_rounds.c: revision 1.6
Call libc's fpgetround.
 1.10 10-Jul-2011  matt Don't use "f" with non-fp types. Use a union to go between
double and uint64_t. Makes clang happy.
 1.9 28-Apr-2008  martin branches: 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 24-Dec-2005  perry branches: 1.8.18;
__asm__ -> __asm
 1.7 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 12-Jun-2005  lukem Add missing __RCSID()
 1.5 04-Apr-2004  matt Supress a few lint warnings. s/u_int64_t/uint64_t/
 1.4 02-Apr-2004  matt Rather than use magic values, include <powerpc/fpu.h> and use those
definitions to generate the magic bits.
 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 08-Feb-2001  wiz branches: 1.2.2;
Add some casts to make lint shut up. Reviewed by christos.
 1.1 07-Jul-1999  danw add the ieeefp functions
 1.2.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.8.18.1 18-May-2008  yamt sync with head.
 1.9.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9.8.1 28-Apr-2008  martin file fpgetmask.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.10 10-Jul-2011  matt Don't use "f" with non-fp types. Use a union to go between
double and uint64_t. Makes clang happy.
 1.9 28-Apr-2008  martin branches: 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 24-Dec-2005  perry branches: 1.8.18;
__asm__ -> __asm
 1.7 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 12-Jun-2005  lukem Add missing __RCSID()
 1.5 04-Apr-2004  matt Supress a few lint warnings. s/u_int64_t/uint64_t/
 1.4 02-Apr-2004  matt Rather than use magic values, include <powerpc/fpu.h> and use those
definitions to generate the magic bits.
 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 08-Feb-2001  wiz branches: 1.2.2;
Add some casts to make lint shut up. Reviewed by christos.
 1.1 07-Jul-1999  danw add the ieeefp functions
 1.2.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.8.18.1 18-May-2008  yamt sync with head.
 1.9.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9.8.1 28-Apr-2008  martin file fpgetround.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.10 10-Jul-2011  matt Don't use "f" with non-fp types. Use a union to go between
double and uint64_t. Makes clang happy.
 1.9 28-Apr-2008  martin branches: 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 24-Dec-2005  perry branches: 1.8.18;
__asm__ -> __asm
 1.7 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 12-Jun-2005  lukem Add missing __RCSID()
 1.5 04-Apr-2004  matt Supress a few lint warnings. s/u_int64_t/uint64_t/
 1.4 02-Apr-2004  matt Rather than use magic values, include <powerpc/fpu.h> and use those
definitions to generate the magic bits.
 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 08-Feb-2001  wiz branches: 1.2.2;
Add some casts to make lint shut up. Reviewed by christos.
 1.1 07-Jul-1999  danw add the ieeefp functions
 1.2.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.8.18.1 18-May-2008  yamt sync with head.
 1.9.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9.8.1 28-Apr-2008  martin file fpgetsticky.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.11 27-Feb-2017  chs have fpsetmask() change the FE0/FE1 MSR bits to precise mode if any
FP exceptions are enabled. fix the kernel emulation of mfmsr and mtmsr
to use the correct opcodes for these instructions. ignore PSL_FE
(the FP enable bit) in the MSR that a user program tries to set,
since it will naturally be set for FP-using processes but
we can't let the user process manage that bit.
 1.10 10-Jul-2011  matt branches: 1.10.24; 1.10.28;
Don't use "f" with non-fp types. Use a union to go between
double and uint64_t. Makes clang happy.
 1.9 28-Apr-2008  martin branches: 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 24-Dec-2005  perry branches: 1.8.18;
__asm__ -> __asm
 1.7 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 12-Jun-2005  lukem Add missing __RCSID()
 1.5 04-Apr-2004  matt Lint cleanup. s/u_int64_t/uint64_t
 1.4 02-Apr-2004  matt Rather than use magic values, include <powerpc/fpu.h> and use those
definitions to generate the magic bits.
 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 08-Feb-2001  wiz branches: 1.2.2;
Add some casts to make lint shut up. Reviewed by christos.
 1.1 07-Jul-1999  danw add the ieeefp functions
 1.2.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.8.18.1 18-May-2008  yamt sync with head.
 1.9.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9.8.1 28-Apr-2008  martin file fpsetmask.c was added on branch christos-time_t on 2008-04-28 20:22:57 +0000
 1.10.28.1 21-Apr-2017  bouyer Sync with HEAD
 1.10.24.1 20-Mar-2017  pgoyette Sync with HEAD
 1.10 10-Jul-2011  matt Don't use "f" with non-fp types. Use a union to go between
double and uint64_t. Makes clang happy.
 1.9 28-Apr-2008  martin branches: 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 24-Dec-2005  perry branches: 1.8.18;
__asm__ -> __asm
 1.7 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 12-Jun-2005  lukem Add missing __RCSID()
 1.5 04-Apr-2004  matt Lint cleanup. s/u_int64_t/uint64_t
 1.4 02-Apr-2004  matt Rather than use magic values, include <powerpc/fpu.h> and use those
definitions to generate the magic bits.
 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 08-Feb-2001  wiz branches: 1.2.2;
Add some casts to make lint shut up. Reviewed by christos.
 1.1 07-Jul-1999  danw add the ieeefp functions
 1.2.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.8.18.1 18-May-2008  yamt sync with head.
 1.9.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9.8.1 28-Apr-2008  martin file fpsetround.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.11 10-Jul-2011  matt Don't use "f" with non-fp types. Use a union to go between
double and uint64_t. Makes clang happy.
 1.10 28-Apr-2008  martin branches: 1.10.8;
Remove clause 3 and 4 from TNF licenses
 1.9 24-Dec-2005  perry branches: 1.9.18;
__asm__ -> __asm
 1.8 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.7 12-Jun-2005  lukem Add missing __RCSID()
 1.6 04-Apr-2004  matt Update FPSCR_FX consistently per the Programming Environment Manual. So
if any sticky bit is set, FPSCR_FX should be set. If no sticky bits are
set, then FPSCR_FX should be clear.
 1.5 04-Apr-2004  matt Deal with the way FP_X_INV works. That maps to FPSCR_VX. However FPSCR_VX
is not a sticky, it's actually an inclusive OR of 9 stick bits. So when
FP_X_INV is cleared, we need to clear all of those bits. When FP_X_INV is
set, we set all of them.
 1.4 02-Apr-2004  matt Rather than use magic values, include <powerpc/fpu.h> and use those
definitions to generate the magic bits.
 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 08-Feb-2001  wiz branches: 1.2.2;
Add some casts to make lint shut up. Reviewed by christos.
 1.1 07-Jul-1999  danw add the ieeefp functions
 1.2.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.9.18.1 18-May-2008  yamt sync with head.
 1.10.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10.8.1 28-Apr-2008  martin file fpsetsticky.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.5 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.4 29-Aug-1999  mycroft branches: 1.4.10;
Trivial KNF.
 1.3 29-Aug-1999  mycroft Make the C version of frexp() consitent across platforms, and handle the
Inf/NaN case.
 1.2 10-Mar-1999  mycroft Use ieee.h structs and macros.
 1.1 26-Nov-1998  sakamoto Add frexp.c and modf.c.
 1.4.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.1 08-Nov-2001  briggs branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.2 09-Nov-2001  briggs As pointed out by Klaus Klein <kleink@netbsd.org> in private email,
getcontext.S should live in sys as it is a userland wrapper around
the actual syscall.
 1.1.2.1 08-Nov-2001  briggs get/make/swap/resumecontext() from Klaus Klein <kleink@netbsd.org>
 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 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.5.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.7 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.6 22-Jan-2000  mycroft branches: 1.6.6;
Delint.
 1.5 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.4 14-Nov-1998  christos delint
 1.3 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.2 13-Jul-1997  christos Add missing math.h include
Fix RCSID's
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.6.6.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 22-Jan-2000  mycroft branches: 1.5.6;
Delint.
 1.4 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.3 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.2 13-Jul-1997  christos Fix RCSID's
Add missing math.h include
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.5.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.11 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.10 07-Nov-2001  mjl fix for -Wshadow
 1.9 30-Aug-1999  mycroft branches: 1.9.10;
Another microoptimization. Take advantage of the addition already having set
the flags for the <=0 comparison.
 1.8 30-Aug-1999  mycroft Reuse the trick of loading 0.0 (rather than 1.0) and then modifying the
exponent. It's a bit faster on some machines.
 1.7 30-Aug-1999  augustss Remove more unused mulexp variables.
 1.6 29-Aug-1999  mycroft ldexp(denormal, exp>1023) would generate the wrong result in all non-overflow
cases. Totally rework this code to fix this bug *and* make it faster.
 1.5 29-Aug-1999  mycroft Don't ever return -0.0.
 1.4 29-Aug-1999  mycroft Minor style change.
 1.3 10-Mar-1999  mycroft Just some minor cleanup.
 1.2 13-Jul-1997  christos Fix RCSID's
Add missing math.h include
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.9.10.2 08-Mar-2002  nathanw Catch up to -current.
 1.9.10.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 09-Oct-2003  kleink branches: 1.3.30;
Update to use symbolic register names.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 08-Nov-2001  briggs branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.2 17-Nov-2001  briggs Update comments.
 1.1.2.1 08-Nov-2001  briggs get/make/swap/resumecontext() from Klaus Klein <kleink@netbsd.org>
 1.3.30.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:58 +0000
 1.5 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.4 09-Feb-2001  wiz branches: 1.4.2;
De-lint. Reviewed by christos.
 1.3 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 13-Mar-2000  soren branches: 1.2.2;
Fix doubled 'the's.
 1.1 26-Nov-1998  sakamoto Add frexp.c and modf.c.
 1.2.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.2.1 08-Mar-2002  nathanw Catch up to -current.
 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.5 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Dec-2006  martin branches: 1.3.10;
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-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.2 18-Jan-2003  thorpej branches: 1.2.16;
Merge the nathanw_sa branch.
 1.1 08-Nov-2001  briggs branches: 1.1.2;
file resumecontext.c was initially added on branch nathanw_sa.
 1.1.2.1 08-Nov-2001  briggs get/make/swap/resumecontext() from Klaus Klein <kleink@netbsd.org>
 1.2.16.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #264):
lib/libc/arch/sh5/gen/resumecontext.c: revision 1.2
lib/libc/arch/sh3/gen/resumecontext.c: revision 1.3
lib/libc/arch/sparc/gen/resumecontext.c: revision 1.3
lib/libc/arch/powerpc/gen/resumecontext.c: revision 1.3
lib/libc/arch/arm/gen/resumecontext.c: revision 1.3
lib/libc/arch/mips/gen/resumecontext.c: revision 1.3
lib/libc/arch/vax/gen/resumecontext.c: revision 1.2
lib/libc/arch/powerpc64/gen/resumecontext.c: revision 1.2
lib/libc/arch/hppa/gen/resumecontext.c: revision 1.2
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:
-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.3.10.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.5 18-Feb-2006  matt *setjmp14 are not compat, plain setjmp/sigsetjmp are the compat versions.
Exchange the files.
 1.4 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.3 03-Oct-1998  tsubai branches: 1.3.12; 1.3.14;
New signal stuff for PowerPC.
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.3.14.1 23-Jul-2004  tron Pull up revision 1.4 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.3.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.7 18-Feb-2006  matt *setjmp14 are not compat, plain setjmp/sigsetjmp are the compat versions.
Exchange the files.
 1.6 09-Aug-2002  briggs Add a missing register prefix, noted by Makoto Fujiwara on the port-macppc
mailing list.
 1.5 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.4 03-Oct-1998  tsubai branches: 1.4.12; 1.4.14;
New signal stuff for PowerPC.
 1.3 02-Jul-1998  tsubai Add #include <sys/syscall.h> for "SYS_sigprocmask".
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.4.14.1 23-Jul-2004  tron Pull up revision 1.5 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.4.12.2 13-Aug-2002  nathanw Catch up to -current.
 1.4.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.8 28-Feb-2018  uwe PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
 1.7 12-Sep-2013  joerg branches: 1.7.4; 1.7.18;
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 16-Jan-2011  matt branches: 1.6.6; 1.6.8; 1.6.12;
Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
 1.5 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 03-Oct-2003  kleink branches: 1.3.30;
Convert to use register prefixes.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 08-Nov-2001  briggs branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 08-Nov-2001  briggs get/make/swap/resumecontext() from Klaus Klein <kleink@netbsd.org>
 1.3.30.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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.6.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.8.1 13-Mar-2018  snj Pull up following revision(s) (requested by uwe in ticket #1534):
lib/libc/arch/powerpc/genassym.cf: 1.5 via patch
lib/libc/arch/powerpc/gen/swapcontext.S: 1.8 via patch
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
 1.6.6.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.18.1 01-Mar-2018  martin Pull up following revision(s) (requested by uwe in ticket #596):
lib/libc/arch/powerpc/genassym.cf: revision 1.5
lib/libc/arch/powerpc/gen/swapcontext.S: revision 1.8
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
(oops, forgot to commit this along with swapcontext.S)
 1.7.4.1 03-Mar-2018  snj Pull up following revision(s) (requested by uwe in ticket #1576):
lib/libc/arch/powerpc/genassym.cf: 1.8 1.5
lib/libc/arch/powerpc/gen/swapcontext.S: 1.8
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually. Makes old context happy when it needs to do
more function calls after restore.
 1.15 18-Mar-2008  he When compiling for _STANDALONE, omit a bunch of headers which aren't really
needed and which trigger build problems.

(These two files should probably be unified and put under common/...)
 1.14 24-Dec-2005  perry branches: 1.14.10; 1.14.16;
__asm__ -> __asm
 1.13 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.12 11-Aug-2003  matt export size_t __getcachelinesize(void) for memset()
 1.11 26-Nov-2002  thorpej Need <stdlib.h> for abort() prototype.
 1.10 28-Mar-2002  matt Add sync before isync since the MPC74xx require it.
 1.9 26-Mar-2002  matt Use size_t in prototype (so this will be LP64 clean for PPC64 someday).
Calculate len separately for icache & dcache in case each has different
cacheline widths. Make the code for both loops the same except for the
dcbst/icbi. Deal with sizes >=2GB properly (like that'll happen but ...)
 1.8 18-Mar-2002  dbj make compile with _STANDALONE
 1.7 13-Mar-2002  eeh Remove leftover debug code. Oops.
 1.6 12-Mar-2002  eeh Use new CPU_CACHEINFO sysctl to get more detailed information about
cache layout.
 1.5 27-Aug-2001  matt Ansi'fy. (to make this compile under -Wstrict-prototypes)
 1.4 26-Jan-2001  wiz branches: 1.4.2;
delint (variable is only used for size, so make if size_t instead of int).
 1.3 29-Jun-2000  mrg sync with libkern version; <vm/vm.h> -> <uvm/uvm_extern.h>
 1.2 05-May-1999  tsubai * Add getcachelinesize() prototype.
* Make this compile with -D_STANDALONE.
 1.1 17-Apr-1999  ws Modify syncicache on PowerPC from an inline to a real function.
Support different cache line sizes with the same object code in userland.
While here, move the function to implementation name space.
 1.4.2.4 10-Dec-2002  thorpej Sync with HEAD.
 1.4.2.3 25-Apr-2002  nathanw Catch up to -current.
 1.4.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.4.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.14.16.1 24-Mar-2008  keiichi sync with head.
 1.14.10.1 23-Mar-2008  matt sync with HEAD
 1.1 30-Aug-2013  matt branches: 1.1.4; 1.1.8;
Use a constructor to get the cache_info.
However memset can be called before the constructor is called, just treat
those as simple fills.
Add CACHE_INFO_DCACHE_LINE_SIZE to assym.h and use it
 1.1.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 30-Aug-2013  tls file powerpc_initfini.c was added on branch tls-maxphys on 2014-08-20 00:02:11 +0000
 1.1.4.2 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.1.4.1 30-Aug-2013  yamt file powerpc_initfini.c was added on branch yamt-pagecache on 2014-05-22 11:36:48 +0000
 1.2 12-May-2003  kleink Build {h,n}to{n,h}{l,s}() into object code; addresses PR port-macppc/21541
from Tsuyoshi MOMOSE.
 1.1 29-Mar-1997  thorpej branches: 1.1.16;
Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.1.16.1 19-Jun-2003  grant Pull up revision 1.2 (requested by kleink in ticket #1288):

Build {h,n}to{n,h}{l,s}() into object code; addresses PR port-macppc/21541
from Tsuyoshi MOMOSE.
 1.1 25-May-2001  simonb Softfloat support files for PowerPC.
 1.2 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 25-May-2001  simonb Softfloat support files for PowerPC.
 1.2 21-Apr-2002  bjh21 All the versions of softfloat-specialize were practically identical, so replace
them with a single one.
 1.1 25-May-2001  simonb Softfloat support files for PowerPC.
 1.7 07-Jul-2011  matt Don't define a new enum. Just #define round_* to their FP_Rx instead.
 1.6 04-Jul-2011  matt Add __floatunsidf __floatunsisf __floatunsitf routines.
XXX i think they are correct but not sure.
 1.5 16-May-2006  mrg if SOFTFLOAT_FOR_GCC is not defined, don't declare float_detect_tininess.
 1.4 29-May-2002  eeh Fix conflict in definitions.
 1.3 12-May-2002  bjh21 Add SIGFPE support to SoftFloat, so fpsetmask/fpgetmask now work. A new
variable, float_exception_mask (#defined to _softfloat_float_exception_mask)
contains the current exception mask.
Also make the argument to float_raise into an fp_except.
Also synchronise file header comments between files.
 1.2 06-May-2002  bjh21 Consistently declare the types of float_rounding_mode and float_exception_flags
as fp_rnd and fp_except respectively.
 1.1 25-May-2001  simonb Softfloat support files for PowerPC.
 1.5 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.4 04-Aug-2008  matt branches: 1.4.6;
Add C99 functions imaxabs and imaxdiv.
 1.3 22-Mar-2006  drochner branches: 1.3.20;
build erand48_ieee754.c on everything but vax
 1.2 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1 05-Nov-1997  cgd branches: 1.1.2;
A foolish consistency... gen, net, and string all get MD sources
specified by including a Makefile.inc from the appropriate MD directory.
stdlib doesn't do that, but there's no reason that it shouldn't (and
it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>A foolish consistency... gen, net, and string all get MD sources
>specified by including a Makefile.inc from the appropriate MD directory.
>stdlib doesn't do that, but there's no reason that it shouldn't (and
>it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.1 05-Nov-1997  veego file Makefile.inc was added on branch netbsd-1-3 on 1997-11-08 21:56:41 +0000
 1.3.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.16 30-May-2022  rin Obsolete hack for evbppc to replace memcmp(9), memcpy(9), and memmove(9)
with strictly-aligned versions.

Now all 32-bit powerpc ports share the same libc binary.

This change together with the preceding similar change in libkern slightly
improve performance for DHT (ibm4xx/405GP) and RB800 (MPC8533E).

See changes in bytebench scores:

- DHT https://gist.github.com/rokuyama/301063355de9733bea515b84ef574c0a
- RB800 https://gist.github.com/rokuyama/60ad665d367d6d110b79ec44707f39ff

Improvements may be negligible, but this does not cause performance
regressions at least.

This hack was for 403, but unaligned memory access is now emulated by
kernel. This should result in serious performance regression for 403.
We will provide strictly-aligned versions by ld.so.conf.
 1.15 26-Jul-2021  rin Improve previous:

- Add suffix ``d'' for mkdep(1).
- Improve comment a little...
 1.14 24-Jul-2021  rin For evbppc, use C version of bcopy(3), memcpy(3), memcmp(3), and
memmove(3) consistently for debug library (*.go) in order to avoid
alignment faults for 403.
 1.13 14-Mar-2010  mrg update all of these makefiles for the .so -> .pico change.

most of them are most harmless, but the libgcc parts are quite essential.
before this change, all the special rules for .pico files were not applied,
and exception handling wasn't enabled. this caused c++ exceptions not to
work on sparc64.


this fixes the build of boost-headers (it was correctly calling exception
support broken!), which in turn makes all the things that depend upon it
to actually work again on sparc64.
 1.12 11-Aug-2009  dsl Change NO_SRCS lines to specify .S in order to exclude the .c file from
SRCS but add it to LSRCS (sort of makes sense!).
 1.11 03-Aug-2009  dsl bzero.S also defines memset(), so exclude memset.c
 1.10 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.9 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.8 18-Apr-2008  garbled branches: 1.8.10;
Fix a stupid typo in a comment. Pointed out by Juergen Hannken-Illjes.
 1.7 18-Apr-2008  garbled Back out the ppc assembler changes for memcpy/memmove/memcmp on evbppc.
It breaks the explora because the cpu (403) cannot deal with unaligned
accesses. Reported by Juergen Hannken-Illjes.
 1.6 21-Feb-2008  garbled Make use of ppc tuned assembler.
 1.5 17-Jun-2006  uwe branches: 1.5.10; 1.5.16;
G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.4 20-Feb-2002  eeh Add bzero.S and strlen.S to the stuff that gets installed in libkern.
 1.3 30-Nov-2001  mjl Add assembler version of strlen.
 1.2 25-Nov-2001  mjl Add PPC assembler routines for ffs(3), bzero(3) and memset(3).
 1.1 29-Mar-1997  thorpej branches: 1.1.14;
Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.1.14.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.14.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.14.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.16.1 24-Mar-2008  keiichi sync with head.
 1.5.10.1 23-Mar-2008  matt sync with HEAD
 1.8.10.2 18-Apr-2008  garbled Fix a stupid typo in a comment. Pointed out by Juergen Hannken-Illjes.
 1.8.10.1 18-Apr-2008  garbled file Makefile.inc was added on branch christos-time_t on 2008-04-18 08:05:06 +0000
 1.15 19-Dec-2016  christos PR/50228: Christian Groessler: fix bzero(ptr, 0) on ppc. Check for 0 length
before jumping to cb_memset like memset does.
 1.14 12-Sep-2013  joerg branches: 1.14.8;
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.13 30-Aug-2013  matt Use a constructor to get the cache_info.
However memset can be called before the constructor is called, just treat
those as simple fills.
Add CACHE_INFO_DCACHE_LINE_SIZE to assym.h and use it
 1.12 18-Jul-2013  matt Use pcrel access and avoid GOT entries. Restructure a little to be more
efficient.
 1.11 29-Jan-2011  matt branches: 1.11.4; 1.11.10; 1.11.14;
Don't use r0 to restore LR, use r7 instead.
 1.10 19-Jan-2011  matt branches: 1.10.2;
Fix some bugs introduced when switching to new GOT/PLT format.
 1.9 16-Jan-2011  matt Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
 1.8 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.7 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.6 15-Mar-2003  hannken Make it work on cpus with cachelinesize < 32.

Tested on macppc by Markus W Kilbinger.
 1.5 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.4 12-Mar-2002  eeh branches: 1.4.2;
Use new CPU_CACHEINFO sysctl to get more detailed information about
cache layout.
 1.3 30-Nov-2001  mjl branches: 1.3.2;
Outifdef some stuff not needed in the _KERNEL case.
 1.2 29-Nov-2001  mjl Make this work in kernel space too.
 1.1 25-Nov-2001  mjl Add PPC assembler routines for ffs(3), bzero(3) and memset(3).
 1.3.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.3.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.3.2.2 28-Jan-2002  nathanw Catch up to -current.
 1.3.2.1 30-Nov-2001  nathanw file bzero.S was added on branch nathanw_sa on 2002-01-28 20:50:09 +0000
 1.4.2.1 23-Jul-2004  tron Pull up revision 1.5 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.10.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.14.1 23-Jul-2013  riastradh sync with HEAD
 1.11.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.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.14.8.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.2 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.1 25-Nov-2001  mjl branches: 1.1.2; 1.1.4;
Add PPC assembler routines for ffs(3), bzero(3) and memset(3).
 1.1.4.1 23-Jul-2004  tron Pull up revision 1.2 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.1.2.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 28-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 25-Nov-2001  nathanw file ffs.S was added on branch nathanw_sa on 2002-01-28 20:50:10 +0000
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.2 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.1 30-Nov-2001  mjl branches: 1.1.2; 1.1.4;
Add assembler version of strlen.
 1.1.4.1 23-Jul-2004  tron Pull up revision 1.2 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.1.2.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 28-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 30-Nov-2001  nathanw file strlen.S was added on branch nathanw_sa on 2002-01-28 20:50:10 +0000
 1.5 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.4 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.3 02-Dec-1998  thorpej branches: 1.3.12; 1.3.14;
Warn about references to the compatibility vfork() (i.e. the vfork() with
the 4.4BSD non-shared-address-space semantics), and direct the user to
include <unistd.h> to generate the correct reference.

This warning isn't about an ABI compatibility issue, but the new vfork() is
considerably faster.
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.3.14.1 23-Jul-2004  tron Pull up revision 1.4 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.3.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.6 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.5 12-Sep-2013  joerg branches: 1.5.4;
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.4 16-Jan-2011  matt branches: 1.4.6; 1.4.12;
Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
 1.3 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.2 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.1 20-Jul-2001  tsubai branches: 1.1.2; 1.1.4;
Add a __clone(3) entry point for powerpc.
 1.1.4.1 23-Jul-2004  tron Pull up revision 1.2 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.1.2.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 20-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:17:57 +0000
 1.4.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.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.5.4.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.10 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.9 28-Apr-2008  martin branches: 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 18-May-2006  christos branches: 1.8.18;
change __weak_extern to __weak_reference so that gcc4 works.
 1.7 19-Feb-2006  christos make these consistent.
 1.6 12-Jun-2005  lukem Add missing __RCSID()
 1.5 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.4 27-Sep-2003  matt Remove __LIBC12_SOURCE
 1.3 27-Sep-2003  matt Invoke the proper signal trampoline depending on SA_SIGINFO.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:28:02 +0000
 1.8.18.1 18-May-2008  yamt sync with head.
 1.9.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.3 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.2 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.1 03-Oct-1998  tsubai New signal stuff for PowerPC.
 1.4 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.3 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.2 30-Jul-2002  matt branches: 1.2.2;
Convert to use register prefixes. (0 -> %r0, etc.)
 1.1 09-Jul-2002  thorpej New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.2.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.2.2.1 30-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:28:02 +0000
 1.5 27-Nov-2021  skrll Trailing whitespace
 1.4 21-Nov-2021  thorpej Decorate the powerpc signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.3 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 25-Sep-2003  matt branches: 1.1.30;
Add siginfo signal trampoline.
 1.1.30.1 18-May-2008  yamt 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 __sigtramp2.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.4 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.3 23-Aug-2014  matt branches: 1.3.16;
Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 01-Feb-2014  matt branches: 1.2.4;
Since powerpc passes 8 arguments in registers and the syscall number in r0,
shuffle register argument so the kernel won't need to access the stack to
retrieve that last argument.
 1.1 13-Dec-2000  matt branches: 1.1.60; 1.1.66;
This should convert to syscall but that's too hard. So punt. XXX
 1.1.66.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.60.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.2.4.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.3.16.1 21-Apr-2020  martin Sync with HEAD
 1.4 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.3 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.2 25-May-1998  ws branches: 1.2.12; 1.2.14;
Remove long obsolete copyright (should have been done before initial import)
 1.1 04-Jan-1998  thorpej Add syscall stubs for __vfork14(). These are basically copies of Ovfork.S
with the syscall numbers changed.

Since 4.4BSD vfork(2) did not share address space, Ovfork.S could be changed
to be identical to fork.S (modulo syscall numbers). __vfork14.S, however,
needs to remain separate since with a shared address space, the stub needs to
pre-decrement the stack and do an indirect jump to the return address, so that
the shared stackframe is still there when the parent returns. (Obviously,
this does not apply to systems which to not build stackframes on leaf calls.)
 1.2.14.1 23-Jul-2004  tron Pull up revision 1.3 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.2.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.14 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.13 12-Sep-2013  joerg branches: 1.13.4;
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 16-Jan-2011  matt branches: 1.12.6; 1.12.12;
Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
 1.11 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.10 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.9 26-Jun-2000  kleink branches: 1.9.2; 1.9.4;
Thinko in previous: we do always use an internal name.
 1.8 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.7 24-Feb-2000  kleink branches: 1.7.4;
Missed in end -> _end cleanup.
 1.6 31-Mar-1999  kleink Change references to `end' to `_end' as not to invade (or being invaded by)
the user's name space.
 1.5 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.4 24-Nov-1998  tsubai Add PIC version.
 1.3 25-May-1998  ws Use asm.h defines for symbols
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.7.4.1 22-Aug-2000  kleink Pull up revs. 1.8-1.9 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.9.4.1 23-Jul-2004  tron Pull up revision 1.10 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.9.2.1 01-Aug-2002  nathanw Catch up to -current.
 1.12.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.6.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.4.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.11 12-Sep-2013  joerg 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.10 27-Feb-2012  matt branches: 1.10.2;
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.9 27-Feb-2012  joerg Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
 1.8 16-Jan-2011  matt branches: 1.8.6; 1.8.8;
Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
 1.7 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.6 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.5 27-Jan-2000  kleink branches: 1.5.6; 1.5.8;
Support *__errno() indirection.
 1.4 14-Jan-1999  kleink branches: 1.4.2;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.3 24-Nov-1998  tsubai Add PIC version.
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.4.2.1 02-Feb-2000  he Pull up revision 1.5 (requested by kleink):
Implement *__errno() indirection.
 1.5.8.1 23-Jul-2004  tron Pull up revision 1.6 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.5.6.1 01-Aug-2002  nathanw Catch up to -current.
 1.8.8.1 27-Feb-2012  riz Pull up following revision(s) (requested by joerg in ticket #57):
lib/libc/arch/arm/sys/cerror.S: revision 1.8
lib/libc/arch/vax/SYS.h: revision 1.12
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.3
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.4
lib/libc/arch/i386/sys/cerror.S: revision 1.16
lib/libc/arch/x86_64/sys/cerror.S: revision 1.5
lib/libc/arch/powerpc/sys/cerror.S: revision 1.10
lib/libc/arch/mips/sys/cerror.S: revision 1.17
lib/libc/arch/powerpc/sys/cerror.S: revision 1.9
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.8.6.2 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.8.6.1 17-Apr-2012  yamt sync with head
 1.10.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.3 25-May-1998  ws branches: 1.3.94; 1.3.98;
Remove long obsolete copyright (should have been done before initial import)
 1.2 03-Feb-1998  thorpej Fix exect(3).
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.3.98.1 21-Apr-2017  bouyer Sync with HEAD
 1.3.94.1 20-Mar-2017  pgoyette Sync with HEAD
 1.6 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.5 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.4 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.3 26-Jun-2000  kleink branches: 1.3.2; 1.3.4;
Need an internal name for fork().
 1.2 25-May-1998  ws branches: 1.2.10;
Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.2.10.1 22-Aug-2000  kleink Pull up rev. 1.3 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.3.4.1 23-Jul-2004  tron Pull up revision 1.4 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.3.2.1 01-Aug-2002  nathanw Catch up to -current.
 1.6 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.5 15-Jan-2011  matt branches: 1.5.24;
Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 03-Oct-2003  kleink branches: 1.3.30;
Convert to use register prefixes.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Nov-2001  briggs branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 09-Nov-2001  briggs As pointed out by Klaus Klein <kleink@netbsd.org> in private email,
getcontext.S should live in sys as it is a userland wrapper around
the actual syscall.
 1.3.30.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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.5.24.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.9 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.8 15-Jan-2011  matt branches: 1.8.24;
Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.7 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.6 28-Sep-2000  kleink branches: 1.6.2; 1.6.4;
Need an internal name for pipe(2).
 1.5 14-Jan-1999  kleink branches: 1.5.10;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.4 24-Nov-1998  tsubai Add PIC version.
 1.3 25-May-1998  ws Use asm.h defines for symbols
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.5.10.1 29-Sep-2000  kleink Pull up rev. 1.6 (approved by thorpej):
Add internal name for pipe().
 1.6.4.1 23-Jul-2004  tron Pull up revision 1.7 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.6.2.1 01-Aug-2002  nathanw Catch up to -current.
 1.8.24.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.7 12-Sep-2013  joerg 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 16-Jan-2011  matt branches: 1.6.6; 1.6.12;
Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
 1.5 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.4 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.3 23-Feb-2000  kleink branches: 1.3.6; 1.3.8;
For consistency with all other ports, clear errno in the prologue to the
syscall here as well - while the manual page advises applications to clear
errno themselves their actual behaviour may be questionable, especially in
light of the other ports' implementations.
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.3.8.1 23-Jul-2004  tron Pull up revision 1.4 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.3.6.1 01-Aug-2002  nathanw Catch up to -current.
 1.6.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.6.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 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.12 12-Sep-2013  joerg branches: 1.12.4;
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.11 16-Jan-2011  matt branches: 1.11.6; 1.11.12;
Switch to the PIC_GOTSETUP/PIC_TOCSETUP macros for PIC code. Now libc
will be built to use secureplt by default.
 1.10 15-Jan-2011  matt Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
 1.9 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.8 26-Jun-2000  kleink branches: 1.8.2; 1.8.4;
Thinko in previous: we do always use an internal name.
 1.7 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.6 31-Mar-1999  kleink branches: 1.6.10;
Change references to `end' to `_end' as not to invade (or being invaded by)
the user's name space.
 1.5 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.4 24-Nov-1998  tsubai Add PIC version.
 1.3 25-May-1998  ws Use asm.h defines for symbols
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.6.10.1 22-Aug-2000  kleink Pull up revs. 1.7-1.8 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.8.4.1 23-Jul-2004  tron Pull up revision 1.9 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.8.2.1 01-Aug-2002  nathanw Catch up to -current.
 1.11.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.6.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.12.4.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.3 24-Nov-1998  tsubai branches: 1.3.12; 1.3.14;
Add PIC version.
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.3.14.1 23-Jul-2004  tron Pull up revision 1.4 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.3.12.1 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.1 07-Jul-2000  itohy Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.2 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.3 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.1 03-Oct-1998  tsubai New signal stuff for PowerPC.
 1.9 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.8 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.7 14-Jan-1999  kleink branches: 1.7.12; 1.7.14;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.5 24-Nov-1998  tsubai Add PIC version.
 1.4 03-Oct-1998  tsubai New signal stuff for PowerPC.
 1.3 25-May-1998  ws Use asm.h defines for symbols
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.7.14.1 23-Jul-2004  tron Pull up revision 1.8 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.7.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.9 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.8 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.7 14-Jan-1999  kleink branches: 1.7.12; 1.7.14;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.5 24-Nov-1998  tsubai Add PIC version.
 1.4 03-Oct-1998  tsubai New signal stuff for PowerPC.
 1.3 25-May-1998  ws Use asm.h defines for symbols
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.7.14.1 23-Jul-2004  tron Pull up revision 1.8 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.7.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.6 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.5 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 1.4 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 03-Oct-1998  tsubai New signal stuff for PowerPC.
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.9 18-Feb-2006  matt Move PowerPC compat files from arch/powerpc to compat/arch/powerpc.
 1.8 30-Jul-2002  matt Convert to use register prefixes. (0 -> %r0, etc.)
 1.7 14-Jan-1999  kleink branches: 1.7.12; 1.7.14;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.6 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.5 24-Nov-1998  tsubai Add PIC version.
 1.4 03-Oct-1998  tsubai New signal stuff for PowerPC.
 1.3 25-May-1998  ws Use asm.h defines for symbols
 1.2 25-May-1998  ws Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.7.14.1 23-Jul-2004  tron Pull up revision 1.8 (requested by skrll in ticket #1725):
Convert to use register prefixes. (0 -> %r0, etc.)
 1.7.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.3 01-Feb-2014  matt Since powerpc passes 8 arguments in registers and the syscall number in r0,
shuffle register argument so the kernel won't need to access the stack to
retrieve that last argument.
 1.2 25-May-1998  ws branches: 1.2.70; 1.2.76;
Remove long obsolete copyright (should have been done before initial import)
 1.1 29-Mar-1997  thorpej Architecture-specific bits for libc on the PowerPC. From Wolfgang
Solfrank <ws@tools.de>
 1.2.76.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.70.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.4 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.3 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 07-Jul-2006  ross branches: 1.2.64;
build __sigaction14_sigtramp.c
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2.64.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.4 12-Jan-2015  dennis Replace the branch to __cerror() in powerpc64 syscall stubs
with inline code which does what __cerror() was doing. #ifdef
that code (i.e. all code) out of cerror.S; __cerror() is no more.
This seems to be necessary to fix the link of rescue/rescue, and
should have the pleasant side effect of making all other workarounds
done to keep the 'b __cerror' working unnecessary.
 1.3 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 22-Mar-2010  mrg branches: 1.2.24;
add a nop to provide enough space for the linker and long calls.
fixes link errors with 'cerror' and libposix.

from dennis.c.ferguson@gmail.com in PR#43010.
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2.24.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1 23-Aug-2014  matt branches: 1.1.2;
Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1.2.2 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1.2.1 23-Aug-2014  martin file genassym.cf was added on branch netbsd-7 on 2015-02-04 22:00:24 +0000
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.5 14-Sep-2023  rin libc/arch: Fix copy-paste; or1k, powerpc64, riscv are not powerpc ;)
 1.4 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.3 07-Jul-2006  ross Add missing ppc64 elements
 1.2 03-Jul-2006  drochner This is a new port - don't ever start with frexp/ldexp/modf in libc, we
have it in libm already.
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.5 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.4 11-Oct-2023  skrll Trailing whitespace
 1.3 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 08-Mar-2009  he branches: 1.2.24;
Based on input from Eduardo Horvath (eeh@), replace 'stmd' and 'lmd',
which apparently don't exist as instructions, with a sequence of
std / ld instructions.

Also remove the attempted include of ldstm.S which we don't have.
 1.1 07-Jul-2006  ross branches: 1.1.30;
Add missing ppc64 elements
 1.1.30.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.2.24.2 04-Feb-2015  martin Fix merge mishap in previous
 1.2.24.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.4 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.3 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 22-Mar-2010  mrg branches: 1.2.24;
replace kernel-only 'stmd' and 'lmd' operations in userland with equivalent
sequences of code, as done in eg, powerpc64/gen/_setjmp.S rev 1.2.

from dennis.c.ferguson@gmail.com in PR#43009.
 1.1 07-Jul-2006  ross Add missing ppc64 elements
 1.2.24.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.3 24-Nov-2012  christos fix lint.
 1.2 05-Jul-2006  ross branches: 1.2.44; 1.2.50;
adjust casts for LP64
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2.50.1 25-Feb-2013  tls resync with head
 1.2.44.1 16-Jan-2013  yamt sync with (a bit old) head
 1.2 05-Jul-2006  ross Finish ppc64 conversion
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.3 08-Nov-2018  riastradh powerpc64 needs fabsl too. (Apparently no __HAVE_LONG_DOUBLE?)
 1.2 05-Jul-2006  ross branches: 1.2.84; 1.2.86;
fix typo
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2.86.1 10-Jun-2019  christos Sync with HEAD
 1.2.84.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.2 19-Mar-2015  joerg Call libc's fpgetround.
 1.1 01-Jul-2006  ross branches: 1.1.64;
ppc64 build framework first pass
 1.1.64.1 21-Mar-2015  snj Pull up following revision(s) (requested by joerg in ticket #632):
lib/libc/arch/arm/gen/flt_rounds.c: revision 1.5
lib/libc/arch/mips/gen/flt_rounds.c: revision 1.9
lib/libc/arch/powerpc/gen/flt_rounds.c: revision 1.12
lib/libc/arch/powerpc64/gen/flt_rounds.c: revision 1.2
lib/libc/arch/sh3/gen/flt_rounds.c: revision 1.6
Call libc's fpgetround.
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 01-Jul-2006  ross branches: 1.1.18;
ppc64 build framework first pass
 1.1.18.1 18-May-2008  yamt 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 fpgetmask.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 01-Jul-2006  ross branches: 1.1.18;
ppc64 build framework first pass
 1.1.18.1 18-May-2008  yamt 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 fpgetround.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 01-Jul-2006  ross branches: 1.1.18;
ppc64 build framework first pass
 1.1.18.1 18-May-2008  yamt 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 fpgetsticky.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 01-Jul-2006  ross branches: 1.1.18;
ppc64 build framework first pass
 1.1.18.1 18-May-2008  yamt 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 fpsetmask.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 01-Jul-2006  ross branches: 1.1.18;
ppc64 build framework first pass
 1.1.18.1 18-May-2008  yamt 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 fpsetround.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 01-Jul-2006  ross branches: 1.1.18;
ppc64 build framework first pass
 1.1.18.1 18-May-2008  yamt 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 fpsetsticky.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 05-Jul-2006  ross branches: 1.2.18;
Adjust types and casts for LP64 compilation.
Split "long *sp;" into "__greg_t sp, *spp;", which reduces the cast
density and could be used to clean up the ppc32 version as well.
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2.18.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 makecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 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.1 01-Jul-2006  ross branches: 1.1.30;
ppc64 build framework first pass
 1.1.30.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.4 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 08-Dec-2006  martin branches: 1.2.10;
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-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.1 01-Jul-2006  ross branches: 1.1.4;
ppc64 build framework first pass
 1.1.4.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #264):
lib/libc/arch/sh5/gen/resumecontext.c: revision 1.2
lib/libc/arch/sh3/gen/resumecontext.c: revision 1.3
lib/libc/arch/sparc/gen/resumecontext.c: revision 1.3
lib/libc/arch/powerpc/gen/resumecontext.c: revision 1.3
lib/libc/arch/arm/gen/resumecontext.c: revision 1.3
lib/libc/arch/mips/gen/resumecontext.c: revision 1.3
lib/libc/arch/vax/gen/resumecontext.c: revision 1.2
lib/libc/arch/powerpc64/gen/resumecontext.c: revision 1.2
lib/libc/arch/hppa/gen/resumecontext.c: revision 1.2
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:
-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.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.5 13-Aug-2014  joerg [] -> ()
 1.4 12-Sep-2012  manu setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@
 1.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 05-Jul-2006  ross branches: 1.2.18;
revise for ppc64
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2.18.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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.3.4.1 30-Oct-2012  yamt sync with head
 1.2 24-Nov-2012  christos Use __arraycount(), and cast to u_int.
 1.1 01-Jul-2006  ross branches: 1.1.44; 1.1.50;
ppc64 build framework first pass
 1.1.50.1 25-Feb-2013  tls resync with head
 1.1.44.1 16-Jan-2013  yamt sync with (a bit old) head
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.3 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.2 04-Aug-2008  matt branches: 1.2.6;
Add C99 functions imaxabs and imaxdiv.
 1.1 01-Jul-2006  ross branches: 1.1.20;
ppc64 build framework first pass
 1.1.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.2.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.6 11-Aug-2009  dsl Change NO_SRCS lines to specify .S in order to exclude the .c file from
SRCS but add it to LSRCS (sort of makes sense!).
 1.5 03-Aug-2009  dsl bzero.S defines memset(), so exclude memset.c
 1.4 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.3 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.2 07-Jul-2006  ross bzero() and memset() for ppc64.
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 07-Jul-2006  ross branches: 1.3.18;
rcsid & white space
 1.2 07-Jul-2006  ross bzero() and memset() for ppc64.
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 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 bzero.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.1 07-Jul-2006  ross Add missing sigaction()
 1.2 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1 01-Jul-2006  ross branches: 1.1.64;
ppc64 build framework first pass
 1.1.64.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.3 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 07-Jul-2006  ross branches: 1.1.18;
Add missing sigaction()
 1.1.18.1 18-May-2008  yamt 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 __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.4 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.3 17-Jan-2011  matt branches: 1.3.24;
Kill _NOREGNAMES. Everything should be using %rX now. If it doesn't it
soon will.
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 01-Jul-2006  ross branches: 1.1.18;
ppc64 build framework first pass
 1.1.18.1 18-May-2008  yamt 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 __sigtramp2.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.3.24.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.3 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.2 23-Aug-2014  matt branches: 1.2.16;
Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1 01-Jul-2006  ross branches: 1.1.64;
ppc64 build framework first pass
 1.1.64.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2.16.1 21-Apr-2020  martin Sync with HEAD
 1.2 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1 06-Jul-2006  ross branches: 1.1.64;
we need the current vfork
 1.1.64.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.5 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.4 29-Oct-2011  christos branches: 1.4.20;
Everything else uses PIC branches to __cerror except those two...
 1.3 07-Jul-2006  ross fix @toc reference macro
 1.2 06-Jul-2006  ross rewrite for ppc elf64 reloc
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.4.20.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.7 12-Jan-2015  dennis Replace the branch to __cerror() in powerpc64 syscall stubs
with inline code which does what __cerror() was doing. #ifdef
that code (i.e. all code) out of cerror.S; __cerror() is no more.
This seems to be necessary to fix the link of rescue/rescue, and
should have the pleasant side effect of making all other workarounds
done to keep the 'b __cerror' working unnecessary.
 1.6 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.5 12-Sep-2013  joerg branches: 1.5.4;
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.4 27-Feb-2012  matt branches: 1.4.2;
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.3 27-Feb-2012  joerg Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
 1.2 29-Oct-2011  christos branches: 1.2.2; 1.2.4;
Sync with other ports: in PIC mode make __cerror hidden; it is not supposed
to be used outside libc.
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2.4.1 27-Feb-2012  riz Pull up following revision(s) (requested by joerg in ticket #57):
lib/libc/arch/arm/sys/cerror.S: revision 1.8
lib/libc/arch/vax/SYS.h: revision 1.12
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.3
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.4
lib/libc/arch/i386/sys/cerror.S: revision 1.16
lib/libc/arch/x86_64/sys/cerror.S: revision 1.5
lib/libc/arch/powerpc/sys/cerror.S: revision 1.10
lib/libc/arch/mips/sys/cerror.S: revision 1.17
lib/libc/arch/powerpc/sys/cerror.S: revision 1.9
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.2.2.2 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.2.2.1 17-Apr-2012  yamt sync with head
 1.4.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.4.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.1 01-Jul-2006  ross branches: 1.1.68; 1.1.72;
ppc64 build framework first pass
 1.1.72.1 21-Apr-2017  bouyer Sync with HEAD
 1.1.68.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1 01-Jul-2006  ross branches: 1.1.64;
ppc64 build framework first pass
 1.1.64.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.5 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.4 29-Oct-2011  christos branches: 1.4.20;
Everything else uses PIC branches to __cerror except those two...
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 05-Jul-2006  ross branches: 1.2.18;
convert PIC linkage
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2.18.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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.4.20.2 04-Feb-2015  martin Fix merge mishap in previous
 1.4.20.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1 01-Jul-2006  ross branches: 1.1.64;
ppc64 build framework first pass
 1.1.64.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.3 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 12-Sep-2013  joerg branches: 1.2.4;
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.1 01-Jul-2006  ross branches: 1.1.44; 1.1.50;
ppc64 build framework first pass
 1.1.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.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.2.4.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.5 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.4 13-Aug-2014  joerg Spell LdAddr consistently
 1.3 07-Jul-2006  ross branches: 1.3.64;
fix @toc reference macro
 1.2 05-Jul-2006  ross convert remaining ppc32 code to ppc64
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.3.64.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1 01-Jul-2006  ross ppc64 build framework first pass
 1.2 23-Aug-2014  matt Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.1 01-Jul-2006  ross branches: 1.1.64;
ppc64 build framework first pass
 1.1.64.1 04-Feb-2015  martin Pull up following revision(s) (requested by chs in ticket #492):
lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2
lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3
lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2
lib/libc/arch/powerpc/sys/__clone.S: revision 1.6
lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3
sys/arch/powerpc/include/asm.h: revision 1.47
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6
lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5
lib/libc/arch/powerpc64/sys/brk.S: revision 1.5
lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3
lib/libc/arch/powerpc64/genassym.cf: revision 1.1
lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3
lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6
compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3
lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2
lib/libc/arch/powerpc/sys/brk.S: revision 1.14
lib/libc/arch/powerpc64/SYS.h: revision 1.3
lib/libc/arch/powerpc64/sys/fork.S: revision 1.2
lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4
lib/libc/arch/powerpc64/Makefile.inc: revision 1.3
lib/libc/arch/powerpc/sys/pipe.S: revision 1.9
lib/libc/compiler_rt/Makefile.inc: revision 1.25
lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5
lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2
lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13
lib/libc/arch/powerpc/SYS.h: revision 1.13
powerpc64 uses the same sources as powerpc and needs the long double as
double-double sources.
-
Spell LdAddr consistently
-
Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd
-
Fix cmpptr/cmpreq/etc to use right mnemonics
-
Minimize differences between powerpc and powerpc64
-
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
-
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
 1.2 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.5 19-May-2023  skrll No need for double semi-colon

Indent END the same as ENTRY.

NFCI.
 1.4 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.3 13-Apr-2019  maya Looks like libc is too big to be able to use j. use a longer distance jump
 1.2 27-Mar-2015  matt branches: 1.2.16;
Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2.16.1 10-Jun-2019  christos Sync with HEAD
 1.4 30-May-2024  skrll Annotate the RISC-V signal trampoline with CFI attributes.
 1.3 19-May-2023  skrll KNF
 1.2 27-Mar-2015  matt Adapt to the jmpbuf changes.
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.4 16-Apr-2019  mrg revert previously. we want riscv32 to have 128 bit long double...
shall fix the compiler instead.
 1.3 16-Apr-2019  mrg risc32 doesn't want long double specific versions
 1.2 15-Apr-2019  maya Cargo cult follow the other 128bit long double architecture (sparc64).
 1.1 19-Sep-2014  matt branches: 1.1.16;
New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1.16.1 10-Jun-2019  christos Sync with HEAD
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.3 03-Dec-2022  skrll Trailing whitespace
 1.2 14-Apr-2019  maya Provide a definition of quiet NaN for RISC-V, and a reference to where
it comes from.
 1.1 19-Sep-2014  matt branches: 1.1.16;
New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1.16.1 10-Jun-2019  christos Sync with HEAD
 1.3 14-Sep-2023  rin libc/arch: Fix copy-paste; or1k, powerpc64, riscv are not powerpc ;)
 1.2 13-Apr-2019  maya build the generic 128bit long double code.
 1.1 19-Sep-2014  matt branches: 1.1.16;
New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1.16.1 10-Jun-2019  christos Sync with HEAD
 1.5 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.4 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.3 04-Dec-2022  skrll Consistently use the 'mv' instrucation (which is itself an alias) instead
of the (old) alternative alias 'move'.
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2 27-Mar-2015  matt Adapt to new assembler. jump->tail[call] auipc/lo12 changes.
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.1 19-Sep-2014  matt branches: 1.1.28;
New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1.28.1 02-Aug-2025  perseant Sync with HEAD
 1.3 04-Dec-2022  skrll Consistently use the 'mv' instrucation (which is itself an alias) instead
of the (old) alternative alias 'move'.
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2 19-Mar-2015  joerg Call libc's fpgetround.
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 03-Dec-2022  skrll Trailing whitespace
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.4 16-May-2024  riastradh riscv: Nix shifting around FRRM and FSRM in libc too.

These read and write the floating-point rounding mode directly, not
the whole floating-point control and status register.
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 03-Dec-2022  skrll Trailing whitespace
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.4 16-May-2024  riastradh riscv: More shiftiness reduction around FCSR in libc.
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 03-Dec-2022  skrll Trailing whitespace
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.4 11-May-2024  skrll Do the '#if FCSR_FMASK == 0' thing that fpgetmask.c does for consistency.
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 03-Dec-2022  skrll Trailing whitespace
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.4 16-May-2024  riastradh riscv: Nix shifting around FRRM and FSRM in libc too.

These read and write the floating-point rounding mode directly, not
the whole floating-point control and status register.
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 03-Dec-2022  skrll Trailing whitespace
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.4 16-May-2024  riastradh riscv: More shiftiness reduction around FCSR in libc.
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 03-Dec-2022  skrll Trailing whitespace
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.3 04-May-2024  skrll makecontext: correct the type to setup register based arguments.

Use __greg_t rather than int for register based arguments. This fixes
various atf tests.
 1.2 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2 03-Dec-2022  skrll Trailing whitespace
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.3 27-Mar-2015  matt Adapt to new assembler. jump->tail[call] auipc/lo12 changes.
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.3 27-Mar-2015  matt Adapt to new assembler. jump->tail[call] auipc/lo12 changes.
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.5 30-May-2024  skrll Annotate the RISC-V signal trampoline with CFI attributes.
 1.4 28-May-2024  skrll Change MIPS to RISC-V.
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.4 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.3 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.2 27-Mar-2015  matt branches: 1.2.16;
Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2.16.1 21-Apr-2020  martin Sync with HEAD
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.6 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.5 04-Dec-2022  skrll Consistently use the 'mv' instrucation (which is itself an alias) instead
of the (old) alternative alias 'move'.
 1.4 31-Mar-2015  matt Use lla instead doing the pcrel relocs ourselves.
 1.3 27-Mar-2015  matt Adapt to new assembler. jump->tail[call] auipc/lo12 changes.
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.3 27-Mar-2015  matt Adapt to new assembler. jump->tail[call] auipc/lo12 changes.
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.1 19-Sep-2014  matt branches: 1.1.2; 1.1.4;
New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.1.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.3 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.6 07-May-2023  skrll RISC-V support that works on QEMU with a single hart.

Thanks for Simon Burge for plic(4).
 1.5 04-Dec-2022  skrll Consistently use the 'mv' instrucation (which is itself an alias) instead
of the (old) alternative alias 'move'.
 1.4 31-Mar-2015  matt Use lla instead doing the pcrel relocs ourselves.
 1.3 27-Mar-2015  matt Adapt to new assembler. jump->tail[call] auipc/lo12 changes.
 1.2 27-Mar-2015  matt Switch to new ABI (return values now in a0/a1; v0/v1 are no more)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1 19-Sep-2014  matt New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.9 24-Nov-2021  thorpej Decorate the SuperH signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.8 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.7 22-Mar-2017  chs provide a common softfloat fenv implemenation and use it for softfloat builds.
restore ABI compatibility with previous releases for ieeefp.h on sh3.
add namespace.h protection for all the fenv interfaces.
use MKSOFTFLOAT on sh3 instead of assuming softfloat.
standardize on comparing MKSOFTFLOAT with "no".
remove the arm-specific softfloat fenv code (which also had several bugs).
fix logic errors in the arm hardfloat feraiseexcept() and feupdateenv().
 1.6 17-Jun-2006  uwe branches: 1.6.68; 1.6.72;
G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.5 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.4 23-Nov-2003  uwe Implement siginfo for sh3.
 1.3 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.2 06-Jun-2000  tsubai branches: 1.2.4;
Add softfloat glue for sh3.
 1.1 05-Jan-2000  msaitoh branches: 1.1.2;
libc for SH3.
TODO: fplib
 1.1.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 01-Aug-2002  nathanw Catch up to -current.
 1.6.72.1 21-Apr-2017  bouyer Sync with HEAD
 1.6.68.1 26-Apr-2017  pgoyette Sync with HEAD
 1.11 12-Sep-2013  joerg 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.10 23-Jan-2011  joerg branches: 1.10.4; 1.10.10;
Correctly define inta using a helper macro for the #
 1.9 06-Jan-2006  uwe branches: 1.9.40;
Drop unnecessary nops.
 1.8 06-Jan-2006  uwe Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.7 25-Dec-2005  uwe Be consistent about macro indentation.
Indent delay slot instructions.
Whitespace changes only, same binary code produced.
 1.6 07-Aug-2003  agc branches: 1.6.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.4 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.3 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.2 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.1 05-Jan-2000  msaitoh branches: 1.1.6;
libc for SH3.
TODO: fplib
 1.1.6.2 21-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 28-Jan-2002  nathanw Catch up to -current.
 1.6.6.3 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.9
Drop unnecessary nops.
 1.6.6.2 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.6.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.7
Be consistent about macro indentation.
Indent delay slot instructions.
Whitespace changes only, same binary code produced.
 1.9.40.1 08-Feb-2011  bouyer Sync with HEAD
 1.10.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.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.1 24-Nov-2021  thorpej Decorate the SuperH signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.26 20-Jan-2014  joerg Use fabs_ieee754.c.
 1.25 06-Dec-2009  uebayasi branches: 1.25.6; 1.25.12;
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.24 28-Jun-2006  drochner build frexp/ldexp/modf in the "compat" part (code is identical)
(These are the easy cases where no assembler implementations exist.)
 1.23 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.22 02-Jun-2006  mrg remove GCC2 support
 1.21 07-Apr-2006  mrg retire HAVE_GCC3/HAVE_GCC4 and introduce HAVE_GCC that is set to 2, 3 or 4.
 1.20 15-Oct-2005  uwe _setjmp and _longjmp are not compat functions. Noticed by Havard Eidnes.
 1.19 15-Sep-2005  uwe Add lint stubs for __setjmp14 and __sigsetjmp14.
 1.18 15-Sep-2005  uwe Switch arch/sh3/gen to the new compat code layout.
 1.17 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.16 04-Mar-2004  kleink branches: 1.16.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.15 22-Feb-2004  uwe In gcc3 world the "millicode" must be provided by libgcc*.a, so don't
include it in libc.
 1.14 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.13 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.12 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.11 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.10 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.9 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.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 05-Sep-2002  msaitoh Add __movstr_i4_{odd,even} for -m4.
Written by SHIMIZU Ryo.
 1.6 02-Apr-2002  thorpej Remove non-existent ldexp.c from SRCS.
 1.5 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.4 09-Jun-2000  msaitoh branches: 1.4.4;
movstrSI*() for gcc -Os
 1.3 06-Jun-2000  tsubai Add softfloat glue for sh3.
 1.2 17-Jan-2000  kleink branches: 1.2.2;
Add NAN constant glue for sh3.
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.4.7 07-Oct-2002  thorpej Add missing backslash.
 1.4.4.6 17-Sep-2002  nathanw Catch up to -current.
 1.4.4.5 10-Aug-2002  thorpej Add _lwp.c to SRCS.
 1.4.4.4 22-Jun-2002  thorpej ucontext-related functions. From Klaus Klein.
 1.4.4.3 25-Apr-2002  nathanw Catch up to -current.
 1.4.4.2 22-Mar-2002  nathanw Catch up to -current.
 1.4.4.1 08-Mar-2002  nathanw Catch up to -current.
 1.16.6.1 19-Apr-2005  tron Pull up revision 1.17 (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.25.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.6.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 15-Sep-2005  uwe Switch arch/sh3/gen to the new compat code layout.
 1.6 07-Aug-2003  agc branches: 1.6.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 14-Feb-2001  msaitoh branches: 1.3.2;
use _C_LABEL()
 1.2 04-Aug-2000  tsubai Change comment character from '#' to '!'. (binutils-2.10 doesn't like '#')
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.6.1 22-Jan-2006  tron Apply patch (requested by uwe in ticket #1100):
Use PLT for PIC calls to avoids text relocs in the shared library.
 1.7 15-Sep-2005  uwe Switch arch/sh3/gen to the new compat code layout.
 1.6 07-Aug-2003  agc branches: 1.6.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 14-Feb-2001  msaitoh branches: 1.3.2;
use _C_LABEL()
 1.2 04-Aug-2000  tsubai Change comment character from '#' to '!'. (binutils-2.10 doesn't like '#')
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.6.1 22-Jan-2006  tron Apply patch (requested by uwe in ticket #1100):
Use PLT for PIC calls to avoids text relocs in the shared library.
 1.6 22-Mar-2012  he Follow the pattern from powerpc, make lint happy.
 1.5 24-Feb-2011  joerg branches: 1.5.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.4 12-Jun-2005  lukem branches: 1.4.40;
Add missing __RCSID()
 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 10-Aug-2002  thorpej branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.1 10-Aug-2002  thorpej LWP routines for sh3.
 1.4.40.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.4.1 17-Apr-2012  yamt sync with head
 1.7 05-Jan-2006  uwe Use SET_ENTRY_SIZE macro to hide verbose .size arithmetic.
 1.6 05-Jan-2006  uwe Use constants from <machine/setjmp.h> for better readability.
 1.5 05-Jan-2006  uwe Add .size directives.
While here, indent instructions in the rts delay slots.
 1.4 15-Oct-2005  uwe _setjmp and _longjmp are not compat functions. Noticed by Havard Eidnes.
 1.3 15-Sep-2005  uwe Switch arch/sh3/gen to the new compat code layout.
 1.2 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.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.5 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.4 22-Sep-2003  uwe Indent delay slots. Whitespace change only, same object code produced.
 1.3 14-Feb-2001  msaitoh don't profile (use NENTRY() and ALTENTRY())
 1.2 14-Feb-2001  msaitoh use _C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.3 22-Sep-2003  uwe Do not profile. Indent delay slot.
 1.2 14-Feb-2001  msaitoh use _C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.3 22-Sep-2003  uwe Do not profile. Indent delay slot.
 1.2 14-Feb-2001  msaitoh use _C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.4 20-Jan-2014  joerg Use fabs_ieee754.c.
 1.3 21-May-2006  mrg branches: 1.3.44; 1.3.50;
add a local prototype for fabs()
 1.2 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.1 05-Jan-2000  msaitoh branches: 1.1.6;
libc for SH3.
TODO: fplib
 1.1.6.1 21-Jun-2002  nathanw Catch up to -current.
 1.3.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.8 08-Apr-2022  andvar fix various typos, mainly in comments, but also log messages, docs, game text.
 1.7 11-Mar-2017  chs fix the mapping table. this sh3 version was originally copied from arm,
but FP_RP and FP_RM have opposite values on sh3 vs. arm.
 1.6 19-Mar-2015  joerg branches: 1.6.2; 1.6.4;
Call libc's fpgetround.
 1.5 22-Mar-2012  he branches: 1.5.10;
Add a void to make function declaration c89.
 1.4 17-Jan-2007  hubertf branches: 1.4.36;
Remove more duplicate #includes, and a few spurious whitespaces at EOL
From Slava Semushin <slava.semushin@gmail.com>
 1.3 25-Feb-2006  wiz Fix some typos.
 1.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.4.36.1 17-Apr-2012  yamt sync with head
 1.5.10.1 21-Mar-2015  snj Pull up following revision(s) (requested by joerg in ticket #632):
lib/libc/arch/arm/gen/flt_rounds.c: revision 1.5
lib/libc/arch/mips/gen/flt_rounds.c: revision 1.9
lib/libc/arch/powerpc/gen/flt_rounds.c: revision 1.12
lib/libc/arch/powerpc64/gen/flt_rounds.c: revision 1.2
lib/libc/arch/sh3/gen/flt_rounds.c: revision 1.6
Call libc's fpgetround.
 1.6.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.6.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2 06-Jun-2000  tsubai Add softfloat glue for sh3.
 1.1 05-Jan-2000  msaitoh branches: 1.1.2;
libc for SH3.
TODO: fplib
 1.1.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2 06-Jun-2000  tsubai Add softfloat glue for sh3.
 1.1 05-Jan-2000  msaitoh branches: 1.1.2;
libc for SH3.
TODO: fplib
 1.1.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2 06-Jun-2000  tsubai Add softfloat glue for sh3.
 1.1 05-Jan-2000  msaitoh branches: 1.1.2;
libc for SH3.
TODO: fplib
 1.1.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2 06-Jun-2000  tsubai Add softfloat glue for sh3.
 1.1 05-Jan-2000  msaitoh branches: 1.1.2;
libc for SH3.
TODO: fplib
 1.1.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2 06-Jun-2000  tsubai Add softfloat glue for sh3.
 1.1 05-Jan-2000  msaitoh branches: 1.1.2;
libc for SH3.
TODO: fplib
 1.1.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2 06-Jun-2000  tsubai Add softfloat glue for sh3.
 1.1 05-Jan-2000  msaitoh branches: 1.1.2;
libc for SH3.
TODO: fplib
 1.1.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 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 05-Jan-2000  msaitoh branches: 1.1.6;
libc for SH3.
TODO: fplib
 1.1.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 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.3 13-Sep-2000  msaitoh branches: 1.3.2;
check LIBC_SCCS
 1.2 17-Jan-2000  kleink Adjust for little endian environments (confirmed by msaitoh).
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.1 08-Mar-2002  nathanw Catch up to -current.
 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 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.6.1 08-Mar-2002  nathanw Catch up to -current.
 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 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.6.1 08-Mar-2002  nathanw Catch up to -current.
 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 10-Dec-2001  msaitoh sync with other archs.

Important fixes:

> ldexp(denormal, exp>1023) would generate the wrong result in all non-overflow
> cases. Totally rework this code to fix this bug *and* make it faster.

> Don't ever return -0.0.
 1.1 05-Jan-2000  msaitoh branches: 1.1.6;
libc for SH3.
TODO: fplib
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 28-Jan-2002  nathanw Catch up to -current.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.3 22-Sep-2003  uwe Do not profile. Indent delay slot.
 1.2 14-Feb-2001  msaitoh use _C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 23-Jun-2003  uwe branches: 1.3.30;
Registers _REG_Ri defines are numbered backwards, so when we fill
r4-r7 with arguments, use the correct *minus* i to compute the i-th
register index.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 22-Jun-2002  thorpej branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.1 22-Jun-2002  thorpej ucontext-related functions. From Klaus Klein.
 1.3.30.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:58 +0000
 1.4 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.3 14-Jun-2000  cgd branches: 1.3.4;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.2 13-Mar-2000  soren branches: 1.2.2;
Fix doubled 'the's.
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.4.1 08-Mar-2002  nathanw Catch up to -current.
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.5 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.4 22-Sep-2003  uwe Do not profile. Indent delay slot.
 1.3 11-May-2001  msaitoh style fix (no functional change)
 1.2 14-Feb-2001  msaitoh branches: 1.2.2;
use _C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.7 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.6 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.5 22-Sep-2003  uwe Indent delay slot.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 14-Feb-2001  msaitoh branches: 1.3.2;
don't profile (use NENTRY() and ALTENTRY())
 1.2 14-Feb-2001  msaitoh use _C_LABEL()
 1.1 09-Jun-2000  msaitoh branches: 1.1.4;
movstrSI*() for gcc -Os
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 09-Jun-2000  minoura file movstrSI.S was added on branch minoura-xpg4dl on 2000-06-23 16:17:17 +0000
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.2 22-Sep-2003  uwe Do not profile. Indent delay slots.
 1.1 05-Sep-2002  msaitoh branches: 1.1.2;
Add __movstr_i4_{odd,even} for -m4.
Written by SHIMIZU Ryo.
 1.1.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.1 05-Sep-2002  nathanw file movstr_i4.S was added on branch nathanw_sa on 2002-09-17 21:32:44 +0000
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.3 22-Sep-2003  uwe Do not profile. Indent delay slot.
 1.2 14-Feb-2001  msaitoh use _C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 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 17-Jan-2000  kleink branches: 1.1.6;
Add NAN constant glue for sh3.
 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:51 +0000
 1.5 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Dec-2006  martin branches: 1.3.10;
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-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.2 18-Jan-2003  thorpej branches: 1.2.16;
Merge the nathanw_sa branch.
 1.1 22-Jun-2002  thorpej branches: 1.1.2;
file resumecontext.c was initially added on branch nathanw_sa.
 1.1.2.1 22-Jun-2002  thorpej ucontext-related functions. From Klaus Klein.
 1.2.16.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #264):
lib/libc/arch/sh5/gen/resumecontext.c: revision 1.2
lib/libc/arch/sh3/gen/resumecontext.c: revision 1.3
lib/libc/arch/sparc/gen/resumecontext.c: revision 1.3
lib/libc/arch/powerpc/gen/resumecontext.c: revision 1.3
lib/libc/arch/arm/gen/resumecontext.c: revision 1.3
lib/libc/arch/mips/gen/resumecontext.c: revision 1.3
lib/libc/arch/vax/gen/resumecontext.c: revision 1.2
lib/libc/arch/powerpc64/gen/resumecontext.c: revision 1.2
lib/libc/arch/hppa/gen/resumecontext.c: revision 1.2
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:
-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.3.10.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.9 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.8 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.7 22-Sep-2003  uwe Indent delay slots. Add a comment that the magic number 8 is SIGFPE.
 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 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 14-Feb-2001  msaitoh branches: 1.3.2;
use _C_LABEL()
 1.2 14-Jan-2000  msaitoh sync with libkern
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.12 17-Jul-2024  uwe sh3: siglongjmp - restore register context first (PR lib/57946)
 1.11 11-Oct-2023  skrll branches: 1.11.2;
Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.10 05-Jan-2006  uwe branches: 1.10.88; 1.10.96;
Use PIC_PROLOGUE_NOSAVE in long jumps, where we don't need to preserve r12.
While here, swap the order in which r4 and r5 saved on the stack so
that r4 is restored further away from its first use.
 1.9 05-Jan-2006  uwe Oops, supply correct label for __longjmp14 .size directive.
 1.8 05-Jan-2006  uwe Use PLT for PIC calls to avoids text relocs in the shared library.
Use constants from <machine/setjmp.h> for better readability.
Provide .size directives.
 1.7 15-Sep-2005  uwe Switch arch/sh3/gen to the new compat code layout.
 1.6 07-Aug-2003  agc branches: 1.6.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 14-Feb-2001  msaitoh branches: 1.3.2;
use _C_LABEL()
 1.2 04-Aug-2000  tsubai Change comment character from '#' to '!'. (binutils-2.10 doesn't like '#')
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.6.1 22-Jan-2006  tron Apply patch (requested by uwe in ticket #1100):
Use PLT for PIC calls to avoids text relocs in the shared library.
 1.10.96.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.10.88.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.11.2.1 02-Aug-2025  perseant Sync with HEAD
 1.11 17-Jul-2024  uwe sh3: siglongjmp - restore register context first (PR lib/57946)
 1.10 11-Oct-2023  skrll branches: 1.10.2;
Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.9 05-Jan-2006  uwe branches: 1.9.88; 1.9.96;
Use PIC_PROLOGUE_NOSAVE in long jumps, where we don't need to preserve r12.
While here, swap the order in which r4 and r5 saved on the stack so
that r4 is restored further away from its first use.
 1.8 05-Jan-2006  uwe Use PLT for PIC calls to avoids text relocs in the shared library.
Use constants from <machine/setjmp.h> for better readability.
Provide .size directives.
 1.7 15-Sep-2005  uwe Switch arch/sh3/gen to the new compat code layout.
 1.6 07-Aug-2003  agc branches: 1.6.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 14-Feb-2001  msaitoh branches: 1.3.2;
use _C_LABEL()
 1.2 04-Aug-2000  tsubai Change comment character from '#' to '!'. (binutils-2.10 doesn't like '#')
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.6.1 22-Jan-2006  tron Apply patch (requested by uwe in ticket #1100):
Use PLT for PIC calls to avoids text relocs in the shared library.
 1.9.96.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.9.88.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.10.2.1 02-Aug-2025  perseant Sync with HEAD
 1.12 06-Apr-2015  uwe On swapcontext(3) preserve r12 too. Properly fixes PR port-sh3/49597.
 1.11 25-Jan-2015  uwe Adjust _UC_MACHINE_SP(oucp) to "drop" values we pushed to the stack.
t_swapcontext tests pass now with gcc 4.8.

From Yasushi Oshima in PR port-sh3/49597
 1.10 12-Sep-2013  joerg branches: 1.10.4;
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.9 28-Apr-2008  martin branches: 1.9.4; 1.9.6; 1.9.8; 1.9.24; 1.9.28;
Remove clause 3 and 4 from TNF licenses
 1.8 05-Jan-2006  uwe branches: 1.8.18;
Add .size directive.
 1.7 05-Jan-2006  uwe PIC_PROLOGUE doesn't take temp register argument, adjust.
 1.6 04-Jan-2006  uwe Use PLT for PIC calls. Makes the called functions overridable and
avoids text reloc in the shared library.
Same non-PIC code generated.
 1.5 04-Jan-2006  uwe Took me some time to figure that getcontext does _UC_MACHINE_INTRV(oucp) = 0
for us, so add a comment. While here use official _UC_MACHINE_SET_PC
macro in another comment.
 1.4 04-Jan-2006  uwe Use macros from <machine/asm.h>. s/r15/sp/. Use cpp-safe label
names. Add comments. Same object code is generated.
 1.3 01-Jul-2003  marcus branches: 1.3.6;
Generate proper PIC code for libc_pic.a.
 1.2 20-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 22-Jun-2002  thorpej branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 22-Jun-2002  thorpej ucontext-related functions. From Klaus Klein.
 1.3.6.5 11-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1096):
lib/libc/arch/sh3/gen/swapcontext.S: revision 1.8
Add .size directive.
 1.3.6.4 11-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1096):
lib/libc/arch/sh3/gen/swapcontext.S: revision 1.7
PIC_PROLOGUE doesn't take temp register argument, adjust.
 1.3.6.3 11-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1096):
lib/libc/arch/sh3/gen/swapcontext.S: revision 1.6
Use PLT for PIC calls. Makes the called functions overridable and
avoids text reloc in the shared library.
Same non-PIC code generated.
 1.3.6.2 11-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1096):
lib/libc/arch/sh3/gen/swapcontext.S: revision 1.5
Took me some time to figure that getcontext does _UC_MACHINE_INTRV(oucp) = 0
for us, so add a comment. While here use official _UC_MACHINE_SET_PC
macro in another comment.
 1.3.6.1 11-Jan-2006  tron Pull up following revision(s) (requested by uew in ticket #1096):
lib/libc/arch/sh3/gen/swapcontext.S: revision 1.4
Use macros from <machine/asm.h>. s/r15/sp/. Use cpp-safe label
names. Add comments. Same object code is generated.
 1.8.18.1 18-May-2008  yamt sync with head.
 1.9.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.24.1 19-Apr-2015  msaitoh Pull up following revision(s) (requested by uwe in ticket #1294):

lib/libc/arch/sh3/gen/swapcontext.S 1.11-1.12 via patch

Correctly preserve old sate in swapcontext(3).
Fixes PR port-sh3/49597 reported by Yasushi Oshima.
 1.9.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9.8.1 28-Apr-2008  martin file swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.9.6.1 19-Apr-2015  msaitoh Pull up following revision(s) (requested by uwe in ticket #1960):

lib/libc/arch/sh3/gen/swapcontext.S 1.11-1.12 via patch

Correctly preserve old sate in swapcontext(3).
Fixes PR port-sh3/49597 reported by Yasushi Oshima.
 1.9.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.10.4.1 19-Apr-2015  msaitoh Pull up following revision(s) (requested by uwe in ticket #709):
lib/libc/arch/sh3/gen/swapcontext.S: revision 1.11
lib/libc/arch/sh3/gen/swapcontext.S: revision 1.12
- Adjust _UC_MACHINE_SP(oucp) to "drop" values we pushed to the stack.
t_swapcontext tests pass now with gcc 4.8. From Yasushi Oshima in
PR port-sh3/49597.
- On swapcontext(3) preserve r12 too. Properly fixes PR port-sh3/49597.
 1.8 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.7 27-Mar-2004  uwe Mark gcc "millicode" functions .hidden if compiled for PIC. NB: these
files are *NOT* used, as we now provide gcc's version of millicode in
libgcc_pic.
 1.6 27-Aug-2003  uwe Add a comment that explains that

. this function cannot have _PROF_PROLOGUE
. this function cannot be called via PLT

Change ENTRY to NENTRY for the former.

XXX: The latter is important in the gcc3 world, that have shared
libraries. We will need to play tricks with .hidden to make sure
every shared library gets its own private __udivsi3 that it can call
directly, without going through the PLT.
 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 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.3 11-May-2001  msaitoh style fix (no functional change)
 1.2 14-Feb-2001  msaitoh branches: 1.2.2;
use _C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3 24-Dec-2005  perry __asm__ -> __asm
 1.2 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.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3 24-Dec-2005  perry __asm__ -> __asm
 1.2 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.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3 24-Dec-2005  perry __asm__ -> __asm
 1.2 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.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3 24-Dec-2005  perry __asm__ -> __asm
 1.2 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.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.1 06-Jun-2000  tsubai branches: 1.1.4;
Add softfloat glue for sh3.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 06-Jun-2000  minoura file milieu.h was added on branch minoura-xpg4dl on 2000-06-23 16:17:18 +0000
 1.2 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 06-Jun-2000  tsubai branches: 1.1.4;
Add softfloat glue for sh3.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 06-Jun-2000  minoura file sh3-gcc.h was added on branch minoura-xpg4dl on 2000-06-23 16:17:18 +0000
 1.2 21-Apr-2002  bjh21 All the versions of softfloat-specialize were practically identical, so replace
them with a single one.
 1.1 06-Jun-2000  tsubai branches: 1.1.4; 1.1.6;
Add softfloat glue for sh3.
 1.1.6.1 25-Apr-2002  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 06-Jun-2000  minoura file softfloat-specialize was added on branch minoura-xpg4dl on 2000-06-23 16:17:19 +0000
 1.11 07-Jul-2011  matt Don't define a new enum. Just #define round_* to their FP_Rx instead.
 1.10 04-Jul-2011  matt Add __floatunsidf __floatunsisf __floatunsitf routines.
XXX i think they are correct but not sure.
 1.9 16-May-2006  mrg if SOFTFLOAT_FOR_GCC is not defined, don't declare float_detect_tininess.
 1.8 21-Aug-2003  uwe Add missing prototypes to make softfloat compile with -DSOFTFLOAT_NEED_FIXUNS.
 1.7 12-May-2002  bjh21 Add SIGFPE support to SoftFloat, so fpsetmask/fpgetmask now work. A new
variable, float_exception_mask (#defined to _softfloat_float_exception_mask)
contains the current exception mask.
Also make the argument to float_raise into an fp_except.
Also synchronise file header comments between files.
 1.6 06-May-2002  bjh21 Consistently declare the types of float_rounding_mode and float_exception_flags
as fp_rnd and fp_except respectively.
 1.5 26-Apr-2001  simonb Fix typos in an (unused) function return type.
 1.4 08-Feb-2001  bjh21 branches: 1.4.2;
Don't declare functions that are provided elsewhere in libc.
 1.3 15-Jul-2000  bjh21 Revert previous change -- turned out I'd got my build environment in a twist.
 1.2 15-Jul-2000  bjh21 Add fixunssfsi and fixunsdfsi. These are provided by libgcc2.c in GCC 2.95,
but not in EGCS.

This version of fixunssfsi is almost exactly the arm32 version. fixunsdfsi is
mostly based on fixdfsi, but with simplifications for 64-bit integers.

Only minimal testing has been applied so far.
 1.1 06-Jun-2000  tsubai branches: 1.1.4;
Add softfloat glue for sh3.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 06-Jun-2000  minoura file softfloat.h was added on branch minoura-xpg4dl on 2000-06-23 16:17:19 +0000
 1.4.2.2 21-Jun-2002  nathanw Catch up to -current.
 1.4.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.4 04-Aug-2008  matt branches: 1.4.6;
Add C99 functions imaxabs and imaxdiv.
 1.3 22-Mar-2006  drochner branches: 1.3.20;
build erand48_ieee754.c on everything but vax
 1.2 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.5 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.4 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.3 20-Nov-2002  itohy Assembly version of string functions.
Originally from SHIMIZU Ryo.
 1.2 24-Aug-2002  itohy Use assembly version of ffs(3).
 1.1 05-Jan-2000  msaitoh branches: 1.1.6;
libc for SH3.
TODO: fplib
 1.1.6.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.6.1 27-Aug-2002  nathanw Catch up to -current.
 1.3 23-Apr-2006  uwe Now that bcopy.S doesn't contain the actual implemenation, move it
back to libc.
 1.2 22-Dec-2005  christos move to the common tree.
 1.1 20-Nov-2002  itohy branches: 1.1.2;
Assembly version of string functions.
Originally from SHIMIZU Ryo.
 1.1.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 20-Nov-2002  thorpej file bcopy.S was added on branch nathanw_sa on 2002-12-10 06:25:44 +0000
 1.1 20-Nov-2002  itohy branches: 1.1.2;
Assembly version of string functions.
Originally from SHIMIZU Ryo.
 1.1.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 20-Nov-2002  thorpej file bzero.S was added on branch nathanw_sa on 2002-12-10 06:25:45 +0000
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 01-Sep-2002  itohy Save 1-4 instructions on all cases except for the ret=0 case.

This is probably the last version from me. :)
You are welcome to speed it up, of course. :)

Here's a benchmark on SH-4 200MHz.
9.2% faster if all the cases occur evenly.

return value C version previous vers this version speed ratio
of ffs() (ns/call) *1 (ns/call) (ns/call) *2 (*1/*2)
 1.3 28-Aug-2002  itohy Slightly improved version of ffs(3).
Partially from SHIMIZU Ryo <ryo@iij.ad.jp>. Thanks.
Some cases are slower, but other most cases are faster.

Here's a benchmark on SH-4 200MHz.

return value C version previous vers this version speed ratio
of ffs() (ns/call) *1 (ns/call) (ns/call) *2 (*1/*2)
 1.2 24-Aug-2002  itohy branches: 1.2.2;
Oops, SYSLIBC_SCCS -> LIBC_SCCS
 1.1 24-Aug-2002  itohy Assembly version of ffs(3).
Confirmed to return the same value as that of the C version.

The results of a simple benchmark on SH-4 200MHz, is shown below.
I think this shows acceptable performance.

return value C version this version speed
of ffs() (ns/call) (ns/call) ratio
 1.2.2.3 17-Sep-2002  nathanw Catch up to -current.
 1.2.2.2 27-Aug-2002  nathanw Catch up to -current.
 1.2.2.1 24-Aug-2002  nathanw file ffs.S was added on branch nathanw_sa on 2002-08-27 23:49:28 +0000
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 20-Nov-2002  itohy branches: 1.1.2;
Assembly version of string functions.
Originally from SHIMIZU Ryo.
 1.1.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 20-Nov-2002  thorpej file memcpy.S was added on branch nathanw_sa on 2002-12-10 06:25:45 +0000
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 20-Nov-2002  itohy branches: 1.1.2;
Assembly version of string functions.
Originally from SHIMIZU Ryo.
 1.1.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 20-Nov-2002  thorpej file memmove.S was added on branch nathanw_sa on 2002-12-10 06:25:45 +0000
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 20-Nov-2002  itohy branches: 1.1.2;
Assembly version of string functions.
Originally from SHIMIZU Ryo.
 1.1.2.2 10-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 20-Nov-2002  thorpej file memset.S was added on branch nathanw_sa on 2002-12-10 06:25:45 +0000
 1.6 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.5 07-Aug-2003  agc branches: 1.5.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.3 11-May-2001  msaitoh style fix (no functional change)
 1.2 09-Apr-2001  marcus Added missing _C_LABEL to errno reference.
 1.1 05-Jan-2000  msaitoh branches: 1.1.6;
libc for SH3.
TODO: fplib
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.5.6.1 22-Jan-2006  tron Apply patch (requested by uwe in ticket #1102):
Use JUMP_CERROR instead of messing with errno directly.
Simplify. Add WARN_REFERENCES.
 1.7 12-Sep-2013  joerg 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 06-Jan-2006  uwe branches: 1.6.44; 1.6.50;
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.5 05-Jan-2006  uwe Use PLT for PIC call to _exit to avoid text reloc in the shared library.
Add .size directive.
 1.4 05-Jan-2006  uwe Use macros from <machine/asm.h>. Add some comments.
Same PIC object code. Almost the same non-PIC object code (b/c of
s/jsr/jmp/ to _exit).
 1.3 24-Oct-2003  uwe branches: 1.3.6;
In PIC code "braf" to cerror, not "bsrf" to it!
 1.2 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.1 22-Jul-2001  tsubai branches: 1.1.2;
Add __clone() for sh3.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 22-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:18:06 +0000
 1.3.6.3 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.3.6.2 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/sys/__clone.S: revision 1.5
Use PLT for PIC call to _exit to avoid text reloc in the shared library.
Add .size directive.
 1.3.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/sys/__clone.S: revision 1.4
Use macros from <machine/asm.h>. Add some comments.
Same PIC object code. Almost the same non-PIC object code (b/c of
s/jsr/jmp/ to _exit).
 1.6.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.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.2 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.1 20-Apr-2000  tsubai Add missing files.
 1.9 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.8 28-Apr-2008  martin branches: 1.8.8;
Remove clause 3 and 4 from TNF licenses
 1.7 18-May-2006  christos branches: 1.7.18;
change __weak_extern to __weak_reference so that gcc4 works.
 1.6 19-Feb-2006  christos make these consistent.
 1.5 12-Jun-2005  lukem Add missing __RCSID()
 1.4 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.3 23-Nov-2003  uwe Implement siginfo for sh3.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:28:05 +0000
 1.7.18.1 18-May-2008  yamt sync with head.
 1.8.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.4 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.3 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.2 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.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.2 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:28:05 +0000
 1.5 24-Nov-2021  thorpej Decorate the SuperH signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.4 15-Oct-2020  skrll Trailing whitespace
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 06-Jan-2006  uwe branches: 1.2.18;
Add .size directive.
 1.1 23-Nov-2003  uwe Implement siginfo for sh3.
 1.2.18.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 __sigtramp2.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.6 06-Jan-2006  uwe This can be simplified to RSYSCALL(__syscall), no special treatment necessary.
 1.5 07-Aug-2003  agc branches: 1.5.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.3 11-May-2001  msaitoh style fix (no functional change)
 1.2 17-Jan-2001  itojun branches: 1.2.2;
fix syscall() and __syscall(). r0 has to be set to SYS_syscall or
SYS___syscall, respectively. otherwise sys/arch/sh3/sh3/trap.c will
look at the wrong argument.
 1.1 04-Jan-2001  itojun __syscall is now mandatory
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5.6.1 11-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1097):
lib/libc/arch/sh3/sys/__syscall.S: revision 1.6
This can be simplified to RSYSCALL(__syscall), no special treatment necessary.
 1.6 06-Jan-2006  uwe Use JUMP_CERROR instead of messing with errno directly.
Simplify.
 1.5 07-Aug-2003  agc branches: 1.5.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.3 11-May-2001  msaitoh style fix (no functional change)
 1.2 16-Feb-2001  msaitoh branches: 1.2.2;
_C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1102):
lib/libc/arch/sh3/sys/__vfork14.S: revision 1.6
Use JUMP_CERROR instead of messing with errno directly.
Simplify.
 1.11 12-Sep-2013  joerg 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.10 06-Jan-2006  uwe branches: 1.10.44; 1.10.50;
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.9 07-Aug-2003  agc branches: 1.9.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.7 11-May-2001  msaitoh style fix (no functional change)
 1.6 16-Dec-2000  tsubai branches: 1.6.2;
Fix weak alias.
 1.5 04-Aug-2000  tsubai s/minbrk/_C_LABEL(__minbrk)/.
 1.4 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.3 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.2 27-Mar-2000  msaitoh branches: 1.2.4;
fill delay slots (from Klaus Klein)
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.4.1 22-Aug-2000  kleink Pull up revs. 1.3-1.4 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.6.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.9.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.10.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.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.11 12-Sep-2013  joerg 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.10 06-Jan-2006  uwe branches: 1.10.44; 1.10.50;
Change !_REENTRANT && !PIC case to use r4 too.
 1.9 06-Jan-2006  uwe Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.8 05-Jan-2006  uwe Use PLT for PIC call to __errno to avoid text reloc in the shared library.
Add .size directive.
 1.7 28-May-2004  uwe branches: 1.7.2;
Provide _REENTRANT code. It's a wonder nobody has noticed this before.
Uncovered by multithreaded bind9 utils.
 1.6 07-Aug-2003  agc branches: 1.6.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 14-Feb-2001  msaitoh branches: 1.3.2;
use _C_LABEL()
 1.2 27-Mar-2000  msaitoh fill delay slots (from Klaus Klein)
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.2.1 29-May-2004  tron Pull up revision 1.7 (requested by uwe in ticket #418):
Provide _REENTRANT code. It's a wonder nobody has noticed this before.
Uncovered by multithreaded bind9 utils.
 1.7.2.3 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/sys/cerror.S: revision 1.10
Change !_REENTRANT && !PIC case to use r4 too.
 1.7.2.2 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.7.2.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/sys/cerror.S: revision 1.8
Use PLT for PIC call to __errno to avoid text reloc in the shared library.
Add .size directive.
 1.10.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.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.6 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.5 06-Jan-2006  uwe branches: 1.5.68; 1.5.72;
This can be simplified to PSEUDO(exect,execve).
 1.4 07-Aug-2003  agc branches: 1.4.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.2 11-May-2001  msaitoh style fix (no functional change)
 1.1 05-Jan-2000  msaitoh branches: 1.1.6;
libc for SH3.
TODO: fplib
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.4.6.1 11-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1097):
lib/libc/arch/sh3/sys/exect.S: revision 1.5
This can be simplified to PSEUDO(exect,execve).
 1.5.72.1 21-Apr-2017  bouyer Sync with HEAD
 1.5.68.1 20-Mar-2017  pgoyette Sync with HEAD
 1.10 06-Jan-2006  uwe Open code _SYSCALL_NOERROR to shave off a memory load and a branch.
Makes this congruent to vforks. Add .size directive.
 1.9 06-Jan-2006  uwe Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.8 07-Aug-2003  agc branches: 1.8.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.6 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.5 11-May-2001  msaitoh style fix (no functional change)
 1.4 16-Dec-2000  tsubai branches: 1.4.2;
Fix weak alias.
 1.3 26-Jun-2000  kleink Need an internal name for fork().
 1.2 27-Mar-2000  msaitoh branches: 1.2.4;
fill delay slots (from Klaus Klein)
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.4.1 22-Aug-2000  kleink Pull up rev. 1.3 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.4.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.8.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 22-Jun-2002  thorpej branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 22-Jun-2002  thorpej ucontext-related functions. From Klaus Klein.
 1.2.30.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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.1 20-Apr-2000  tsubai Add missing files.
 1.7 06-Jan-2006  uwe Simplify.
 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 11-May-2001  msaitoh style fix (no functional change)
 1.4 16-Dec-2000  tsubai branches: 1.4.2;
Fix weak alias.
 1.3 28-Sep-2000  kleink Need an internal name for pipe(2).
 1.2 27-Mar-2000  msaitoh branches: 1.2.4;
fill delay slots (from Klaus Klein)
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.4.1 29-Sep-2000  kleink Pull up rev. 1.3 (approved by thorpej):
Add internal name for pipe().
 1.4.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.9 12-Sep-2013  joerg 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.8 06-Jan-2006  uwe branches: 1.8.44; 1.8.50;
Provide _REENTRANT version of errno = 0;
 1.7 06-Jan-2006  uwe Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.6 24-Oct-2003  uwe branches: 1.6.6;
In PIC code "braf" to cerror, not "bsrf" to it!
 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 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.3 11-May-2001  msaitoh style fix (no functional change)
 1.2 16-Feb-2001  msaitoh branches: 1.2.2;
_C_LABEL()
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.6.2 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1103):
lib/libc/arch/sh3/sys/ptrace.S: revision 1.8
Provide _REENTRANT version of errno = 0;
 1.6.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.8.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.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.10 12-Sep-2013  joerg 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.9 06-Jan-2006  uwe branches: 1.9.44; 1.9.50;
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.8 07-Aug-2003  agc branches: 1.8.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.6 11-May-2001  msaitoh style fix (no functional change)
 1.5 16-Dec-2000  tsubai branches: 1.5.2;
Fix weak alias.
 1.4 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.3 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.2 27-Mar-2000  msaitoh branches: 1.2.4;
fill delay slots (from Klaus Klein)
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.4.1 22-Aug-2000  kleink Pull up revs. 1.3-1.4 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.5.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.8.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.9.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.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.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 16-Feb-2001  msaitoh branches: 1.3.2;
_C_LABEL()
 1.2 27-Mar-2000  msaitoh fill delay slots (from Klaus Klein)
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.2 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.1 07-Jul-2000  itohy Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.2 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.1 20-Apr-2000  tsubai Add missing files.
 1.2 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.6 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 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 11-May-2001  msaitoh style fix (no functional change)
 1.3 04-Aug-2000  tsubai branches: 1.3.2;
Change comment character from '#' to '!'. (binutils-2.10 doesn't like '#')
 1.2 27-Mar-2000  msaitoh fill delay slots (from Klaus Klein)
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.3.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.7 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.6 07-Aug-2003  agc branches: 1.6.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.4 11-May-2001  msaitoh style fix (no functional change)
 1.3 09-Apr-2001  marcus Renamed reference to compat syscall to conform to new naming scheme.
 1.2 04-Aug-2000  tsubai branches: 1.2.2;
Change comment character from '#' to '!'. (binutils-2.10 doesn't like '#')
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.4 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.3 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 1.2 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.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.6 15-Sep-2005  uwe Switch arch/sh3/sys to the new compat code layout.
 1.5 07-Aug-2003  agc branches: 1.5.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.3 11-May-2001  msaitoh style fix (no functional change)
 1.2 04-Aug-2000  tsubai branches: 1.2.2;
Change comment character from '#' to '!'. (binutils-2.10 doesn't like '#')
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5.6.1 22-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1101):
lib/libc/arch/sh3/SYS.h: revision 1.8
lib/libc/arch/sh3/sys/brk.S: revision 1.10
lib/libc/arch/sh3/sys/__clone.S: revision 1.6
lib/libc/arch/sh3/sys/cerror.S: revision 1.9
lib/libc/arch/sh3/sys/ptrace.S: revision 1.7
lib/libc/arch/sh3/sys/fork.S: revision 1.9
lib/libc/arch/sh3/sys/sbrk.S: revision 1.9
lib/libc/arch/sh3/sys/sigprocmask.S: patch
lib/libc/arch/sh3/sys/sigsuspend.S: patch
Change cerror to take errno in r4, instead of r0.
In PIC code fetch cerror address from GOT to avoid
unresolved text relocations in shared libraries.
Hide the code to jump to cerror inside JUMP_CERROR macro.
Change syscall code to use JUMP_CERROR.
Die text relocations! DIE!
 1.7 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.6 06-Jan-2006  uwe branches: 1.6.86;
This can be simplified to RSYSCALL(syscall), no special treatment necessary.
 1.5 07-Aug-2003  agc branches: 1.5.6;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 01-Jul-2003  marcus Generate proper PIC code for libc_pic.a.
 1.3 11-May-2001  msaitoh style fix (no functional change)
 1.2 17-Jan-2001  itojun branches: 1.2.2;
fix syscall() and __syscall(). r0 has to be set to SYS_syscall or
SYS___syscall, respectively. otherwise sys/arch/sh3/sh3/trap.c will
look at the wrong argument.
 1.1 05-Jan-2000  msaitoh libc for SH3.
TODO: fplib
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.5.6.1 11-Jan-2006  tron Pull up following revision(s) (requested by uwe in ticket #1097):
lib/libc/arch/sh3/sys/syscall.S: revision 1.6
This can be simplified to RSYSCALL(syscall), no special treatment necessary.
 1.6.86.1 21-Apr-2020  martin Sync with HEAD
 1.4 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.3 10-Feb-1994  pk Insert some Position Independent Code.
 1.2 23-Jan-1994  deraadt ## and /**/
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.17 03-Sep-2023  mrg avoid array-bounds issues by using more complete types.

also, don't cast to a type that includes an extra, unused, member.

while here, replace the hard coded offsets in setjmp.S and some
asserts in longjmp.c with assym.h and shared structures for all
the movings parts, and asserts based upon those structures.

avoids GCC 12 warnings.
 1.16 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.15 12-Jul-2014  nakayama Include sparc_v8 library into sparc64 32-bit compat libc library.
 1.14 12-Apr-2011  mrg branches: 1.14.10; 1.14.20;
rm -f ${.TARGET} before trying to > write to it; some how mine ended up
being mode 444 and the build failed.
 1.13 26-Oct-2008  mrg branches: 1.13.4;
define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build.
 1.12 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.11 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.10 20-Apr-2005  jmc Don't use 'm4' here. Use $TOOL_M4 instead.
 1.9 12-Oct-2003  pk SIGINFO __sigaction & trampoline code.
 1.8 27-Oct-2002  chs remove setjmp/longjmp from libkern, they're not used.
 1.7 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.6 09-Oct-1997  lukem branches: 1.6.14;
rcsid police
 1.5 18-Nov-1996  pk Remove reference to DEFS.h
 1.4 30-Jun-1994  deraadt set KMSRCS & friends
 1.3 08-Dec-1993  pk Fix location of sources -> arch/sparc
 1.2 04-Dec-1993  cgd update for .S and MACHINE_ARCH
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6.14.2 11-Nov-2002  nathanw Catch up to -current
 1.6.14.1 01-Aug-2002  nathanw Catch up to -current.
 1.13.4.2 26-Oct-2008  mrg define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build.
 1.13.4.1 26-Oct-2008  mrg file Makefile.inc was added on branch christos-time_t on 2008-10-26 07:43:08 +0000
 1.14.20.1 10-Aug-2014  tls Rebase.
 1.14.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19 12-Sep-2013  joerg 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.18 28-Mar-2011  martin branches: 1.18.4; 1.18.10;
ABI police: avoid cluttering global registers %g2 and %g7. Not quite there
yet for %g2, but the target is not very well defined. %g7 should be clean
now.
 1.17 08-Oct-2007  uwe In handwritten asm use -fPIC code instead of -fpic, our libc has grown
large enough for GOT to be larger than 8k.

While here kill redundant PIC ifdefs in setjmp.S - sparc "call"
instruction is piccy by itself.

Tested by martin@
 1.16 20-May-2005  uwe branches: 1.16.10;
Prettify. Avoid code duplication.
Same object code is generated.
 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 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.13 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.12 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.11 23-Jul-2001  christos Add a macro "CALL()" to call a function correctly in the pic and non pic
case. Write ERROR() in terms of call.
 1.10 26-Jun-2000  kleink branches: 1.10.2;
Add a _SYSCALL(entry,syscall) macro like the one found on other
architectures.
 1.9 31-Mar-1999  kleink branches: 1.9.10;
While in transition, conditionally rename _ASM_LABEL(cerror) and
_ASM_LABEL(curbrk) to _C_LABEL(__cerror) and _C_LABEL(__curbrk), respectively,
depending on the object format chosen, to avoid user namespace clashes.
 1.8 04-May-1997  kleink Fix typo in last commit.
 1.7 02-May-1997  kleink Consistency: distinguish between PSEUDO() and PSEUDO_NOERROR().
 1.6 09-Nov-1996  pk Flesh out the `noerror' syscall macros.
 1.5 24-Oct-1996  jtc fix typo
 1.4 19-Oct-1996  jtc Added new macros:
SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.

RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.

These macros simply call SYSCALL / RSYSCALL, and serve as placeholders
until an optimized implementation is done.
 1.3 10-Feb-1994  pk Insert some Position Independent Code.
 1.2 15-Jan-1994  pk Make it work with old-style (/usr/bin) cpp
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.9.10.1 25-Jul-2000  kleink Pull up rev. 1.10 (approved by thorpej):
Add a _SYSCALL(entry,syscall) macro.
 1.10.2.3 21-Jun-2002  nathanw Catch up to -current.
 1.10.2.2 28-Jan-2002  nathanw Catch up to -current.
 1.10.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.16.10.1 06-Nov-2007  matt sync with HEAD
 1.18.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.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.1 03-Sep-2023  mrg avoid array-bounds issues by using more complete types.

also, don't cast to a type that includes an extra, unused, member.

while here, replace the hard coded offsets in setjmp.S and some
asserts in longjmp.c with assym.h and shared structures for all
the movings parts, and asserts based upon those structures.

avoids GCC 12 warnings.
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.24 03-Sep-2023  mrg avoid array-bounds issues by using more complete types.

also, don't cast to a type that includes an extra, unused, member.

while here, replace the hard coded offsets in setjmp.S and some
asserts in longjmp.c with assym.h and shared structures for all
the movings parts, and asserts based upon those structures.

avoids GCC 12 warnings.
 1.23 12-Jul-2014  nakayama Include sparc_v8 library into sparc64 32-bit compat libc library.
 1.22 06-Dec-2009  uebayasi branches: 1.22.12; 1.22.22;
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.21 03-Jul-2006  drochner build frexp_ieee754 and ldexp_ieee754 in the "compat" subtree
(There is an assembler version of modf which needs to be checked.)
 1.20 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.19 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.18 22-Mar-2004  pk branches: 1.18.6;
Use setcontext() instead of sigreturn() to implement longjmp().
 1.17 04-Mar-2004  kleink * 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.16 12-Feb-2004  kleink Forgot to build signbit() library parts in previous; noticed by mrg.
 1.15 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.14 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.13 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.12 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.11 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.10 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.9 21-Jan-2003  kleink Add swapcontext() lint stub.
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 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.6 23-Dec-1999  kleink branches: 1.6.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.5 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 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.3 10-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,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.6.6.3 23-Nov-2002  martin Add the new files to the Makefile (oops!), fix a small glitch in
makecontext and add _lwp.c (nearly verbatim copy or the sparc64 one).
 1.6.6.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.18.6.1 19-Apr-2005  tron Pull up revision 1.19 (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.22.22.1 10-Aug-2014  tls Rebase.
 1.22.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.3 14-Sep-2005  martin Add missing <compat/include/setjmp.h>
 1.2 23-Mar-2004  pk The sc_g1, sc_o0 members in the jmp_buf aren't used.
 1.1 22-Mar-2004  pk Use setcontext() instead of sigreturn() to implement longjmp().
 1.5 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.4 23-Mar-2004  pk Since libpthread may want to interpose signal handling, we can't directly
invoke the sigprocmask syscall trap. So build a stack frame and call
the signal handling functions by name.
 1.3 22-Mar-2004  pk Use setcontext() instead of sigreturn() to implement longjmp().
 1.2 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.1 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.4 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.3 16-Oct-1998  christos Fix the non pic version too.
 1.2 16-Oct-1998  christos PR/6285: Tom Ivar Helbekkmo: sigsetjmp/siglongjmp broken after current signal
changes.
 1.1 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.10 24-Apr-2025  riastradh sparc _lwp_makecontext, makecontext: Sort includes.

No functional change intended.

Tidying up for:

PR kern/59327: user stack pointer is not aligned properly
 1.9 24-Apr-2025  martin include <sys/param.h> for STACK_ALIGNBYTES
 1.8 24-Apr-2025  riastradh sparc: Use STACK_ALIGNBYTES macro when aligning stack pointer.

Prompted by:

PR kern/59327: user stack pointer is not aligned properly
 1.7 21-Mar-2012  christos branches: 1.7.44;
void cast
 1.6 24-Feb-2011  joerg branches: 1.6.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.5 28-Apr-2008  martin branches: 1.5.8; 1.5.20;
Remove clause 3 and 4 from TNF licenses
 1.4 12-Jun-2005  lukem branches: 1.4.18;
Add missing __RCSID()
 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 23-Nov-2002  martin branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.4 16-Jan-2003  thorpej Add missing notice.
 1.1.2.3 18-Dec-2002  skrll Fix up after change to mcontext.h
 1.1.2.2 29-Nov-2002  uwe Clean up remaining sparc64'isms. Beautify it a bit.
XXX: keep the code that sets %i6 and %i7 in the window save area,
though I think it's not necessary.
 1.1.2.1 23-Nov-2002  martin Add the new files to the Makefile (oops!), fix a small glitch in
makecontext and add _lwp.c (nearly verbatim copy or the sparc64 one).
 1.4.18.1 18-May-2008  yamt sync with head.
 1.5.20.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file _lwp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.6.4.1 17-Apr-2012  yamt sync with head
 1.7.44.1 02-Aug-2025  perseant Sync with HEAD
 1.10 12-Jul-2014  nakayama Use save instruction to set up a local stack frame.

This fixes a segmentation fault caused by bash 4.3 on sparc64
kernels with 32-bit userland, bash uses _setjmp/_longjmp heavyly
via sigsetjmp/siglongjmp since 4.3.

For 32-bit compat library which is compiled with -mcpu=ultrasparc
option (and define __sparc_v9__), use a similar code to 64-bit
library.
 1.9 30-Apr-2011  martin branches: 1.9.6; 1.9.10; 1.9.12; 1.9.18; 1.9.20;
Save a few global registers during set/longjmp - at least the application
registers and the only currently used system register (%g7).
Sparc now passes the setjmp tests (and should be able to build perl again).
 1.8 28-Apr-2008  martin branches: 1.8.8;
Remove clause 3 and 4 from TNF licenses
 1.7 23-Mar-2004  pk branches: 1.7.30;
Fix comment: g6 => o1
 1.6 27-Jun-1999  pk A new implementation of _setjmp/_longjmp that uses the T_FLUSHWIN trap.
This means the stack frame and program counter can restored directly
from the jmp_buf, eliminating the need to backtrack through frames
which does not work in all cases.
 1.5 01-Jul-1998  tv Change immediate label references to _C_LABEL().
 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 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.2 06-Mar-1996  pk Avoid load/store doubles; jmp_buf is long aligned (Michael Eriksson; PR#2180)
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7.30.1 18-May-2008  yamt sync with head.
 1.8.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8.8.1 28-Apr-2008  martin file _setjmp.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.9.20.1 10-Aug-2014  tls Rebase.
 1.9.18.1 07-Aug-2014  msaitoh Pull up following revision(s) (requested by nakayama in ticket #1100):
lib/libc/arch/sparc/gen/_setjmp.S: revision 1.10
Use save instruction to set up a local stack frame.
This fixes a segmentation fault caused by bash 4.3 on sparc64
kernels with 32-bit userland, bash uses _setjmp/_longjmp heavyly
via sigsetjmp/siglongjmp since 4.3.
For 32-bit compat library which is compiled with -mcpu=ultrasparc
option (and define __sparc_v9__), use a similar code to 64-bit
library.
 1.9.12.1 07-Aug-2014  msaitoh Pull up following revision(s) (requested by nakayama in ticket #1100):
lib/libc/arch/sparc/gen/_setjmp.S: revision 1.10
Use save instruction to set up a local stack frame.
This fixes a segmentation fault caused by bash 4.3 on sparc64
kernels with 32-bit userland, bash uses _setjmp/_longjmp heavyly
via sigsetjmp/siglongjmp since 4.3.
For 32-bit compat library which is compiled with -mcpu=ultrasparc
option (and define __sparc_v9__), use a similar code to 64-bit
library.
 1.9.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.6.1 07-Aug-2014  msaitoh Use save instruction to set up a local stack frame.
This fixes a segmentation fault caused by bash 4.3 on sparc64
kernels with 32-bit userland, bash uses _setjmp/_longjmp heavyly
via sigsetjmp/siglongjmp since 4.3.
For 32-bit compat library which is compiled with -mcpu=ultrasparc
option (and define __sparc_v9__), use a similar code to 64-bit
library.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6 23-Mar-2011  martin Avoid using %g7
 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 09-Oct-1997  lukem rcsid police
 1.3 18-Nov-1996  mrg update for removed DEFS.h.
 1.2 22-Apr-1995  pk Preserve the equality "x == y*(x/y)+(x%y)" for negative y; from Lon Willett.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5 07-Nov-2018  riastradh On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.

For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm. For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64. Need help from an itanium
wizard! Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.
 1.4 07-Aug-2003  agc branches: 1.4.96; 1.4.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4.98.1 10-Jun-2019  christos Sync with HEAD
 1.4.96.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6 12-Sep-2013  joerg 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.5 07-Aug-2003  agc branches: 1.5.56; 1.5.62;
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 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.2 14-Aug-1995  pk Make PIC-safe.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7 21-Mar-2012  christos c89 prototypes, unsigned int
 1.6 24-Dec-2005  perry branches: 1.6.44;
__asm__ -> __asm
 1.5 12-Jun-2005  lukem Add missing __RCSID()
 1.4 01-Nov-2003  nakayama Corrent map order to match sparc/ieeefp.h.
 1.3 09-Jan-1998  perry RCS Id Police.
 1.2 18-Jul-1997  thorpej Pull in __flt_rounds() prototype.
 1.1 10-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.6.44.1 17-Apr-2012  yamt sync with head
 1.6 21-Mar-2012  christos c89 prototypes, unsigned int
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 10-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.6 21-Mar-2012  christos c89 prototypes, unsigned int
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 10-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.6 21-Mar-2012  christos c89 prototypes, unsigned int
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 10-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.6 21-Mar-2012  christos c89 prototypes, unsigned int
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 10-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.8 02-Apr-2024  rillig sparc/fpsetround: fix the nearby signed integer overflow as well

Same as for sparc64 a few days ago.
 1.7 02-Apr-2024  christos fix lint
 1.6 21-Mar-2012  christos c89 prototypes, unsigned int
 1.5 24-Dec-2005  perry branches: 1.5.44;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 10-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.44.1 17-Apr-2012  yamt sync with head
 1.6 18-Oct-2013  mrg convert to full ANSI C.
 1.5 24-Dec-2005  perry branches: 1.5.44; 1.5.50;
__asm__ -> __asm
 1.4 12-Jun-2005  lukem Add missing __RCSID()
 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 10-Apr-1995  jtc Added __flt_rounds, fp{get,set}{mask,round,sticky}.
 1.2.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.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.5 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.4 29-Aug-1999  mycroft branches: 1.4.10;
Trivial KNF.
 1.3 10-Mar-1999  mycroft Just some minor cleanup.
 1.2 13-Jul-1997  christos Add missing math.h include
Fix RCSID's
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.3 19-Jan-2003  kleink Move getcontext.S from gen to sys, where it belongs.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 21-Nov-2002  martin branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.2 29-Nov-2002  uwe Cosmetic: use "clr [...]" instead of "st %g0, [...]".
 1.1.2.1 21-Nov-2002  martin Add context handling functions from Klaus Klein.
 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 19-Oct-1993  deraadt First cut; not sure if it's right. Very like it is, because it's
the same as the m68k versions..
 1.5.2.1 08-Mar-2002  nathanw Catch up to -current.
 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 RCSID's
 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.7 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.6 22-Jan-2000  mycroft branches: 1.6.6;
Delint.
 1.5 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 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 RCSID's
 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.6.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.11 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.10 08-Nov-2001  tron Rename a parameter to fix build problem with new toolchain.
 1.9 30-Aug-1999  mycroft branches: 1.9.10;
Another microoptimization. Take advantage of the addition already having set
the flags for the <=0 comparison.
 1.8 30-Aug-1999  mycroft Reuse the trick of loading 0.0 (rather than 1.0) and then modifying the
exponent. It's a bit faster on some machines.
 1.7 30-Aug-1999  augustss Remove more unused mulexp variables.
 1.6 29-Aug-1999  mycroft ldexp(denormal, exp>1023) would generate the wrong result in all non-overflow
cases. Totally rework this code to fix this bug *and* make it faster.
 1.5 29-Aug-1999  mycroft Don't ever return -0.0.
 1.4 29-Aug-1999  mycroft Minor style change.
 1.3 10-Mar-1999  mycroft Just some minor cleanup.
 1.2 13-Jul-1997  christos Add missing math.h include
Fix RCSID's
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.9.10.2 08-Mar-2002  nathanw Catch up to -current.
 1.9.10.1 14-Nov-2001  nathanw Catch up to -current.
 1.6 24-Apr-2025  riastradh sparc, sparc64 longjmp: Use _UC_SIGMASK to restore signal mask.

This way, restoring the signal mask and restoring the stack pointer
happen atomically with respect to signal handler calls, whereas using
sigprocmask would restore the signal mask _before_ the stack pointer,
breaking sigaltstack.

The motivation for using sigprocmask first and then setcontext later,
rather than _UC_SIGMASK in setcontext, was to get SA-based libpthead
sigprocmask interposition. But that's long gone and unlikely to come
back.

PR lib/57946: longjmp fails to restore stack first before restoring
signal mask on most architectures
 1.5 20-Feb-2024  uwe branches: 1.5.2;
fix typo in comment
 1.4 03-Sep-2023  mrg avoid array-bounds issues by using more complete types.

also, don't cast to a type that includes an extra, unused, member.

while here, replace the hard coded offsets in setjmp.S and some
asserts in longjmp.c with assym.h and shared structures for all
the movings parts, and asserts based upon those structures.

avoids GCC 12 warnings.
 1.3 30-Apr-2011  martin Save a few global registers during set/longjmp - at least the application
registers and the only currently used system register (%g7).
Sparc now passes the setjmp tests (and should be able to build perl again).
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 15-Oct-2005  uwe branches: 1.1.18;
Switch sparc to the new compat code layout.
 1.1.18.1 18-May-2008  yamt 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 longjmp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 24-Apr-2025  riastradh sparc _lwp_makecontext, makecontext: Sort includes.

No functional change intended.

Tidying up for:

PR kern/59327: user stack pointer is not aligned properly
 1.5 24-Apr-2025  martin include <sys/param.h> for STACK_ALIGNBYTES
 1.4 24-Apr-2025  riastradh sparc: Use STACK_ALIGNBYTES macro when aligning stack pointer.

Prompted by:

PR kern/59327: user stack pointer is not aligned properly
 1.3 28-Apr-2008  martin branches: 1.3.8; 1.3.76;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 21-Nov-2002  martin branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.6 18-Dec-2002  skrll Fix up after change to mcontext.h
 1.1.2.5 29-Nov-2002  uwe Our libpthread implementation calls makecontext(3) with argc being
the real argc. Change this accordingly.
 1.1.2.4 27-Nov-2002  uwe Fix off-by-one in previous for arguments passed on the stack.
 1.1.2.3 27-Nov-2002  uwe Correctly pass arguments that don't fit into out registers.
Add comment from cu5 test about argc being one greater then
the number of arguments (per solaris version that we seems to support).
Passes cu5 now.
 1.1.2.2 23-Nov-2002  martin Add the new files to the Makefile (oops!), fix a small glitch in
makecontext and add _lwp.c (nearly verbatim copy or the sparc64 one).
 1.1.2.1 21-Nov-2002  martin Add context handling functions from Klaus Klein.
 1.2.30.1 18-May-2008  yamt sync with head.
 1.3.76.1 02-Aug-2025  perseant 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 makecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.7 12-Sep-2013  joerg 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 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
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 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.3 10-Feb-1994  pk Insert some Position Independent Code.
 1.2 08-Dec-1993  pk Use %hi operator when fiddling a bit high...
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 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:51 +0000
 1.5 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Dec-2006  martin branches: 1.3.10;
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-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.2 18-Jan-2003  thorpej branches: 1.2.16;
Merge the nathanw_sa branch.
 1.1 21-Nov-2002  martin branches: 1.1.2;
file resumecontext.c was initially added on branch nathanw_sa.
 1.1.2.1 21-Nov-2002  martin Add context handling functions from Klaus Klein.
 1.2.16.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #264):
lib/libc/arch/sh5/gen/resumecontext.c: revision 1.2
lib/libc/arch/sh3/gen/resumecontext.c: revision 1.3
lib/libc/arch/sparc/gen/resumecontext.c: revision 1.3
lib/libc/arch/powerpc/gen/resumecontext.c: revision 1.3
lib/libc/arch/arm/gen/resumecontext.c: revision 1.3
lib/libc/arch/mips/gen/resumecontext.c: revision 1.3
lib/libc/arch/vax/gen/resumecontext.c: revision 1.2
lib/libc/arch/powerpc64/gen/resumecontext.c: revision 1.2
lib/libc/arch/hppa/gen/resumecontext.c: revision 1.2
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:
-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.3.10.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.14 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.13 03-Sep-2023  mrg avoid array-bounds issues by using more complete types.

also, don't cast to a type that includes an extra, unused, member.

while here, replace the hard coded offsets in setjmp.S and some
asserts in longjmp.c with assym.h and shared structures for all
the movings parts, and asserts based upon those structures.

avoids GCC 12 warnings.
 1.12 30-Apr-2011  martin Save a few global registers during set/longjmp - at least the application
registers and the only currently used system register (%g7).
Sparc now passes the setjmp tests (and should be able to build perl again).
 1.11 08-Oct-2007  uwe In handwritten asm use -fPIC code instead of -fpic, our libc has grown
large enough for GOT to be larger than 8k.

While here kill redundant PIC ifdefs in setjmp.S - sparc "call"
instruction is piccy by itself.

Tested by martin@
 1.10 28-Dec-2006  martin branches: 1.10.4;
Use CCFSZ instead of 96 for standard save operations.
 1.9 15-Oct-2005  uwe branches: 1.9.4;
Switch sparc to the new compat code layout.
 1.8 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.7 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.6 01-Jul-1998  tv Change immediate label references to _C_LABEL().
 1.5 04-Dec-1997  tv Quick fix to repair runtime link problem with libc - "SYS_sigaltstack
undefined". The sigaltstack structure layout didn't actually change on
the sparc, so just change the syscall name. A better fix would probably
be to replace the direct system call with a function call to the libc
sigaltstack().
 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 17-May-1994  deraadt sigaltstack
 1.2 08-Dec-1993  pk Use sigstack() in stead of sigaltstack() until we have a sigaltstack()
in the kernel.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.9.4.1 04-Jan-2007  bouyer Pull up following revision(s) (requested by martin in ticket #312):
lib/libc/arch/sparc/gen/setjmp.S: revision 1.10
lib/libc/arch/sparc/sys/__clone.S: revision 1.4
lib/libc/arch/sparc/sys/cerror.S: revision 1.9
Use CCFSZ instead of 96 for standard save operations.
 1.10.4.1 06-Nov-2007  matt sync with HEAD
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7 12-Sep-2013  joerg 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 08-Oct-2007  uwe branches: 1.6.30; 1.6.36;
In handwritten asm use -fPIC code instead of -fpic, our libc has grown
large enough for GOT to be larger than 8k.

While here kill redundant PIC ifdefs in setjmp.S - sparc "call"
instruction is piccy by itself.

Tested by martin@
 1.5 15-Oct-2005  uwe branches: 1.5.10;
Switch sparc to the new compat code layout.
 1.4 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.3 01-Jul-1998  tv Change immediate label references to _C_LABEL().
 1.2 11-Mar-1995  pk Simplify.
 1.1 11-Jan-1995  pk Machine dependent sig{set,long}jmp().
 1.5.10.1 06-Nov-2007  matt sync with HEAD
 1.6.36.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.30.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.1 03-Sep-2023  mrg avoid array-bounds issues by using more complete types.

also, don't cast to a type that includes an extra, unused, member.

while here, replace the hard coded offsets in setjmp.S and some
asserts in longjmp.c with assym.h and shared structures for all
the movings parts, and asserts based upon those structures.

avoids GCC 12 warnings.
 1.5 12-Sep-2013  joerg 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.4 12-Sep-2012  manu branches: 1.4.2;
setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@
 1.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 21-Nov-2002  martin branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 21-Nov-2002  martin Add context handling functions from Klaus Klein.
 1.2.30.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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.3.4.2 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.3.4.1 30-Oct-2012  yamt sync with head
 1.4.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.1 25-Feb-1995  cgd need these now, with new net Makefile.inc
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5 11-Aug-2009  dsl Change NO_SRCS lines to specify .S in order to exclude the .c file from
SRCS but add it to LSRCS (sort of makes sense!).
 1.4 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.3 22-Mar-2006  drochner build erand48_ieee754.c on everything but vax
 1.2 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1 05-Nov-1997  cgd branches: 1.1.2;
A foolish consistency... gen, net, and string all get MD sources
specified by including a Makefile.inc from the appropriate MD directory.
stdlib doesn't do that, but there's no reason that it shouldn't (and
it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>A foolish consistency... gen, net, and string all get MD sources
>specified by including a Makefile.inc from the appropriate MD directory.
>stdlib doesn't do that, but there's no reason that it shouldn't (and
>it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.1 05-Nov-1997  veego file Makefile.inc was added on branch netbsd-1-3 on 1997-11-08 21:56:44 +0000
 1.4 20-Jan-2000  kleink Nuke the assembly version, which has been unused for > 2 years and is actually
identical to GCC's output from processing abs.c.
 1.3 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4 04-Aug-2008  matt branches: 1.4.6;
Add C99 functions imaxabs and imaxdiv.
 1.3 07-Aug-2003  agc branches: 1.3.32;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 29-May-2001  kleink Add missing internal names and weak aliases to assembly versions.
 1.1 06-Mar-2000  kleink branches: 1.1.6;
Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.3.32.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file llabs.S was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.4 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.3 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.2 23-Jun-2001  kleink Use a bzero-based assembly language implementation for memset();
inspired by the recent sparc64 change.
 1.1 20-Mar-1995  mycroft branches: 1.1.22;
Separate machine dependencies.
 1.1.22.1 08-Oct-2001  nathanw Catch up to -current.
 1.6 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 23-Jun-2001  kleink Use a bzero-based assembly language implementation for memset();
inspired by the recent sparc64 change.
 1.3 16-Jul-1997  christos branches: 1.3.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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.3.14.1 08-Oct-2001  nathanw Catch up to -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.12 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 13-May-2001  kleink Make this work for PIC (as opposed to pic) without taking chances of fitting
__ffstab into a GOT13 relocation; from Eduardo Horvath.
 1.9 06-Sep-1999  chs branches: 1.9.10;
use RODATA() instead of ENTRY() for __ffstab so that it works when profiling.
 1.8 01-Jul-1998  tv Change immediate label references to _C_LABEL().
 1.7 24-Feb-1998  pk Need to use PIC_PROLOGUE() since `__ffstab' is now a global.
 1.6 22-Feb-1998  mycroft Fix omission in last.
 1.5 22-Feb-1998  mycroft Expose ffstab as __ffstab.
 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 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.2 10-Feb-1994  pk Insert some Position Independent Code.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.9.10.1 08-Oct-2001  nathanw Catch up to -current.
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 23-Jun-2001  kleink branches: 1.1.2;
Use a bzero-based assembly language implementation for memset();
inspired by the recent sparc64 change.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 23-Jun-2001  nathanw file memset.S was added on branch nathanw_sa on 2001-10-08 20:18:20 +0000
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 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.2 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 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 02-Dec-1998  thorpej Warn about references to the compatibility vfork() (i.e. the vfork() with
the 4.4BSD non-shared-address-space semantics), and direct the user to
include <unistd.h> to generate the correct reference.

This warning isn't about an ABI compatibility issue, but the new vfork() is
considerably faster.
 1.2 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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6 28-Apr-2008  martin branches: 1.6.8;
Remove clause 3 and 4 from TNF licenses
 1.5 28-Dec-2006  martin branches: 1.5.10;
Provide a full frame stack space in the clone'd child.
 1.4 28-Dec-2006  martin Use CCFSZ instead of 96 for standard save operations.
 1.3 23-Jan-2004  martin branches: 1.3.16;
If the syscall fails, the carry bit will be set - not the zero bit.
 1.2 02-Jan-2004  martin Restore stack frames on error return.
 1.1 23-Jul-2001  christos branches: 1.1.2;
add an implementation of __clone(2)
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 23-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:18:21 +0000
 1.3.16.2 04-Jan-2007  bouyer Pull up following revision(s) (requested by martin in ticket #313):
lib/libc/arch/sparc/sys/__clone.S: revision 1.5
Provide a full frame stack space in the clone'd child.
 1.3.16.1 04-Jan-2007  bouyer Pull up following revision(s) (requested by martin in ticket #312):
lib/libc/arch/sparc/gen/setjmp.S: revision 1.10
lib/libc/arch/sparc/sys/__clone.S: revision 1.4
lib/libc/arch/sparc/sys/cerror.S: revision 1.9
Use CCFSZ instead of 96 for standard save operations.
 1.5.10.1 18-May-2008  yamt 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 __clone.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.8 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.7 28-Apr-2008  martin branches: 1.7.8;
Remove clause 3 and 4 from TNF licenses
 1.6 19-Feb-2006  christos branches: 1.6.18;
make these consistent.
 1.5 12-Jun-2005  lukem Add missing __RCSID()
 1.4 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.3 12-Oct-2003  pk SIGINFO __sigaction & trampoline code.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:28:06 +0000
 1.6.18.1 18-May-2008  yamt sync with head.
 1.7.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.4 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.3 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.2 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.1 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.5 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.4 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 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 11-Jul-2002  thorpej branches: 1.2.2;
Need <machine/psl.h> and <machine/signal.h>. Problem pointed out
by Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>.
 1.1 09-Jul-2002  thorpej New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.2.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.2.2.1 11-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:28:06 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 12-Oct-2003  pk branches: 1.1.30;
SIGINFO __sigaction & trampoline code.
 1.1.30.1 18-May-2008  yamt 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 __sigtramp2.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 13-Dec-2000  pk branches: 1.1.34;
Add required __syscall.S stub.
 1.1.34.1 18-May-2008  yamt 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 __syscall.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 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.1 04-Jan-1998  thorpej Add syscall stubs for __vfork14(). These are basically copies of Ovfork.S
with the syscall numbers changed.

Since 4.4BSD vfork(2) did not share address space, Ovfork.S could be changed
to be identical to fork.S (modulo syscall numbers). __vfork14.S, however,
needs to remain separate since with a shared address space, the stub needs to
pre-decrement the stack and do an indirect jump to the return address, so that
the shared stackframe is still there when the parent returns. (Obviously,
this does not apply to systems which to not build stackframes on leaf calls.)
 1.16 12-Sep-2013  joerg 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.15 06-Nov-2008  nakayama branches: 1.15.2; 1.15.10; 1.15.16;
Redo rev.1.13. We must refer to CURBRK via GOT in case of PIC.
 1.14 10-Mar-2008  he branches: 1.14.8;
As mrg@ informs me, delay slots are indented 1 and not 2 spaces.
 1.13 10-Mar-2008  he Fix the problem that CURBRK can't be referenced directly via R_SPARC_GOT13
here anymore (apparently libc grew too big). Use sethi and %hi/%lo instead.
 1.12 08-Oct-2007  uwe branches: 1.12.4;
In handwritten asm use -fPIC code instead of -fpic, our libc has grown
large enough for GOT to be larger than 8k.

While here kill redundant PIC ifdefs in setjmp.S - sparc "call"
instruction is piccy by itself.

Tested by martin@
 1.11 26-Dec-2003  martin branches: 1.11.22;
Use an unsigned comparison against minbrk.
From OpenBSD, changed by Miod Vallat.
 1.10 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.9 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.8 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.7 03-Jun-1999  kleink branches: 1.7.8;
Shameless hack to reference end if using a.out and _end if using ELF.
 1.6 31-Mar-1999  kleink While in transition, conditionally rename _ASM_LABEL(cerror) and
_ASM_LABEL(curbrk) to _C_LABEL(__cerror) and _C_LABEL(__curbrk), respectively,
depending on the object format chosen, to avoid user namespace clashes.
 1.5 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.4 01-Jul-1998  tv Change immediate label references to _C_LABEL().
 1.3 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.2 10-Feb-1994  pk Insert some Position Independent Code.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7.8.1 22-Aug-2000  kleink Pull up revs. 1.8-1.9 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.11.22.2 23-Mar-2008  matt sync with HEAD
 1.11.22.1 06-Nov-2007  matt sync with HEAD
 1.12.4.1 24-Mar-2008  keiichi sync with head.
 1.14.8.1 07-Nov-2008  snj Pull up following revision(s) (requested by nakayama in ticket #23):
lib/libc/arch/sparc/sys/brk.S: revision 1.15
Redo rev.1.13. We must refer to CURBRK via GOT in case of PIC.
 1.15.16.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.10.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.2 06-Nov-2008  nakayama Redo rev.1.13. We must refer to CURBRK via GOT in case of PIC.
 1.15.2.1 06-Nov-2008  nakayama file brk.S was added on branch christos-time_t on 2008-11-06 13:42:56 +0000
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.11 12-Sep-2013  joerg 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.10 08-Oct-2007  uwe branches: 1.10.30; 1.10.36;
In handwritten asm use -fPIC code instead of -fpic, our libc has grown
large enough for GOT to be larger than 8k.

While here kill redundant PIC ifdefs in setjmp.S - sparc "call"
instruction is piccy by itself.

Tested by martin@
 1.9 28-Dec-2006  martin branches: 1.9.4;
Use CCFSZ instead of 96 for standard save operations.
 1.8 07-Aug-2003  agc branches: 1.8.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 31-Mar-1999  kleink While in transition, conditionally rename _ASM_LABEL(cerror) and
_ASM_LABEL(curbrk) to _C_LABEL(__cerror) and _C_LABEL(__curbrk), respectively,
depending on the object format chosen, to avoid user namespace clashes.
 1.6 01-Jul-1998  tv Change immediate label references to _C_LABEL().
 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 16-Nov-1996  pk Remove DEFS.h, which has been just a placeholder for a long time.
 1.3 16-Nov-1996  pk Do the `_REENTRANT' song-and-dance.
 1.2 10-Feb-1994  pk Insert some Position Independent Code.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.8.16.1 04-Jan-2007  bouyer Pull up following revision(s) (requested by martin in ticket #312):
lib/libc/arch/sparc/gen/setjmp.S: revision 1.10
lib/libc/arch/sparc/sys/__clone.S: revision 1.4
lib/libc/arch/sparc/sys/cerror.S: revision 1.9
Use CCFSZ instead of 96 for standard save operations.
 1.9.4.1 06-Nov-2007  matt sync with HEAD
 1.10.36.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.30.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.3 07-Aug-2003  agc branches: 1.3.80; 1.3.84;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.3.84.1 21-Apr-2017  bouyer Sync with HEAD
 1.3.80.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 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 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.3 26-Jun-2000  kleink Need an internal name for fork().
 1.2 16-Jul-1997  christos branches: 1.2.12;
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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2.12.1 22-Aug-2000  kleink Pull up rev. 1.3 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 19-Jan-2003  kleink branches: 1.1.30;
Move getcontext.S from gen to sys, where it belongs.
 1.1.30.1 18-May-2008  yamt 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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 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 28-Sep-2000  kleink Need an internal name for pipe(2).
 1.2 16-Jul-1997  christos branches: 1.2.12;
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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2.12.1 29-Sep-2000  kleink Pull up rev. 1.3 (approved by thorpej):
Add internal name for pipe().
 1.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.9 12-Sep-2013  joerg 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.8 08-Oct-2007  uwe branches: 1.8.30; 1.8.36;
In handwritten asm use -fPIC code instead of -fpic, our libc has grown
large enough for GOT to be larger than 8k.

While here kill redundant PIC ifdefs in setjmp.S - sparc "call"
instruction is piccy by itself.

Tested by martin@
 1.7 08-Jan-2006  martin branches: 1.7.10;
Cosmetics (pointed out by uwe): use trivial restore, not the explicit
version.
 1.6 08-Jan-2006  martin Use __errno in the _REENTRANT case (pointed out by Valeriy E. Ushakov).
While there, indent some delay slot instructions.
 1.5 07-Aug-2003  agc branches: 1.5.6; 1.5.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 01-Jul-1998  tv Change immediate label references to _C_LABEL().
 1.3 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.2 10-Feb-1994  pk Insert some Position Independent Code.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5.10.2 11-Jan-2006  tron Pull up following revision(s) (requested by martin in ticket #1109):
lib/libc/arch/sparc/sys/ptrace.S: revision 1.7
Cosmetics (pointed out by uwe): use trivial restore, not the explicit
version.
 1.5.10.1 11-Jan-2006  tron Pull up following revision(s) (requested by martin in ticket #1109):
lib/libc/arch/sparc/sys/ptrace.S: revision 1.6
Use __errno in the _REENTRANT case (pointed out by Valeriy E. Ushakov).
While there, indent some delay slot instructions.
 1.5.6.2 11-Jan-2006  tron Pull up following revision(s) (requested by martin in ticket #1109):
lib/libc/arch/sparc/sys/ptrace.S: revision 1.7
Cosmetics (pointed out by uwe): use trivial restore, not the explicit
version.
 1.5.6.1 11-Jan-2006  tron Pull up following revision(s) (requested by martin in ticket #1109):
lib/libc/arch/sparc/sys/ptrace.S: revision 1.6
Use __errno in the _REENTRANT case (pointed out by Valeriy E. Ushakov).
While there, indent some delay slot instructions.
 1.7.10.1 06-Nov-2007  matt sync with HEAD
 1.8.36.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.30.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.2 04-Dec-1993  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 11-Nov-1996  mycroft Treat reboot() like a normal system call. From PR 2458.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.11 12-Sep-2013  joerg 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.10 08-Oct-2007  uwe branches: 1.10.30; 1.10.36;
In handwritten asm use -fPIC code instead of -fpic, our libc has grown
large enough for GOT to be larger than 8k.

While here kill redundant PIC ifdefs in setjmp.S - sparc "call"
instruction is piccy by itself.

Tested by martin@
 1.9 07-Aug-2003  agc branches: 1.9.22;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.7 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.6 03-Jun-1999  kleink branches: 1.6.8;
Shameless hack to reference end if using a.out and _end if using ELF.
 1.5 31-Mar-1999  kleink While in transition, conditionally rename _ASM_LABEL(cerror) and
_ASM_LABEL(curbrk) to _C_LABEL(__cerror) and _C_LABEL(__curbrk), respectively,
depending on the object format chosen, to avoid user namespace clashes.
 1.4 01-Jul-1998  tv Change immediate label references to _C_LABEL().
 1.3 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.2 10-Feb-1994  pk Insert some Position Independent Code.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6.8.1 22-Aug-2000  kleink Pull up revs. 1.7-1.8 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.9.22.1 06-Nov-2007  matt sync with HEAD
 1.10.36.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.30.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.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.5 01-Jul-1998  tv branches: 1.5.12;
Change immediate label references to _C_LABEL().
 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 10-Feb-1994  pk Insert some Position Independent Code.
 1.2 18-Dec-1993  jtc Fix bug #24 by renaming _logname_valid to __logname_valid.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5.12.1 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.1 07-Jul-2000  itohy Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.2 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.3 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.1 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.6 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 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 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.2 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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 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 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.2 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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.7 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 1.6 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 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 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.2 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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.6 15-Oct-2005  uwe Switch sparc to the new compat code layout.
 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 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 29-Sep-1998  christos Make the sparc work again; some work from jason, some from me.
 1.2 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.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.5 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.4 07-Aug-2003  agc branches: 1.4.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 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.2 18-Nov-1996  pk The code in here was just an expansion of RSYSCALL(syscall).
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.4.98.1 21-Apr-2020  martin Sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.21 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.20 15-Apr-2015  mrg remove various HAVE_GCC=45 fragments.
 1.19 21-Mar-2012  christos do not need lint overrides anymore
 1.18 20-Mar-2012  martin We do not care about portability when instantiating softfloats for our
concrete environment - add appropriate lintflags.
 1.17 10-Jul-2011  matt Fix so that float128_to_uint64_round_to_zero is defined for sparc64.
(isn't tha a namespace violation?)
 1.16 22-Jun-2011  mrg apply some -Wno-error/-Wno-enum-compare/-Wno-array-bounds.

this should be looked at more closely.
 1.15 22-Mar-2011  martin Remove the sparc-v7 compatibility wrapper functions (.div, .mul, ... .urem),
the compiler never generates (or did generate in the past) 64bit code to call
them, and they are still present in our 32bit compat library.
 1.14 06-Mar-2011  martin While we use hardware (for float and double), but cooperate with softfloat
(to do long double), we need to not only handle the hardware exception
mask and cummulated flags, but also update/query the softfloat variables.
Since this may go away sometime (to make us psABI compliant), ifdef it
properly.
 1.13 06-Dec-2009  uebayasi Set ${SRCS.softfloat}.
 1.12 26-Oct-2008  mrg branches: 1.12.4;
define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build.
 1.11 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.10 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.9 20-Apr-2005  jmc Don't use 'm4' here. Use $TOOL_M4 instead.
 1.8 27-Oct-2003  christos Add __sigtramp2
 1.7 27-Oct-2002  chs remove setjmp/longjmp from libkern, they're not used.
 1.6 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.5 22-May-2002  bjh21 Adapt for recent lib/libc/softfloat changes.
 1.4 04-Mar-2002  jmc branches: 1.4.2;
Move names for softfloat lib that _Qp functions call into _softfloat_
namespace
 1.3 05-Feb-2002  jmc Enable the _Qp* routines to be built always and allow full softfloat to be
pulled in if MKSOFTFLOAT gets enabled.
 1.2 19-Dec-2001  tv Remove -Wa,-Av9a hack from <sys.mk> and relegate it to the places that need
it (kernel and libc).

The current version of the gas assembler in the tree (2.11.2) already
defaults to generating object files for "-Av9 -64", supporting V9
instructions in ELF64 object format. "-Av9a" is only needed for specific
parts of the NetBSD base sources, and not for all third-party code.
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.6 11-Nov-2002  nathanw Catch up to -current
 1.1.12.5 01-Aug-2002  nathanw Catch up to -current.
 1.1.12.4 21-Jun-2002  nathanw Catch up to -current.
 1.1.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.2.1 24-May-2002  perry resolve 1.6 pullup ticket #16 by bjh21
necessary to get sparc64 builds working again.
pulls up revision 1.5
Original commit message:

> Adapt for recent lib/libc/softfloat changes.
 1.12.4.2 26-Oct-2008  mrg define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build.
 1.12.4.1 26-Oct-2008  mrg file Makefile.inc was added on branch christos-time_t on 2008-10-26 07:43:08 +0000
 1.15 12-Sep-2013  joerg 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 28-Mar-2011  martin branches: 1.14.4; 1.14.10;
ABI police: avoid cluttering global registers %g2 and %g7. Not quite there
yet for %g2, but the target is not very well defined. %g7 should be clean
now.
 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 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.11 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.10 07-May-2002  eeh Go back from using %g2 (an application register) to %g7 (a system register)
for syscall returns.
 1.9 07-May-2002  eeh Add support for large -fPIC relocations.
 1.8 05-May-2002  thorpej Add a .register directive to appease newer gas.
 1.7 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.6 23-Jul-2001  thorpej From rev. 1.11 of the 32-bit version:

Add a macro "CALL()" to call a function correctly in the pic and non pic
case. Write ERROR() in terms of call.
 1.5 15-Jun-2001  chs adjust the PIC case for ERROR() to handle __cerror being at a larger offset
than will fit in the immediate field of the LDX instruction.
 1.4 18-Jul-2000  eeh branches: 1.4.2;
Fix PIC bugs.
 1.3 26-Jun-2000  kleink Add a _SYSCALL(entry,syscall) macro like the one found on other
architectures.
 1.2 14-Jan-1999  kleink branches: 1.2.10;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.2.10.2 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.2.10.1 25-Jul-2000  kleink Pull up rev. 1.3 (approved by thorpej):
Add a _SYSCALL(entry,syscall) macro.
 1.4.2.3 21-Jun-2002  nathanw Catch up to -current.
 1.4.2.2 28-Jan-2002  nathanw Catch up to -current.
 1.4.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.14.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.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.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.20 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.19 06-Dec-2009  uebayasi branches: 1.19.46;
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.18 03-Jul-2006  drochner build frexp_ieee754 and ldexp_ieee754 in the "compat" subtree
(There is an assembler version of modf which needs to be checked.)
 1.17 16-Oct-2005  christos rename the files in gen like we did for i386.
 1.16 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.15 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.14 04-Mar-2004  kleink branches: 1.14.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.13 17-Jan-2004  martin Avoid using the depreceated __sigreturn14 for longjmp by adapting
Christian Limpachs arch/m68k implementation using setcontext().
 1.12 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.11 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.10 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.9 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.8 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.7 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.6 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.5 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.4 23-Dec-1999  kleink branches: 1.4.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.3 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.2 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.4.6.4 22-Mar-2002  nathanw Catch up to -current.
 1.4.6.3 08-Mar-2002  nathanw Catch up to -current.
 1.4.6.2 24-Jan-2002  petrov _lwp.c added
 1.4.6.1 17-Nov-2001  martin Userland *context support for sparc64, from Klaus Klein.
 1.14.6.1 19-Apr-2005  tron Pull up revision 1.15 (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.19.46.1 10-Jun-2019  christos Sync with HEAD
 1.6 16-Oct-2005  christos rename the files in gen like we did for i386.
 1.5 13-Sep-2005  martin Add missing <compat/..> include
 1.4 22-Mar-2004  martin Simplify slightly and fix a comment.
 1.3 19-Jan-2004  martin Forgot to mention in last commit message: remove some accidently commited
debug code.
 1.2 19-Jan-2004  martin Unfortunately we can not restore the signal mask with setcontext() - this
breaks libpthread, which tries to intercept the weak sigprocmask symbol.
So use an explicit sigprocmask call instead.
 1.1 17-Jan-2004  martin Avoid using the depreceated __sigreturn14 for longjmp by adapting
Christian Limpachs arch/m68k implementation using setcontext().
 1.9 16-Oct-2005  christos rename the files in gen like we did for i386.
 1.8 23-Mar-2004  pk Call PIC_PROLOGUE only once.
 1.7 23-Mar-2004  pk Store the correct boolean value in sc_onstack.
 1.6 19-Jan-2004  martin Too sad - inlining syscall stubs on sparc64 is so much easier than doing
PIC calls to the libc stubs, but unfortunately we need to do the latter-
otherwise we break weak symbol semantics and make libpthread fail.
Thanks to Christian Limpach for the analyzis.
 1.5 17-Jan-2004  martin Avoid using the depreceated __sigreturn14 for longjmp by adapting
Christian Limpachs arch/m68k implementation using setcontext().
 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 28-Aug-2000  eeh Fix layout of fields in jmp_buf. [N.B. we could make JMP_BUFLEN 9 if we want.]
 1.2 03-Jan-1999  eeh branches: 1.2.10;
More fixes to signal handling code...
 1.1 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.2.10.1 04-Sep-2000  eeh Pull up revision 1.3 (approved by thorpej):

date: 2000/08/28 00:45:59; author: eeh; state: Exp; lines: +3 -4
Fix layout of fields in jmp_buf. [N.B. we could make JMP_BUFLEN 9 if we want.]
 1.8 16-Oct-2005  christos rename the files in gen like we did for i386.
 1.7 19-Jan-2004  martin Store the "signal mask saved" flag at the end of the jmp_buf - we now use
more of it than before (and I bet the old place just is a non translated
32bit sparc value).
 1.6 02-Jan-2004  martin Fix two inverted comparisions and a few comments.
This makes sparc64 pass the sigsetjmp regression tests.
 1.5 07-May-2002  eeh Use large (-fPIC) relocations.
 1.4 28-Aug-2000  eeh branches: 1.4.2;
Fix layout of fields in jmp_buf. [N.B. we could make JMP_BUFLEN 9 if we want.]
 1.3 21-Jul-2000  eeh Update some more assembly code for PIC issues.
 1.2 18-Jul-2000  eeh Fix PIC bugs.
 1.1 08-Oct-1998  eeh branches: 1.1.10;
Fix libc signal breakage (I hope).
 1.1.10.2 04-Sep-2000  eeh Pull up revision 1.4 (approved by thorpej):

Fix layout of fields in jmp_buf. [N.B. we could make JMP_BUFLEN 9 if we want.]
 1.1.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.4.2.1 21-Jun-2002  nathanw Catch up to -current.
 1.7 17-Mar-2012  martin Avoid lint warnings
 1.6 24-Feb-2011  joerg branches: 1.6.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.5 28-Apr-2008  martin branches: 1.5.8; 1.5.20;
Remove clause 3 and 4 from TNF licenses
 1.4 12-Jun-2005  lukem branches: 1.4.18;
Add missing __RCSID()
 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 24-Jan-2002  petrov branches: 1.1.2;
file _lwp.c was initially added on branch nathanw_sa.
 1.1.2.4 16-Jan-2003  thorpej Add missing notice.
 1.1.2.3 10-Sep-2002  petrov more compiler warnings.
 1.1.2.2 10-Sep-2002  petrov Compiler warnings.
 1.1.2.1 24-Jan-2002  petrov _lwp_makecontext passes simple test
 1.4.18.1 18-May-2008  yamt sync with head.
 1.5.20.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file _lwp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.6.4.1 17-Apr-2012  yamt sync with head
 1.7 30-Apr-2011  martin Save/restore some global registers (sigsetjmp compatible). Does not realy
make a difference currently, but is a hard to spot blackhole if something
ever starts using the application registers.
 1.6 07-Dec-2004  martin Replace the stack unwinding by a much simpler solution taken from
../../arch/sparc/gen/_setjmp.S rev. 1.6. This ended up to be ~identical
to the OpenBSD change triggered by the same sparc change.
Thanks to Stoned Elipot for pointing out the problem.
 1.5 07-Aug-2003  agc branches: 1.5.2; 1.5.4;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.3 13-Sep-1998  eeh Libc fixes, mostly to work around the new signal stuff.
 1.2 12-Sep-1998  eeh Bring in definition for stack BIAS.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.5.4.1 07-Jan-2005  jdc Pull up revision 1.6 (requested by martin in ticket #1020).

Replace the stack unwinding by a much simpler solution taken from
../../arch/sparc/gen/_setjmp.S rev. 1.6. This ended up to be ~identical
to the OpenBSD change triggered by the same sparc change.
Thanks to Stoned Elipot for pointing out the problem.
 1.5.2.1 07-Jan-2005  jdc Pull up revision 1.6 (requested by martin in ticket #1020).

Replace the stack unwinding by a much simpler solution taken from
../../arch/sparc/gen/_setjmp.S rev. 1.6. This ended up to be ~identical
to the OpenBSD change triggered by the same sparc change.
Thanks to Stoned Elipot for pointing out the problem.
 1.5 22-Mar-2011  martin Remove the sparc-v7 compatibility wrapper functions (.div, .mul, ... .urem),
the compiler never generates (or did generate in the past) 64bit code to call
them, and they are still present in our 32bit compat library.
 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 29-Oct-2002  chs move includes to the top so that this builds in libc context too.
 1.2 27-Oct-2002  chs use %g5 instead of %g7 (since we want to use %g7 for the cpu_info pointer
in the kernel). resync libc and libkern versions of this file.
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 11-Nov-2002  nathanw Catch up to -current
 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 06-Apr-2003  petrov Floating point argument should be in %f0 (sparcv9 ABI says).
 1.3 01-Feb-2003  martin Check how the compiler expects the return value of this function
by testing SOFTFLOATSPARC64_FOR_GCC.

Should fix PR port-sparc64/20140.
 1.2 23-Jul-2000  eeh branches: 1.2.4;
Fix stack BIAS issues.
 1.1 11-Sep-1998  eeh branches: 1.1.10;
Add sparc64-specific libc.
 1.1.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.2.4.1 03-Feb-2003  jmc Pullup revisions 1.2->1.3 (requested by martin in ticket #1137)
Check how the compiler expects the return value of this function
by testing SOFTFLOATSPARC64_FOR_GCC. Fixes PR#20140
 1.5 12-Sep-2013  joerg 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.4 07-Aug-2003  agc branches: 1.4.56; 1.4.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 25-Jul-2000  mycroft Make __dtoul() actually DTRT. The calling convention was totally wrong, and
the `big' value should be 2^63, not 2^31.
Also, nuke __fixunsdfsi(), since this is never output by the sparc64 compiler.
 1.2 04-Apr-1999  eeh branches: 1.2.8;
Add _dtoul() which gcc generates a lot. Maybe it should go in another file.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.2.8.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.4.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.56.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.6 24-Jun-2012  christos fix old style definitions; XXX: gcc should have picked them up but it did not.
 1.5 17-Mar-2012  martin delint
 1.4 24-Dec-2005  perry branches: 1.4.44;
__asm__ -> __asm
 1.3 12-Jun-2005  lukem Add missing __RCSID()
 1.2 01-Nov-2003  nakayama Corrent map order to match sparc/ieeefp.h.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.4.44.2 30-Oct-2012  yamt sync with head
 1.4.44.1 17-Apr-2012  yamt sync with head
 1.3 20-Nov-2013  martin PR 48384: reorganize struct ieee_ext for sparc64 to only use a high/low
part for the mantissa.
Adjust arch specific code accordingly.
 1.2 28-Apr-2008  martin branches: 1.2.4; 1.2.8; 1.2.28;
Remove clause 3 and 4 from TNF licenses
 1.1 28-Oct-2003  kleink branches: 1.1.30;
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.30.1 18-May-2008  yamt sync with head.
 1.2.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 fpclassifyl.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2.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.6 24-Jun-2012  christos fix old style definitions; XXX: gcc should have picked them up but it did not.
 1.5 17-Mar-2012  martin delint
 1.4 24-Dec-2005  perry branches: 1.4.44;
__asm__ -> __asm
 1.3 12-Jun-2005  lukem Add missing __RCSID()
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.44.2 30-Oct-2012  yamt sync with head
 1.4.44.1 17-Apr-2012  yamt sync with head
 1.6 24-Jun-2012  christos fix old style definitions; XXX: gcc should have picked them up but it did not.
 1.5 17-Mar-2012  martin delint
 1.4 24-Dec-2005  perry branches: 1.4.44;
__asm__ -> __asm
 1.3 12-Jun-2005  lukem Add missing __RCSID()
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.44.2 30-Oct-2012  yamt sync with head
 1.4.44.1 17-Apr-2012  yamt sync with head
 1.7 24-Jun-2012  christos fix old style definitions; XXX: gcc should have picked them up but it did not.
 1.6 17-Mar-2012  martin delint
 1.5 06-Mar-2011  martin branches: 1.5.4;
While we use hardware (for float and double), but cooperate with softfloat
(to do long double), we need to not only handle the hardware exception
mask and cummulated flags, but also update/query the softfloat variables.
Since this may go away sometime (to make us psABI compliant), ifdef it
properly.
 1.4 24-Dec-2005  perry __asm__ -> __asm
 1.3 12-Jun-2005  lukem Add missing __RCSID()
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.4.2 30-Oct-2012  yamt sync with head
 1.5.4.1 17-Apr-2012  yamt sync with head
 1.7 28-Oct-2013  mrg convert to ANSI C definitions.
 1.6 17-Mar-2012  martin branches: 1.6.2;
delint
 1.5 06-Mar-2011  martin branches: 1.5.4;
While we use hardware (for float and double), but cooperate with softfloat
(to do long double), we need to not only handle the hardware exception
mask and cummulated flags, but also update/query the softfloat variables.
Since this may go away sometime (to make us psABI compliant), ifdef it
properly.
 1.4 24-Dec-2005  perry __asm__ -> __asm
 1.3 12-Jun-2005  lukem Add missing __RCSID()
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.4.2 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.5.4.1 17-Apr-2012  yamt sync with head
 1.6.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9 20-Mar-2024  rillig sparc64/fpsetround: avoid shifting into the sign bit

Lint had warned about the constant expression '0x03 << 30' but not about
the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'.

No binary change.
 1.8 11-Mar-2024  christos fix lint
 1.7 28-Oct-2013  mrg convert to ANSI C definitions.
 1.6 15-Feb-2013  martin While we are using softfloat for 128 bit long double values, make fpsetround
update the softfloat rounding mode as well.
 1.5 17-Mar-2012  martin branches: 1.5.2;
delint
 1.4 24-Dec-2005  perry branches: 1.4.44; 1.4.46;
__asm__ -> __asm
 1.3 12-Jun-2005  lukem Add missing __RCSID()
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.4.46.1 18-Feb-2013  riz Pull up following revision(s) (requested by martin in ticket #826):
lib/libc/arch/sparc64/gen/fpsetround.c: revision 1.6
While we are using softfloat for 128 bit long double values, make fpsetround
update the softfloat rounding mode as well.
 1.4.44.2 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.4.44.1 17-Apr-2012  yamt sync with head
 1.5.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 25-Feb-2013  tls resync with head
 1.7 28-Oct-2013  mrg convert to ANSI C definitions.
 1.6 17-Mar-2012  martin branches: 1.6.2;
delint
 1.5 06-Mar-2011  martin branches: 1.5.4;
While we use hardware (for float and double), but cooperate with softfloat
(to do long double), we need to not only handle the hardware exception
mask and cummulated flags, but also update/query the softfloat variables.
Since this may go away sometime (to make us psABI compliant), ifdef it
properly.
 1.4 24-Dec-2005  perry __asm__ -> __asm
 1.3 12-Jun-2005  lukem Add missing __RCSID()
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 28-Jan-2002  nathanw Catch up to -current.
 1.5.4.2 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.5.4.1 17-Apr-2012  yamt sync with head
 1.6.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5 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.4 29-Aug-1999  mycroft branches: 1.4.10;
Trivial KNF.
 1.3 29-Aug-1999  mycroft Make the C version of frexp() consitent across platforms, and handle the
Inf/NaN case.
 1.2 10-Mar-1999  mycroft Just some minor cleanup.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.4.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 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.3 13-Sep-2000  msaitoh branches: 1.3.2;
check LIBC_SCCS
 1.2 14-Nov-1998  christos delint
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3.2.1 08-Mar-2002  nathanw Catch up to -current.
 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.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 29-Oct-2003  kleink branches: 1.1.30;
C99 7.12.3.2: add library portions of isfinite, but don't build these just
yet.
 1.1.30.1 18-May-2008  yamt 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 isfinitel.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 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 22-Jan-2000  mycroft branches: 1.5.6;
Delint.
 1.4 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.3 14-Nov-1998  christos delint
 1.2 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.5.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.5 20-Nov-2013  martin PR 48384: reorganize struct ieee_ext for sparc64 to only use a high/low
part for the mantissa.
Adjust arch specific code accordingly.
 1.4 04-Mar-2004  kleink branches: 1.4.56; 1.4.62;
* 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.3 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.2 27-Oct-2003  kleink Retire local union { floating-type; struct ieee_prec; } in favor of those
available from <machine/ieee.h>
 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.4.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.56.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.5 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.4 22-Jan-2000  mycroft branches: 1.4.6;
Delint.
 1.3 29-Aug-1999  mycroft Separate isnan() into a separate module, and make isinf()/isnan() use ieee.h.
 1.2 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.4.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.5 20-Nov-2013  martin PR 48384: reorganize struct ieee_ext for sparc64 to only use a high/low
part for the mantissa.
Adjust arch specific code accordingly.
 1.4 04-Mar-2004  kleink branches: 1.4.56; 1.4.62;
* 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.3 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.2 27-Oct-2003  kleink Retire local union { floating-type; struct ieee_prec; } in favor of those
available from <machine/ieee.h>
 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.4.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.56.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.10 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.9 07-Nov-2001  chs fix for -Wshadow
 1.8 30-Aug-1999  mycroft branches: 1.8.10;
Another microoptimization. Take advantage of the addition already having set
the flags for the <=0 comparison.
 1.7 30-Aug-1999  mycroft Reuse the trick of loading 0.0 (rather than 1.0) and then modifying the
exponent. It's a bit faster on some machines.
 1.6 30-Aug-1999  augustss Remove more unused mulexp variables.
 1.5 29-Aug-1999  mycroft ldexp(denormal, exp>1023) would generate the wrong result in all non-overflow
cases. Totally rework this code to fix this bug *and* make it faster.
 1.4 29-Aug-1999  mycroft Don't ever return -0.0.
 1.3 29-Aug-1999  mycroft Minor style change.
 1.2 10-Mar-1999  mycroft Just some minor cleanup.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.8.10.2 08-Mar-2002  nathanw Catch up to -current.
 1.8.10.1 14-Nov-2001  nathanw Catch up to -current.
 1.8 24-Apr-2025  riastradh sparc, sparc64 longjmp: Use _UC_SIGMASK to restore signal mask.

This way, restoring the signal mask and restoring the stack pointer
happen atomically with respect to signal handler calls, whereas using
sigprocmask would restore the signal mask _before_ the stack pointer,
breaking sigaltstack.

The motivation for using sigprocmask first and then setcontext later,
rather than _UC_SIGMASK in setcontext, was to get SA-based libpthead
sigprocmask interposition. But that's long gone and unlikely to come
back.

PR lib/57946: longjmp fails to restore stack first before restoring
signal mask on most architectures
 1.7 17-Mar-2012  martin branches: 1.7.44;
delint
 1.6 30-Apr-2011  martin branches: 1.6.4;
Fix previous: the way we calculate, we need to test the size of sigjmp_buf
 1.5 30-Apr-2011  martin Add another compile time assert: catch overflows of jmp_buf
 1.4 30-Apr-2011  martin Rearange jmp_buf content again: storing the sigsetjmp() save_mask midway
inside the environment is not a good idea, we may overwrite it when
fetching other details of the sigjmp environment.
Instead move it to the very end again.
Do not bother to save volatile (caller saved) global registers.
Fixes PR port-sparc64/44918.
 1.3 27-Apr-2011  martin Fix offsets used in the assembly code to save global registers into a
jmp_buf, add a compile time assert to catch this kind of divergence
in the C code.
Move the fixed "%npc = %pc + 4" computation to longjmp, this frees
the sigcontext sc_npc value. Use this space to save the savemask
for siglongjmp (we have run out of space behind the globals).
Fixes the tests/lib/libc/setjmp/t_threadjmp tests, and also hopefully
fixes PR port-sparc64/44902.
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 16-Oct-2005  christos branches: 1.1.18;
rename the files in gen like we did for i386.
 1.1.18.1 18-May-2008  yamt 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 longjmp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.6.4.1 17-Apr-2012  yamt sync with head
 1.7.44.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Mar-2012  martin delint
 1.4 28-Apr-2008  martin branches: 1.4.4; 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 17-Nov-2001  martin branches: 1.1.2;
file makecontext.c was initially added on branch nathanw_sa.
 1.1.2.4 10-Sep-2002  petrov more compiler warnings.
 1.1.2.3 08-Feb-2002  petrov respect BIAS and correct on-stack frame
 1.1.2.2 24-Jan-2002  petrov BIAS for sp
 1.1.2.1 17-Nov-2001  martin Userland *context support for sparc64, from 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:58 +0000
 1.4.4.1 17-Apr-2012  yamt sync with head
 1.5 12-Sep-2013  joerg 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.4 07-Aug-2003  agc branches: 1.4.56; 1.4.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 01-Nov-2000  eeh Fix modf() (I hope. Can't be any worse than the old version.)
 1.2 23-Jul-2000  eeh Fix stack BIAS issues.
 1.1 11-Sep-1998  eeh branches: 1.1.10;
Add sparc64-specific libc.
 1.1.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.4.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.56.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.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 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.1 11-Sep-1998  eeh Add sparc64-specific libc.
 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:51 +0000
 1.5 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Dec-2006  martin branches: 1.3.10;
Pull over rev. 1.5 of the i386 version (../../i386/resumecontext.S),
quoting Matthias Drochner:

> -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.

This also fixes regress/lib/libc/context for sparc64.
 1.2 18-Jan-2003  thorpej branches: 1.2.16;
Merge the nathanw_sa branch.
 1.1 17-Nov-2001  martin branches: 1.1.2;
file resumecontext.c was initially added on branch nathanw_sa.
 1.1.2.1 17-Nov-2001  martin Userland *context support for sparc64, from Klaus Klein.
 1.2.16.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #263):
lib/libc/arch/sparc64/gen/resumecontext.c: revision 1.3
Pull over rev. 1.5 of the i386 version (../../i386/resumecontext.S),
quoting Matthias Drochner:
-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.
This also fixes regress/lib/libc/context for sparc64.
 1.3.10.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 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 21-Jul-2000  eeh Update some more assembly code for PIC issues.
 1.1 11-Sep-1998  eeh branches: 1.1.10;
Add sparc64-specific libc.
 1.1.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.12 11-Oct-2023  skrll Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
 1.11 11-Oct-2023  skrll Trailing whitespace
 1.10 12-Sep-2013  joerg 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.9 30-Apr-2011  martin branches: 1.9.4; 1.9.10;
Rearange jmp_buf content again: storing the sigsetjmp() save_mask midway
inside the environment is not a good idea, we may overwrite it when
fetching other details of the sigjmp environment.
Instead move it to the very end again.
Do not bother to save volatile (caller saved) global registers.
Fixes PR port-sparc64/44918.
 1.8 27-Apr-2011  martin Fix offsets used in the assembly code to save global registers into a
jmp_buf, add a compile time assert to catch this kind of divergence
in the C code.
Move the fixed "%npc = %pc + 4" computation to longjmp, this frees
the sigcontext sc_npc value. Use this space to save the savemask
for siglongjmp (we have run out of space behind the globals).
Fixes the tests/lib/libc/setjmp/t_threadjmp tests, and also hopefully
fixes PR port-sparc64/44902.
 1.7 16-Oct-2005  christos rename the files in gen like we did for i386.
 1.6 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 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 28-Aug-2000  eeh Fix layout of fields in jmp_buf. [N.B. we could make JMP_BUFLEN 9 if we want.]
 1.3 08-Oct-1998  eeh branches: 1.3.10;
Fix libc signal breakage (I hope).
 1.2 13-Sep-1998  eeh Libc fixes, mostly to work around the new signal stuff.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3.10.1 04-Sep-2000  eeh Pull up revision 1.4 (approved by thorpej):

date: 2000/08/28 00:45:59; author: eeh; state: Exp; lines: +5 -5
Fix layout of fields in jmp_buf. [N.B. we could make JMP_BUFLEN 9 if we want.]
 1.9.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.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.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:58 +0000
 1.12 14-Sep-2013  nakayama Redo previous to fix build break.
 1.11 12-Sep-2013  joerg 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.10 30-Apr-2011  martin branches: 1.10.4; 1.10.10;
Rearange jmp_buf content again: storing the sigsetjmp() save_mask midway
inside the environment is not a good idea, we may overwrite it when
fetching other details of the sigjmp environment.
Instead move it to the very end again.
Do not bother to save volatile (caller saved) global registers.
Fixes PR port-sparc64/44918.
 1.9 27-Apr-2011  martin Fix offsets used in the assembly code to save global registers into a
jmp_buf, add a compile time assert to catch this kind of divergence
in the C code.
Move the fixed "%npc = %pc + 4" computation to longjmp, this frees
the sigcontext sc_npc value. Use this space to save the savemask
for siglongjmp (we have run out of space behind the globals).
Fixes the tests/lib/libc/setjmp/t_threadjmp tests, and also hopefully
fixes PR port-sparc64/44902.
 1.8 16-Oct-2005  christos rename the files in gen like we did for i386.
 1.7 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.6 07-May-2002  eeh Use large (-fPIC) relocations.
 1.5 28-Aug-2000  eeh branches: 1.5.2;
Fix layout of fields in jmp_buf. [N.B. we could make JMP_BUFLEN 9 if we want.]
 1.4 21-Jul-2000  eeh Update some more assembly code for PIC issues.
 1.3 18-Jul-2000  eeh Fix PIC bugs.
 1.2 08-Oct-1998  eeh branches: 1.2.10;
Fix libc signal breakage (I hope).
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.2.10.2 04-Sep-2000  eeh Pull up revision 1.5 (approved by thorpej):

date: 2000/08/28 00:45:59; author: eeh; state: Exp; lines: +7 -7
Fix layout of fields in jmp_buf. [N.B. we could make JMP_BUFLEN 9 if we want.]
 1.2.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.5.2.1 21-Jun-2002  nathanw Catch up to -current.
 1.10.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.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.8 12-Sep-2013  joerg 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.7 13-Sep-2012  martin Fix register usage
 1.6 12-Sep-2012  manu branches: 1.6.2;
setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@
 1.5 28-Mar-2011  martin branches: 1.5.4;
ABI police: avoid cluttering global registers %g2 and %g7. Not quite there
yet for %g2, but the target is not very well defined. %g7 should be clean
now.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 23-May-2003  petrov branches: 1.3.30;
Declare global register.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 17-Nov-2001  martin branches: 1.1.2;
file swapcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 17-Nov-2001  martin Userland *context support for sparc64, from Klaus Klein.
 1.3.30.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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.5.4.2 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.5.4.1 30-Oct-2012  yamt sync with head
 1.6.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 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.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 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.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 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.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 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.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 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.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.1 05-Feb-2002  jmc branches: 1.1.2;
Add softfloat and quad softfloat setup for sparc64 (thanks to Andrey Petrov
for most of this. I just integrated the build).

This adds proper functions for the _Qp* parts of the sparc64 ABI (which
handle quad softfloat). The routines work but need additional testing.
However if the compiler calls these currently bad things (core dumps)
will happen as gcc 2.95.3 generates bad calls for these.

Until that problem is fixed in the toolchain -msoft-quad-float cannot be
enabled as the default option for all builds (but the routines need to be
in libc as libgcc contains some references to these and anything including
it via --whole-archive will need the symbols to at least resolve).
 1.1.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 05-Feb-2002  nathanw file milieu.h was added on branch nathanw_sa on 2002-03-22 20:41:55 +0000
 1.11 02-Feb-2014  martin Fix unsigned 64 bit int to long double conversion for numbers that would not
fit into a signed 64 bit int. Found by latest t_floatunditf test case
failuer, hint from Matt Thomas.
 1.10 15-Feb-2013  martin Make all conversions from 128bit (long double) floats to integral types
use rounding towards zero (casts to int/long are not affected by current
rounding mode).
Fixes PR port-sparc64/47535.
 1.9 17-Mar-2012  martin branches: 1.9.2;
Avoid lint warnings
 1.8 14-Mar-2012  martin Rename __zero to __sf128_zero to avoid clashes with the strange new
inline function in cdefs.h
 1.7 28-Apr-2008  martin branches: 1.7.4; 1.7.8; 1.7.24;
Remove clause 3 and 4 from TNF licenses
 1.6 08-Nov-2007  martin branches: 1.6.6;
When converting long double values to integer types, explicitly use the
"round to zero" variants of the softfloat conversion functions.
Add a variant to convert long double to unsigned long - the "to long"
variant checked for overflows that do not apply to unsigned results.
This fixes the regress/lib/libc/convfp tests for sparc64.
 1.5 01-May-2003  martin branches: 1.5.22;
Make _Qp_qtoui return the right value for inputs that do not fit into
an int value, but are valid unsigned ints. This should fix PR 21414.
The same problem exists for _Qp_qtoux, but there is no similar trivial
solution to that (I could think of).
Pointed out by David Laight.
 1.4 06-Feb-2003  petrov Correct unsigned to float conversions, add license, adjust style.
 1.3 27-Mar-2002  jmc branches: 1.3.2;
Fix typo in previous commit
 1.2 27-Mar-2002  jmc Correct mistaken signature for _Qp_dtoq. It gets a double passed in, not
a pointer to double which causes obvious errors on evaluation
 1.1 05-Feb-2002  jmc branches: 1.1.2;
Add softfloat and quad softfloat setup for sparc64 (thanks to Andrey Petrov
for most of this. I just integrated the build).

This adds proper functions for the _Qp* parts of the sparc64 ABI (which
handle quad softfloat). The routines work but need additional testing.
However if the compiler calls these currently bad things (core dumps)
will happen as gcc 2.95.3 generates bad calls for these.

Until that problem is fixed in the toolchain -msoft-quad-float cannot be
enabled as the default option for all builds (but the routines need to be
in libc as libgcc contains some references to these and anything including
it via --whole-archive will need the symbols to at least resolve).
 1.1.2.3 25-Apr-2002  nathanw Catch up to -current.
 1.1.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 05-Feb-2002  nathanw file qp.c was added on branch nathanw_sa on 2002-03-22 20:41:55 +0000
 1.3.2.2 19-Oct-2003  tron Pull up revision 1.5 (requested by nakayama in ticket #1517):
Make _Qp_qtoui return the right value for inputs that do not fit into
an int value, but are valid unsigned ints. This should fix PR 21414.
The same problem exists for _Qp_qtoux, but there is no similar trivial
solution to that (I could think of).
Pointed out by David Laight.
 1.3.2.1 19-Oct-2003  tron Pull up revision 1.4 (requested by nakayama in ticket #1517):
Correct unsigned to float conversions, add license, adjust style.
 1.5.22.1 09-Jan-2008  matt sync with HEAD
 1.6.6.1 18-May-2008  yamt sync with head.
 1.7.24.1 18-Feb-2013  riz Pull up following revision(s) (requested by martin in ticket #825):
lib/libc/arch/sparc64/softfloat/qp.c: revision 1.10
Make all conversions from 128bit (long double) floats to integral types
use rounding towards zero (casts to int/long are not affected by current
rounding mode).
Fixes PR port-sparc64/47535.
 1.7.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7.8.1 28-Apr-2008  martin file qp.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.7.4.2 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.4.1 17-Apr-2012  yamt sync with head
 1.9.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.2.1 25-Feb-2013  tls resync with head
 1.2 08-Nov-2007  martin When converting long double values to integer types, explicitly use the
"round to zero" variants of the softfloat conversion functions.
Add a variant to convert long double to unsigned long - the "to long"
variant checked for overflows that do not apply to unsigned results.
This fixes the regress/lib/libc/convfp tests for sparc64.
 1.1 04-Mar-2002  jmc branches: 1.1.2; 1.1.26;
Move names for softfloat lib that _Qp functions call into _softfloat_
namespace
 1.1.26.1 09-Jan-2008  matt sync with HEAD
 1.1.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 04-Mar-2002  nathanw file softfloat-qp.h was added on branch nathanw_sa on 2002-03-22 20:41:55 +0000
 1.3 21-Apr-2002  bjh21 All the versions of softfloat-specialize were practically identical, so replace
them with a single one.
 1.2 04-Mar-2002  jmc branches: 1.2.2;
Move names for softfloat lib that _Qp functions call into _softfloat_
namespace
 1.1 05-Feb-2002  jmc Add softfloat and quad softfloat setup for sparc64 (thanks to Andrey Petrov
for most of this. I just integrated the build).

This adds proper functions for the _Qp* parts of the sparc64 ABI (which
handle quad softfloat). The routines work but need additional testing.
However if the compiler calls these currently bad things (core dumps)
will happen as gcc 2.95.3 generates bad calls for these.

Until that problem is fixed in the toolchain -msoft-quad-float cannot be
enabled as the default option for all builds (but the routines need to be
in libc as libgcc contains some references to these and anything including
it via --whole-archive will need the symbols to at least resolve).
 1.2.2.3 25-Apr-2002  nathanw Catch up to -current.
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 04-Mar-2002  nathanw file softfloat-specialize was added on branch nathanw_sa on 2002-03-22 20:41:55 +0000
 1.1 05-Feb-2002  jmc branches: 1.1.2;
Add softfloat and quad softfloat setup for sparc64 (thanks to Andrey Petrov
for most of this. I just integrated the build).

This adds proper functions for the _Qp* parts of the sparc64 ABI (which
handle quad softfloat). The routines work but need additional testing.
However if the compiler calls these currently bad things (core dumps)
will happen as gcc 2.95.3 generates bad calls for these.

Until that problem is fixed in the toolchain -msoft-quad-float cannot be
enabled as the default option for all builds (but the routines need to be
in libc as libgcc contains some references to these and anything including
it via --whole-archive will need the symbols to at least resolve).
 1.1.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 05-Feb-2002  nathanw file softfloat-wrapper.c was added on branch nathanw_sa on 2002-03-22 20:41:55 +0000
 1.8 07-Jul-2011  matt Don't define a new enum. Just #define round_* to their FP_Rx instead.
 1.7 04-Jul-2011  matt Add __floatunsidf __floatunsisf __floatunsitf routines.
XXX i think they are correct but not sure.
 1.6 08-Nov-2007  martin When converting long double values to integer types, explicitly use the
"round to zero" variants of the softfloat conversion functions.
Add a variant to convert long double to unsigned long - the "to long"
variant checked for overflows that do not apply to unsigned results.
This fixes the regress/lib/libc/convfp tests for sparc64.
 1.5 11-May-2006  mrg branches: 1.5.10;
if SOFTFLOAT_FOR_GCC is not defined, don't declare float_detect_tininess.
 1.4 12-May-2002  bjh21 Add SIGFPE support to SoftFloat, so fpsetmask/fpgetmask now work. A new
variable, float_exception_mask (#defined to _softfloat_float_exception_mask)
contains the current exception mask.
Also make the argument to float_raise into an fp_except.
Also synchronise file header comments between files.
 1.3 06-May-2002  bjh21 Consistently declare the types of float_rounding_mode and float_exception_flags
as fp_rnd and fp_except respectively.
 1.2 04-Mar-2002  jmc branches: 1.2.2;
Move names for softfloat lib that _Qp functions call into _softfloat_
namespace
 1.1 05-Feb-2002  jmc Add softfloat and quad softfloat setup for sparc64 (thanks to Andrey Petrov
for most of this. I just integrated the build).

This adds proper functions for the _Qp* parts of the sparc64 ABI (which
handle quad softfloat). The routines work but need additional testing.
However if the compiler calls these currently bad things (core dumps)
will happen as gcc 2.95.3 generates bad calls for these.

Until that problem is fixed in the toolchain -msoft-quad-float cannot be
enabled as the default option for all builds (but the routines need to be
in libc as libgcc contains some references to these and anything including
it via --whole-archive will need the symbols to at least resolve).
 1.2.2.3 21-Jun-2002  nathanw Catch up to -current.
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 04-Mar-2002  nathanw file softfloat.h was added on branch nathanw_sa on 2002-03-22 20:41:56 +0000
 1.5.10.1 09-Jan-2008  matt sync with HEAD
 1.2 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 05-Feb-2002  jmc branches: 1.1.2;
Add softfloat and quad softfloat setup for sparc64 (thanks to Andrey Petrov
for most of this. I just integrated the build).

This adds proper functions for the _Qp* parts of the sparc64 ABI (which
handle quad softfloat). The routines work but need additional testing.
However if the compiler calls these currently bad things (core dumps)
will happen as gcc 2.95.3 generates bad calls for these.

Until that problem is fixed in the toolchain -msoft-quad-float cannot be
enabled as the default option for all builds (but the routines need to be
in libc as libgcc contains some references to these and anything including
it via --whole-archive will need the symbols to at least resolve).
 1.1.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 05-Feb-2002  nathanw file sparc64-gcc.h was added on branch nathanw_sa on 2002-03-22 20:41:56 +0000
 1.5 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.4 04-Aug-2008  matt branches: 1.4.6;
Add C99 functions imaxabs and imaxdiv.
 1.3 22-Mar-2006  drochner branches: 1.3.20;
build erand48_ieee754.c on everything but vax
 1.2 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.2 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.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.8 11-Aug-2009  dsl Change NO_SRCS lines to specify .S in order to exclude the .c file from
SRCS but add it to LSRCS (sort of makes sense!).
 1.7 30-Jul-2009  dsl Stop bcopy.c and bzero.c being compiled
 1.6 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.5 18-Jul-2009  dsl Remove references to index.c and rindex.c (strchr.c and strrchr.c
now provide the definitions).
 1.4 07-Jul-2001  eeh Replace bzero.S and bcopy.S with memset.S and memcpy.S to make the makefiles
happy.
 1.3 30-Jun-2001  eeh Add an optimized asssembly bcopy/memcpy.
 1.2 21-Jun-2001  eeh Add an assembly version of memset(3).
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.8 07-Jul-2001  eeh Replace bzero.S and bcopy.S with memset.S and memcpy.S to make the makefiles
happy.
 1.7 05-Jul-2001  eeh Fix more boundary issues.
 1.6 05-Jul-2001  eeh Fix some boundary condition issues.
 1.5 04-Jul-2001  eeh Re-enable block insns for cahe issues.
 1.4 04-Jul-2001  eeh Fix return value and fetches beyond the source range that could cause
segmentation faults in some cases. And disable the VIS version which
seems to be slower.
 1.3 01-Jul-2001  eeh Oops. Fix typo.
 1.2 01-Jul-2001  eeh I seem to have stumbled on an even faster bcopy implementation....
 1.1 30-Jun-2001  eeh Add an optimized asssembly bcopy/memcpy.
 1.11 07-Jul-2001  eeh Replace bzero.S and bcopy.S with memset.S and memcpy.S to make the makefiles
happy.
 1.10 04-Jul-2001  eeh Re-enable block insns since they don't allocate in the caches.
 1.9 04-Jul-2001  eeh Disable slower VIS version.
 1.8 10-Feb-2001  eeh branches: 1.8.2;
Don't flush the zero-ed data from the cache.
 1.7 24-Jul-2000  mycroft Offset the %i2 stack slot from %sp, not %fp. Otherwise we may modify the
caller's registers!
 1.6 24-Jul-2000  mycroft There's no good reason not to assume a 64-bit stack here.
 1.5 24-Jul-2000  mycroft Don't bother saving %f16-%f31, since we don't use them.
 1.4 23-Jul-2000  mycroft Just use a store/load pair to get the pattern into the FP reg. This eliminates
a bunch of cruft and avoids using a v9a instruction.
In addition, eliminate 8 of the fmovda's, which we are not using the result of
anyway.
Net result is that this should be faster in all cases.
 1.3 08-Jul-2000  eeh Block align pointer *AFTER* fixing up possible stack bias.
 1.2 30-Dec-1999  eeh branches: 1.2.4;
New bzero() using block store insns.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.2.4.2 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.2.4.1 19-Jul-2000  mrg pull up rev 1.3 (approved by thorpej):
>Block align pointer *AFTER* fixing up possible stack bias.
 1.8.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.7 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 13-May-2001  eeh Removed unused PIC setup code.
 1.4 18-Jul-2000  eeh branches: 1.4.2;
Fix PIC bugs.
 1.3 30-Dec-1999  eeh branches: 1.3.4;
Sample code to implement ffs() using the popc insn (if it's ever implemented).
 1.2 13-Sep-1998  eeh Libc fixes, mostly to work around the new signal stuff.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3.4.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.4.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.6 17-Mar-2013  christos now live in common/lib/libc/arch/sparc64/string
 1.5 12-Jul-2011  mrg branches: 1.5.2; 1.5.8;
rename sparc64 BLOCK_SIZE and BLOCK_ALIGN to have SPARC64_ prefixes.
for the assembler files, define the old names to the new names
since using the new names cause ugliness due to longer identifer
names, and reduces churn.

fixes build issues in dtv and vaguely makes <machine/psl.h> slightly
less name-space invasive.
 1.4 25-May-2011  christos use _ALIGN consistently.
 1.3 24-May-2011  christos make this compile with DEBUG (_ALIGN was not defined).
 1.2 01-Aug-2001  eeh branches: 1.2.2;
Use unsigned compares for addresses.
 1.1 07-Jul-2001  eeh Replace bzero.S and bcopy.S with memset.S and memcpy.S to make the makefiles
happy.
 1.2.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.2.2.1 01-Aug-2001  nathanw file memcpy.S was added on branch nathanw_sa on 2001-10-08 20:18:26 +0000
 1.5.8.1 23-Jun-2013  tls resync from head
 1.5.2.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.5 17-Mar-2013  christos now live in common/lib/libc/arch/sparc64/string
 1.4 02-Aug-2001  eeh branches: 1.4.2; 1.4.60; 1.4.66;
Improved version of bzero.
 1.3 01-Aug-2001  eeh Fix some corner cases.
 1.2 07-Jul-2001  eeh Replace bzero.S and bcopy.S with memset.S and memcpy.S to make the makefiles
happy.
 1.1 21-Jun-2001  eeh Add an assembly version of memset(3).
 1.4.66.1 23-Jun-2013  tls resync from head
 1.4.60.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.4.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.4.2.1 02-Aug-2001  nathanw file memset.S was added on branch nathanw_sa on 2001-10-08 20:18:27 +0000
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 02-Apr-2002  eeh The mask for 8-byte alignment is 0x7 not 0xf.
 1.3 01-Apr-2002  eeh Remove test harnass bits.
 1.2 30-Mar-2002  eeh Better, faster strlen().
 1.1 11-Sep-1998  eeh branches: 1.1.12;
Add sparc64-specific libc.
 1.1.12.1 25-Apr-2002  nathanw Catch up to -current.
 1.5 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 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 25-Jul-2000  mycroft Use cpp comment style.
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility vfork() (i.e. the vfork() with
the 4.4BSD non-shared-address-space semantics), and direct the user to
include <unistd.h> to generate the correct reference.

This warning isn't about an ABI compatibility issue, but the new vfork() is
considerably faster.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.7 28-Apr-2008  martin branches: 1.7.8;
Remove clause 3 and 4 from TNF licenses
 1.6 27-Dec-2006  martin branches: 1.6.10;
After discussing this further with uwe, rearange stack usage slightly and
replace a comment with words suggested by him.
 1.5 25-Dec-2006  martin When setting up the __clone()'s userland stack, make sure to allocate
an initial frame. Fixes PR 33075.
 1.4 02-Jan-2004  martin branches: 1.4.16;
Restore stack frames on error exit. This makes us pass dynamic and static
linked versions of the clonetest regression test.
While here, some cosmetics: branch prediction, avoid depreceated instructions.
 1.3 31-Dec-2003  martin Use CC64FSZ instead of magic constant for stack frame size.
Frob the clone's stack pointer to be BIASed - it is 64 bit code too.
Use "carry set" as test for a failed syscall.
 1.2 07-May-2002  eeh Use large (-fPIC) relocations.
 1.1 23-Jul-2001  thorpej branches: 1.1.2;
sparc64 version, cloned (har har!) from the sparc version and tweaked.
 1.1.2.3 21-Jun-2002  nathanw Catch up to -current.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 23-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:18:28 +0000
 1.4.16.2 04-Jan-2007  bouyer Pull up following revision(s) (requested by martin in ticket #311):
lib/libc/arch/sparc64/sys/__clone.S: revision 1.6
After discussing this further with uwe, rearange stack usage slightly and
replace a comment with words suggested by him.
 1.4.16.1 03-Jan-2007  tron Pull up following revision(s) (requested by martin in ticket #309):
lib/libc/arch/sparc64/sys/__clone.S: revision 1.5
When setting up the __clone()'s userland stack, make sure to allocate
an initial frame. Fixes PR 33075.
 1.6.10.1 18-May-2008  yamt sync with head.
 1.7.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7.8.1 28-Apr-2008  martin file __clone.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.10 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.9 11-Jan-2009  christos merge christos-time_t
 1.8 24-Nov-2008  martin Remove __LIBC12_SOURCE__
 1.7 28-Apr-2008  martin branches: 1.7.6; 1.7.8;
Remove clause 3 and 4 from TNF licenses
 1.6 19-Feb-2006  christos branches: 1.6.4; 1.6.18;
make these consistent.
 1.5 12-Jun-2005  lukem Add missing __RCSID()
 1.4 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.3 27-Oct-2003  christos Signal trampoline stuff for siginfo.
XXX: I don't understand why I am off by 48 bytes.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:28:06 +0000
 1.6.18.1 18-May-2008  yamt sync with head.
 1.6.4.1 28-Nov-2008  snj Pull up following revision(s) (requested by martin in ticket #1241):
lib/libc/arch/sparc64/sys/__sigaction14_sigtramp.c: revision 1.8
Remove __LIBC12_SOURCE__
 1.7.8.2 04-Jan-2009  christos merge with head.
 1.7.8.1 28-Apr-2008  christos file __sigaction14_sigtramp.c was added on branch christos-time_t on 2009-01-04 17:02:18 +0000
 1.7.6.1 25-Nov-2008  snj Pull up following revision(s) (requested by martin in ticket #124):
lib/libc/arch/sparc64/sys/__sigaction14_sigtramp.c: revision 1.8
Remove __LIBC12_SOURCE__
 1.4 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.3 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.2 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.1 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.6 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.5 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 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 29-Oct-2002  petrov Compile with an ISO C preprocessor.
 1.2 10-Jul-2002  thorpej branches: 1.2.2;
Also need <machine/fsr.h> and <machine/psl.h>.
 1.1 09-Jul-2002  thorpej New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.2.2.3 11-Nov-2002  nathanw Catch up to -current
 1.2.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.2.2.1 10-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:28:06 +0000
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 27-Oct-2003  christos branches: 1.2.30;
Explain the stack layout correctly now that that I understand it :-)
 1.1 27-Oct-2003  christos Signal trampoline stuff for siginfo.
XXX: I don't understand why I am off by 48 bytes.
 1.2.30.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 __sigtramp2.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.1 13-Dec-2000  martin Add simple __syscall.S to make libc compile on sparc64 again.
 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 25-Jul-2000  mycroft Use cpp comment style.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.13 12-Sep-2013  joerg 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 26-Dec-2003  martin branches: 1.12.56; 1.12.62;
Use an unsigned comparison against minbrk.
From OpenBSD, changed by Miod Vallat.
 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 07-May-2002  eeh Use large (-fPIC) relocations.
 1.9 25-Jul-2000  mycroft branches: 1.9.2;
Store the whole 64-bit pointer...
 1.8 25-Jul-2000  mycroft Use cpp comment style.
 1.7 21-Jul-2000  eeh Update some more assembly code for PIC issues.
 1.6 18-Jul-2000  eeh Fix PIC bugs.
 1.5 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.4 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.3 31-Mar-1999  kleink branches: 1.3.10;
Change references to `end' to `_end' as not to invade (or being invaded by)
the user's name space.
 1.2 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3.10.3 22-Aug-2000  kleink Pull up revs. 1.4-1.5 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.3.10.2 27-Jul-2000  mycroft Fix missing piece of the previous pullup.
 1.3.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.9.2.1 21-Jun-2002  nathanw Catch up to -current.
 1.12.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.56.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.8 14-Sep-2013  nakayama Redo previous to fix build break.
 1.7 12-Sep-2013  joerg 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 07-Aug-2003  agc branches: 1.6.56; 1.6.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 07-May-2002  eeh Use large (-fPIC) relocations.
 1.4 26-Jul-2000  eeh branches: 1.4.2;
Need to reserve a full 64-bit stackframe, not a 32-bit one.
 1.3 18-Jul-2000  eeh Fix PIC bugs.
 1.2 14-Jan-1999  kleink branches: 1.2.10;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.2.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.4.2.1 21-Jun-2002  nathanw Catch up to -current.
 1.6.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.56.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.3 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.2 07-Aug-2003  agc branches: 1.2.80; 1.2.84;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.2.84.1 21-Apr-2017  bouyer Sync with HEAD
 1.2.80.1 20-Mar-2017  pgoyette Sync with HEAD
 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 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.3 25-Jul-2000  mycroft Use cpp comment style.
 1.2 26-Jun-2000  kleink Need an internal name for fork().
 1.1 11-Sep-1998  eeh branches: 1.1.10;
Add sparc64-specific libc.
 1.1.10.1 22-Aug-2000  kleink Pull up rev. 1.2 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 18-Jan-2003  thorpej branches: 1.2.30;
Merge the nathanw_sa branch.
 1.1 17-Nov-2001  martin branches: 1.1.2;
file getcontext.S was initially added on branch nathanw_sa.
 1.1.2.1 17-Nov-2001  martin Userland *context support for sparc64, from Klaus Klein.
 1.2.30.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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.2 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 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 28-Sep-2000  kleink Need an internal name for pipe(2).
 1.2 25-Jul-2000  mycroft Use cpp comment style.
 1.1 11-Sep-1998  eeh branches: 1.1.10;
Add sparc64-specific libc.
 1.1.10.1 29-Sep-2000  kleink Pull up rev. 1.3 via patch (approved by thorpej):
Add internal name for pipe().
 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 24-Jul-2000  mycroft _errno -> __errno
 1.3 21-Jul-2000  eeh Update some more assembly code for PIC issues.
 1.2 18-Jul-2000  eeh Fix PIC bugs.
 1.1 11-Sep-1998  eeh branches: 1.1.10;
Add sparc64-specific libc.
 1.1.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.11 14-Sep-2013  nakayama Redo previous to fix build break.
 1.10 12-Sep-2013  joerg 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.9 07-Aug-2003  agc branches: 1.9.56; 1.9.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 07-May-2002  eeh Use large (-fPIC) relocations.
 1.7 25-Jul-2000  mycroft branches: 1.7.2;
Use cpp comment style.
 1.6 18-Jul-2000  eeh Fix PIC bugs.
 1.5 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.4 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.3 31-Mar-1999  kleink branches: 1.3.10;
Change references to `end' to `_end' as not to invade (or being invaded by)
the user's name space.
 1.2 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3.10.2 22-Aug-2000  kleink Pull up revs. 1.4-1.5 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.3.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.7.2.1 21-Jun-2002  nathanw Catch up to -current.
 1.9.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.56.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.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 07-May-2002  eeh Use large (-fPIC) relocations.
 1.3 21-Jul-2000  eeh branches: 1.3.2;
Update some more assembly code for PIC issues.
 1.2 18-Jul-2000  eeh Fix PIC bugs.
 1.1 11-Sep-1998  eeh branches: 1.1.10;
Add sparc64-specific libc.
 1.1.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.3.2.1 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.1 07-Jul-2000  itohy Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.2 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.3 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.1 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.8 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.7 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.6 25-Jul-2000  mycroft Use cpp comment style.
 1.5 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.4 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.3 14-Sep-1998  thorpej Back out previous change; it was incorrect.
 1.2 13-Sep-1998  eeh Libc fixes, mostly to work around the new signal stuff.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.9 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.8 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.7 25-Jul-2000  mycroft Use cpp comment style.
 1.6 21-Jul-2000  eeh Update some more assembly code for PIC issues.
 1.5 02-Dec-1998  thorpej branches: 1.5.10;
Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.4 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.3 14-Sep-1998  thorpej Back out previous change; it was incorrect.
 1.2 13-Sep-1998  eeh Libc fixes, mostly to work around the new signal stuff.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.5.10.1 26-Jul-2000  mycroft Approved by thorpej:
Add/fix PIC support, stack biasing, and many other random bugs.

basesrc/lib/libc/arch/sparc64/SYS.h 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/gen/__sigsetjmp14.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/fabs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/fixunsdfsi.S 1.2 -> 1.3
basesrc/lib/libc/arch/sparc64/gen/modf.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/saveregs.S 1.1 -> 1.2
basesrc/lib/libc/arch/sparc64/gen/sigsetjmp.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/string/bzero.S 1.3 -> 1.7
basesrc/lib/libc/arch/sparc64/string/ffs.S 1.3 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.5 -> 1.7
basesrc/lib/libc/arch/sparc64/sys/brk.S 1.8 -> 1.9
basesrc/lib/libc/arch/sparc64/sys/cerror.S 1.2 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/ptrace.S 1.1 -> 1.4
basesrc/lib/libc/arch/sparc64/sys/sbrk.S 1.5 -> 1.6
basesrc/lib/libc/arch/sparc64/sys/setlogin.S 1.1 -> 1.3
basesrc/lib/libc/arch/sparc64/sys/sigprocmask.S 1.5 -> 1.6
 1.8 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.7 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 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 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.4 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.3 14-Sep-1998  thorpej Back out previous change; it was incorrect.
 1.2 13-Sep-1998  eeh Libc fixes, mostly to work around the new signal stuff.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.8 16-Oct-2005  christos Bring sparc64 to the new compat layout.
 1.7 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.6 25-Jul-2000  mycroft Use cpp comment style.
 1.5 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.4 08-Oct-1998  eeh Fix libc signal breakage (I hope).
 1.3 14-Sep-1998  thorpej Back out previous change; it was incorrect.
 1.2 13-Sep-1998  eeh Libc fixes, mostly to work around the new signal stuff.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.3 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.2 07-Aug-2003  agc branches: 1.2.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.1 11-Sep-1998  eeh Add sparc64-specific libc.
 1.2.98.1 21-Apr-2020  martin Sync with HEAD
 1.3 06-Jan-1996  ragge Changed to only include <machine/asm.h>, as the other ports.
 1.2 09-Dec-1995  ragge Can't be sure cpp can handle x ## y.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.10 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.9 06-Jul-2010  mrg remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.8 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.7 03-May-2005  matt Make longjmp on vax not use sigreturn. Instead it rewrites the
jmp_buf into one compatible with __longjmp14 and relies on that
to change that into a ucontext_t suitable for setcontext(2).
 1.6 03-Jun-2004  mhitch A -I. is needed by vax; had gotten removed from elsewhere.
 1.5 21-Mar-2004  matt Change longjmp on VAX (ELF) to use setcontext instead of sigreturn14.
 1.4 30-Sep-2003  matt Enable the SIGINFO trampoline.
 1.3 28-Sep-2003  matt Deal with changed filename.
 1.2 12-Sep-2002  ragge Rename __sigtramp1.S to __sigtramp.S.
 1.1 10-Jul-2002  thorpej branches: 1.1.2;
Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.1.2.3 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 10-Jul-2002  nathanw file Makefile.inc was added on branch nathanw_sa on 2002-08-01 03:28:07 +0000
 1.12 27-Feb-2012  joerg Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
 1.11 25-Jan-2011  matt branches: 1.11.4; 1.11.6;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.10 07-Aug-2003  agc branches: 1.10.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.8 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.7 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.6 28-Jun-2000  matt branches: 1.6.2;
Make these work with either a.out or ELF.
 1.5 20-Oct-1998  matt Some changes to disassembly easier without causing any performance penalty.
 1.4 02-May-1997  kleink Consistency: distinguish between PSEUDO() and PSEUDO_NOERROR().
 1.3 18-Oct-1996  jtc Include <machine/asm.h> instead of defining our own ENTRY() macro
Changed all instances of ENTRY() to match the new calling convention
(it takes a second argument ).

Added new macros:
SYSTRAP(x): Expands to the code used to call syscall x.
This is used to simplify other macros.

SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.

RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.
 1.2 12-Dec-1995  ragge Add defs to understand K&R cpp.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.6.2.2 21-Jun-2002  nathanw Catch up to -current.
 1.6.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.10.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.6.1 27-Feb-2012  riz Pull up following revision(s) (requested by joerg in ticket #57):
lib/libc/arch/arm/sys/cerror.S: revision 1.8
lib/libc/arch/vax/SYS.h: revision 1.12
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.3
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.4
lib/libc/arch/i386/sys/cerror.S: revision 1.16
lib/libc/arch/x86_64/sys/cerror.S: revision 1.5
lib/libc/arch/powerpc/sys/cerror.S: revision 1.10
lib/libc/arch/mips/sys/cerror.S: revision 1.17
lib/libc/arch/powerpc/sys/cerror.S: revision 1.9
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.11.4.1 17-Apr-2012  yamt sync with head
 1.6 24-Nov-2021  thorpej Decorate the VAX signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.

N.B. This is currently disabled, as these .cfi directives cause
linker warnings about incompatible TEXTREL relocations in .eh_frame.
 1.5 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.4 28-Apr-2008  martin branches: 1.4.8; 1.4.20;
Remove clause 3 and 4 from TNF licenses
 1.3 03-May-2005  matt branches: 1.3.18;
Make longjmp on vax not use sigreturn. Instead it rewrites the
jmp_buf into one compatible with __longjmp14 and relies on that
to change that into a ucontext_t suitable for setcontext(2).
 1.2 04-Mar-2004  matt Add UC_STACK and stack_t related definitions.
 1.1 03-Mar-2004  matt Use this to symbolically get into ucontext_t and struct sigcontext.
 1.3.18.1 18-May-2008  yamt sync with head.
 1.4.20.1 08-Feb-2011  bouyer 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 genassym.cf was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.18 08-Nov-2018  riastradh Attempt to implement fabsf by copying fabs and s/d/f/g.

Vax wizards, please vaxinate if I flubbed this!
 1.17 06-Jul-2010  mrg branches: 1.17.44; 1.17.46;
remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.16 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.15 03-Jun-2009  christos add _lwp_makecontext for the vax.
 1.14 04-Mar-2004  kleink * 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.13 16-Jan-2004  ragge Fix typo fpclassifd.c -> fpclassifyd.c, reported by Bertram Barth.
 1.12 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.11 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.10 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.9 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.8 23-Jan-2003  matt Add the *context.? sources to SRCS.
Make getcontext _getcontext and add a getcontext weak alias.
 1.7 26-Oct-2002  thorpej Split isnan() into its own file.
 1.6 27-Mar-2002  matt Don't build old 1.3 compat jmp stuff for ELF.
For ELF, don't rewind stack on longjmp/_longjmp. (for pth).
 1.5 06-Mar-1999  ragge branches: 1.5.12;
Fix typos after the hton* changes. Need __*setjmp14.S also.
 1.4 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.3 10-Oct-1998  matt Actually build __setjmp.S/__sigsetjmp.S for vax. PICifiy the setjmp code.
Fix libm Makefile to handle obj directories.
 1.2 09-Dec-1995  ragge sigsetjmp/siglongjmp was missing. Code fix by Arne H. Juul.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.5.12.2 11-Nov-2002  nathanw Catch up to -current
 1.5.12.1 25-Apr-2002  nathanw Catch up to -current.
 1.17.46.1 10-Jun-2019  christos Sync with HEAD
 1.17.44.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.6 29-Jun-2024  rin vax: {,_}longjmp(3): Return 1 if `val` == 0

Found by tests/lib/libc/setjmp/t_setjmp:{,_}longjmp_zero.
 1.5 24-Jan-2016  christos use __register_t
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 14-Sep-2005  he branches: 1.3.18;
Patterned after the other fixes for __longjmp14.c, include
<compat/include/setjmp.h> also here to make these build.
 1.2 23-Mar-2004  simonb Fix <tab> nits.
 1.1 21-Mar-2004  matt Change longjmp on VAX (ELF) to use setcontext instead of sigreturn14.
 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 __longjmp14.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.11 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.10 03-May-2005  matt branches: 1.10.40;
Make longjmp on vax not use sigreturn. Instead it rewrites the
jmp_buf into one compatible with __longjmp14 and relies on that
to change that into a ucontext_t suitable for setcontext(2).
 1.9 21-Mar-2004  matt Change longjmp on VAX (ELF) to use setcontext instead of sigreturn14.
 1.8 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.7 30-Mar-2002  matt Put R6 back in the save and adjust frame size for it. Don't save the
register in sigset area, put them after the sigset area.
 1.6 27-Mar-2002  matt Don't build old 1.3 compat jmp stuff for ELF.
For ELF, don't rewind stack on longjmp/_longjmp. (for pth).
 1.5 24-Feb-2002  matt Change to use a register prefix.
 1.4 28-Jun-2000  matt branches: 1.4.2;
Make these work with either a.out or ELF.
 1.3 10-Oct-1998  matt Use __sigprocmask14, fix a few more bugs
 1.2 10-Oct-1998  matt Actually build __setjmp.S/__sigsetjmp.S for vax. PICifiy the setjmp code.
Fix libm Makefile to handle obj directories.
 1.1 01-Oct-1998  christos This should be close...
 1.4.2.3 25-Apr-2002  nathanw Catch up to -current.
 1.4.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.4.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.10.40.1 08-Feb-2011  bouyer Sync with HEAD
 1.5 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.4 07-Aug-2003  agc branches: 1.4.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 24-Feb-2002  matt Change to use a register prefix.
 1.2 28-Jun-2000  matt branches: 1.2.2;
Make these work with either a.out or ELF.
 1.1 01-Oct-1998  christos This should be close...
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.4.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 02-Apr-2023  skrll Trailing whitespace
 1.3 22-Mar-2012  christos vax-specific lint fixes.
 1.2 07-Jan-2012  chs define _UC_TLSBASE and use it to pass the TLS pointer to setcontext().
since there is no available space in ucontext_t on vax, pass the
TLS pointer on the stack referenced by the ucontext_t instead.
suggested by joerg.
 1.1 03-Jun-2009  christos branches: 1.1.6;
add _lwp_makecontext for the vax.
 1.1.6.1 17-Apr-2012  yamt sync with head
 1.11 29-Jun-2024  rin vax: {,_}longjmp(3): Return 1 if `val` == 0

Found by tests/lib/libc/setjmp/t_setjmp:{,_}longjmp_zero.
 1.10 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.9 07-Aug-2003  agc branches: 1.9.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 30-Mar-2002  matt Put R6 back in save mask (to make mask used by PLT routines). Adjust frame
size according. In _longjmp, deal with sp/fp separately since they stored
in reserve order so movq won't work.
 1.7 28-Mar-2002  matt Fix a few wrong register uses. (at least I know it works now. :)
 1.6 27-Mar-2002  matt Don't build old 1.3 compat jmp stuff for ELF.
For ELF, don't rewind stack on longjmp/_longjmp. (for pth).
 1.5 24-Feb-2002  matt Missed an sp in the great %sp cleanup.
 1.4 24-Feb-2002  matt Change to use a register prefix.
 1.3 28-Jun-2000  matt branches: 1.3.2;
Make these work with either a.out or ELF.
 1.2 13-Oct-1998  matt PICify. (e.g. change movl $sym, rX to movab sym, rX)
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.3.2.3 25-Apr-2002  nathanw Catch up to -current.
 1.3.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.3.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.9.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.5 21-Nov-2011  chs gcc 4.5 on vax creates PLT stubs with an entry mask of 0xffc
rather than 0 like gcc 4.1 did, so the sneaky assembly functions
that "ret" without really returning now clobber their registers.
adjust these functions to avoid this problem.
 1.4 25-Jan-2011  matt branches: 1.4.4;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 17-Apr-1995  ragge branches: 1.1.22;
Added libc VAX specific files.
 1.1.22.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.22.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4.4.1 17-Apr-2012  yamt sync with head
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 15-Jan-1999  bouyer branches: 1.1.12;
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.1.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 15-Jan-1999  bouyer branches: 1.1.12;
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.1.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.5 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.4 07-Aug-2003  agc branches: 1.4.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 24-Feb-2002  matt Change to use a register prefix.
 1.2 06-Mar-1999  ragge branches: 1.2.12;
Fix typos after the hton* changes. Need __*setjmp14.S also.
 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.2.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.4.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.5 07-Nov-2018  riastradh On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.

For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm. For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64. Need help from an itanium
wizard! Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.
 1.4 25-Jan-2011  matt branches: 1.4.42; 1.4.44;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 17-Apr-1995  ragge branches: 1.1.22;
Added libc VAX specific files.
 1.1.22.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.22.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4.44.1 10-Jun-2019  christos Sync with HEAD
 1.4.42.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1 08-Nov-2018  riastradh branches: 1.1.2; 1.1.4;
Attempt to implement fabsf by copying fabs and s/d/f/g.

Vax wizards, please vaxinate if I flubbed this!
 1.1.4.2 10-Jun-2019  christos Sync with HEAD
 1.1.4.1 08-Nov-2018  christos file fabsf.S was added on branch phil-wifi on 2019-06-10 22:05:18 +0000
 1.1.2.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1.2.1 08-Nov-2018  pgoyette file fabsf.S was added on branch pgoyette-compat on 2018-11-26 01:52:11 +0000
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 20-Jan-2004  matt branches: 1.2.30;
Make these compile.
 1.1 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.2.30.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 fpclassifyd.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 20-Jan-2004  matt branches: 1.2.30;
Make these compile.
 1.1 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.2.30.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 fpclassifyf.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.5 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.4 07-Aug-2003  agc branches: 1.4.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 10-Mar-1999  mycroft Just some minor cleanup.
 1.2 13-Jul-1997  christos Fix RCSID's
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.4.56.1 30-Oct-2012  yamt sync with head
 1.8 19-Feb-2002  thorpej Adjust for changes to __infinity decl.
 1.7 13-Sep-2000  msaitoh branches: 1.7.2;
check LIBC_SCCS
 1.6 17-Apr-1999  ragge Set infinity to the highest D-float possible.
XXX - infinity does not exist on vax...
 1.5 14-Nov-1998  christos branches: 1.5.2;
delint
 1.4 26-Jul-1998  mycroft const poisoning.
 1.3 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.2 13-Jul-1997  christos Fix RCSID's
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.5.2.1 19-Apr-1999  cjs Pull up to HEAD 1.6, per Anders Magnusson <ragge@ludd.luth.se>.
 1.7.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.7.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.1 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __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.5 28-Apr-2008  martin branches: 1.5.8;
Remove clause 3 and 4 from TNF licenses
 1.4 20-Jan-2004  matt branches: 1.4.30;
s/sgn/sign (compiles now)
 1.3 20-Jan-2004  matt Make these compile too.
 1.2 30-Oct-2003  kleink Pasto.
 1.1 29-Oct-2003  kleink C99 7.12.3.2: add library portions of isfinite, but don't build these just
yet.
 1.4.30.1 18-May-2008  yamt sync with head.
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file isfinited.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 20-Jan-2004  matt branches: 1.3.30;
s/sgn/sign (compiles now)
 1.2 20-Jan-2004  matt Make these compile too.
 1.1 29-Oct-2003  kleink C99 7.12.3.2: add library portions of isfinite, but don't build these just
yet.
 1.3.30.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 isfinitef.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.8 04-Mar-2004  kleink * 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.7 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.6 26-Oct-2002  thorpej Split isnan() into its own file.
 1.5 22-Jan-2000  mycroft branches: 1.5.6;
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 RCSID's
 1.2 05-Feb-1996  jtc Add explicit return type
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.5.6.1 11-Nov-2002  nathanw Catch up to -current
 1.3 04-Mar-2004  kleink * 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.2 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.1 17-May-2003  thorpej Add _isinfl() and _isnanl() routines, currently for internal use only.
 1.3 04-Mar-2004  kleink * 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.2 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.1 26-Oct-2002  thorpej branches: 1.1.2;
Split isnan() into its own file.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 26-Oct-2002  nathanw file isnan.c was added on branch nathanw_sa on 2002-11-11 22:21:59 +0000
 1.3 04-Mar-2004  kleink * 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.2 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.1 17-May-2003  thorpej Add _isinfl() and _isnanl() routines, currently for internal use only.
 1.7 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.6 07-Aug-2003  agc branches: 1.6.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 24-Feb-2002  matt Change to use a register prefix.
 1.4 28-Jun-2000  matt branches: 1.4.2;
Make these work with either a.out or ELF.
 1.3 05-Feb-2000  kleink Go via *__errno() here, too.
 1.2 01-Jun-1995  ragge branches: 1.2.12;
Converted K&R -> ansi.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2.12.1 07-Feb-2000  he Pull up revision 1.3 (requested by kleink):
Implement *__errno() indirection.
 1.4.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.4.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.6.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 22-Mar-2012  christos vax-specific lint fixes.
 1.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 09-Apr-2005  matt branches: 1.2.18;
Start the args after the argc. Return to resumecontext after the entry mask.
 1.1 19-Jan-2003  matt Add the VAX versions of these.
 1.2.18.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 makecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.3.4.1 17-Apr-2012  yamt sync with head
 1.5 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.4 07-Aug-2003  agc branches: 1.4.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 23-Jun-2002  matt Add modff
 1.2 24-Feb-2002  matt branches: 1.2.2;
Change to use a register prefix.
 1.1 17-Apr-1995  ragge branches: 1.1.22;
Added libc VAX specific files.
 1.1.22.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.22.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.22.1 08-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 24-Jun-2002  lukem Pull up revision 1.3 (requested by matt in ticket #352):
Add modff
 1.4.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 19-Sep-2011  joerg Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 08-Dec-2006  martin branches: 1.2.10;
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:

-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.1 19-Jan-2003  matt branches: 1.1.16;
Add the VAX versions of these.
 1.1.16.1 09-Dec-2006  bouyer Pull up following revision(s) (requested by martin in ticket #264):
lib/libc/arch/sh5/gen/resumecontext.c: revision 1.2
lib/libc/arch/sh3/gen/resumecontext.c: revision 1.3
lib/libc/arch/sparc/gen/resumecontext.c: revision 1.3
lib/libc/arch/powerpc/gen/resumecontext.c: revision 1.3
lib/libc/arch/arm/gen/resumecontext.c: revision 1.3
lib/libc/arch/mips/gen/resumecontext.c: revision 1.3
lib/libc/arch/vax/gen/resumecontext.c: revision 1.2
lib/libc/arch/powerpc64/gen/resumecontext.c: revision 1.2
lib/libc/arch/hppa/gen/resumecontext.c: revision 1.2
Sync all resumecontext.c versions with the changes originally made
by Matthias Drochner to i386 and alpha:
-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.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 resumecontext.c was added on branch christos-time_t on 2008-04-28 20:22:58 +0000
 1.8 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.7 03-May-2005  matt Make longjmp on vax not use sigreturn. Instead it rewrites the
jmp_buf into one compatible with __longjmp14 and relies on that
to change that into a ucontext_t suitable for setcontext(2).
 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 24-Feb-2002  matt Change to use a register prefix.
 1.4 28-Jun-2000  matt branches: 1.4.2;
Make these work with either a.out or ELF.
 1.3 10-Oct-1998  matt Actually build __setjmp.S/__sigsetjmp.S for vax. PICifiy the setjmp code.
Fix libm Makefile to handle obj directories.
 1.2 05-Dec-1997  thorpej Use __sigaltstack14(), not sigaltstack().
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.4.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.4.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.2 28-Apr-2008  martin branches: 1.2.8;
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.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2.8.1 28-Apr-2008  martin file signbitd.c was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.2 28-Apr-2008  martin branches: 1.2.8;
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.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2.8.1 28-Apr-2008  martin file signbitf.c was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.5 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 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 24-Feb-2002  matt Change to use a register prefix.
 1.2 28-Jun-2000  matt branches: 1.2.2;
Make these work with either a.out or ELF.
 1.1 09-Dec-1995  ragge sigsetjmp/siglongjmp was missing. Code fix by Arne H. Juul.
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 28-Apr-2008  martin branches: 1.3.8; 1.3.20;
Remove clause 3 and 4 from TNF licenses
 1.2 20-Jan-2003  matt branches: 1.2.30;
Make sure r0 in the saved context is 0.
 1.1 19-Jan-2003  matt Add the VAX versions of these.
 1.2.30.1 18-May-2008  yamt sync with head.
 1.3.20.1 08-Feb-2011  bouyer 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 swapcontext.S was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 24-Feb-2002  matt Change to use a register prefix.
 1.2 07-Aug-2000  matt branches: 1.2.2;
Fix some ELF/a.out lossage
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 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 24-Feb-2002  matt Change to use a register prefix.
 1.2 07-Aug-2000  matt branches: 1.2.2;
Fix some ELF/a.out lossage
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 06-Jun-2004  he Revert previous; mhitch has already committed a workaround to ../Makefile.inc.
 1.3 06-Jun-2004  he It appears necessary to add -I. to CPPFLAGS for nslexer.c. This is
most probably caused by gcc 2.95.3; will be documented in doc/HACKS.
Reviewed by ragge.
 1.2 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.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2 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.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2 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.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2 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.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2 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.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.5 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.4 04-Aug-2008  matt branches: 1.4.6;
Add C99 functions imaxabs and imaxdiv.
 1.3 22-Mar-2006  drochner branches: 1.3.20;
build erand48_ieee754.c on everything but vax
 1.2 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.1 05-Nov-1997  cgd branches: 1.1.2;
A foolish consistency... gen, net, and string all get MD sources
specified by including a Makefile.inc from the appropriate MD directory.
stdlib doesn't do that, but there's no reason that it shouldn't (and
it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>A foolish consistency... gen, net, and string all get MD sources
>specified by including a Makefile.inc from the appropriate MD directory.
>stdlib doesn't do that, but there's no reason that it shouldn't (and
>it'd be nice to eliminate the 'if's from the MI stdlib Makefile.inc).
 1.1.2.1 05-Nov-1997  veego file Makefile.inc was added on branch netbsd-1-3 on 1997-11-08 21:56:45 +0000
 1.3.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:29 +0000
 1.5 12-Mar-2010  uwe Add memset to libkern on vax, moving existing memset.S to src/common.

While kernel source code is supposed to use <machine/macros.h> via
<sys/param.h> and pick an inline asm version from there, gcc itself
can generate direct calls to memset() for structure initialization, so
the symbol must be provided.

Fixes INSTALL kernel, for which -Os caused gcc to use memset() call to
initialize a struct in uvm_fault_internal().
 1.4 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.3 17-Jul-2009  dsl Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
libc and kernel build ok for affected archs (i386, amd64, vax, sun3,
evbmips-eb) all seem ok.
(vax might lose an asm index() - but comments imply it is worse than the C)
 1.2 19-May-1996  ragge VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.6 29-Sep-2020  msaitoh s/occurence/occurrence/
 1.5 23-Jan-2020  pgoyette Fix name of keyword so it will worwk correctly. :)
 1.4 25-Jan-2011  matt branches: 1.4.44;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4.44.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 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 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 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 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 12-Mar-2010  uwe Add memset to libkern on vax, moving existing memset.S to src/common.

While kernel source code is supposed to use <machine/macros.h> via
<sys/param.h> and pick an inline asm version from there, gcc itself
can generate direct calls to memset() for structure initialization, so
the symbol must be provided.

Fixes INSTALL kernel, for which -Os caused gcc to use memset() call to
initialize a struct in uvm_fault_internal().
 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 24-Feb-2002  matt Change to use a register prefix.
 1.1 19-May-1996  ragge branches: 1.1.20;
VAX string functions in assembler. Fixed for NetBSD by Ken Wellsch.
 1.1.20.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.20.1 08-Mar-2002  nathanw Catch up to -current.
 1.8 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.7 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.6 24-Feb-2002  matt Change to use a register prefix.
 1.5 28-Jun-2000  matt branches: 1.5.2;
Make these work with either a.out or ELF.
 1.4 05-Feb-2000  kleink Implement *__errno() redirection, with help from Matt Thomas.
 1.3 02-Dec-1998  thorpej branches: 1.3.2;
Warn about references to the compatibility vfork() (i.e. the vfork() with
the 4.4BSD non-shared-address-space semantics), and direct the user to
include <unistd.h> to generate the correct reference.

This warning isn't about an ABI compatibility issue, but the new vfork() is
considerably faster.
 1.2 04-Feb-1997  ragge ENTRY() takes two argument now, not one.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.3.2.1 07-Feb-2000  he Pull up revision 1.4 (requested by kleink):
Implement *__errno() indirection.
 1.5.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 28-Apr-2008  martin branches: 1.3.8; 1.3.20;
Remove clause 3 and 4 from TNF licenses
 1.2 24-Feb-2002  matt branches: 1.2.32;
Change to use a register prefix.
 1.1 20-Jul-2001  matt branches: 1.1.2;
Add __clone(2) for VAX.
 1.1.2.4 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 20-Jul-2001  nathanw file __clone.S was added on branch nathanw_sa on 2001-10-08 20:18:29 +0000
 1.2.32.1 18-May-2008  yamt sync with head.
 1.3.20.1 08-Feb-2011  bouyer 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 __clone.S was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.2 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.11 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.10 28-Apr-2008  martin branches: 1.10.8;
Remove clause 3 and 4 from TNF licenses
 1.9 22-Feb-2006  he branches: 1.9.18;
Remove unused local variable (re-declared in inner conditional scope).
 1.8 19-Feb-2006  christos make these consistent.
 1.7 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.6 12-Jun-2005  lukem Add missing __RCSID()
 1.5 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.4 30-Sep-2003  matt Enable the SIGINFO trampoline.
 1.3 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.2 12-Sep-2002  ragge Fix a signal handler bug originally reported by Hugh Graham some year ago:
If two signals are sent after each other without the process being run in
userspace between them then the second one will overwrite part of the signal
info stored on the userstack.
Fixed by rewriting and simplifying both the signal delivery code and the
trampoline code. Also bump signal version number to 2.
Rename __sigtramp1.S to __sigtramp.S.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.4 02-Oct-2002  thorpej libc:
Internally rename __sigaction14 to __libc_sigaction14. Provide a
weak alias of __sigaction14 -> __libc_sigaction14.

libpthread:
Use __libc_sigaction14 to actually register the signal handler, rather
than using __sigaction_sigtramp() directly with a hard-coded trampoline
version. While we don't actually use the libc trampoline, we want to
avoid depending on any COMPAT_* kernel options down the road (this is
already the case for the VAX port).

Be explicit about which version of the signal interface we're interposing
(...14), and build pthread_sig.c with __LIBC12_SOURCE__ (required to get
the libc-internal interfaces).
 1.1.2.3 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigaction14_sigtramp.c was added on branch nathanw_sa on 2002-08-01 03:28:08 +0000
 1.9.18.1 18-May-2008  yamt sync with head.
 1.10.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.5 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.4 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 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 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.1 30-Sep-1998  ragge New libc signal handling stuff.
 1.3 27-Sep-2003  matt Since this a signal trampoline #2, make that's in the file name.
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 12-Sep-2002  ragge branches: 1.1.2;
Fix a signal handler bug originally reported by Hugh Graham some year ago:
If two signals are sent after each other without the process being run in
userspace between them then the second one will overwrite part of the signal
info stored on the userstack.
Fixed by rewriting and simplifying both the signal delivery code and the
trampoline code. Also bump signal version number to 2.
Rename __sigtramp1.S to __sigtramp.S.
 1.1.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.1 12-Sep-2002  nathanw file __sigtramp.S was added on branch nathanw_sa on 2002-09-17 21:32:47 +0000
 1.2 12-Sep-2002  ragge Fix a signal handler bug originally reported by Hugh Graham some year ago:
If two signals are sent after each other without the process being run in
userspace between them then the second one will overwrite part of the signal
info stored on the userstack.
Fixed by rewriting and simplifying both the signal delivery code and the
trampoline code. Also bump signal version number to 2.
Rename __sigtramp1.S to __sigtramp.S.
 1.1 09-Jul-2002  thorpej branches: 1.1.2;
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.1.2.3 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 09-Jul-2002  nathanw file __sigtramp1.S was added on branch nathanw_sa on 2002-08-01 03:28:08 +0000
 1.3 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.2 26-Mar-2004  drochner fix references to the syscall formerly known as SYS___sigreturn14
 1.1 27-Sep-2003  matt Since this a signal trampoline #2, make that's in the file name.
 1.3 24-Nov-2021  thorpej Decorate the VAX signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.

N.B. This is currently disabled, as these .cfi directives cause
linker warnings about incompatible TEXTREL relocations in .eh_frame.
 1.2 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.1 30-Sep-2003  matt branches: 1.1.52;
Enable the SIGINFO trampoline.
 1.1.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 07-Aug-2003  agc branches: 1.3.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 13-Dec-2000  matt branches: 1.1.2;
Add a VAX version of __syscall. XXX Doesn't handle if syscall number is
> 0xffffffff or < -0xffffffff.
 1.1.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.7 21-Nov-2011  chs gcc 4.5 on vax creates PLT stubs with an entry mask of 0xffc
rather than 0 like gcc 4.1 did, so the sneaky assembly functions
that "ret" without really returning now clobber their registers.
adjust these functions to avoid this problem.
 1.6 25-Jan-2011  matt branches: 1.6.4;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.5 07-Aug-2003  agc branches: 1.5.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 24-Feb-2002  matt Change to use a register prefix.
 1.3 28-Jun-2000  matt branches: 1.3.2;
Make these work with either a.out or ELF.
 1.2 05-Feb-2000  kleink Implement *__errno() redirection, with help from Matt Thomas.
 1.1 04-Jan-1998  thorpej branches: 1.1.2;
Add syscall stubs for __vfork14(). These are basically copies of Ovfork.S
with the syscall numbers changed.

Since 4.4BSD vfork(2) did not share address space, Ovfork.S could be changed
to be identical to fork.S (modulo syscall numbers). __vfork14.S, however,
needs to remain separate since with a shared address space, the stub needs to
pre-decrement the stack and do an indirect jump to the return address, so that
the shared stackframe is still there when the parent returns. (Obviously,
this does not apply to systems which to not build stackframes on leaf calls.)
 1.1.2.1 07-Feb-2000  he Pull up revision 1.2 (requested by kleink):
Implement *__errno() indirection.
 1.3.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.3.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.5.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.6.4.1 17-Apr-2012  yamt sync with head
 1.15 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.14 18-Jul-2013  matt Make __curbrk & __minbrk hidden.
 1.13 25-Jan-2011  matt branches: 1.13.4; 1.13.10; 1.13.14;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.12 26-Dec-2003  martin branches: 1.12.52;
Use an unsigned comparison against minbrk.
From OpenBSD, changed by Miod Vallat.
 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 24-Feb-2002  matt Change to use a register prefix.
 1.9 01-Jul-2000  matt branches: 1.9.2;
Fix a major botch in 1.4 (which I did not do) which broke _brk and malloc.
 1.8 30-Jun-2000  matt Fix some bugs and clean up for ELF & a.out support
 1.7 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.6 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.5 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.4 23-Jun-2000  kleink Delete the leftover _brk entry; as discussed with Ragge.
 1.3 14-Jan-1999  kleink branches: 1.3.10;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.2 04-Feb-1997  ragge ENTRY() takes two argument now, not one.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.3.10.1 22-Aug-2000  kleink Pull up revs. 1.4-1.6,1.9 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.9.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.9.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.12.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.13.14.1 23-Jul-2013  riastradh sync with HEAD
 1.13.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.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.9 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.8 07-Aug-2003  agc branches: 1.8.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 24-Feb-2002  matt Change to use a register prefix.
 1.6 07-Aug-2000  matt branches: 1.6.2;
Fix some ELF/a.out lossage
 1.5 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.4 05-Feb-2000  kleink Implement *__errno() indirection.
 1.3 20-Oct-1998  matt branches: 1.3.2;
Some changes to disassembly easier without causing any performance penalty.
 1.2 04-Dec-1995  ragge Didn't take care of errors when return parameter was long long.
Bug pointed out by Arne Henrik Juul.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.3.2.1 07-Feb-2000  he Pull up revision 1.4 (requested by kleink):
Implement *__errno() indirection.
 1.6.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.8.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 24-Aug-2003  ragge branches: 1.3.52;
execl, execle and execlp must be weak-aliased.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 01-Jul-2001  ragge branches: 1.1.2;
These are too simple to not have in assembler. Also shrunk the libs with
~1k of unneccessary code :-)
 1.1.2.4 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 01-Jul-2001  nathanw file execl.S was added on branch nathanw_sa on 2001-10-08 20:18:29 +0000
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.5 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.4 24-Aug-2003  ragge branches: 1.4.52;
execl, execle and execlp must be weak-aliased.
 1.3 24-Feb-2002  matt Change to use a register prefix.
 1.2 06-Sep-2001  chuck branches: 1.2.2;
change "pushl [r0](ap)" ---> "pushl (ap)[r0]" ... the old version
made a reference to an external symbol "r0" rather that used register r0.
 1.1 01-Jul-2001  ragge These are too simple to not have in assembler. Also shrunk the libs with
~1k of unneccessary code :-)
 1.2.2.4 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.2.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.2.2.1 06-Sep-2001  nathanw file execle.S was added on branch nathanw_sa on 2001-10-08 20:18:30 +0000
 1.4.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.4 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.3 24-Aug-2003  ragge branches: 1.3.52;
execl, execle and execlp must be weak-aliased.
 1.2 24-Feb-2002  matt Change to use a register prefix.
 1.1 01-Jul-2001  ragge branches: 1.1.2;
These are too simple to not have in assembler. Also shrunk the libs with
~1k of unneccessary code :-)
 1.1.2.4 22-Mar-2002  nathanw Catch up to -current.
 1.1.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.1.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.1 01-Jul-2001  nathanw file execlp.S was added on branch nathanw_sa on 2001-10-08 20:18:31 +0000
 1.3.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.7 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.6 25-Jan-2011  matt branches: 1.6.26; 1.6.30;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.5 07-Aug-2003  agc branches: 1.5.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 30-Jun-2000  matt Fix some bugs and clean up for ELF & a.out support
 1.3 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.2 04-Feb-1997  ragge ENTRY() takes two argument now, not one.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.5.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.6.30.1 21-Apr-2017  bouyer Sync with HEAD
 1.6.26.1 20-Mar-2017  pgoyette Sync with HEAD
 1.6 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.5 07-Aug-2003  agc branches: 1.5.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.3 24-Feb-2002  matt Change to use a register prefix.
 1.2 26-Jun-2000  kleink branches: 1.2.2;
Need an internal name for fork().
 1.1 17-Apr-1995  ragge branches: 1.1.20;
Added libc VAX specific files.
 1.1.20.1 22-Aug-2000  kleink Pull up rev. 1.2 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.5.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.6 21-Nov-2011  chs gcc 4.5 on vax creates PLT stubs with an entry mask of 0xffc
rather than 0 like gcc 4.1 did, so the sneaky assembly functions
that "ret" without really returning now clobber their registers.
adjust these functions to avoid this problem.
 1.5 25-Jan-2011  matt branches: 1.5.4;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.4 28-Apr-2008  martin branches: 1.4.8; 1.4.20;
Remove clause 3 and 4 from TNF licenses
 1.3 23-Jan-2003  matt branches: 1.3.30;
Add the *context.? sources to SRCS.
Make getcontext _getcontext and add a getcontext weak alias.
 1.2 20-Jan-2003  matt Use _ALIGN_TEXT.
Make sure R0 is 0 in the saved context.
 1.1 19-Jan-2003  matt Add getcontext(2) stub.
 1.3.30.1 18-May-2008  yamt sync with head.
 1.4.20.1 08-Feb-2011  bouyer 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 getcontext.S was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.5.4.1 17-Apr-2012  yamt sync with head
 1.2 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.5 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.4 07-Aug-2003  agc branches: 1.4.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.3 24-Feb-2002  matt Change to use a register prefix.
 1.2 28-Sep-2000  kleink branches: 1.2.2;
Need an internal name for pipe(2).
 1.1 17-Apr-1995  ragge branches: 1.1.20;
Added libc VAX specific files.
 1.1.20.1 29-Sep-2000  kleink Pull up rev. 1.2 (approved by thorpej):
Add internal name for pipe().
 1.2.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.2.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.4.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.8 25-Jan-2011  matt Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.7 07-Aug-2003  agc branches: 1.7.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 24-Feb-2002  matt Change to use a register prefix.
 1.5 30-Jun-2000  matt branches: 1.5.2;
Fix some bugs and clean up for ELF & a.out support
 1.4 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.3 05-Feb-2000  kleink Implement *__errno() indirection.
 1.2 04-Feb-1997  ragge branches: 1.2.4;
ENTRY() takes two argument now, not one.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2.4.1 07-Feb-2000  he Pull up revision 1.3 (requested by kleink):
Implement *__errno() indirection.
 1.5.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.7.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.2 11-Nov-1996  mycroft Treat reboot() like a normal system call. From PR 2458.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.13 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.12 18-Jul-2013  matt Make __curbrk & __minbrk hidden.
 1.11 25-Jan-2011  matt branches: 1.11.4; 1.11.10; 1.11.14;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.10 07-Aug-2003  agc branches: 1.10.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 24-Feb-2002  matt Change to use a register prefix.
 1.8 05-May-2001  kleink Shameless hack to reference end when using a.out and _end when using ELF.
 1.7 30-Jun-2000  matt branches: 1.7.2;
Fix some bugs and clean up for ELF & a.out support
 1.6 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.5 26-Jun-2000  kleink Thinko in previous: we do always use an internal name.
 1.4 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.3 14-Jan-1999  kleink branches: 1.3.10;
* On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.2 04-Feb-1997  ragge ENTRY() takes two argument now, not one.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.3.10.1 22-Aug-2000  kleink Pull up revs. 1.4-1.5 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.7.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.7.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.7.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.10.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.14.1 23-Jul-2013  riastradh sync with HEAD
 1.11.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.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.3 18-Jan-2003  thorpej These files are obsolete; setlogin() is now implemented in C with a
small syscall stub.
 1.2 28-Jun-2000  matt branches: 1.2.2;
Make these work with either a.out or ELF.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.2.2.1 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.1 07-Jul-2000  itohy Add special treatment of shmat(2).
On m68k ELF calling standard (__SVR4_ABI__), if a function
returns a pointer, the return value should go to a0 as well as d0.
 1.2 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.1 25-Aug-1999  thorpej Add __msgctl13(), __semctl13(), and __shmctl13() (symbols are __RENAME()'d
in their respective header files). Add PSEUDO stubs for the old versions
of these system calls.

Note that __semctl13() doesn't require the extra stub that the old
semctl()/__semctl() did, as the SUSv2 version takes variable arguments,
and thus does not require the extra indirection.
 1.3 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.2 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.1 30-Sep-1998  ragge New libc signal handling stuff.
 1.6 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 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 24-Feb-2002  matt Change to use a register prefix.
 1.3 02-Dec-1998  thorpej branches: 1.3.12;
Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.2 30-Sep-1998  ragge New libc signal handling stuff.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.3.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.3.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.9 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.8 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.7 24-Feb-2002  matt Change to use a register prefix.
 1.6 30-Jun-2000  matt branches: 1.6.2;
Fix some bugs and clean up for ELF & a.out support
 1.5 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.4 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 30-Sep-1998  ragge New libc signal handling stuff.
 1.2 04-Feb-1997  ragge ENTRY() takes two argument now, not one.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.6.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.9 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.8 26-Mar-2004  drochner the WARN_REFERENCES text "include <signal.h> for correct reference" is pointless
as <signal.h> won't help you, so remove it
 1.7 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.6 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.5 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.4 30-Sep-1998  ragge New libc signal handling stuff.
 1.3 04-Feb-1997  ragge ENTRY() takes two argument now, not one.
 1.2 30-Nov-1996  jtc PROF -> GPROF
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.9 18-Feb-2006  matt Seperate out the compat support for VAX. Also, make references to the
sigcontext sigtramp code weak so compat can be compiled out.
 1.8 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.7 24-Feb-2002  matt Change to use a register prefix.
 1.6 30-Jun-2000  matt branches: 1.6.2;
Fix some bugs and clean up for ELF & a.out support
 1.5 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.4 02-Dec-1998  thorpej Warn about references to the compatibility() sigaction(), sigpending(),
sigprocmask(), sigreturn(), and sigsuspend(), and direct the user to
include <signal.h> to generate the correct reference.
 1.3 30-Sep-1998  ragge New libc signal handling stuff.
 1.2 04-Feb-1997  ragge ENTRY() takes two argument now, not one.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.6.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.8 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.7 25-Jan-2011  matt branches: 1.7.44;
Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
 1.6 07-Aug-2003  agc branches: 1.6.52;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.5 24-Feb-2002  matt Change to use a register prefix.
 1.4 30-Jun-2000  matt branches: 1.4.2;
Fix some bugs and clean up for ELF & a.out support
 1.3 28-Jun-2000  matt Make these work with either a.out or ELF.
 1.2 04-Feb-1997  ragge ENTRY() takes two argument now, not one.
 1.1 17-Apr-1995  ragge Added libc VAX specific files.
 1.4.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.4.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.6.52.1 08-Feb-2011  bouyer Sync with HEAD
 1.7.44.1 21-Apr-2020  martin Sync with HEAD
 1.8 31-Oct-2021  thorpej Tidy up how __sigaction14_sigtramp.c is added to SRCS.
 1.7 12-Oct-2020  kamil Decorate the x86_64 signal trampoline with CFI attributes easing unwinding

Combine the approach provided by Nikhil Benesch and Andrew Cagney.

Now, the unwinders (in gccgo, backtrace(3), etc) can unwind properly
the stack from a signal handler.

Fixes lib/55719 by Nikhil Benesch
 1.6 15-Jul-2015  pooka 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.5 17-Jun-2006  uwe G/c KMSRCS and KMINCLUDES now that we have common/lib/libc
 1.4 25-Mar-2004  drochner kill sigcontext passing to signal handlers, we don't have to worry
about compatibility
 1.3 06-Oct-2003  fvdl Userland amd64 siginfo support.
 1.2 10-Jul-2002  thorpej Enable the libc-provided signal trampoline. The old __sigaction14
entry point has been replaced by the new __sigaction14() which is a
wrapper around the __sigaction_sigtramp system call (which is itself
not directly exposed outside of libc).

No shared library version change is necessary; no new symbols
are exposed outside of libc.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.12 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.11 18-Nov-2011  joerg branches: 1.11.6; 1.11.16;
Exploit hidden __cerror
 1.10 23-Nov-2007  dsl branches: 1.10.30;
Reorder the code for i386 and amd64 syscall stubs so that the 'jc' on error
is a forwards jump instead of a backwards jump that a P4 will mispredect (and
probably immediatly get a cache-line miss due to the way the code gets
aligned).
 1.9 08-Mar-2007  ad branches: 1.9.4;
Remove an obsolete comment.
 1.8 09-Mar-2004  drochner Really, there is no need to use the old int0x80 syscall entry just for
getcontext(). There are some registers not properly saved with the
new syscall entry, but these are calee-saved, scratch or meaningless.
It's the setcontext() return path what matters.
 1.7 18-Oct-2003  fvdl Use the int 0x80 path for context system calls.
 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 03-Jun-2002  fvdl Use the syscall insn for system calls. Fix up some assembly to
remove either previously made errors, or to account for the
fact that syscall clobbers %ecx.
 1.4 26-May-2002  wiz Revert previous: .S files are currently compiled with -traditional-cpp,
so __STDC__ is _not_ always defined.
 1.3 26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.2 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.9.4.1 09-Jan-2008  matt sync with HEAD
 1.10.30.1 17-Apr-2012  yamt sync with head
 1.11.16.1 10-Aug-2014  tls Rebase.
 1.11.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 12-Oct-2020  kamil Add CVS Id
 1.1 12-Oct-2020  kamil Decorate the x86_64 signal trampoline with CFI attributes easing unwinding

Combine the approach provided by Nikhil Benesch and Andrew Cagney.

Now, the unwinders (in gccgo, backtrace(3), etc) can unwind properly
the stack from a signal handler.

Fixes lib/55719 by Nikhil Benesch
 1.1 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.3 05-Jun-2011  christos Revert previous and make frach be 0xc0000000 for NAN's generated by strtold()
as suggested by tron.
 1.2 20-Mar-2011  christos branches: 1.2.2;
Add ld formats for the unit-tests.
 1.1 25-Jan-2006  kleink Add machine-dependent definitions for gdtoa.
 1.2.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.19 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.18 15-Jul-2015  pooka branches: 1.18.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.17 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.16 26-Mar-2011  christos add fpgetprec/fpsetprec
 1.15 14-Jan-2010  joerg Move AMD64's bswap64 implementation from libc to src/common and share it
with the kernel.
 1.14 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.13 03-Jul-2006  drochner build {frexp,ldexp,modf} in the "compat" subtree
(Drop the modf assembler version. We have the same code in libm.)
(Drop the ldexp inline-assembler version. The same code is in libm as
scalbn; the ldexp there is just a wrapper providing error handling.)
 1.12 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.11 04-Mar-2004  kleink branches: 1.11.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.10 15-Jan-2004  kleink Add C99 fpclassify(), isfinite(), isnormal(), and signbit() macros.
 1.9 28-Oct-2003  matt Fix tpyo. (ieee854 -> ieee754)
 1.8 25-Oct-2003  kleink Add __infinityf and __infinityl, float respectively long double analogs
of __infinity.
 1.7 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.6 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.5 17-May-2003  thorpej Build _isinfl() and _isnanl().
 1.4 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.3 30-Jan-2003  fvdl Add ucontext glue for x86_64.
 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 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.11.6.1 19-Apr-2005  tron Pull up revision 1.12 (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.18.16.1 10-Jun-2019  christos Sync with HEAD
 1.5 03-May-2025  riastradh libc/x86_64: Omit needless __PIC__ conditionals.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.4 04-Apr-2024  riastradh branches: 1.4.2;
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
 1.3 22-May-2014  uebayasi branches: 1.3.26; 1.3.34;
Put missing END() markers to set ELF symbol size.
 1.2 12-Sep-2013  joerg branches: 1.2.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.1 19-Jun-2001  fvdl branches: 1.1.58; 1.1.64;
Initial commit of x86-64 specific parts of libc.
 1.1.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.58.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.2.2.1 10-Aug-2014  tls Rebase.
 1.3.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.3.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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 03-May-2025  riastradh libc/x86_64: Omit needless __PIC__ conditionals.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.4 04-Apr-2024  riastradh branches: 1.4.2;
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
 1.3 22-May-2014  uebayasi branches: 1.3.26; 1.3.34;
Put missing END() markers to set ELF symbol size.
 1.2 12-Sep-2013  joerg branches: 1.2.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.1 19-Jun-2001  fvdl branches: 1.1.58; 1.1.64;
Initial commit of x86-64 specific parts of libc.
 1.1.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.58.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.2.2.1 10-Aug-2014  tls Rebase.
 1.3.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.3.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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.8 02-Apr-2023  skrll Trailing whitespace
 1.7 24-Feb-2011  joerg 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 02-Jul-2009  joerg branches: 1.6.2;
Fix stack alignment for the thread stack. The AMD64 stack has 16 Bytes
alignment, but this is active before the return address is pushed onto
the stack. Fixes random crashes in va_start when the SSE registers are
saved.
 1.5 01-Jul-2009  joerg Reduce diff to makecontext.
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 12-Jun-2005  lukem branches: 1.3.18;
Add missing __RCSID()
 1.2 07-Apr-2003  kleink Make sure we reference getcontext() by its internal name.
 1.1 30-Jan-2003  fvdl Add ucontext glue for x86_64.
 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 _lwp.c was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.6.2.1 05-Mar-2011  bouyer Sync with HEAD
 1.2 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.1 19-Jun-2001  fvdl branches: 1.1.64; 1.1.76;
Initial commit of x86-64 specific parts of libc.
 1.1.76.1 10-Aug-2014  tls Rebase.
 1.1.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.1 19-Jun-2001  fvdl branches: 1.1.64; 1.1.76;
Initial commit of x86-64 specific parts of libc.
 1.1.76.1 10-Aug-2014  tls Rebase.
 1.1.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 14-Jan-2010  joerg Move AMD64's bswap64 implementation from libc to src/common and share it
with the kernel.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.3 23-Mar-2004  drochner branches: 1.3.62; 1.3.74;
simplify: it doesn't need an i387 to kill a sign bit
 1.2 26-Feb-2004  drochner fix copyback from fp stack - we need 64 bits
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.74.1 10-Aug-2014  tls Rebase.
 1.3.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7 22-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;
PR/44293: Paul Goyette: Fix the mess of the rounding code.
 1.5 29-Sep-2011  christos even simpler.
 1.4 29-Sep-2011  christos add a simpler version.
 1.3 28-Sep-2011  christos Instead of using a PICGOT relocation for map, use just a pc-relative one
since it is guaranteed to be close enough. Fixes issue with binutils-2.21.1a
(probably a bug).
 1.2 06-Jun-2002  fvdl mov -> lea to access _map table.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 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.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 02-Feb-2007  christos branches: 1.3.10;
ext_int bit is no more.
 1.2 18-Jan-2004  matt branches: 1.2.16;
Make this compile.
 1.1 28-Oct-2003  kleink 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.2.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.10.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 fpclassifyl.c was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.4 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.3 12-Jun-2002  fvdl branches: 1.3.62; 1.3.74;
Attempt to juggle the 2 seperarate status/mask bit sets for plain FP
and XMM to provide a consistent interface.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.74.1 10-Aug-2014  tls Rebase.
 1.3.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 22-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.5 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.4 30-Sep-2011  christos branches: 1.4.8; 1.4.18;
PR/44293: Paul Goyette: Fix the mess of the rounding code.
 1.3 12-Jun-2002  fvdl Attempt to juggle the 2 seperarate status/mask bit sets for plain FP
and XMM to provide a consistent interface.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4.18.1 10-Aug-2014  tls Rebase.
 1.4.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.3 12-Jun-2002  fvdl branches: 1.3.62; 1.3.74;
Attempt to juggle the 2 seperarate status/mask bit sets for plain FP
and XMM to provide a consistent interface.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.74.1 10-Aug-2014  tls Rebase.
 1.3.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.5 19-Jan-2012  drochner branches: 1.5.6; 1.5.16;
let one bit more through to SSE, to make FP_X_IMP work
 1.4 19-Oct-2011  njoly branches: 1.4.2;
Fix fpsetmask(3) to be able to clear bits previously set.
 1.3 12-Jun-2002  fvdl Attempt to juggle the 2 seperarate status/mask bit sets for plain FP
and XMM to provide a consistent interface.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4.2.1 17-Apr-2012  yamt sync with head
 1.5.16.1 10-Aug-2014  tls Rebase.
 1.5.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 22-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.5 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.4 30-Sep-2011  christos branches: 1.4.8; 1.4.18;
PR/44293: Paul Goyette: Fix the mess of the rounding code.
 1.3 12-Jun-2002  fvdl Attempt to juggle the 2 seperarate status/mask bit sets for plain FP
and XMM to provide a consistent interface.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4.18.1 10-Aug-2014  tls Rebase.
 1.4.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.5 09-Mar-2004  drochner branches: 1.5.62; 1.5.74;
we also have to reset bits in the i387 status
as required
 1.4 05-Mar-2004  drochner -clear status bits in mxcsr as required
-return the old accumulated status bits
 1.3 12-Jun-2002  fvdl Attempt to juggle the 2 seperarate status/mask bit sets for plain FP
and XMM to provide a consistent interface.
 1.2 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 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.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 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 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 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 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 10-Apr-2011  christos branches: 1.3.2;
make infinityl match what gdtoa thinks.
 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:59 +0000
 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 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.6 02-Feb-2007  christos ext_int bit is no more.
 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 Sync with i386:
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.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 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 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;
ext_int bit is no more.
 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 Sync with i386:
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.3 03-Jul-2006  drochner replaced by code in libc/compat/gen
 1.2 30-Dec-2001  thorpej Fix -Wshadow warnings.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 30-Jul-2009  dsl If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 28-Feb-2004  drochner branches: 1.2.30;
Get the stack alignment right: the stack arguments must start
at a 16-byte aligned address, the return address is at an
"odd" address.
approved by fvdl
 1.1 30-Jan-2003  fvdl Add ucontext glue for x86_64.
 1.2.30.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 makecontext.c was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.4 03-Jul-2006  drochner build {frexp,ldexp,modf} in the "compat" subtree
(Drop the modf assembler version. We have the same code in libm.)
(Drop the ldexp inline-assembler version. The same code is in libm as
scalbn; the ldexp there is just a wrapper providing error handling.)
 1.3 16-Aug-2003  fvdl Return the right value for modf(). Fixes PR 22503.
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 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 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 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:51 +0000
 1.7 03-May-2025  riastradh libc/x86_64: Omit needless __PIC__ conditionals.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.6 22-May-2014  uebayasi branches: 1.6.36;
Put missing END() markers to set ELF symbol size.
 1.5 12-Sep-2013  joerg branches: 1.5.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.4 28-Apr-2008  martin branches: 1.4.4; 1.4.8; 1.4.28;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Nov-2006  drochner branches: 1.3.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.2 27-Feb-2004  drochner alignment trouble: uc_link is at offset 8
 1.1 30-Jan-2003  fvdl Add ucontext glue for x86_64.
 1.3.16.1 18-May-2008  yamt sync with head.
 1.4.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 resumecontext.S was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.4.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.5.2.1 10-Aug-2014  tls Rebase.
 1.6.36.1 02-Aug-2025  perseant Sync with HEAD
 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:59 +0000
 1.7 03-May-2025  riastradh libc/x86_64: Omit needless __PIC__ conditionals.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.6 22-May-2014  uebayasi branches: 1.6.36;
Put missing END() markers to set ELF symbol size.
 1.5 12-Sep-2013  joerg branches: 1.5.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.4 12-Apr-2007  pooka branches: 1.4.36; 1.4.42;
Don't clobber callee save registers r12 & r13 in swapcontext. They
were saved in the stack, but the subsequent swapcontext would return
to the earlier stack frame and never restore them. Fixes puffs
with default compiler flags on amd64.

Thanks to Mihai Chelaru for providing access to an amd64 machine
for debugging this problem.
 1.3 01-Dec-2004  ws branches: 1.3.2; 1.3.10;
Use correct stack offsets after pushing values onto it.
 1.2 07-Apr-2003  kleink branches: 1.2.2; 1.2.4;
Make sure we reference getcontext() by its internal name.
 1.1 30-Jan-2003  fvdl Add ucontext glue for x86_64.
 1.2.4.1 07-Jan-2005  jdc Pull up revision 1.3 (requested by hira in ticket #1029).

Use correct stack offsets after pushing values onto it.
 1.2.2.1 07-Jan-2005  jdc Pull up revision 1.3 (requested by hira in ticket #1029).

Use correct stack offsets after pushing values onto it.
 1.3.10.1 07-May-2007  snj Pull up following revision(s) (requested by pooka in ticket #605):
lib/libc/arch/x86_64/gen/swapcontext.S: revision 1.4
Don't clobber callee save registers r12 & r13 in swapcontext. They
were saved in the stack, but the subsequent swapcontext would return
to the earlier stack frame and never restore them. Fixes puffs
with default compiler flags on amd64.
Thanks to Mihai Chelaru for providing access to an amd64 machine
for debugging this problem.
 1.3.2.1 27-May-2007  bouyer Pull up following revision(s) (requested by pooka in ticket #1772):
lib/libc/arch/x86_64/gen/swapcontext.S: revision 1.4
Don't clobber callee save registers r12 & r13 in swapcontext. They
were saved in the stack, but the subsequent swapcontext would return
to the earlier stack frame and never restore them. Fixes puffs
with default compiler flags on amd64.
Thanks to Mihai Chelaru for providing access to an amd64 machine
for debugging this problem.
 1.4.42.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.36.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.5.2.1 10-Aug-2014  tls Rebase.
 1.6.36.1 02-Aug-2025  perseant Sync with HEAD
 1.3 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.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.6 11-Aug-2009  dsl Change NO_SRCS lines to specify .S in order to exclude the .c file from
SRCS but add it to LSRCS (sort of makes sense!).
 1.5 31-Jul-2009  dsl Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc.
Change the arch files only include the .S files.
This adds imaxdiv() to some archs where it was missing.
 1.4 04-Aug-2008  matt branches: 1.4.6;
Add C99 functions imaxabs and imaxdiv.
 1.3 22-Mar-2006  drochner branches: 1.3.20;
build erand48_ieee754.c on everything but vax
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.6.2 04-Aug-2008  matt Add C99 functions imaxabs and imaxdiv.
 1.4.6.1 04-Aug-2008  matt file Makefile.inc was added on branch christos-time_t on 2008-08-04 21:29:30 +0000
 1.3 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.2 07-Aug-2003  agc branches: 1.2.62; 1.2.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2.74.1 10-Aug-2014  tls Rebase.
 1.2.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.1 19-Jun-2001  fvdl branches: 1.1.64; 1.1.76;
Initial commit of x86-64 specific parts of libc.
 1.1.76.1 10-Aug-2014  tls Rebase.
 1.1.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.2 04-Aug-2008  matt branches: 1.2.6; 1.2.26; 1.2.38;
Use WEAK_ALIAS.
Add imaxabs weak alias.
 1.1 19-Jun-2001  fvdl branches: 1.1.34;
Initial commit of x86-64 specific parts of libc.
 1.1.34.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.38.1 10-Aug-2014  tls Rebase.
 1.2.26.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.2 04-Aug-2008  matt Use WEAK_ALIAS.
Add imaxabs weak alias.
 1.2.6.1 04-Aug-2008  matt file labs.S was added on branch christos-time_t on 2008-08-04 20:21:27 +0000
 1.3 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.2 04-Aug-2008  matt branches: 1.2.6; 1.2.26; 1.2.38;
Use WEAK_ALIAS
 1.1 19-Jun-2001  fvdl branches: 1.1.34;
Initial commit of x86-64 specific parts of libc.
 1.1.34.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.38.1 10-Aug-2014  tls Rebase.
 1.2.26.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.2 04-Aug-2008  matt Use WEAK_ALIAS
 1.2.6.1 04-Aug-2008  matt file ldiv.S was added on branch christos-time_t on 2008-08-04 20:26:39 +0000
 1.7 27-Jan-2020  ad Make x86 use the C versions of bcmp() and memcmp().
 1.6 24-Nov-2013  christos branches: 1.6.26;
No need for bzero, memset provides it.
 1.5 23-Nov-2013  jakllsch Remove now-non-existant bzero.S from sources list.
 1.4 30-Jul-2009  dsl branches: 1.4.6; 1.4.12;
If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.3 17-Jul-2009  dsl Change all archs so that strchr.[cS] and strrchr.[cS] exist and generate
duplicate symbols for index() and rindex().
libc and kernel build ok for affected archs (i386, amd64, vax, sun3,
evbmips-eb) all seem ok.
(vax might lose an asm index() - but comments imply it is worse than the C)
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.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.6.26.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 02-Aug-2005  rpaulo Fix typos found by Giorgos Keramid and Steve Kargl on freebsd-arch mailing
list.
 1.3 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 26-Feb-2004  drochner the char we fill with shouldn't be sign-extended
(the way the length argument is dealt with looks suspicious
too, but this would only have an effect for >=2G fields)
this can probably be optimized...
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 26-Jul-2004  drochner fix alignment check for source
should fix PR port-amd64/26416 by Nicolas Joly
 1.3 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 02-Aug-2005  rpaulo Fix typos found by Giorgos Keramid and Steve Kargl on freebsd-arch mailing
list.
 1.3 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.3 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.5 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.4 02-Aug-2005  rpaulo Fix typos found by Giorgos Keramid and Steve Kargl on freebsd-arch mailing
list.
 1.3 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.3 03-Aug-2005  rpaulo branches: 1.3.50; 1.3.62;
Fix another typo in comments found by Ricardo Nabinger Sanchez
on the freebsd-arch mailing list.
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.62.1 10-Aug-2014  tls Rebase.
 1.3.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.2 19-Jul-2004  drochner replace the str*() functions by speed optimized versions, submitted by
J.T. Conklin per PR port-amd64/25411
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.3 02-Aug-2005  rpaulo branches: 1.3.50; 1.3.62;
Fix typos found by Giorgos Keramid and Steve Kargl on freebsd-arch mailing
list.
 1.2 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.62.1 10-Aug-2014  tls Rebase.
 1.3.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 11-Mar-2006  christos remove files moved to the new compat layout.
 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 03-Jun-2002  fvdl Use the syscall insn for system calls. Fix up some assembly to
remove either previously made errors, or to account for the
fact that syscall clobbers %ecx.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.6 03-May-2025  riastradh libc/x86_64: Omit needless __PIC__ conditionals.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.5 22-May-2014  uebayasi branches: 1.5.36;
Put missing END() markers to set ELF symbol size.
 1.4 12-Sep-2013  joerg branches: 1.4.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.3 18-Nov-2011  joerg branches: 1.3.6;
Exploit hidden __cerror
 1.2 06-Jun-2002  fvdl branches: 1.2.56;
Fix the EINVAL return path.
 1.1 03-Jun-2002  fvdl Add clone(2) implementation.
 1.2.56.2 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.2.56.1 17-Apr-2012  yamt sync with head
 1.3.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.2.1 10-Aug-2014  tls Rebase.
 1.5.36.1 02-Aug-2025  perseant Sync with HEAD
 1.2 11-Mar-2006  christos remove files moved to the new compat layout.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.12 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.11 14-May-2014  uebayasi Whitespace.
 1.10 28-Apr-2008  martin branches: 1.10.8; 1.10.28; 1.10.40;
Remove clause 3 and 4 from TNF licenses
 1.9 19-Feb-2006  christos branches: 1.9.18;
make these consistent.
 1.8 12-Jun-2005  lukem Add missing __RCSID()
 1.7 25-Mar-2004  drochner kill sigcontext passing to signal handlers, we don't have to worry
about compatibility
 1.6 23-Mar-2004  drochner save errno while trying to install a !SA_SIGINFO trampoline -- this
is expected to fail with !COMPAT_16 kernels, and we shouldn't
overwrite errno in this case
 1.5 18-Oct-2003  briggs Need a couple more headers for the last change.
 1.4 18-Oct-2003  briggs Sync with the i386 version.
 1.3 06-Oct-2003  fvdl Userland amd64 siginfo support.
 1.2 30-Jan-2003  fvdl Add ucontext glue for x86_64.
 1.1 09-Jul-2002  thorpej New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.9.18.1 18-May-2008  yamt sync with head.
 1.10.40.1 10-Aug-2014  tls Rebase.
 1.10.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10.8.1 28-Apr-2008  martin file __sigaction14_sigtramp.c was added on branch christos-time_t on 2008-04-28 20:22:59 +0000
 1.4 11-Mar-2006  christos remove files moved to the new compat layout.
 1.3 26-Mar-2004  drochner disembowel -- there is no kernel support anyway
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.5 25-Mar-2004  drochner kill sigcontext passing to signal handlers, we don't have to worry
about compatibility
 1.4 15-Mar-2003  fvdl No need to use movq for the small immediate values here, they'll be
zero-extended with movl.
 1.3 13-Dec-2002  fvdl The fast syscall path clobbers 2 registers. Which is fine for a plain
system call, as long as the stub knows about it. However, it's bad
for sigreturn. Hence, use the old entry point for sigreturn. XXX
 1.2 14-Jul-2002  fvdl Remove fs and gs kludge.
 1.1 09-Jul-2002  thorpej New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.
 1.9 19-Oct-2020  kamil Restore RSP from mcontext

Fixes unwinding of multiple frames without base pointer.

Patch by: Nikhil Benesch via PR lib/55719
 1.8 12-Oct-2020  kamil Decorate the x86_64 signal trampoline with CFI attributes easing unwinding

Combine the approach provided by Nikhil Benesch and Andrew Cagney.

Now, the unwinders (in gccgo, backtrace(3), etc) can unwind properly
the stack from a signal handler.

Fixes lib/55719 by Nikhil Benesch
 1.7 02-Dec-2019  christos Add cfi annotations so that gdb can unwind the stack through signal handlers.
 1.6 22-May-2014  uebayasi branches: 1.6.24;
Put missing END() markers to set ELF symbol size.
 1.5 08-Nov-2006  drochner branches: 1.5.48; 1.5.60;
if setcontext(2) returns, _exit(2) with a return code of -1 instead
of relying on a sensible return value
 1.4 23-Mar-2004  drochner replace the last occurence of an "int 0x80" syscall
 1.3 18-Oct-2003  fvdl Use the int 0x80 path for context system calls.
 1.2 17-Oct-2003  fvdl Get ucontext pointer back out of callee-saved register %r15.
 1.1 06-Oct-2003  fvdl Userland amd64 siginfo support.
 1.5.60.1 10-Aug-2014  tls Rebase.
 1.5.48.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.24.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.5 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.4 18-Nov-2011  joerg branches: 1.4.6; 1.4.16;
Exploit hidden __cerror
 1.3 07-Aug-2003  agc branches: 1.3.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 03-Jun-2002  fvdl Use the syscall insn for system calls. Fix up some assembly to
remove either previously made errors, or to account for the
fact that syscall clobbers %ecx.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.56.1 17-Apr-2012  yamt sync with head
 1.4.16.1 10-Aug-2014  tls Rebase.
 1.4.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.5 12-Sep-2013  joerg branches: 1.5.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.4 18-Nov-2011  joerg branches: 1.4.6;
Exploit hidden __cerror
 1.3 07-Aug-2003  agc branches: 1.3.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 03-Jun-2002  fvdl Use the syscall insn for system calls. Fix up some assembly to
remove either previously made errors, or to account for the
fact that syscall clobbers %ecx.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.56.2 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.3.56.1 17-Apr-2012  yamt sync with head
 1.4.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 10-Aug-2014  tls Rebase.
 1.8 03-May-2025  riastradh libc/x86_64: Omit needless __PIC__ conditionals.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.7 22-May-2014  uebayasi branches: 1.7.36;
Put missing END() markers to set ELF symbol size.
 1.6 12-Sep-2013  joerg branches: 1.6.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.5 27-Feb-2012  joerg branches: 1.5.2;
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
 1.4 18-Nov-2011  joerg branches: 1.4.2;
Explicitly mark __cerror as hidden
 1.3 07-Aug-2003  agc branches: 1.3.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 03-Jun-2002  fvdl Use the syscall insn for system calls. Fix up some assembly to
remove either previously made errors, or to account for the
fact that syscall clobbers %ecx.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.56.2 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.3.56.1 17-Apr-2012  yamt sync with head
 1.4.2.1 27-Feb-2012  riz Pull up following revision(s) (requested by joerg in ticket #57):
lib/libc/arch/arm/sys/cerror.S: revision 1.8
lib/libc/arch/vax/SYS.h: revision 1.12
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.3
lib/libc/arch/powerpc64/sys/cerror.S: revision 1.4
lib/libc/arch/i386/sys/cerror.S: revision 1.16
lib/libc/arch/x86_64/sys/cerror.S: revision 1.5
lib/libc/arch/powerpc/sys/cerror.S: revision 1.10
lib/libc/arch/mips/sys/cerror.S: revision 1.17
lib/libc/arch/powerpc/sys/cerror.S: revision 1.9
Make __cerror protected to restore ABI leak in older libc versions,
where e.g. librt referenced the copy from libc. This still allows libc
to use PC-relative jumps.
PowerPC doesn't have CERROR since it never had a.out.
Use _C_LABEL(__cerror) instead.
 1.5.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.2.1 10-Aug-2014  tls Rebase.
 1.7.36.1 02-Aug-2025  perseant Sync with HEAD
 1.5 07-Feb-2017  kamil Mark exect(3) obsolete and bind it to plain execve(2) on all platforms

The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
- exect(2) traces (single-steps) libc and it requires hundreds or
thousands steps before entering a new image
- it's vax and x86 specific code
- this functionality has been moved to the kernel - once a process is
traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
its debugger
- the side effects and unportability make this interface unusable
- there are no known users of this interface
- it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
 1.4 22-May-2014  uebayasi branches: 1.4.6; 1.4.10;
Put missing END() markers to set ELF symbol size.
 1.3 18-Nov-2011  joerg branches: 1.3.6; 1.3.16;
Exploit hidden __cerror
 1.2 07-Aug-2003  agc branches: 1.2.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2.56.1 17-Apr-2012  yamt sync with head
 1.3.16.1 10-Aug-2014  tls Rebase.
 1.3.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.10.1 21-Apr-2017  bouyer Sync with HEAD
 1.4.6.1 20-Mar-2017  pgoyette Sync with HEAD
 1.4 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.3 07-Aug-2003  agc branches: 1.3.62; 1.3.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.74.1 10-Aug-2014  tls Rebase.
 1.3.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.3 09-Mar-2004  drochner branches: 1.3.62; 1.3.74;
Really, there is no need to use the old int0x80 syscall entry just for
getcontext(). There are some registers not properly saved with the
new syscall entry, but these are calee-saved, scratch or meaningless.
It's the setcontext() return path what matters.
 1.2 18-Oct-2003  fvdl Use the int 0x80 path for context system calls.
 1.1 30-Jan-2003  fvdl Add ucontext glue for x86_64.
 1.3.74.1 10-Aug-2014  tls Rebase.
 1.3.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 11-Mar-2006  christos remove files moved to the new compat layout.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.2 07-Aug-2003  agc branches: 1.2.62; 1.2.74;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2.74.1 10-Aug-2014  tls Rebase.
 1.2.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8 03-May-2025  riastradh libc/x86_64: Omit needless __PIC__ conditionals.

PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.7 19-Mar-2016  christos branches: 1.7.28;
Save and restore all the registers we need instead of playing tricks and
"knowing" which registers the compiler clobbers. gcc-5.3 clobbers both
rcx and rdx...
 1.6 24-Nov-2014  christos Fix ptrace %rcx corruption when pthread_errno() is used. Small example:
#include <sys/types.h>
#include <stdio.h>
#include <sys/ptrace.h>
int main(void) { ptrace(18, getpid(), NULL, 0xabcd); }
The -lpthread cases pases 0 instead of 0xabcd
 1.5 22-May-2014  uebayasi branches: 1.5.2;
Put missing END() markers to set ELF symbol size.
 1.4 12-Sep-2013  joerg branches: 1.4.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.3 18-Nov-2011  joerg branches: 1.3.6;
Exploit hidden __cerror
 1.2 07-Aug-2003  agc branches: 1.2.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2.56.2 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.2.56.1 17-Apr-2012  yamt sync with head
 1.3.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.2.1 10-Aug-2014  tls Rebase.
 1.5.2.1 25-Nov-2014  martin Pull up following revision(s) (requested by christos in ticket #263):
lib/libc/arch/x86_64/sys/ptrace.S: revision 1.6
Fix ptrace %rcx corruption when pthread_errno() is used. Small example:
#include <sys/types.h>
#include <stdio.h>
#include <sys/ptrace.h>
int main(void) { ptrace(18, getpid(), NULL, 0xabcd); }
The -lpthread cases pases 0 instead of 0xabcd
 1.7.28.1 02-Aug-2025  perseant Sync with HEAD
 1.6 22-May-2014  uebayasi Put missing END() markers to set ELF symbol size.
 1.5 12-Sep-2013  joerg branches: 1.5.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.4 18-Nov-2011  joerg branches: 1.4.6;
Exploit hidden __cerror
 1.3 02-Jul-2008  rmind branches: 1.3.2; 1.3.6;
Avoid calling a syscall when argument to sbrk(2) is zero.
OK by <ad>.
 1.2 07-Aug-2003  agc branches: 1.2.32;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2.32.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.6.2 02-Jul-2008  rmind Avoid calling a syscall when argument to sbrk(2) is zero.
OK by <ad>.
 1.3.6.1 02-Jul-2008  rmind file sbrk.S was added on branch christos-time_t on 2008-07-02 20:07:44 +0000
 1.3.2.2 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.3.2.1 17-Apr-2012  yamt sync with head
 1.4.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 10-Aug-2014  tls Rebase.
 1.2 18-Jan-2003  thorpej These files are obsolete; setlogin() is now implemented in C with a
small syscall stub.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2 11-Mar-2006  christos remove files moved to the new compat layout.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.2 11-Mar-2006  christos remove files moved to the new compat layout.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 11-Mar-2006  christos remove files moved to the new compat layout.
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 11-Mar-2006  christos remove files moved to the new compat layout.
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.4 11-Mar-2006  christos remove files moved to the new compat layout.
 1.3 26-Mar-2004  drochner disembowel -- there is no kernel support anyway
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3 11-Mar-2006  christos remove files moved to the new compat layout.
 1.2 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.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.5 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.4 05-Nov-2007  dsl branches: 1.4.72;
syscall() has to be implemented in the kernel - so is a normal system call here.This has always been broken, so I suspect everything is using __syscall().
 1.3 07-Aug-2003  agc branches: 1.3.22;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.2 03-Jun-2002  fvdl Use the syscall insn for system calls. Fix up some assembly to
remove either previously made errors, or to account for the
fact that syscall clobbers %ecx.
 1.1 19-Jun-2001  fvdl Initial commit of x86-64 specific parts of libc.
 1.3.22.1 06-Nov-2007  matt sync with HEAD
 1.4.72.1 21-Apr-2020  martin Sync with HEAD

RSS XML Feed