Home | History | Annotate | only in /src/sys/lib/libkern
History log of /src/sys/lib/libkern
RevisionDateAuthorComments
 1.101 05-Jun-2018  christos Use the standard build rules.
 1.100 22-Mar-2016  mrg branches: 1.100.16;
remove a bunch of "@echo done" from the tail of rules. these messages
were vaguely useful back when we didn't run make -j, but now you end
up with a single line "done" every so often, with no idea what it is
for. very few other targets claim they're done so just remove these.
 1.99 07-Sep-2015  uebayasi Order library object build.
 1.98 07-Sep-2015  uebayasi Sprinkle more done messages.
 1.97 09-Feb-2014  njoly branches: 1.97.6;
Revert previous revision. It bkeaks profiling kernel builds.
LIBISPRIVATE unconditionnally set MKPROFILE to no, preventing
profiling kernel library.
 1.96 21-Aug-2013  matt Simplify by using LIBISPRIVATE?= yes
 1.95 18-Jan-2009  he branches: 1.95.24; 1.95.28;
Change the use of formally undocumented features, which have now been
made to fail. Specifically, change
.ifdef(SYMBOL) -> .ifdef SYMBOL or .if defined(SYMBOL),
and corresponding for .ifndef.

Also correct one error in lib/libm/Makefile (.ifdef (${MKCOMPLEX} != "no")?!?).
 1.94 04-Jan-2009  pooka Split variables out of Makefile into Makefile.libkern so that we
can easily just .include it for the proper SRCS etc. definitions
in case we're interested in the files but not in building an actual
libkern.{a,o}. for librump
 1.93 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.92 20-Nov-2008  matt Add new ptree (Patricia / RADIX tree) implementation to NetBSD.
 1.91 16-Nov-2008  ad Our qsort() is inappropriate for kernel use because it makes recursive
calls. Replace it with a kheapsort() function in kernel. Pointed out
by tron@.
 1.90 16-Nov-2008  ad Make qsort() available in libkern.
 1.89 30-Jun-2008  matt branches: 1.89.2; 1.89.4; 1.89.6; 1.89.10;
Move rb.c from sys/lib/libkern to common so it can be in both libc and libkern.
 1.88 15-Jun-2008  christos Include cpuset.
 1.87 31-Jan-2008  matt branches: 1.87.6; 1.87.8; 1.87.10; 1.87.12; 1.87.14;
Add Mersenne Twister prototypes and state struct to libkern.h
Cleanup a comment. s/RLEN/MTPRNG_RLEN/g s/POS1/MTPRNG_POS1/g
Remove unneeded test code.
 1.86 22-Nov-2007  plunky remove insque/remque from libkern, they are no longer used
 1.85 20-Nov-2007  yamt build rb.c.
 1.84 13-Nov-2006  dyoung branches: 1.84.22; 1.84.24; 1.84.28; 1.84.30;
Add strsep(3) to libkern.

To avoid code duplication, move strsep.c to the kernel/userland
common files.

Soon I will commit source-address selection (options IPSELSRC).
It will use strsep(3).
 1.83 27-Oct-2006  christos Merge kernel and userland rmd160 and sha2 implementation.
XXX: We still install rmd160.h and sha2.h in /usr/include/crypto, unlike
the other hash functions which get installed in /usr/include for compatibility.
 1.82 08-Oct-2006  thorpej - Move strtoll.c and strtoull.c from libc/stdlib to common/libc/stdlib.
- Add strtoll.c and strtoull.c to libkern.
 1.81 28-Aug-2006  tsutsui branches: 1.81.2; 1.81.4;
Add src/common/include to include header search path so that
standalone programs can be built without installed ${DESTDIR} tree.
Okayed by christos, and should close PR 33431.
 1.80 27-Apr-2006  thorpej Support for building proplib in the kernel.
 1.79 22-Apr-2006  thorpej Move strtoumax.c from libc/stdlib to common/libc/stdlib and include it
in libkern. Required for new code coming soon.
 1.78 11-Mar-2006  kleink branches: 1.78.2;
Provide BCD<->binary conversion in libkern and turn <dev/clock_subr.h>'s
FROMBCD()/TOBCD() macros into wrappers around it, resulting in both
smaller code footprint and elimination of possible issues due to
multiple evaluation of macro arguments.

Suggested by Simon Burge and Anders Gavare on tech-kern.
 1.77 20-Dec-2005  christos branches: 1.77.4; 1.77.6; 1.77.8; 1.77.10;
Use common sources with userland.
 1.76 11-Dec-2005  christos merge ktrace-lwp.
 1.75 02-Oct-2005  chs put mcount.c in the normal object list, so that "make depend" works.
use a gcc attribute to prevent it from being instrumented.
 1.74 25-Aug-2005  uebayasi Redo previous; don't add mcount.po to POBJS when MKPROFILE=no.
 1.73 25-Aug-2005  uebayasi Create mcount.po only when MKPROFILE != no.
 1.72 26-Feb-2005  perry branches: 1.72.4;
nuke trailing whitespace
 1.71 07-Jul-2003  dsl branches: 1.71.8; 1.71.10;
Add xlat_mbr_fstype - converts mbr type to disklabel type
 1.70 15-May-2003  itojun branches: 1.70.2;
add strl{cpy,cat} to libkern. code from lib/libc/string (originally from openbsd).
 1.69 23-Nov-2002  fvdl If LIBKERN_ARCH is defined, use that as the architecture-specific
subdirectory. Needed for the x86_64 32bit compile case.
 1.68 02-Nov-2002  perry set LLIBS= so we don't try to check the lint lib against llib-lc.ln
 1.67 04-Oct-2002  junyoung Unconditionally add strstr.c. Bill Studenmund.
 1.66 04-Oct-2002  junyoung Add strstr() to libkern. For now, it's only used in i386 (for processor
identification).
 1.65 18-Jun-2002  wrstuden Updated version of cscope/mkid support. Check libkern and compat lib
for source files. Also include header files in mkid run.
 1.64 28-May-2002  itojun have arc4random(9).
 1.63 12-Dec-2001  tv branches: 1.63.8; 1.63.10;
MKfoo=no -> NOfoo
 1.62 14-Nov-2001  tv Undefine DESTDIR; we don't want the special DESTDIR <bsd.lib.mk>
handling for kernel libraries.

XXX this build method should be replaced by something more sane
 1.61 12-Aug-2001  jdolecek Move _insque()/_remque() to libkern. Once remaining uses would
be converted to <sys/queue.h> macros, _insque()/_remque() would be eliminated
altogether.
 1.60 18-Feb-2001  enami branches: 1.60.2; 1.60.4;
Don't set ARCHSUBDIR to empty string.
 1.59 16-Feb-2001  bjh21 Use MACHINE_CPU to find the architecture subdir, or MACHINE_ARCH if that
exists. Same algorithm as libc uses.
 1.58 15-Feb-2001  simonb Use arm arch directory for arm32 as well as arm26.
 1.57 04-Jan-2001  itojun prepare for sh3e[bl] split
 1.56 29-Dec-2000  bjh21 Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.55 08-Dec-2000  deberg add md4c.c
 1.54 02-Mar-2000  itojun make CMSG_ALIGN always synchronize with kernel's idea of ALIGNBYTES.
ancillary data alignment will be ALIGNBYTES, not sizeof(long) - 1, from now.

CMSG_xx will NOT resolve into constant. if you use CMSG_xx to allocate
arrays, you'll lose.

bump shlib minor for libc.

NOTE: if you are on top of arch with ALIGNBYTES != sizeof(long) - 1,
you need to recompile IPv6-related binaries. there is no way to guarantee
backward compat in this aspect. sorry for this. this should be the last
backward compat breakage for IPv6-related ancillary data manipulation.
(we still have PR 9516 for unix-domain sockets...)
 1.53 07-May-1999  drochner branches: 1.53.2;
move intoa() from libsa:net.c to libkern, turn inet_ntoa() into a macro,
nuke ip_convertaddr()
 1.52 07-May-1999  drochner Build libraries for kernel/standalone code from within their compilation
directories and use .PATH to lookup the source files.
(Formerly, the libs were built from the source dirs, with MAKEOBJDIR
set to the compilation directory.)
This solves 2 problems:
-"mkdep" and "make" are now consistent about the file lookup, this fixes
bad interactions with amd reported in PR bin/7374 (Arne Juul) and
lossage reported by Andrew Gillham ("obj" dirs and relative paths still
don't work well together)
-kernel compile trees can be moved around without forcing a new
"make depend" - fixing PR kern/4021 by Martin Husemann
 1.51 11-Apr-1999  gwr Add inet_addr.c (for nfs_bootparam.c)
 1.50 04-Mar-1999  drochner branches: 1.50.4;
make the mipse[lb]->mips translation really work
(the S/// doesn't work as I'm now telling the 3rd time),
put the translation onto a separate line to make it more understandable
 1.49 03-Mar-1999  jonathan Makefile ${MACHINE_ARCH} changes for mips{eb,el}, as suggested by
Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
 1.48 24-Feb-1999  chs no need to add ${OBJS} to POBJS here, bsd.lib.mk does it automatically.
 1.47 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.46 04-Aug-1998  perry branches: 1.46.2;
replace several special targets with stub .c files, as in libc/string
 1.45 03-Aug-1998  perry fix silly comment typo
 1.44 31-Jul-1998  perry make libkern build memmove() properly
 1.43 19-Jul-1998  drochner branches: 1.43.2;
Make the combination "profiled kernel" and "${KERN_AS} == "library""
work too. (mcount.po was forgotten)
 1.42 21-Jun-1998  christos Add a small string pattern matching function to facilitate pcmcia cis string
matches.
 1.41 27-May-1998  explorer add sha1.c, and build it.
 1.40 22-Feb-1998  mycroft Build memcpy() out of bcopy() by default.
 1.39 23-Jan-1998  cgd update to match (now-fixed) libc rules for strchr and strrchr.
Brokenness pointed out by Matthias Drochner.
 1.38 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.37 04-Nov-1997  gwr Use LORDER, TSORT
 1.36 31-May-1997  cjs branches: 1.36.8;
Back out BUILDDIR and NOINSTALL changes.
 1.35 30-May-1997  cjs Use new NOINSTALL option for libraries that are used only during the build
of a program, and not installed into the final system.
 1.34 07-May-1997  mycroft Use libinstall::, not install:, to prevent instaling LIB.
 1.33 30-Apr-1997  thorpej Build md5c.c
 1.32 16-Feb-1997  cgd allow includers to specify library-specific CPP flags via ${LIB}MISCCPPFLAGS
 1.31 10-Aug-1996  mycroft branches: 1.31.6;
Add anchors so that only exactly `-I. is modified.
 1.30 10-Aug-1996  mycroft Convert the -I. to -I${.OBJDIR}, so that the `machine symlink is available.
 1.29 08-Aug-1996  mycroft We dont need to pass down COMPATDIR and KERNDIR.
 1.28 08-Aug-1996  mycroft Run the child make in the source directory, so that nothing here needs to be
changed when the compile directory is outside the source tree.
 1.27 10-May-1996  scottr Make sure we clean up libkern.o and libkern.po, too. Closes PRs 1951
and 2387.
 1.26 18-Apr-1996  cgd don't get rid of the -D_KERNEL in KERNCPPFLAGS
 1.25 02-Feb-1996  mycroft Simplify, and add support for passing CPPFLAGS.
 1.24 20-Oct-1995  cgd set, don't add to, CFLAGS from KERNCFLAGS. Do assignment of CC and
CFLAGS earlier, so that the arch-specific Makefile can add to them.
 1.23 07-Oct-1995  mycroft Build libkern as one .o file, so that all symbols defined therein are
always available to loadable modules.
 1.22 26-Sep-1995  jonathan Remove old .PATH directives that referenced libc source.
Libkern has its own copies of all the requisite source files.
 1.21 26-Jun-1995  christos Add the ability to override KERNREL and KERNDST.
 1.20 24-Jun-1995  christos Build libkern in the kernel compilation directory, like libcompat.
 1.19 13-Feb-1995  cgd slight cleanup/reorg. don't use quad code on the alpha.
 1.18 31-Dec-1994  mycroft Change a dependency to work when not using `all' target.
 1.17 07-Dec-1994  deraadt silence link creation
 1.16 26-Oct-1994  cgd new RCS ID format.
 1.15 16-Sep-1994  deraadt compile -O3
 1.14 30-Jun-1994  deraadt clean obj better
 1.13 30-Jun-1994  deraadt to find the DEFS.h files here, not in libc..
 1.12 30-Jun-1994  deraadt mv ${arch}/ to arch/${arch}, so that libkern builds without obj/
 1.11 21-May-1994  cgd be careful about mcount.po
 1.10 16-May-1994  cgd need a backslash!
 1.9 16-May-1994  deraadt attempts to reduce our reliance on /usr/include
 1.8 14-May-1994  cgd add libkern mcount
 1.7 23-Mar-1994  deraadt kernel/disklib.c goes away, not very portable
 1.6 09-Mar-1994  ws Make FFS optional
 1.5 04-Dec-1993  cgd quad support
 1.4 04-Dec-1993  cgd branches: 1.4.2;
change to use MACHINE_ARCH and update from libc
 1.3 23-Oct-1993  cgd use obj.${MACHINE} dirs to compile into
 1.2 13-Oct-1993  cgd slight cleanup, and ... (gasp) add comments
 1.1 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.4.2.2 04-Dec-1993  cgd use quad support; we need it
 1.4.2.1 04-Dec-1993  cgd file Makefile was added on branch magnum on 1993-12-04 05:07:45 +0000
 1.31.6.1 12-Mar-1997  is Merge in changes from The Trunk
 1.36.8.1 12-Nov-1997  thorpej Sync w/ trunk.
 1.43.2.1 08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.46.2.3 09-Apr-1999  chs undo previous changes to the LD lines.
I fixed my cross build environment.
 1.46.2.2 25-Feb-1999  chs sync with HEAD - profiling fixes.
 1.46.2.1 09-Nov-1998  chs initial snapshot. lots left to do.
 1.50.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.53.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.53.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.53.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.53.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.60.4.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.60.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.60.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.60.4.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.60.2.8 11-Dec-2002  thorpej Sync with HEAD.
 1.60.2.7 11-Nov-2002  nathanw Catch up to -current
 1.60.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.60.2.5 01-Aug-2002  nathanw Catch up to -current.
 1.60.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.60.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.60.2.2 14-Nov-2001  thorpej Merge from -current, required to cross-build kernels properly.
 1.60.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.63.10.1 19-Jun-2002  lukem Pull up revision 1.65 (requested by wrstuden in ticket #318):
Updated version of cscope/mkid support. Check libkern and compat lib
for source files. Also include header files in mkid run.
 1.63.8.2 15-Jul-2002  gehenna catch up with -current.
 1.63.8.1 30-May-2002  gehenna Catch up with -current.
 1.70.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.70.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.70.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.70.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.70.2.1 03-Aug-2004  skrll Sync with HEAD
 1.71.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.71.8.1 29-Apr-2005  kent sync with -current
 1.72.4.4 04-Feb-2008  yamt sync with head.
 1.72.4.3 07-Dec-2007  yamt sync with head
 1.72.4.2 30-Dec-2006  yamt sync with head.
 1.72.4.1 21-Jun-2006  yamt sync with head.
 1.77.10.2 11-May-2006  elad sync with head
 1.77.10.1 19-Apr-2006  elad sync with head.
 1.77.8.3 03-Sep-2006  yamt sync with head.
 1.77.8.2 24-May-2006  yamt sync with head.
 1.77.8.1 13-Mar-2006  yamt sync with head.
 1.77.6.2 01-Jun-2006  kardel Sync with head.
 1.77.6.1 22-Apr-2006  simonb Sync with head.
 1.77.4.1 09-Sep-2006  rpaulo sync with head
 1.78.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.81.4.2 10-Dec-2006  yamt sync with head.
 1.81.4.1 22-Oct-2006  yamt sync with head
 1.81.2.1 18-Nov-2006  ad Sync with head.
 1.84.30.2 18-Feb-2008  mjf Sync with HEAD.
 1.84.30.1 08-Dec-2007  mjf Sync with HEAD.
 1.84.28.1 21-Nov-2007  bouyer Sync with HEAD
 1.84.24.2 23-Mar-2008  matt sync with HEAD
 1.84.24.1 09-Jan-2008  matt sync with HEAD
 1.84.22.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.84.22.1 21-Nov-2007  joerg Sync with HEAD.
 1.87.14.2 03-Jul-2008  simonb Sync with head.
 1.87.14.1 18-Jun-2008  simonb Sync with head.
 1.87.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.87.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.87.10.1 04-May-2009  yamt sync with head.
 1.87.8.1 17-Jun-2008  yamt sync with head.
 1.87.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.87.6.2 02-Jul-2008  mjf Sync with HEAD.
 1.87.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.89.10.3 27-Dec-2011  matt Add popcount32 and popcount64 for flash/nand
 1.89.10.2 21-Apr-2010  matt sync to netbsd-5
 1.89.10.1 21-Aug-2009  matt Pass LDFLAGS to LD
 1.89.6.1 03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
sys/lib/libkern/Makefile: patch
sys/lib/libkern/crc32.c: revision 1.1
sys/lib/libkern/crc32.h: revision 1.1
sys/lib/libkern/libkern.h: revision 1.89
sys/lib/libkern/arch/i386/Makefile.inc: revision 1.28
sys/net/zlib.h: revision 1.14 via patch
sys/opencrypto/crypto.c: revision 1.33
sys/opencrypto/cryptodev.c: revision 1.46
sys/opencrypto/cryptodev.h: revision 1.16
sys/opencrypto/cryptosoft.c: revision 1.24
sys/opencrypto/cryptosoft.h: revision 1.6
sys/opencrypto/deflate.h: revision 1.6
sys/opencrypto/cryptosoft_xform.c: revision 1.12
sys/opencrypto/deflate.c: revision 1.13
sys/opencrypto/files.opencrypto: revision 1.20
sys/opencrypto/ocryptodev.c: revision 1.1
sys/opencrypto/ocryptodev.h: revision 1.1
sys/opencrypto/xform.c: revision 1.18
sys/opencrypto/xform.h: revision 1.10
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.89.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.89.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.95.28.2 18-May-2014  rmind sync with head
 1.95.28.1 28-Aug-2013  rmind sync with head
 1.95.24.1 03-Dec-2017  jdolecek update from HEAD
 1.97.6.2 22-Apr-2016  skrll Sync with HEAD
 1.97.6.1 22-Sep-2015  skrll Sync with HEAD
 1.100.16.1 25-Jun-2018  pgoyette Sync with HEAD
 1.14 13-Nov-2023  mrg avoid dependency on NETBSDSRCDIR being set.

due to various things, non-build.sh builds don't have it set already
and it ends up defaulting to /usr/src, so if that doesn't exist or
is the wrong version, building libkern fails.

XXX: pullup-10, ..?
 1.13 16-Jun-2021  rin PR port-arm/55897

Fix ABI mismatch for armhf runtime routines for floating-point arithmetics;
For hard-float arm variants, provide

(1) generic runtime routines with correct calling convention, and
(2) EABI runtime routines at the same time.

I've confirmed that no binary changes for kernels.

LGTM by skrll
 1.12 24-Apr-2020  rin branches: 1.12.6;
For m68k, do not compile in {,u}divmodsi4 also, that are not used by
codes generated by gcc (confirmed not only for kernel, but also all
executables and libraries for userland).

Fix build failure for MODULAR kernel, noticed by mlelstv.
 1.11 23-Apr-2020  rin For m68k, do not compile in {,u}divsi3 and {,u}modsi3 since codes
generated by gcc do not depend on them.

We should not have unused functions in libkern for MODULAR.
 1.10 29-Sep-2019  mrg branches: 1.10.6;
convert HAVE_GCC == 7 to HAVE_GCC >= 7.
 1.9 05-Apr-2019  thorpej branches: 1.9.4;
clzdi2 and ctzdi2 are needed on alpha. (counting instructions are in the
optional CIX extension, and thus not used by the default compiler configuation).
 1.8 07-Feb-2019  mrg don't use -fnon-call-exceptions on arm. not needed and triggers eh_frame generation.
 1.7 07-Feb-2019  mrg apply the previous to all GCC-7 platforms. it affects vax as well.
 1.6 07-Feb-2019  mrg for sh3 and GCC 7 pass -fnon-call-exceptions for udivmoddi4.c.
avoids it emitting a call to abort() for an explicit divide by zero.
 1.5 10-Aug-2014  matt branches: 1.5.4; 1.5.30;
Changes to existing files to enable building AARCH64 userland.
evbarm64-el
This is clang only. While gcc4.8 supports aarch64, no netbsd support has
been written for aarch64 with gcc4.8.
 1.4 26-Feb-2014  joerg branches: 1.4.4; 1.4.6;
Update compiler-rt glue for the new source layout.
 1.3 29-Jan-2014  joerg For ARM EABI, includ divide-by-0 trap handlers.
 1.2 17-Jan-2014  joerg This is not libc, so don't check the libc arch macro.
 1.1 03-Dec-2013  joerg libkern build glue for compiler-rt.
 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 26-Feb-2014  yamt file Makefile.compiler-rt was added on branch yamt-pagecache on 2014-05-22 11:41:04 +0000
 1.4.4.2 18-May-2014  rmind sync with head
 1.4.4.1 26-Feb-2014  rmind file Makefile.compiler-rt was added on branch rmind-smpnet on 2014-05-18 17:46:08 +0000
 1.5.30.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.30.1 10-Jun-2019  christos Sync with HEAD
 1.5.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.4.1 10-Aug-2014  tls file Makefile.compiler-rt was added on branch tls-maxphys on 2014-08-20 00:04:29 +0000
 1.9.4.1 08-Aug-2021  martin Pull up following revision(s) (requested by skrll in ticket #1328):

sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmpeq_check_nan.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.4
sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.5
sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c: revision 1.2
sys/external/bsd/compiler_rt/abi.mk: revision 1.1
sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.4
sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.5
sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c: revision 1.3
sys/lib/libkern/Makefile.compiler-rt: revision 1.13
sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.6
sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_frsub.c: revision 1.2
lib/libm/compiler_rt/Makefile.inc: revision 1.11
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_div0.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/mulsf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/mulsf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/negdf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/negdf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/subsf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/subsf3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatundisf.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatundisf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_drsub.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/muldi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfsi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cdcmpeq_check_nan.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/muldi3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfsi.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatdisf.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatdisf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c: revision 1.3
lib/libc/compiler_rt/Makefile.inc: revision 1.40
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/udivsi3.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/truncsfhf2.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c: revision 1.2
sys/external/bsd/compiler_rt/dist/lib/builtins/udivsi3.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/truncsfhf2.c: revision 1.3
sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c: revision 1.4
sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c: revision 1.3

PR port-arm/55897
Cherry-pick upstream commit llvm-svn: 266891:
https://github.com/llvm/llvm-project/commit/28e1b977d4694c6b3a5c4d8107570a969be71e77#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007
----
[PATCH] builtins: remove use of __attribute__((pcs("aapcs"))) on
Windows
Windows does not honour the __attribute__((pcs)) on ARM. Although this will
result in ABI mismatches, compiler-rt should largely be unneeded for resolving
dependencies as we generate MS ABI compliant library calls now for the most
part.
llvm-svn: 266891
PR port-arm/55897
Cherry-pick upstream commit llvm-svn: 298974 for lib/builtins/int_lib.h.
https://github.com/llvm/llvm-project/commit/d8ca74176e25bd4080ee81982819e2ef7a36553f#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007
----
[Builtin] Unxfail tests for armhf
Summary:
Originally, a few tests fail for armhf target due to:
1) COMPILER_RT_ARMHF_TARGET was not set when building the lib
2) COMPILER_RT_ABI should not be defined as `__attribute__((pcs("aapcs")))` for armhf when building for both lib and tests
This addresshttps://bugs.llvm.org//show_bug.cgi?id=32261
mulsc3_test.c is a newly exposed issue, which will be addressed separately.
Reviewers: rengolin, compnerd
Reviewed By: compnerd
Subscribers: aemerson, llvm-commits, mgorny
Differential Revision:https://reviews.llvm.org/D31448
llvm-svn: 298974
PR port-arm/55897
Cherry-pick upstream commit llvm-svn: 303138:
https://github.com/llvm/llvm-project/commit/44c45717b9e9f3dc194508d2eeeb8599a9d76949#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007
----
[PATCH] builtins: use reserved spelling (NFC)
llvm-svn: 303138
PR port-arm/55897
Cherry-pick upstream commit llvm-svn: 303188:
https://github.com/llvm/llvm-project/commit/36ac5ddff7377586390a71cb3261f0a40d274308#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007
----
[PATCH] builtins: expand out the AEABI function stubs
These actually may change calling conventions. We cannot simply provide
function aliases as the aliased function may have a different calling
convention. Provide a forwarding function instead to permit the
compiler to synthesize the calling convention adjustment thunk.
Remove the `ARM_EABI_FNALIAS` macro as that is not safe to use.
Resolves PR33030!
llvm-svn: 303188
PR port-arm/55897
Cherry-pick upstream commit llvm-svn: 303207:
https://github.com/llvm/llvm-project/commit/4a45838d10085defac0f3b3003a5263e34536f3b#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007
----
[PATCH] builtins: fix guard __AEABI__ -> __ARM_EABI__
llvm-svn: 303207
PR port-arm/55897
Cherry-pick upstream commit llvm-svn: 314851:
https://github.com/llvm/llvm-project/commit/0d586d06a756b126a7eb43a21ecc12bd243d7cd8#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007
----
[PATCH] [compiler-rt] Add back ARM EABI aliases where legal.
r303188 removed all the uses of aliases for EABI functions from
compiler-rt, because some of them had mismatched calling conventions.
Obviously, we can't use aliases for functions which don't have the same
calling convention, but that's only an issue for floating-point
functions with the hardfloat ABI. In other cases, the stubs increase
size and reduce performance for no benefit.
This patch adds back the aliases, with appropriate checks to make sure
they're only used in cases where the calling convention matches.
llvm-svn: 314851
PR port-arm/55897
Fix ABI mismatch for armhf runtime routines for floating-point arithmetics;
For hard-float arm variants, provide
(1) generic runtime routines with correct calling convention, and
(2) EABI runtime routines at the same time.
I've confirmed that no binary changes for kernels.
LGTM by skrll
 1.10.6.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.12.6.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.50 20-Sep-2025  mrg mark cleankernlib and cleandirkernlib as .MAKE.

fixes a couple of:
nbmake[1]: warning: Invalid internal option "-J" in <..>
problems that appear with "build.sh -U .. kernel=" but not with -u.

solution from rillig@ in private email.
 1.49 30-Aug-2023  christos explicitly pass COPTS
 1.48 19-Jun-2022  rillig libkern: fix wrong escaping in makefile

In the unlikely event that KERNDIR contains a '$' character, that '$'
should not be doubled to '$$'. It only needs the usual shell quoting.
 1.47 30-May-2022  rin Introduce LIBKERN_MD_FLAGS to pass some MD flags for libkern.

This is necessary since libkern is built by coprocess, and
threfore subsets of make(1) variables are passed.
 1.46 22-Sep-2018  rin - Determine KERN_AS automatically depending on whether OPT_MODULAR is
set or not, in the same way as libcompat.

- Specify OPT_MODULAR in the port Makefile instead of KERN_AS.

Now, KERN_AS=library is used for kernels without module(7) for all ports.

OK christos
 1.45 27-May-2018  christos branches: 1.45.2;
- Introduce :q modifier for make variables and make it double escape $'s so
that passing variables to recursive makes with :q works as expected.
- Revert :Q to work as before.
- Adjust makefiles that use recursive make to use :q

Discussed on tech-toolchain@
XXX: pullup 8
 1.44 29-Oct-2015  mrg branches: 1.44.10; 1.44.16;
remove "@echo done" from 4 rules that don't need it and the random "done"
in my build logs don't help understanding.
 1.43 06-Sep-2015  uebayasi In kernel lib build, print message when things not only start bug also end.
 1.42 12-Dec-2012  matt branches: 1.42.14;
Don't pass down CPUFLAGS since its value is already in CFLAGS.
 1.41 10-Aug-2012  joerg branches: 1.41.2;
Deal with optional HAVE_GCC.
 1.40 20-Dec-2005  christos branches: 1.40.94; 1.40.110; 1.40.118;
Use common sources with userland.
 1.39 11-Dec-2005  christos merge ktrace-lwp.
 1.38 26-Feb-2005  perry branches: 1.38.4;
nuke trailing whitespace
 1.37 07-Nov-2003  dsl branches: 1.37.8; 1.37.10;
Make 'dependall' generate dependencies in these libraries.
 1.36 02-Nov-2002  perry branches: 1.36.6;
Add lint infrastructure
 1.35 21-Nov-2001  jmc Don't make clean and cleandir depend on the lib subdir. Just check for it's
existance before running the submake. This makes it possible to run a
make build (which runs cleandir before make obj) in a r/o source tree
 1.34 05-Dec-2000  sommerfeld branches: 1.34.2; 1.34.4;
Have recursive make invocations depend on the .MAKE pseudo-target so
make knows to handle them specially.
 1.33 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.32 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.31 07-May-1999  drochner branches: 1.31.2;
Build libraries for kernel/standalone code from within their compilation
directories and use .PATH to lookup the source files.
(Formerly, the libs were built from the source dirs, with MAKEOBJDIR
set to the compilation directory.)
This solves 2 problems:
-"mkdep" and "make" are now consistent about the file lookup, this fixes
bad interactions with amd reported in PR bin/7374 (Arne Juul) and
lossage reported by Andrew Gillham ("obj" dirs and relative paths still
don't work well together)
-kernel compile trees can be moved around without forcing a new
"make depend" - fixing PR kern/4021 by Martin Husemann
 1.30 15-Oct-1998  drochner branches: 1.30.8;
change handling of libkern:
-sys/lib/libkern builds as library per default (as it was documented all
the time)
-ports able to LKM set "KERN_AS=obj" explicitely in their Makefiles
 1.29 05-Sep-1998  lukem distclean is a synonym for cleandir
 1.28 07-Feb-1998  cgd make sure that LORDER, TSORT, AR, NM, RANLIB, and SIZE are correctly
and consistently set when doing kernel library builds.
 1.27 04-Nov-1997  gwr Pass down the values of: AR NM RANLIB
(Fixes PR#4426 from SAITOH Masanobu)
Also pass down LORDER TSORT.
 1.26 07-Mar-1997  thorpej branches: 1.26.8;
Allow depend target to be parallized, from Andrew Wheadon
<andrew@wipux2.wifo.uni-mannheim.de>, PR #3257.
 1.25 16-Feb-1997  cgd allow includers to specify library-specific CPP flags via ${LIB}MISCCPPFLAGS
 1.24 23-Jan-1997  cgd branches: 1.24.4;
clean up substantially. Transform clean, depend, cleandir targets from ::
to :, so they can be used e.g. with <bsd.prog.mk>. Standardize variable
names used to configure kernel libraries.

Variables used by these Makefile.inc's are:

S must be set to the top of the 'sys' tree.
${LIB}DST may be set to the location of the directory where library
objects are to be built. Defaults to ${.OBJDIR}/lib/${lib}.
${LIB}_AS may be set to 'obj' to build a object from the library's
object files. (Otherwise, a library will be built.)
Defaults to 'library'.
${LIB}MISCMAKEFLAGS
Miscellaneous flags to be passed to the library's Makefile when
building. See library's Makefile for more details about
supported flags and their default values.

(where LIB is KERN, SA, or Z, and lib is kern, sa, or z, depending on which
library's Makefile.inc is being discussed.)
 1.23 26-Dec-1996  christos PR/2981: use ${VAR:Q} instead of '${VAR}' to avoid quoting problems
 1.22 30-Sep-1996  ws Allow compilation of libkern as library for standalone programs
 1.21 23-Sep-1996  ghudson Handle relative paths to the source directory if they begin with a '.'.
 1.20 09-Sep-1996  mycroft Pass $STRIP to the sub-make.
 1.19 10-Aug-1996  mycroft Add anchors so that only exactly `-I. is modified.
 1.18 10-Aug-1996  mycroft Convert the -I. to -I${.OBJDIR}, so that the `machine symlink is available.
 1.17 08-Aug-1996  mycroft We dont need to pass down COMPATDIR and KERNDIR.
 1.16 08-Aug-1996  mycroft Run the child make in the source directory, so that nothing here needs to be
changed when the compile directory is outside the source tree.
 1.15 20-May-1996  mrg use ' not " when passing variables to a sub-make. pr#1199/pr#1296
 1.14 11-May-1996  mycroft Make `make depend' work for libraries.
 1.13 02-Feb-1996  mycroft Simplify, and add support for passing CPPFLAGS.
 1.12 07-Oct-1995  mycroft Build libkern as one .o file, so that all symbols defined therein are
always available to loadable modules.
 1.11 26-Jun-1995  christos Add the ability to override KERNREL and KERNDST.
 1.10 24-Jun-1995  christos Build libkern in the kernel compilation directory, like libcompat.
 1.9 31-Dec-1994  mycroft Only build the version of the library that's needed.
 1.8 26-Oct-1994  cgd new RCS ID format.
 1.7 09-Jan-1994  ws Use $(MAKE) instead of make
 1.6 28-Dec-1993  davidb Changed to use make's new .OBJDIR
 1.5 22-Dec-1993  cgd use ${MAKE} rather than "make", as suggested by Roland McGrath
 1.4 23-Oct-1993  cgd branches: 1.4.2;
use obj.${MACHINE} dirs to compile into
 1.3 13-Oct-1993  cgd punt on doing minimal work in favor of less output in 'happy' case.
 1.2 13-Oct-1993  cgd add a bunch of .NOTMAINs
 1.1 13-Oct-1993  cgd slight cleanup, and ... (gasp) add comments
 1.4.2.2 28-Dec-1993  davidb Changes from main branch:
Use make's new .OBJDIR
Changed make to $(MAKE)
 1.4.2.1 23-Oct-1993  davidb file Makefile.inc was added on branch magnum on 1993-12-28 12:24:33 +0000
 1.24.4.1 12-Mar-1997  is Merge in changes from The Trunk
 1.26.8.1 12-Nov-1997  thorpej Sync w/ trunk.
 1.30.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.31.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.31.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.34.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.34.2.2 11-Nov-2002  nathanw Catch up to -current
 1.34.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.36.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.36.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.36.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.36.6.1 03-Aug-2004  skrll Sync with HEAD
 1.37.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.37.8.1 29-Apr-2005  kent sync with -current
 1.38.4.1 21-Jun-2006  yamt sync with head.
 1.40.118.1 06-Dec-2012  matt Don't pass CPUFLAGS down since its value is in CFLAGS
 1.40.110.2 16-Jan-2013  yamt sync with (a bit old) head
 1.40.110.1 30-Oct-2012  yamt sync with head
 1.40.94.1 21-Aug-2009  matt Pass LDFLAGS
 1.41.2.1 25-Feb-2013  tls resync with head
 1.42.14.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.42.14.1 22-Sep-2015  skrll Sync with HEAD
 1.44.16.2 30-Sep-2018  pgoyette Ssync with HEAD
 1.44.16.1 25-Jun-2018  pgoyette Sync with HEAD
 1.44.10.1 09-Jun-2018  martin Pull up following revision(s) (requested by christos in ticket #870):

sys/lib/libgnuefi/Makefile.inc: revision 1.5
external/mit/xorg/xorg-pkg-ver.mk: revision 1.9
sys/arch/i386/stand/lib/Makefile.inc: revision 1.17
sys/compat/common/Makefile.inc: revision 1.25
usr.bin/make/unit-tests/varquote.exp: revision 1.1, 1.2
sys/lib/libsa/Makefile.inc: revision 1.24
usr.bin/make/var.c: revision 1.220
sys/arch/ia64/stand/efi/libefi/Makefile.inc: revision 1.5
sys/arch/hppa/spmath/Makefile.inc: revision 1.10
usr.bin/make/unit-tests/varquote.mk: revision 1.1, 1.2
usr.bin/make/unit-tests/Makefile: revision 1.53
sys/lib/libkern/Makefile.inc: revision 1.45
sys/arch/acorn32/stand/lib/Makefile.inc: revision 1.4
sys/arch/m68k/fpsp/Makefile.inc: revision 1.21
usr.bin/make/make.1: revision 1.273
sys/lib/libz/Makefile.inc: revision 1.17

- Introduce :q modifier for make variables and make it double escape $'s so
that passing variables to recursive makes with :q works as expected.
- Adjust makefiles that use recursive make to use :q

Discussed on tech-toolchain@

XXX: pullup 8
 1.45.2.1 10-Jun-2019  christos Sync with HEAD
 1.55 20-Jan-2024  kre Compensate for src/common/lib/libc/atomic/atomic_init_cas.c losing
the extern declaration of __libc_atomic_init() and instead using a
new one added to src/lib/libc/include/extern.h

That file is outside src/common and src/sys so is unavailable to
kernel builds, so instead make a new include file in src/common
which the kernel can read which contains the needed extern decl
for __libc_atomic_init()

This seems to fix the evbarm builds (maybe others) - but it is
all MUCH TOO UGLY to keep. Someone please make a better fix,
even if that just means reverting rev 1.5 of
src/common/lib/libc/atomic/atomic_init_cas.c
and all of the changes here (the addition to libc/include/extern.h
should be harmless to keep).
 1.54 01-Jan-2024  rhialto avoid dependency on NETBSDSRCDIR being set.

(similar to an earlier commit)
due to various things, non-build.sh builds don't have it set already
and it ends up defaulting to /usr/src, so if that doesn't exist or
is the wrong version, building libkern fails.
 1.53 27-Oct-2021  ryo revert previous: http://mail-index.netbsd.org/source-changes/2021/10/25/msg133295.html

going to add __always_inline to the functions called from _mcount()
discussed on http://mail-index.netbsd.org/source-changes-d/2021/10/25/msg013480.html
 1.52 25-Oct-2021  ryo In some arch, _mcount() would be called recursively when built with COPTS=-O0.

Normally, functions called from mcount.c are expected to be expanded inline,
so _mcount() will never be called recursively. But when build with COPTS=-O0,
`static inline' functions aren't inlined, and _mcount() will be called
recursively.

Even if _mcount() has `__attribute__((__no_ instrument_function__))',
it has no effect on the calling external (no-inlined) function.

To avoid this, PROF.<fn> is added can be set the profiling flag of any file.
"PROF.mcount.c" is set to blank by default, mcount.c itself is compiled
without -pg.
 1.51 17-May-2021  mrg move bi-endian disklabel support from the kernel and libsa into libkern.

- dkcksum() and dkcksum_sized() move from subr_disk.c and from
libsa into libkern/dkcksum.c (which is missing _sized() version),
using the version from usr.sbin/disklabel.

- swap_disklabel() moves from subr_disk_mbr.c into libkern, now called
disklabel_swap(). (the sh3 version should be updated to use this.)

- DISKLABEL_EI becomes a first-class option with opt_disklabel.h.

- add libkern.h to libsa/disklabel.c.

this enables future work for bi-endian libsa/ufs.c (relevant for ffsv1,
ffsv2, lfsv1, and lfsv2), as well as making it possible for ports not
using subr_disk_mbr.c to include bi-endian disklabel support (which,
afaict, includes any disk on mbr-supporting platforms that do not have
an mbr as well as disklabel.)

builds successsfully on: alpha, i386, amd64, sun2, sun3, evbarm64,
evbarm64-eb, sparc, and sparc64. tested in anita on i386 and sparc,
testing in hardware on evbarm64*.
 1.50 25-Jan-2021  thorpej branches: 1.50.4; 1.50.6;
Build strlist.c.

(Sigh, missed in original commit.)
 1.49 30-Jun-2020  maxv branches: 1.49.2;
Make copystr() a MI C function, part of libkern and shared on all
architectures.

Notes:

- On alpha and ia64 the function is kept but gets renamed locally to avoid
symbol collision. This is because on these two arches, I am not sure
whether the ASM callers do not rely on fixed registers, so I prefer to
keep the ASM body for now.
- On Vax, only the symbol is removed, because the body is used from other
functions.
- On RISC-V, this change fixes a bug: copystr() was just a wrapper around
strlcpy(), but strlcpy() makes the operation less safe (strlen on the
source beyond its size).
- The kASan, kCSan and kMSan wrappers are removed, because now that
copystr() is in C, the compiler transformations are applied to it,
without the need for manual wrappers.

Could test on amd64 only, but should be fine.
 1.48 30-Apr-2020  riastradh Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources. Hardware RNG devices should have hardware-specific
health tests. For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug. Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
knob kern.entropy.depletion; otherwise it is disabled, and once the
system reaches full entropy it is assumed to stay there as far as
modern cryptography is concerned.

- No `entropy estimation' based on sample values. Such `entropy
estimation' is a contradiction in terms, dishonest to users, and a
potential source of side channels. It is the responsibility of the
driver author to study the entropy of the process that generates
the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
it's ready, if we've never reached full entropy, and with a rate
limit afterward. Operators can force consolidation now by running
sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
whenever entropy is consolidated into the global pool.
. Usage: Cache entropy_epoch() when you seed. If entropy_epoch()
has changed when you're about to use whatever you seeded, reseed.
. Epoch is never zero, so initialize cache to 0 if you want to reseed
on first use.
. Epoch is -1 iff we have never reached full entropy -- in other
words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
but it is better if you check for changes rather than for -1, so
that if the system estimated its own entropy incorrectly, entropy
consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
happening:
. kern.entropy.needed - bits of entropy short of full entropy
. kern.entropy.pending - bits known to be pending in per-CPU pools,
can be consolidated with sysctl -w kern.entropy.consolidate=1
. kern.entropy.epoch - number of times consolidation has happened,
never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
Hash_DRBGs. There are only two in the system: user_cprng for
/dev/urandom and sysctl kern.?random, and kern_cprng for kernel
users which may need to operate in interrupt context up to IPL_VM.

(Calling cprng_strong in interrupt context does not strike me as a
particularly good idea, so I added an event counter to see whether
anything actually does.)

- Event counters provide operator visibility into when reseeding
happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.
 1.47 14-Dec-2019  riastradh Nix trailing whitespace.
 1.46 14-Dec-2019  riastradh Remove never-used Mersenne twister from libkern.
 1.45 14-Dec-2019  riastradh Omit vestigial unused commented-out experiment.
 1.44 14-Dec-2019  ad Include radixtree in the kernel.
 1.43 03-Sep-2018  riastradh Rename min.c -> uimin.c, max.c -> uimax.c in libkern.
 1.42 08-Jul-2018  christos provide memmem
 1.41 08-Dec-2017  christos branches: 1.41.2; 1.41.4;
coalesce the two copies of hexdump into libkern
 1.40 30-Nov-2017  riastradh Import SHA-3 code into libc and libkern.

No new public symbols in libc, but publishing the symbols is a simple
matter if/when we decide to do so.

Proposed on tech-kern and tech-userlevel with no objections:

https://mail-index.NetBSD.org/tech-kern/2017/11/11/msg022581.html
https://mail-index.NetBSD.org/tech-userlevel/2017/11/11/msg010968.html
 1.39 02-May-2016  christos move scsipi_strvis -> libkern:strnvisx()
change the prototype to match userland
fix sizes of strings passed to it
 1.38 15-Apr-2015  mrg remove various HAVE_GCC=45 fragments.
 1.37 16-Jan-2015  christos strtoi and strtou for the kernel
 1.36 20-Nov-2014  christos branches: 1.36.2;
bcdtobin and bintobcd are now inlines in <dev/clock_subr.h>
 1.35 10-Aug-2014  tls branches: 1.35.2;
Merge tls-earlyentropy branch into HEAD.
 1.34 19-Jul-2014  lneto lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE
 1.33 04-Jul-2014  jmcneill ${.PARSEDIR} not .${PARSEDIR} for Makefile.compiler-rt include
 1.32 12-Mar-2014  pooka branches: 1.32.2;
Do not include compiler-rt in librump. librump is not a toolchain support
library, and toolchain support belongs in the host libc or libgcc or
equivalent entity that is actually supposed to complement the toolchain.

Fixes librump build on (a) Linux ARM (collisions with libgcc)
 1.31 29-Jan-2014  joerg Include compiler-rt in libc, libm and libkern.
 1.30 15-Jan-2014  joerg For HAVE_LIBGCC=no, use compiler-rt for quad support.
 1.29 27-Dec-2013  christos add strncat (for acpi)
 1.28 11-Dec-2013  joerg Allow kernel code to access constant databases by moving cdbr(3) and the
required mi_vector_hash(3) into src/common.
 1.27 02-Dec-2013  lneto changed lua_Number to int64_t
 1.26 23-Jul-2013  skrll Another codegen bug that fixes (in this case lots of) atf tests.
rump_server doesn't die so much now.
 1.25 29-Jun-2013  rmind branches: 1.25.2;
libkern: add murmurhash module.
 1.24 24-Jun-2013  riastradh branches: 1.24.2;
Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.23 17-Mar-2013  christos undo sparc64 kludge
 1.22 14-Mar-2013  nakayama Make sparc64 32-bit kernel buildable.
 1.21 11-Mar-2013  christos amend previous sparc64 fix: rump does not know about memcpyset.s
 1.20 10-Mar-2013  christos On sparc64 memcpy and memset are provided by memcpyset.s (should have been
memcpyset.S, but...). Don't include them in the build because it breaks the
modular build where the kernel library is built as an object.
 1.19 23-Jan-2013  matt Add strnlen.c to SRCS (which will automatically use the .S version if it
exists).
 1.18 30-Aug-2012  drochner branches: 1.18.2;
Add "consttime_bcmp" and "explicit_bzero" functions for both kernel
abd userland, as proposed on tech-security, with explicit_bzero using
a volatile function pointer as suggested by Alan Barrett.
Both do what the name says. For userland, both are prefixed by "__"
to keep them out of the user namespace.
Change some memset/memcmp uses to the new functions where it makes
sense -- these are just some examples, more to come.
 1.17 05-Feb-2012  dholland branches: 1.17.2; 1.17.4; 1.17.6; 1.17.8;
Migrate one last leftover bit (used only by the kernel now) to
sys/ufs/ufs and remove the old quota headers and no-longer-used shared
code. Ok by releng.
 1.16 20-Jan-2012  joerg Don't use __cmsg_alignbytes in the kernel. Mark it as constant function
for userland as its value never changes. This allows the compiler to
optimise most invocations away.
 1.15 19-Nov-2011  tls branches: 1.15.2;
First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

An initial cleanup and minor reorganization of the entropy pool
code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are
fixed. Some effort is made to accumulate entropy more quickly at
boot time.

A generic interface, "rndsink", is added, for stream generators to
request that they be re-keyed with good quality entropy from the pool
as soon as it is available.

The arc4random()/arc4randbytes() implementation in libkern is
adjusted to use the rndsink interface for rekeying, which helps
address the problem of low-quality keys at boot time.

An implementation of the FIPS 140-2 statistical tests for random
number generator quality is provided (libkern/rngtest.c). This
is based on Greg Rose's implementation from Qualcomm.

A new random stream generator, nist_ctr_drbg, is provided. It is
based on an implementation of the NIST SP800-90 CTR_DRBG by
Henric Jungheim. This generator users AES in a modified counter
mode to generate a backtracking-resistant random stream.

An abstraction layer, "cprng", is provided for in-kernel consumers
of randomness. The arc4random/arc4randbytes API is deprecated for
in-kernel use. It is replaced by "cprng_strong". The current
cprng_fast implementation wraps the existing arc4random
implementation. The current cprng_strong implementation wraps the
new CTR_DRBG implementation. Both interfaces are rekeyed from
the entropy pool automatically at intervals justifiable from best
current cryptographic practice.

In some quick tests, cprng_fast() is about the same speed as
the old arc4randbytes(), and cprng_strong() is about 20% faster
than rnd_extract_data(). Performance is expected to improve.

The AES code in src/crypto/rijndael is no longer an optional
kernel component, as it is required by cprng_strong, which is
not an optional kernel component.

The entropy pool output is subjected to the rngtest tests at
startup time; if it fails, the system will reboot. There is
approximately a 3/10000 chance of a false positive from these
tests. Entropy pool _input_ from hardware random numbers is
subjected to the rngtest tests at attach time, as well as the
FIPS continuous-output test, to detect bad or stuck hardware
RNGs; if any are detected, they are detached, but the system
continues to run.

A problem with rndctl(8) is fixed -- datastructures with
pointers in arrays are no longer passed to userspace (this
was not a security problem, but rather a major issue for
compat32). A new kernel will require a new rndctl.

The sysctl kern.arandom() and kern.urandom() nodes are hooked
up to the new generators, but the /dev/*random pseudodevices
are not, yet.

Manual pages for the new kernel interfaces are forthcoming.
 1.14 26-Aug-2011  dyoung branches: 1.14.2;
Build and install ppath(3), property-list paths library.
 1.13 24-Mar-2011  bouyer Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
 1.12 26-Feb-2011  jakllsch Add quad srcs if building x86_64 32-bit libkern.
 1.11 26-Feb-2011  matt Add quad srcs if using MIPS O32 ABI
 1.10 11-May-2010  pooka branches: 1.10.2; 1.10.4;
fix typo
 1.9 19-Jan-2010  pooka branches: 1.9.2; 1.9.4;
Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
 1.8 14-Dec-2009  uebayasi Build fix for the mips64 merge:
- If memset2.c is in ${SRCS}, exclude conflicting memset.c.
- If MD byte_swap_8.* is in ${SRCS}, exclude conflicting bswap64.c.
 1.7 21-Nov-2009  uebayasi Redo the previous inverted logic. Sort alphabetically.
 1.6 21-Nov-2009  uebayasi Don't build quad support code on 64-bit platforms.
 1.5 14-Aug-2009  dsl Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.4 12-Aug-2009  dsl Use stuff from libc/Makefile to auto-remove .c files if a .S has been added.
Use it to dispose of tne .c files that were already only conditionally
added.
 1.3 21-Jul-2009  joerg Move popcount et al to src/common and add popcount32/popcount64.
Requested by rmind@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.
 1.2 25-Mar-2009  darran branches: 1.2.2;
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.1 04-Jan-2009  pooka branches: 1.1.2; 1.1.4; 1.1.6;
Split variables out of Makefile into Makefile.libkern so that we
can easily just .include it for the proper SRCS etc. definitions
in case we're interested in the files but not in building an actual
libkern.{a,o}. for librump
 1.1.6.2 23-Jul-2009  jym Sync with HEAD.
 1.1.6.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.4.3 28-Apr-2009  skrll Sync with HEAD.
 1.1.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.4.1 04-Jan-2009  skrll file Makefile.libkern was added on branch nick-hppapmap on 2009-01-19 13:19:56 +0000
 1.1.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 04-Jan-2009  mjf file Makefile.libkern was added on branch mjf-devfs2 on 2009-01-17 13:29:21 +0000
 1.2.2.6 11-Aug-2010  yamt sync with head.
 1.2.2.5 11-Mar-2010  yamt sync with head
 1.2.2.4 19-Aug-2009  yamt sync with head.
 1.2.2.3 20-Jun-2009  yamt sync with head
 1.2.2.2 04-May-2009  yamt sync with head.
 1.2.2.1 25-Mar-2009  yamt file Makefile.libkern was added on branch yamt-nfs-mp on 2009-05-04 08:13:50 +0000
 1.9.4.3 21-Apr-2011  rmind sync with head
 1.9.4.2 05-Mar-2011  rmind sync with head
 1.9.4.1 30-May-2010  rmind sync with head
 1.9.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.10.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.10.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.14.2.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.14.2.3 30-Oct-2012  yamt sync with head
 1.14.2.2 17-Apr-2012  yamt sync with head
 1.14.2.1 02-Nov-2011  yamt page cache related changes

- maintain object pages in radix tree rather than rb tree.
- reduce unnecessary page scan in putpages. esp. when an object has a ton of
pages cached but only a few of them are dirty.
- reduce the number of pmap operations by tracking page dirtiness more
precisely in uvm layer.
- fix nfs commit range tracking.
- fix nfs write clustering. XXX hack
 1.15.2.1 18-Feb-2012  mrg merge to -current.
 1.17.8.1 23-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1481):
sys/lib/libkern/Makefile.libkern: revision 1.19
Add strnlen.c to SRCS (which will automatically use the .S version if it
exists).
 1.17.6.1 23-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1481):
sys/lib/libkern/Makefile.libkern: revision 1.19
Add strnlen.c to SRCS (which will automatically use the .S version if it
exists).
 1.17.4.1 07-Feb-2013  matt Pullup rev 1.19:
date: 2013/01/23 22:34:37; author: matt; state: Exp; lines: +2 -2
Add strnlen.c to SRCS (which will automatically use the .S version if it
exists).
 1.17.2.1 23-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1481):
sys/lib/libkern/Makefile.libkern: revision 1.19
Add strnlen.c to SRCS (which will automatically use the .S version if it
exists).
 1.18.2.4 03-Dec-2017  jdolecek update from HEAD
 1.18.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.2.2 23-Jun-2013  tls resync from head
 1.18.2.1 25-Feb-2013  tls resync with head
 1.24.2.2 18-May-2014  rmind sync with head
 1.24.2.1 28-Aug-2013  rmind sync with head
 1.25.2.1 23-Jul-2013  riastradh sync with HEAD
 1.32.2.4 10-Aug-2014  tls Rebase.
 1.32.2.3 09-Aug-2014  tls (Temporarily) disable LZF in libkern -- it introduces a dependency from
src/sys to src/external which I'll need to fix by moving the LZF sources.
 1.32.2.2 17-Jul-2014  tls Adjustments to the "earlyentropy" branch in response to the various
discussions beginning with my initial proposal
http://mail-index.netbsd.org/tech-kern/2014/04/08/msg016876.html and
particularly the long discussion of cprng_fast() performance (e.g.
https://mail-index.netbsd.org/tech-crypto/2014/04/21/msg000642.html).

In particular:

* Per-CPU, lockless cprng_fast replacement using Dennis Ferguson's
"ccrand" implementation of ChaCha8.

* libkern arc4random() is gone, gone, gone.

* Entropy estimator reverted to 32-bit recordkeeping and timestamps
per Dennis' comments and analysis.

* LZF entropy estimator removed: it required a great deal of state,
and rejected only truly pathological input.

I have not yet reverted the changes that provide LZF in the kernel
as generic functionality; I will likely revert those changes prior
to any merge of this branch to HEAD.
 1.32.2.1 07-Apr-2014  tls LZF in the kernel. As an entropy estimator for now but it's very small, and
we could use it for ipcomp, for hibernation, for paging, for core dumps, etc.
 1.35.2.1 22-Apr-2015  snj Pull up following revision(s) (requested by roy in ticket #648):
common/lib/libc/stdlib/_strtoi.h: revisions 1.1, 1.2
common/lib/libc/stdlib/strtoi.c: revision 1.1
common/lib/libc/stdlib/strtou.c: revision 1.1
distrib/sets/lists/base/ad.aarch64: patch
distrib/sets/lists/base/ad.arm: patch
distrib/sets/lists/base/ad.mips: patch
distrib/sets/lists/base/ad.powerpc: patch
distrib/sets/lists/base/md.amd64: patch
distrib/sets/lists/base/md.sparc64: patch
distrib/sets/lists/base/shl.mi: patch
distrib/sets/lists/comp/mi: revision 1.1939
distrib/sets/lists/debug/ad.aarch64: patch
distrib/sets/lists/debug/ad.arm: patch
distrib/sets/lists/debug/ad.mips: patch
distrib/sets/lists/debug/ad.powerpc: patch
distrib/sets/lists/debug/md.amd64: patch
distrib/sets/lists/debug/md.sparc64: patch
distrib/sets/lists/debug/shl.mi: patch
include/inttypes.h: revision 1.11
lib/libc/shlib_version: patch
lib/libc/stdlib/Makefile.inc: revision 1.84
lib/libc/stdlib/strtol.3: revisions 1.27-1.31
lib/libc/stdlib/strtoul.3: revisions 1.26-1.29
sys/lib/libkern/Makefile.libkern: revision 1.37
sys/lib/libkern/libkern.h: revision 1.117
tools/compat/Makefile: revision 1.73
tools/compat/compat_defs.h: revision 1.101
tools/compat/configure.ac: revision 1.83
tools/compat/configure: revision 1.82
tools/compat/nbtool_config.h.in: revision 1.36
add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
--
strtoi and strtou additions
--
strtoi and strtou for the kernel
--
strtoi and strtou additions
--
strtoi and strtou man pages
--
strto{i,u}
--
regen
--
Remove trailing whitespace.
--
match variable names with man page (Kamil Rytarowski)
--
cleanups from (Kamil Rytarowski)
--
add strtoi strtou (Kamil Rytarowski)
--
PR/49640: Kamil Rytarowski: Improve error printing
--
Use existing month for Dd.
 1.36.2.3 29-May-2016  skrll Sync with HEAD
 1.36.2.2 06-Jun-2015  skrll Sync with HEAD
 1.36.2.1 06-Apr-2015  skrll Sync with HEAD
 1.41.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.41.4.1 10-Jun-2019  christos Sync with HEAD
 1.41.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.41.2.1 28-Jul-2018  pgoyette Sync with HEAD
 1.49.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.50.6.1 31-May-2021  cjep sync with head
 1.50.4.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.12 19-Jan-2010  pooka Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
 1.11 24-Sep-2007  pooka branches: 1.11.22; 1.11.40;
Rename __assert() to __kernassert() so that it doesn't collide
with the libc version. They take different arguments.
 1.10 03-Aug-2007  ad branches: 1.10.2; 1.10.4; 1.10.6; 1.10.8;
Do the panicstr check only if _KERNEL.
 1.9 29-Jul-2007  ad Disable kernel assertions if panicstr != NULL.
 1.8 11-Dec-2005  christos branches: 1.8.30; 1.8.40;
merge ktrace-lwp.
 1.7 12-Mar-2005  dsl branches: 1.7.4;
KNF
 1.6 27-Sep-2002  provos branches: 1.6.6; 1.6.14; 1.6.16;
remove trailing \n in panic(). approved perry.
 1.5 29-Mar-2000  simonb branches: 1.5.6; 1.5.8;
Don't prototype __assert() if not STANDALONE - <sys/systm.h> has already
included <lib/libkern/libkern.h> to get the prototype by this stage.

XXX: should we just change <sys/systm.h> from
#ifdef _KERNEL
#include <sys/systm.h>
#endif
to
#if defined(_KERNEL) || defined(_STANDALONE)
#include <sys/systm.h>
#endif
anyways?
 1.4 13-Apr-1999  drochner branches: 1.4.2;
make libkern compile in userland - for testing purposes
 1.3 11-Feb-1999  pk branches: 1.3.4;
Can't include libkern.h twice which is what happens if _KERNEL is on.
For now, protect here with _STANDALONE.
XXX - must probably fix sys/systm.h
 1.2 11-Feb-1999  pk Pull libkern.h in.
 1.1 27-Aug-1996  cgd Add machine-independent assertion-checking support. macros are:

assert() which always does assertion checking
unless "NDEBUG" is defined.

KASSERT() which does assertion checking if DIAGNOSTIC
is defined.

KDASSERT() which does assertion checking if DEBUG is
define. This macro exists for compatibility
with existing ports' assertion checking macros.
(Assertion checking is not typically an
"expensive" operation, and DIAGNOSTIC should be
used for inexpensive consistency checks.)
 1.3.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.8.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.6.1 18-Oct-2002  nathanw Catch up to -current.
 1.6.16.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.14.1 29-Apr-2005  kent sync with -current
 1.6.6.1 01-Apr-2005  skrll Sync with HEAD.
 1.7.4.2 27-Oct-2007  yamt sync with head.
 1.7.4.1 03-Sep-2007  yamt sync with head.
 1.8.40.1 15-Aug-2007  skrll Sync with HEAD.
 1.8.30.2 09-Oct-2007  ad Sync with head.
 1.8.30.1 20-Aug-2007  ad Sync with HEAD.
 1.10.8.2 03-Aug-2007  ad Do the panicstr check only if _KERNEL.
 1.10.8.1 03-Aug-2007  ad file __assert.c was added on branch matt-mips64 on 2007-08-03 13:06:01 +0000
 1.10.6.1 06-Oct-2007  yamt sync with head.
 1.10.4.1 06-Nov-2007  matt sync with HEAD
 1.10.2.2 02-Oct-2007  joerg Sync with HEAD.
 1.10.2.1 03-Aug-2007  joerg file __assert.c was added on branch jmcneill-pm on 2007-10-02 18:29:08 +0000
 1.11.40.1 14-Feb-2014  matt Change KASSERTMSG/KDASSERTMSG to use varadic arguments like HEAD.
panic -> vpanic, add panic wrapper to vpanic.
 1.11.22.1 11-Mar-2010  yamt sync with head
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 15-Nov-2001  lukem branches: 1.3.32;
don't need <sys/types.h> when including <sys/param.h>
 1.2 19-Apr-2000  itojun branches: 1.2.6; 1.2.8; 1.2.10;
change copyright notice from 3-clause TNF -> 4-clause TNF.
not sure if which we prefer, but the point is to use exactly the same
copyright. From: matthew green <mrg@eterna.com.au>
 1.1 02-Mar-2000  itojun make CMSG_ALIGN always synchronize with kernel's idea of ALIGNBYTES.
ancillary data alignment will be ALIGNBYTES, not sizeof(long) - 1, from now.

CMSG_xx will NOT resolve into constant. if you use CMSG_xx to allocate
arrays, you'll lose.

bump shlib minor for libc.

NOTE: if you are on top of arch with ALIGNBYTES != sizeof(long) - 1,
you need to recompile IPv6-related binaries. there is no way to guarantee
backward compat in this aspect. sorry for this. this should be the last
backward compat breakage for IPv6-related ancillary data manipulation.
(we still have PR 9516 for unix-domain sockets...)
 1.2.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.6.1 19-Apr-2000  bouyer file __cmsg_alignbytes.c was added on branch thorpej_scsipi on 2000-11-20 18:09:19 +0000
 1.3.32.1 21-Jun-2006  yamt sync with head.
 1.6 15-Mar-2009  cegger ansify function definitions
 1.5 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.4 14-Mar-1996  christos branches: 1.4.166; 1.4.176; 1.4.182;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 15-Oct-1993  cgd branches: 1.1.2;
add __main()
 1.1.2.2 15-Oct-1993  cgd add __main()
 1.1.2.1 15-Oct-1993  cgd file __main.c was added on branch magnum on 1993-10-15 06:20:47 +0000
 1.4.182.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.176.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.166.1 04-May-2009  yamt sync with head.
 1.4 22-Nov-2007  plunky remove insque/remque from libkern, they are no longer used
 1.3 11-Dec-2005  christos branches: 1.3.44; 1.3.46; 1.3.52;
merge ktrace-lwp.
 1.2 26-Feb-2005  perry branches: 1.2.4;
nuke trailing whitespace
 1.1 12-Aug-2001  jdolecek branches: 1.1.2; 1.1.4; 1.1.24; 1.1.32; 1.1.34;
Move _insque()/_remque() to libkern. Once remaining uses would
be converted to <sys/queue.h> macros, _insque()/_remque() would be eliminated
altogether.
 1.1.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.32.1 29-Apr-2005  kent sync with -current
 1.1.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.4.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.4.1 12-Aug-2001  thorpej file _que.c was added on branch kqueue on 2001-08-25 06:16:50 +0000
 1.1.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.1.2.1 12-Aug-2001  nathanw file _que.c was added on branch nathanw_sa on 2001-08-24 00:11:49 +0000
 1.2.4.1 07-Dec-2007  yamt sync with head
 1.3.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.3.46.1 23-Mar-2008  matt sync with HEAD
 1.3.44.1 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 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 22364, verified by myself.
 1.7 20-Oct-2002  scw branches: 1.7.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.6 27-Mar-1998  cgd branches: 1.6.26;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file adddi3.c was added on branch magnum on 1993-12-04 05:01:34 +0000
 1.6.26.1 11-Nov-2002  nathanw Catch up to -current
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file anddi3.c was added on branch magnum on 1993-12-04 05:01:36 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.36 10-Aug-2014  tls Merge tls-earlyentropy branch into HEAD.
 1.35 24-Jun-2013  riastradh branches: 1.35.6;
Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.34 23-Jun-2013  riastradh Account bytes drawn from initial call to libkern arc4random.

XXX This unlocked initialization looks rather bogus...
 1.33 23-Jun-2013  riastradh Rework rndsink(9) abstraction and adapt arc4random(9) and cprng(9).

rndsink(9):
- Simplify API.
- Simplify locking scheme.
- Add a man page.
- Avoid races in destruction.
- Avoid races in requesting entropy now and scheduling entropy later.

Periodic distribution of entropy to sinks reduces the need for the
last one, but this way we don't need to rely on periodic distribution
(e.g., in a future tickless NetBSD).

rndsinks_lock should probably eventually merge with the rndpool lock,
but we'll put that off for now.

cprng(9):
- Make struct cprng_strong opaque.
- Move rndpseudo.c parts that futz with cprng guts to subr_cprng.c.
- Fix kevent locking. (Is kevent locking documented anywhere?)
- Stub out rump cprng further until we can rumpify rndsink instead.
- Strip code to grovel through struct cprng_strong in fstat.
 1.32 10-Apr-2012  tls branches: 1.32.2;

Add a spin mutex to the rndsink structure; it is used to avoid lock
ordering and sleep-holding-locks problems when rekeying, and thus
to avoid a nasty race between cprng destruction and reseeding.
 1.31 14-Feb-2012  njoly branches: 1.31.2;
void function _arc4randbytes cannot return a value.
 1.30 02-Feb-2012  tls Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.29 29-Nov-2011  drochner branches: 1.29.2;
make "rs" static -- this name is too unspecific for the global namespace
 1.28 29-Nov-2011  tls Remove rnd_extract_data from the public kernel API (it is for use by the
stream generators only). Clean up some related minor issues.
 1.27 28-Nov-2011  tls Remove arc4random() and arc4randbytes() from the kernel API. Replace
arc4random() hacks in rump with stubs that call the host arc4random() to
get numbers that are hopefully actually random (arc4random() keyed with
stack junk is not). This should fix some of the currently failing anita
tests -- we should no longer generate duplicate "random" MAC addresses in
the test environment.
 1.26 27-Nov-2011  tsutsui Disable a DIAGNOSTIC test which causes kernel stack overflow on all arm ports.

Boot failure is reported from several arm users (nonaka@, ryo@, and others),
and too large auto variable in arc4_randrekey() is pointed out by enami@.
 1.25 26-Nov-2011  enami Use exact 32bit integral type to declare variable to store
32bit random value. This is necessary since it is overwritten
by four bytes.
 1.24 26-Nov-2011  enami Fix white space usage.
 1.23 20-Nov-2011  para make it compile without DIAGNOSTIC defined
 1.22 19-Nov-2011  tls First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

An initial cleanup and minor reorganization of the entropy pool
code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are
fixed. Some effort is made to accumulate entropy more quickly at
boot time.

A generic interface, "rndsink", is added, for stream generators to
request that they be re-keyed with good quality entropy from the pool
as soon as it is available.

The arc4random()/arc4randbytes() implementation in libkern is
adjusted to use the rndsink interface for rekeying, which helps
address the problem of low-quality keys at boot time.

An implementation of the FIPS 140-2 statistical tests for random
number generator quality is provided (libkern/rngtest.c). This
is based on Greg Rose's implementation from Qualcomm.

A new random stream generator, nist_ctr_drbg, is provided. It is
based on an implementation of the NIST SP800-90 CTR_DRBG by
Henric Jungheim. This generator users AES in a modified counter
mode to generate a backtracking-resistant random stream.

An abstraction layer, "cprng", is provided for in-kernel consumers
of randomness. The arc4random/arc4randbytes API is deprecated for
in-kernel use. It is replaced by "cprng_strong". The current
cprng_fast implementation wraps the existing arc4random
implementation. The current cprng_strong implementation wraps the
new CTR_DRBG implementation. Both interfaces are rekeyed from
the entropy pool automatically at intervals justifiable from best
current cryptographic practice.

In some quick tests, cprng_fast() is about the same speed as
the old arc4randbytes(), and cprng_strong() is about 20% faster
than rnd_extract_data(). Performance is expected to improve.

The AES code in src/crypto/rijndael is no longer an optional
kernel component, as it is required by cprng_strong, which is
not an optional kernel component.

The entropy pool output is subjected to the rngtest tests at
startup time; if it fails, the system will reboot. There is
approximately a 3/10000 chance of a false positive from these
tests. Entropy pool _input_ from hardware random numbers is
subjected to the rngtest tests at attach time, as well as the
FIPS continuous-output test, to detect bad or stuck hardware
RNGs; if any are detected, they are detached, but the system
continues to run.

A problem with rndctl(8) is fixed -- datastructures with
pointers in arrays are no longer passed to userspace (this
was not a security problem, but rather a major issue for
compat32). A new kernel will require a new rndctl.

The sysctl kern.arandom() and kern.urandom() nodes are hooked
up to the new generators, but the /dev/*random pseudodevices
are not, yet.

Manual pages for the new kernel interfaces are forthcoming.
 1.21 18-Jan-2010  joerg branches: 1.21.12;
Keep arc4_i and arc4_j synchronised after a rekeying. This prevents
accidentally ending up in a short ARC4 cycle.
 1.20 28-Apr-2008  martin branches: 1.20.10; 1.20.16; 1.20.18;
Remove clause 3 and 4 from TNF licenses
 1.19 19-Jul-2007  dsl branches: 1.19.26; 1.19.28; 1.19.30; 1.19.32;
include sys/cdefs.h
 1.18 05-Nov-2006  christos branches: 1.18.2; 1.18.8; 1.18.18; 1.18.22;
- call the initialization routine for arc4randbytes.
- knf (add continues)
 1.17 07-Jun-2006  kardel branches: 1.17.6; 1.17.8;
merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
 1.16 24-Dec-2005  perry branches: 1.16.4; 1.16.6; 1.16.8; 1.16.14;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.15 11-Dec-2005  christos merge ktrace-lwp.
 1.14 26-Feb-2005  perry branches: 1.14.4;
nuke trailing whitespace
 1.13 17-Sep-2004  enami branches: 1.13.4; 1.13.6;
Redo part of rev. 1.10.
 1.12 08-Sep-2004  yamt arc4random: fix a bug introduced by rev.1.7.
actually generate four bytes random value, rather than
leaving a byte always zero.
 1.11 02-Oct-2003  itojun branches: 1.11.2;
fix build for bootloaders (no /usr/include/sys/kernel.h any more).
 1.10 20-Aug-2003  itojun KNF
 1.9 06-Oct-2002  dan branches: 1.9.6;
let this compile in the non KERNEL case without NRND.
 1.8 06-Oct-2002  tls ESP output was drawing down the entropy pool at a ferocious rate, a
particular problem on hosts with only wireless interfaces that are
definitely not safe to use as entropy sources.

Add arc4randbytes() which hands out bytes from the same source used
by arc4random(). This is intended to be a _temporary_ interface
until we can design and implement a better general PRNG interface
that is decoupled from the entropy-pool implementation.

Modify key_randomfill() (used only for initialization vectors on
SA creation and via key_sa_stir_iv(), which does not "stir",
despite its name) to use arc4randbytes() instead of pulling bits
directly from the entropy pool. It is my hope that this change
will pose minimal integration problems for the KAME folks as the
random-pool interface is *already* different between each BSD
variant; this just simplifies the NetBSD case and solves a
fairly serious problem.

Note that it is generally considered acceptable cryptographic
practice to use a fast stream cipher to generate IVs for encryption
with stronger block ciphers. For example, the use of "non-Approved"
PRNGs to generate IVs for "Approved" block ciphers is explicitly
sanctioned by FIPS 140-2.
 1.7 06-Oct-2002  tls This commit includes two major changes:

1) Speed up arc4random(). We make arc4randbyte() inline, which makes this
not much slower than, say, the other arc4 implementation in our kernel.

We also replace four calls to arc4randbyte() with a loop, saving about
20% on some processors where the "unrolled" arc4randbyte() calls would
needlessly stomp the cache.

2) Address various problems with the initialization/"stirring" code,
primarily in the area of handling of the source data from the kernel
entropy pool. We used to:

a) Ask the entropy pool for 32 bytes

b) If we got zero bytes, key with junk from the stack (ouch!)
which has some nasty implications, to say the least. For
example, we're most likely to get zero bytes at boot time,
when the stack contents are even more predictable than usual.

c) If we got less than 32 bytes but more than zero bytes, use
however many bytes we got as the arc4 key, copying it
repeatedly as per usual arc4 key setup.

Because of the way NetBSD's entropy pool works, this was
mostly harmless, because if you ask for RND_EXTRACT_ANY,
you always get as many bytes as you ask for. However,
this is probably a security hole in the original FreeBSD
code, where AFAICT you might end up using an 8-bit arc4
key -- not good, much worse than using the output of the
entropy pool hash function even when it thinks it only
has 8 bits of entropy to give you.

One thing this code could do on NetBSD that was not so
good was to replace a key with a lot of entropy with
one with less entropy. That's clearly counterproductive.

The new code, instead:

a) Asks for 32 good bytes. If it gets them, use them as the
arc4 key in the usual way.

b) Tracks how many entropy bytes the key it's replacing had.
If the new entropy request got less bytes, leave the old
key in place. Note that the first time through, the "old
key" had zero bytes, so we'll always replace it.

c) If we get less then 32 bytes but more than we had, request
EXTRACT_ANY bytes from the entropy pool, padding the key
out to 32 bytes which we then use as the arc4 key in the
usual way.

This is still really all rather backwards. Instead of this generator
deciding to rekey itself using a basically arbitrary metric, it should
register a callback so that the entropy pool code could rekey it when
a lot of bits were available. Details at 11.

Finally, rename the "stir" function (which did not stir) to "rekey",
which is what it actually does.
 1.6 04-Oct-2002  itojun include rnd.h only under kernel build.
caveat: arc4random() will not get stirred in bootstrap code.
 1.5 04-Oct-2002  itojun add missing "rnd.h" include - noted by simonb
 1.4 14-Jun-2002  itojun branches: 1.4.2; 1.4.4;
discard 256 bytes of output every time we stir (not just when initializing)
 1.3 29-May-2002  itojun branches: 1.3.2;
need libkern.h for bootloaders
 1.2 28-May-2002  itojun no need for libkern.h
 1.1 28-May-2002  itojun have arc4random(9).
 1.3.2.3 20-Jun-2002  gehenna catch up with -current.
 1.3.2.2 30-May-2002  gehenna Catch up with -current.
 1.3.2.1 29-May-2002  gehenna file arc4random.c was added on branch gehenna-devsw on 2002-05-30 14:48:12 +0000
 1.4.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.4.1 14-Jun-2002  jdolecek file arc4random.c was added on branch kqueue on 2002-06-23 17:49:45 +0000
 1.4.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.4.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.4.2.1 14-Jun-2002  nathanw file arc4random.c was added on branch nathanw_sa on 2002-06-20 03:47:32 +0000
 1.9.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11.2.1 11-Sep-2004  he Pull up revision 1.12 (requested by dan in ticket #824):
Fix bug introduced earlier: actually generate four bytes of
random value, rather than always leaving a byte zero.
 1.13.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.13.4.1 29-Apr-2005  kent sync with -current
 1.14.4.3 03-Sep-2007  yamt sync with head.
 1.14.4.2 30-Dec-2006  yamt sync with head.
 1.14.4.1 21-Jun-2006  yamt sync with head.
 1.16.14.1 19-Jun-2006  chap Sync with head.
 1.16.8.1 26-Jun-2006  yamt sync with head.
 1.16.6.1 04-Feb-2006  simonb Adapt for timecounters: mostly use get*time() and use "time_second"
instead of "time.tv_sec".
 1.16.4.1 09-Sep-2006  rpaulo sync with head
 1.17.8.1 10-Dec-2006  yamt sync with head.
 1.17.6.1 18-Nov-2006  ad Sync with head.
 1.18.22.1 21-Jan-2010  snj Pull up following revision(s) (requested by joerg in ticket #1374):
sys/lib/libkern/arc4random.c: revision 1.21
Keep arc4_i and arc4_j synchronised after a rekeying. This prevents
accidentally ending up in a short ARC4 cycle.
 1.18.18.1 15-Aug-2007  skrll Sync with HEAD.
 1.18.8.1 20-Aug-2007  ad Sync with HEAD.
 1.18.2.1 21-Jan-2010  snj Pull up following revision(s) (requested by joerg in ticket #1374):
sys/lib/libkern/arc4random.c: revision 1.21
Keep arc4_i and arc4_j synchronised after a rekeying. This prevents
accidentally ending up in a short ARC4 cycle.
 1.19.32.2 19-Jul-2007  dsl include sys/cdefs.h
 1.19.32.1 19-Jul-2007  dsl file arc4random.c was added on branch matt-mips64 on 2007-07-19 22:00:05 +0000
 1.19.30.2 11-Mar-2010  yamt sync with head
 1.19.30.1 16-May-2008  yamt sync with head.
 1.19.28.1 18-May-2008  yamt sync with head.
 1.19.26.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.18.1 21-Apr-2010  matt sync to netbsd-5
 1.20.16.1 20-Jan-2010  snj Pull up following revision(s) (requested by joerg in ticket #1253):
sys/lib/libkern/arc4random.c: revision 1.21
Keep arc4_i and arc4_j synchronised after a rekeying. This prevents
accidentally ending up in a short ARC4 cycle.
 1.20.10.1 20-Jan-2010  snj Pull up following revision(s) (requested by joerg in ticket #1253):
sys/lib/libkern/arc4random.c: revision 1.21
Keep arc4_i and arc4_j synchronised after a rekeying. This prevents
accidentally ending up in a short ARC4 cycle.
 1.21.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.21.12.1 17-Apr-2012  yamt sync with head
 1.29.2.2 29-Apr-2012  mrg sync to latest -current.
 1.29.2.1 18-Feb-2012  mrg merge to -current.
 1.31.2.1 19-Apr-2012  riz Pull up following revision(s) (requested by tls in ticket #185):
sys/kern/subr_cprng.c: revision 1.6
sys/kern/subr_cprng.c: revision 1.7
sys/lib/libkern/arc4random.c: revision 1.32
sys/kern/kern_rndq.c: revision 1.2
sys/dev/rndpseudo.c: revision 1.7
sys/sys/rnd.h: revision 1.30
Add a spin mutex to the rndsink structure; it is used to avoid lock
ordering and sleep-holding-locks problems when rekeying, and thus
to avoid a nasty race between cprng destruction and reseeding.
Fix LOCKDEBUG problems pointed out by drochner@
1) Lock ordering in cprng_strong_destroy had us take a spin mutex then
an adaptive mutex. Can't do that. Reordering this requires changing
cprng_strong_reseed to tryenter the cprng's own mutex and skip the
reseed on failure, or we could deadlock.
2) Can't free memory with a valid mutex in it.
reorder initialization to improve error handling in case the system
runs out of file descriptors, avoids LOCKDEBUG panic due to double
mutex initialization
 1.32.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.35.6.1 17-Jul-2014  tls Adjustments to the "earlyentropy" branch in response to the various
discussions beginning with my initial proposal
http://mail-index.netbsd.org/tech-kern/2014/04/08/msg016876.html and
particularly the long discussion of cprng_fast() performance (e.g.
https://mail-index.netbsd.org/tech-crypto/2014/04/21/msg000642.html).

In particular:

* Per-CPU, lockless cprng_fast replacement using Dennis Ferguson's
"ccrand" implementation of ChaCha8.

* libkern arc4random() is gone, gone, gone.

* Entropy estimator reverted to 32-bit recordkeeping and timestamps
per Dennis' comments and analysis.

* LZF entropy estimator removed: it required a great deal of state,
and rejected only truly pathological input.

I have not yet reverted the changes that provide LZF in the kernel
as generic functionality; I will likely revert those changes prior
to any merge of this branch to HEAD.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 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 22364, verified by myself.
 1.7 20-Oct-2002  scw branches: 1.7.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.6 27-Mar-1998  cgd branches: 1.6.26;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file ashldi3.c was added on branch magnum on 1993-12-04 05:01:37 +0000
 1.6.26.1 11-Nov-2002  nathanw Catch up to -current
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 07-Aug-2003  agc branches: 1.9.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 20-Oct-2002  scw branches: 1.8.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.7 10-Sep-1999  drochner branches: 1.7.14;
sync with libc
 1.6 27-Mar-1998  cgd sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file ashrdi3.c was added on branch magnum on 1993-12-04 05:01:38 +0000
 1.7.14.1 11-Nov-2002  nathanw Catch up to -current
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.2 20-Nov-2014  christos bcdtobin and bintobcd are now inlines in <dev/clock_subr.h>
 1.1 11-Mar-2006  kleink branches: 1.1.2; 1.1.6; 1.1.8; 1.1.14; 1.1.20; 1.1.120;
Provide BCD<->binary conversion in libkern and turn <dev/clock_subr.h>'s
FROMBCD()/TOBCD() macros into wrappers around it, resulting in both
smaller code footprint and elimination of possible issues due to
multiple evaluation of macro arguments.

Suggested by Simon Burge and Anders Gavare on tech-kern.
 1.1.120.1 03-Dec-2017  jdolecek update from HEAD
 1.1.20.2 09-Sep-2006  rpaulo sync with head
 1.1.20.1 11-Mar-2006  rpaulo file bcd.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.1.14.2 21-Jun-2006  yamt sync with head.
 1.1.14.1 11-Mar-2006  yamt file bcd.c was added on branch yamt-lazymbuf on 2006-06-21 15:10:13 +0000
 1.1.8.2 22-Apr-2006  simonb Sync with head.
 1.1.8.1 11-Mar-2006  simonb file bcd.c was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.1.6.2 19-Apr-2006  elad sync with head.
 1.1.6.1 11-Mar-2006  elad file bcd.c was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.1.2.2 13-Mar-2006  yamt sync with head.
 1.1.2.1 11-Mar-2006  yamt file bcd.c was added on branch yamt-pdpolicy on 2006-03-13 09:07:39 +0000
 1.14 20-Dec-2005  christos Use common sources with userland.
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 07-Aug-2003  agc branches: 1.12.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 01-Apr-1999  simonb branches: 1.11.42;
Sync with src/lib/libc/string/bcmp.c
 1.10 27-Mar-1998  cgd sync with libc
 1.9 13-Oct-1997  lukem rcsid fascism
 1.8 24-Oct-1996  cgd branches: 1.8.10;
when casting const pointers, preserve const qualifiers. (-Wcast-qual)
 1.7 18-Apr-1996  cgd don't include user-land headers in libkern files when compiling for
the kernel.
 1.6 14-Mar-1996  christos - Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file bcmp.c was added on branch magnum on 1993-10-27 22:00:43 +0000
 1.8.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.42.1 03-Aug-2004  skrll Sync with HEAD
 1.12.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 31-May-2005  christos branches: 1.6.2;
add missing const
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 07-Apr-2003  scw branches: 1.4.2;
When MEMCOPY is defined, don't bother checking if a backwards-copy is
required. That's what memmove() is for.

This should fix port-powerpc/16889. The backwards copyin can confuse
uiomove/genfs_getpages, resulting in corruption of files written over NFS.
 1.3 27-Mar-1998  cgd sync with libc
 1.2 22-Feb-1998  mycroft Sync with libc.
 1.1 22-Feb-1998  mycroft Need bcopy.c to generate memcpy().
 1.4.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.2.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 04-Dec-2003  keihan branches: 1.3.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.2 15-Jan-1999  bouyer branches: 1.2.42;
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 09-Oct-1997  bouyer branches: 1.1.2;
Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 09-Oct-1997  thorpej file bswap16.c was added on branch marc-pcmcia on 1997-10-14 10:26:37 +0000
 1.2.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.42.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 04-Dec-2003  keihan branches: 1.3.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.2 15-Jan-1999  bouyer branches: 1.2.42;
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 09-Oct-1997  bouyer branches: 1.1.2;
Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 09-Oct-1997  thorpej file bswap32.c was added on branch marc-pcmcia on 1997-10-14 10:26:38 +0000
 1.2.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.42.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 04-Dec-2003  keihan branches: 1.5.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.4 10-Aug-2003  martin Sync with userland version.
 1.3 05-Feb-1999  bouyer branches: 1.3.42;
Sync with libc version.
 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 09-Oct-1997  bouyer branches: 1.1.2;
Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 09-Oct-1997  thorpej file bswap64.c was added on branch marc-pcmcia on 1997-10-14 10:26:40 +0000
 1.3.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.42.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 04-Aug-1998  perry branches: 1.9.62;
update bzero.c to stub from libc/string
 1.8 27-Mar-1998  cgd sync with libc
 1.7 13-Oct-1997  lukem rcsid fascism
 1.6 18-Apr-1996  cgd branches: 1.6.12;
don't include user-land headers in libkern files when compiling for
the kernel.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file bzero.c was added on branch magnum on 1993-10-27 22:00:45 +0000
 1.6.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.62.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file cmpdi2.c was added on branch magnum on 1993-12-04 05:01:39 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.1 30-Jun-2020  maxv Make copystr() a MI C function, part of libkern and shared on all
architectures.

Notes:

- On alpha and ia64 the function is kept but gets renamed locally to avoid
symbol collision. This is because on these two arches, I am not sure
whether the ASM callers do not rely on fixed registers, so I prefer to
keep the ASM body for now.
- On Vax, only the symbol is removed, because the body is used from other
functions.
- On RISC-V, this change fixes a bug: copystr() was just a wrapper around
strlcpy(), but strlcpy() makes the operation less safe (strlen on the
source beyond its size).
- The kASan, kCSan and kMSan wrappers are removed, because now that
copystr() is in C, the compiler transformations are applied to it,
without the need for manual wrappers.

Could test on amd64 only, but should be fine.
 1.3 16-Apr-2020  rin Revert previous for now:
http://mail-index.netbsd.org/source-changes/2020/04/16/msg116278.html

The reasoning turned out to be wrong; __KERNEL_RCSID() in header files
does *not* overwrite RCSID in main source files. The real problem is that
it inserts its RCSID into *every* object files. However, it can be still
useful even if heavily duplicated.
 1.2 16-Apr-2020  rin Stop using __KERNEL_RCSID() in header files; it confuses ident(1) by
overwriting RCSID in main source files.

XXX
The first argument of __KERNEL_RCSID() is neglected for ELF. If we wish
to have RCSID of header files in kernel binary, we need something like
__FBSDID() macro in FreeBSD.
 1.1 20-Aug-2016  jdolecek branches: 1.1.2; 1.1.4; 1.1.18; 1.1.32;
extract crc16 code from utoppy driver to a separate file in libkern, for use
by ext2fs; every usage gets their own copy of the table for now, as it's
fairly small, and too rare to be used to be useful pulling into every kernel
 1.1.32.1 20-Apr-2020  bouyer Sync with HEAD
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 20-Aug-2016  jdolecek file crc16.h was added on branch tls-maxphys on 2017-12-03 11:38:46 +0000
 1.1.4.2 05-Oct-2016  skrll Sync with HEAD
 1.1.4.1 20-Aug-2016  skrll file crc16.h was added on branch nick-nhusb on 2016-10-05 20:56:03 +0000
 1.1.2.2 14-Sep-2016  pgoyette Sync with HEAD
 1.1.2.1 20-Aug-2016  pgoyette file crc16.h was added on branch pgoyette-localcount on 2016-09-14 03:04:17 +0000
 1.4 26-Mar-2009  he branches: 1.4.2; 1.4.4; 1.4.6; 1.4.8; 1.4.14;
Make the function declaration the same for the big-endian case as
for the little-endian case, and consistent with the libkern.h
declaration. Fixes build problem for at least hp700 and evbbarm-eb.
 1.3 25-Mar-2009  tls Fix compilation error on 64-bit platforms.
 1.2 25-Mar-2009  tls Fix build problems caused by crc32 addition to libkern. Also, this makes
the i386 bootblocks about 2K smaller than they were before we monkeyed
with crc32 at all.
 1.1 25-Mar-2009  darran Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.4.14.2 21-Apr-2010  matt sync to netbsd-5
 1.4.14.1 26-Mar-2009  matt file crc32.c was added on branch matt-nb5-mips64 on 2010-04-21 00:28:20 +0000
 1.4.8.3 16-May-2009  jym Fix a merge botch that hampered kernel's build for amd64.

Reported by cegger@ in private mail. Thanks.
 1.4.8.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.8.1 26-Mar-2009  jym file crc32.c was added on branch jym-xensuspend on 2009-05-13 17:22:15 +0000
 1.4.6.2 04-May-2009  yamt sync with head.
 1.4.6.1 26-Mar-2009  yamt file crc32.c was added on branch yamt-nfs-mp on 2009-05-04 08:13:50 +0000
 1.4.4.5 03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
sys/lib/libkern/crc32.c: revision 1.4
Make the function declaration the same for the big-endian case as
for the little-endian case, and consistent with the libkern.h
declaration. Fixes build problem for at least hp700 and evbbarm-eb.
 1.4.4.4 03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
sys/lib/libkern/crc32.c: revision 1.3
Fix compilation error on 64-bit platforms.
 1.4.4.3 03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
common/dist/zlib/zlib.h: revision 1.3
sys/lib/libkern/crc32.c: revision 1.2
sys/lib/libkern/libkern.h: revision 1.90 via patch
sys/lib/libsa/cread.c: revision 1.23
sys/lib/libz/Makefile: revision 1.16
Fix build problems caused by crc32 addition to libkern. Also, this makes
the i386 bootblocks about 2K smaller than they were before we monkeyed
with crc32 at all.
 1.4.4.2 03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
sys/lib/libkern/Makefile: patch
sys/lib/libkern/crc32.c: revision 1.1
sys/lib/libkern/crc32.h: revision 1.1
sys/lib/libkern/libkern.h: revision 1.89
sys/lib/libkern/arch/i386/Makefile.inc: revision 1.28
sys/net/zlib.h: revision 1.14 via patch
sys/opencrypto/crypto.c: revision 1.33
sys/opencrypto/cryptodev.c: revision 1.46
sys/opencrypto/cryptodev.h: revision 1.16
sys/opencrypto/cryptosoft.c: revision 1.24
sys/opencrypto/cryptosoft.h: revision 1.6
sys/opencrypto/deflate.h: revision 1.6
sys/opencrypto/cryptosoft_xform.c: revision 1.12
sys/opencrypto/deflate.c: revision 1.13
sys/opencrypto/files.opencrypto: revision 1.20
sys/opencrypto/ocryptodev.c: revision 1.1
sys/opencrypto/ocryptodev.h: revision 1.1
sys/opencrypto/xform.c: revision 1.18
sys/opencrypto/xform.h: revision 1.10
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.4.4.1 26-Mar-2009  snj file crc32.c was added on branch netbsd-5 on 2009-05-03 17:24:45 +0000
 1.4.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.4.2.1 26-Mar-2009  skrll file crc32.c was added on branch nick-hppapmap on 2009-04-28 07:37:13 +0000
 1.1 25-Mar-2009  darran branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.14;
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.1.14.2 21-Apr-2010  matt sync to netbsd-5
 1.1.14.1 25-Mar-2009  matt file crc32.h was added on branch matt-nb5-mips64 on 2010-04-21 00:28:20 +0000
 1.1.8.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.8.1 25-Mar-2009  jym file crc32.h was added on branch jym-xensuspend on 2009-05-13 17:22:15 +0000
 1.1.6.2 04-May-2009  yamt sync with head.
 1.1.6.1 25-Mar-2009  yamt file crc32.h was added on branch yamt-nfs-mp on 2009-05-04 08:13:50 +0000
 1.1.4.2 03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
sys/lib/libkern/Makefile: patch
sys/lib/libkern/crc32.c: revision 1.1
sys/lib/libkern/crc32.h: revision 1.1
sys/lib/libkern/libkern.h: revision 1.89
sys/lib/libkern/arch/i386/Makefile.inc: revision 1.28
sys/net/zlib.h: revision 1.14 via patch
sys/opencrypto/crypto.c: revision 1.33
sys/opencrypto/cryptodev.c: revision 1.46
sys/opencrypto/cryptodev.h: revision 1.16
sys/opencrypto/cryptosoft.c: revision 1.24
sys/opencrypto/cryptosoft.h: revision 1.6
sys/opencrypto/deflate.h: revision 1.6
sys/opencrypto/cryptosoft_xform.c: revision 1.12
sys/opencrypto/deflate.c: revision 1.13
sys/opencrypto/files.opencrypto: revision 1.20
sys/opencrypto/ocryptodev.c: revision 1.1
sys/opencrypto/ocryptodev.h: revision 1.1
sys/opencrypto/xform.c: revision 1.18
sys/opencrypto/xform.h: revision 1.10
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.1.4.1 25-Mar-2009  snj file crc32.h was added on branch netbsd-5 on 2009-05-03 17:24:45 +0000
 1.1.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.1.2.1 25-Mar-2009  skrll file crc32.h was added on branch nick-hppapmap on 2009-04-28 07:37:13 +0000
 1.1 17-May-2021  mrg branches: 1.1.2; 1.1.6;
move bi-endian disklabel support from the kernel and libsa into libkern.

- dkcksum() and dkcksum_sized() move from subr_disk.c and from
libsa into libkern/dkcksum.c (which is missing _sized() version),
using the version from usr.sbin/disklabel.

- swap_disklabel() moves from subr_disk_mbr.c into libkern, now called
disklabel_swap(). (the sh3 version should be updated to use this.)

- DISKLABEL_EI becomes a first-class option with opt_disklabel.h.

- add libkern.h to libsa/disklabel.c.

this enables future work for bi-endian libsa/ufs.c (relevant for ffsv1,
ffsv2, lfsv1, and lfsv2), as well as making it possible for ports not
using subr_disk_mbr.c to include bi-endian disklabel support (which,
afaict, includes any disk on mbr-supporting platforms that do not have
an mbr as well as disklabel.)

builds successsfully on: alpha, i386, amd64, sun2, sun3, evbarm64,
evbarm64-eb, sparc, and sparc64. tested in anita on i386 and sparc,
testing in hardware on evbarm64*.
 1.1.6.2 17-Jun-2021  thorpej Sync w/ HEAD.
 1.1.6.1 17-May-2021  thorpej file disklabel_swap.c was added on branch thorpej-i2c-spi-conf on 2021-06-17 04:46:33 +0000
 1.1.2.2 31-May-2021  cjep sync with head
 1.1.2.1 17-May-2021  cjep file disklabel_swap.c was added on branch cjep_staticlib_x on 2021-05-31 22:15:20 +0000
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file divdi3.c was added on branch magnum on 1993-12-04 05:01:40 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.1 17-May-2021  mrg branches: 1.1.2; 1.1.6;
move bi-endian disklabel support from the kernel and libsa into libkern.

- dkcksum() and dkcksum_sized() move from subr_disk.c and from
libsa into libkern/dkcksum.c (which is missing _sized() version),
using the version from usr.sbin/disklabel.

- swap_disklabel() moves from subr_disk_mbr.c into libkern, now called
disklabel_swap(). (the sh3 version should be updated to use this.)

- DISKLABEL_EI becomes a first-class option with opt_disklabel.h.

- add libkern.h to libsa/disklabel.c.

this enables future work for bi-endian libsa/ufs.c (relevant for ffsv1,
ffsv2, lfsv1, and lfsv2), as well as making it possible for ports not
using subr_disk_mbr.c to include bi-endian disklabel support (which,
afaict, includes any disk on mbr-supporting platforms that do not have
an mbr as well as disklabel.)

builds successsfully on: alpha, i386, amd64, sun2, sun3, evbarm64,
evbarm64-eb, sparc, and sparc64. tested in anita on i386 and sparc,
testing in hardware on evbarm64*.
 1.1.6.2 17-Jun-2021  thorpej Sync w/ HEAD.
 1.1.6.1 17-May-2021  thorpej file dkcksum.c was added on branch thorpej-i2c-spi-conf on 2021-06-17 04:46:33 +0000
 1.1.2.2 31-May-2021  cjep sync with head
 1.1.2.1 17-May-2021  cjep file dkcksum.c was added on branch cjep_staticlib_x on 2021-05-31 22:15:20 +0000
 1.1 30-Apr-2020  riastradh Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources. Hardware RNG devices should have hardware-specific
health tests. For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug. Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
knob kern.entropy.depletion; otherwise it is disabled, and once the
system reaches full entropy it is assumed to stay there as far as
modern cryptography is concerned.

- No `entropy estimation' based on sample values. Such `entropy
estimation' is a contradiction in terms, dishonest to users, and a
potential source of side channels. It is the responsibility of the
driver author to study the entropy of the process that generates
the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
it's ready, if we've never reached full entropy, and with a rate
limit afterward. Operators can force consolidation now by running
sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
whenever entropy is consolidated into the global pool.
. Usage: Cache entropy_epoch() when you seed. If entropy_epoch()
has changed when you're about to use whatever you seeded, reseed.
. Epoch is never zero, so initialize cache to 0 if you want to reseed
on first use.
. Epoch is -1 iff we have never reached full entropy -- in other
words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
but it is better if you check for changes rather than for -1, so
that if the system estimated its own entropy incorrectly, entropy
consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
happening:
. kern.entropy.needed - bits of entropy short of full entropy
. kern.entropy.pending - bits known to be pending in per-CPU pools,
can be consolidated with sysctl -w kern.entropy.consolidate=1
. kern.entropy.epoch - number of times consolidation has happened,
never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
Hash_DRBGs. There are only two in the system: user_cprng for
/dev/urandom and sysctl kern.?random, and kern_cprng for kernel
users which may need to operate in interrupt context up to IPL_VM.

(Calling cprng_strong in interrupt context does not strike me as a
particularly good idea, so I added an event counter to see whether
anything actually does.)

- Event counters provide operator visibility into when reseeding
happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.
 1.1 30-Apr-2020  riastradh Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources. Hardware RNG devices should have hardware-specific
health tests. For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug. Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
knob kern.entropy.depletion; otherwise it is disabled, and once the
system reaches full entropy it is assumed to stay there as far as
modern cryptography is concerned.

- No `entropy estimation' based on sample values. Such `entropy
estimation' is a contradiction in terms, dishonest to users, and a
potential source of side channels. It is the responsibility of the
driver author to study the entropy of the process that generates
the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
it's ready, if we've never reached full entropy, and with a rate
limit afterward. Operators can force consolidation now by running
sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
whenever entropy is consolidated into the global pool.
. Usage: Cache entropy_epoch() when you seed. If entropy_epoch()
has changed when you're about to use whatever you seeded, reseed.
. Epoch is never zero, so initialize cache to 0 if you want to reseed
on first use.
. Epoch is -1 iff we have never reached full entropy -- in other
words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
but it is better if you check for changes rather than for -1, so
that if the system estimated its own entropy incorrectly, entropy
consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
happening:
. kern.entropy.needed - bits of entropy short of full entropy
. kern.entropy.pending - bits known to be pending in per-CPU pools,
can be consolidated with sysctl -w kern.entropy.consolidate=1
. kern.entropy.epoch - number of times consolidation has happened,
never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
Hash_DRBGs. There are only two in the system: user_cprng for
/dev/urandom and sysctl kern.?random, and kern_cprng for kernel
users which may need to operate in interrupt context up to IPL_VM.

(Calling cprng_strong in interrupt context does not strike me as a
particularly good idea, so I added an event counter to see whether
anything actually does.)

- Event counters provide operator visibility into when reseeding
happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.
 1.12 20-Dec-2005  christos Use common sources with userland.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 07-Aug-2003  agc branches: 1.10.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 10-Oct-2002  jdolecek branches: 1.9.6;
#undef ffs before the ffs() function definition, so that the name
isn't rewrote to __builtin_ffs() on gcc 2.95+; this fixes compilation
on sun2
also change the comment for function
 1.8 27-Mar-1998  cgd branches: 1.8.26; 1.8.28; 1.8.42;
sync with libc
 1.7 13-Oct-1997  lukem rcsid fascism
 1.6 18-Apr-1996  cgd branches: 1.6.12;
don't include user-land headers in libkern files when compiling for
the kernel.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file ffs.c was added on branch magnum on 1993-10-27 22:00:46 +0000
 1.6.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.42.1 23-Nov-2002  tron Pull up revision 1.9 (requested by skrll in ticket #1009):
isn't rewrote to __builtin_ffs() on gcc 2.95+; this fixes compilation
on sun2
also change the comment for function
 1.8.28.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.8.26.1 18-Oct-2002  nathanw Catch up to -current.
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.4 09-Dec-2017  christos Even smaller and takes print function.
 1.3 08-Dec-2017  christos don't ifdef _KERNEL
 1.2 08-Dec-2017  christos use a different, more readable approach.
 1.1 08-Dec-2017  christos coalesce the two copies of hexdump into libkern
 1.14 20-Dec-2005  christos Use common sources with userland.
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 26-Feb-2005  perry branches: 1.12.4;
nuke trailing whitespace
 1.11 04-Dec-2003  keihan branches: 1.11.8; 1.11.10;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.10 22-Aug-2001  itojun branches: 1.10.20;
sync argument/return type of [hn]to[nh][ls] to XNET 5.2 (uint{16,32}_t).
as discussed on tech-net.
 1.9 27-Mar-1998  cgd branches: 1.9.26; 1.9.28;
sync with libc
 1.8 17-Oct-1996  cgd pull down from libc
 1.7 29-May-1996  cgd Copy from libkern:
Add some casts so that we're not bitten by type promotions on 64-bit
systems. Not a great concern since the only 64-bit system currently
supported by NetBSD (Alpha) uses assembly versions of these routines.
 1.6 07-Oct-1995  mycroft branches: 1.6.6;
Update from libc.
 1.5 06-Jan-1995  cgd copy back from libc
 1.4 06-Jan-1995  cgd from libc
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file htonl.c was added on branch magnum on 1993-10-27 22:00:46 +0000
 1.6.6.1 29-May-1996  cgd Pull changes copied from libc to the release branch: Add some casts so
that we're not bitten by type promotions on 64-bit systems.
 1.9.28.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.9.26.1 21-Sep-2001  nathanw Catch up to -current.
 1.10.20.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.20.1 03-Aug-2004  skrll Sync with HEAD
 1.11.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.11.8.1 29-Apr-2005  kent sync with -current
 1.12.4.1 21-Jun-2006  yamt sync with head.
 1.13 20-Dec-2005  christos Use common sources with userland.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 04-Dec-2003  keihan branches: 1.11.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.10 22-Aug-2001  itojun branches: 1.10.20;
sync argument/return type of [hn]to[nh][ls] to XNET 5.2 (uint{16,32}_t).
as discussed on tech-net.
 1.9 27-Mar-1998  cgd branches: 1.9.26; 1.9.28;
sync with libc
 1.8 17-Oct-1996  cgd pull down from libc
 1.7 29-May-1996  cgd Copy from libkern:
Add some casts so that we're not bitten by type promotions on 64-bit
systems. Not a great concern since the only 64-bit system currently
supported by NetBSD (Alpha) uses assembly versions of these routines.
 1.6 07-Oct-1995  mycroft branches: 1.6.6;
Update from libc.
 1.5 06-Jan-1995  cgd copy back from libc
 1.4 06-Jan-1995  cgd from libc
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file htons.c was added on branch magnum on 1993-10-27 22:00:47 +0000
 1.6.6.1 29-May-1996  cgd Pull changes copied from libc to the release branch: Add some casts so
that we're not bitten by type promotions on 64-bit systems.
 1.9.28.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.9.26.1 21-Sep-2001  nathanw Catch up to -current.
 1.10.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.20.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.1 21-Jun-2006  yamt sync with head.
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 14-Mar-1996  christos branches: 1.3.64;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file imax.c was added on branch magnum on 1993-10-13 05:40:37 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 14-Mar-1996  christos branches: 1.3.64;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file imin.c was added on branch magnum on 1993-10-13 05:40:39 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.5 01-Nov-2003  jdolecek g/c index.c and rindex.c (not used anywhere)
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 27-Mar-1998  cgd branches: 1.3.48;
sync with libc
 1.2 22-Feb-1998  mycroft Don't even think about cdefs.h here...
 1.1 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.3.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 18-Apr-2001  thorpej branches: 1.6.38;
ctype-like functions are now in libkern.
 1.5 30-Mar-2000  augustss branches: 1.5.6;
Kill some more register declarations.
 1.4 13-Apr-1999  drochner branches: 1.4.2;
make libkern compile in userland - for testing purposes
 1.3 12-Apr-1999  drochner This was an n_long, not u_long, so u_int32_t is correct.
 1.2 12-Apr-1999  ross libkern just got an inet_addr(), but it won't compile, no prototype. Cleanup...
* Add prototype to libkern.h.
* Remove the almost-identical-copy from libsa/net.[ch].
* Change its type back to the (wrong, but harmless) historical one. (u_long)
* Kill the XXX local prototype in nfs_bootparam.c
 1.1 12-Dec-1997  gwr branches: 1.1.10;
Copied from src/lib/libc/net/inet_pton.c
and adapted for kernel and libsa use.
 1.1.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.38.1 21-Jun-2006  yamt sync with head.
 1.3 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.2 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 07-May-1999  drochner branches: 1.1.2; 1.1.140; 1.1.150; 1.1.156;
move intoa() from libsa:net.c to libkern, turn inet_ntoa() into a macro,
nuke ip_convertaddr()
 1.1.156.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.150.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.140.1 04-May-2009  yamt sync with head.
 1.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file iordi3.c was added on branch magnum on 1993-12-04 05:01:42 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.5 13-Dec-2021  chs revert rev 1.4 ("Add garbage instructions at end of kern_assert after vpanic.")

that change had no effect because vpanic() is marked __dead / noreturn
and thus the compiler would optimize away everything after a call to vpanic().
the original problem has now been fixed differently (but only for x86 so far).
 1.4 14-Mar-2017  riastradh Add garbage instructions at end of kern_assert after vpanic.

This avoids having the return address passed to vpanic confusingly
appear to be some other symbol.
 1.3 19-Nov-2013  christos branches: 1.3.6; 1.3.10; 1.3.14;
For the purposes of static analysis, this never returns.
 1.2 29-Sep-2011  christos branches: 1.2.2; 1.2.12; 1.2.16;
Don't include <sys/systm.h> because it brings in too much stuff that
conflicts with standalone code. Instead modify kern_assert() to be like
panic() and call that.
 1.1 19-Jan-2010  pooka branches: 1.1.4;
Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
 1.1.4.2 11-Mar-2010  yamt sync with head
 1.1.4.1 19-Jan-2010  yamt file kern_assert.c was added on branch yamt-nfs-mp on 2010-03-11 15:04:21 +0000
 1.2.16.1 18-May-2014  rmind sync with head
 1.2.12.2 03-Dec-2017  jdolecek update from HEAD
 1.2.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.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.3.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.3.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.3.6.1 28-Aug-2017  skrll Sync with HEAD
 1.148 02-Mar-2025  riastradh libc: New _r variants of heapsort, mergesort, qsort.

Also kheapsort_r for kernel/standalone use.

These variants allow the caller to pass a cookie through to the
comparison function, e.g. if you want to sort an array of indices
into a buffer.

qsort_r is new in POSIX.1-2024; the others are obvious analogues of
our nonstandard extensions for heapsort and mergesort.

PR lib/58931: qsort_r() missing
 1.147 01-Nov-2024  riastradh string.h: Fix various symbol visibility issues.

1. Order declarations according to POSIX 2024 to make this easier to
review side-by-side with the spec.
2. Fix visibility of memccpy: XSI-only, not POSIX in general; require
_XOPEN_SOURCE, not just _POSIX_C_SOURCE.
3. Omit redundant _XOPEN_SOURCE test around stpcpy/stpncpy.
4. Hide strdup in POSIX 2001. Not POSIX (without XSI) until 2008.
5. Hide strerror_r until POSIX 2001. Can't find evidence of it in
any earlier POSIX or X/Open. (Not 100% sure on this one, maybe
someone can double-check my research.)
6. Add restrict to strlcat/strlcpy.
7. Omit redundant _XOPEN_SOURCE test around strndup and strnlen.
8. Hide strtok_r until POSIX 2001. Can't find evidence of it in
any earlier POSIX or X/Open. (Not 100% sure on this one, maybe
someone can double-check my research.)

Carry the restrict qualifiers on strlcat/strlcpy to libkern too.

Main reference:
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/string.h.html

PR standards/58804: string.h: wrong visibility for memccpy
 1.146 09-Oct-2024  christos deduplicate offsetof (stddef.h) and container_of (container_of.h)
 1.145 06-Sep-2023  mrg branches: 1.145.6;
fix the example for container_of().

needs to be a pointer into the containing structure, not the
value of a pointer inside the structure.
 1.144 31-Dec-2021  riastradh libkern: Make KASSERT verify expression is valid if !DIAGNOSTIC.

This way it is no longer necessary to mark variables __diagused if
they are used in KASSERT conditions.

Fix fallout from this by removing now-unnecessary and `#ifdef
DIAGNOSTIC'.

Don't do the same for KDASSERT if !DEBUG -- unlike KASSERT and
DIAGNOSTIC, variables needed by KDASSERT and DEBUG are likely to be
expensive to compute (and potentially difficult for a compiler to
prove flushable), so we don't want to require them under !DEBUG.
 1.143 17-May-2021  mrg move bi-endian disklabel support from the kernel and libsa into libkern.

- dkcksum() and dkcksum_sized() move from subr_disk.c and from
libsa into libkern/dkcksum.c (which is missing _sized() version),
using the version from usr.sbin/disklabel.

- swap_disklabel() moves from subr_disk_mbr.c into libkern, now called
disklabel_swap(). (the sh3 version should be updated to use this.)

- DISKLABEL_EI becomes a first-class option with opt_disklabel.h.

- add libkern.h to libsa/disklabel.c.

this enables future work for bi-endian libsa/ufs.c (relevant for ffsv1,
ffsv2, lfsv1, and lfsv2), as well as making it possible for ports not
using subr_disk_mbr.c to include bi-endian disklabel support (which,
afaict, includes any disk on mbr-supporting platforms that do not have
an mbr as well as disklabel.)

builds successsfully on: alpha, i386, amd64, sun2, sun3, evbarm64,
evbarm64-eb, sparc, and sparc64. tested in anita on i386 and sparc,
testing in hardware on evbarm64*.
 1.142 21-Jan-2021  thorpej branches: 1.142.4; 1.142.6;
Add a generic set of routines for interacting with OpenFirmware-style
string lists.
 1.141 16-Jan-2021  chs remove unused "_DIAGNOSTIC" option and opt_diagnostic.h.
note that this is unrelated to the widely used "DIAGNOSTIC" option.
 1.140 17-Apr-2020  maxv branches: 1.140.2;
Slightly reorder for clarity, and add header.
 1.139 07-Apr-2020  skrll branches: 1.139.2;
Fix KASAN build on aarch64
 1.138 03-Apr-2020  maxv Add KASAN instrumentation on strcat/strchr/strrchr.
 1.137 14-Dec-2019  riastradh Remove never-used Mersenne twister from libkern.
 1.136 05-Dec-2019  riastradh #ifdef notyet ---> never
 1.135 22-Nov-2019  maxv Ah, strcat/strchr/strrchr are ASM functions, so instrument them.
 1.134 14-Nov-2019  maxv Add support for Kernel Memory Sanitizer (kMSan). It detects uninitialized
memory used by the kernel at run time, and just like kASan and kCSan, it
is an excellent feature. It has already detected 38 uninitialized variables
in the kernel during my testing, which I have since discreetly fixed.

We use two shadows:
- "shad", to track uninitialized memory with a bit granularity (1:1).
Each bit set to 1 in the shad corresponds to one uninitialized bit of
real kernel memory.
- "orig", to track the origin of the memory with a 4-byte granularity
(1:1). Each uint32_t cell in the orig indicates the origin of the
associated uint32_t of real kernel memory.

The memory consumption of these shadows is consequent, so at least 4GB of
RAM is recommended to run kMSan.

The compiler inserts calls to specific __msan_* functions on each memory
access, to manage both the shad and the orig and detect uninitialized
memory accesses that change the execution flow (like an "if" on an
uninitialized variable).

We mark as uninit several types of memory buffers (stack, pools, kmem,
malloc, uvm_km), and check each buffer passed to copyout, copyoutstr,
bwrite, if_transmit_lock and DMA operations, to detect uninitialized memory
that leaves the system. This allows us to detect kernel info leaks in a way
that is more efficient and also more user-friendly than KLEAK.

Contrary to kASan, kMSan requires comprehensive coverage, ie we cannot
tolerate having one non-instrumented function, because this could cause
false positives. kMSan cannot instrument ASM functions, so I converted
most of them to __asm__ inlines, which kMSan is able to instrument. Those
that remain receive special treatment.

Contrary to kASan again, kMSan uses a TLS, so we must context-switch this
TLS during interrupts. We use different contexts depending on the interrupt
level.

The orig tracks precisely the origin of a buffer. We use a special encoding
for the orig values, and pack together in each uint32_t cell of the orig:
- a code designating the type of memory (Stack, Pool, etc), and
- a compressed pointer, which points either (1) to a string containing
the name of the variable associated with the cell, or (2) to an area
in the kernel .text section which we resolve to a symbol name + offset.

This encoding allows us not to consume extra memory for associating
information with each cell, and produces a precise output, that can tell
for example the name of an uninitialized variable on the stack, the
function in which it was pushed on the stack, and the function where we
accessed this uninitialized variable.

kMSan is available with LLVM, but not with GCC.

The code is organized in a way that is similar to kASan and kCSan, so it
means that other architectures than amd64 can be supported.
 1.133 05-Nov-2019  maxv Add Kernel Concurrency Sanitizer (kCSan) support. This sanitizer allows us
to detect race conditions at runtime. It is a variation of TSan that is
easy to implement and more suited to kernel internals, albeit theoretically
less precise than TSan's happens-before.

We do basically two things:

- On every KCSAN_NACCESSES (=2000) memory accesses, we create a cell
describing the access, and delay the calling CPU (10ms).

- On all memory accesses, we verify if the memory we're reading/writing
is referenced in a cell already.

The combination of the two means that, if for example cpu0 does a read that
is selected and cpu1 does a write at the same address, kCSan will fire,
because cpu1's write collides with cpu0's read cell.

The coverage of the instrumentation is the same as that of kASan. Also, the
code is organized in a way similar to kASan, so it is easy to add support
for more architectures than amd64. kCSan is compatible with KCOV.

Reviewed by Kamil.
 1.132 20-Sep-2019  maxv Add ifdefs to eliminate false positives on lgtm, same as coverity.
 1.131 07-Sep-2019  maxv Add KASAN instrumentation for memmove.
 1.130 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.129 27-Aug-2018  maxv Add kasan interceptors for strcpy/strcmp/strlen.
 1.128 20-Aug-2018  maxv Add support for kASan on amd64. Written by me, with some parts inspired
from Siddharth Muralee's initial work. This feature can detect several
kinds of memory bugs, and it's an excellent feature.

It can be enabled by uncommenting these three lines in GENERIC:

#makeoptions KASAN=1 # Kernel Address Sanitizer
#options KASAN
#no options SVS

The kernel is compiled without SVS, without DMAP and without PCPU area.
A shadow area is created at boot time, and it can cover the upper 128TB
of the address space. This area is populated gradually as we allocate
memory. With this design the memory consumption is kept at its lowest
level.

The compiler calls the __asan_* functions each time a memory access is
done. We verify whether this access is legal by looking at the shadow
area.

We declare our own special memcpy/memset/etc functions, because the
compiler's builtins don't add the __asan_* instrumentation.

Initially all the mappings are marked as valid. During dynamic
allocations, we add a redzone, which we mark as invalid. Any access on
it will trigger a kASan error message. Additionally, the compiler adds
a redzone on global variables, and we mark these redzones as invalid too.
The illegal-access detection works with a 1-byte granularity.

For now, we cover three areas:

- global variables
- kmem_alloc-ated areas
- malloc-ated areas

More will come, but that's a good start.
 1.127 08-Jul-2018  christos provide memmem
 1.126 09-Dec-2017  christos branches: 1.126.2; 1.126.4;
Even smaller and takes print function.
 1.125 08-Dec-2017  christos coalesce the two copies of hexdump into libkern
 1.124 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.123 11-May-2016  rtr provide const versions of container_of macros.

discussed with riastradh@ by email
 1.122 02-May-2016  christos move scsipi_strvis -> libkern:strnvisx()
change the prototype to match userland
fix sizes of strings passed to it
 1.121 30-Aug-2015  uebayasi Include opt_diagnostic.h.
 1.120 29-May-2015  matt If the platform support popcount as a __builtin, use that in preference
to the libc versions.
 1.119 09-May-2015  christos tricks with sizeof() make coverity complain.
 1.118 20-Apr-2015  riastradh Add container_of to libkern.

Given x = &c->f, container_of(x, T, f) yields c, where T is the type
of c.

Discussed on tech-kern a while ago:

https://mail-index.netbsd.org/tech-kern/2013/03/21/msg015131.html
 1.117 16-Jan-2015  christos strtoi and strtou for the kernel
 1.116 20-Nov-2014  christos branches: 1.116.2;
bcdtobin and bintobcd are now inlines in <dev/clock_subr.h>
 1.115 10-Aug-2014  tls branches: 1.115.2;
Merge tls-earlyentropy branch into HEAD.
 1.114 19-Jul-2014  lneto lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE
 1.113 27-Feb-2014  joerg branches: 1.113.2;
Provide labs, llabs and imaxabs for kernel use.
 1.112 27-Dec-2013  christos add strncat (for acpi)
 1.111 15-Dec-2013  pooka Allow overriding CTASSERT. This helps with building NetBSD sources with
compilers that don't support __COUNTER__ -- shifting the CTASSERTs
around to avoid __LINE__ conflicts is a hopeless struggle.
 1.110 11-Dec-2013  joerg Allow kernel code to access constant databases by moving cdbr(3) and the
required mi_vector_hash(3) into src/common.
 1.109 02-Dec-2013  lneto changed lua_Number to int64_t
 1.108 28-Aug-2013  riastradh Fix libkern's prototype for explicit_memset.
 1.107 24-Jun-2013  riastradh branches: 1.107.2;
Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.106 30-Aug-2012  drochner branches: 1.106.2;
Add "consttime_bcmp" and "explicit_bzero" functions for both kernel
abd userland, as proposed on tech-security, with explicit_bzero using
a volatile function pointer as suggested by Alan Barrett.
Both do what the name says. For userland, both are prefixed by "__"
to keep them out of the user namespace.
Change some memset/memcmp uses to the new functions where it makes
sense -- these are just some examples, more to come.
 1.105 22-Jan-2012  rmind Add CTASSERT_SIGNED() and CTASSERT_UNSIGNED().
 1.104 28-Nov-2011  tls branches: 1.104.2;
Remove arc4random() and arc4randbytes() from the kernel API. Replace
arc4random() hacks in rump with stubs that call the host arc4random() to
get numbers that are hopefully actually random (arc4random() keyed with
stack junk is not). This should fix some of the currently failing anita
tests -- we should no longer generate duplicate "random" MAC addresses in
the test environment.
 1.103 01-Oct-2011  chs branches: 1.103.2;
use gcc builtin for memset() on vax too.
 1.102 29-Sep-2011  christos Don't include <sys/systm.h> because it brings in too much stuff that
conflicts with standalone code. Instead modify kern_assert() to be like
panic() and call that.
 1.101 27-Sep-2011  jym Modify *ASSERTMSG() so they are now used as variadic macros. The main goal
is to provide routines that do as KASSERT(9) says: append a message
to the panic format string when the assertion triggers, with optional
arguments.

Fix call sites to reflect the new definition.

Discussed on tech-kern@. See
http://mail-index.netbsd.org/tech-kern/2011/09/07/msg011427.html
 1.100 25-Sep-2011  jym Do as Joerg said and kill the __STDC__ blocks. They only make sense for
things used by assembler, which won't be the case for these macros.
 1.99 01-Sep-2011  jym Make strnlen(3) accessible in kernel. ok christos@.
 1.98 05-Jul-2011  matt If GCC 4.0 or later, use __builtin_offsetof for offsetof.
This make GCC 4.5 with offsetof in mbuf.h and kern_cpu.c
 1.97 19-Feb-2011  matt Define CTASSERT in terms of __CTASSERT
 1.96 26-Jan-2011  matt Fix KDASSERTMSG defintions for !DEBUG
 1.95 24-Jan-2011  matt Add KDASSERTMSG (KDASSERT already exists).
 1.94 25-Apr-2010  rmind branches: 1.94.2; 1.94.4;
Fix KASSERTMSG() to be consistent with KASSERT() logic, not inverted.
Hi matt@!
 1.93 19-Jan-2010  pooka branches: 1.93.2; 1.93.4;
Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
 1.92 21-Jul-2009  joerg Move popcount et al to src/common and add popcount32/popcount64.
Requested by rmind@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.
 1.91 13-May-2009  pgoyette Implement snprintb_m(3) to provide multi-line bit/bit-field decode.
Discussed on tech-kern.
 1.90 25-Mar-2009  tls Fix build problems caused by crc32 addition to libkern. Also, this makes
the i386 bootblocks about 2K smaller than they were before we monkeyed
with crc32 at all.
 1.89 25-Mar-2009  darran Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.88 23-Mar-2009  tsutsui Don't use gcc's __builtin_*() functions #if defined(_STANDALONE)
because they could be larger than __OPTIMIZE_SIZE__'ed libsa ones and
__builtin_memcpy() on vax rejects NULL (i.e. copying from/to address 0x0).

No particular comments on tech-toolchain.

Tested on alpha, arc, cobalt, hp300, i386, landisk, macppc, news68k, sgimips,
sparc, sparc64, sun3, and vax (on simh).
 1.87 18-Mar-2009  tsutsui - remove bcmp(9), bcopy(9), and bzero(9) from libkern since <sys/systm.h> has
macro which replace them with mem*() functions in #ifdef _KERNEL as noted
in man pages
- move declarations of bcopy(3) and bzero(3) into <lib/libsa/stand.h>
since they are still in libsa for some MD standalone sources
(I guess all bcmp(3) in standalone sources have been replaced with memcmp(3)
but they should be replaced with memcmp() anyway)
 1.86 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.85 16-Dec-2008  christos branches: 1.85.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.84 16-Nov-2008  ad Our qsort() is inappropriate for kernel use because it makes recursive
calls. Replace it with a kheapsort() function in kernel. Pointed out
by tron@.
 1.83 16-Nov-2008  ad Make qsort() available in libkern.
 1.82 08-Sep-2008  gmcgarry branches: 1.82.2; 1.82.4; 1.82.8;
Replace most gcc-specific __attribute__ uses with BSD-style sys/cdef.h
preprocessor macros.
 1.81 02-Jul-2008  matt branches: 1.81.2;
Add KASSERTMSG(e, msg) for umass.c. XXX directly calls panic.
 1.80 02-Jul-2008  matt Add CTASSERT (compile time assert) from FreeBSD.
Causes sources to fail to compile:
<file>:<line>: error: size of array '__ctassert<line>' is negative
 1.79 25-Mar-2008  christos branches: 1.79.4; 1.79.6; 1.79.8;
fix again
 1.78 25-Mar-2008  christos fix bcopy again
 1.77 25-Mar-2008  christos fix bcopy prototype
 1.76 25-Mar-2008  christos add a prototype for bcopy.
 1.75 17-Feb-2008  matt branches: 1.75.6;
Don't need to that particular in mtprng_random(). Use 2 values instead of 8.
 1.74 02-Feb-2008  matt Improve my version of mtprng_random. Reshuffle things. Add an compatible
version of init_by_array.
 1.73 31-Jan-2008  matt Add Mersenne Twister prototypes and state struct to libkern.h
Cleanup a comment. s/RLEN/MTPRNG_RLEN/g s/POS1/MTPRNG_POS1/g
Remove unneeded test code.
 1.72 25-Dec-2007  perry Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.71 24-Sep-2007  pooka branches: 1.71.4; 1.71.6; 1.71.10;
Rename __assert() to __kernassert() so that it doesn't collide
with the libc version. They take different arguments.
 1.70 29-Jul-2007  ad branches: 1.70.4; 1.70.6; 1.70.8; 1.70.10;
Disable kernel assertions if panicstr != NULL.
 1.69 09-Apr-2007  matt branches: 1.69.4;
Enable builtin_ffs for vax
 1.68 21-Feb-2007  thorpej branches: 1.68.4; 1.68.6;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.67 08-Oct-2006  thorpej branches: 1.67.2; 1.67.4; 1.67.6;
- Move strtoll.c and strtoull.c from libc/stdlib to common/libc/stdlib.
- Add strtoll.c and strtoull.c to libkern.
 1.66 10-Sep-2006  matt branches: 1.66.2;
If __STDC__ and GNU C >= 3.0, define C99's bool, true, false
 1.65 31-Aug-2006  dyoung branches: 1.65.2;
Per discussion on tech-kern and tech-userlevel, move the bit-twiddling
macros, __BIT, __BITS, SHIFTIN, SHIFTOUT, and __arraycount() from
lib/libkern/libkern.h to sys/cdefs.h. Add a __-prefix to SHIFTIN
and SHIFTOUT, and add a manual page for the bit-twiddling macros,
bits(3).

Make the __BIT and __BITS macros "widthless," as best I can, by
changing their type to uintmax_t from uint32_t. XXX The manual
page lags this change by a bit.

Define __PRIxBIT and __PRIxBITS printf(3) format strings.
 1.64 25-Aug-2006  matt Add __NULL_STMT which is do { } while (/* CONSTCOND */ 0)
 1.63 08-Jul-2006  matt With VAX & GCC4, use builtin memset and memmove.
 1.62 22-Apr-2006  thorpej branches: 1.62.4;
Move strtoumax.c from libc/stdlib to common/libc/stdlib and include it
in libkern. Required for new code coming soon.
 1.61 15-Apr-2006  christos Imply DIAGNOSTIC if __COVERITY__.
 1.60 14-Apr-2006  christos If __COVERITY__ is defined, turn on KASSERT and _DIAGASSERT.
 1.59 27-Mar-2006  dyoung Per discussion on source-changes@, add __arraycount(array) for
counting the number of elements in a static array, using the idiom,
sizeof(array)/sizeof(array[0]).

XXX This may move in the future, but this is a safe place to put
XXX it for use in the kernel.
 1.58 11-Mar-2006  kleink branches: 1.58.2;
Provide BCD<->binary conversion in libkern and turn <dev/clock_subr.h>'s
FROMBCD()/TOBCD() macros into wrappers around it, resulting in both
smaller code footprint and elimination of possible issues due to
multiple evaluation of macro arguments.

Suggested by Simon Burge and Anders Gavare on tech-kern.
 1.57 08-Mar-2006  dyoung Change macro names to avoid collisions:

BIT -> __BIT
BITS -> __BITS
 1.56 08-Mar-2006  dyoung Move my bit-twiddling macros to libkern.h from my drivers, where
I had duplicated them. Improve the macros' names. Simplify their
implementation.

A brief description of each macro is below.

BIT(n): Return a bitmask with bit m set, where the least
significant bit is bit 0.

BITS(m, n): Return a bitmask with bits m through n, inclusive,
set. It does not matter whether m>n or m<=n.
The least significant bit is bit 0.

A "bitfield" is a span of consecutive bits defined by a
bitmask, where 1s select the bits in the bitfield. SHIFTIN,
SHIFTOUT, and SHIFTOUT_MASK help read and write bitfields
from device registers.

SHIFTIN(v, mask): Left-shift bits `v' into the bitfield
defined by `mask', and return them. No
side-effects.

SHIFTOUT(v, mask): Extract and return the bitfield selected
by `mask' from `v', right-shifting the
bits so that the rightmost selected bit
is at bit 0. No side-effects.

SHIFTOUT_MASK(mask): Right-shift the bits in `mask' so that
the rightmost non-zero bit is at bit
0. This is useful for finding the
greatest unsigned value that a bitfield
can hold. No side-effects. Note that
SHIFTOUT_MASK(m) = SHIFTOUT(m, m).

Examples:

/*
* Register definitions taken from the RFMD RF3000 manual.
*/
#define RF3000_GAINCTL 0x11 /* TX variable gain control */
#define RF3000_GAINCTL_TXVGC_MASK BITS(7, 2)
#define RF3000_GAINCTL_SCRAMBLER BIT(1)

/*
* Shift the transmit power into the transmit-power field of the
* gain-control register and write it to the baseband processor.
*/
atw_rf3000_write(sc, RF3000_GAINCTL,
SHIFTIN(txpower, RF3000_GAINCTL_TXVGC_MASK));


/*
* Register definitions taken from the ADMtek ADM8211 manual.
*
*/
#define ATW_RXSTAT_OWN BIT(31) /* 1: NIC may fill descriptor */
/* ... */
#define ATW_RXSTAT_DA1 BIT(17) /* DA bit 1, admin'd address */
#define ATW_RXSTAT_DA0 BIT(16) /* DA bit 0, group address */
#define ATW_RXSTAT_RXDR_MASK BITS(15,12) /* RX data rate */
#define ATW_RXSTAT_FL_MASK BITS(11,0) /* RX frame length, last
* descriptor only
*/

/* Extract the frame length from the Rx descriptor's
* status field.
*/
len = SHIFTOUT(rxstat, ATW_RXSTAT_FL_MASK);
 1.55 16-Feb-2006  perry branches: 1.55.2; 1.55.4;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.54 24-Dec-2005  perry branches: 1.54.2; 1.54.4; 1.54.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.53 21-Dec-2005  christos Add the state setting functions for the new random function, but use the
small one by default, so that we can switch in the future if we want to.
 1.52 20-Dec-2005  christos Provide _DIAGASSERT and NULL, so that we don't have to do it in *all* the
libkern files.
Also the new inet_addr, provides inet_aton; advertise it.
 1.51 11-Dec-2005  christos merge ktrace-lwp.
 1.50 13-Aug-2003  ragge branches: 1.50.16;
Do not use the builtins for the mem* functions on vax, the compiler gets
confused with the static inline functions vax uses.
 1.49 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.48 15-May-2003  itojun branches: 1.48.2;
add strl{cpy,cat} to libkern. code from lib/libc/string (originally from openbsd).
 1.47 24-Oct-2002  christos make offsetof lint friendlier.
 1.46 06-Oct-2002  tls ESP output was drawing down the entropy pool at a ferocious rate, a
particular problem on hosts with only wireless interfaces that are
definitely not safe to use as entropy sources.

Add arc4randbytes() which hands out bytes from the same source used
by arc4random(). This is intended to be a _temporary_ interface
until we can design and implement a better general PRNG interface
that is decoupled from the entropy-pool implementation.

Modify key_randomfill() (used only for initialization vectors on
SA creation and via key_sa_stir_iv(), which does not "stir",
despite its name) to use arc4randbytes() instead of pulling bits
directly from the entropy pool. It is my hope that this change
will pose minimal integration problems for the KAME folks as the
random-pool interface is *already* different between each BSD
variant; this just simplifies the NetBSD case and solves a
fairly serious problem.

Note that it is generally considered acceptable cryptographic
practice to use a fast stream cipher to generate IVs for encryption
with stronger block ciphers. For example, the use of "non-Approved"
PRNGs to generate IVs for "Approved" block ciphers is explicitly
sanctioned by FIPS 140-2.
 1.45 04-Oct-2002  junyoung Add strstr() to libkern. For now, it's only used in i386 (for processor
identification).
 1.44 04-Oct-2002  matt Ansify's (use prototypes).
 1.43 25-Aug-2002  thorpej Tweak the previous change so that a prototype is always provided.
 1.42 23-Aug-2002  ragge Do not try to use "__builtin_ffs" on vax, ffs is an instruction already.
Maybe possible to teach gcc to use it?
 1.41 21-Aug-2002  thorpej GCC 2.95 supports __builtin_ffs(); use it.
 1.40 28-May-2002  itojun have arc4random(9).
 1.39 28-Dec-2001  thorpej branches: 1.39.8; 1.39.10;
Always provide alloca() as __builtin_alloca().
 1.38 23-Dec-2001  thorpej The kernel is now built with -ffreestanding, so GCC built-ins are
disabled. Explicitly re-enable some that we want to use, namely:

* memcpy() -> __builtin_memcpy()
* memcmp() -> __builtin_memcmp()
* memset() -> __builtin_memset()

* strcpy() -> __builtin_strcpy()
* strcmp() -> __builtin_strcmp()
* strlen() -> __builtin_strlen()

We might also consider some others for GCC 3.x.
 1.37 07-Jul-2001  perry branches: 1.37.2;
restore bzero and bcmp prototypes for now -- this has to be hashed out.
 1.36 07-Jul-2001  simonb Put the prototypes for bcmp() and bzero() back (ifdef _STANDALONE) so that
libsa builds again.
 1.35 07-Jul-2001  perry Remove bcmp and bzero prototypes. And yes, I actually checked and
tested this time. (Slap self repeatedly.)
 1.34 30-Apr-2001  lukem remove some lint
 1.33 05-Apr-2001  thorpej Add ctype routines.
 1.32 01-Nov-2000  thorpej branches: 1.32.2;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.31 12-Oct-2000  msaitoh enclose offsetof macro definition with #ifndef offsetof ... #endif
 1.30 08-May-2000  thorpej branches: 1.30.4;
__predict_true() the expressions passed to the assert family, so
as to move the calls to __assert() out-of-line.

Suggested by Bill Sommerfeld.
 1.29 29-Mar-2000  simonb Multiple include protection.
 1.28 29-Nov-1999  simonb Move strtoul.c (via CVS repo copy) to libkern. Also sort prototypes
in libkern.h and sources in arm32/Makefile.inc alphabetically.
 1.27 10-Sep-1999  tron branches: 1.27.2; 1.27.8;
Add prototype for memcmp() as suggested by Anders Hjalmarsson in
PR kern/8360.
 1.26 07-May-1999  drochner move intoa() from libsa:net.c to libkern, turn inet_ntoa() into a macro,
nuke ip_convertaddr()
 1.25 12-Apr-1999  drochner This was an n_long, not u_long, so u_int32_t is correct.
 1.24 12-Apr-1999  ross libkern just got an inet_addr(), but it won't compile, no prototype. Cleanup...
* Add prototype to libkern.h.
* Remove the almost-identical-copy from libsa/net.[ch].
* Change its type back to the (wrong, but harmless) historical one. (u_long)
* Kill the XXX local prototype in nfs_bootparam.c
 1.23 31-Jul-1998  perry branches: 1.23.8;
make libkern build memmove() properly
 1.22 21-Jun-1998  christos branches: 1.22.2;
Add a small string pattern matching function to facilitate pcmcia cis string
matches.
 1.21 01-Mar-1998  fvdl Merge with Lite2 + local changes
 1.20 22-Feb-1998  mycroft Add memcpy() and memset(), and sort.
 1.19 28-Jan-1998  thorpej Add offsetof().
 1.18 23-Jan-1998  drochner remove prototypes for deprecated index() and rindex()
 1.17 22-Jan-1998  drochner add prototype for index()
 1.16 21-Jan-1998  cgd add strrchr
 1.15 24-Oct-1997  mjacob Add missing NULL define for KERNEL case and prototype into libkern.h.
 1.14 07-Jul-1997  cgd mark prototypes for static inline functions as possibly unused (with
__attribute__ ((unused))), to avoid generating warnings when compiling
without optimization but with most ports' default warning flags.
 1.13 13-Jun-1997  drochner Add prototype for bzero() (since it is implemented here).
 1.12 18-Jan-1997  cgd add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.11 24-Oct-1996  cgd second and third args to scanc() (string and table) are not and should not
be modified. Make them 'const'.
 1.10 22-Sep-1996  cgd add a missing #else, pointed out by Wolfgang Solfrank
 1.9 27-Aug-1996  cgd Add machine-independent assertion-checking support. macros are:

assert() which always does assertion checking
unless "NDEBUG" is defined.

KASSERT() which does assertion checking if DIAGNOSTIC
is defined.

KDASSERT() which does assertion checking if DEBUG is
define. This macro exists for compatibility
with existing ports' assertion checking macros.
(Assertion checking is not typically an
"expensive" operation, and DIAGNOSTIC should be
used for inexpensive consistency checks.)
 1.8 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.7 14-Mar-1996  christos - Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.6 13-Feb-1996  christos Add declaration of strncasecmp.
 1.5 23-Sep-1995  leo Add abs() function as an 'inline'. The atari-port needs it since the
-fno-builtin is used in the kernel Makefile.
 1.4 14-Aug-1995  cgd prototype inline functions, almost as suggested by Jonathan Stone in PR 1258.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 15-Jul-1994  cgd don't use inline, use __inline, like cdefs intends (so it can kill it if nongcc
 1.1 05-May-1994  cgd branches: 1.1.2;
lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.1.2.1 15-Jul-1994  cgd updates from trunk. basically, C language errors.
 1.22.2.1 08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.23.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.27.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.27.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.27.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.27.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.30.4.1 05-Nov-2000  tv Pullup 1.31 [msaitoh]:
enclose offsetof macro definition with #ifndef offsetof ... #endif
 1.32.2.8 11-Nov-2002  nathanw Catch up to -current
 1.32.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.32.2.6 27-Aug-2002  nathanw Catch up to -current.
 1.32.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.32.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.32.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.32.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.32.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.37.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.37.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.37.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.39.10.2 03-Dec-2002  he Pull up revisions 1.42-1.43 (requested by thorpej in ticket #1024):
Don't use __builtin_ffs() on vax, ffs is an instruction
there already. Also, always provide an ffs() prototype.
Should fix build problem on vax.
 1.39.10.1 21-Nov-2002  he Pull up revision 1.41 (requested by thorpej in ticket #710):
GCC 2.95 supports __builtin_ffs(), so use it.
 1.39.8.2 29-Aug-2002  gehenna catch up with -current.
 1.39.8.1 30-May-2002  gehenna Catch up with -current.
 1.48.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.48.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.48.2.1 03-Aug-2004  skrll Sync with HEAD
 1.50.16.8 27-Feb-2008  yamt sync with head.
 1.50.16.7 04-Feb-2008  yamt sync with head.
 1.50.16.6 21-Jan-2008  yamt sync with head
 1.50.16.5 27-Oct-2007  yamt sync with head.
 1.50.16.4 03-Sep-2007  yamt sync with head.
 1.50.16.3 26-Feb-2007  yamt sync with head.
 1.50.16.2 30-Dec-2006  yamt sync with head.
 1.50.16.1 21-Jun-2006  yamt sync with head.
 1.54.6.2 01-Jun-2006  kardel Sync with head.
 1.54.6.1 22-Apr-2006  simonb Sync with head.
 1.54.4.1 09-Sep-2006  rpaulo sync with head
 1.54.2.1 18-Feb-2006  yamt sync with head.
 1.55.4.2 11-May-2006  elad sync with head
 1.55.4.1 19-Apr-2006  elad sync with head.
 1.55.2.6 14-Sep-2006  yamt sync with head.
 1.55.2.5 03-Sep-2006  yamt sync with head.
 1.55.2.4 11-Aug-2006  yamt sync with head
 1.55.2.3 24-May-2006  yamt sync with head.
 1.55.2.2 01-Apr-2006  yamt sync with head.
 1.55.2.1 13-Mar-2006  yamt sync with head.
 1.58.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.58.2.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.62.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.65.2.1 18-Nov-2006  ad Sync with head.
 1.66.2.1 22-Oct-2006  yamt sync with head
 1.67.6.1 07-Apr-2008  skrll Oops, missed this one.
 1.67.4.2 15-Apr-2007  yamt sync with head.
 1.67.4.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.67.2.1 19-Apr-2008  bouyer Pull up following revision(s) (requested by skrll in ticket #1129):
share/mk/bsd.own.mk: revision 1.489.4.3
gnu/dist/gcc4/gcc/config/vax/vax.h: revision 1.2.6.1
gnu/dist/gcc4/gcc/config/vax/builtins.md: revision 1.2.10.2
sys/arch/vax/conf/Makefile.vax: revision 1.77.22.1
gnu/dist/gcc4/gcc/config/vax/vax-protos.h: revision 1.1.1.1.6.1
gnu/dist/binutils/gas/config/tc-vax.h: revision 1.1.1.1.18.1
gnu/lib/libgcc4/libgcc/Makefile: revision 1.2.6.1
sys/arch/vax/include/macros.h: revision 1.37.14.1
gnu/lib/crtstuff4/Makefile: revision 1.1.6.1
gnu/dist/gcc4/gcc/config/vax/elf.h: revision 1.1.1.1.6.1
gnu/dist/gcc4/gcc/config/vax/vax.c: revision 1.1.1.1.6.1
sys/arch/vax/boot/Makefile.inc: revision 1.12.16.1
tools/gcc/Makefile: revision 1.22.4.1
lib/libcrypto/Makefile: revision 1.46.4.2
gnu/dist/gcc4/gcc/config/vax/netbsd-elf.h: revision 1.1.1.1.6.1
sys/lib/libkern/libkern.h: revision 1.67.6.1
gnu/dist/gcc4/gcc/config/vax/predicates.md: revision 1.3.10.2
gnu/dist/binutils/bfd/elf32-vax.c: revision 1.5.6.1
gnu/dist/gcc4/gcc/config/vax/vax.md: revision 1.1.1.1.4.1.2.1
gnu/dist/gcc4/gcc/config/vax/vax.opt: revision 1.1.1.1.6.1
gnu/dist/binutils/gas/config/tc-vax.c: revision 1.4.4.1.2.1
Pullup changes to get vax shlibs working from the wrstuden-fixsa branch.
 1.68.6.1 11-Jul-2007  mjf Sync with head.
 1.68.4.3 09-Oct-2007  ad Sync with head.
 1.68.4.2 20-Aug-2007  ad Sync with HEAD.
 1.68.4.1 10-Apr-2007  ad Sync with head.
 1.69.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.70.10.2 29-Jul-2007  ad Disable kernel assertions if panicstr != NULL.
 1.70.10.1 29-Jul-2007  ad file libkern.h was added on branch matt-mips64 on 2007-07-29 11:46:03 +0000
 1.70.8.1 06-Oct-2007  yamt sync with head.
 1.70.6.3 23-Mar-2008  matt sync with HEAD
 1.70.6.2 09-Jan-2008  matt sync with HEAD
 1.70.6.1 06-Nov-2007  matt sync with HEAD
 1.70.4.1 02-Oct-2007  joerg Sync with HEAD.
 1.71.10.1 02-Jan-2008  bouyer Sync with HEAD
 1.71.6.1 26-Dec-2007  ad Sync with head.
 1.71.4.1 18-Feb-2008  mjf Sync with HEAD.
 1.75.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.75.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.75.6.2 02-Jul-2008  mjf Sync with HEAD.
 1.75.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.79.8.1 03-Jul-2008  simonb Sync with head.
 1.79.6.2 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.79.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.79.4.5 11-Aug-2010  yamt sync with head.
 1.79.4.4 11-Mar-2010  yamt sync with head
 1.79.4.3 19-Aug-2009  yamt sync with head.
 1.79.4.2 16-May-2009  yamt sync with head
 1.79.4.1 04-May-2009  yamt sync with head.
 1.81.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.81.2.1 19-Oct-2008  haad Sync with HEAD.
 1.82.8.5 14-Feb-2014  matt Change KASSERTMSG/KDASSERTMSG to use varadic arguments like HEAD.
panic -> vpanic, add panic wrapper to vpanic.
 1.82.8.4 27-Dec-2011  matt Add popcount32 and popcount64 for flash/nand
 1.82.8.3 29-Apr-2011  matt Move CTASSERT to __CTASSERT in <sys/cdefs.h> (from current)
Add KDASSERTMSG (from current)
 1.82.8.2 03-Feb-2011  cliff fix KASSERTMSG
 1.82.8.1 21-Apr-2010  matt sync to netbsd-5
 1.82.4.2 03-May-2009  snj branches: 1.82.4.2.4;
Pull up following revision(s) (requested by tls in ticket #611):
common/dist/zlib/zlib.h: revision 1.3
sys/lib/libkern/crc32.c: revision 1.2
sys/lib/libkern/libkern.h: revision 1.90 via patch
sys/lib/libsa/cread.c: revision 1.23
sys/lib/libz/Makefile: revision 1.16
Fix build problems caused by crc32 addition to libkern. Also, this makes
the i386 bootblocks about 2K smaller than they were before we monkeyed
with crc32 at all.
 1.82.4.1 03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
sys/lib/libkern/Makefile: patch
sys/lib/libkern/crc32.c: revision 1.1
sys/lib/libkern/crc32.h: revision 1.1
sys/lib/libkern/libkern.h: revision 1.89
sys/lib/libkern/arch/i386/Makefile.inc: revision 1.28
sys/net/zlib.h: revision 1.14 via patch
sys/opencrypto/crypto.c: revision 1.33
sys/opencrypto/cryptodev.c: revision 1.46
sys/opencrypto/cryptodev.h: revision 1.16
sys/opencrypto/cryptosoft.c: revision 1.24
sys/opencrypto/cryptosoft.h: revision 1.6
sys/opencrypto/deflate.h: revision 1.6
sys/opencrypto/cryptosoft_xform.c: revision 1.12
sys/opencrypto/deflate.c: revision 1.13
sys/opencrypto/files.opencrypto: revision 1.20
sys/opencrypto/ocryptodev.c: revision 1.1
sys/opencrypto/ocryptodev.h: revision 1.1
sys/opencrypto/xform.c: revision 1.18
sys/opencrypto/xform.h: revision 1.10
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.82.4.2.4.1 07-Jan-2011  matt Fix KASSERTMSG.
 1.82.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.82.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.85.2.2 23-Jul-2009  jym Sync with HEAD.
 1.85.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.93.4.4 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.93.4.3 05-Mar-2011  rmind sync with head
 1.93.4.2 30-May-2010  rmind sync with head
 1.93.4.1 25-Apr-2010  rmind Pull-up rev 1.94
 1.93.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.94.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.94.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.94.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.103.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.103.2.2 30-Oct-2012  yamt sync with head
 1.103.2.1 17-Apr-2012  yamt sync with head
 1.104.2.1 18-Feb-2012  mrg merge to -current.
 1.106.2.2 03-Dec-2017  jdolecek update from HEAD
 1.106.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.107.2.2 18-May-2014  rmind sync with head
 1.107.2.1 28-Aug-2013  rmind sync with head
 1.113.2.3 10-Aug-2014  tls Rebase.
 1.113.2.2 09-Aug-2014  tls (Temporarily) disable LZF in libkern -- it introduces a dependency from
src/sys to src/external which I'll need to fix by moving the LZF sources.
 1.113.2.1 07-Apr-2014  tls LZF in the kernel. As an entropy estimator for now but it's very small, and
we could use it for ipcomp, for hibernation, for paging, for core dumps, etc.
 1.115.2.1 22-Apr-2015  snj Pull up following revision(s) (requested by roy in ticket #648):
common/lib/libc/stdlib/_strtoi.h: revisions 1.1, 1.2
common/lib/libc/stdlib/strtoi.c: revision 1.1
common/lib/libc/stdlib/strtou.c: revision 1.1
distrib/sets/lists/base/ad.aarch64: patch
distrib/sets/lists/base/ad.arm: patch
distrib/sets/lists/base/ad.mips: patch
distrib/sets/lists/base/ad.powerpc: patch
distrib/sets/lists/base/md.amd64: patch
distrib/sets/lists/base/md.sparc64: patch
distrib/sets/lists/base/shl.mi: patch
distrib/sets/lists/comp/mi: revision 1.1939
distrib/sets/lists/debug/ad.aarch64: patch
distrib/sets/lists/debug/ad.arm: patch
distrib/sets/lists/debug/ad.mips: patch
distrib/sets/lists/debug/ad.powerpc: patch
distrib/sets/lists/debug/md.amd64: patch
distrib/sets/lists/debug/md.sparc64: patch
distrib/sets/lists/debug/shl.mi: patch
include/inttypes.h: revision 1.11
lib/libc/shlib_version: patch
lib/libc/stdlib/Makefile.inc: revision 1.84
lib/libc/stdlib/strtol.3: revisions 1.27-1.31
lib/libc/stdlib/strtoul.3: revisions 1.26-1.29
sys/lib/libkern/Makefile.libkern: revision 1.37
sys/lib/libkern/libkern.h: revision 1.117
tools/compat/Makefile: revision 1.73
tools/compat/compat_defs.h: revision 1.101
tools/compat/configure.ac: revision 1.83
tools/compat/configure: revision 1.82
tools/compat/nbtool_config.h.in: revision 1.36
add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
--
strtoi and strtou additions
--
strtoi and strtou for the kernel
--
strtoi and strtou additions
--
strtoi and strtou man pages
--
strto{i,u}
--
regen
--
Remove trailing whitespace.
--
match variable names with man page (Kamil Rytarowski)
--
cleanups from (Kamil Rytarowski)
--
add strtoi strtou (Kamil Rytarowski)
--
PR/49640: Kamil Rytarowski: Improve error printing
--
Use existing month for Dd.
 1.116.2.4 29-May-2016  skrll Sync with HEAD
 1.116.2.3 22-Sep-2015  skrll Sync with HEAD
 1.116.2.2 06-Jun-2015  skrll Sync with HEAD
 1.116.2.1 06-Apr-2015  skrll Sync with HEAD
 1.126.4.4 21-Apr-2020  martin Sync with HEAD
 1.126.4.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.126.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.126.4.1 10-Jun-2019  christos Sync with HEAD
 1.126.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.126.2.1 28-Jul-2018  pgoyette Sync with HEAD
 1.139.2.1 20-Apr-2020  bouyer Sync with HEAD
 1.140.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.142.6.1 31-May-2021  cjep sync with head
 1.142.4.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.145.6.1 02-Aug-2025  perseant Sync with HEAD
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 14-Mar-1996  christos branches: 1.3.64;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file lmax.c was added on branch magnum on 1993-10-13 05:40:40 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 14-Mar-1996  christos branches: 1.3.64;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file lmin.c was added on branch magnum on 1993-10-13 05:40:41 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.3 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file locc.c was added on branch magnum on 1993-10-13 05:40:42 +0000
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 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 22364, verified by myself.
 1.7 20-Oct-2002  scw branches: 1.7.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.6 27-Mar-1998  cgd branches: 1.6.26;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file lshldi3.c was added on branch magnum on 1993-12-04 05:01:43 +0000
 1.6.26.1 11-Nov-2002  nathanw Catch up to -current
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 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 22364, verified by myself.
 1.7 20-Oct-2002  scw branches: 1.7.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.6 27-Mar-1998  cgd branches: 1.6.26;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file lshrdi3.c was added on branch magnum on 1993-12-04 05:01:44 +0000
 1.6.26.1 11-Nov-2002  nathanw Catch up to -current
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.8 03-Sep-2018  riastradh Rename min.c -> uimin.c, max.c -> uimax.c in libkern.
 1.7 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.6 14-Mar-2009  dsl branches: 1.6.62; 1.6.64;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 14-Mar-1996  christos branches: 1.3.64;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file max.c was added on branch magnum on 1993-10-13 05:40:44 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.6.64.1 10-Jun-2019  christos Sync with HEAD
 1.6.62.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.16 20-Dec-2005  christos Use common sources with userland.
 1.15 11-Dec-2005  christos merge ktrace-lwp.
 1.14 02-Oct-2005  chs put mcount.c in the normal object list, so that "make depend" works.
use a gcc attribute to prevent it from being instrumented.
 1.13 26-Feb-2005  perry branches: 1.13.4;
nuke trailing whitespace
 1.12 07-Aug-2003  agc branches: 1.12.8; 1.12.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 05-Sep-2000  thorpej branches: 1.11.24;
Move the Alpha _mcount() into a .S file so that it can be
pre-processed, like other Alpha assembly files.
 1.10 17-Jan-1999  mrg branches: 1.10.8;
update from libc; RCSID, register.
 1.9 27-Mar-1998  cgd branches: 1.9.4;
sync with libc
 1.8 07-Dec-1996  fvdl Move _MCOUNT_DECL prototype back here again (grmbl).
 1.7 05-Dec-1996  fvdl Remove _MCOUNT_DECL prototype declaration of _mcount() again; move it
to <machine/profile.h>
 1.6 04-Dec-1996  fvdl Add prototype for _mcount, to make this compile with warnings on.
 1.5 29-Jun-1996  abrown Prevent recursive invocation of mcount() while in kernel by setting profiling
state to BUSY while in mcount(). This allows profiling to work when mcount()
calls a profiled routine (for example, udiv on the SPARC).
 1.4 12-Jun-1996  cgd copy down from libkern:
>use p->hashfraction when doing non-time-critical calculations, rather than
>using HASHFRACTION directly. in time-critical calculations, if HASHFRACTION
>is a power of two, check that p->hashfraction == HASHFRACTION and if so do
>the calculation with the compiled-in value so that the compiler can optimize
>out (potentially) expensive divisions. if p->hashfraction != HASHFRACTION,
>actually do the division. This has the result that on machines with slow
>division, the division can be optimized out of the common case, but that
>if HASHFRACTION changes from the compiled-in value (for whatever reason),
>profiling will still work. Changes suggested by Chris Torek.
 1.3 28-Mar-1995  jtc branches: 1.3.6;
KERNEL -> _KERNEL
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 14-May-1994  cgd add libkern mcount
 1.3.6.1 12-Jun-1996  cgd copy down from libkern.
 1.9.4.1 25-Feb-1999  chs sync with HEAD - profiling fixes.
 1.10.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.11.24.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.24.1 03-Aug-2004  skrll Sync with HEAD
 1.12.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.8.1 29-Apr-2005  kent sync with -current
 1.13.4.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 04-Dec-2003  keihan branches: 1.3.16;
NetBSD.ORG -> NetBSD.org

Now all "NetBSD.ORG" are gone from src/sys.
 1.2 15-Nov-2001  lukem branches: 1.2.16;
don't need <sys/types.h> when including <sys/param.h>
 1.1 08-Dec-2000  deberg branches: 1.1.2; 1.1.4; 1.1.6;
in-kernel MD4 implementation, from libc
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.1.2.1 08-Dec-2000  bouyer file md4c.c was added on branch thorpej_scsipi on 2000-12-13 15:50:23 +0000
 1.2.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.16.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.13 20-Dec-2005  christos Use common sources with userland.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 30-Jun-2004  christos branches: 1.11.12;
remove useless typedef and casts
 1.10 04-Dec-2003  keihan NetBSD.ORG -> NetBSD.org

Now all "NetBSD.ORG" are gone from src/sys.
 1.9 15-Nov-2001  lukem branches: 1.9.16;
don't need <sys/types.h> when including <sys/param.h>
 1.8 16-Oct-1999  ragge branches: 1.8.12; 1.8.14;
Include <lib/libkern/libkern.h> after sys/param.h, to avoid warnings
when memcpy et al is static inline.
 1.7 16-Sep-1999  sommerfeld branches: 1.7.2;
Include <lib/libkern/libkern.h> instead of <sys/systm.h>.
(the former no longer has mem* prototypes).
Remove the b* vs mem* kludge.
This change allows standalone libkern to build on alpha again.
 1.6 10-Sep-1999  drochner sync with libc
 1.5 04-Feb-1999  fvdl Check for _STANDALONE as well as _KERNEL to make it compile again. Fold
some includes together in one #if as a result of this.
 1.4 04-Feb-1999  explorer sync with userland
 1.3 12-Sep-1998  ragge Include <sys/param.h> instead of <sys/types.h>, to get mem* inlines.
(At least on vax)
 1.2 27-Mar-1998  cgd sync with libc
 1.1 30-Apr-1997  thorpej Add the libc md5 implementation to libkern.
 1.7.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.14.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.9.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.16.1 03-Aug-2004  skrll Sync with HEAD
 1.11.12.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 01-Jul-2004  christos branches: 1.7.12;
add __UNCONST
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 27-Mar-1998  cgd branches: 1.5.48;
sync with libc
 1.4 22-Feb-1998  mycroft Don't even think about cdefs.h here...
 1.3 21-Jan-1998  cgd sync with libc
 1.2 24-Oct-1997  mjacob Add missing NULL define for KERNEL case and prototype into libkern.h.
 1.1 24-Oct-1997  chuck add memchr() to libkern
 1.5.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.12.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 26-Feb-2005  perry branches: 1.5.4;
nuke trailing whitespace
 1.4 07-Aug-2003  agc branches: 1.4.8; 1.4.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 27-Mar-1998  cgd branches: 1.3.48;
sync with libc
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 15-Aug-1996  jtc branches: 1.1.10;
Added to libkern in preparation for change from b* to mem*.
 1.1.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.48.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.48.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.4.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 04-Aug-1998  perry branches: 1.1.62;
replace several special targets with stub .c files, as in libc/string
 1.1.62.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 04-Aug-1998  perry branches: 1.1.62;
replace several special targets with stub .c files, as in libc/string
 1.1.62.1 21-Jun-2006  yamt sync with head.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 26-Feb-2005  perry branches: 1.9.4;
nuke trailing whitespace
 1.8 07-Aug-2003  agc branches: 1.8.8; 1.8.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.7 14-Sep-1998  leo branches: 1.7.46;
Fix "unused variable `c'" warning. (From Julian Coleman)
 1.6 27-Mar-1998  cgd copy from libc:
limits.h if user-land, machine/limits.h if kernel or standalone
 1.5 27-Mar-1998  cgd sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 15-Aug-1996  jtc branches: 1.3.10;
Added to libkern in preparation for change from b* to mem*.
 1.2 11-Mar-1996  scottr Back out previous change.
 1.1 11-Mar-1996  thorpej Provide a memset() for the i386 (assembly version), and move memset.c
out into the libkern proper in case other ports want to use it.
i386 kernels with COMPAT_LINUX should compile now.
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.46.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.46.1 03-Aug-2004  skrll Sync with HEAD
 1.8.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.8.1 29-Apr-2005  kent sync with -current
 1.9.4.1 21-Jun-2006  yamt sync with head.
 1.9 14-Dec-2019  riastradh Remove never-used Mersenne twister from libkern.
 1.8 28-Apr-2008  martin branches: 1.8.88;
Remove clause 3 and 4 from TNF licenses
 1.7 17-Feb-2008  matt branches: 1.7.2; 1.7.8; 1.7.10; 1.7.12; 1.7.14;
Don't need to that particular in mtprng_random(). Use 2 values instead of 8.
 1.6 02-Feb-2008  matt branches: 1.6.2;
Improve my version of mtprng_random. Reshuffle things. Add an compatible
version of init_by_array.
 1.5 31-Jan-2008  simonb Check _STANDALONE as well as _KERNEL when choosing headers to include.
Also pull in <lib/libkern/libkern.h> so we get prototypes and a struct
mtprng_state declaration.
 1.4 31-Jan-2008  simonb Have mtprng_random() call mtprng_rawrandom() to get more
random data instead of calling itself. Much nicer to the
stack...
 1.3 31-Jan-2008  simonb Check against correct constant in a KASSERT().
 1.2 31-Jan-2008  matt Add Mersenne Twister prototypes and state struct to libkern.h
Cleanup a comment. s/RLEN/MTPRNG_RLEN/g s/POS1/MTPRNG_POS1/g
Remove unneeded test code.
 1.1 31-Jan-2008  matt Add Mersenne Twister PRNG implementation. This is a new implementation.
 1.6.2.3 27-Feb-2008  yamt sync with head.
 1.6.2.2 04-Feb-2008  yamt sync with head.
 1.6.2.1 02-Feb-2008  yamt file mertwist.c was added on branch yamt-lazymbuf on 2008-02-04 09:24:27 +0000
 1.7.14.1 16-May-2008  yamt sync with head.
 1.7.12.1 18-May-2008  yamt sync with head.
 1.7.10.2 23-Mar-2008  matt sync with HEAD
 1.7.10.1 17-Feb-2008  matt file mertwist.c was added on branch matt-armv6 on 2008-03-23 02:05:02 +0000
 1.7.8.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.7.2.1 17-Feb-2008  mjf file mertwist.c was added on branch mjf-devfs on 2008-02-18 21:06:59 +0000
 1.8.88.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.5 02-Sep-2020  thorpej Update to the SoftFloat-2c version of milieu.h. This includes a
simplification of the license and updates the comments. NFC.
 1.4 19-Apr-2018  christos s/static inline/static __inline/g for consistency.
 1.3 28-Apr-2008  martin branches: 1.3.86;
Remove clause 3 and 4 from TNF licenses
 1.2 22-Apr-2003  christos branches: 1.2.100; 1.2.102; 1.2.104;
don't define TRUE and FALSE locally.
 1.1 26-Apr-2001  ross branches: 1.1.2;
o IEEE 754 floating-point completion code.
o Implement the architected FP_C "Floating Point Control Quadword"
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 26-Apr-2001  nathanw file milieu.h was added on branch nathanw_sa on 2001-06-21 20:07:16 +0000
 1.2.104.1 16-May-2008  yamt sync with head.
 1.2.102.1 18-May-2008  yamt sync with head.
 1.2.100.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.86.1 22-Apr-2018  pgoyette Sync with HEAD
 1.8 03-Sep-2018  riastradh Rename min.c -> uimin.c, max.c -> uimax.c in libkern.
 1.7 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.6 14-Mar-2009  dsl branches: 1.6.62; 1.6.64;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 14-Mar-1996  christos branches: 1.3.64;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file min.c was added on branch magnum on 1993-10-13 05:40:45 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.6.64.1 10-Jun-2019  christos Sync with HEAD
 1.6.62.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file moddi3.c was added on branch magnum on 1993-12-04 05:01:45 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 26-Feb-2005  perry branches: 1.9.4;
nuke trailing whitespace
 1.8 07-Aug-2003  agc branches: 1.8.8; 1.8.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.7 20-Oct-2002  scw branches: 1.7.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.6 27-Mar-1998  cgd branches: 1.6.26;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file muldi3.c was added on branch magnum on 1993-12-04 05:01:47 +0000
 1.6.26.1 11-Nov-2002  nathanw Catch up to -current
 1.7.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.8.1 29-Apr-2005  kent sync with -current
 1.9.4.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file negdi2.c was added on branch magnum on 1993-12-04 05:01:49 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file notdi2.c was added on branch magnum on 1993-12-04 05:01:51 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.13 20-Dec-2005  christos Use common sources with userland.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 04-Dec-2003  keihan branches: 1.11.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.10 22-Aug-2001  itojun branches: 1.10.20;
sync argument/return type of [hn]to[nh][ls] to XNET 5.2 (uint{16,32}_t).
as discussed on tech-net.
 1.9 27-Mar-1998  cgd branches: 1.9.26; 1.9.28;
sync with libc
 1.8 17-Oct-1996  cgd pull down from libc
 1.7 29-May-1996  cgd Copy from libkern:
Add some casts so that we're not bitten by type promotions on 64-bit
systems. Not a great concern since the only 64-bit system currently
supported by NetBSD (Alpha) uses assembly versions of these routines.
 1.6 07-Oct-1995  mycroft branches: 1.6.6;
Update from libc.
 1.5 06-Jan-1995  cgd copy back from libc
 1.4 06-Jan-1995  cgd from libc
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file ntohl.c was added on branch magnum on 1993-10-27 22:00:49 +0000
 1.6.6.1 29-May-1996  cgd Pull changes copied from libc to the release branch: Add some casts so
that we're not bitten by type promotions on 64-bit systems.
 1.9.28.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.9.26.1 21-Sep-2001  nathanw Catch up to -current.
 1.10.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.20.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.1 21-Jun-2006  yamt sync with head.
 1.12 20-Dec-2005  christos Use common sources with userland.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 04-Dec-2003  keihan branches: 1.10.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.9 22-Aug-2001  itojun branches: 1.9.20;
sync argument/return type of [hn]to[nh][ls] to XNET 5.2 (uint{16,32}_t).
as discussed on tech-net.
 1.8 27-Mar-1998  cgd branches: 1.8.26; 1.8.28;
sync with libc
 1.7 17-Oct-1996  cgd pull down from libc
 1.6 29-May-1996  cgd Copy from libkern:
Add some casts so that we're not bitten by type promotions on 64-bit
systems. Not a great concern since the only 64-bit system currently
supported by NetBSD (Alpha) uses assembly versions of these routines.
 1.5 07-Oct-1995  mycroft branches: 1.5.6;
Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 17-Apr-1994  glass missing. not noticed because all the ports have their own version.
 1.5.6.1 29-May-1996  cgd Pull changes copied from libc to the release branch: Add some casts so
that we're not bitten by type promotions on 64-bit systems.
 1.8.28.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.8.26.1 21-Sep-2001  nathanw Catch up to -current.
 1.9.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.20.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.9 09-Oct-2024  gutteridge pmatch.c: fix a typo in a comment
 1.8 24-Aug-2024  christos Not really a bug since the value is not used, but avoid reading uninitialized
memory anyway (CID-1597959)
 1.7 21-Jan-2021  thorpej branches: 1.7.24;
Allow this to be built for the strlist.c unit tests.
 1.6 14-Mar-2009  dsl branches: 1.6.76;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry nuke trailing whitespace
 1.3 07-Aug-2003  agc branches: 1.3.8; 1.3.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 15-Nov-2001  lukem branches: 1.2.16;
don't need <sys/types.h> when including <sys/param.h>
 1.1 21-Jun-1998  christos branches: 1.1.26; 1.1.28;
Add a small string pattern matching function to facilitate pcmcia cis string
matches.
 1.1.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.16.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.16.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.6.76.1 03-Apr-2021  thorpej Sync with HEAD.
 1.7.24.1 02-Aug-2025  perseant Sync with HEAD
 1.13 20-Dec-2005  christos Use common sources with userland.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 26-Feb-2005  perry branches: 1.11.4;
nuke trailing whitespace
 1.10 07-Aug-2003  agc branches: 1.10.8; 1.10.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 20-Oct-2002  scw branches: 1.9.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.8 12-Dec-2000  mycroft branches: 1.8.2;
Update from libc.
 1.7 10-Sep-1999  drochner branches: 1.7.2;
sync with libc
 1.6 27-Mar-1998  cgd sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 16-Jun-1994  glass wierd fix for very wierd pmax compile problem. terry hit this too
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file qdivrem.c was added on branch magnum on 1993-12-04 05:01:53 +0000
 1.7.2.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.8.2.1 11-Nov-2002  nathanw Catch up to -current
 1.9.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.11.4.1 21-Jun-2006  yamt sync with head.
 1.18 20-Dec-2005  christos Use common sources with userland.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 07-Aug-2003  agc branches: 1.16.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.15 20-Oct-2002  scw branches: 1.15.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.14 05-May-2000  thorpej branches: 1.14.6;
Use __GNUC_PREREQ__().
 1.13 27-Mar-2000  simonb Remove duplicate declaration of __cmpdi2()
 1.12 10-Sep-1999  drochner branches: 1.12.2;
sync with libc
 1.11 30-Aug-1998  eeh Some more 64-bit cleanup. Now everything compiles.
 1.10 30-Aug-1998  enami As a temporary work around to make kernel links again, protect
renaming of quad type library only when !__NetBSD__ && sun && __svr4__.
XXX. Probably need to check __GNUC_MINOR__.
 1.9 29-Aug-1998  eeh Some more 64-bit-ification.
 1.8 27-Mar-1998  cgd sync with libc
 1.7 18-Apr-1996  cgd don't include user-land headers in libkern files when compiling for
the kernel.
 1.6 14-Mar-1996  christos - Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.5 12-Oct-1995  jtc Fix from Jochen Pohl which fixes case where quad multiply
goes awry if bit 31 of at least one of the operands is set
(PR #1591).
 1.4 07-Oct-1995  mycroft branches: 1.4.2;
Update from libc.
 1.3 06-Jan-1995  cgd copy back from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
oops; we need this
 1.1.2.2 04-Dec-1993  cgd oops; we need this
 1.1.2.1 04-Dec-1993  cgd file quad.h was added on branch magnum on 1993-12-04 05:09:15 +0000
 1.4.2.1 12-Oct-1995  jtc Fix from Jochen Pohl which fixes case where quad multiply
goes awry if bit 31 of at least one of the operands is set
(PR #1591).
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.6.1 11-Nov-2002  nathanw Catch up to -current
 1.15.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.6.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 30-Mar-2000  augustss branches: 1.4.28;
Kill some more register declarations.
 1.3 13-Nov-1996  cgd branches: 1.3.28;
include libkern.h, not types.h, to get prototype. (libkern.h includes types.h)
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 03-Jun-1994  glass needed by some multicast thing
 1.3.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.28.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.21 30-Jun-2008  matt Move rb.c from sys/lib/libkern to common so it can be in both libc and libkern.
 1.20 30-Jun-2008  matt Add some significant improvements to the red-black tree implementation.
Shrink size of rb_node by 25% (merge parent/father pointer and flags).
 1.19 25-Jun-2008  matt Nuke MOVED support. Move rb_parent out of rb_nodes and make it it's own
member.
 1.18 25-Jun-2008  christos Make rb use masks instead of bitfields, because it is more portable (bitfields
to unsigned long are not portable), and produces tighter code. Tested on
amd64. approved by gimpy.
 1.17 06-Jun-2008  tron branches: 1.17.2;
Use proper C99 syntax to statically initialize a "rb_node" structure to
fix the build.
 1.16 04-Jun-2008  ad Move lib/libkern/rb.h to sys/rb.h, so it can be used by kernel header
files.
 1.15 28-Apr-2008  martin branches: 1.15.2;
Remove clause 3 and 4 from TNF licenses
 1.14 21-Nov-2007  matt branches: 1.14.14; 1.14.16; 1.14.18;
Make rb_tree_insert_node return true/false whether the node was inserted
or not.
 1.13 20-Nov-2007  yamt rename
RB_LEFT
RB_RIGHT
RB_OTHER
to
RB_DIR_LEFT
RB_DIR_RIGHT
RB_DIR_OTHER
so that it can coexist with sys/tree.h.
 1.12 20-Nov-2007  yamt fix compilation in the case of _KERNEL && DIAGNOSTIC && !RBDEBUG.
 1.11 10-Sep-2006  matt branches: 1.11.24; 1.11.26; 1.11.30; 1.11.32;
Add a way for a user to know what nodes have changed when a node has been
inserted or removed. Refactor node insertion to not require rebalancing
all the time or a loop if it does. In rb_tree_swap_prune_and_rebalance,
don't call rb_tree_reparent_nodes, instead do the work ourselves (since
we will eventually undo half of the work of rb_tree_reparent_nodes).
 1.10 09-Sep-2006  matt Shrink rb_tree to 4 pointers (2 if RBSMALL is defined). Move compare
functions to a separate rb_tree_ops structure. Make every int explicit
in being signed or unsigned. Use RBDEBUG to enable debug code. Move
rbt_count to RBSTATS. Use RBSMALL to not keep track of min/max.
 1.9 09-Sep-2006  matt Add rb_tree_find_node_{geq,leq}. Add stats. Make TAILQ DEBUG only.
Keep track of tree's min/max nodes for easier iteration. Improve comments.
Move functions around to improve locality.
 1.8 08-Sep-2006  matt Fix and simplify node removal. Add lots of assertions and comments.
 1.7 06-Sep-2006  thorpej branches: 1.7.2;
Use static at the function decl if the prototype also uses static.
 1.6 05-Sep-2006  matt Rewrite of red-black tree code.
 1.5 02-Sep-2006  matt Make this compile in _KERNEL || _STANDALONE. Make gcc4 happy.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 26-Feb-2005  perry branches: 1.3.4;
nuke trailing whitespace
 1.2 08-Oct-2002  simonb branches: 1.2.6; 1.2.14; 1.2.16;
Add RCS ids.
 1.1 24-Oct-2001  matt branches: 1.1.2; 1.1.4; 1.1.6;
Add "Red Black +" balanced binary tree routines to libkern. These provide
O(log(N)) insertation, deletion, and lookup times. However, unlike most
red-black implemenations, this one does no additional memory allocations.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 24-Oct-2001  thorpej file rb.c was added on branch kqueue on 2002-01-10 20:00:28 +0000
 1.1.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.4.1 24-Oct-2001  nathanw file rb.c was added on branch nathanw_sa on 2001-11-14 19:16:50 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 24-Oct-2001  thorpej file rb.c was added on branch thorpej-mips-cache on 2001-11-12 21:19:04 +0000
 1.2.16.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.14.1 29-Apr-2005  kent sync with -current
 1.2.6.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.4.2 07-Dec-2007  yamt sync with head
 1.3.4.1 30-Dec-2006  yamt sync with head.
 1.4.8.2 14-Sep-2006  yamt sync with head.
 1.4.8.1 03-Sep-2006  yamt sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.7.2.1 18-Nov-2006  ad Sync with head.
 1.11.32.1 08-Dec-2007  mjf Sync with HEAD.
 1.11.30.1 21-Nov-2007  bouyer Sync with HEAD
 1.11.26.1 09-Jan-2008  matt sync with HEAD
 1.11.24.1 21-Nov-2007  joerg Sync with HEAD.
 1.14.18.2 04-May-2009  yamt sync with head.
 1.14.18.1 16-May-2008  yamt sync with head.
 1.14.16.2 17-Jun-2008  yamt sync with head.
 1.14.16.1 18-May-2008  yamt sync with head.
 1.14.14.4 02-Jul-2008  mjf Sync with HEAD.
 1.14.14.3 29-Jun-2008  mjf Sync with HEAD.
 1.14.14.2 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.14.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.2.2 07-Sep-2008  wrstuden Delete a bunch of things that are now gone in head.
 1.15.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.17.2.2 01-Jul-2008  matt More rb.c / wapbl fallout cleanup.
 1.17.2.1 27-Jun-2008  simonb Sync with head.
 1.11 04-Jun-2008  ad Move lib/libkern/rb.h to sys/rb.h, so it can be used by kernel header
files.
 1.10 28-Apr-2008  martin branches: 1.10.2;
Remove clause 3 and 4 from TNF licenses
 1.9 21-Nov-2007  matt branches: 1.9.14; 1.9.16; 1.9.18;
Make rb_tree_insert_node return true/false whether the node was inserted
or not.
 1.8 20-Nov-2007  yamt rename
RB_LEFT
RB_RIGHT
RB_OTHER
to
RB_DIR_LEFT
RB_DIR_RIGHT
RB_DIR_OTHER
so that it can coexist with sys/tree.h.
 1.7 10-Sep-2006  matt branches: 1.7.24; 1.7.26; 1.7.30; 1.7.32;
Add a way for a user to know what nodes have changed when a node has been
inserted or removed. Refactor node insertion to not require rebalancing
all the time or a loop if it does. In rb_tree_swap_prune_and_rebalance,
don't call rb_tree_reparent_nodes, instead do the work ourselves (since
we will eventually undo half of the work of rb_tree_reparent_nodes).
 1.6 09-Sep-2006  matt Shrink rb_tree to 4 pointers (2 if RBSMALL is defined). Move compare
functions to a separate rb_tree_ops structure. Make every int explicit
in being signed or unsigned. Use RBDEBUG to enable debug code. Move
rbt_count to RBSTATS. Use RBSMALL to not keep track of min/max.
 1.5 09-Sep-2006  matt Add rb_tree_find_node_{geq,leq}. Add stats. Make TAILQ DEBUG only.
Keep track of tree's min/max nodes for easier iteration. Improve comments.
Move functions around to improve locality.
 1.4 08-Sep-2006  matt Fix and simplify node removal. Add lots of assertions and comments.
 1.3 05-Sep-2006  matt branches: 1.3.2;
Rewrite of red-black tree code.
 1.2 08-Oct-2002  simonb branches: 1.2.22; 1.2.36; 1.2.40;
Add RCS ids.
 1.1 24-Oct-2001  matt branches: 1.1.2; 1.1.4; 1.1.6;
Add "Red Black +" balanced binary tree routines to libkern. These provide
O(log(N)) insertation, deletion, and lookup times. However, unlike most
red-black implemenations, this one does no additional memory allocations.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 24-Oct-2001  thorpej file rb.h was added on branch kqueue on 2002-01-10 20:00:28 +0000
 1.1.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.4.1 24-Oct-2001  nathanw file rb.h was added on branch nathanw_sa on 2001-11-14 19:16:50 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 24-Oct-2001  thorpej file rb.h was added on branch thorpej-mips-cache on 2001-11-12 21:19:04 +0000
 1.2.40.1 14-Sep-2006  yamt sync with head.
 1.2.36.1 09-Sep-2006  rpaulo sync with head
 1.2.22.2 07-Dec-2007  yamt sync with head
 1.2.22.1 30-Dec-2006  yamt sync with head.
 1.3.2.1 18-Nov-2006  ad Sync with head.
 1.7.32.1 08-Dec-2007  mjf Sync with HEAD.
 1.7.30.1 21-Nov-2007  bouyer Sync with HEAD
 1.7.26.1 09-Jan-2008  matt sync with HEAD
 1.7.24.1 21-Nov-2007  joerg Sync with HEAD.
 1.9.18.2 04-May-2009  yamt sync with head.
 1.9.18.1 16-May-2008  yamt sync with head.
 1.9.16.2 17-Jun-2008  yamt sync with head.
 1.9.16.1 18-May-2008  yamt sync with head.
 1.9.14.2 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.9.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.2.2 23-Jun-2008  wrstuden Remove files removed on branch. Updating using patch has its
drawbacks. :-)
 1.10.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.5 01-Nov-2003  jdolecek g/c index.c and rindex.c (not used anywhere)
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 27-Mar-1998  cgd branches: 1.3.48;
sync with libc
 1.2 22-Feb-1998  mycroft Don't even think about cdefs.h here...
 1.1 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.3.48.1 03-Aug-2004  skrll Sync with HEAD
 1.4 03-Sep-2018  riastradh We have popcount; no need to reimplement it.
 1.3 28-Mar-2016  riastradh branches: 1.3.16; 1.3.18;
Fix relation in rngtest failure message to match reality.
 1.2 25-Nov-2011  joerg branches: 1.2.6; 1.2.10; 1.2.28;
Spell restrict with __.
 1.1 19-Nov-2011  tls First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

An initial cleanup and minor reorganization of the entropy pool
code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are
fixed. Some effort is made to accumulate entropy more quickly at
boot time.

A generic interface, "rndsink", is added, for stream generators to
request that they be re-keyed with good quality entropy from the pool
as soon as it is available.

The arc4random()/arc4randbytes() implementation in libkern is
adjusted to use the rndsink interface for rekeying, which helps
address the problem of low-quality keys at boot time.

An implementation of the FIPS 140-2 statistical tests for random
number generator quality is provided (libkern/rngtest.c). This
is based on Greg Rose's implementation from Qualcomm.

A new random stream generator, nist_ctr_drbg, is provided. It is
based on an implementation of the NIST SP800-90 CTR_DRBG by
Henric Jungheim. This generator users AES in a modified counter
mode to generate a backtracking-resistant random stream.

An abstraction layer, "cprng", is provided for in-kernel consumers
of randomness. The arc4random/arc4randbytes API is deprecated for
in-kernel use. It is replaced by "cprng_strong". The current
cprng_fast implementation wraps the existing arc4random
implementation. The current cprng_strong implementation wraps the
new CTR_DRBG implementation. Both interfaces are rekeyed from
the entropy pool automatically at intervals justifiable from best
current cryptographic practice.

In some quick tests, cprng_fast() is about the same speed as
the old arc4randbytes(), and cprng_strong() is about 20% faster
than rnd_extract_data(). Performance is expected to improve.

The AES code in src/crypto/rijndael is no longer an optional
kernel component, as it is required by cprng_strong, which is
not an optional kernel component.

The entropy pool output is subjected to the rngtest tests at
startup time; if it fails, the system will reboot. There is
approximately a 3/10000 chance of a false positive from these
tests. Entropy pool _input_ from hardware random numbers is
subjected to the rngtest tests at attach time, as well as the
FIPS continuous-output test, to detect bad or stuck hardware
RNGs; if any are detected, they are detached, but the system
continues to run.

A problem with rndctl(8) is fixed -- datastructures with
pointers in arrays are no longer passed to userspace (this
was not a security problem, but rather a major issue for
compat32). A new kernel will require a new rndctl.

The sysctl kern.arandom() and kern.urandom() nodes are hooked
up to the new generators, but the /dev/*random pseudodevices
are not, yet.

Manual pages for the new kernel interfaces are forthcoming.
 1.2.28.1 22-Apr-2016  skrll Sync with HEAD
 1.2.10.1 03-Dec-2017  jdolecek update from HEAD
 1.2.6.2 17-Apr-2012  yamt sync with head
 1.2.6.1 25-Nov-2011  yamt file rngtest.c was added on branch yamt-pagecache on 2012-04-17 00:08:33 +0000
 1.3.18.1 10-Jun-2019  christos Sync with HEAD
 1.3.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 09-Aug-2001  lukem branches: 1.6.20;
convert to ansi knf, and fix a bug where the last arg was incorrectly
'u_char' instead of 'int' (per the prototype and usage and other scanc
implementations)
 1.5 30-Mar-2000  augustss branches: 1.5.4; 1.5.6; 1.5.8;
Kill some more register declarations.
 1.4 24-Oct-1996  cgd branches: 1.4.28;
second and third args to scanc() (string and table) are not and should not
be modified. Make them 'const'.
 1.3 14-Mar-1996  christos - Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file scanc.c was added on branch magnum on 1993-10-13 05:40:46 +0000
 1.4.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.8.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.5.6.1 24-Aug-2001  nathanw Catch up with -current.
 1.5.4.1 25-Nov-2001  he Pull up revision 1.6 (requested by lukem):
Fix scanc() arguments.
 1.6.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.20.1 03-Aug-2004  skrll Sync with HEAD
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 30-Jun-2005  tron branches: 1.9.2;
Don't use a static buffer in SHA1Transform() because it might cause
various problems including sporadic IPSec authentification failures
if this code is used by multiple instances in parallel.
 1.8 30-Jun-2004  christos branches: 1.8.10;
avoid string const cast-aways.
 1.7 23-Sep-2003  martin Same treatment as libc/hash/sha1.c: ifdef the sparc64 compiler bug
workaround for old gcc only.
 1.6 17-Sep-2000  eeh branches: 1.6.24;
Prevent the compiler from blowing up on sparc64. From mrg.
 1.5 16-Sep-1999  sommerfeld branches: 1.5.2; 1.5.12;
Include <lib/libkern/libkern.h> instead of <sys/systm.h>.
(the former no longer has mem* prototypes).
Remove the b* vs mem* kludge.
This change allows standalone libkern to build on alpha again.
 1.4 09-May-1999  eeh Allocating a byte-array and then accessing it as 32-bit integers just won't work
on any machine that has alignment restrictions.
 1.3 12-Sep-1998  ragge branches: 1.3.8;
Include <sys/param.h> instead of <sys/types.h>, to get mem* inlines.
(At least on vax)
 1.2 29-May-1998  hannken Didn't find sha1.h compiling sys/arch/sparc/stand/boot.
 1.1 27-May-1998  explorer add sha1.c, and build it.
 1.3.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.12.1 19-Oct-2000  he Pull up revision 1.6 (requested by eeh):
Prevent the compiler from blowing up on sparc64.
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.6.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.24.1 03-Aug-2004  skrll Sync with HEAD
 1.8.10.1 05-Jul-2005  riz Pull up revision 1.9 (requested by tron in ticket #515):
Don't use a static buffer in SHA1Transform() because it might cause
various problems including sporadic IPSec authentification failures
if this code is used by multiple instances in parallel.
 1.9.2.1 21-Jun-2006  yamt sync with head.
 1.7 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.6 11-Dec-2005  christos branches: 1.6.74; 1.6.84; 1.6.90;
merge ktrace-lwp.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 30-Mar-2000  augustss branches: 1.4.28;
Kill some more register declarations.
 1.3 14-Mar-1996  christos branches: 1.3.30;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file skpc.c was added on branch magnum on 1993-10-13 05:40:47 +0000
 1.3.30.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.28.1 03-Aug-2004  skrll Sync with HEAD
 1.6.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.6.74.1 04-May-2009  yamt sync with head.
 1.3 01-Sep-2020  thorpej Update to the SoftFloat-2c version of softfloat-macros.h. This has 3
small changes:
- Simplification of the license.
- Minor style changes to 3 comments.
- Fixes a bug in shift128Right() for shift counts >= 64;
 1.2 01-Sep-2020  thorpej Update to the SoftFloat-2b version of softfloat-macros.h. This makes a
clarifying change to the warranty disclaimer and updates the comments. NFC.
 1.1 26-Apr-2001  ross branches: 1.1.2;
o IEEE 754 floating-point completion code.
o Implement the architected FP_C "Floating Point Control Quadword"
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 26-Apr-2001  nathanw file softfloat-macros.h was added on branch nathanw_sa on 2001-06-21 20:07:17 +0000
 1.3 02-Sep-2020  thorpej Update to the SoftFloat-2c version of softfloat-specialize.h and softfloat.h.
This includes a simplification of the license and updates the comments. NFC.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 26-Apr-2001  ross branches: 1.1.2; 1.1.122; 1.1.124; 1.1.126;
o IEEE 754 floating-point completion code.
o Implement the architected FP_C "Floating Point Control Quadword"
 1.1.126.1 16-May-2008  yamt sync with head.
 1.1.124.1 18-May-2008  yamt sync with head.
 1.1.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 26-Apr-2001  nathanw file softfloat-specialize.h was added on branch nathanw_sa on 2001-06-21 20:07:18 +0000
 1.8 02-Sep-2020  thorpej Reduce diffs to upstream: get rid of FLOAT64_{,DE}MANGLE(); it's no longer
used.
 1.7 02-Sep-2020  thorpej Update to the SoftFloat-2b version of softfloat.c. This makes a clarifying
change to the warranty disclaimer and updates the comments. NFC.
 1.6 31-Dec-2017  martin PR port-alpha/52520: provide float64 -> uint64 conversion and use
that when converting positive numbers.
 1.5 03-Nov-2013  christos branches: 1.5.22;
mark some variables as unused, but keep them around as comments
 1.4 11-Dec-2005  christos branches: 1.4.94; 1.4.110; 1.4.120; 1.4.126;
merge ktrace-lwp.
 1.3 04-Dec-2003  keihan netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.2 05-Dec-2002  thorpej branches: 1.2.6;
Wrap this file in "#ifndef _STANDALONE".
 1.1 26-Apr-2001  ross branches: 1.1.2;
o IEEE 754 floating-point completion code.
o Implement the architected FP_C "Floating Point Control Quadword"
 1.1.2.3 11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 26-Apr-2001  nathanw file softfloat.c was added on branch nathanw_sa on 2001-06-21 20:07:18 +0000
 1.2.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.6.1 03-Aug-2004  skrll Sync with HEAD
 1.4.126.1 18-May-2014  rmind sync with head
 1.4.120.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.110.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.94.2 08-Feb-2011  cliff - remove erroneous include of opt_multiprocessor.h
("MULTIPROCESSOR" instance was inside a comment)
 1.4.94.1 05-Feb-2011  cliff - include opt_multiprocessor.h for explicit MULTIPROCESSOR dependency
 1.5.22.1 26-Feb-2018  snj Pull up following revision(s) (requested by maya in ticket #584):
sys/arch/alpha/alpha/fp_complete.c: 1.22
sys/lib/libkern/softfloat.c: 1.6
sys/lib/libkern/softfloat.h: 1.5
PR port-alpha/52520: provide float64 -> uint64 conversion and use
that when converting positive numbers.
 1.6 02-Sep-2020  thorpej Update to the SoftFloat-2c version of softfloat-specialize.h and softfloat.h.
This includes a simplification of the license and updates the comments. NFC.
 1.5 31-Dec-2017  martin PR port-alpha/52520: provide float64 -> uint64 conversion and use
that when converting positive numbers.
 1.4 28-Apr-2008  martin branches: 1.4.80;
Remove clause 3 and 4 from TNF licenses
 1.3 16-Feb-2006  perry branches: 1.3.64; 1.3.66; 1.3.68;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.2 24-Dec-2005  perry branches: 1.2.2; 1.2.4; 1.2.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 26-Apr-2001  ross branches: 1.1.2;
o IEEE 754 floating-point completion code.
o Implement the architected FP_C "Floating Point Control Quadword"
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 26-Apr-2001  nathanw file softfloat.h was added on branch nathanw_sa on 2001-06-21 20:07:19 +0000
 1.2.6.1 22-Apr-2006  simonb Sync with head.
 1.2.4.1 09-Sep-2006  rpaulo sync with head
 1.2.2.1 18-Feb-2006  yamt sync with head.
 1.3.68.1 16-May-2008  yamt sync with head.
 1.3.66.1 18-May-2008  yamt sync with head.
 1.3.64.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.80.1 26-Feb-2018  snj Pull up following revision(s) (requested by maya in ticket #584):
sys/arch/alpha/alpha/fp_complete.c: 1.22
sys/lib/libkern/softfloat.c: 1.6
sys/lib/libkern/softfloat.h: 1.5
PR port-alpha/52520: provide float64 -> uint64 conversion and use
that when converting positive numbers.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 26-Feb-2005  perry branches: 1.2.4;
nuke trailing whitespace
 1.1 01-Nov-2000  thorpej branches: 1.1.2; 1.1.26; 1.1.34; 1.1.36;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.1.36.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.34.1 29-Apr-2005  kent sync with -current
 1.1.26.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.1.2.1 01-Nov-2000  bouyer file strcasecmp.c was added on branch thorpej_scsipi on 2000-11-22 16:05:34 +0000
 1.2.4.1 21-Jun-2006  yamt sync with head.
 1.12 20-Dec-2005  christos Use common sources with userland.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 07-Aug-2003  agc branches: 1.10.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 27-Mar-1998  cgd branches: 1.9.48;
sync with libc
 1.8 13-Oct-1997  lukem rcsid fascism
 1.7 18-Apr-1996  cgd branches: 1.7.12;
don't include user-land headers in libkern files when compiling for
the kernel.
 1.6 14-Mar-1996  christos - Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file strcat.c was added on branch magnum on 1993-10-27 22:00:50 +0000
 1.7.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.48.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 01-Jul-2004  christos branches: 1.7.12;
add __UNCONST
 1.6 01-Nov-2003  jdolecek g/c index.c and rindex.c (not used anywhere)
 1.5 04-Aug-1998  perry branches: 1.5.46;
replace several special targets with stub .c files, as in libc/string
 1.4 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.3 21-Jan-1998  cgd sync with libc version. (just rcs id changes.)
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 18-Jan-1997  cgd branches: 1.1.8;
add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.1.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.46.1 03-Aug-2004  skrll Sync with HEAD
 1.7.12.1 21-Jun-2006  yamt sync with head.
 1.12 20-Dec-2005  christos Use common sources with userland.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 07-Aug-2003  agc branches: 1.10.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 27-Mar-1998  cgd branches: 1.9.48;
sync with libc
 1.8 13-Oct-1997  lukem rcsid fascism
 1.7 24-Oct-1996  cgd branches: 1.7.10;
when casting const pointers, preserve const qualifiers. (-Wcast-qual)
 1.6 18-Apr-1996  cgd don't include user-land headers in libkern files when compiling for
the kernel.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file strcmp.c was added on branch magnum on 1993-10-27 22:00:51 +0000
 1.7.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.48.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.12 20-Dec-2005  christos Use common sources with userland.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 07-Aug-2003  agc branches: 1.10.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 27-Mar-1998  cgd branches: 1.9.48;
sync with libc
 1.8 13-Oct-1997  lukem rcsid fascism
 1.7 18-Apr-1996  cgd branches: 1.7.12;
don't include user-land headers in libkern files when compiling for
the kernel.
 1.6 14-Mar-1996  christos - Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file strcpy.c was added on branch magnum on 1993-10-27 22:00:51 +0000
 1.7.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.48.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 15-May-2003  itojun branches: 1.2.18;
latest copyright notice (more loose). noted by wiz
 1.1 15-May-2003  itojun add strl{cpy,cat} to libkern. code from lib/libc/string (originally from openbsd).
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 15-May-2003  itojun branches: 1.2.18;
latest copyright notice (more loose). noted by wiz
 1.1 15-May-2003  itojun add strl{cpy,cat} to libkern. code from lib/libc/string (originally from openbsd).
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 07-Aug-2003  agc branches: 1.9.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 27-Mar-1998  cgd branches: 1.8.48;
sync with libc
 1.7 13-Oct-1997  lukem rcsid fascism
 1.6 18-Apr-1996  cgd branches: 1.6.12;
don't include user-land headers in libkern files when compiling for
the kernel.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file strlen.c was added on branch magnum on 1993-10-27 22:00:52 +0000
 1.6.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.48.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.3 11-Aug-2023  mrg avoid uninitialised variable warnings (likely incorrect ones.)

cry wolved by GCC 12.
 1.2 23-Jan-2021  thorpej branches: 1.2.4;
Fix building in the _STANDALONE case.
 1.1 21-Jan-2021  thorpej Add a generic set of routines for interacting with OpenFirmware-style
string lists.
 1.2.4.2 03-Apr-2021  thorpej Sync with HEAD.
 1.2.4.1 23-Jan-2021  thorpej file strlist.c was added on branch thorpej-futex on 2021-04-03 22:29:00 +0000
 1.1 21-Jan-2021  thorpej branches: 1.1.4;
Add a generic set of routines for interacting with OpenFirmware-style
string lists.
 1.1.4.2 03-Apr-2021  thorpej Sync with HEAD.
 1.1.4.1 21-Jan-2021  thorpej file strlist.h was added on branch thorpej-futex on 2021-04-03 22:29:00 +0000
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 26-Feb-2005  perry branches: 1.6.4;
nuke trailing whitespace
 1.5 27-Mar-1998  cgd branches: 1.5.48; 1.5.56; 1.5.58;
sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Apr-1996  cgd branches: 1.3.12;
don't include user-land headers in libkern files when compiling for
the kernel.
 1.2 06-Feb-1996  christos Make it really work like strncasecmp, instead of 0/1 return codes.
 1.1 06-Feb-1996  christos Add strncasecmp.c; extracted from ADOSFS adlookup.c.
 1.3.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.58.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.56.1 29-Apr-2005  kent sync with -current
 1.5.48.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.4.1 21-Jun-2006  yamt sync with head.
 1.12 20-Dec-2005  christos Use common sources with userland.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 07-Aug-2003  agc branches: 1.10.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 27-Mar-1998  cgd branches: 1.9.48;
sync with libc
 1.8 13-Oct-1997  lukem rcsid fascism
 1.7 24-Oct-1996  cgd branches: 1.7.10;
when casting const pointers, preserve const qualifiers. (-Wcast-qual)
 1.6 18-Apr-1996  cgd don't include user-land headers in libkern files when compiling for
the kernel.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 05-Nov-1993  cgd branches: 1.1.2;
added files copied in from libc. version numbers are screwed,
but are screwed for the rest of libkern's files, anyway.
 1.1.2.2 05-Nov-1993  cgd added files copied in from libc. version numbers are screwed,
but are screwed for the rest of libkern's files, anyway.
 1.1.2.1 05-Nov-1993  cgd file strncmp.c was added on branch magnum on 1993-11-05 22:40:49 +0000
 1.7.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.48.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 07-Aug-2003  agc branches: 1.9.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 27-Mar-1998  cgd branches: 1.8.48;
sync with libc
 1.7 13-Oct-1997  lukem rcsid fascism
 1.6 18-Apr-1996  cgd branches: 1.6.12;
don't include user-land headers in libkern files when compiling for
the kernel.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Oct-1993  jtc branches: 1.1.2;
Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.2 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.1.2.1 27-Oct-1993  jtc file strncpy.c was added on branch magnum on 1993-10-27 22:00:53 +0000
 1.6.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.48.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.1 02-May-2016  christos branches: 1.1.2; 1.1.18;
move scsipi_strvis -> libkern:strnvisx()
change the prototype to match userland
fix sizes of strings passed to it
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 02-May-2016  jdolecek file strnvisx.c was added on branch tls-maxphys on 2017-12-03 11:38:46 +0000
 1.1.2.2 29-May-2016  skrll Sync with HEAD
 1.1.2.1 02-May-2016  skrll file strnvisx.c was added on branch nick-nhusb on 2016-05-29 08:44:37 +0000
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 01-Jul-2004  christos branches: 1.3.12;
add __UNCONST
 1.2 01-Nov-2003  jdolecek g/c index.c and rindex.c (not used anywhere)
 1.1 04-Aug-1998  perry branches: 1.1.46;
replace several special targets with stub .c files, as in libc/string
 1.1.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.46.1 03-Aug-2004  skrll Sync with HEAD
 1.3.12.1 21-Jun-2006  yamt sync with head.
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 01-Jul-2004  christos branches: 1.4.12;
add __UNCONST
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 08-Oct-2002  jdolecek branches: 1.2.2; 1.2.8;
need to include <sys/param.h> to get inline strlen() on vax; found
with help of Matt Thomas
 1.1 04-Oct-2002  junyoung Add strstr() to libkern. For now, it's only used in i386 (for processor
identification).
 1.2.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.8.1 03-Aug-2004  skrll Sync with HEAD
 1.2.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.1 08-Oct-2002  nathanw file strstr.c was added on branch nathanw_sa on 2002-10-18 02:44:59 +0000
 1.4.12.1 21-Jun-2006  yamt sync with head.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 01-Jul-2004  christos branches: 1.8.12;
add __UNCONST
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 07-Jun-2003  briggs branches: 1.6.2;
Provide a strtoul() implementation based on the one in libc instead of the
totally different version that was here. This version, of course, has an
BSD license on it while the old one did not. This one also compiles down
to tighter code--the smaller the better for libkern & libsa.
 1.5 25-May-2000  msaitoh branches: 1.5.6;
fix the null pointer access bug when arg2 (char **endptr) == NULL
 1.4 29-Nov-1999  simonb branches: 1.4.2;
Copied from arch/arm32/arm32/strtoul.c,v
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 18-Feb-1997  mark Limit valid numeric digits to between 0 and min(base, 9) inclusive so that
puntuation characters are not evaluated.
 1.1 31-Jan-1996  mark branches: 1.1.8;
Initial commit of the NetBSD/arm32 port.
 1.1.8.1 11-Mar-1997  is merge in changes from Trunk.
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.6.1 25-May-2000  bouyer file strtoul.c was added on branch thorpej_scsipi on 2000-11-20 18:09:20 +0000
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.12.1 21-Jun-2006  yamt sync with head.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 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 22364, verified by myself.
 1.7 20-Oct-2002  scw branches: 1.7.6;
Sync with libc/quad:

As discussed (briefly) on tech-userlevel, fix our quad support to work
correctly on LP64 platforms. This is mostly just s/long/int/ in the
appropriate places.
 1.6 27-Mar-1998  cgd branches: 1.6.26;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file subdi3.c was added on branch magnum on 1993-12-04 05:01:55 +0000
 1.6.26.1 11-Nov-2002  nathanw Catch up to -current
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file ucmpdi2.c was added on branch magnum on 1993-12-04 05:01:57 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file udivdi3.c was added on branch magnum on 1993-12-04 05:01:59 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.1 03-Sep-2018  riastradh branches: 1.1.2; 1.1.6;
Rename min.c -> uimin.c, max.c -> uimax.c in libkern.
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 03-Sep-2018  christos file uimax.c was added on branch phil-wifi on 2019-06-10 22:09:04 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 03-Sep-2018  pgoyette file uimax.c was added on branch pgoyette-compat on 2018-09-06 06:56:42 +0000
 1.1 03-Sep-2018  riastradh branches: 1.1.2; 1.1.6;
Rename min.c -> uimin.c, max.c -> uimax.c in libkern.
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 03-Sep-2018  christos file uimin.c was added on branch phil-wifi on 2019-06-10 22:09:04 +0000
 1.1.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.2.1 03-Sep-2018  pgoyette file uimin.c was added on branch pgoyette-compat on 2018-09-06 06:56:42 +0000
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 14-Mar-1996  christos branches: 1.3.64;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file ulmax.c was added on branch magnum on 1993-10-13 05:40:48 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.84; 1.5.90;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 14-Mar-1996  christos branches: 1.3.64;
- Add missing prototypes
- Bring prototypes into scope
- Correct prototype for skpc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file ulmin.c was added on branch magnum on 1993-10-13 05:40:49 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file umoddi3.c was added on branch magnum on 1993-12-04 05:02:00 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.10 02-Mar-2025  jakllsch xlat_mbr_fstype: handle MBR_PTYPE_EFI as FS_MSDOS
 1.9 02-Mar-2013  christos branches: 1.9.74;
recognize OpenBSD too
 1.8 16-Jan-2012  christos branches: 1.8.6;
PR/45796: Evgeniy Ivanov minixfs3 support.
 1.7 28-Apr-2008  martin branches: 1.7.34; 1.7.38;
Remove clause 3 and 4 from TNF licenses
 1.6 16-Jul-2006  rillig branches: 1.6.54; 1.6.56; 1.6.58;
Fixed the gcc warning that "static" should come before "const".
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 12-Nov-2004  uwe branches: 1.3.4; 1.3.6;
MBR_PTYPE_APPLE_UFS is now spelled with an underscore.
 1.2 08-Oct-2003  lukem branches: 1.2.4;
sort entries, and add a couple
 1.1 07-Jul-2003  dsl Add xlat_mbr_fstype - converts mbr type to disklabel type
 1.2.4.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.4.5 14-Nov-2004  skrll Sync with HEAD.
 1.2.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 08-Oct-2003  skrll file xlat_mbr_fstype.c was added on branch ktrace-lwp on 2004-08-03 10:53:31 +0000
 1.3.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.4.1 29-Apr-2005  kent sync with -current
 1.4.4.1 30-Dec-2006  yamt sync with head.
 1.5.8.1 11-Aug-2006  yamt sync with head
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.58.1 16-May-2008  yamt sync with head.
 1.6.56.1 18-May-2008  yamt sync with head.
 1.6.54.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.38.1 18-Feb-2012  mrg merge to -current.
 1.7.34.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.34.1 17-Apr-2012  yamt sync with head
 1.8.6.1 23-Jun-2013  tls resync from head
 1.9.74.1 02-Aug-2025  perseant Sync with HEAD
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Mar-1998  cgd branches: 1.6.48;
sync with libc
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 06-Jan-1995  cgd copy back from libc
 1.3 06-Jan-1995  cgd from libc
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
quad support copied in from libc.
 1.1.2.2 04-Dec-1993  cgd quad support copied in from libc.
 1.1.2.1 04-Dec-1993  cgd file xordi3.c was added on branch magnum on 1993-12-04 05:02:01 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.2 16-Mar-2018  ryo use memmove.S
 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 22-Mar-2018  pgoyette Synch with HEAD, resolve 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 Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:04:30 +0000
 1.2 17-Oct-1996  cgd copy down changes from libc
 1.1 13-Feb-1995  cgd Alpha support from libc.
 1.28 14-Aug-2009  dsl Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.27 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.26 18-Mar-2009  tsutsui - remove bcmp(9), bcopy(9), and bzero(9) from libkern since <sys/systm.h> has
macro which replace them with mem*() functions in #ifdef _KERNEL as noted
in man pages
- move declarations of bcopy(3) and bzero(3) into <lib/libsa/stand.h>
since they are still in libsa for some MD standalone sources
(I guess all bcmp(3) in standalone sources have been replaced with memcmp(3)
but they should be replaced with memcmp() anyway)
 1.25 11-Dec-2005  christos branches: 1.25.74; 1.25.84; 1.25.90;
merge ktrace-lwp.
 1.24 22-Apr-2005  reed Use ${TOOL_M4} instead of "m4". (I only tested this fix
for sparc but not sparc64 or alpha yet.)

Noticed problem when building NetBSD/sparc from a Linux/i386 host
that didn't have "m4".
 1.23 24-Apr-2002  ross branches: 1.23.10; 1.23.18;
Add strtoul.c
 1.22 13-Jul-2001  thorpej Provide bcopy() here.
 1.21 26-Apr-2001  ross branches: 1.21.2;
o IEEE 754 floating-point completion code.
o Implement the architected FP_C "Floating Point Control Quadword"
 1.20 01-Nov-2000  thorpej branches: 1.20.2;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.19 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.18 15-Jan-1999  bouyer branches: 1.18.8;
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.17 04-Aug-1998  perry add memcmp.c memmove.S
 1.16 22-Feb-1998  mycroft Use the assembler version of memcpy().
 1.15 22-Feb-1998  mycroft We need memcpy().
 1.14 22-Feb-1998  mycroft Add some missing things.
 1.13 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.12 24-Oct-1997  chuck add memchr() to libkern
 1.11 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.10 18-Jan-1997  cgd branches: 1.10.8;
add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.9 27-Aug-1996  cgd Add machine-independent assertion-checking support. macros are:

assert() which always does assertion checking
unless "NDEBUG" is defined.

KASSERT() which does assertion checking if DIAGNOSTIC
is defined.

KDASSERT() which does assertion checking if DEBUG is
define. This macro exists for compatibility
with existing ports' assertion checking macros.
(Assertion checking is not typically an
"expensive" operation, and DIAGNOSTIC should be
used for inexpensive consistency checks.)
 1.8 21-Aug-1996  cgd fix up for new libkern path specs
 1.7 15-Jul-1996  cgd add an assembly version of ffs(), copied down from libc
 1.6 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.5 17-Apr-1996  cgd files copied from libc
 1.4 13-Apr-1996  cgd add strncasecmp.c to ports' libkern Makefile.inc's. When adding a new
source file to libkern, it should be added to _ALL_ ports makefiles if
it is machine-independent and used by machine-independent code (in
this case adosfs). (There are several arguments that say that
strncasecmp should not be in libkern at all, and i think they're
good ones, but as long as ADOSFS needs it to link, it has to be here
for all architectures.)
 1.3 20-Oct-1995  cgd use NetBSD RCS id format. use bzero.S, not bzerro.c
 1.2 28-Jun-1995  cgd update dependencies to deal with the alpha
 1.1 13-Feb-1995  cgd Alpha support from libc.
 1.10.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.18.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.18.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.20.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.20.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.20.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.21.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.21.2.1 03-Aug-2001  lukem update to -current
 1.23.18.1 29-Apr-2005  kent sync with -current
 1.23.10.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.25.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.74.2 19-Aug-2009  yamt sync with head.
 1.25.74.1 04-May-2009  yamt sync with head.
 1.3 17-Oct-1996  cgd copy down changes from libc
 1.2 26-Sep-1996  cgd label changes, pulled down from libc
 1.1 13-Feb-1995  cgd Alpha support from libc.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 26-Feb-2005  perry branches: 1.2.4;
nuke trailing whitespace
 1.1 05-Sep-2000  thorpej branches: 1.1.2; 1.1.26; 1.1.34; 1.1.36;
Move the Alpha _mcount() into a .S file so that it can be
pre-processed, like other Alpha assembly files.
 1.1.36.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.34.1 29-Apr-2005  kent sync with -current
 1.1.26.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.1.2.1 05-Sep-2000  bouyer file _mcount.S was added on branch thorpej_scsipi on 2000-11-20 18:09:21 +0000
 1.2.4.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 22-Feb-1998  mycroft branches: 1.1.64;
Use the assembler version of memcpy().
 1.1.64.1 21-Jun-2006  yamt sync with head.
 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 12-Oct-1997  bouyer branches: 1.1.2;
Ops, forgot to 'cvs add' theses. Pointed out by enami tsugutomo.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 12-Oct-1997  thorpej file bswap16.S was added on branch marc-pcmcia on 1997-10-14 10:27:00 +0000
 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 12-Oct-1997  bouyer branches: 1.1.2;
Ops, forgot to 'cvs add' theses. Pointed out by enami tsugutomo.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 12-Oct-1997  thorpej file bswap32.S was added on branch marc-pcmcia on 1997-10-14 10:27:01 +0000
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 22-Jan-1999  mycroft branches: 1.4.58;
Sync with libc.
 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 copy down changes from libc
 1.1 17-Apr-1996  cgd files copied from libc
 1.4.58.1 21-Jun-2006  yamt sync with head.
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 22-Jan-1999  mycroft branches: 1.5.58;
Sync with libc.
 1.4 15-Jan-1999  thorpej Fix an unterminated macro call.
 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 copy down changes from libc
 1.1 17-Apr-1996  cgd files copied from libc
 1.5.58.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 17-Oct-1996  cgd branches: 1.2.78;
copy down changes from libc
 1.1 20-Oct-1995  cgd copy from libkern
 1.2.78.1 21-Jun-2006  yamt sync with head.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 26-Feb-2005  perry nuke trailing whitespace
 1.6 24-Jan-2002  ross branches: 1.6.16; 1.6.24; 1.6.26;
sync
 1.5 17-Oct-1996  cgd branches: 1.5.40; 1.5.42;
copy down changes from libc
 1.4 26-Sep-1996  cgd label changes, pulled down from libc
 1.3 20-Oct-1995  cgd update from libc
 1.2 03-Mar-1995  cgd copy down from libc.
 1.1 13-Feb-1995  cgd Alpha support from libc.
 1.5.42.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.5.40.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.26.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.24.1 29-Apr-2005  kent sync with -current
 1.6.16.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 17-Oct-1996  cgd branches: 1.3.78;
copy down changes from libc
 1.2 15-Jul-1996  cgd 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(), copied down from libc
 1.3.78.1 21-Jun-2006  yamt sync with head.
 1.1 17-Apr-1996  cgd files copied from libc
 1.1 17-Apr-1996  cgd files copied from libc
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 22-Feb-1998  mycroft branches: 1.1.64;
Use the assembler version of memcpy().
 1.1.64.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 04-Aug-1998  perry branches: 1.1.62;
add memmove.S
 1.1.62.1 21-Jun-2006  yamt sync with head.
 1.1 17-Apr-1996  cgd files copied from libc
 1.1 17-Apr-1996  cgd files copied from libc
 1.21 29-Jan-2014  joerg Include compiler-rt in libc, libm and libkern.
 1.20 20-Aug-2013  matt Some assembly files need to compiled -marm since they are Thumb compatible.
 1.19 12-Aug-2013  matt Add EHABI unwind stubs to libkern so prevent errors in linking if unwind
tables are present.
 1.18 21-Jun-2013  matt branches: 1.18.2;
Add back {,u}modsi3 for libkern since if we are building standalone tools
we might be using the old ABI and might need them.
 1.17 20-Jun-2013  matt modsi3/umodsi3 are only needed !EABI arm
 1.16 02-May-2013  matt This change arm, armeb, earm, earmeb, earmhf, earmhfeb so all builds that
share a MACHINE_ARCH for userland so that except for etc, will produce
identical sets.

usr/include/machine now points to usr/include/arm
 1.15 06-Feb-2013  matt Modify earm rule to match any machine_arch starting with earm.
 1.14 23-Jan-2013  matt Add strnlen.c to SRCS (which will automatically use the .S version if it
exists).
 1.13 23-Jan-2013  macallan pull in strnlen.S
 1.12 30-Oct-2012  christos add new divsi3 related files.
 1.11 10-Oct-2012  christos add split files.
 1.10 06-Aug-2012  matt branches: 1.10.2;
If earm*, compile new aeabi runtime routines.
 1.9 14-Aug-2009  dsl branches: 1.9.12; 1.9.18; 1.9.20;
Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.8 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.7 14-Oct-2008  matt Add a _clzsi2 for armv4 platforms.
 1.6 23-Nov-2002  chris branches: 1.6.104; 1.6.108; 1.6.114;
Sync arm asm libkern files with libc's asm files.
 1.5 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.4 17-Aug-2002  chris pull in ffs.S from libc for arm.
The main benefit is that ffs always runs in constant time.
 1.3 20-Nov-2001  chris branches: 1.3.8;
Tidy up some memory copying cruft:
bcopy.S is no longer needed
memmove and memcpy were both stacking r0 and unstacking it to keep the return value, so push this down into _memcpy.
rename _memcpy.S to memcpy.S.
memmove.S is now just a placeholder otherwise the make system automagically adds a memmove.c file to libkern.
memmove is just another entry point for memcpy.
 1.2 06-Jul-2001  toshii branches: 1.2.2;
Remove bcmp, bcopy and bzero. We don't need them as they aren't
called from asm code, and we shouldn't have them if we don't need them.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2; 1.1.4;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.4.4 11-Dec-2002  thorpej Sync with HEAD.
 1.1.4.3 27-Aug-2002  nathanw Catch up to -current.
 1.1.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.4.1 24-Aug-2001  nathanw Catch up with -current.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file Makefile.inc was added on branch thorpej_scsipi on 2001-01-08 14:56:54 +0000
 1.2.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.8.1 29-Aug-2002  gehenna catch up with -current.
 1.6.114.1 19-Oct-2008  haad Sync with HEAD.
 1.6.108.2 19-Aug-2009  yamt sync with head.
 1.6.108.1 04-May-2009  yamt sync with head.
 1.6.104.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.20.1 28-Nov-2012  matt Deal with div/mod changes.
 1.9.18.1 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.9.12.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.9.12.2 16-Jan-2013  yamt sync with (a bit old) head
 1.9.12.1 30-Oct-2012  yamt sync with head
 1.10.2.4 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.2.3 23-Jun-2013  tls resync from head
 1.10.2.2 25-Feb-2013  tls resync with head
 1.10.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.2.2 18-May-2014  rmind sync with head
 1.18.2.1 28-Aug-2013  rmind sync with head
 1.3 20-Nov-2001  chris Tidy up some memory copying cruft:
bcopy.S is no longer needed
memmove and memcpy were both stacking r0 and unstacking it to keep the return value, so push this down into _memcpy.
rename _memcpy.S to memcpy.S.
memmove.S is now just a placeholder otherwise the make system automagically adds a memmove.c file to libkern.
memmove is just another entry point for memcpy.
 1.2 23-Jan-2001  bjh21 branches: 1.2.2; 1.2.4;
Sync with libc for licence update.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file _memcpy.S was added on branch thorpej_scsipi on 2001-01-08 14:56:55 +0000
 1.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.2 20-Nov-2001  chris Tidy up some memory copying cruft:
bcopy.S is no longer needed
memmove and memcpy were both stacking r0 and unstacking it to keep the return value, so push this down into _memcpy.
rename _memcpy.S to memcpy.S.
memmove.S is now just a placeholder otherwise the make system automagically adds a memmove.c file to libkern.
memmove is just another entry point for memcpy.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2; 1.1.4; 1.1.6;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file bcopy.S was added on branch thorpej_scsipi on 2001-01-08 14:56:56 +0000
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 05-Apr-2003  bjh21 branches: 1.3.2; 1.3.10; 1.3.12;
NetBSD/acorn26 has used 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; 1.1.6; 1.1.18; 1.1.20;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.20.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.18.1 15-Jul-2002  gehenna catch up with -current.
 1.1.6.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.4.1 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file byte_swap_2.S was added on branch thorpej_scsipi on 2001-01-08 14:56:56 +0000
 1.3.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.10.1 29-Apr-2005  kent sync with -current
 1.3.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 05-Apr-2003  bjh21 branches: 1.2.18;
NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file byte_swap_4.S was added on branch thorpej_scsipi on 2001-01-08 14:56:57 +0000
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.2 09-Nov-2003  scw bzero is no longer used in the kernel.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2; 1.1.26;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.26.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file bzero.S was added on branch thorpej_scsipi on 2001-01-08 14:56:58 +0000
 1.7 29-Jan-2014  joerg Include compiler-rt in libc, libm and libkern.
 1.6 21-Aug-2013  matt Thumbify
 1.5 11-Aug-2013  matt Support thumb
 1.4 01-Sep-2012  matt branches: 1.4.2; 1.4.4;
Add ARMv5 support the clz instruction
 1.3 15-Oct-2008  matt branches: 1.3.2; 1.3.10; 1.3.16; 1.3.34;
Use RET/RETc as appropriate
 1.2 14-Oct-2008  matt Need to be __clz[sd]i2
 1.1 14-Oct-2008  matt Add a _clzsi2 for armv4 platforms.
 1.3.34.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.34.1 30-Oct-2012  yamt sync with head
 1.3.16.2 04-May-2009  yamt sync with head.
 1.3.16.1 15-Oct-2008  yamt file clzsi2.S was added on branch yamt-nfs-mp on 2009-05-04 08:13:50 +0000
 1.3.10.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.10.1 15-Oct-2008  mjf file clzsi2.S was added on branch mjf-devfs2 on 2009-01-17 13:29:21 +0000
 1.3.2.2 19-Oct-2008  haad Sync with HEAD.
 1.3.2.1 15-Oct-2008  haad file clzsi2.S was added on branch haad-dm on 2008-10-19 22:17:40 +0000
 1.4.4.2 18-May-2014  rmind sync with head
 1.4.4.1 28-Aug-2013  rmind sync with head
 1.4.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 26-Feb-2005  perry branches: 1.5.4;
nuke trailing whitespace
 1.4 05-Apr-2003  bjh21 branches: 1.4.2; 1.4.10; 1.4.12;
NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 15-Aug-2002  briggs Use .L prefix for all local labels.
 1.2 13-Nov-2001  chris branches: 1.2.8;
Sync to libc version of divsi3.S. This is to fix up the stack for 8 byte alignment.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2; 1.1.4; 1.1.6;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2 27-Aug-2002  nathanw Catch up to -current.
 1.1.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file divsi3.S was added on branch thorpej_scsipi on 2001-01-08 14:56:59 +0000
 1.2.8.1 29-Aug-2002  gehenna catch up with -current.
 1.4.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.10.1 29-Apr-2005  kent sync with -current
 1.4.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.4.1 21-Jun-2006  yamt sync with head.
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 05-Apr-2003  bjh21 branches: 1.3.2; 1.3.10; 1.3.12;
NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 17-Aug-2002  thorpej branches: 1.2.2; 1.2.4; 1.2.6;
Local label fixup.
 1.1 17-Aug-2002  chris pull in ffs.S from libc for arm.
The main benefit is that ffs always runs in constant time.
 1.2.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.6.1 17-Aug-2002  jdolecek file ffs.S was added on branch kqueue on 2002-09-06 08:48:27 +0000
 1.2.4.2 29-Aug-2002  gehenna catch up with -current.
 1.2.4.1 17-Aug-2002  gehenna file ffs.S was added on branch gehenna-devsw on 2002-08-29 05:23:19 +0000
 1.2.2.2 27-Aug-2002  nathanw Catch up to -current.
 1.2.2.1 17-Aug-2002  nathanw file ffs.S was added on branch nathanw_sa on 2002-08-27 23:47:44 +0000
 1.3.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.10.1 29-Apr-2005  kent sync with -current
 1.3.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 23-Oct-2003  scw branches: 1.4.16;
Duh, fix the align-to-32-bits code.
 1.3 13-Oct-2003  scw Xscale-optimised mem* functions, 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,
results in > 100% speedup on Xscale.

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

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
don't overlap. Otherwise unchanged.
 1.2 05-Apr-2003  bjh21 branches: 1.2.2;
NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__.
 1.1 23-Nov-2002  chris branches: 1.1.2;
Sync arm asm libkern files with libc's asm files.
 1.1.2.2 11-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-11 06:46:24 +0000
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 13-Oct-2003  scw branches: 1.6.16;
Xscale-optimised mem* functions, 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,
results in > 100% speedup on Xscale.

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

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
don't overlap. Otherwise unchanged.
 1.5 09-Oct-2003  ichiro big endian support

thanks to smi@sm.sony.co.jp
 1.4 05-Apr-2003  bjh21 branches: 1.4.2;
NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__.
 1.3 15-Aug-2002  briggs Use .L prefix for all local labels.
 1.2 20-Nov-2001  chris branches: 1.2.8;
Tidy up some memory copying cruft:
bcopy.S is no longer needed
memmove and memcpy were both stacking r0 and unstacking it to keep the return value, so push this down into _memcpy.
rename _memcpy.S to memcpy.S.
memmove.S is now just a placeholder otherwise the make system automagically adds a memmove.c file to libkern.
memmove is just another entry point for memcpy.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2; 1.1.4; 1.1.6;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2 27-Aug-2002  nathanw Catch up to -current.
 1.1.4.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file memcpy.S was added on branch thorpej_scsipi on 2001-01-08 14:56:59 +0000
 1.2.8.1 29-Aug-2002  gehenna catch up with -current.
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 02-Jun-2005  scw branches: 1.3.2;
Re-sync with libc version of memcpy_arm.S, which has deals correctly
with big-endian ARM (non-XScale) systems.
 1.2 26-Feb-2005  perry nuke trailing whitespace
 1.1 13-Oct-2003  scw branches: 1.1.4; 1.1.10; 1.1.12;
Xscale-optimised mem* functions, 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,
results in > 100% speedup on Xscale.

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

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
don't overlap. Otherwise unchanged.
 1.1.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.10.1 29-Apr-2005  kent sync with -current
 1.1.4.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.4.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 13-Oct-2003  skrll file memcpy_arm.S was added on branch ktrace-lwp on 2004-08-03 10:53:42 +0000
 1.3.2.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 26-Feb-2005  perry branches: 1.2.2; 1.2.4;
nuke trailing whitespace
 1.1 13-Oct-2003  scw branches: 1.1.4; 1.1.10; 1.1.12;
Xscale-optimised mem* functions, 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,
results in > 100% speedup on Xscale.

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

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
don't overlap. Otherwise unchanged.
 1.1.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.10.1 29-Apr-2005  kent sync with -current
 1.1.4.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 13-Oct-2003  skrll file memcpy_xscale.S was added on branch ktrace-lwp on 2004-08-03 10:53:42 +0000
 1.2.4.1 21-Jun-2006  yamt sync with head.
 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.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.2; 1.4.4;
nuke trailing whitespace
 1.3 13-Oct-2003  scw branches: 1.3.8; 1.3.10;
Xscale-optimised mem* functions, 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,
results in > 100% speedup on Xscale.

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

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
don't overlap. Otherwise unchanged.
 1.2 20-Nov-2001  chris branches: 1.2.16;
Tidy up some memory copying cruft:
bcopy.S is no longer needed
memmove and memcpy were both stacking r0 and unstacking it to keep the return value, so push this down into _memcpy.
rename _memcpy.S to memcpy.S.
memmove.S is now just a placeholder otherwise the make system automagically adds a memmove.c file to libkern.
memmove is just another entry point for memcpy.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2; 1.1.4; 1.1.6;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file memmove.S was added on branch thorpej_scsipi on 2001-01-08 14:57:00 +0000
 1.2.16.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.16.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.4.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 common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 13-Oct-2003  scw branches: 1.4.16;
Xscale-optimised mem* functions, 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,
results in > 100% speedup on Xscale.

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

memmove() - Big-endian support. Use fast memcpy(), above, if the regions
don't overlap. Otherwise unchanged.
 1.3 05-Apr-2003  bjh21 branches: 1.3.2;
NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 15-Aug-2002  briggs Use .L prefix for all local labels.
 1.1 29-Dec-2000  bjh21 branches: 1.1.2; 1.1.4; 1.1.6; 1.1.18;
Create a shared set of ARM sources for libkern and move arm26 over to using
them.

These are identical to the current arm32 sources with the following exceptions:
- References to C labels are wrapped in _C_LABEL().
- Function returns have an alternate version inside #ifdef __APCS_26__.
 1.1.18.1 29-Aug-2002  gehenna catch up with -current.
 1.1.6.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.4.1 27-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 08-Jan-2001  bouyer Files added on trunk.
 1.1.2.1 29-Dec-2000  bouyer file memset.S was added on branch thorpej_scsipi on 2001-01-08 14:57:01 +0000
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 05-Apr-2003  bjh21 branches: 1.3.18;
NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__.
 1.2 23-Nov-2002  chris branches: 1.2.2;
Sync arm asm libkern files with libc's asm files.
 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 11-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-11 06:46:24 +0000
 1.3.18.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 05-Apr-2003  bjh21 branches: 1.2.18;
NetBSD/acorn26 has used APCS-32 for years, so unifdef -U__APCS_26__.
 1.1 23-Nov-2002  chris branches: 1.1.2;
Sync arm asm libkern files with libc's asm files.
 1.1.2.2 11-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-11 06:46:24 +0000
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.2 12-Aug-2013  matt branches: 1.2.2; 1.2.6; 1.2.10;
Fix typos (prX not cpX)
 1.1 12-Aug-2013  matt Add EHABI unwind stubs to libkern so prevent errors in linking if unwind
tables are present.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 12-Aug-2013  tls file unwind_stub.c was added on branch tls-maxphys on 2014-08-20 00:04:30 +0000
 1.2.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.2.6.1 12-Aug-2013  yamt file unwind_stub.c was added on branch yamt-pagecache on 2014-05-22 11:41:04 +0000
 1.2.2.2 28-Aug-2013  rmind sync with head
 1.2.2.1 12-Aug-2013  rmind file unwind_stub.c was added on branch rmind-smpnet on 2013-08-28 23:59:35 +0000
 1.13 13-Jun-2022  skrll Provide a __canonicalize_funcptr_for_compare which only needs to return
the passed value as the kernel doesn't do PLABELS.

PR/56878 (hppa: kernel module lua fails to load)
 1.12 13-Mar-2014  pooka branches: 1.12.34;
remove compiler-rt duplicates to fix build
 1.11 22-Sep-2009  pooka branches: 1.11.12; 1.11.22; 1.11.26;
Don't build spcopy for rumpkern. Fixes hp700 build failure pointed
out by nick.

XXX: spcopy should be in the main kernel instead of libkern in any case
 1.10 14-Aug-2009  dsl Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.9 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.8 18-Mar-2009  tsutsui - remove bcmp(9), bcopy(9), and bzero(9) from libkern since <sys/systm.h> has
macro which replace them with mem*() functions in #ifdef _KERNEL as noted
in man pages
- move declarations of bcopy(3) and bzero(3) into <lib/libsa/stand.h>
since they are still in libsa for some MD standalone sources
(I guess all bcmp(3) in standalone sources have been replaced with memcmp(3)
but they should be replaced with memcmp() anyway)
 1.7 04-Feb-2006  uwe branches: 1.7.68; 1.7.78; 1.7.84;
Add bswap16.c and bswap32.c to SRCS. We need fallback versions for
kernels compiled without optimization (and thus without inlining of
bswap16 and bswap32)
 1.6 27-Dec-2005  yamt branches: 1.6.2; 1.6.4; 1.6.6;
fix build of bzero.
XXX is it better to remove it as i386?
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 21-Oct-2003  tsutsui branches: 1.4.16;
Add bswap64.c, required by options FFS_EI.
 1.3 11-Sep-2003  chs the asm version of strlcpy() was buggy, just use the C version.
 1.2 21-Sep-2002  chs branches: 1.2.6;
add strtoul.c, it's now used in MI code.
 1.1 06-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added hppa support to libkern.
 1.1.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.1 06-Jun-2002  jdolecek file Makefile.inc was added on branch kqueue on 2002-06-23 17:49:46 +0000
 1.1.2.2 20-Jun-2002  gehenna catch up with -current.
 1.1.2.1 06-Jun-2002  gehenna file Makefile.inc was added on branch gehenna-devsw on 2002-06-20 16:02:24 +0000
 1.2.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.6.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.6.2.1 18-Feb-2006  yamt sync with head.
 1.7.84.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.78.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.68.3 11-Mar-2010  yamt sync with head
 1.7.68.2 19-Aug-2009  yamt sync with head.
 1.7.68.1 04-May-2009  yamt sync with head.
 1.11.26.1 18-May-2014  rmind sync with head
 1.11.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.12.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.34.1 14-Jun-2022  martin Pull up following revision(s) (requested by skrll in ticket #1472):

sys/lib/libkern/arch/hppa/Makefile.inc: revision 1.13
sys/lib/libkern/arch/hppa/milli.S: revision 1.3
sys/lib/libkern/arch/hppa/milli_extra.S: revision 1.1

Don't need $$sh_func_adrs

Provide a __canonicalize_funcptr_for_compare which only needs to return
the passed value as the kernel doesn't do PLABELS.
PR/56878 (hppa: kernel module lua fails to load)
 1.17 09-Aug-2021  andvar fix typos in asymmetry, asymmetric(al), symmetrical.
 1.16 16-Jan-2021  chs remove unused "_DIAGNOSTIC" option and opt_diagnostic.h.
note that this is unrelated to the widely used "DIAGNOSTIC" option.
 1.15 30-Aug-2015  uebayasi branches: 1.15.30;
Include opt_diagnostic.h.
 1.14 31-Jan-2011  skrll branches: 1.14.14; 1.14.32;
This file needs opt_multiprocessor.h early so we pick up the right
definition from cpu.h, etc.

XXX should revisit the _STANDALONE vs _KERNEL split
 1.13 24-Jan-2011  skrll Fix build.
 1.12 22-Jan-2011  skrll Fix MULTIPROCESSOR curlwp/curcpu handling... missed in previous commit.
 1.11 20-Mar-2010  chs branches: 1.11.2; 1.11.4;
fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.10 10-Dec-2009  skrll branches: 1.10.2; 1.10.4;
Rename L_ADDR to L_PCB
 1.9 01-Dec-2009  skrll Remove U_PCB as requested by rmind.

Same code before and after.
 1.8 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.7 28-Apr-2008  martin branches: 1.7.8; 1.7.14;
Remove clause 3 and 4 from TNF licenses
 1.6 04-Mar-2007  christos branches: 1.6.36; 1.6.38; 1.6.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 11-Dec-2005  christos branches: 1.5.26;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 10-Oct-2003  chs branches: 1.3.8; 1.3.10;
update for new gas syntax. from Jochen Kunz.
 1.2 31-Aug-2003  chs update for LWPs, and some lite cleanup.
 1.1 06-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added hppa support to libkern.
 1.1.10.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.1 06-Jun-2002  jdolecek file bcopy.S was added on branch kqueue on 2002-06-23 17:49:46 +0000
 1.1.2.2 20-Jun-2002  gehenna catch up with -current.
 1.1.2.1 06-Jun-2002  gehenna file bcopy.S was added on branch gehenna-devsw on 2002-06-20 16:02:24 +0000
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.1 03-Sep-2007  yamt sync with head.
 1.5.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.40.4 11-Aug-2010  yamt sync with head.
 1.6.40.3 11-Mar-2010  yamt sync with head
 1.6.40.2 04-May-2009  yamt sync with head.
 1.6.40.1 16-May-2008  yamt sync with head.
 1.6.38.1 18-May-2008  yamt sync with head.
 1.6.36.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.8.1 27-Oct-2008  skrll Commit work in progress.
 1.10.4.2 05-Mar-2011  rmind sync with head
 1.10.4.1 30-May-2010  rmind sync with head
 1.10.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.11.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.14.32.1 22-Sep-2015  skrll Sync with HEAD
 1.14.14.1 03-Dec-2017  jdolecek update from HEAD
 1.15.30.1 03-Apr-2021  thorpej Sync with HEAD.
 1.1 06-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added hppa support to libkern.
 1.1.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.1 06-Jun-2002  jdolecek file memcpy.S was added on branch kqueue on 2002-06-23 17:49:46 +0000
 1.1.2.2 20-Jun-2002  gehenna catch up with -current.
 1.1.2.1 06-Jun-2002  gehenna file memcpy.S was added on branch gehenna-devsw on 2002-06-20 16:02:24 +0000
 1.1 06-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added hppa support to libkern.
 1.1.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.1 06-Jun-2002  jdolecek file memmove.S was added on branch kqueue on 2002-06-23 17:49:46 +0000
 1.1.2.2 20-Jun-2002  gehenna catch up with -current.
 1.1.2.1 06-Jun-2002  gehenna file memmove.S was added on branch gehenna-devsw on 2002-06-20 16:02:24 +0000
 1.3 13-Jun-2022  skrll Don't need $$sh_func_adrs
 1.2 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.1 06-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.204;
Added hppa support to libkern.
 1.1.204.1 14-Jun-2022  martin Pull up following revision(s) (requested by skrll in ticket #1472):

sys/lib/libkern/arch/hppa/Makefile.inc: revision 1.13
sys/lib/libkern/arch/hppa/milli.S: revision 1.3
sys/lib/libkern/arch/hppa/milli_extra.S: revision 1.1

Don't need $$sh_func_adrs

Provide a __canonicalize_funcptr_for_compare which only needs to return
the passed value as the kernel doesn't do PLABELS.
PR/56878 (hppa: kernel module lua fails to load)
 1.1.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.1 06-Jun-2002  jdolecek file milli.S was added on branch kqueue on 2002-06-23 17:49:47 +0000
 1.1.2.2 20-Jun-2002  gehenna catch up with -current.
 1.1.2.1 06-Jun-2002  gehenna file milli.S was added on branch gehenna-devsw on 2002-06-20 16:02:25 +0000
 1.2 15-Jun-2022  skrll Fix a dumb typo/thinko

Thanks to Tom Lane for spotting it.
 1.1 13-Jun-2022  skrll branches: 1.1.2;
Provide a __canonicalize_funcptr_for_compare which only needs to return
the passed value as the kernel doesn't do PLABELS.

PR/56878 (hppa: kernel module lua fails to load)
 1.1.2.3 16-Jun-2022  martin Pull up following revision(s) (requested by skrll in ticket #1473):

sys/lib/libkern/arch/hppa/milli_extra.S: revision 1.2

Fix a dumb typo/thinko

Thanks to Tom Lane for spotting it.
 1.1.2.2 14-Jun-2022  martin Pull up following revision(s) (requested by skrll in ticket #1472):

sys/lib/libkern/arch/hppa/Makefile.inc: revision 1.13
sys/lib/libkern/arch/hppa/milli.S: revision 1.3
sys/lib/libkern/arch/hppa/milli_extra.S: revision 1.1

Don't need $$sh_func_adrs

Provide a __canonicalize_funcptr_for_compare which only needs to return
the passed value as the kernel doesn't do PLABELS.
PR/56878 (hppa: kernel module lua fails to load)
 1.1.2.1 13-Jun-2022  martin file milli_extra.S was added on branch netbsd-9 on 2022-06-14 10:41:18 +0000
 1.2 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.1 06-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.148; 1.1.158; 1.1.164;
Added hppa support to libkern.
 1.1.164.1 18-May-2014  rmind sync with head
 1.1.158.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.148.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.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.1 06-Jun-2002  jdolecek file prefix.h was added on branch kqueue on 2002-06-23 17:49:47 +0000
 1.1.2.2 20-Jun-2002  gehenna catch up with -current.
 1.1.2.1 06-Jun-2002  gehenna file prefix.h was added on branch gehenna-devsw on 2002-06-20 16:02:25 +0000
 1.1 06-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added hppa support to libkern.
 1.1.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.1 06-Jun-2002  jdolecek file spcopy.S was added on branch kqueue on 2002-06-23 17:49:47 +0000
 1.1.2.2 20-Jun-2002  gehenna catch up with -current.
 1.1.2.1 06-Jun-2002  gehenna file spcopy.S was added on branch gehenna-devsw on 2002-06-20 16:02:25 +0000
 1.2 11-Sep-2003  chs the asm version of strlcpy() was buggy, just use the C version.
 1.1 06-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added hppa support to libkern.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.1 06-Jun-2002  jdolecek file strlcpy.S was added on branch kqueue on 2002-06-23 17:49:48 +0000
 1.1.2.2 20-Jun-2002  gehenna catch up with -current.
 1.1.2.1 06-Jun-2002  gehenna file strlcpy.S was added on branch gehenna-devsw on 2002-06-20 16:02:25 +0000
 1.6 10-Sep-1999  drochner -don't use DEFS.h nor SYS.h in libkern
-remove setjmp.S, it's not useful for libkern
 1.5 13-Oct-1997  lukem rcsid fascism
 1.4 07-Oct-1995  mycroft branches: 1.4.14;
Update from libc.
 1.3 05-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 05-Nov-1993  cgd branches: 1.1.2;
added files copied in from libc. version numbers are screwed,
but are screwed for the rest of libkern's files, anyway.
 1.1.2.2 05-Nov-1993  cgd added files copied in from libc. version numbers are screwed,
but are screwed for the rest of libkern's files, anyway.
 1.1.2.1 05-Nov-1993  cgd file DEFS.h was added on branch magnum on 1993-11-05 22:40:56 +0000
 1.4.14.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.32 27-Jan-2020  ad Make x86 use the C version of memcmp().
 1.31 14-Aug-2009  dsl branches: 1.31.64; 1.31.70;
Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.30 12-Aug-2009  skrll Put back random.S. Hi dsl!
 1.29 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.28 25-Mar-2009  darran Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.27 11-Dec-2005  christos branches: 1.27.74; 1.27.84; 1.27.86; 1.27.90; 1.27.94;
merge ktrace-lwp.
 1.26 26-Oct-2003  junyoung Remove bcmp.S and bzero.S from list. They were doing nothing but wasting
kernel bits for a long time (2 years?).
 1.25 05-Apr-2001  thorpej branches: 1.25.22;
Build strtoul.c
 1.24 01-Nov-2000  thorpej branches: 1.24.2;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.23 15-Jan-1999  bouyer branches: 1.23.8;
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.22 04-Aug-1998  perry add memcmp.S
 1.21 04-Aug-1998  perry Fix formatting, and add memmove.S
 1.20 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.19 22-Feb-1998  mycroft Add strchr.S and strrchr.S.
 1.18 22-Feb-1998  mycroft Sync with libc.
 1.17 22-Feb-1998  mycroft Add some missing things.
 1.16 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.15 24-Oct-1997  chuck add memchr() to libkern
 1.14 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.13 18-Jan-1997  cgd branches: 1.13.8;
add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.12 27-Aug-1996  cgd Add machine-independent assertion-checking support. macros are:

assert() which always does assertion checking
unless "NDEBUG" is defined.

KASSERT() which does assertion checking if DIAGNOSTIC
is defined.

KDASSERT() which does assertion checking if DEBUG is
define. This macro exists for compatibility
with existing ports' assertion checking macros.
(Assertion checking is not typically an
"expensive" operation, and DIAGNOSTIC should be
used for inexpensive consistency checks.)
 1.11 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.10 13-Apr-1996  cgd add strncasecmp.c to ports' libkern Makefile.inc's. When adding a new
source file to libkern, it should be added to _ALL_ ports makefiles if
it is machine-independent and used by machine-independent code (in
this case adosfs). (There are several arguments that say that
strncasecmp should not be in libkern at all, and i think they're
good ones, but as long as ADOSFS needs it to link, it has to be here
for all architectures.)
 1.9 11-Mar-1996  scottr Back out previous change.
 1.8 11-Mar-1996  thorpej Provide a memset() for the i386 (assembly version), and move memset.c
out into the libkern proper in case other ports want to use it.
i386 kernels with COMPAT_LINUX should compile now.
 1.7 07-Oct-1995  mycroft Remove bzero.S and setjmp.S, as these functions are in locore.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 24-Feb-1994  mycroft Assembler versions of these.
 1.4 04-Dec-1993  cgd use .S files
 1.3 15-Oct-1993  cgd branches: 1.3.2;
add strncmp to anything
 1.2 15-Oct-1993  cgd add __main()
 1.1 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.3.2.2 04-Dec-1993  cgd use quad support; we need it
 1.3.2.1 15-Oct-1993  cgd file Makefile.inc was added on branch magnum on 1993-12-04 05:07:53 +0000
 1.13.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.8.2 21-Apr-2001  bouyer Sync with HEAD
 1.23.8.1 22-Nov-2000  bouyer Sync with HEAD.
 1.24.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.25.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.22.1 03-Aug-2004  skrll Sync with HEAD
 1.27.94.1 21-Apr-2010  matt sync to netbsd-5
 1.27.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.86.1 03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
sys/lib/libkern/Makefile: patch
sys/lib/libkern/crc32.c: revision 1.1
sys/lib/libkern/crc32.h: revision 1.1
sys/lib/libkern/libkern.h: revision 1.89
sys/lib/libkern/arch/i386/Makefile.inc: revision 1.28
sys/net/zlib.h: revision 1.14 via patch
sys/opencrypto/crypto.c: revision 1.33
sys/opencrypto/cryptodev.c: revision 1.46
sys/opencrypto/cryptodev.h: revision 1.16
sys/opencrypto/cryptosoft.c: revision 1.24
sys/opencrypto/cryptosoft.h: revision 1.6
sys/opencrypto/deflate.h: revision 1.6
sys/opencrypto/cryptosoft_xform.c: revision 1.12
sys/opencrypto/deflate.c: revision 1.13
sys/opencrypto/files.opencrypto: revision 1.20
sys/opencrypto/ocryptodev.c: revision 1.1
sys/opencrypto/ocryptodev.h: revision 1.1
sys/opencrypto/xform.c: revision 1.18
sys/opencrypto/xform.h: revision 1.10
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel. The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.
 1.27.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.27.74.2 19-Aug-2009  yamt sync with head.
 1.27.74.1 04-May-2009  yamt sync with head.
 1.31.70.1 29-Feb-2020  ad Sync with head.
 1.31.64.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.10 10-Sep-1999  drochner -don't use DEFS.h nor SYS.h in libkern
-remove setjmp.S, it's not useful for libkern
 1.9 23-Aug-1999  kleink Sync with libc: use _ALIGN_TEXT from <machine/asm.h>.
 1.8 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.7 22-Feb-1998  mycroft Sync with libc.
 1.6 13-Oct-1997  lukem rcsid fascism
 1.5 07-Oct-1995  mycroft branches: 1.5.14;
Update from libc.
 1.4 05-Feb-1995  mycroft Sync with libc.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 15-Feb-1994  mycroft Update from libc.
 1.1 05-Nov-1993  cgd branches: 1.1.2;
added files copied in from libc. version numbers are screwed,
but are screwed for the rest of libkern's files, anyway.
 1.1.2.2 05-Nov-1993  cgd added files copied in from libc. version numbers are screwed,
but are screwed for the rest of libkern's files, anyway.
 1.1.2.1 05-Nov-1993  cgd file SYS.h was added on branch magnum on 1993-11-05 22:40:58 +0000
 1.5.14.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7 26-Oct-2003  junyoung Goodbye to bcmp.S, bcopy.S, and bzero.S. They are defined as macros in
sys/systm.h.
 1.6 22-Feb-1998  mycroft branches: 1.6.48;
Move random.S from arch/i386/i386.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 05-Feb-1995  mycroft Sync with libc.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file bcmp.S was added on branch magnum on 1993-12-04 03:05:17 +0000
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.5 26-Oct-2003  junyoung Goodbye to bcmp.S, bcopy.S, and bzero.S. They are defined as macros in
sys/systm.h.
 1.4 15-Apr-2003  dsl branches: 1.4.2;
Significantly faster memcpy/memmove/bcopy and memset/bzero
 1.3 10-Jul-2002  kent Avoid redundant memory access.
 1.2 22-Feb-1998  mycroft branches: 1.2.26; 1.2.28; 1.2.40;
Move random.S from arch/i386/i386.
 1.1 22-Feb-1998  mycroft Sync with libc.
 1.2.40.1 15-Jul-2002  gehenna catch up with -current.
 1.2.28.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.26.1 01-Aug-2002  nathanw Catch up to -current.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 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 13-Oct-1997  lukem branches: 1.2.2;
rcsid fascism
 1.1 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.2.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.2.1 13-Oct-1997  thorpej file bswap16.S was added on branch marc-pcmcia on 1997-10-14 10:27:28 +0000
 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 13-Oct-1997  lukem branches: 1.2.2;
rcsid fascism
 1.1 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.2.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.2.1 13-Oct-1997  thorpej file bswap32.S was added on branch marc-pcmcia on 1997-10-14 10:27:29 +0000
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 14-Dec-2000  mycroft branches: 1.2.24;
ALTENTRY() must die.
 1.1 15-Jan-1999  bouyer branches: 1.1.8;
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.8.1 05-Jan-2001  bouyer Sync with HEAD
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 14-Dec-2000  mycroft branches: 1.2.24;
ALTENTRY() must die.
 1.1 15-Jan-1999  bouyer branches: 1.1.8;
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.8.1 05-Jan-2001  bouyer Sync with HEAD
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.8 26-Oct-2003  junyoung Goodbye to bcmp.S, bcopy.S, and bzero.S. They are defined as macros in
sys/systm.h.
 1.7 15-Apr-2003  dsl branches: 1.7.2;
Significantly faster memcpy/memmove/bcopy and memset/bzero
 1.6 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 05-Feb-1995  mycroft Sync with libc.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file bzero.S was added on branch magnum on 1993-12-04 03:05:45 +0000
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 04-Dec-2003  keihan branches: 1.8.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.7 23-Aug-1999  kleink branches: 1.7.36;
Sync with libc: use _ALIGN_TEXT from <machine/asm.h>.
 1.6 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 05-Feb-1995  mycroft Sync with libc.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file ffs.S was added on branch magnum on 1993-12-04 03:06:04 +0000
 1.7.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.36.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.8 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 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.6 22-Feb-1998  mycroft Sync with libc.
 1.5 13-Oct-1997  lukem rcsid fascism
 1.4 07-Oct-1995  mycroft branches: 1.4.14;
Update from libc.
 1.3 05-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file htonl.S was added on branch magnum on 1993-12-04 03:06:13 +0000
 1.4.14.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.8 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 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.6 22-Feb-1998  mycroft Sync with libc.
 1.5 13-Oct-1997  lukem rcsid fascism
 1.4 07-Oct-1995  mycroft branches: 1.4.14;
Update from libc.
 1.3 05-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file htons.S was added on branch magnum on 1993-12-04 03:06:23 +0000
 1.4.14.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.3 27-Oct-2003  junyoung index() shouldn't be used in the kernel. Use strchr() instead.
 1.2 23-Aug-1999  kleink branches: 1.2.36;
Sync with libc: use _ALIGN_TEXT from <machine/asm.h>.
 1.1 22-Feb-1998  mycroft And index.S...
 1.2.36.1 03-Aug-2004  skrll Sync with HEAD
 1.3 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 24-Feb-1994  mycroft Assembler versions of these.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 04-Dec-2003  keihan branches: 1.5.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.4 23-Aug-1999  kleink branches: 1.4.36;
Sync with libc: use _ALIGN_TEXT from <machine/asm.h>.
 1.3 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.2 05-Feb-1998  mrg initial import of the new virtual memory system, UVM, into -current.

UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code. i provided some help
getting swap and paging working, and other bug fixes/ideas. chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly. :-)
 1.1 24-Oct-1997  chuck add memchr() to libkern
 1.4.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.36.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 04-Dec-2003  keihan branches: 1.3.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.2 21-Sep-2001  fvdl branches: 1.2.18;
Make new gas happy. Use movzbl instead of xorl + movb.
 1.1 04-Aug-1998  perry branches: 1.1.24; 1.1.26; 1.1.28;
add memcmp.S
 1.1.28.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.26.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.24.1 21-Sep-2001  nathanw Catch up to -current.
 1.2.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.18.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 15-Apr-2004  yamt branches: 1.5.12;
add '.L' prefixes to local labels.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 15-Apr-2003  dsl branches: 1.3.2;
Significantly faster memcpy/memmove/bcopy and memset/bzero
 1.2 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.1 22-Feb-1998  mycroft Sync with libc.
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.12.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 15-Apr-2003  dsl branches: 1.2.18;
Significantly faster memcpy/memmove/bcopy and memset/bzero
 1.1 04-Aug-1998  perry add memmove.S
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 15-Apr-2004  yamt branches: 1.6.12;
add '.L' prefixes to local labels.
 1.5 15-Apr-2003  dsl branches: 1.5.2;
Significantly faster memcpy/memmove/bcopy and memset/bzero
 1.4 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.3 22-Feb-1998  mycroft Sync with libc.
 1.2 11-Mar-1996  scottr Back out previous change.
 1.1 11-Mar-1996  thorpej Provide a memset() for the i386 (assembly version), and move memset.c
out into the libkern proper in case other ports want to use it.
i386 kernels with COMPAT_LINUX should compile now.
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.12.1 21-Jun-2006  yamt sync with head.
 1.8 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 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.6 22-Feb-1998  mycroft Sync with libc.
 1.5 13-Oct-1997  lukem rcsid fascism
 1.4 07-Oct-1995  mycroft branches: 1.4.14;
Update from libc.
 1.3 05-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file ntohl.S was added on branch magnum on 1993-12-04 03:06:33 +0000
 1.4.14.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.8 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 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.6 22-Feb-1998  mycroft Sync with libc.
 1.5 13-Oct-1997  lukem rcsid fascism
 1.4 07-Oct-1995  mycroft branches: 1.4.14;
Update from libc.
 1.3 05-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file ntohs.S was added on branch magnum on 1993-12-04 03:06:43 +0000
 1.4.14.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.6 07-Sep-2010  pooka Rename jump label to something a little more negative. No, I'm
not doing it for cosmetic value or out of angst. See, PIC_PROLOGUE
on i386 uses the "1" label internally. Now, everything would be
fine and dandy for the first 551245 calls to random. After that
p+q is negative and the jump is taken. However, it is taken into
the middle of PIC_PROLOGUE instead of where upon superficial
examination we assumed we are jumping. This causes wrong(tm) things
to happen and "ret" triggers a jump into hyperspace.

(no, I did not see that coming)
 1.5 04-Jan-2009  pooka branches: 1.5.4; 1.5.6;
Support PIC for inclusion in librump. (m68k untested)
 1.4 28-Apr-2008  martin branches: 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 15-Aug-1998  mycroft branches: 1.3.144; 1.3.146; 1.3.148;
Assign my copyrights to TNF.
 1.2 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.1 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.3.148.3 09-Oct-2010  yamt sync with head
 1.3.148.2 04-May-2009  yamt sync with head.
 1.3.148.1 16-May-2008  yamt sync with head.
 1.3.146.1 18-May-2008  yamt sync with head.
 1.3.144.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.144.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.6.1 05-Mar-2011  rmind sync with head
 1.5.4.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.3 05-Nov-2003  junyoung rindex() shouldn't be used in the kernel. Use strrchr() instead.
 1.2 23-Aug-1999  kleink branches: 1.2.36;
Sync with libc: use _ALIGN_TEXT from <machine/asm.h>.
 1.1 22-Feb-1998  mycroft And rindex.S...
 1.2.36.1 03-Aug-2004  skrll Sync with HEAD
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 10-Sep-1999  drochner branches: 1.8.134; 1.8.136; 1.8.138;
-don't use DEFS.h nor SYS.h in libkern
-remove setjmp.S, it's not useful for libkern
 1.7 15-Aug-1998  mycroft Assign copyrights to TNF.
 1.6 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 23-Mar-1994  mycroft Much faster on 486s and Pentiums; a little slower on 386s.
 1.3 24-Feb-1994  mycroft Minor speedup.
 1.2 24-Feb-1994  mycroft Minutely faster.
 1.1 24-Feb-1994  mycroft Assembler versions of these.
 1.8.138.1 16-May-2008  yamt sync with head.
 1.8.136.1 18-May-2008  yamt sync with head.
 1.8.134.1 02-Jun-2008  mjf Sync with HEAD.
 1.6 10-Sep-1999  drochner -don't use DEFS.h nor SYS.h in libkern
-remove setjmp.S, it's not useful for libkern
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 21-Oct-1993  jtc branches: 1.4.2;
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.4.2.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.4.2.1 21-Oct-1993  jtc file setjmp.S was added on branch magnum on 1993-10-21 01:48:17 +0000
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 10-Sep-1999  drochner branches: 1.5.134; 1.5.136; 1.5.138;
-don't use DEFS.h nor SYS.h in libkern
-remove setjmp.S, it's not useful for libkern
 1.4 15-Aug-1998  mycroft Assign copyrights to TNF.
 1.3 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 24-Feb-1994  mycroft Assembler versions of these.
 1.5.138.1 16-May-2008  yamt sync with head.
 1.5.136.1 18-May-2008  yamt sync with head.
 1.5.134.1 02-Jun-2008  mjf Sync with HEAD.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 04-Dec-2003  keihan branches: 1.9.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.8 23-Aug-1999  kleink branches: 1.8.36;
Sync with libc: use _ALIGN_TEXT from <machine/asm.h>.
 1.7 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.6 07-Oct-1995  mycroft Update from libc.
 1.5 05-Feb-1995  mycroft Sync with libc.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 15-Feb-1994  mycroft Update from libc.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file strcat.S was added on branch magnum on 1993-12-04 03:06:54 +0000
 1.8.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.36.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 04-Dec-2003  keihan branches: 1.3.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.2 27-Oct-2003  junyoung index() shouldn't be used in the kernel. Use strchr() instead.
 1.1 22-Feb-1998  mycroft branches: 1.1.48;
Add these as well.
 1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 04-Dec-2003  keihan branches: 1.9.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.8 23-Aug-1999  kleink branches: 1.8.36;
Sync with libc: use _ALIGN_TEXT from <machine/asm.h>.
 1.7 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.6 07-Oct-1995  mycroft Update from libc.
 1.5 05-Feb-1995  mycroft Sync with libc.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 15-Feb-1994  mycroft Update from libc.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file strcmp.S was added on branch magnum on 1993-12-04 03:07:08 +0000
 1.8.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.36.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 04-Dec-2003  keihan branches: 1.9.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.8 23-Aug-1999  kleink branches: 1.8.36;
Sync with libc: use _ALIGN_TEXT from <machine/asm.h>.
 1.7 22-Feb-1998  mycroft Move random.S from arch/i386/i386.
 1.6 07-Oct-1995  mycroft Update from libc.
 1.5 05-Feb-1995  mycroft Sync with libc.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 15-Feb-1994  mycroft Update from libc.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file strcpy.S was added on branch magnum on 1993-12-04 03:07:22 +0000
 1.8.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.36.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 04-Dec-2003  keihan branches: 1.7.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.6 22-Feb-1998  mycroft branches: 1.6.48;
Move random.S from arch/i386/i386.
 1.5 07-Oct-1995  mycroft Update from libc.
 1.4 05-Feb-1995  mycroft Sync with libc.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 04-Dec-1993  cgd branches: 1.1.2;
change to use MACHINE_ARCH and update from libc
 1.1.2.2 04-Dec-1993  cgd change to use MACHINE_ARCH and update from libc
 1.1.2.1 04-Dec-1993  cgd file strlen.S was added on branch magnum on 1993-12-04 03:07:40 +0000
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 27-Oct-1993  jtc Did a ``make copy-to-libkern'' from libc to copy libc files to libkern.
Checking them in to make people happy.
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 04-Dec-2003  keihan branches: 1.3.8; 1.3.10;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.2 05-Nov-2003  junyoung rindex() shouldn't be used in the kernel. Use strrchr() instead.
 1.1 22-Feb-1998  mycroft branches: 1.1.48;
Add these as well.
 1.1.48.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.5 05-Aug-2016  scole PR port-ia64/51261

Use common/lib/libc/arch/ia64/string functions
 1.4 14-Aug-2009  dsl branches: 1.4.22; 1.4.40; 1.4.44;
Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.3 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.2 20-Jul-2009  kiyohara Fix little bit, and add a few files.
current status is to see following thread.
http://mail-index.netbsd.org/port-ia64/2009/06/18/msg000102.html
 1.1 07-Apr-2006  cherry branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10; 1.1.14; 1.1.20; 1.1.74; 1.1.90;
Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.1.90.1 23-Jul-2009  jym Sync with HEAD.
 1.1.74.1 19-Aug-2009  yamt sync with head.
 1.1.20.2 09-Sep-2006  rpaulo sync with head
 1.1.20.1 07-Apr-2006  rpaulo file Makefile.inc was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.1.14.2 21-Jun-2006  yamt sync with head.
 1.1.14.1 07-Apr-2006  yamt file Makefile.inc was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.1.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.1.10.1 07-Apr-2006  tron file Makefile.inc was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.1.6.2 22-Apr-2006  simonb Sync with head.
 1.1.6.1 07-Apr-2006  simonb file Makefile.inc was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.1.4.2 19-Apr-2006  elad sync with head.
 1.1.4.1 07-Apr-2006  elad file Makefile.inc was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.1.2.2 11-Apr-2006  yamt sync with head
 1.1.2.1 07-Apr-2006  yamt file Makefile.inc was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.4.44.1 06-Aug-2016  pgoyette Sync with HEAD
 1.4.40.1 05-Oct-2016  skrll Sync with HEAD
 1.4.22.1 03-Dec-2017  jdolecek update from HEAD
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file bswap16.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file bswap16.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file bswap16.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file bswap16.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file bswap16.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file bswap16.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file bswap32.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file bswap32.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file bswap32.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file bswap32.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file bswap32.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file bswap32.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.1 20-Jul-2009  kiyohara branches: 1.1.2; 1.1.4;
Fix little bit, and add a few files.
current status is to see following thread.
http://mail-index.netbsd.org/port-ia64/2009/06/18/msg000102.html
 1.1.4.2 19-Aug-2009  yamt sync with head.
 1.1.4.1 20-Jul-2009  yamt file bswap64.S was added on branch yamt-nfs-mp on 2009-08-19 18:48:19 +0000
 1.1.2.2 23-Jul-2009  jym Sync with HEAD.
 1.1.2.1 20-Jul-2009  jym file bswap64.S was added on branch jym-xensuspend on 2009-07-23 23:32:45 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file byte_swap_2.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file byte_swap_2.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file byte_swap_2.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file byte_swap_2.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file byte_swap_2.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file byte_swap_2.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file byte_swap_4.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file byte_swap_4.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file byte_swap_4.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file byte_swap_4.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file byte_swap_4.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file byte_swap_4.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.1 20-Jul-2009  kiyohara branches: 1.1.2; 1.1.4;
Fix little bit, and add a few files.
current status is to see following thread.
http://mail-index.netbsd.org/port-ia64/2009/06/18/msg000102.html
 1.1.4.2 19-Aug-2009  yamt sync with head.
 1.1.4.1 20-Jul-2009  yamt file byte_swap_8.S was added on branch yamt-nfs-mp on 2009-08-19 18:48:19 +0000
 1.1.2.2 23-Jul-2009  jym Sync with HEAD.
 1.1.2.1 20-Jul-2009  jym file byte_swap_8.S was added on branch jym-xensuspend on 2009-07-23 23:32:45 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file divdi3.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file divdi3.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file divdi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file divdi3.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file divdi3.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file divdi3.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file divsi3.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file divsi3.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file divsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file divsi3.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file divsi3.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file divsi3.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.1 07-Apr-2006  cherry branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10; 1.1.14; 1.1.20;
Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.1.20.2 09-Sep-2006  rpaulo sync with head
 1.1.20.1 07-Apr-2006  rpaulo file htonl.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.1.14.2 21-Jun-2006  yamt sync with head.
 1.1.14.1 07-Apr-2006  yamt file htonl.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.1.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.1.10.1 07-Apr-2006  tron file htonl.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.1.6.2 22-Apr-2006  simonb Sync with head.
 1.1.6.1 07-Apr-2006  simonb file htonl.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.1.4.2 19-Apr-2006  elad sync with head.
 1.1.4.1 07-Apr-2006  elad file htonl.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.1.2.2 11-Apr-2006  yamt sync with head
 1.1.2.1 07-Apr-2006  yamt file htonl.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 05-Aug-2016  scole PR port-ia64/51261

Use common/lib/libc/arch/ia64/string functions
 1.1 07-Apr-2006  cherry branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10; 1.1.14; 1.1.20; 1.1.120; 1.1.140; 1.1.144;
Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.1.144.1 06-Aug-2016  pgoyette Sync with HEAD
 1.1.140.1 05-Oct-2016  skrll Sync with HEAD
 1.1.120.1 03-Dec-2017  jdolecek update from HEAD
 1.1.20.2 09-Sep-2006  rpaulo sync with head
 1.1.20.1 07-Apr-2006  rpaulo file memcpy.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.1.14.2 21-Jun-2006  yamt sync with head.
 1.1.14.1 07-Apr-2006  yamt file memcpy.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.1.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.1.10.1 07-Apr-2006  tron file memcpy.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.1.6.2 22-Apr-2006  simonb Sync with head.
 1.1.6.1 07-Apr-2006  simonb file memcpy.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.1.4.2 19-Apr-2006  elad sync with head.
 1.1.4.1 07-Apr-2006  elad file memcpy.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.1.2.2 11-Apr-2006  yamt sync with head
 1.1.2.1 07-Apr-2006  yamt file memcpy.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file moddi3.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file moddi3.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file moddi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file moddi3.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file moddi3.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file moddi3.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file modsi3.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file modsi3.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file modsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file modsi3.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file modsi3.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file modsi3.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.1 07-Apr-2006  cherry branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10; 1.1.14; 1.1.20;
Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.1.20.2 09-Sep-2006  rpaulo sync with head
 1.1.20.1 07-Apr-2006  rpaulo file ntohl.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.1.14.2 21-Jun-2006  yamt sync with head.
 1.1.14.1 07-Apr-2006  yamt file ntohl.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.1.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.1.10.1 07-Apr-2006  tron file ntohl.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.1.6.2 22-Apr-2006  simonb Sync with head.
 1.1.6.1 07-Apr-2006  simonb file ntohl.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.1.4.2 19-Apr-2006  elad sync with head.
 1.1.4.1 07-Apr-2006  elad file ntohl.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.1.2.2 11-Apr-2006  yamt sync with head
 1.1.2.1 07-Apr-2006  yamt file ntohl.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file udivdi3.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file udivdi3.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file udivdi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file udivdi3.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file udivdi3.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file udivdi3.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file udivsi3.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file udivsi3.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file udivsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file udivsi3.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file udivsi3.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file udivsi3.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file umoddi3.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file umoddi3.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file umoddi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file umoddi3.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file umoddi3.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file umoddi3.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.2 07-Apr-2006  cherry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10; 1.2.14; 1.2.20;
Fixed CVS version headers
 1.1 07-Apr-2006  cherry Initial import of arch/ia64 sources.
These sources are ported from FreeBSD/ia64 code.
See individual source files for credits.
In addition, code from NetBSD/alpha NetBSD/sparc64,
NetBSD/i386 and NetBSD/amd64 were used as templates,
along with my own additions.
 1.2.20.2 09-Sep-2006  rpaulo sync with head
 1.2.20.1 07-Apr-2006  rpaulo file umodsi3.S was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:52 +0000
 1.2.14.2 21-Jun-2006  yamt sync with head.
 1.2.14.1 07-Apr-2006  yamt file umodsi3.S was added on branch yamt-lazymbuf on 2006-06-21 15:10:22 +0000
 1.2.10.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.10.1 07-Apr-2006  tron file umodsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2.6.2 22-Apr-2006  simonb Sync with head.
 1.2.6.1 07-Apr-2006  simonb file umodsi3.S was added on branch simonb-timecounters on 2006-04-22 11:40:05 +0000
 1.2.4.2 19-Apr-2006  elad sync with head.
 1.2.4.1 07-Apr-2006  elad file umodsi3.S was added on branch elad-kernelauth on 2006-04-19 04:36:01 +0000
 1.2.2.2 11-Apr-2006  yamt sync with head
 1.2.2.1 07-Apr-2006  yamt file umodsi3.S was added on branch yamt-pdpolicy on 2006-04-11 11:55:48 +0000
 1.4 11-Nov-1999  thorpej Sync w/ libc.
 1.3 22-Feb-1998  mycroft branches: 1.3.14; 1.3.16; 1.3.20;
Sync with libc, and add random.S.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.3.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.16.1 15-Nov-1999  fvdl Sync with -current
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 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 30-Jul-2015  tsutsui Revert untested and unnecessary change in previous rev 1.36.

Our autobuild doesn't always reflect the latest fixes.
 1.36 30-Jul-2015  christos add mulsi3, needed by inet_addr.o
 1.35 08-Sep-2014  joerg branches: 1.35.2;
Revert 1.33 and 1.34 for now, until either .INVISIBLE is reinstanciated
or random.S dropped.
 1.34 01-Sep-2014  matt Make random.S invisible for coldfire too (e.g. anything not "m68k")
 1.33 27-Aug-2014  christos use .INVISIBLE to hide random.S, instead of extra rules.
 1.32 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.31 18-Jul-2013  matt Reorder a little to make clearer.
 1.30 14-Aug-2009  dsl branches: 1.30.12; 1.30.22; 1.30.26; 1.30.34;
Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.29 12-Aug-2009  dsl Remove some .c files accidentally left on the .S lines
 1.28 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.27 18-Mar-2009  tsutsui - remove bcmp(9), bcopy(9), and bzero(9) from libkern since <sys/systm.h> has
macro which replace them with mem*() functions in #ifdef _KERNEL as noted
in man pages
- move declarations of bcopy(3) and bzero(3) into <lib/libsa/stand.h>
since they are still in libsa for some MD standalone sources
(I guess all bcmp(3) in standalone sources have been replaced with memcmp(3)
but they should be replaced with memcmp() anyway)
 1.26 11-Dec-2005  christos branches: 1.26.74; 1.26.84; 1.26.90;
merge ktrace-lwp.
 1.25 29-Oct-2003  mycroft Don't try to build random.S on 68010.
 1.24 21-Sep-2002  chs branches: 1.24.6;
add strtoul.c, it's now used in MI code.
 1.23 26-Mar-2002  fredette Added brand-new integer multiply and divide support, used only
on the m68000.
 1.22 22-Mar-2002  fredette On the m68000, if and only if gcc doesn't seem to know
where libgcc.a is, fall back to one under DESTDIR.
 1.21 16-May-2001  fredette branches: 1.21.2;
When MACHINE_ARCH is m68000, compile ffs.c and random.c
instead of ffs.s and random.s, and sneak the libgcc
integer support routines into the list of library objects.
 1.20 01-Nov-2000  thorpej branches: 1.20.2;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.19 04-Aug-1998  perry branches: 1.19.12;
add memcmp.S memmove.S
 1.18 22-Feb-1998  mycroft Use the new .S files.
 1.17 22-Feb-1998  mycroft Sync with libc, and add random.S.
 1.16 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.15 24-Oct-1997  chuck add memchr() to libkern
 1.14 11-Oct-1997  scottr Implement assembly byte-swap functions.
 1.13 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.12 18-Jan-1997  cgd branches: 1.12.8;
add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.11 03-Dec-1996  thorpej We use C flavors of the quad support functions in libkern.
 1.10 30-Nov-1996  jtc Sync with libc
 1.9 27-Aug-1996  cgd Add machine-independent assertion-checking support. macros are:

assert() which always does assertion checking
unless "NDEBUG" is defined.

KASSERT() which does assertion checking if DIAGNOSTIC
is defined.

KDASSERT() which does assertion checking if DEBUG is
define. This macro exists for compatibility
with existing ports' assertion checking macros.
(Assertion checking is not typically an
"expensive" operation, and DIAGNOSTIC should be
used for inexpensive consistency checks.)
 1.8 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.7 18-Apr-1996  cgd use assembly version of strcat (copied down from libc)
 1.6 06-Feb-1996  christos Add strncasecmp.c; extracted from ADOSFS adlookup.c.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 05-Dec-1993  cgd use .S
 1.3 04-Dec-1993  cgd branches: 1.3.2;
change to use MACHINE_ARCH and update from libc
 1.2 29-Nov-1993  briggs Move the SRCS from hp300 over to here, changing ffs.c to ffs.s.
Am I missing something obvious in doing this? This makes the
${ARCH}/Makefile.inc for 68k able to just set ARCH=m68k.
 1.1 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.3.2.2 05-Dec-1993  cgd use .S
 1.3.2.1 04-Dec-1993  cgd file Makefile.inc was added on branch magnum on 1993-12-05 01:52:18 +0000
 1.12.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.19.12.1 22-Nov-2000  bouyer Sync with HEAD.
 1.20.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.20.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.20.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.21.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.21.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.24.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.6.1 03-Aug-2004  skrll Sync with HEAD
 1.26.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.26.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.26.74.2 19-Aug-2009  yamt sync with head.
 1.26.74.1 04-May-2009  yamt sync with head.
 1.30.34.1 23-Jul-2013  riastradh sync with HEAD
 1.30.26.1 28-Aug-2013  rmind sync with head
 1.30.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.12.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.35.2.1 22-Sep-2015  skrll Sync with HEAD
 1.8 30-Mar-2006  tsutsui Remove unused file. Pointed out by uwe.
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
merge ktrace-lwp.
 1.6 26-Feb-2005  perry branches: 1.6.4;
nuke trailing whitespace
 1.5 07-Aug-2003  agc branches: 1.5.8; 1.5.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 11-Nov-1999  thorpej branches: 1.4.28;
Sync w/ libc.
 1.3 22-Feb-1998  mycroft branches: 1.3.14; 1.3.16; 1.3.20;
Sync with libc, and add random.S.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.3.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.16.1 15-Nov-1999  fvdl Sync with -current
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.28.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.28.1 03-Aug-2004  skrll Sync with HEAD
 1.5.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.6.4.1 21-Jun-2006  yamt sync with head.
 1.7.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.7.10.1 19-Apr-2006  elad sync with head.
 1.7.8.1 01-Apr-2006  yamt sync with head.
 1.7.6.1 22-Apr-2006  simonb Sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.12 20-Dec-2005  christos Use common sources with userland.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 26-Feb-2005  perry branches: 1.10.4;
nuke trailing whitespace
 1.9 07-Aug-2003  agc branches: 1.9.8; 1.9.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 16-May-2001  fredette branches: 1.8.22;
On the 68010, we are forced to do bytewise compares
and copies if the two addresses aren't of the same
evenness.
 1.7 11-Nov-1999  thorpej branches: 1.7.6;
Sync w/ libc.
 1.6 15-May-1997  jtc branches: 1.6.22; 1.6.24; 1.6.28;
Sync with libc
 1.5 13-May-1997  jtc Sync with libc.
 1.4 30-Nov-1996  jtc Sync with libc
 1.3 08-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.6.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.24.1 15-Nov-1999  fvdl Sync with -current
 1.6.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.7.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.22.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.22.1 03-Aug-2004  skrll Sync with HEAD
 1.9.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.4.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 26-Feb-2005  perry branches: 1.5.4;
nuke trailing whitespace
 1.4 07-Aug-2003  agc branches: 1.4.8; 1.4.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 16-May-2001  fredette branches: 1.3.22;
On the 68010, we are forced to do bytewise compares
and copies if the two addresses aren't of the same
evenness.
 1.2 11-Nov-1999  thorpej branches: 1.2.6;
Sync w/ libc.
 1.1 22-Feb-1998  mycroft branches: 1.1.14; 1.1.16; 1.1.20;
Sync with libc, and add random.S.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.22.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.22.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.4.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 11-Nov-1999  thorpej branches: 1.2.44;
Sync w/ libc.
 1.1 11-Oct-1997  scottr branches: 1.1.2; 1.1.18; 1.1.20; 1.1.24;
Implement assembly byte-swap functions.
 1.1.24.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.20.1 15-Nov-1999  fvdl Sync with -current
 1.1.18.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 11-Oct-1997  thorpej file bswap16.S was added on branch marc-pcmcia on 1997-10-14 10:27:38 +0000
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 11-Nov-1999  thorpej branches: 1.2.44;
Sync w/ libc.
 1.1 11-Oct-1997  scottr branches: 1.1.2; 1.1.18; 1.1.20; 1.1.24;
Implement assembly byte-swap functions.
 1.1.24.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.20.1 15-Nov-1999  fvdl Sync with -current
 1.1.18.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 11-Oct-1997  thorpej file bswap32.S was added on branch marc-pcmcia on 1997-10-14 10:27:39 +0000
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 11-Nov-1999  thorpej branches: 1.2.44;
Sync w/ libc.
 1.1 11-Oct-1997  scottr branches: 1.1.2; 1.1.18; 1.1.20; 1.1.24;
Implement assembly byte-swap functions.
 1.1.24.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.20.1 15-Nov-1999  fvdl Sync with -current
 1.1.18.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 11-Oct-1997  thorpej file bswap64.S was added on branch marc-pcmcia on 1997-10-14 10:27:41 +0000
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 26-Feb-2005  perry branches: 1.8.4;
nuke trailing whitespace
 1.7 07-Aug-2003  agc branches: 1.7.8; 1.7.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 11-Nov-1999  thorpej branches: 1.6.28;
Sync w/ libc.
 1.5 13-May-1997  jtc branches: 1.5.22; 1.5.24; 1.5.28;
Sync with libc.
 1.4 30-Nov-1996  jtc Sync with libc
 1.3 08-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.5.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.24.1 15-Nov-1999  fvdl Sync with -current
 1.5.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.6.28.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.28.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.4.1 21-Jun-2006  yamt sync with head.
 1.4 23-Apr-2020  rin Remove "#ifndef __mc68010__ #error" I added when these {,u}divsi3.S and
{,u}modsi3.S were moved here (It was better to split the commit, sorry);
bootloader for sun3 still depends on them.
 1.3 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 in a controlled situation, i.e., kernel and
standalone programs.

Note that this does not affect 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.2 20-Dec-2005  christos branches: 1.2.100;
Use common sources with userland.
 1.1 26-Mar-2002  fredette branches: 1.1.2; 1.1.8; 1.1.30;
Added brand-new integer multiply and divide support, used only
on the m68000.
 1.1.30.1 21-Jun-2006  yamt sync with head.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 26-Mar-2002  jdolecek file divsi3.S was added on branch kqueue on 2002-06-23 17:49:48 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 26-Mar-2002  nathanw file divsi3.S was added on branch nathanw_sa on 2002-04-01 07:48:05 +0000
 1.2.100.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 26-Feb-2005  perry branches: 1.9.4;
nuke trailing whitespace
 1.8 29-Oct-2003  mycroft branches: 1.8.8; 1.8.10;
Refresh from libc to get 68010 version.
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 11-Nov-1999  thorpej branches: 1.6.28;
Sync w/ libc.
 1.5 13-May-1997  jtc branches: 1.5.22; 1.5.24; 1.5.28;
Sync with libc.
 1.4 08-Feb-1995  mycroft Sync with libc.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 09-Sep-1994  mycroft Use bfffo rather than a slow loop.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.5.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.24.1 15-Nov-1999  fvdl Sync with -current
 1.5.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.6.28.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.28.1 03-Aug-2004  skrll Sync with HEAD
 1.8.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.8.1 29-Apr-2005  kent sync with -current
 1.9.4.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 11-Nov-1999  thorpej branches: 1.4.28;
Sync w/ libc.
 1.3 22-Feb-1998  mycroft branches: 1.3.14; 1.3.16; 1.3.20;
Sync with libc, and add random.S.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.3.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.16.1 15-Nov-1999  fvdl Sync with -current
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.28.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 11-Nov-1999  thorpej branches: 1.4.28;
Sync w/ libc.
 1.3 22-Feb-1998  mycroft branches: 1.3.14; 1.3.16; 1.3.20;
Sync with libc, and add random.S.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.3.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.16.1 15-Nov-1999  fvdl Sync with -current
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.28.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 11-Nov-1999  thorpej branches: 1.2.28;
Sync w/ libc.
 1.1 22-Feb-1998  mycroft branches: 1.1.14; 1.1.16; 1.1.20;
Sync with libc, and add random.S.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.28.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.3 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file locc.S was added on branch magnum on 1993-10-13 05:41:03 +0000
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 11-Nov-1999  thorpej branches: 1.2.28;
Add register prefixes.
 1.1 04-Aug-1998  perry branches: 1.1.12; 1.1.14; 1.1.18;
add memcmp.S memmove.S
 1.1.18.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.14.1 15-Nov-1999  fvdl Sync with -current
 1.1.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.28.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 11-Nov-1999  thorpej branches: 1.2.44;
Sync w/ libc.
 1.1 22-Feb-1998  mycroft branches: 1.1.14; 1.1.16; 1.1.20;
Sync with libc, and add random.S.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 11-Nov-1999  thorpej branches: 1.2.44;
Sync w/ libc.
 1.1 04-Aug-1998  perry branches: 1.1.12; 1.1.14; 1.1.18;
add memcmp.S memmove.S
 1.1.18.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.14.1 15-Nov-1999  fvdl Sync with -current
 1.1.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 26-Feb-2005  perry branches: 1.5.4;
nuke trailing whitespace
 1.4 07-Aug-2003  agc branches: 1.4.8; 1.4.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 06-Sep-2001  fredette branches: 1.3.20;
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.2 11-Nov-1999  thorpej branches: 1.2.6; 1.2.8;
Sync w/ libc.
 1.1 22-Feb-1998  mycroft branches: 1.1.14; 1.1.16; 1.1.20;
Sync with libc, and add random.S.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.8.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.6.1 21-Sep-2001  nathanw Catch up to -current.
 1.3.20.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.20.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.4.1 21-Jun-2006  yamt sync with head.
 1.4 23-Apr-2020  rin Remove "#ifndef __mc68010__ #error" I added when these {,u}divsi3.S and
{,u}modsi3.S were moved here (It was better to split the commit, sorry);
bootloader for sun3 still depends on them.
 1.3 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 in a controlled situation, i.e., kernel and
standalone programs.

Note that this does not affect 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.2 20-Dec-2005  christos branches: 1.2.100;
Use common sources with userland.
 1.1 26-Mar-2002  fredette branches: 1.1.2; 1.1.8; 1.1.30;
Added brand-new integer multiply and divide support, used only
on the m68000.
 1.1.30.1 21-Jun-2006  yamt sync with head.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 26-Mar-2002  jdolecek file modsi3.S was added on branch kqueue on 2002-06-23 17:49:49 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 26-Mar-2002  nathanw file modsi3.S was added on branch nathanw_sa on 2002-04-01 07:48:05 +0000
 1.2.100.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 26-Mar-2002  fredette branches: 1.1.2; 1.1.8; 1.1.30;
Added brand-new integer multiply and divide support, used only
on the m68000.
 1.1.30.1 21-Jun-2006  yamt sync with head.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 26-Mar-2002  jdolecek file mulsi3.S was added on branch kqueue on 2002-06-23 17:49:49 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 26-Mar-2002  nathanw file mulsi3.S was added on branch nathanw_sa on 2002-04-01 07:48:06 +0000
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 11-Nov-1999  thorpej branches: 1.4.28;
Sync w/ libc.
 1.3 22-Feb-1998  mycroft branches: 1.3.14; 1.3.16; 1.3.20;
Sync with libc, and add random.S.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.3.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.16.1 15-Nov-1999  fvdl Sync with -current
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.28.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 11-Nov-1999  thorpej branches: 1.4.28;
Sync w/ libc.
 1.3 22-Feb-1998  mycroft branches: 1.3.14; 1.3.16; 1.3.20;
Sync with libc, and add random.S.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.3.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.16.1 15-Nov-1999  fvdl Sync with -current
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.28.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.6 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.5 18-Jul-2013  matt Don't use %d2 (violates the ABI since it wasn't saved), use %a0 instead.
Use a pcrelative access for the local data avoiding the GOT.
 1.4 06-Jan-2009  pooka branches: 1.4.14; 1.4.24; 1.4.28; 1.4.36;
Fix PIC version, it was missing one dereference. Thanks to spz
for access to m68k hardware for testing.
 1.3 04-Jan-2009  pooka Support PIC for inclusion in librump. (m68k untested)
 1.2 11-Nov-1999  thorpej branches: 1.2.126; 1.2.130; 1.2.140;
Add register prefixes.
 1.1 22-Feb-1998  mycroft branches: 1.1.14; 1.1.16; 1.1.20;
Sync with libc, and add random.S.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.140.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.130.1 04-May-2009  yamt sync with head.
 1.2.126.1 17-Jan-2009  mjf Sync with HEAD.
 1.4.36.1 23-Jul-2013  riastradh sync with HEAD
 1.4.28.1 28-Aug-2013  rmind sync with head
 1.4.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.14.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-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 11-Nov-1999  thorpej branches: 1.2.28;
Sync w/ libc.
 1.1 22-Feb-1998  mycroft branches: 1.1.14; 1.1.16; 1.1.20;
Sync with libc, and add random.S.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.28.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.10 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.9 18-Jul-2013  matt Adjust for coldfire
 1.8 18-Jul-2013  matt Keep stack longword aligned.
Use longword ops for %d2.
 1.7 18-Jul-2013  matt Convert to motorola syntax
 1.6 08-Feb-2011  rmind branches: 1.6.4; 1.6.14; 1.6.18; 1.6.26;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.5 11-Dec-2005  christos branches: 1.5.98; 1.5.104; 1.5.106;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 11-Nov-1999  thorpej branches: 1.3.28;
Add register prefixes.
 1.2 26-Oct-1994  cgd branches: 1.2.32; 1.2.34; 1.2.38;
new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file scanc.S was added on branch magnum on 1993-10-13 05:41:04 +0000
 1.2.38.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.34.1 15-Nov-1999  fvdl Sync with -current
 1.2.32.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.3.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.28.1 03-Aug-2004  skrll Sync with HEAD
 1.5.106.1 17-Feb-2011  bouyer Sync with HEAD
 1.5.104.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.98.1 05-Mar-2011  rmind sync with head
 1.6.26.1 23-Jul-2013  riastradh sync with HEAD
 1.6.18.1 28-Aug-2013  rmind sync with head
 1.6.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 01-Mar-1995  mycroft Clean up deleted files.
 1.1 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.10 18-Mar-2014  riastradh Merge riastradh-drm2 to HEAD.
 1.9 18-Jul-2013  matt Adjust for coldfire
 1.8 18-Jul-2013  matt Fix typo.
 1.7 18-Jul-2013  matt Convert to morotola syntax
 1.6 08-Feb-2011  rmind branches: 1.6.4; 1.6.14; 1.6.18; 1.6.26;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.5 11-Dec-2005  christos branches: 1.5.98; 1.5.104; 1.5.106;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 11-Nov-1999  thorpej branches: 1.3.28;
Add register prefixes.
 1.2 26-Oct-1994  cgd branches: 1.2.32; 1.2.34; 1.2.38;
new RCS ID format.
 1.1 13-Oct-1993  cgd branches: 1.1.2;
move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.2 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.1.2.1 13-Oct-1993  cgd file skpc.S was added on branch magnum on 1993-10-13 05:41:06 +0000
 1.2.38.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.34.1 15-Nov-1999  fvdl Sync with -current
 1.2.32.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.3.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.28.1 03-Aug-2004  skrll Sync with HEAD
 1.5.106.1 17-Feb-2011  bouyer Sync with HEAD
 1.5.104.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.98.1 05-Mar-2011  rmind sync with head
 1.6.26.1 23-Jul-2013  riastradh sync with HEAD
 1.6.18.1 28-Aug-2013  rmind sync with head
 1.6.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 01-Mar-1995  mycroft Clean up deleted files.
 1.1 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 07-Aug-2003  agc branches: 1.4.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 11-Nov-1999  thorpej branches: 1.3.28;
Sync w/ libc.
 1.2 13-May-1997  jtc branches: 1.2.22; 1.2.24; 1.2.28;
Sync with libc.
 1.1 18-Apr-1996  cgd use assembly version of strcat (copied down from libc)
 1.2.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.24.1 15-Nov-1999  fvdl Sync with -current
 1.2.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.3.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.28.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.3 18-Apr-1996  cgd use assembly version of strcat (copied down from libc)
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 11-Nov-1999  thorpej branches: 1.2.44;
Sync w/ libc.
 1.1 22-Feb-1998  mycroft branches: 1.1.14; 1.1.16; 1.1.20;
Sync with libc, and add random.S.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 04-Dec-2003  keihan branches: 1.9.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.8 16-May-2001  fredette branches: 1.8.22;
Use the EXTBL macro where we want the extbl instruction.
On the 68010 this expands to an extw/extl combination.
 1.7 28-Nov-2000  is branches: 1.7.2;
Sync with libc: make function exit one instruction faster, and function one
instruction shorter (Horimoto).
 1.6 11-Nov-1999  thorpej Sync w/ libc.
 1.5 20-Jun-1997  jtc branches: 1.5.22; 1.5.24; 1.5.28;
sync with libc
 1.4 13-May-1997  jtc Sync with libc.
 1.3 08-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.5.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.24.1 15-Nov-1999  fvdl Sync with -current
 1.5.22.2 08-Dec-2000  bouyer Sync with HEAD.
 1.5.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.22.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 11-Nov-1999  thorpej branches: 1.5.28;
Sync w/ libc.
 1.4 13-May-1997  jtc branches: 1.4.22; 1.4.24; 1.4.28;
Sync with libc.
 1.3 08-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.4.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.24.1 15-Nov-1999  fvdl Sync with -current
 1.4.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.28.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 11-Nov-1999  thorpej branches: 1.5.28;
Sync w/ libc.
 1.4 13-May-1997  jtc branches: 1.4.22; 1.4.24; 1.4.28;
Sync with libc.
 1.3 08-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.4.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.24.1 15-Nov-1999  fvdl Sync with -current
 1.4.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.28.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.10 20-Dec-2005  christos Use common sources with userland.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 04-Dec-2003  keihan branches: 1.8.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.7 16-May-2001  fredette branches: 1.7.22;
Use the EXTBL macro where we want the extbl instruction.
On the 68010 this expands to an extw/extl combination.
 1.6 11-Nov-1999  thorpej branches: 1.6.6;
Sync w/ libc.
 1.5 20-Jun-1997  jtc branches: 1.5.22; 1.5.24; 1.5.28;
sync with libc
 1.4 13-May-1997  jtc Sync with libc.
 1.3 08-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.5.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.24.1 15-Nov-1999  fvdl Sync with -current
 1.5.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.6.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.22.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 27-Nov-2000  is branches: 1.6.24;
Sync with libc strncpy.S 1.11: optimized code by Hiroshi Horimoto.
 1.5 11-Nov-1999  thorpej Sync w/ libc.
 1.4 13-May-1997  jtc branches: 1.4.22; 1.4.24; 1.4.28;
Sync with libc.
 1.3 08-Feb-1995  mycroft Sync with libc.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 29-Mar-1994  chopps copied over so lib/libc/arch not needed to build kernel.
 1.4.28.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.24.1 15-Nov-1999  fvdl Sync with -current
 1.4.22.2 08-Dec-2000  bouyer Sync with HEAD.
 1.4.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.6.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.24.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 11-Nov-1999  thorpej branches: 1.2.44;
Sync w/ libc.
 1.1 22-Feb-1998  mycroft branches: 1.1.14; 1.1.16; 1.1.20;
Sync with libc, and add random.S.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.6 23-Apr-2020  rin Remove "#ifndef __mc68010__ #error" I added when these {,u}divsi3.S and
{,u}modsi3.S were moved here (It was better to split the commit, sorry);
bootloader for sun3 still depends on them.
 1.5 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 in a controlled situation, i.e., kernel and
standalone programs.

Note that this does not affect 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.4 20-Dec-2005  christos branches: 1.4.100;
Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 26-Feb-2005  perry branches: 1.2.4;
nuke trailing whitespace
 1.1 26-Mar-2002  fredette branches: 1.1.2; 1.1.8; 1.1.14; 1.1.22; 1.1.24;
Added brand-new integer multiply and divide support, used only
on the m68000.
 1.1.24.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.22.1 29-Apr-2005  kent sync with -current
 1.1.14.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 26-Mar-2002  jdolecek file udivsi3.S was added on branch kqueue on 2002-06-23 17:49:49 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 26-Mar-2002  nathanw file udivsi3.S was added on branch nathanw_sa on 2002-04-01 07:48:06 +0000
 1.2.4.1 21-Jun-2006  yamt sync with head.
 1.4.100.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.4 23-Apr-2020  rin Remove "#ifndef __mc68010__ #error" I added when these {,u}divsi3.S and
{,u}modsi3.S were moved here (It was better to split the commit, sorry);
bootloader for sun3 still depends on them.
 1.3 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 in a controlled situation, i.e., kernel and
standalone programs.

Note that this does not affect 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.2 20-Dec-2005  christos branches: 1.2.100;
Use common sources with userland.
 1.1 26-Mar-2002  fredette branches: 1.1.2; 1.1.8; 1.1.30;
Added brand-new integer multiply and divide support, used only
on the m68000.
 1.1.30.1 21-Jun-2006  yamt sync with head.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 26-Mar-2002  jdolecek file umodsi3.S was added on branch kqueue on 2002-06-23 17:49:49 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 26-Mar-2002  nathanw file umodsi3.S was added on branch nathanw_sa on 2002-04-01 07:48:06 +0000
 1.2.100.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.24 03-Sep-2018  riastradh Rename min.c -> uimin.c, max.c -> uimax.c in libkern.
 1.23 20-Jan-2010  pgoyette branches: 1.23.62; 1.23.64;
Remove kern_assert.c - it's not needed here cuz it's already pulled in
by sys/lib/libkern/Makefile.libkern

OK pooka@
 1.22 20-Jan-2010  pooka __assert.c -> kern_assert.c

(I don't fully understand why __assert.c is needed here. maybe it
can be removed, but I don't have time to do a full set of mips builds
tonight)
 1.21 14-Dec-2009  matt Merge from matt-nb5-mips64
 1.20 14-Aug-2009  dsl Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.19 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.18 27-Dec-2001  shin branches: 1.18.120; 1.18.138;
we need ffs().
 1.17 01-Nov-2000  thorpej branches: 1.17.2; 1.17.4;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.16 29-Nov-1999  simonb Add strtoul.c and sort sources alphabetically.
 1.15 15-Mar-1999  jonathan branches: 1.15.8; 1.15.14;
Use merged memcpy()/memset() based on old bcopy rather than C-coded memmove.
TODO: change register usage so memcpy()/memmove() is default, put test
for back-copy before memcpy() and back-copy loop after memcpy().
 1.14 23-Feb-1999  simonb Add memset.S instead of memset.c, and remove __main.c.
 1.13 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.12 15-Jan-1999  castor Break out utility functions from locore.S
 1.11 11-Sep-1998  jonathan Changes to sys/arch/mips from ARC port, from Noriyuki Soda <soda@sra.co.jp>.
Adds (most) support for ARC platform to port-independent mips code.

Some changes (e.g., clean up of overlapping CPU/FPU ids) inspired by
comparison to the OpenBSD 2.1 codebase of Soda's ARC port.

Open issues:
* Still no support for r4600 or mipsIV CPUs with two-way L1 cache.
Code derived from Per Fogelstrom's OpenBSD source doesn't work
on mips3 pmaxes with L2 cache.

* Still some port-specific #ifdefs, for interrupt enable and
pmax L2 cache-size. Needs more thought, but overlaps with
work-in-progress by Tohru and Tsubai on spl()s and related stuff.
 1.10 20-Aug-1998  tls update for b->mem change in sys/kern; now we need memcmp and memset, not just memchr. AFAIK, memcpy is provided by the compiler or by locore on this platform.
 1.9 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.8 24-Oct-1997  chuck add memchr() to libkern
 1.7 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.6 18-Jan-1997  cgd branches: 1.6.8;
add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.5 27-Aug-1996  cgd Add machine-independent assertion-checking support. macros are:

assert() which always does assertion checking
unless "NDEBUG" is defined.

KASSERT() which does assertion checking if DIAGNOSTIC
is defined.

KDASSERT() which does assertion checking if DEBUG is
define. This macro exists for compatibility
with existing ports' assertion checking macros.
(Assertion checking is not typically an
"expensive" operation, and DIAGNOSTIC should be
used for inexpensive consistency checks.)
 1.4 13-Apr-1996  cgd add strncasecmp.c to ports' libkern Makefile.inc's. When adding a new
source file to libkern, it should be added to _ALL_ ports makefiles if
it is machine-independent and used by machine-independent code (in
this case adosfs). (There are several arguments that say that
strncasecmp should not be in libkern at all, and i think they're
good ones, but as long as ADOSFS needs it to link, it has to be here
for all architectures.)
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 15-Jun-1994  glass fix typo: scan.c -> scanc.c
 1.1 03-Jun-1994  glass works in bootstrapping caseee
 1.6.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.15.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.17.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.17.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.18.138.2 05-Sep-2009  matt Add an assmebly version of bswap64
 1.18.138.1 18-Aug-2009  matt Update to use new memset2.c
 1.18.120.2 11-Mar-2010  yamt sync with head
 1.18.120.1 19-Aug-2009  yamt sync with head.
 1.23.64.1 10-Jun-2019  christos Sync with HEAD
 1.23.62.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 10-Nov-2002  thorpej branches: 1.5.6;
ABICALLS -> __ABICALLS__
 1.4 27-Feb-2001  cgd branches: 1.4.2;
copy from lib/libc/arch/mips/gen
 1.3 20-Apr-1999  simonb branches: 1.3.2;
Until <bsd.lib.mk> is fixed, don't try to guess whether or not to
use abicalls in kernel source.
 1.2 17-Mar-1999  simonb branches: 1.2.2;
Don't add .abicalls if NO_ABICALLS is defined even if ABICALLS is defined.
 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.2.1 27-Apr-1999  perry branches: 1.2.2.1.2;
pullup 1.2->1.3 (simonb)
 1.2.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.1 12-Mar-2001  bouyer Sync with HEAD.
 1.4.2.1 11-Nov-2002  nathanw Catch up to -current
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 10-Nov-2002  thorpej branches: 1.6.6;
ABICALLS -> __ABICALLS__
 1.5 27-Feb-2001  cgd branches: 1.5.2;
copy from lib/libc/arch/mips/gen
 1.4 20-Apr-1999  simonb branches: 1.4.2;
Until <bsd.lib.mk> is fixed, don't try to guess whether or not to
use abicalls in kernel source.
 1.3 17-Mar-1999  simonb branches: 1.3.2;
Don't add .abicalls if NO_ABICALLS is defined even if ABICALLS is defined.
 1.2 18-Jan-1999  castor Make bswap32 be the "real" entrypoint and htonl, ntohl aliases.
 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 27-Apr-1999  perry branches: 1.3.2.1.2;
pullup 1.3->1.4 (simonb)
 1.3.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.2.1 12-Mar-2001  bouyer Sync with HEAD.
 1.5.2.1 11-Nov-2002  nathanw Catch up to -current
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 26-Feb-2005  perry branches: 1.6.4;
nuke trailing whitespace
 1.5 07-Aug-2003  agc branches: 1.5.8; 1.5.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 10-Nov-2002  thorpej branches: 1.4.6;
ABICALLS -> __ABICALLS__
 1.3 02-Jan-2002  uch branches: 1.3.2; 1.3.4;
R5900 short-loop bug.
 1.2 27-Dec-2001  shin don't use .abicalls in kernel.
 1.1 27-Dec-2001  shin copy from libc/arch/mips/string
 1.3.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.1 02-Jan-2002  thorpej file ffs.S was added on branch kqueue on 2002-01-10 20:00:32 +0000
 1.3.2.5 11-Nov-2002  nathanw Catch up to -current
 1.3.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.3.2.3 11-Jan-2002  nathanw More catchup.
 1.3.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.2.1 02-Jan-2002  nathanw file ffs.S was added on branch nathanw_sa on 2002-01-08 00:32:50 +0000
 1.4.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.5.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.6.4.1 21-Jun-2006  yamt sync with head.
 1.11 20-Dec-2005  christos Use common sources with userland.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 26-Feb-2005  perry branches: 1.9.4;
nuke trailing whitespace
 1.8 29-Sep-2004  sekiya branches: 1.8.4; 1.8.6;
Use 64-bit-clean addition/subtraction opcodes for pointer arithmetic iff
_LP64 is defined.
 1.7 16-Oct-2001  uch branches: 1.7.18;
R5900 miss-prediction of branch targets for short-loop.
 1.6 10-Oct-2000  jeffs branches: 1.6.2; 1.6.4;
Set return value correctly for memcpy/memmove.
 1.5 18-Jul-2000  enami Fix an obvious typo in comment introduced by previous commit; the instruction
now compares a0 against a1 + a2, not a0 + a2.
 1.4 17-Jul-2000  jeffs Make memcpy() the favored interface an swizzle the args for ovbcopy. Also
move bcopy XLEAF here from locore.S. For 64b clean compilation add a
ld/sd section to the block copy.
 1.3 15-Mar-1999  jonathan branches: 1.3.8; 1.3.18;
Use merged memcpy()/memset() based on old bcopy rather than C-coded memmove.
TODO: change register usage so memcpy()/memmove() is default, put test
for back-copy before memcpy() and back-copy loop after memcpy().
 1.2 15-Jan-1999  castor Break out utility functions from locore.S
 1.1 11-Sep-1998  jonathan Changes to sys/arch/mips from ARC port, from Noriyuki Soda <soda@sra.co.jp>.
Adds (most) support for ARC platform to port-independent mips code.

Some changes (e.g., clean up of overlapping CPU/FPU ids) inspired by
comparison to the OpenBSD 2.1 codebase of Soda's ARC port.

Open issues:
* Still no support for r4600 or mipsIV CPUs with two-way L1 cache.
Code derived from Per Fogelstrom's OpenBSD source doesn't work
on mips3 pmaxes with L2 cache.

* Still some port-specific #ifdefs, for interrupt enable and
pmax L2 cache-size. Needs more thought, but overlaps with
work-in-progress by Tohru and Tsubai on spl()s and related stuff.
 1.3.18.1 19-Jul-2000  jeffs Pull up revision memcpy.S 1.4-1.5 and locore.S 1.105 (approved by thorpej).
Make memcpy() the favored interface an swizzle the args for ovbcopy. Also
move bcopy XLEAF here from locore.S. For 64b clean compilation add a
ld/sd section to the block copy.
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.6.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 22-Oct-2001  nathanw Catch up to -current.
 1.7.18.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.18.1 19-Oct-2004  skrll Sync with HEAD
 1.8.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.4.1 29-Apr-2005  kent sync with -current
 1.9.4.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 15-Mar-1999  jonathan branches: 1.1.58;
Use merged memcpy()/memset() based on old bcopy rather than C-coded memmove.
TODO: change register usage so memcpy()/memmove() is default, put test
for back-copy before memcpy() and back-copy loop after memcpy().
 1.1.58.1 21-Jun-2006  yamt sync with head.
 1.7 20-Dec-2005  christos Use common sources with userland.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 26-Feb-2005  perry branches: 1.5.4;
nuke trailing whitespace
 1.4 29-Sep-2004  sekiya branches: 1.4.4; 1.4.6;
Use 64-bit-clean addition/subtraction opcodes for pointer arithmetic iff
_LP64 is defined.
 1.3 16-Oct-2001  uch branches: 1.3.18;
R5900 miss-prediction of branch targets for short-loop.
 1.2 15-Mar-1999  jonathan branches: 1.2.20; 1.2.22;
Fix bug in construction of word-length version of 'c'.
Preserve input string and return it as per userlevel spec.
 1.1 28-Jan-1999  jonathan memset, derived from old kernel bcopy.
Uses negative register offsets in memory writes, to avoid r4k silicon bugs.
 1.2.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.20.1 22-Oct-2001  nathanw Catch up to -current.
 1.3.18.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.18.1 19-Oct-2004  skrll Sync with HEAD
 1.4.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.4.1 29-Apr-2005  kent sync with -current
 1.5.4.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 26-Feb-2005  perry branches: 1.3.4;
nuke trailing whitespace
 1.2 29-Sep-2004  sekiya branches: 1.2.4; 1.2.6;
Use 64-bit-clean addition/subtraction opcodes for pointer arithmetic iff
_LP64 is defined.
 1.1 15-Jan-1999  castor branches: 1.1.42;
Break out utility functions from locore.S
 1.1.42.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.42.1 19-Oct-2004  skrll Sync with HEAD
 1.2.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.4.1 29-Apr-2005  kent sync with -current
 1.3.4.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 29-Sep-2004  sekiya branches: 1.2.12;
Use 64-bit-clean addition/subtraction opcodes for pointer arithmetic iff
_LP64 is defined.
 1.1 15-Jan-1999  castor branches: 1.1.42;
Break out utility functions from locore.S
 1.1.42.1 19-Oct-2004  skrll Sync with HEAD
 1.2.12.1 21-Jun-2006  yamt sync with head.
 1.1 03-Sep-2014  matt branches: 1.1.18;
New files for OR1K support
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 03-Sep-2014  jdolecek file Makefile.inc was added on branch tls-maxphys on 2017-12-03 11:38:46 +0000
 1.34 30-May-2022  rin Restrict strictly-aligned versions of memcmp(9), memcpy(9), and
memmove(9) to 403, instead of all evbppc machines.

Introduce strict-align LIBKERN_MD_FLAGS for this purpose.
 1.33 26-Jul-2021  rin Improve previous:

- Add suffix ``d'' for mkdep(1).
- Improve comment a little...
 1.32 24-Jul-2021  rin For evbppc, use C version of memcpy(3), memcmp(3), and memmove(3)
consistently for *.{po,pico,go} (for RUMP), in order to avoid
alignment faults for 403.
 1.31 02-Jul-2011  matt branches: 1.31.70;
Add the _restgpr* and _savegpr* entries that GCC 4.5 wants. This file is
designed to support the other GCC 4.5 variants that may be required.
 1.30 17-Jan-2011  matt Kill _NOREGNAMES. Everything should be using %rX now. If it doesn't it
soon will.
 1.29 16-Jan-2011  matt branches: 1.29.2;
Add -D_NOREGNAMES
 1.28 14-Aug-2009  dsl Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.27 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.26 18-Mar-2009  tsutsui - remove bcmp(9), bcopy(9), and bzero(9) from libkern since <sys/systm.h> has
macro which replace them with mem*() functions in #ifdef _KERNEL as noted
in man pages
- move declarations of bcopy(3) and bzero(3) into <lib/libsa/stand.h>
since they are still in libsa for some MD standalone sources
(I guess all bcmp(3) in standalone sources have been replaced with memcmp(3)
but they should be replaced with memcmp() anyway)
 1.25 18-Apr-2008  garbled branches: 1.25.4; 1.25.12; 1.25.18;
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.24 11-Dec-2005  christos branches: 1.24.70;
merge ktrace-lwp.
 1.23 10-Aug-2003  matt Add a memset.S (does not use dcbz; to be added later). It does both bzero
and memset.
 1.22 25-Feb-2003  matt branches: 1.22.2;
Switch back to generic bzero/memset until new one is shown to work.
 1.21 24-Feb-2003  matt Actually use bzero.S. Also fix bzero to use GET_CPUINFO
 1.20 24-Feb-2003  matt Don't make memset.c since bzero.o has memset in addition to bzero.
 1.19 02-Dec-2001  mjl Disable bzero/memset assembler implementation until the dependency
problem on assym.h is sorted out and TRW to get at CACHELINESIZE in
the kernel is determined.
 1.18 30-Nov-2001  mjl Add assembler version of strlen.
 1.17 29-Nov-2001  mjl Add assembler versions of ffs, bzero and memset.
 1.16 01-Nov-2000  thorpej branches: 1.16.2; 1.16.4;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.15 01-Feb-2000  danw add strtoul
 1.14 17-Apr-1999  ws branches: 1.14.2;
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.13 04-Aug-1998  perry branches: 1.13.8;
remove memcpy.c -- I forgot this gets built anyway
 1.12 04-Aug-1998  perry remove memmove.c -- I forgot this gets built anyway
 1.11 04-Aug-1998  perry add memcmp.c memcpy.c memmove.c
 1.10 22-Feb-1998  mycroft Fix typo.
 1.9 22-Feb-1998  mycroft Don't list bcopy.c here, since we only want memcpy() and not bcopy().
XXX What a kluge!
 1.8 22-Feb-1998  mycroft We need memcpy().
 1.7 22-Feb-1998  mycroft Add some missing things.
 1.6 22-Feb-1998  mycroft Pull in [hn]to[nh][ls].c.
 1.5 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.4 24-Oct-1997  chuck add memchr() to libkern
 1.3 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.2 18-Jan-1997  cgd branches: 1.2.8;
add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.1 30-Sep-1996  ws PowerPC port
 1.2.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.14.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.14.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.16.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.22.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.2.1 03-Aug-2004  skrll Sync with HEAD
 1.24.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.25.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.4.2 19-Aug-2009  yamt sync with head.
 1.25.4.1 04-May-2009  yamt sync with head.
 1.29.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.31.70.1 01-Aug-2021  thorpej Sync with HEAD.
 1.6 10-Aug-2003  matt Add a memset.S (does not use dcbz; to be added later). It does both bzero
and memset.
 1.5 24-Feb-2003  matt branches: 1.5.2;
Actually use bzero.S. Also fix bzero to use GET_CPUINFO
 1.4 30-Jul-2002  matt cpu_info is not in spr0, but spr_g_0.
 1.3 13-Mar-2002  eeh branches: 1.3.4;
Updated from libc.
 1.2 30-Nov-2001  mjl branches: 1.2.2; 1.2.4;
Outifdef some stuff not needed in the _KERNEL case.
 1.1 29-Nov-2001  mjl Add assembler versions of ffs, bzero and memset.
 1.2.4.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 30-Nov-2001  thorpej file bzero.S was added on branch kqueue on 2002-01-10 20:00:34 +0000
 1.2.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.2.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 30-Nov-2001  nathanw file bzero.S was added on branch nathanw_sa on 2002-01-08 00:32:51 +0000
 1.3.4.1 29-Aug-2002  gehenna catch up with -current.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 29-Nov-2001  mjl branches: 1.1.2; 1.1.4; 1.1.36;
Add assembler versions of ffs, bzero and memset.
 1.1.36.1 21-Jun-2006  yamt sync with head.
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 29-Nov-2001  thorpej file ffs.S was added on branch kqueue on 2002-01-10 20:00:34 +0000
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 29-Nov-2001  nathanw file ffs.S was added on branch nathanw_sa on 2002-01-08 00:32:51 +0000
 1.4 28-Oct-2011  christos shouldn't need .size for ppc64.
 1.3 12-Aug-2011  matt Fix bug when only restoring r31 (lr was not being restored properly).
 1.2 02-Jul-2011  mrg fix the names of the _END symbols passed to .size; fixes rump issues,
and kernels still work fine, and ofwboot still links.
 1.1 02-Jul-2011  matt Add the _restgpr* and _savegpr* entries that GCC 4.5 wants. This file is
designed to support the other GCC 4.5 variants that may be required.
 1.7 17-Jan-2011  matt Don't define _NOREGNAMES since all of libkern is now compiled with it.
 1.6 04-Mar-2007  christos branches: 1.6.64;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 11-Dec-2005  christos branches: 1.5.26;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 04-Dec-2003  keihan branches: 1.3.4; 1.3.10; 1.3.12;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.2 27-Aug-2003  matt Actually the right instruction to fill a half-word.
From Juergen Hannken-Illjes hannken at eis dot cs dot tu-bs dot de
 1.1 10-Aug-2003  matt Add a memset.S (does not use dcbz; to be added later). It does both bzero
and memset.
 1.3.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.10.1 29-Apr-2005  kent sync with -current
 1.3.4.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 04-Dec-2003  skrll file memset.S was added on branch ktrace-lwp on 2004-08-03 10:53:49 +0000
 1.4.4.1 03-Sep-2007  yamt sync with head.
 1.5.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.64.1 05-Mar-2011  rmind sync with head
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 26-Feb-2005  perry branches: 1.3.4;
nuke trailing whitespace
 1.2 04-Dec-2003  keihan branches: 1.2.8; 1.2.10;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 30-Nov-2001  mjl branches: 1.1.2; 1.1.4; 1.1.20;
Add assembler version of strlen.
 1.1.20.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.20.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 30-Nov-2001  thorpej file strlen.S was added on branch kqueue on 2002-01-10 20:00:35 +0000
 1.1.2.2 08-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-08 00:32:52 +0000
 1.2.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.3.4.1 21-Jun-2006  yamt sync with head.
 1.14 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.13 24-Dec-2005  perry branches: 1.13.46; 1.13.66; 1.13.70;
__asm__ -> __asm
 1.12 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 27-Jul-2005  simonb KNF nit.
 1.9 26-Feb-2005  perry branches: 1.9.4;
nuke trailing whitespace
 1.8 28-Mar-2002  matt branches: 1.8.10; 1.8.18; 1.8.20;
Refresh from libc.
 1.7 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.6 18-Mar-2002  dbj make compile with _STANDALONE
 1.5 13-Mar-2002  eeh Updated from libc.
 1.4 22-Aug-2001  matt 7450 requires a sync before the the isync (MPC7450UM - 3.4.4.8)
 1.3 27-Jun-2000  mrg branches: 1.3.2; 1.3.4;
<vm/vm.h> -> <uvm/uvm_extern.h>
 1.2 05-May-1999  tsubai branches: 1.2.2; 1.2.4;
Copy from libc.
 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.2.4.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.3.4.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.3.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.8.20.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.18.1 29-Apr-2005  kent sync with -current
 1.8.10.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.10.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.4.2 24-Mar-2008  yamt sync with head.
 1.9.4.1 21-Jun-2006  yamt sync with head.
 1.13.70.1 03-Apr-2008  mjf Sync with HEAD.
 1.13.66.1 24-Mar-2008  keiichi sync with head.
 1.13.46.1 23-Mar-2008  matt sync with HEAD
 1.1 19-Sep-2014  matt branches: 1.1.18;
New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 19-Sep-2014  jdolecek file Makefile.inc was added on branch tls-maxphys on 2017-12-03 11:38:46 +0000
 1.19 04-Aug-2011  uwe For unsignad integer division gcc used to emit a call to __udivsi3
"millicode" function that uses compiler-private ABI. Newer gcc uses
heavily tuned __udivsi3_i4i that is NOT compatible with __udivsi3
because it's expected to clobber different registers. We don't want
to link the kernel against libgcc and we don't have resources to write
heavily tuned version ourselves, so clone __udivsi3 but adjust it to
conform to the __udivsi3_i4i clobber spec.

Ditto for signed division.

You can make gcc use old routines with -mdiv=call-div1 to avoid few
extra instructions to save/restore the right registers in the signed
division funcion.
 1.18 14-Aug-2009  dsl Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.17 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.16 14-Mar-2007  uwe branches: 1.16.36;
Provide __movmemSI12_i4 (gcc4) a.k.a. __movstrSI12_i4 (gcc3) that gcc
emits for sh4 to copy 12 bytes at certain optimization levels.
Discovered by compiling landisk kernel with -Os.

Use gcc3 naming ("movstr") to match the rest of the "movstr" files.
 1.15 11-Dec-2005  christos branches: 1.15.24; 1.15.26; 1.15.30; 1.15.32;
merge ktrace-lwp.
 1.14 14-Nov-2003  uwe branches: 1.14.16;
Use assembler version of bswap64.
 1.13 13-Nov-2003  uwe Eliminate bzero.
 1.12 08-Nov-2003  uwe Nuke bcopy. Move the code to memmove.S (which it is) make memmove the
primary entry point and comment out the bcopy entry point.

Kernels before and after the change are identical.
 1.11 08-Nov-2003  jdolecek no need for bcmp.c
 1.10 20-Nov-2002  itohy branches: 1.10.6;
Use assembly version of bzero() and memset().
 1.9 21-Sep-2002  chs add strtoul.c, it's now used in MI code.
 1.8 05-Sep-2002  msaitoh Add __movstr_i4_{odd,even} for -m4.
Written by SHIMIZU Ryo.
 1.7 24-Aug-2002  itohy Use assembly version of ffs(3).
 1.6 01-Nov-2000  thorpej branches: 1.6.2; 1.6.4; 1.6.16;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.5 21-Jul-2000  msaitoh compile byte_swap_2.S and byte_swap_4.S
 1.4 09-Jun-2000  msaitoh branches: 1.4.2;
new bcopy.S
 1.3 20-Apr-2000  msaitoh branches: 1.3.2;
asm bcopy() for sh3
 1.2 21-Oct-1999  msaitoh add strncasecmp.c
 1.1 13-Sep-1999  itojun branches: 1.1.2; 1.1.4; 1.1.6;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.4.1 15-Nov-1999  fvdl Sync with -current
 1.1.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.1.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.3.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.2.1 11-Aug-2000  msaitoh Pullup revision 1.5 (approved by thorpej):

compile byte_swap_*.S
 1.6.16.1 29-Aug-2002  gehenna catch up with -current.
 1.6.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.4.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.6.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.6.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.6.2.1 27-Aug-2002  nathanw Catch up to -current.
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14.16.1 03-Sep-2007  yamt sync with head.
 1.15.32.1 11-Jul-2007  mjf Sync with head.
 1.15.30.1 10-Apr-2007  ad Sync with head.
 1.15.26.1 24-Mar-2007  yamt sync with head.
 1.15.24.1 20-Apr-2007  bouyer Pull up following revision(s) (requested by uwe in ticket #585):
sys/lib/libkern/arch/sh3/Makefile.inc: revision 1.16
sys/lib/libkern/arch/sh3/movstrSI12_i4.S: revision 1.1
Provide __movmemSI12_i4 (gcc4) a.k.a. __movstrSI12_i4 (gcc3) that gcc
emits for sh4 to copy 12 bytes at certain optimization levels.
Discovered by compiling landisk kernel with -Os.
Use gcc3 naming ("movstr") to match the rest of the "movstr" files.
 1.16.36.1 19-Aug-2009  yamt sync with head.
 1.7 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.6 22-May-2006  uwe branches: 1.6.2; 1.6.58; 1.6.62; 1.6.72;
G/c #ifdef PIC we inherited from the userland.
 1.5 22-Apr-2006  uwe branches: 1.5.2; 1.5.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.4 20-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8;
Use common sources with userland.
 1.3 14-Feb-2001  msaitoh branches: 1.3.40;
don't profile (use NENTRY() and ALTENTRY())
 1.2 14-Feb-2001  msaitoh _C_LABEL()
 1.1 13-Sep-1999  itojun branches: 1.1.2;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.2.1 12-Mar-2001  bouyer Sync with HEAD.
 1.3.40.1 21-Jun-2006  yamt sync with head.
 1.4.8.1 24-May-2006  yamt sync with head.
 1.4.6.1 01-Jun-2006  kardel Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.4.1 19-Jun-2006  chap Sync with head.
 1.5.2.2 11-May-2006  elad sync with head
 1.5.2.1 22-Apr-2006  elad file ashiftrt.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.6.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.6.62.1 04-May-2009  yamt sync with head.
 1.6.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.6.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.6.2.1 22-May-2006  tron file ashiftrt.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.6 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.5 22-May-2006  uwe branches: 1.5.2; 1.5.58; 1.5.62; 1.5.72;
G/c #ifdef PIC we inherited from the userland.
 1.4 22-Apr-2006  uwe branches: 1.4.2; 1.4.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.3 20-Dec-2005  christos branches: 1.3.4; 1.3.6; 1.3.8;
Use common sources with userland.
 1.2 14-Feb-2001  msaitoh branches: 1.2.40;
_C_LABEL()
 1.1 13-Sep-1999  itojun branches: 1.1.2;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.2.1 12-Mar-2001  bouyer Sync with HEAD.
 1.2.40.1 21-Jun-2006  yamt sync with head.
 1.3.8.1 24-May-2006  yamt sync with head.
 1.3.6.1 01-Jun-2006  kardel Sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.4.1 19-Jun-2006  chap Sync with head.
 1.4.2.2 11-May-2006  elad sync with head
 1.4.2.1 22-Apr-2006  elad file ashlsi3.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.5.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.62.1 04-May-2009  yamt sync with head.
 1.5.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.2.1 22-May-2006  tron file ashlsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.6 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.5 22-May-2006  uwe branches: 1.5.2; 1.5.58; 1.5.62; 1.5.72;
G/c #ifdef PIC we inherited from the userland.
 1.4 22-Apr-2006  uwe branches: 1.4.2; 1.4.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.3 20-Dec-2005  christos branches: 1.3.4; 1.3.6; 1.3.8;
Use common sources with userland.
 1.2 14-Feb-2001  msaitoh branches: 1.2.40;
_C_LABEL()
 1.1 13-Sep-1999  itojun branches: 1.1.2;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.2.1 12-Mar-2001  bouyer Sync with HEAD.
 1.2.40.1 21-Jun-2006  yamt sync with head.
 1.3.8.1 24-May-2006  yamt sync with head.
 1.3.6.1 01-Jun-2006  kardel Sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.4.1 19-Jun-2006  chap Sync with head.
 1.4.2.2 11-May-2006  elad sync with head
 1.4.2.1 22-Apr-2006  elad file ashrsi3.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.5.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.62.1 04-May-2009  yamt sync with head.
 1.5.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.2.1 22-May-2006  tron file ashrsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.4 08-Nov-2003  uwe Nuke bcopy. Move the code to memmove.S (which it is) make memmove the
primary entry point and comment out the bcopy entry point.

Kernels before and after the change are identical.
 1.3 20-Nov-2002  itohy branches: 1.3.6;
memcpy() and memmove() must return the first parameter.
Problem found by itohy, fixed by SHIMIZU Ryo.
 1.2 09-Jun-2000  msaitoh branches: 1.2.4; 1.2.6;
new bcopy.S
 1.1 20-Apr-2000  msaitoh branches: 1.1.2;
asm bcopy() for sh3
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.6.1 11-Dec-2002  thorpej Sync with HEAD.
 1.2.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.4.1 09-Jun-2000  bouyer file bcopy.S was added on branch thorpej_scsipi on 2000-11-20 18:09:30 +0000
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6 14-Apr-2006  nonaka Always _LOCORE is defined for standalone program.
 1.5 04-Feb-2006  uwe branches: 1.5.2; 1.5.4; 1.5.6;
Truncate the argument to 16 bit with extu.w
 1.4 11-Dec-2005  christos branches: 1.4.2; 1.4.4; 1.4.6;
merge ktrace-lwp.
 1.3 09-Nov-2003  uwe branches: 1.3.16;
Compile identity ntoh*/hton* only for big endian case.
 1.2 21-Jul-2000  msaitoh branches: 1.2.24;
support "big endian", too.
 1.1 13-Sep-1999  itojun branches: 1.1.2; 1.1.12;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.12.1 11-Aug-2000  msaitoh Pullup revision 1.5 (approved by thorpej):

support big endian, too.
 1.1.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.4.6.1 22-Apr-2006  simonb Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.4.2.1 18-Feb-2006  yamt sync with head.
 1.5.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.4.1 19-Apr-2006  elad sync with head.
 1.5.2.1 24-May-2006  yamt sync with head.
 1.5 14-Apr-2006  nonaka Always _LOCORE is defined for standalone program.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8; 1.4.10; 1.4.12;
merge ktrace-lwp.
 1.3 09-Nov-2003  uwe branches: 1.3.16;
Compile identity ntoh*/hton* only for big endian case.
 1.2 21-Jul-2000  msaitoh branches: 1.2.24;
support "big endian", too.
 1.1 13-Sep-1999  itojun branches: 1.1.2; 1.1.12;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.12.1 11-Aug-2000  msaitoh Pullup revision 1.2 (approved by thorpej):

support big endian, too.
 1.1.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.4.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.4.10.1 19-Apr-2006  elad sync with head.
 1.4.8.1 24-May-2006  yamt sync with head.
 1.4.6.1 22-Apr-2006  simonb Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 14-Nov-2003  uwe branches: 1.1.4;
bswap64 written in assembler.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 14-Nov-2003  skrll file byte_swap_8.S was added on branch ktrace-lwp on 2004-08-03 10:53:49 +0000
 1.2 13-Nov-2003  uwe Eliminate bzero.
 1.1 20-Nov-2002  itohy branches: 1.1.2; 1.1.8;
Assembly version of bzero()/memset().
Written by SHIMIZU Ryo.
 1.1.8.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 11-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-11 06:46:25 +0000
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 01-Sep-2002  itohy branches: 1.4.2; 1.4.24;
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 branches: 1.3.2;
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:47:46 +0000
 1.3.2.2 29-Aug-2002  gehenna catch up with -current.
 1.3.2.1 28-Aug-2002  gehenna file ffs.S was added on branch gehenna-devsw on 2002-08-29 05:23:20 +0000
 1.4.24.1 21-Jun-2006  yamt sync with head.
 1.4.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.2.1 01-Sep-2002  jdolecek file ffs.S was added on branch kqueue on 2002-09-06 08:48:31 +0000
 1.6 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.5 22-May-2006  uwe branches: 1.5.2; 1.5.58; 1.5.62; 1.5.72;
G/c #ifdef PIC we inherited from the userland.
 1.4 22-Apr-2006  uwe branches: 1.4.2; 1.4.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.3 20-Dec-2005  christos branches: 1.3.4; 1.3.6; 1.3.8;
Use common sources with userland.
 1.2 14-Feb-2001  msaitoh branches: 1.2.40;
_C_LABEL()
 1.1 13-Sep-1999  itojun branches: 1.1.2;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.2.1 12-Mar-2001  bouyer Sync with HEAD.
 1.2.40.1 21-Jun-2006  yamt sync with head.
 1.3.8.1 24-May-2006  yamt sync with head.
 1.3.6.1 01-Jun-2006  kardel Sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.4.1 19-Jun-2006  chap Sync with head.
 1.4.2.2 11-May-2006  elad sync with head
 1.4.2.1 22-Apr-2006  elad file lshrsi3.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.5.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.62.1 04-May-2009  yamt sync with head.
 1.5.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.2.1 22-May-2006  tron file lshrsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 09-Jun-2000  msaitoh branches: 1.2.4; 1.2.44;
new bcopy.S
 1.1 20-Apr-2000  msaitoh branches: 1.1.2;
asm bcopy() for sh3
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.2.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.4.1 09-Jun-2000  bouyer file memcpy.S was added on branch thorpej_scsipi on 2000-11-20 18:09:31 +0000
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 09-Nov-2003  uwe branches: 1.4.16;
Get rid of bcopy relics. Minimize diffs against the libc version.
 1.3 08-Nov-2003  uwe Nuke bcopy. Move the code to memmove.S (which it is) make memmove the
primary entry point and comment out the bcopy entry point.

Kernels before and after the change are identical.
 1.2 09-Jun-2000  msaitoh branches: 1.2.4; 1.2.28;
new bcopy.S
 1.1 20-Apr-2000  msaitoh branches: 1.1.2;
asm bcopy() for sh3
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.28.1 03-Aug-2004  skrll Sync with HEAD
 1.2.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.4.1 09-Jun-2000  bouyer file memmove.S was added on branch thorpej_scsipi on 2000-11-20 18:09:31 +0000
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 20-Nov-2002  itohy branches: 1.1.2; 1.1.24;
Assembly version of bzero()/memset().
Written by SHIMIZU Ryo.
 1.1.24.1 21-Jun-2006  yamt sync with head.
 1.1.2.2 11-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-11 06:46:25 +0000
 1.9 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.8 22-May-2006  uwe branches: 1.8.2; 1.8.58; 1.8.62; 1.8.72;
Provide __movmem* aliases to __movstr* functions.
Gcc4 uses movmem, older versions use movstr.
 1.7 22-May-2006  uwe G/c #ifdef PIC we inherited from the userland.
 1.6 22-Apr-2006  uwe branches: 1.6.2; 1.6.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.5 20-Dec-2005  christos branches: 1.5.4; 1.5.6; 1.5.8;
Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 26-Feb-2005  perry branches: 1.3.4;
nuke trailing whitespace
 1.2 14-Feb-2001  msaitoh branches: 1.2.24; 1.2.32; 1.2.34;
_C_LABEL()
 1.1 13-Sep-1999  itojun branches: 1.1.2;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.2.1 12-Mar-2001  bouyer Sync with HEAD.
 1.2.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.32.1 29-Apr-2005  kent sync with -current
 1.2.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.4.1 21-Jun-2006  yamt sync with head.
 1.5.8.1 24-May-2006  yamt sync with head.
 1.5.6.1 01-Jun-2006  kardel Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.4.1 19-Jun-2006  chap Sync with head.
 1.6.2.2 11-May-2006  elad sync with head
 1.6.2.1 22-Apr-2006  elad file movstr.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.8.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.62.1 04-May-2009  yamt sync with head.
 1.8.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.8.2.1 22-May-2006  tron file movstr.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2 16-Sep-1999  msaitoh unused file (we have an asm version)
 1.1 13-Sep-1999  itojun Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.8 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.7 22-May-2006  uwe branches: 1.7.2; 1.7.58; 1.7.62; 1.7.72;
Provide __movmem* aliases to __movstr* functions.
Gcc4 uses movmem, older versions use movstr.
 1.6 22-May-2006  uwe G/c #ifdef PIC we inherited from the userland.
 1.5 22-Apr-2006  uwe branches: 1.5.2; 1.5.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.4 20-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8;
Use common sources with userland.
 1.3 14-Feb-2001  msaitoh branches: 1.3.40;
don't profile (use NENTRY() and ALTENTRY())
 1.2 14-Feb-2001  msaitoh ENTRY()
 1.1 09-Jun-2000  msaitoh branches: 1.1.4; 1.1.6;
movstrSI*() for gcc -Os
 1.1.6.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.1.6.1 09-Jun-2000  bouyer file movstrSI.S was added on branch thorpej_scsipi on 2000-11-20 18:09:31 +0000
 1.1.4.2 22-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-22 17:09:28 +0000
 1.3.40.1 21-Jun-2006  yamt sync with head.
 1.4.8.1 24-May-2006  yamt sync with head.
 1.4.6.1 01-Jun-2006  kardel Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.4.1 19-Jun-2006  chap Sync with head.
 1.5.2.2 11-May-2006  elad sync with head
 1.5.2.1 22-Apr-2006  elad file movstrSI.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.7.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.62.1 04-May-2009  yamt sync with head.
 1.7.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.7.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.7.2.1 22-May-2006  tron file movstrSI.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.1 14-Mar-2007  uwe branches: 1.1.4; 1.1.6; 1.1.10; 1.1.12; 1.1.22; 1.1.42; 1.1.46; 1.1.56;
Provide __movmemSI12_i4 (gcc4) a.k.a. __movstrSI12_i4 (gcc3) that gcc
emits for sh4 to copy 12 bytes at certain optimization levels.
Discovered by compiling landisk kernel with -Os.

Use gcc3 naming ("movstr") to match the rest of the "movstr" files.
 1.1.56.1 19-Jan-2009  skrll Sync with HEAD.
 1.1.46.1 04-May-2009  yamt sync with head.
 1.1.42.1 17-Jan-2009  mjf Sync with HEAD.
 1.1.22.2 03-Sep-2007  yamt sync with head.
 1.1.22.1 14-Mar-2007  yamt file movstrSI12_i4.S was added on branch yamt-lazymbuf on 2007-09-03 14:41:30 +0000
 1.1.12.2 11-Jul-2007  mjf Sync with head.
 1.1.12.1 14-Mar-2007  mjf file movstrSI12_i4.S was added on branch mjf-ufs-trans on 2007-07-11 20:10:28 +0000
 1.1.10.2 20-Apr-2007  bouyer Pull up following revision(s) (requested by uwe in ticket #585):
sys/lib/libkern/arch/sh3/Makefile.inc: revision 1.16
sys/lib/libkern/arch/sh3/movstrSI12_i4.S: revision 1.1
Provide __movmemSI12_i4 (gcc4) a.k.a. __movstrSI12_i4 (gcc3) that gcc
emits for sh4 to copy 12 bytes at certain optimization levels.
Discovered by compiling landisk kernel with -Os.
Use gcc3 naming ("movstr") to match the rest of the "movstr" files.
 1.1.10.1 14-Mar-2007  bouyer file movstrSI12_i4.S was added on branch netbsd-4 on 2007-04-20 20:35:32 +0000
 1.1.6.2 10-Apr-2007  ad Sync with head.
 1.1.6.1 14-Mar-2007  ad file movstrSI12_i4.S was added on branch vmlocking on 2007-04-10 13:26:18 +0000
 1.1.4.2 24-Mar-2007  yamt sync with head.
 1.1.4.1 14-Mar-2007  yamt file movstrSI12_i4.S was added on branch yamt-idlelwp on 2007-03-24 14:56:07 +0000
 1.6 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.5 22-May-2006  uwe branches: 1.5.2; 1.5.58; 1.5.62; 1.5.72;
Provide __movmem* aliases to __movstr* functions.
Gcc4 uses movmem, older versions use movstr.
 1.4 22-May-2006  uwe G/c #ifdef PIC we inherited from the userland.
 1.3 22-Apr-2006  uwe branches: 1.3.2; 1.3.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.2 20-Dec-2005  christos branches: 1.2.4; 1.2.6; 1.2.8;
Use common sources with userland.
 1.1 05-Sep-2002  msaitoh branches: 1.1.2; 1.1.4; 1.1.26;
Add __movstr_i4_{odd,even} for -m4.
Written by SHIMIZU Ryo.
 1.1.26.1 21-Jun-2006  yamt sync with head.
 1.1.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.4.1 05-Sep-2002  jdolecek file movstr_i4.S was added on branch kqueue on 2002-10-10 18:43:26 +0000
 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:22:35 +0000
 1.2.8.1 24-May-2006  yamt sync with head.
 1.2.6.1 01-Jun-2006  kardel Sync with head.
 1.2.4.1 09-Sep-2006  rpaulo sync with head
 1.3.4.1 19-Jun-2006  chap Sync with head.
 1.3.2.2 11-May-2006  elad sync with head
 1.3.2.1 22-Apr-2006  elad file movstr_i4.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.5.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.62.1 04-May-2009  yamt sync with head.
 1.5.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.2.1 22-May-2006  tron file movstr_i4.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.6 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.5 22-May-2006  uwe branches: 1.5.2; 1.5.58; 1.5.62; 1.5.72;
G/c #ifdef PIC we inherited from the userland.
 1.4 22-Apr-2006  uwe branches: 1.4.2; 1.4.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.3 20-Dec-2005  christos branches: 1.3.4; 1.3.6; 1.3.8;
Use common sources with userland.
 1.2 14-Feb-2001  msaitoh branches: 1.2.40;
_C_LABEL()
 1.1 13-Sep-1999  itojun branches: 1.1.2;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.2.1 12-Mar-2001  bouyer Sync with HEAD.
 1.2.40.1 21-Jun-2006  yamt sync with head.
 1.3.8.1 24-May-2006  yamt sync with head.
 1.3.6.1 01-Jun-2006  kardel Sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.4.1 19-Jun-2006  chap Sync with head.
 1.4.2.2 11-May-2006  elad sync with head
 1.4.2.1 22-Apr-2006  elad file mulsi3.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.5.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.62.1 04-May-2009  yamt sync with head.
 1.5.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.2.1 22-May-2006  tron file mulsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.12 05-Aug-2011  uwe Reword the comment about "millicode" nature of these functions and add
it to sdivsi3.S too.

Remove !_KERNEL code left over from the days when we shared these
files with userland.

Use .L prefix for local label.
 1.11 14-Jul-2011  mrg revert the _i4i aliases. they are not the right thing.
 1.10 06-Jul-2011  mrg add weak aliases for __sdivsi3_i4i and __udivsi3_i4i.
 1.9 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.8 22-May-2006  uwe branches: 1.8.2; 1.8.58; 1.8.62; 1.8.72;
G/c #ifdef PIC we inherited from the userland.
 1.7 22-Apr-2006  uwe branches: 1.7.2; 1.7.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.6 20-Dec-2005  christos branches: 1.6.4; 1.6.6; 1.6.8;
Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 07-Aug-2003  agc branches: 1.4.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 09-Sep-2000  msaitoh branches: 1.3.24;
check _STANDALONE macro, too.
 1.2 03-Jan-2000  msaitoh branches: 1.2.4;
don't clobber r4 and r5
 1.1 13-Sep-1999  itojun branches: 1.1.2;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.4.1 21-Sep-2000  msaitoh pullup revision 1.3 (approved by thorpej):

check _STANDALONE macro, too (for boot-loader)
 1.3.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.24.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.6.8.1 24-May-2006  yamt sync with head.
 1.6.6.1 01-Jun-2006  kardel Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.4.1 19-Jun-2006  chap Sync with head.
 1.7.2.2 11-May-2006  elad sync with head
 1.7.2.1 22-Apr-2006  elad file sdivsi3.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.8.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.62.1 04-May-2009  yamt sync with head.
 1.8.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.8.2.1 22-May-2006  tron file sdivsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2 05-Aug-2011  uwe Reword the comment about "millicode" nature of these functions and add
it to sdivsi3_i4i.S too.
 1.1 04-Aug-2011  uwe For unsignad integer division gcc used to emit a call to __udivsi3
"millicode" function that uses compiler-private ABI. Newer gcc uses
heavily tuned __udivsi3_i4i that is NOT compatible with __udivsi3
because it's expected to clobber different registers. We don't want
to link the kernel against libgcc and we don't have resources to write
heavily tuned version ourselves, so clone __udivsi3 but adjust it to
conform to the __udivsi3_i4i clobber spec.

Ditto for signed division.

You can make gcc use old routines with -mdiv=call-div1 to avoid few
extra instructions to save/restore the right registers in the signed
division funcion.
 1.11 05-Aug-2011  uwe Reword the comment about "millicode" nature of these functions and add
it to sdivsi3.S too.

Remove !_KERNEL code left over from the days when we shared these
files with userland.

Use .L prefix for local label.
 1.10 14-Jul-2011  mrg revert the _i4i aliases. they are not the right thing.
 1.9 06-Jul-2011  mrg add weak aliases for __sdivsi3_i4i and __udivsi3_i4i.
 1.8 07-Jan-2009  uwe These copy of gcc millicode routines is now included in librump (that
sucks in all libkern sources), so mark them ".hidden". I'm not sure
if this is the best course of action (dropping millicode from librump
might be a better idea), but it's the quickest fix to get sh3 builds
going again for now.
 1.7 22-May-2006  uwe branches: 1.7.2; 1.7.58; 1.7.62; 1.7.72;
G/c #ifdef PIC we inherited from the userland.
 1.6 22-Apr-2006  uwe branches: 1.6.2; 1.6.4;
libc gets gcc millicode from libgcc, so we don't need to keep it
in src/common. Move it to sys/lib/libkern/arch/sh3.
 1.5 20-Dec-2005  christos branches: 1.5.4; 1.5.6; 1.5.8;
Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 21-Dec-1999  msaitoh branches: 1.2.28;
check _STANDALONE
 1.1 13-Sep-1999  itojun branches: 1.1.2; 1.1.8;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.28.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.5.8.1 24-May-2006  yamt sync with head.
 1.5.6.1 01-Jun-2006  kardel Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.4.1 19-Jun-2006  chap Sync with head.
 1.6.2.2 11-May-2006  elad sync with head
 1.6.2.1 22-Apr-2006  elad file udivsi3.S was added on branch elad-kernelauth on 2006-05-11 23:31:08 +0000
 1.7.72.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.62.1 04-May-2009  yamt sync with head.
 1.7.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.7.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.7.2.1 22-May-2006  tron file udivsi3.S was added on branch peter-altq on 2006-05-24 15:50:42 +0000
 1.2 05-Aug-2011  uwe Reword the comment about "millicode" nature of these functions and add
it to sdivsi3_i4i.S too.
 1.1 04-Aug-2011  uwe For unsignad integer division gcc used to emit a call to __udivsi3
"millicode" function that uses compiler-private ABI. Newer gcc uses
heavily tuned __udivsi3_i4i that is NOT compatible with __udivsi3
because it's expected to clobber different registers. We don't want
to link the kernel against libgcc and we don't have resources to write
heavily tuned version ourselves, so clone __udivsi3 but adjust it to
conform to the __udivsi3_i4i clobber spec.

Ditto for signed division.

You can make gcc use old routines with -mdiv=call-div1 to avoid few
extra instructions to save/restore the right registers in the signed
division funcion.
 1.3 18-Nov-1996  pk sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.36 17-Mar-2013  nakayama Revert previous. christos fixed the root cause.
 1.35 14-Mar-2013  nakayama Make sparc64 32-bit kernel buildable.
 1.34 14-Aug-2009  dsl Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.33 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.32 11-Dec-2005  christos branches: 1.32.74;
merge ktrace-lwp.
 1.31 22-Apr-2005  reed Use ${TOOL_M4} instead of "m4". (I only tested this fix
for sparc but not sparc64 or alpha yet.)

Noticed problem when building NetBSD/sparc from a Linux/i386 host
that didn't have "m4".
 1.30 08-Nov-2003  lukem branches: 1.30.8;
Add '.SUFFIXES: .m4' here, now that <sys.mk> doesn't provide it anymore.
It appears that .PATH.m4: needs it.
Should fix problem noted in private mail by Markus W Kilbinger.
 1.29 08-Nov-2003  jdolecek don't need bcmp() and bzero()
 1.28 16-Apr-2002  martin branches: 1.28.10;
Add strtoul.c, otherwise kernels using "wi* at pcmcia?" do not work
anymore.

Why only four archs provide this is beyound me.
 1.27 01-Jul-2001  kleink branches: 1.27.2;
Sync with libc: use bzero-based assembly version of memset().
 1.26 01-Nov-2000  thorpej branches: 1.26.2;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.25 09-May-1999  pk branches: 1.25.2;
Add .PATH.m4
 1.24 24-Feb-1999  chs branches: 1.24.4;
don't list any *.S files in SRCS multiple times, once is enough.
 1.23 04-Aug-1998  perry branches: 1.23.2;
add memcmp.c
 1.22 22-Feb-1998  mycroft Move random() from kernel.
 1.21 22-Feb-1998  mycroft Don't list bcopy.c here, since we only want memcpy() and not bcopy().
XXX What a kluge!
 1.20 22-Feb-1998  mycroft We need memcpy().
 1.19 22-Feb-1998  mycroft Add some missing things.
 1.18 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.17 24-Oct-1997  chuck add memchr() to libkern
 1.16 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.15 18-Jan-1997  cgd branches: 1.15.8;
add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.14 18-Nov-1996  pk Remove `chmod 444's.
 1.13 27-Aug-1996  cgd Add machine-independent assertion-checking support. macros are:

assert() which always does assertion checking
unless "NDEBUG" is defined.

KASSERT() which does assertion checking if DIAGNOSTIC
is defined.

KDASSERT() which does assertion checking if DEBUG is
define. This macro exists for compatibility
with existing ports' assertion checking macros.
(Assertion checking is not typically an
"expensive" operation, and DIAGNOSTIC should be
used for inexpensive consistency checks.)
 1.12 23-Apr-1996  christos Remove memset.c; it is not currently used, and .c files should belong in
the MI portion of libkern. When/if we move to use mem* routines in the kernel
we can add it to the MI portion/write a memset.s.
 1.11 13-Apr-1996  cgd add strncasecmp.c to ports' libkern Makefile.inc's. When adding a new
source file to libkern, it should be added to _ALL_ ports makefiles if
it is machine-independent and used by machine-independent code (in
this case adosfs). (There are several arguments that say that
strncasecmp should not be in libkern at all, and i think they're
good ones, but as long as ADOSFS needs it to link, it has to be here
for all architectures.)
 1.10 07-Oct-1995  mycroft Remove setjmp() and ffs().
 1.9 26-Oct-1994  cgd new RCS ID format.
 1.8 15-Sep-1994  deraadt gcc automatically calls memset in certain situations.
 1.7 30-Jun-1994  deraadt find divrem.m4 automatically
 1.6 22-Mar-1994  deraadt delete some unneeded things
 1.5 15-Jan-1994  pk Find source in the right places.
 1.4 05-Dec-1993  cgd use .S
 1.3 15-Oct-1993  cgd branches: 1.3.2;
add strncmp to anything
 1.2 15-Oct-1993  cgd add __main()
 1.1 13-Oct-1993  cgd move 'boot' and 'libkern' into 'lib'. generally clean up 'kernel library'
building and dependencies.
 1.3.2.2 05-Dec-1993  cgd use .S
 1.3.2.1 15-Oct-1993  cgd file Makefile.inc was added on branch magnum on 1993-12-05 01:52:48 +0000
 1.15.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.2.1 09-Nov-1998  chs initial snapshot. lots left to do.
 1.24.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.25.2.1 22-Nov-2000  bouyer Sync with HEAD.
 1.26.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.26.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.27.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.28.10.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.28.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.10.1 03-Aug-2004  skrll Sync with HEAD
 1.30.8.1 29-Apr-2005  kent sync with -current
 1.32.74.1 19-Aug-2009  yamt sync with head.
 1.9 30-Mar-2006  uwe G/c this stale copy of SYS.h. It has not been updated since 1999. It
has not been used since an unused copy of setjmp.S has been removed
from here in 2002 (i386 removed its own in 1999).
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.6; 1.8.8; 1.8.10; 1.8.12;
merge ktrace-lwp.
 1.7 26-Feb-2005  perry branches: 1.7.4;
nuke trailing whitespace
 1.6 07-Aug-2003  agc branches: 1.6.8; 1.6.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.7.4.1 21-Jun-2006  yamt sync with head.
 1.8.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.8.10.1 19-Apr-2006  elad sync with head.
 1.8.8.1 01-Apr-2006  yamt sync with head.
 1.8.6.1 22-Apr-2006  simonb Sync with head.
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.6 27-Oct-2002  chs remove setjmp/longjmp from libkern, they're not used.
 1.5 05-Mar-1999  pk branches: 1.5.20;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.20.1 11-Nov-2002  nathanw Catch up to -current
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 01-Jul-2001  kleink branches: 1.6.22;
Sync with libc: use bzero-based assembly version of memset().
 1.5 05-Mar-1999  pk branches: 1.5.20;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.20.1 24-Aug-2001  nathanw Catch up with -current.
 1.6.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.22.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.9 13-Jun-2011  mrg catch up with the userland copy:
>revision 1.6
>date: 2011/03/23 20:54:35; author: martin; state: Exp; lines: +2 -2
>Avoid using %g7

fixes rump on sparc, at least somewhat.
tested that normal kernels runs fine this with this change, too.
 1.8 11-Dec-2005  christos branches: 1.8.108;
merge ktrace-lwp.
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 05-Mar-1999  pk branches: 1.6.42;
Sync with libc
 1.5 13-Oct-1997  lukem rcsid fascism
 1.4 18-Nov-1996  pk branches: 1.4.10;
sync with libc source: remove DEFS.h
 1.3 22-Apr-1995  pk eserve the equality "x == y*(x/y)+(x%y)" for negative y; from Lon Willett.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.4.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.42.1 03-Aug-2004  skrll Sync with HEAD
 1.8.108.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.14 20-Dec-2005  christos Use common sources with userland.
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 07-Aug-2003  agc branches: 1.12.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 13-May-2001  kleink branches: 1.11.22;
Make this work for PIC (as opposed to pic) without taking chances of fitting
__ffstab into a GOT13 relocation; from Eduardo Horvath.
 1.10 06-Sep-1999  chs branches: 1.10.14;
sync with libc:
use RODATA() instead of ENTRY() for __ffstab so that it works when profiling.
 1.9 05-Mar-1999  pk Sync with libc
 1.8 24-Feb-1999  chs use RODATA(__ffstab) instead of ENTRY().
this makes profiling kernels work on the sparc.
 1.7 07-May-1998  pk branches: 1.7.4;
Sync with libc.
 1.6 22-Feb-1998  mycroft Fix omission in last.
 1.5 22-Feb-1998  mycroft Copy up.
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.4.1 25-Feb-1999  chs sync with HEAD - profiling fixes.
 1.10.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.22.1 03-Aug-2004  skrll Sync with HEAD
 1.12.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 01-Jul-2001  kleink branches: 1.1.4; 1.1.40;
Sync with libc: use bzero-based assembly version of memset().
 1.1.40.1 21-Jun-2006  yamt sync with head.
 1.1.4.2 24-Aug-2001  nathanw Catch up with -current.
 1.1.4.1 01-Jul-2001  nathanw file memset.S was added on branch nathanw_sa on 2001-08-24 00:11:52 +0000
 1.6 23-Apr-1996  christos Remove memset.c; it is not currently used, and .c files should belong in
the MI portion of libkern. When/if we move to use mem* routines in the kernel
we can add it to the MI portion/write a memset.s.
 1.5 18-Apr-1996  cgd don't include user-land headers in libkern files when compiling for
the kernel. memset.c does not belong here. it either belongs in
the MI libkern directory, or does not belong in libkern at all.
 1.4 11-Mar-1996  scottr Back out previous change.
 1.3 11-Mar-1996  thorpej Provide a memset() for the i386 (assembly version), and move memset.c
out into the libkern proper in case other ports want to use it.
i386 kernels with COMPAT_LINUX should compile now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 15-Sep-1994  deraadt gcc automatically calls memset in certain situations.
 1.9 20-Dec-2005  christos Use common sources with userland.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 26-Feb-2005  perry branches: 1.7.4;
nuke trailing whitespace
 1.6 07-Aug-2003  agc branches: 1.6.8; 1.6.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.7.4.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.5 07-Mar-2014  nakayama Align explicitly to make kernels compiled by clang generate
properly aligned code.
 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 05-Jan-2009  pooka branches: 1.3.14; 1.3.24; 1.3.28;
Fix previous. I have no idea what crack I was on when I "tested" them.
 1.2 04-Jan-2009  pooka Support PIC for inclusion in librump. (m68k untested)
 1.1 22-Feb-1998  mycroft branches: 1.1.146; 1.1.150; 1.1.160;
Move random() from kernel.
 1.1.160.1 19-Jan-2009  skrll Sync with HEAD.
 1.1.150.1 04-May-2009  yamt sync with head.
 1.1.146.1 17-Jan-2009  mjf Sync with HEAD.
 1.3.28.1 18-May-2014  rmind sync with head
 1.3.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.14.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 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.6 27-Oct-2002  chs remove setjmp/longjmp from libkern, they're not used.
 1.5 05-Mar-1999  pk branches: 1.5.20;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.20.1 11-Nov-2002  nathanw Catch up to -current
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 05-Mar-1999  pk branches: 1.5.42;
Sync with libc
 1.4 13-Oct-1997  lukem rcsid fascism
 1.3 18-Nov-1996  pk branches: 1.3.10;
sync with libc source: remove DEFS.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 30-Jun-1994  deraadt auto-copied from libc
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.42.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.11 17-Mar-2013  nakayama Remove duplicate source files.
 1.10 14-Aug-2009  dsl branches: 1.10.12; 1.10.22;
Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.9 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.8 11-Dec-2005  christos branches: 1.8.74;
merge ktrace-lwp.
 1.7 22-Apr-2005  reed Use ${TOOL_M4} instead of "m4". (I only tested this fix
for sparc but not sparc64 or alpha yet.)

Noticed problem when building NetBSD/sparc from a Linux/i386 host
that didn't have "m4".
 1.6 09-Nov-2003  martin branches: 1.6.8;
bzero is gone from the kernel
 1.5 05-May-2002  martin branches: 1.5.10;
Add strtoul.
 1.4 01-Nov-2000  thorpej branches: 1.4.2; 1.4.4;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.3 09-May-1999  eeh branches: 1.3.2;
Find the udivrem.m4 in the proper directory.
 1.2 04-Aug-1998  perry branches: 1.2.8;
add memcmp.c
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh Second half of the sparc64 stuff.
 1.2.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.1 22-Nov-2000  bouyer Sync with HEAD.
 1.4.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.1 20-Jun-2002  nathanw Catch up to -current.
 1.5.10.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.10.1 03-Aug-2004  skrll Sync with HEAD
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.8.74.1 19-Aug-2009  yamt sync with head.
 1.10.22.1 23-Jun-2013  tls resync from head
 1.10.12.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 30-Mar-2006  martin Remove an unused, obsolete copy (pointed out by Valeriy E. Ushakov).
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.6; 1.5.8; 1.5.10; 1.5.12;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 07-Aug-2003  agc branches: 1.3.8; 1.3.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 15-Feb-1999  hubertf branches: 1.2.42;
RCS ID police
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh Second half of the sparc64 stuff.
 1.2.42.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.42.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.5.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.5.10.1 19-Apr-2006  elad sync with head.
 1.5.8.1 01-Apr-2006  yamt sync with head.
 1.5.6.1 22-Apr-2006  simonb Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.2 27-Oct-2002  chs remove setjmp/longjmp from libkern, they're not used.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.26;
Second half of the sparc64 stuff.
 1.1.1.1.26.1 11-Nov-2002  nathanw Catch up to -current
 1.3 09-Nov-2003  martin bzero is gone from the kernel
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 29-Oct-2002  chs branches: 1.3.6;
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 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.26;
Second half of the sparc64 stuff.
 1.1.1.1.26.1 11-Nov-2002  nathanw Catch up to -current
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6 20-Dec-2005  christos Use common sources with userland.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 07-Aug-2003  agc branches: 1.3.8; 1.3.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 26-Nov-1998  eeh branches: 1.2.44;
Fixup ffstab naming conflict between locore.s, libkern/arch/sparc/ffs.S and
libkern/arch/sparc64/ffs.S
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh Second half of the sparc64 stuff.
 1.2.44.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.44.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.44.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.44.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.8 20-Dec-2005  christos Use common sources with userland.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 26-Feb-2005  perry branches: 1.6.4;
nuke trailing whitespace
 1.5 07-Aug-2003  agc branches: 1.5.8; 1.5.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 26-Nov-1998  eeh branches: 1.4.44;
Forgot to specify a label for the branch target. Oops.
 1.3 30-Aug-1998  eeh Some more 64-bit cleanup. Now everything compiles.
 1.2 29-Aug-1998  eeh Some more 64-bit-ification.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh Second half of the sparc64 stuff.
 1.4.44.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.44.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.44.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.44.1 03-Aug-2004  skrll Sync with HEAD
 1.5.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.6.4.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.5 07-Mar-2014  nakayama Align explicitly to make kernels compiled by clang generate
properly aligned code.
 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 05-Jan-2009  pooka branches: 1.3.14; 1.3.24; 1.3.28;
Fix previous. I have no idea what crack I was on when I "tested" them.
 1.2 04-Jan-2009  pooka Support PIC for inclusion in librump. (m68k untested)
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.146; 1.1.1.1.150; 1.1.1.1.160;
Second half of the sparc64 stuff.
 1.1.1.1.160.1 19-Jan-2009  skrll Sync with HEAD.
 1.1.1.1.150.1 04-May-2009  yamt sync with head.
 1.1.1.1.146.1 17-Jan-2009  mjf Sync with HEAD.
 1.3.28.1 18-May-2014  rmind sync with head
 1.3.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.14.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 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.2 27-Oct-2002  chs remove setjmp/longjmp from libkern, they're not used.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.26;
Second half of the sparc64 stuff.
 1.1.1.1.26.1 11-Nov-2002  nathanw Catch up to -current
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 20-Jun-1998  eeh branches: 1.1.1;
Initial revision
 1.1.1.1 20-Jun-1998  eeh branches: 1.1.1.1.48;
Second half of the sparc64 stuff.
 1.1.1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 03-Sep-2018  riastradh Rename min.c -> uimin.c, max.c -> uimax.c in libkern.
 1.3 14-Aug-2009  dsl branches: 1.3.62; 1.3.64;
Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.2 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.1 29-Dec-2007  jmcneill branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.18;
libkern bits for usermode port.
 1.1.18.1 19-Aug-2009  yamt sync with head.
 1.1.8.2 18-Feb-2008  mjf Sync with HEAD.
 1.1.8.1 29-Dec-2007  mjf file Makefile.inc was added on branch mjf-devfs on 2008-02-18 21:06:59 +0000
 1.1.6.2 21-Jan-2008  yamt sync with head
 1.1.6.1 29-Dec-2007  yamt file Makefile.inc was added on branch yamt-lazymbuf on 2008-01-21 09:46:36 +0000
 1.1.4.2 09-Jan-2008  matt sync with HEAD
 1.1.4.1 29-Dec-2007  matt file Makefile.inc was added on branch matt-armv6 on 2008-01-09 01:56:35 +0000
 1.1.2.2 02-Jan-2008  bouyer Sync with HEAD
 1.1.2.1 29-Dec-2007  bouyer file Makefile.inc was added on branch bouyer-xeni386 on 2008-01-02 21:56:29 +0000
 1.3.64.1 10-Jun-2019  christos Sync with HEAD
 1.3.62.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.25 03-Sep-2018  riastradh Rename min.c -> uimin.c, max.c -> uimax.c in libkern.
 1.24 15-Mar-2010  uwe branches: 1.24.60; 1.24.62;
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.23 14-Aug-2009  dsl branches: 1.23.2;
Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.22 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.21 18-Jun-2009  he Back out the addition of memset.c to the vax libkern, and instead do
as tsutsui@ suggested, and include <sys/param.h> in sha2.c instead.
On the vax, this causes <machine/macros.h> to be included, and it contains
that machine's memset() macro+inline.
 1.20 18-Jun-2009  he Add memset.c, so that the references from sha2.c can be satisfied, and
so that the kernel and puffs applications can link again.
 1.19 13-Apr-2007  matt branches: 1.19.32; 1.19.48;
Include byte_swap_[24].c for kernels compiled with -O0
 1.18 11-Dec-2005  christos branches: 1.18.26; 1.18.30; 1.18.32;
merge ktrace-lwp.
 1.17 13-Aug-2003  ragge branches: 1.17.16;
Include the C versions of the string instructions.
Replace blkcpy() with a version that can handle overlapping data areas.
 1.16 19-Sep-2002  ragge branches: 1.16.6;
Need strtoul() also.
 1.15 24-Feb-2002  matt Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.14 10-Feb-2002  thorpej Add __blkcpy() and __blkset() (renamed/modified from __blkclr()) to
libkern.
 1.13 01-Nov-2000  thorpej branches: 1.13.2; 1.13.4;
Add a strcasecmp(), modified from chopps's strncasecmp().
 1.12 19-Jul-2000  matt We need strncasecmp.c now.
 1.11 15-Jan-1999  bouyer branches: 1.11.8; 1.11.18;
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.10 08-Aug-1998  ragge Lots of kernlib functions rewritten as inline macros.
 1.9 22-Feb-1998  mycroft Move random.S from kernel.
 1.8 21-Jan-1998  cgd add rules like those in libc to build strchr() and strrchr() (the latter
is being added to libkern by this commit). remove strchr.c from
archs' Makefile.inc files to go along with this. (If an arch has
a .S version, it should be copied down and added to the apropriate
Makefile.inc.)
 1.7 24-Oct-1997  chuck add memchr() to libkern
 1.6 09-Oct-1997  bouyer Add byte-swapping functions (bswap16, bswap32, bswap64) to libkern.
Only assembly version for i386 bswap16 and bswap32 for now (bswap64 uses
bswap32). Contribution of assembly versions of these are welcome.
Add byte-swapping of ext2fs metadata for big-endian systems.
Tested on i386 and sparc.
 1.5 18-Jan-1997  cgd branches: 1.5.8;
add strchr() to libkern. strchr.c copied from libc's "index.c", but with
appropriate definitions so that it'll build strchr(), and so that it builds
correctly in libkern (needed to #define NULL).
 1.4 27-Aug-1996  cgd Add machine-independent assertion-checking support. macros are:

assert() which always does assertion checking
unless "NDEBUG" is defined.

KASSERT() which does assertion checking if DIAGNOSTIC
is defined.

KDASSERT() which does assertion checking if DEBUG is
define. This macro exists for compatibility
with existing ports' assertion checking macros.
(Assertion checking is not typically an
"expensive" operation, and DIAGNOSTIC should be
used for inexpensive consistency checks.)
 1.3 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.2 13-Apr-1996  cgd add strncasecmp.c to ports' libkern Makefile.inc's. When adding a new
source file to libkern, it should be added to _ALL_ ports makefiles if
it is machine-independent and used by machine-independent code (in
this case adosfs). (There are several arguments that say that
strncasecmp should not be in libkern at all, and i think they're
good ones, but as long as ADOSFS needs it to link, it has to be here
for all architectures.)
 1.1 18-Apr-1995  ragge Added VAX specific makefile. (In libkern/arch/vax)
 1.5.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.18.1 27-Jul-2000  matt Pull up revision 1.12 (requested by matt)
add strncasecmp.c (needed for cd9660)
 1.11.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.11.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.13.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.13.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.13.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.13.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.16.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.6.1 03-Aug-2004  skrll Sync with HEAD
 1.17.16.1 03-Sep-2007  yamt sync with head.
 1.18.32.1 11-Jul-2007  mjf Sync with head.
 1.18.30.1 08-Jun-2007  ad Sync with head.
 1.18.26.1 15-Apr-2007  yamt sync with head.
 1.19.48.1 23-Jul-2009  jym Sync with HEAD.
 1.19.32.4 11-Aug-2010  yamt sync with head.
 1.19.32.3 19-Aug-2009  yamt sync with head.
 1.19.32.2 18-Jul-2009  yamt sync with head.
 1.19.32.1 20-Jun-2009  yamt sync with head
 1.23.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.24.62.1 10-Jun-2019  christos Sync with HEAD
 1.24.60.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 13-Aug-2003  ragge Include the C versions of the string instructions.
Replace blkcpy() with a version that can handle overlapping data areas.
 1.2 24-Feb-2002  matt branches: 1.2.2; 1.2.8; 1.2.20;
Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.1 10-Feb-2002  thorpej Add __blkcpy() and __blkset() (renamed/modified from __blkclr()) to
libkern.
 1.2.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.20.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.8.1 24-Feb-2002  jdolecek file blkcpy.S was added on branch kqueue on 2002-03-16 16:01:56 +0000
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 24-Feb-2002  nathanw file blkcpy.S was added on branch nathanw_sa on 2002-02-28 04:14:50 +0000
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 26-Feb-2005  perry nuke trailing whitespace
 1.3 24-Feb-2002  matt branches: 1.3.2; 1.3.8; 1.3.20; 1.3.28; 1.3.30;
Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.2 19-Feb-2002  ragge blkset() used a register for set value that get clobbered by movc5,
causing the set area to get unpredictable contents.
 1.1 10-Feb-2002  thorpej Add __blkcpy() and __blkset() (renamed/modified from __blkclr()) to
libkern.
 1.3.30.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.28.1 29-Apr-2005  kent sync with -current
 1.3.20.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.3.8.1 24-Feb-2002  jdolecek file blkset.S was added on branch kqueue on 2002-03-16 16:01:56 +0000
 1.3.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.2.1 24-Feb-2002  nathanw file blkset.S was added on branch nathanw_sa on 2002-02-28 04:14:50 +0000
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 24-Feb-2002  matt branches: 1.3.32;
Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.2 19-Jan-1999  ragge branches: 1.2.20; 1.2.22;
#include <machine/asm.h> instead of (nonexistent) "DEFS.h".
 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.22.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.20.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.32.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 15-Feb-1999  hubertf branches: 1.2.58;
RCS ID police
 1.1 08-Aug-1998  ragge Lots of kernlib functions rewritten as inline macros.
 1.2.58.1 21-Jun-2006  yamt sync with head.
 1.3 20-Dec-2005  christos Use common sources with userland.
 1.2 15-Feb-1999  hubertf branches: 1.2.58;
RCS ID police
 1.1 08-Aug-1998  ragge Lots of kernlib functions rewritten as inline macros.
 1.2.58.1 21-Jun-2006  yamt sync with head.
 1.4 14-Jan-2007  ragge Repair copyright that has been broken since -94.
Gently requested by Otto Moerbeek.
 1.3 24-Feb-2002  matt branches: 1.3.32; 1.3.62;
Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.2 19-Jul-2000  matt branches: 1.2.2; 1.2.4;
ELFify
 1.1 22-Feb-1998  mycroft branches: 1.1.14;
Move random.S from kernel.
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.2.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.62.1 01-Feb-2007  ad Sync with head.
 1.3.32.1 26-Feb-2007  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 24-Feb-2002  matt branches: 1.2.2; 1.2.8; 1.2.20;
Add register prefixes to these.
 1.1 24-Feb-2002  matt Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.2.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.20.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.8.1 24-Feb-2002  jdolecek file udiv.S was added on branch kqueue on 2002-03-16 16:01:57 +0000
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 24-Feb-2002  nathanw file udiv.S was added on branch nathanw_sa on 2002-02-28 04:14:50 +0000
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.5 20-Dec-2005  christos Use common sources with userland.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 24-Feb-2002  matt branches: 1.2.2; 1.2.8; 1.2.20;
Add register prefixes to these.
 1.1 24-Feb-2002  matt Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.2.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.20.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.8.1 24-Feb-2002  jdolecek file urem.S was added on branch kqueue on 2002-03-16 16:01:57 +0000
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 24-Feb-2002  nathanw file urem.S was added on branch nathanw_sa on 2002-02-28 04:14:51 +0000
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.7 27-Jan-2020  ad Make x86 use the C version of memcmp().
 1.6 14-Jan-2010  joerg branches: 1.6.64; 1.6.70;
Move AMD64's bswap64 implementation from libc to src/common and share it
with the kernel.
 1.5 14-Aug-2009  dsl Move that majority of the 'SRCS+= foo.c' into the main Makefile.libkern.
Any .S files added by the arch/*/Makefile.inc cause the .c file to
be excluded.
Specific exclusions added using NO_SRCS to match previous files.
At least sparc, sparc64, i386, amd64 and vax GENERIC still build.
(There is a fubar with the naming of the byte-swap files ...)
 1.4 12-Aug-2009  dsl Split the lines that add .c to SRCS from those that add .S
No changes (apart from the order) intended.
 1.3 18-Mar-2009  tsutsui - remove bcmp(9), bcopy(9), and bzero(9) from libkern since <sys/systm.h> has
macro which replace them with mem*() functions in #ifdef _KERNEL as noted
in man pages
- move declarations of bcopy(3) and bzero(3) into <lib/libsa/stand.h>
since they are still in libsa for some MD standalone sources
(I guess all bcmp(3) in standalone sources have been replaced with memcmp(3)
but they should be replaced with memcmp() anyway)
 1.2 25-Nov-2002  fvdl branches: 1.2.108; 1.2.118; 1.2.124;
Add strtoul.c
 1.1 19-Jun-2001  fvdl Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.2.124.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.118.1 28-Apr-2009  skrll Sync with HEAD.
 1.2.108.3 11-Mar-2010  yamt sync with head
 1.2.108.2 19-Aug-2009  yamt sync with head.
 1.2.108.1 04-May-2009  yamt sync with head.
 1.6.70.1 29-Feb-2020  ad Sync with head.
 1.6.64.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 19-Jun-2001  fvdl branches: 1.1.38;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.38.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 19-Jun-2001  fvdl branches: 1.1.38;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.38.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 19-Jun-2001  fvdl branches: 1.1.38;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.38.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.3 30-Oct-2017  maxv Add END().
 1.2 28-Apr-2008  martin branches: 1.2.44;
Remove clause 3 and 4 from TNF licenses
 1.1 19-Jun-2001  fvdl branches: 1.1.120; 1.1.122; 1.1.124;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.124.1 16-May-2008  yamt sync with head.
 1.1.122.1 18-May-2008  yamt sync with head.
 1.1.120.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.44.1 03-Dec-2017  jdolecek update from HEAD
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.3 30-Oct-2017  maxv Add END().
 1.2 28-Apr-2008  martin branches: 1.2.44;
Remove clause 3 and 4 from TNF licenses
 1.1 19-Jun-2001  fvdl branches: 1.1.120; 1.1.122; 1.1.124;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.124.1 16-May-2008  yamt sync with head.
 1.1.122.1 18-May-2008  yamt sync with head.
 1.1.120.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.44.1 03-Dec-2017  jdolecek update from HEAD
 1.3 30-Oct-2017  maxv Add END().
 1.2 28-Apr-2008  martin branches: 1.2.44;
Remove clause 3 and 4 from TNF licenses
 1.1 19-Jun-2001  fvdl branches: 1.1.120; 1.1.122; 1.1.124;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.124.1 16-May-2008  yamt sync with head.
 1.1.122.1 18-May-2008  yamt sync with head.
 1.1.120.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.44.1 03-Dec-2017  jdolecek update from HEAD
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 19-Jun-2001  fvdl branches: 1.1.38;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.38.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4 20-Dec-2005  christos Use common sources with userland.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.1 19-Jun-2001  fvdl branches: 1.1.22;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.2 20-Dec-2005  christos Use common sources with userland.
 1.1 19-Jun-2001  fvdl branches: 1.1.38;
Initial commit of the port to AMD's upcoming 64 bit architecture, the
x86-64. Since there's no hardware available yet, this port is only
known to run on the Simics simulator for at the moment, and as such
uses the PC devices that it simulates for now. It will be developed
more (and cleaned up) as the hardware becomes available.
 1.1.38.1 21-Jun-2006  yamt sync with head.

RSS XML Feed