Home | History | Annotate | only in /src/sys/arch/vax/include
History log of /src/sys/arch/vax/include
RevisionDateAuthorComments
 1.33 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.32 04-Nov-2024  christos Undo previous lwp.h change.
 1.31 03-Nov-2024  christos Split __lwp_getprivate_fast and __lwp_*tcb from mcontext.h into a separate
lwp.h file.
 1.30 29-Dec-2018  maxv branches: 1.30.36;
Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.29 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.28 17-Jul-2011  joerg branches: 1.28.52; 1.28.54;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.27 16-Feb-2007  ad More MD changes to get vax compiling.
 1.26 16-Feb-2007  matt Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.25 26-Jul-2006  drochner don't install <machine/db_machdep.h>, this is kernel only
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.8;
merge ktrace-lwp.
 1.23 08-May-2004  kleink branches: 1.23.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.22 27-Oct-2003  kleink Enter vaxfp.h, the VAX pendant of <machine/ieee.h>.
 1.21 18-Jan-2003  thorpej branches: 1.21.2;
Merge the nathanw_sa branch.
 1.20 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.19 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.18 27-May-2001  ragge branches: 1.18.2; 1.18.8; 1.18.16;
Don't install machine/loadfile_machdep.h; per PR#12666.
 1.17 15-Apr-2001  kleink Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.16 15-Apr-2001  kleink Add definitions of C99 specified-width integer type limits.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.15 14-Apr-2001  kleink Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.14 18-Feb-2001  ragge branches: 1.14.2;
Support to control the leds on VAXstations, taken from Sun3 and ported
to vax by Shinmyoh Koji (yesu@rb3.so-net.ne.jp).
 1.13 26-Jun-2000  kleink Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.12 11-Jun-2000  matt export bus.h
 1.11 04-Jun-2000  matt Add coff_machdep.h (now need due to the recent exec_coff changes).
 1.10 25-May-2000  matt branches: 1.10.2;
Add loadfile() support. soon to be needed by bootblocks.
 1.9 29-Apr-2000  thorpej Oops, install <machine/lock.h> on these systems, too.
 1.8 24-Apr-2000  matt Add lcgreg.h.
 1.7 17-Mar-2000  tron Install "machineendian_machdep.h".
 1.6 10-Jan-2000  matt Add ibcs2_machdep.h and reformat so that adding new includes is a bit easier.
 1.5 23-Dec-1999  kleink C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
 1.4 21-Aug-1999  matt branches: 1.4.2;
export elf_machdep.h
 1.3 16-Jan-1999  bouyer Add byte_swap.h here too.
 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-Jun-1998  cgd Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.4.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.14.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.18.16.1 31-Aug-2002  gehenna catch up with -current.
 1.18.8.3 11-Dec-2002  thorpej Sync with HEAD.
 1.18.8.2 13-Aug-2002  nathanw Catch up to -current.
 1.18.8.1 27-May-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-08-13 02:19:01 +0000
 1.18.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Aug-2004  skrll Sync with HEAD
 1.23.12.2 26-Feb-2007  yamt sync with head.
 1.23.12.1 30-Dec-2006  yamt sync with head.
 1.24.8.1 11-Aug-2006  yamt sync with head
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.28.54.1 10-Jun-2019  christos Sync with HEAD
 1.28.52.2 18-Jan-2019  pgoyette Synch with HEAD
 1.28.52.1 28-Jul-2018  pgoyette Sync with HEAD
 1.30.36.1 02-Aug-2025  perseant Sync with HEAD
 1.27 07-May-2019  kamil Switch all users (except ia64) of custom machine/ansi.h to common_ansi.h

Deduplicate the code among ports and poll definitions of types
directly from a compiler.

This fixes miscompilation of certain programs that instruct compilers
to generate code for different types. This bug has been detected with
-fshort-wchar in EFI firmware.

Proposed and discussed on a mailing list (twice).

Itanium uses custom !ELF fallback switch, temporarily leave it as it is.
 1.26 17-Jul-2011  joerg branches: 1.26.54;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.25 27-Mar-2010  tnozaki 1. {wctype,wctrans,mbstate}_t: switch MD to MI like other
libc implementation (such as *BSD and glibc2).

2. don't typedef void * wc{type,trans}_t, suggested by soda@-san.
it may pass through compiler type check, it's harmful.
so i introduce dummy struct __tag_wc{type,trans}_t(iconv_t already does).

no ABI change was made.
 1.24 11-Jan-2009  christos branches: 1.24.4; 1.24.6;
merge christos-time_t
 1.23 29-Aug-2008  matt branches: 1.23.2;
Drop support for compiling a.out kernel. Elves rule!
 1.22 17-Oct-2007  garbled branches: 1.22.16; 1.22.18; 1.22.22; 1.22.24; 1.22.28;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.21 03-Sep-2007  drochner clean up some definitions around rune_t which are not needed anymore
 1.20 04-Oct-2006  tnozaki branches: 1.20.8; 1.20.16; 1.20.22; 1.20.26; 1.20.28;
fix gcc -Werror -Wmissing-braces problem
mbstate_t(this is opaque object)'s initializer should be ``{ 0 }'',
so changed 1st field of union from character array to integer.
 1.19 11-Dec-2005  christos branches: 1.19.20; 1.19.22;
merge ktrace-lwp.
 1.18 07-Aug-2003  agc branches: 1.18.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.17 02-Mar-2003  tshiozak branches: 1.17.2;
add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
 1.16 17-Sep-2001  simonb branches: 1.16.4;
Only define _BSD_WCHAR_T_ once.
 1.15 28-Jul-2001  matt branches: 1.15.2;
Change clock_t and time_t to more LP64 friendly types.
 1.14 28-Jul-2001  matt Under ELF, change clock_t and time_t to int's (more LP64 friendly).
 1.13 13-Jan-2001  matt branches: 1.13.4;
Add the types needed by the new locale code.
 1.12 17-Jul-2000  matt switch size_t, ptrdiff_t, & ssize_t to long int (signed or unsigned) for
__ELF__.
 1.11 01-Jul-2000  matt More GCC 2.96 changes.
 1.10 30-Jun-2000  matt fix typo
 1.9 28-Jun-2000  matt Use __builtin_va_list when GCC >= 2.96
 1.8 27-Jun-2000  kleink G/c _BSD_INTPTR_T_ and _BSD_UINTPTR_T_.
 1.7 27-Apr-1998  kleink branches: 1.7.14; 1.7.22;
Provide definitions for intptr_t and uintptr_t, signed resp. unsigned integral
types large enough to hold any pointer.
 1.6 23-Nov-1997  kleink Add _BSD_SUSECONDS_T_ and _BSD_USECONDS_T_; do some space vs. tab formatting
cleanup
 1.5 15-Nov-1996  jtc Define _BSD_CLOCKID_T_ and _BSD_TIMER_T_
 1.4 16-Mar-1996  jtc Add _BSD_WINT_T_ definition so we can handle wint_t type added in NA1.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Changes to make files more 4.4/1.0B working.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file ansi.h was added on branch netbsd-1-0 on 1994-08-02 20:20:08 +0000
 1.7.22.1 28-May-2000  minoura Citrus Project XPG4DL, an implementation of I18N (locale) framework,
is imported.
 1.7.14.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.7.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.4.1 03-Aug-2001  lukem update to -current
 1.15.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.16.4.2 17-Sep-2001  simonb Only define _BSD_WCHAR_T_ once.
 1.16.4.1 17-Sep-2001  simonb file ansi.h was added on branch nathanw_sa on 2001-09-17 05:40:39 +0000
 1.17.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.18.16.2 27-Oct-2007  yamt sync with head.
 1.18.16.1 30-Dec-2006  yamt sync with head.
 1.19.22.1 22-Oct-2006  yamt sync with head
 1.19.20.1 18-Nov-2006  ad Sync with head.
 1.20.28.1 06-Nov-2007  matt sync with HEAD
 1.20.26.1 02-Oct-2007  joerg Sync with HEAD.
 1.20.22.1 10-Sep-2007  skrll Sync with HEAD.
 1.20.16.1 03-Oct-2007  garbled Sync with HEAD
 1.20.8.1 09-Oct-2007  ad Sync with head.
 1.22.28.1 19-Oct-2008  haad Sync with HEAD.
 1.22.24.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.22.22.2 11-Aug-2010  yamt sync with head.
 1.22.22.1 04-May-2009  yamt sync with head.
 1.22.18.3 01-Nov-2008  christos Sync with head.
 1.22.18.2 30-Mar-2008  christos time_t is now __int64_t
 1.22.18.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.22.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.22.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.23.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.24.6.1 30-May-2010  rmind sync with head
 1.24.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.26.54.1 10-Jun-2019  christos Sync with HEAD
 1.6 10-Dec-2002  thorpej Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.5 21-Aug-1998  ragge branches: 1.5.30;
VAX logical page size increased to 4k.
 1.4 23-Sep-1995  ragge relocation_info added.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 16-Aug-1994  ragge Minor updates of some errouneous parameters.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.5.30.1 11-Dec-2002  thorpej Sync with HEAD.
 1.30 06-Jan-2025  martin PR 58960: fix misunderstanding in semantic and provide both the original
id string as well as _NETBSD_REVISIONID.
Do not rely on string concatenation in the inline assembler, use .ascii
and .asciz for individual string parts instead.
 1.29 04-Jan-2025  martin PR 58960: vax/asm.h: Respect NETBSD_REVISIONID.
 1.28 17-Apr-2020  joerg branches: 1.28.26;
Mark the .ident section as mergable string section to avoid redundant
entries.
 1.27 25-Apr-2018  ragge branches: 1.27.2; 1.27.12;
Add __KERNEL_RCSID() macro.
 1.26 01-Jun-2012  matt branches: 1.26.38;
Really fix polyf/polyd macros. Now returns expected results.
 1.25 29-May-2012  matt Remove an unneeded indirect access from polyd/polyf macros
 1.24 28-Jul-2011  matt branches: 1.24.2; 1.24.6; 1.24.8;
Add macros for polyd and polyf
 1.23 25-Jan-2011  matt Align functions on 4 byte boundaries, not 16.
Add END(x) for function sizing.
 1.22 20-Dec-2010  joerg branches: 1.22.2; 1.22.4;
Consistently use .gnu.warning with .pushsectio and .popsection on all
architectures instead of obsolete STABS frames for linker warnings.
 1.21 31-Aug-2008  mrg branches: 1.21.16;
remove a strain # endif from the previous commit.
 1.20 29-Aug-2008  matt Drop support for compiling a.out kernel. Elves rule!
 1.19 13-Apr-2008  matt branches: 1.19.4; 1.19.6; 1.19.10;
Put RCSIDs in section ".ident"
 1.18 20-Jan-2006  christos branches: 1.18.72;
Add a STRONG_ALIAS macro
 1.17 11-Dec-2005  christos branches: 1.17.2;
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 02-Oct-2002  thorpej branches: 1.15.6;
Use the register prefix in the ELF case in _PROF_PROLOGUE.
 1.14 03-Jul-2000  matt branches: 1.14.4; 1.14.8; 1.14.18;
Revert WEAK_ALIAS back to ELF only.
Change ALTENTRY so there is no change of alignment or section
 1.13 03-Jul-2000  matt Rework ALTENTRY a bit.
 1.12 01-Jul-2000  matt a.out allow weak symbols too.
 1.11 27-Jun-2000  matt Add ELF support.
 1.10 23-Jun-2000  kleink Add a WEAK_ALIAS() macro.
 1.9 15-Jan-1999  bouyer branches: 1.9.8; 1.9.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.8 02-Dec-1998  thorpej Argh, fix the ANSI CPP version of the a.out WARN_REFERENCES().
 1.7 02-Dec-1998  thorpej Implement WARN_REFERENCES().
 1.6 15-Oct-1998  matt Add .type pseudo-ops needed for shared libraries.
 1.5 30-Nov-1996  jtc PROF -> GPROF
 1.4 06-Jan-1996  ragge Changed to work correctly with both K&R and ANSI cpp.
 1.3 03-May-1995  ragge mtpr support for 11/780 added. DELAY added. mcount() corrected.
trapframe fixed to support all registers.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file asm.h was added on branch netbsd-1-0 on 1994-08-02 20:20:11 +0000
 1.9.18.1 25-Jul-2000  kleink Pull up rev. 1.10 (approved by thorpej):
For ELF, add a WEAK_ALIAS() macro.
 1.9.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.18.1 07-Dec-2002  he Pull up revision 1.15 (requested by thorpej in ticket #894):
Use the register prefix in the ELF case in _PROF_PROLOGUE.
 1.14.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.14.8.1 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.14.4.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.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.17.2.1 01-Feb-2006  yamt sync with head.
 1.18.72.2 28-Sep-2008  mjf Sync with HEAD.
 1.18.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.19.10.1 19-Oct-2008  haad Sync with HEAD.
 1.19.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.19.4.1 04-May-2009  yamt sync with head.
 1.21.16.1 05-Mar-2011  rmind sync with head
 1.22.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.22.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.24.8.2 11-Jun-2012  riz Pull up following revision(s) (requested by abs in ticket #298):
sys/arch/vax/include/asm.h: revision 1.26
Really fix polyf/polyd macros. Now returns expected results.
 1.24.8.1 11-Jun-2012  riz Pull up following revision(s) (requested by martin in ticket #293):
sys/arch/vax/include/asm.h: revision 1.25
Remove an unneeded indirect access from polyd/polyf macros
 1.24.6.1 02-Jun-2012  mrg sync to latest -current.
 1.24.2.1 30-Oct-2012  yamt sync with head
 1.26.38.1 02-May-2018  pgoyette Synch with HEAD
 1.27.12.1 20-Apr-2020  bouyer Sync with HEAD
 1.27.2.1 21-Apr-2020  martin Sync with HEAD
 1.28.26.1 02-Aug-2025  perseant Sync with HEAD
 1.2 20-Dec-2014  jklos Remove autoconf.h include from am7930.c as per Matt Thomas so
vax/include/autoconf.h isn't necessary.
 1.1 20-Dec-2014  jklos Added as a placeholder so kernels compile until a better fix is found.
 1.4 31-Jan-2006  dsl Change sys/arch/xxx/include/bswap.h to #include machine/byte_swap.h then
sys/bswap.h in order to pick up the MD inline routines and the constant
folding definitions in the right order.
Code can include either sys/bswap.h or machine/bswap.h with the same effect.
 1.3 27-May-2000  ragge branches: 1.3.42; 1.3.54;
Use machine instead of vax in include path.
 1.2 21-Aug-1999  simonb branches: 1.2.2; 1.2.10;
Include <sys/bswap.h> for function prototypes. i386, pc532 and vax
still include <machine/byte_swap.h> and define macros for some of
the bswap*() functions.
 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.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.54.1 01-Feb-2006  yamt sync with head.
 1.3.42.1 21-Jun-2006  yamt sync with head.
 1.36 23-Jan-2021  christos Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.
 1.35 24-Sep-2019  maya branches: 1.35.8;
Avoid duplicate PRIxBUSADDR and follow the likely intention, providing PRIxBSH.
 1.34 23-Sep-2019  skrll Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
 1.33 22-Apr-2016  christos branches: 1.33.18;
Elide unused variable warnings (Felix Deichmann)
 1.32 05-Jul-2015  matt Hooks needed for QVSS support
 1.31 28-Apr-2008  martin branches: 1.31.44; 1.31.64;
Remove clause 3 and 4 from TNF licenses
 1.30 11-Mar-2008  matt branches: 1.30.2; 1.30.4;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.29 03-Feb-2008  matt branches: 1.29.2; 1.29.6;
change all u_int{8,16,32}_t to uint{8,16,32}_t
 1.28 04-Mar-2007  christos branches: 1.28.20; 1.28.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.27 21-Feb-2007  mrg add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
bus_addr_t min_addr,
bus_addr_t max_addr,
bus_dma_tag_t *newtag,
int flags)
void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to. this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
 1.26 16-Feb-2006  perry branches: 1.26.20;
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.25 24-Dec-2005  perry branches: 1.25.2; 1.25.4; 1.25.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.24 11-Dec-2005  christos merge ktrace-lwp.
 1.23 09-Mar-2005  matt branches: 1.23.4;
Add a dm_maxsegsz public member to bus_dmamap_t. This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create). dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.
 1.22 15-Jun-2003  fvdl branches: 1.22.2; 1.22.10; 1.22.12;
Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
 1.21 28-Jan-2003  kent Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it.
 1.20 01-Dec-2002  matt Add multiple inclusion protection.
 1.19 15-Nov-2002  ragge Fix vax_mem_read_region_{2,4} bug, by der Mouse (mouse@Rodents.Montreal.QC.CA).
 1.18 16-Sep-2001  ragge branches: 1.18.4;
Add bus_space_mmap().
 1.17 19-Jul-2001  thorpej branches: 1.17.2;
Add BUS_DMA_READ and BUS_DMA_WRITE flags, that hint the back-end
at dmamap load time that the mapping will be used for a unidirectional
transfer of the specified direction.
 1.16 21-Jun-2001  wiz branches: 1.16.2;
constraint, not contraint.
 1.15 07-Mar-2001  thorpej Add the BUS_DMA_STREAMING flag.
 1.14 26-Jun-2000  simonb branches: 1.14.2;
Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.13 04-Jun-2000  ragge branches: 1.13.2;
Forward declaration of `struct proc'.
 1.12 10-Apr-2000  matt branches: 1.12.2;
Add fix for VS4000 SCSI hangs on disk writes. Add a VAX_BUS_DMA_SPILLPAGE
and use it in the asc_vsbus driver.
 1.11 15-Mar-2000  drochner explicitely #include <sys/systm.h> #if BUS_SPACE_DEBUG to get a printf()
prototype
 1.10 05-Mar-2000  matt fix bug in bus_space_subregion
 1.9 25-Jan-2000  drochner define a "BUS_SPACE_MAP_PREFETCHABLE" flag which basically means that
device accesses are idempotent (but should not be cached by the CPU)
 1.8 18-Jun-1999  cgd branches: 1.8.2;
nuke current definitions provided by __BUS_SPACE_COMPAT_OLDDEFS.
I'll do what I can to make new ones soon. 8-)
 1.7 06-Jun-1999  ragge Add an define for SGMAP.
 1.6 24-May-1999  ragge bus.h'ify more of the vax code.
 1.5 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.4 23-Mar-1999  drochner branches: 1.4.4;
Add a macro to check for sufficient pointer alignment in bus.h context,
"BUS_SPACE_ALIGNED_POINTER()".
Equal to the param.h "ALIGNED_POINTER()" normally, but obeys additional
requirements of the bus_space_xxx_n() macros. (BUS_SPACE_DEBUG)
 1.3 09-Oct-1998  matt Fix some old mistakes when I originally committed this.
 1.2 30-Aug-1998  cgd don't define __BUS_SPACE_COMPAT_OLDDEFS by default. As stated in
bus_space(9), if drivers want it (they shouldn't; easy to convert) they
can define it right before including bus.h. There's been a release since
the interfaces were (slightly) changed, and no code in the source tree
uses the old interfaces as far as I can tell.
 1.1 18-Aug-1998  matt Initial steps to getting the VAX to use the MI driver framework.
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.8.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.13.2.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.14.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.16.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.2.1 03-Aug-2001  lukem update to -current
 1.17.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.18.4.2 11-Dec-2002  thorpej Sync with HEAD.
 1.18.4.1 16-Sep-2001  thorpej file bus.h was added on branch nathanw_sa on 2002-12-11 06:12:38 +0000
 1.22.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.22.10.1 29-Apr-2005  kent sync with -current
 1.22.2.1 01-Apr-2005  skrll Sync with HEAD.
 1.23.4.4 17-Mar-2008  yamt sync with head.
 1.23.4.3 04-Feb-2008  yamt sync with head.
 1.23.4.2 03-Sep-2007  yamt sync with head.
 1.23.4.1 26-Feb-2007  yamt sync with head.
 1.25.6.1 22-Apr-2006  simonb Sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.25.2.1 18-Feb-2006  yamt sync with head.
 1.26.20.2 12-Mar-2007  rmind Sync with HEAD.
 1.26.20.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.28.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.28.20.1 23-Mar-2008  matt sync with HEAD
 1.29.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.29.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.29.2.1 24-Mar-2008  keiichi sync with head.
 1.30.4.1 16-May-2008  yamt sync with head.
 1.30.2.1 18-May-2008  yamt sync with head.
 1.31.64.2 29-May-2016  skrll Sync with HEAD
 1.31.64.1 22-Sep-2015  skrll Sync with HEAD
 1.31.44.1 03-Dec-2017  jdolecek update from HEAD
 1.33.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.35.8.1 03-Apr-2021  thorpej Sync with HEAD.
 1.12 14-Jan-2017  christos cast return value
 1.11 17-Feb-2006  skrll branches: 1.11.116; 1.11.136; 1.11.140;
Remove duplicate #include <sys/types.h>
 1.10 30-Jan-2006  dsl branches: 1.10.2; 1.10.4;
Move all the stuff that detects bswapxx(constant) into the MI sys/bswap.h
Put the minimum to define the required inline assembler or C into the MD files.
NB: there may be some fallout from this!
 1.9 28-Dec-2005  perry branches: 1.9.2;
inline -> __inline
 1.8 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 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 24-Feb-2002  matt branches: 1.5.16;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.4 23-Dec-2001  matt #include <sys/types.h> in case this is included before that was.
 1.3 29-Nov-2001  thorpej Use inline functions for the byte swap routines. Allows libc to build
again (-Wshadow).
 1.2 01-Jul-2000  matt branches: 1.2.4; 1.2.8;
GCC 2.96 wants the = constraint first. Older gcc(s) don't care.
 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 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.16.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.9.2.2 18-Feb-2006  yamt sync with head.
 1.9.2.1 01-Feb-2006  yamt sync with head.
 1.10.4.1 22-Apr-2006  simonb Sync with head.
 1.10.2.1 09-Sep-2006  rpaulo sync with head
 1.11.140.1 20-Mar-2017  pgoyette Sync with HEAD
 1.11.136.1 05-Feb-2017  skrll Sync with HEAD
 1.11.116.1 03-Dec-2017  jdolecek update from HEAD
 1.3 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.2 11-Mar-2008  matt branches: 1.2.48; 1.2.68;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.1 06-Jul-2000  ragge branches: 1.1.2; 1.1.42; 1.1.104; 1.1.124; 1.1.128;
Console Communication Area (CCA) layout description.
Used on for example VAX 6000 machines.
 1.1.128.1 03-Apr-2008  mjf Sync with HEAD.
 1.1.124.1 24-Mar-2008  keiichi sync with head.
 1.1.104.1 23-Mar-2008  matt sync with HEAD
 1.1.42.1 17-Mar-2008  yamt sync with head.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 06-Jul-2000  bouyer file cca.h was added on branch thorpej_scsipi on 2000-11-20 20:32:48 +0000
 1.2.68.1 28-Aug-2017  skrll Sync with HEAD
 1.2.48.1 03-Dec-2017  jdolecek update from HEAD
 1.7 20-Jan-2012  joerg Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressions
again. This was changed in sys/socket.h r1.51 to work around fallout
from the IPv6 aux data migration. It broke the historic ABI on some
platforms. This commit restores compatibility for netbsd32 code on such
platforms and provides a template for future changes to the CMSG_*
alignment. Revert PCC/Clang workarounds in postfix and tmux.
 1.6 20-Mar-1999  thorpej branches: 1.6.182; 1.6.186;
Garbage-collect.
 1.5 22-Aug-1998  ragge Must #define __warn_references if not GNUC.
 1.4 04-Nov-1997  thorpej Bug fixes and cleanup from Chris Demetriou <cgd@pa.dec.com>:
- fix _C_LABEL so that it actually works.
- make __RENAME use _C_LABEL.
- fix __RENAME so that it expects an unquoted argument.
- fix __indr_reference and __warn_references so that they
supply their own final semicolon.
- define __warn_references to nothing if not GNU C (required
by the way it's used).

The __warn_references semicolon change has to be made
so that __warn_references can be defined into nothing.
(A ; all by itself isn't a great idea.) The __indr_reference
change was made for consistency.
 1.3 22-Oct-1997  thorpej Implement __RENAME() in <machine/cdefs.h>
 1.2 23-Mar-1995  jtc branches: 1.2.18;
Changed name of __weak_reference() to __indr_reference(). They really
are indirect references, and I want to add a real __weak_reference()
macro to <machine/cdefs.h> soon.
 1.1 19-Jan-1995  jtc This file, which will be included by <sys/cdefs.h>, will contain macros
such as __warn_references() and __weak_reference() which are actually
machine dependant. This will make it easier for ports that are being
bootstraped with ELF and ECOFF based toolchains.

This change also introduces a new macro, _C_LABEL(x). _C_LABEL expands
its argument, an identifier, to a character string of the identifier
name as it is represented in an object file.

For most ports, _C_LABEL(x) will expand to "_x", for ELF based ports
_C_LABEL(x) will expand to "x".
 1.2.18.2 04-Nov-1997  thorpej Pull up from trunk: bug fixes and cleaups.
 1.2.18.1 22-Oct-1997  thorpej Pull up from trunk: Implement __RENAME() in <machine/cdefs.h>
 1.6.186.1 18-Feb-2012  mrg merge to -current.
 1.6.182.1 17-Apr-2012  yamt sync with head
 1.10 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.9 17-Nov-2014  christos branches: 1.9.2;
PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.
 1.8 19-Nov-2010  uwe branches: 1.8.18;
Correct definition of leap year. Make yeartonum and numtoyear use
full years so that year 2000 is correctly counted as a leap year.

Now NetBSD under SIMH picks up correct time-of-day clock value. It
used to be a day behind, since 2000 - 1900 = 100 and naive leap year
test wouldn't count it as a leap year.
 1.7 12-Dec-2009  tsutsui branches: 1.7.4;
Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
 1.6 05-Sep-2006  matt branches: 1.6.60; 1.6.70;
Switch VAX over to generic TODR
 1.5 26-Jul-2000  ragge branches: 1.5.40; 1.5.54; 1.5.58;
Make yeartonum/numtoyear visible.
 1.4 06-Sep-1999  ragge branches: 1.4.2;
Styr upp deklarationen av clockchippsparametrarna.
 1.3 30-Aug-1999  ragge Add some external variables.
 1.2 04-May-1997  ragge Oops, I forgot to check this file in after clock changes.
 1.1 20-Jul-1996  ragge Reworked time handling; now also handles clock chip CPUs correctly.
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.58.1 14-Sep-2006  yamt sync with head.
 1.5.54.1 09-Sep-2006  rpaulo sync with head
 1.5.40.1 30-Dec-2006  yamt sync with head.
 1.6.70.1 07-Jan-2011  riz Pull up following revision(s) (requested by uwe in ticket #1500):
sys/arch/vax/vax/clock.c: revision 1.54
sys/arch/vax/include/clock.h: revision 1.8
Correct definition of leap year. Make yeartonum and numtoyear use
full years so that year 2000 is correctly counted as a leap year.
Now NetBSD under SIMH picks up correct time-of-day clock value. It
used to be a day behind, since 2000 - 1900 = 100 and naive leap year
test wouldn't count it as a leap year.
 1.6.60.1 11-Mar-2010  yamt sync with head
 1.7.4.1 05-Mar-2011  rmind sync with head
 1.8.18.1 03-Dec-2017  jdolecek update from HEAD
 1.9.2.1 28-Aug-2017  skrll Sync with HEAD
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 04-Jun-2000  matt branches: 1.1.4; 1.1.6; 1.1.132; 1.1.134; 1.1.136;
Add coff_machdep.h (now need due to the recent exec_coff changes).
 1.1.136.1 16-May-2008  yamt sync with head.
 1.1.134.1 18-May-2008  yamt sync with head.
 1.1.132.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 04-Jun-2000  bouyer file coff_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:32:49 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 04-Jun-2000  minoura file coff_machdep.h was added on branch minoura-xpg4dl on 2000-06-22 17:05:05 +0000
 1.108 19-Dec-2023  kalvisd vax: PR port-vax/55415

Remove VAX-specific workaround to force pre-emption, as it is now
no longer needed.

tested by oster@
 1.107 10-Sep-2023  oster With the overhaul of the scheduler code the semantics of
ci_want_resched have changed, and for some reason vax
still requires ci_want_resched set to 1 in order to do
preemption. This commit contains a workaround for the
preemption issued discussed in PR#55415.

XXX pullup-10
 1.106 11-Dec-2022  oster branches: 1.106.2;

Support save/restore of AST levels in the PCB for context switching.

Code written by ragge@ , tested by oster@.
 1.105 14-Aug-2021  ryo Improved the performance of kernel profiling on MULTIPROCESSOR, and possible to get profiling data for each CPU.

In the current implementation, locks are acquired at the entrance of the mcount
internal function, so the higher the number of cores, the more lock conflict
occurs, making profiling performance in a MULTIPROCESSOR environment unusable
and slow. Profiling buffers has been changed to be reserved for each CPU,
improving profiling performance in MP by several to several dozen times.

- Eliminated cpu_simple_lock in mcount internal function, using per-CPU buffers.
- Add ci_gmon member to struct cpu_info of each MP arch.
- Add kern.profiling.percpu node in sysctl tree.
- Add new -c <cpuid> option to kgmon(8) to specify the cpuid, like openbsd.
For compatibility, if the -c option is not specified, the entire system can be
operated as before, and the -p option will get the total profiling data for
all CPUs.
 1.104 01-Dec-2019  ad Fix false sharing problems with cpu_info. Identified with tprof(8).
This was a very nice win in my tests on a 48 CPU box.

- Reorganise cpu_data slightly according to usage.
- Put cpu_onproc into struct cpu_info alongside ci_curlwp (now is ci_onproc).
- On x86, put some items in their own cache lines according to usage, like
the IPI bitmask and ci_want_resched.
 1.103 23-Nov-2019  ad cpu_need_resched():

- Remove all code that should be MI, leaving the bare minimum under arch/.
- Make the required actions very explicit.
- Pass in LWP pointer for convenience.
- When a trap is required on another CPU, have the IPI set it locally.
- Expunge cpu_did_resched().
 1.102 22-Aug-2018  msaitoh - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
- Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
use them on all m68k machines.
 1.101 16-Jun-2017  jdolecek branches: 1.101.4; 1.101.6;
dumpconf(void) long doesn't exist, remove the prototype

PR kern/39714 by Henning Petersen
 1.100 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.99 19-May-2014  rmind branches: 1.99.4;
Implement MI IPI interface with cross-call support.
 1.98 10-Nov-2013  christos branches: 1.98.2;
use __unused instead of __USE and void cast to mark iterator variable unused
where needed (from phone)
 1.97 09-Nov-2013  christos __USE cii
 1.96 19-Oct-2013  christos make cpu_need_resched() macros consistent; __USE flags
 1.95 27-Oct-2012  chs branches: 1.95.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.94 27-Feb-2012  matt branches: 1.94.2;
Change cpu_idle to be an inline which sets IPL to 1 and then back to 0
so simh can recognize the kernel is idle.
 1.93 05-Jun-2011  matt branches: 1.93.2; 1.93.6; 1.93.8;
device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.92 14-Apr-2011  matt branches: 1.92.2;
Support LWP_PC
 1.91 14-Dec-2010  matt branches: 1.91.2;
Switch to use <sys/device_if.h>
 1.90 13-Nov-2010  matt Implement CAS using a RAS for non-MP VAX systems. This technique uses the
atomicity of indirect addressing for correctness. It also uses the knowledge
of dereferencing an address outside the page table length will cause a PTELEN
trap. [Tested on netbsd-5]
 1.89 01-Jul-2010  ragge A big bunch of bugfixes from Johnny Billquist. Highlights:
- Makes the VAX8600 work as expected (500kg of hardware :-)
- Fix a hard-tracked bug causing VAXen to hang at splhigh.
 1.88 22-Jun-2010  rmind Implement high priority (XC_HIGHPRI) xcall(9) mechanism - a facility
to execute functions from software interrupt context, at SOFTINT_CLOCK.
Functions must be lightweight. Will be used for passive serialization.

OK ad@.
 1.87 12-Dec-2009  tsutsui branches: 1.87.2; 1.87.4;
Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
 1.86 24-Oct-2009  rmind Provide cpu_lwp_free* stubs in vax and powerpc.
Reported by <he>.
 1.85 11-Mar-2008  matt branches: 1.85.4; 1.85.14;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.84 27-Feb-2008  xtraeme Remove CTL_MACHDEP_NAMES, it's not used anywhere.

Ok by martin@.
 1.83 23-Feb-2008  matt A number of performance changes:
Change internal register SSP to contain curlwp insread curcpu(). This
shrinks the GENERIC by 2KB.
Add rwlock stubs (rw_enter, rw_exit, rw_tryenter).
Simplify simple lock code for uniprocessors.
Do SPL raise/lower in cpu_handle_ipi instead of simple_locks.
 1.82 20-Feb-2008  matt branches: 1.82.2; 1.82.6;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.81 03-Feb-2008  matt Add cpu_intr_p (checks PSL_IS in PSL).
Change badaddr to take a volatile pointer
 1.80 05-Jan-2008  ad Don't need sys/lock.h
 1.79 17-Oct-2007  garbled branches: 1.79.2; 1.79.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.78 01-Oct-2007  ad ci_need_resched -> ci_want_resched
 1.77 17-May-2007  yamt branches: 1.77.8; 1.77.10; 1.77.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.76 04-Mar-2007  christos branches: 1.76.2; 1.76.4; 1.76.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.75 16-Feb-2007  matt branches: 1.75.2;
Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.74 05-Sep-2006  matt Switch VAX over to generic TODR
 1.73 28-Mar-2006  thorpej Add a comment indicating that the cpuid (derived from the autoconfiguration
unit number of the CPU) should be cached in the cpu_info.
 1.72 11-Dec-2005  christos branches: 1.72.4; 1.72.6; 1.72.8; 1.72.10; 1.72.12;
merge ktrace-lwp.
 1.71 20-Jul-2005  he Fixes to make GENERIC.MP build again. Several changes:
o Rename global variable "tramp" to "vax_mp_tramp" to avoid warning
with -Wshadow when compiling the signal code.
o Rename a macro-local variable _s to __s in __cpu_simple_lock()
to avoid -Wshadow warning when MALLOC() is used (also declares _s).
o Follow up -Wcast-qual by making a number of function arguments const char*
where string literals are used.
 1.70 22-Sep-2004  yamt branches: 1.70.12;
move some per-cpu data definitions to MI place so that they can be modified
without touching all ports. discussed on tech-kern@.
 1.69 19-Mar-2004  matt Add CPU_INFO_INTERATOR/FOREACH support.
 1.68 22-Jan-2004  matt Add #define cpu_lwp_free do { } while (/*CONSTCOND*/0)
(VAX systems don't need to do anything in cpu_lwp_free)
 1.67 04-Jan-2004  jdolecek Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
as FPU state), and is the last potentially blocking operation;
all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
 1.66 01-Mar-2003  matt branches: 1.66.2;
Add machdep sysctl support. Support booted_device, consdev, and
printfataltraps.
 1.65 27-Feb-2003  matt Need to forward declare struct buf and struct pte for function prototypes.
 1.64 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.63 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.62 10-Mar-2002  ragge branches: 1.62.4;
Major update of the vax pmap:
- Reinstall the "dynamic page table length" that was removed some
years ago.
- Limit the user page table submap to max 5% of available memory.
- Free the page table space when a process is swapped out.
- If the UPT submap runs out of space, throw away pmap mappings
using the same algorithm as for swapping processes.

As a result of this, 4MB machines are useable again and it's even possible
to compile a kernel for 2MB machines (but it will be slow... :-)

Still to do:
- Multiprocessor fixes.
- More profiling.
 1.61 14-Jun-2001  thorpej branches: 1.61.2; 1.61.8;
Don't need to prototype child_return() here, it's in <sys/proc.h>.
 1.60 04-Jun-2001  ragge Add rudimentary multiprocessor support for DDB.
 1.59 04-Jun-2001  ragge Add IPI_TBIA to flush the translation buffer.
 1.58 03-Jun-2001  ragge Break out the MP-dependent calls. Add definitions for the IPI functions.
 1.57 30-May-2001  mrg use _KERNEL_OPT
 1.56 29-May-2001  ragge Add ci_cpuid.
Change the CLKF_ macros because the idle loop is now running at IPL1.
 1.55 02-Dec-2000  ragge branches: 1.55.2;
Add prototype.
 1.54 25-Aug-2000  thorpej Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity. Its use in
roundrobin() still needs some work.
 1.53 26-Jul-2000  ragge Add badaddr() field.
 1.52 11-Jun-2000  ragge Allow printf's from slave CPUs by stealing the v_putc function.
Easier than expected because the printout lock is hold in the higher levels.
 1.51 10-Jun-2000  ragge Code to spin up other CPUs on a VAX 8200 system.
Haven't solved the printf() problem yet, though.
 1.50 02-Jun-2000  matt Move spl macros from <machine/param.h> to <machine/intr.h>
Fix botch on my part and make the IPL_* match reality on VAX.
Redefine spl macro using the symbolic IPL_ instead of being hardcoded.
Move schedsoftnet, schedsoftclock from <machine/cpu.h> to <machine/intr.h>
Add a _setsirr macro for schedsoft*.
Add softintr function and framework.
 1.49 31-May-2000  matt Eliminate booted_from. extern'ed booted_device (for raidframe). nothing
outside autoconf.c in sys/arch/vax needs to deal with booted_device).
 1.48 29-May-2000  ragge Use the cpu_info struct to store cpu-specific data in the same way in
both uniprocessor and multiprocessor environments. Use the otherwise
unused internal CPU register SSP to store the cpu_info pointer.
The macros curcpu(), curproc, cpu_number() and need_resched() are now the
same in both uniprocessor and multiprocessor environments.
 1.47 27-May-2000  ragge Rewrite cpu_fork(), it now looks like and works as other ports' cpu_fork()
(calling child_return() etc...). Have fun, Jason!
 1.46 27-May-2000  matt branches: 1.46.2;
This need <sys/sched.h> to compile.
 1.45 26-May-2000  thorpej First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

- Global state: sched_qs (run queues), sched_whichqs (bitmap
of non-empty run queues), sched_slpque (sleep queues).
NOTE: These may collectively move into a struct schedstate
at some point in the future.

- Per-CPU state, struct schedstate_percpu: spc_runtime
(time process on this CPU started running), spc_flags
(replaces struct proc's p_schedflags), and
spc_curpriority (usrpri of processes on this CPU).

- Every platform must now supply a struct cpu_info and
a curcpu() macro. Simplify existing cpu_info declarations
where appropriate.

- All references to per-CPU scheduler state now made through
curcpu(). NOTE: this will likely be adjusted in the future
after further changes to struct proc are made.

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
 1.44 22-May-2000  matt Add prototype for findcpu in _STANDALONE.
 1.43 22-Apr-2000  ragge Ops, forgot to commit this.
 1.42 19-Mar-2000  ragge First cut of multiprocessor support for vax. Still much to do before
other CPUs than the master can spin up.
 1.41 21-Oct-1999  ragge Protect against multiple includes.
 1.40 17-Sep-1999  thorpej branches: 1.40.2; 1.40.4; 1.40.6;
Centralize the declaration and clearing of `cold'.
 1.39 10-Aug-1999  thorpej Define cpu_number() as discussed on tech-smp.
 1.38 07-Aug-1999  ragge Clean up all bus handling stuff, it has become a mess the latest years.
Add a new bus; "ibus" that is the internal MicroVAX bus.
 1.37 23-May-1999  ragge Better and more understandable way to find out CPU type.
 1.36 01-May-1999  ragge Real-time clock is started on the same way on all CPUs, there is no
need for a special CPU-dependent hook for this.
 1.35 17-Apr-1999  ragge Use "access_type" in pmap_enter() more intelligent.
Allocate device register space bigger than the logical page size
from the kernel map, thus decreasing the pre-allocated page table memory.
 1.34 02-Feb-1999  ragge branches: 1.34.4;
Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.33 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.32 27-Oct-1998  matt Latent support for revamped "local bus" support.
 1.31 06-Oct-1998  thorpej configure() prototype is in <sys/device.h>
 1.30 05-Oct-1998  thorpej cpu_set_kpc() prototype is already in <sys/systm.h>.
 1.29 10-Aug-1998  ragge Basic support for VS4000/60.
 1.28 09-Jun-1998  ragge #ifdef _KERNEL whole this file.
 1.27 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.26 13-Apr-1998  ragge Wall cleaning.
 1.25 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.24 26-Jul-1997  ragge Actually do 'halt' or 'reboot' on MicroVAX.
 1.23 15-Mar-1997  ragge Add definitions for DEC HW device numbers.
 1.22 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.21 12-Feb-1997  ragge Remove bogus prototypes.
 1.20 31-Jan-1997  thorpej branches: 1.20.4;
Update prototypes to match new calling convention of functions that
find the boot device.
 1.19 20-Jul-1996  ragge branches: 1.19.2;
Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.18 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.17 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.16 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.15 02-Mar-1996  ragge Changes due to 11/780 support. Raise splimp() to BR7.
 1.14 02-Feb-1996  mycroft Fix #includes.
 1.13 13-Dec-1995  ragge MicroVAX III support added.
 1.12 05-Jun-1995  ragge New file pcb.h. USRTEXT changed to 0x400.
 1.11 05-May-1995  ragge BROKEN_SWAP removed, swapping verified OK.
pmap_collect(pmap) added as null define.
 1.10 05-May-1995  ragge Removed cpu_set_init_frame() use.
Increased default limits of memory use, ridiculously small before.
 1.9 05-May-1995  cgd define BROKEN_SWAP and/or cpu_swapout as appropriate.
 1.8 03-May-1995  ragge mtpr support for 11/780 added. DELAY added. mcount() corrected.
trapframe fixed to support all registers.
 1.7 30-Mar-1995  ragge Some bug fixes & update of pcb.
 1.6 23-Feb-1995  ragge Def's for uVAXII added.
 1.5 13-Feb-1995  ragge Lots of fixes...
 1.4 25-Nov-1994  ragge Lots of updates & fixes.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Changes to make files more 4.4/1.0B working.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file cpu.h was added on branch netbsd-1-0 on 1994-08-02 20:20:14 +0000
 1.19.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.20.4.1 12-Mar-1997  is Merge in changes from Trunk
 1.34.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.40.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.40.4.1 15-Nov-1999  fvdl Sync with -current
 1.40.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.40.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.46.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.55.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.61.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.61.8.4 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.61.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.61.8.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.61.8.1 14-Jun-2001  ragge file cpu.h was added on branch nathanw_sa on 2002-03-29 23:31:42 +0000
 1.61.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.61.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.62.4.1 19-May-2002  gehenna Remove unnecessary prototype.
 1.66.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.66.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.66.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.66.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.66.2.1 03-Aug-2004  skrll Sync with HEAD
 1.70.12.9 17-Mar-2008  yamt sync with head.
 1.70.12.8 27-Feb-2008  yamt sync with head.
 1.70.12.7 04-Feb-2008  yamt sync with head.
 1.70.12.6 21-Jan-2008  yamt sync with head
 1.70.12.5 27-Oct-2007  yamt sync with head.
 1.70.12.4 03-Sep-2007  yamt sync with head.
 1.70.12.3 26-Feb-2007  yamt sync with head.
 1.70.12.2 30-Dec-2006  yamt sync with head.
 1.70.12.1 21-Jun-2006  yamt sync with head.
 1.72.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.72.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.72.8.2 14-Sep-2006  yamt sync with head.
 1.72.8.1 01-Apr-2006  yamt sync with head.
 1.72.6.1 22-Apr-2006  simonb Sync with head.
 1.72.4.1 09-Sep-2006  rpaulo sync with head
 1.75.2.3 07-Apr-2007  matt Remove ci_exit, remove idlepcb and exitstack.
 1.75.2.2 04-Apr-2007  matt Not quite functional idlelwp adaption for VAX. lwp fork works but the
kernel never seems to return/stay in usermode.
 1.75.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.76.10.2 03-Oct-2007  garbled Sync with HEAD
 1.76.10.1 22-May-2007  matt Update to HEAD.
 1.76.4.1 11-Jul-2007  mjf Sync with head.
 1.76.2.2 09-Oct-2007  ad Sync with head.
 1.76.2.1 27-May-2007  ad Sync with head.
 1.77.12.1 07-Oct-2007  yamt sync with head.
 1.77.10.3 23-Mar-2008  matt sync with HEAD
 1.77.10.2 09-Jan-2008  matt sync with HEAD
 1.77.10.1 06-Nov-2007  matt sync with HEAD
 1.77.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.79.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.79.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.82.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.82.2.1 24-Mar-2008  keiichi sync with head.
 1.85.14.1 22-Aug-2012  bouyer Pull up following revision(s) (requested by abs in ticket #1780):
sys/arch/vax/include/cpu.h: revision 1.94 via patch
Change cpu_idle to be an inline which sets IPL to 1 and then back to 0
so simh can recognize the kernel is idle.
 1.85.4.2 11-Aug-2010  yamt sync with head.
 1.85.4.1 11-Mar-2010  yamt sync with head
 1.87.4.4 12-Jun-2011  rmind sync with head
 1.87.4.3 21-Apr-2011  rmind sync with head
 1.87.4.2 05-Mar-2011  rmind sync with head
 1.87.4.1 03-Jul-2010  rmind sync with head
 1.87.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.91.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.92.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.93.8.1 12-Jul-2012  riz Pull up following revision(s) (requested by abs in ticket #407):
sys/arch/vax/include/cpu.h: revision 1.94
Change cpu_idle to be an inline which sets IPL to 1 and then back to 0
so simh can recognize the kernel is idle.
 1.93.6.3 06-Mar-2012  mrg sync to -current
 1.93.6.2 06-Mar-2012  mrg sync to -current
 1.93.6.1 04-Mar-2012  mrg sync to latest -current.
 1.93.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.93.2.2 30-Oct-2012  yamt sync with head
 1.93.2.1 17-Apr-2012  yamt sync with head
 1.94.2.3 03-Dec-2017  jdolecek update from HEAD
 1.94.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.94.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.95.2.1 18-May-2014  rmind sync with head
 1.98.2.1 10-Aug-2014  tls Rebase.
 1.99.4.1 28-Aug-2017  skrll Sync with HEAD
 1.101.6.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.101.6.1 10-Jun-2019  christos Sync with HEAD
 1.101.4.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.106.2.2 19-Dec-2023  martin Pull up following revision(s) (requested by kalvisd in ticket #509):

sys/arch/vax/include/cpu.h: revision 1.108

vax: PR port-vax/55415

Remove VAX-specific workaround to force pre-emption, as it is now
no longer needed.

tested by oster@
 1.106.2.1 11-Sep-2023  martin Pull up following revision(s) (requested by oster in ticket #365):

sys/arch/vax/include/cpu.h: revision 1.107

With the overhaul of the scheduler code the semantics of
ci_want_resched have changed, and for some reason vax
still requires ci_want_resched set to 1 in order to do
preemption. This commit contains a workaround for the
preemption issued discussed in PR#55415.
 1.21 22-Mar-2025  hans vax/ddb(4): clean up machine dependent code and improve usability

First, let's garbage collect some dead code wrapped in #if 0/#endif
that were introduced in back in 1999 in revision 1.17 of db_machdep.c,
when VAX stack tracing was last reworked. There's also an unused
argument "stackbase" in db_dump_stack() that can go away.

Next, fix stack tracing on panic. The panicstr has already been printed
by the time we get here from db_panic(), and at least on !MULTIPROCESSOR
the panic stack trace caused a recursive panic immediately. While here,
add tracing by lwp and proc addresses. The code for tracing a process or
lwp should live in its own function, and we can rearrange the logic in
db_stack_trace_print() to be a bit clearer.

While here, add some basic memory access checks so we don't suffer
from recursive panics all the time. For the same reason, get the
process with db_find_proc() rather than proc_find_raw().
 1.20 06-Nov-2017  christos branches: 1.20.34; 1.20.40;
Cleanup and clarify the ELFSIZE mess:

We now have 2 variables automatically set in elf_machdep.h:

ARCH_ELFSIZE: the size for userland binaries
KERN_ELFSIZE: the size for the kernel binaries

DB_ELFSIZE has been deleted and KERN_ELFSIZE should have always the
same values DB_ELFSIZE used to have.

In sys/exec_elf.h, if ELFSIZE is not set, it is set to KERN_ELFSIZE
for the kernel and ARCH_ELFSIZE for userland. These defaults should
eliminate the need for most manual ELFSIZE setting.
 1.19 03-Jul-2011  matt branches: 1.19.12;
Cleanup trapframe handling. Instead of keeping a trapframe pointer in the
pcb, put in the mdlwp instead. We had a dummy field so it didn't grow in
size. This also follows the practice that mips and powerpc follow that a
pointer to the user trapframe is in l->l_md.md_utf. Make trapframe members
start with tf_
 1.18 26-May-2011  joerg Introduce DDB_EXPR_FMT and replace the logic around DB_EXPR_T_IS_QUAD.
 1.17 06-Nov-2010  uebayasi branches: 1.17.2;
Machine dependent code is considered as part of UVM. Include
internal API header.
 1.16 29-Aug-2008  matt branches: 1.16.14; 1.16.16;
Drop support for compiling a.out kernel. Elves rule!
 1.15 11-Mar-2008  matt branches: 1.15.4; 1.15.6; 1.15.10;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.14 01-Apr-2006  cherry branches: 1.14.38; 1.14.58; 1.14.62;
closes: PR kern/32359

modifies machine/db_machdep.h: BKPT_SET(inst) to BKPT_SET(inst, addr) for all archs ie; passess the
breakpoint address as well.

Patch from cherry@mahiti.org
 1.13 12-Mar-2006  matt branches: 1.13.2;
Fix various places where assignment happen to casted lvalues.
(t)v = foo; is not legal C.
 1.12 29-Apr-2003  scw branches: 1.12.18; 1.12.32; 1.12.34; 1.12.36; 1.12.38;
Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
 1.11 13-May-2002  matt Nuke local extern label_t *db_recover; it's now in <ddb/db_extern.h>
 1.10 04-Jun-2001  ragge branches: 1.10.2; 1.10.8;
Add rudimentary multiprocessor support for DDB.
 1.9 02-May-2001  matt Include ELF symbol in DDB is we are an ELF kernel.
 1.8 29-Jun-2000  mrg branches: 1.8.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.7 04-Mar-2000  matt expunge vm_offset_t and vm_size_t.
add bus_dma support for the vs4000 dma translation map (sgmap).
enhance the vsbus for the lance to work with it.
remove the sgmap init code from ka46/48/49.c
 1.6 10-Aug-1998  ragge branches: 1.6.12;
Basic support for VS4000/60.
 1.5 13-Apr-1998  ragge Wall cleaning.
 1.4 26-Jun-1997  thorpej #define DB_AOUT_SYMBOLS
 1.3 06-Feb-1997  gwr FIXUP_PC_AFTER_BREAK now takes an arg of type db_regs_t *
 1.2 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.1 16-Jun-1995  ragge DDB support. splddb() and trapcode for ddb.
 1.6.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.10.8.1 04-Jun-2001  nathanw file db_machdep.h was added on branch nathanw_sa on 2002-06-20 03:42:12 +0000
 1.10.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.38.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.12.36.2 11-Apr-2006  yamt sync with head
 1.12.36.1 13-Mar-2006  yamt sync with head.
 1.12.34.1 22-Apr-2006  simonb Sync with head.
 1.12.32.1 09-Sep-2006  rpaulo sync with head
 1.12.18.2 17-Mar-2008  yamt sync with head.
 1.12.18.1 21-Jun-2006  yamt sync with head.
 1.13.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.14.62.2 28-Sep-2008  mjf Sync with HEAD.
 1.14.62.1 03-Apr-2008  mjf Sync with HEAD.
 1.14.58.1 24-Mar-2008  keiichi sync with head.
 1.14.38.1 23-Mar-2008  matt sync with HEAD
 1.15.10.1 19-Oct-2008  haad Sync with HEAD.
 1.15.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.15.4.1 04-May-2009  yamt sync with head.
 1.16.16.2 31-May-2011  rmind sync with head
 1.16.16.1 05-Mar-2011  rmind sync with head
 1.16.14.1 27-May-2010  uebayasi Fix build.
 1.17.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.12.1 03-Dec-2017  jdolecek update from HEAD
 1.20.40.1 02-Aug-2025  perseant Sync with HEAD
 1.20.34.1 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1085):

sys/arch/vax/vax/db_disasm.c: revision 1.26
sys/arch/vax/vax/db_machdep.c: revision 1.61
sys/arch/vax/vax/trap.c: revision 1.140
sys/arch/vax/include/db_machdep.h: revision 1.21

vax/ddb(4): clean up machine dependent code and improve usability

First, let's garbage collect some dead code wrapped in #if 0/#endif
that were introduced in back in 1999 in revision 1.17 of db_machdep.c,
when VAX stack tracing was last reworked. There's also an unused
argument "stackbase" in db_dump_stack() that can go away.

Next, fix stack tracing on panic. The panicstr has already been printed
by the time we get here from db_panic(), and at least on !MULTIPROCESSOR
the panic stack trace caused a recursive panic immediately. While here,
add tracing by lwp and proc addresses. The code for tracing a process or
lwp should live in its own function, and we can rearrange the logic in
db_stack_trace_print() to be a bit clearer.

While here, add some basic memory access checks so we don't suffer
from recursive panics all the time. For the same reason, get the
process with db_find_proc() rather than proc_find_raw().
 1.8 21-Aug-2021  andvar s/helt/held+s/eroneously/erroneously/+s/splitted/split/+s/recommented/recommended/
 1.7 04-Apr-2013  martin Drop MAXPARTITIONS down to 12 - we do not have more space to store a
larger disklabel in the bootblocks at least on some supported machines.
Keep the extended major/minor sheme compatible with the 6.0 release and
note that we had a bigger MAXPARTITIONS in between.
 1.6 02-Jul-2012  abs branches: 1.6.2;
- Increase MAXPARTITIONS for vax from 8 to 16, using the standard NetBSD
mechanism to ensure all existing /dev nodes continue to work
- Adjust boot block layout to fit additional partitions
- Adjust number of inodes on install media
 1.5 30-Aug-2011  bouyer branches: 1.5.2; 1.5.8;
Add getlabelusesmbr(), as proposed in
http://mail-index.netbsd.org/tech-userlevel/2011/08/25/msg005404.html
This is used by disk tools such as disklabel(8) to dynamically decide is
the undelyling platform uses a disklabel-in-mbr-partition or not
(instead of using a compile-time list of ports).
getlabelusesmbr() reads the sysctl kern.labelusesmbr, takes its value from the
machdep #define LABELUSESMBR.
For evbmips, make LABELUSESMBR 1 if the platform uses pmon
as bootloader, and 0 (the previous value) otherwise.
 1.4 09-Mar-1997  ragge Fixed bug that caused d partition being treated as c.
RAW_PART is 2, not 3.
 1.3 01-Feb-1996  mycroft branches: 1.3.8;
LOCORE -> _LOCORE
 1.2 03-May-1995  ragge mtpr support for 11/780 added. DELAY added. mcount() corrected.
trapframe fixed to support all registers.
 1.1 14-Oct-1994  cgd move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS.
 1.3.8.1 12-Mar-1997  is Merge in changes from Trunk
 1.5.8.2 20-Apr-2013  bouyer Pull up following revision(s) (requested by martin in ticket #865):
sys/arch/vax/include/disklabel.h: revision 1.7
sys/arch/vax/boot/xxboot/start.S: revision 1.5
sys/sys/bootblock.h: revision 1.55
sys/sys/disklabel.h: revision 1.113
usr.sbin/installboot/arch/vax.c: revision 1.14
usr.sbin/installboot/arch/vax.c: revision 1.15
sys/kern/sys_generic.c: revision 1.129
Revert VAX MAXPARTITION bump to 16, adjusting it to 12 instead. Fix bootblocks
and installboot for VAX 780 and other machines booting via VMB.EXE.
 1.5.8.1 05-Jul-2012  riz Pull up following revision(s) (requested by abs in ticket #403):
sys/arch/vax/include/disklabel.h: revision 1.6
sys/sys/bootblock.h: revision 1.54
sys/arch/vax/include/types.h: revision 1.46
distrib/vax/miniroot/Makefile.inc: revision 1.21
- Increase MAXPARTITIONS for vax from 8 to 16, using the standard NetBSD
mechanism to ensure all existing /dev nodes continue to work
- Adjust boot block layout to fit additional partitions
- Adjust number of inodes on install media
 1.5.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.6.2.1 23-Jun-2013  tls resync from head
 1.6 06-Nov-2017  christos Cleanup and clarify the ELFSIZE mess:

We now have 2 variables automatically set in elf_machdep.h:

ARCH_ELFSIZE: the size for userland binaries
KERN_ELFSIZE: the size for the kernel binaries

DB_ELFSIZE has been deleted and KERN_ELFSIZE should have always the
same values DB_ELFSIZE used to have.

In sys/exec_elf.h, if ELFSIZE is not set, it is set to KERN_ELFSIZE
for the kernel and ARCH_ELFSIZE for userland. These defaults should
eliminate the need for most manual ELFSIZE setting.
 1.5 09-Dec-2001  thorpej branches: 1.5.166;
Add support for dumping ELF-cormat core files.
 1.4 13-Jul-2000  matt branches: 1.4.4; 1.4.8;
Reflect the new reality.
 1.3 02-Apr-2000  minoura Move dl* function definitions to libc on ELF.
Based on the patch supplied by Takuya Shiozaki <tshiozak@astec.co.jp>.
See http://mail-index.netbsd.org/tech-userlevel/2000/02/23/0000.html.
 1.2 25-Oct-1999  kleink Update to match new SVR4-style definition names in <sys/exec_elf.h>.
 1.1 21-Aug-1999  matt branches: 1.1.2; 1.1.4; 1.1.6;
Initial VAX ELF32 support (mostly untested). It's checked primarily for
testing and archival for now. I don't expect anyone to work with it
since the binutils and gas changes are still pending. But you got to
crawl before you walk.
 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.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.166.1 03-Dec-2017  jdolecek update from HEAD
 1.17 17-Mar-2000  mycroft In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.16 16-Mar-2000  mycroft Foolish consistency. Mainly, always use underscores and sys/endian.h.
 1.15 21-Aug-1999  simonb branches: 1.15.2;
Include <sys/endian.h> after defining whether where are little- or
big-endian. i386, pc532 and vax still include <machine/byte_swap.h>
and define macros for the {n,h}to{h,n}*() functions. mips also
defines some endian-independent assembly-code aliases for unaligned
memory accesses.
 1.14 24-Jan-1999  mycroft Mark [hn]to[nh][ls]() with __const__, so they are subject to CSE.
 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 16-Dec-1998  kleink Support for compound statements enclosed in parenthes to appear as
expressions is a GNU C extension; mark as such them with __extension__ to
suppress portability warnings. Addresses kern/3562 and misc/6185, as suggested
by Dave Sainty <dave@dtsp.co.nz>.
 1.11 07-Nov-1998  ragge EGCS fixes. Implement htons as a C macro instead of asm; generates as
good code as the asm implementation _and_ can be optimized.
 1.10 08-Aug-1998  ragge Lots of kernlib functions rewritten as inline macros.
 1.9 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.8 13-Oct-1996  christos branches: 1.8.10;
use in_addr_t and in_port_t
 1.7 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.6 21-Aug-1995  ragge Bug fix in byte_swap_word(); didn't always make it.
 1.5 05-Jul-1995  ragge nton?/ntoh? moved to endian.h.
 1.4 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.3 13-Feb-1995  ragge Lots of fixes...
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file endian.h was added on branch netbsd-1-0 on 1994-08-02 20:20:18 +0000
 1.8.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3 30-Jan-2006  dsl Move the definitions of ntohl() and friends into sys/endian.h where they
are defined in terms of bswap32() and bswap16().
This makes the definition be in the same place for all systems regardless
of creed^Wendianness.
 1.2 27-May-2000  ragge branches: 1.2.4; 1.2.44; 1.2.56;
Use machine instead of vax in include path.
 1.1 17-Mar-2000  mycroft branches: 1.1.2;
In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.56.1 01-Feb-2006  yamt sync with head.
 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
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.4.1 27-May-2000  bouyer file endian_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:32:51 +0000
 1.5 08-Oct-1996  cgd moved to aout_machdep.h (via repository copy)
 1.4 23-Sep-1995  ragge relocation_info added.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Minor updates of some errouneous parameters.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Minor updates of some errouneous parameters.
 1.2.2.1 16-Aug-1994  ragge file exec.h was added on branch netbsd-1-0 on 1994-08-16 23:41:54 +0000
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 23-Oct-2003  kleink Oops, s/DECIMAL_DIGIT/DECIMAL_DIG/.
 1.8 22-Oct-2003  kleink C99: provide DECIMAL_DIGIT.
 1.7 22-Oct-2003  kleink C99: provide FLT_EVAL_METHOD.
 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 10-Oct-1998  matt branches: 1.5.46;
Make DBL_MIN and DBL_MAX makes limits.h (otherwise CPP complains when
building xlint).
 1.4 18-Feb-1998  mycroft Minor changes.
 1.3 18-Feb-1998  mycroft Multiple-inclusion crap, correct precision of DBL_*, etc.
 1.2 26-Oct-1994  cgd branches: 1.2.18;
new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file float.h was added on branch netbsd-1-0 on 1994-08-02 20:20:23 +0000
 1.2.18.2 01-Feb-1999  cgd pull up rev 1.5 from trunk (abs)
 1.2.18.1 08-May-1998  mycroft Sync with trunk, per request of mycroft.
 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.3 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.2 04-Jun-2000  matt branches: 1.2.176; 1.2.196;
more cleanup. use __builtin_frame_address(0) instead of our funky
FRAMEOFFSET macro. define an interrupt call frame and use that directly
instead of some magic offsets. Make boot autoconf.o use the current
reality.
 1.1 12-Nov-1995  ragge branches: 1.1.30; 1.1.38;
Function call definition on stack. (calls frame)
 1.1.38.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.30.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.196.1 28-Aug-2017  skrll Sync with HEAD
 1.2.176.1 03-Dec-2017  jdolecek update from HEAD
 1.13 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.12 10-Dec-2009  matt branches: 1.12.62; 1.12.64;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.
 1.11 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10 03-Feb-2008  matt branches: 1.10.6; 1.10.8; 1.10.10;
Make sysmachine take a lwp instead of a proc.
 1.9 12-Mar-2006  christos branches: 1.9.40; 1.9.46;
welcome to syscall_intern.
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.6; 1.8.8; 1.8.10;
merge ktrace-lwp.
 1.7 29-Sep-2003  matt branches: 1.7.16;
Add SA_SIGINFO support for VAX.
 1.6 26-Sep-2003  simonb Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
 1.5 18-Jan-2003  thorpej branches: 1.5.2;
Merge the nathanw_sa branch.
 1.4 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
sigaction and the trampoline/version. Version 0 means "legacy kernel
provided trampoline". Other versions are coordinated with machine-
dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions. Instead,
sendsig() looks up the handler by peeking in the sigacts for the
process getting the signal (since it has to look in there for the
trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.3 21-Jun-2000  matt branches: 1.3.2; 1.3.6; 1.3.10; 1.3.18;
Move COFF_LDPGSZ to ibcs2_machdep.h. Fix nmagic loader to deal with
subpage mappings.
 1.2 10-Jan-2000  matt branches: 1.2.4;
Add some machine dependent stuff for vax.
 1.1 16-Nov-1999  matt branches: 1.1.2;
close the i386 ibcs2 machdep.h; nothing really machine dependent in it yet.
 1.1.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.4.1 22-Jun-2000  matt Move COFF_LDPGSZ to machine dependent includes.
 1.3.18.1 17-Jul-2002  gehenna catch up with -current.
 1.3.10.2 01-Aug-2002  nathanw Catch up to -current.
 1.3.10.1 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.3.6.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.2.1 21-Jun-2000  bouyer file ibcs2_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:32:51 +0000
 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.7.16.2 04-Feb-2008  yamt sync with head.
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.8.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.8.8.1 13-Mar-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.9.46.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.40.1 23-Mar-2008  matt sync with HEAD
 1.10.10.2 11-Mar-2010  yamt sync with head
 1.10.10.1 16-May-2008  yamt sync with head.
 1.10.8.1 18-May-2008  yamt sync with head.
 1.10.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.64.1 10-Jun-2019  christos Sync with HEAD
 1.12.62.1 18-Jan-2019  pgoyette Synch with HEAD
 1.4 13-Aug-2014  matt Include <sys/common_int_const.h> if __INTMAX_C_SUFFIX__ is defined.
 1.3 29-May-2010  tnozaki branches: 1.3.18;
fix wrong integer promotion rule(removed U suffix from UINT{8,16}_C).
see ISO/IEC 9899:1999 7.18.4.3.
 1.2 28-Apr-2008  martin branches: 1.2.20; 1.2.22;
Remove clause 3 and 4 from TNF licenses
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12; 1.1.130; 1.1.132; 1.1.134;
Add definitions of C99 integer constant macros.
 1.1.134.2 11-Aug-2010  yamt sync with head.
 1.1.134.1 16-May-2008  yamt sync with head.
 1.1.132.1 18-May-2008  yamt sync with head.
 1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.12.2 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
 1.1.12.1 14-Apr-2001  kleink file int_const.h was added on branch nathanw_sa on 2001-04-14 22:38:44 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 14-Apr-2001  bouyer file int_const.h was added on branch thorpej_scsipi on 2001-04-21 17:54:59 +0000
 1.2.22.1 30-May-2010  rmind sync with head
 1.2.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.3.18.1 03-Dec-2017  jdolecek update from HEAD
 1.9 21-Aug-2014  matt Revert back to 1.7.
 1.8 14-Aug-2014  matt Fix SCN?FAST{8,16} formats to match reality (int) in gcc4.8.3
 1.7 14-Aug-2014  martin Revert previous changes, gcc configuration will be adapted instead.
 1.6 14-Aug-2014  martin intptr_t and uintptr_t are not long any more.
 1.5 13-Aug-2014  matt include <sys/common_int_fmtio.h> if __INTPTR_FMTd__ is defined
 1.4 29-Aug-2008  matt branches: 1.4.38;
Drop support for compiling a.out kernel. Elves rule!
 1.3 28-Apr-2008  martin branches: 1.3.2; 1.3.6;
Remove clause 3 and 4 from TNF licenses
 1.2 26-Apr-2001  kleink branches: 1.2.2; 1.2.10; 1.2.128; 1.2.130; 1.2.132;
Add definitions for C99 fastest minimum-width integer types.
 1.1 15-Apr-2001  kleink branches: 1.1.2;
Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_fmtio.h was added on branch thorpej_scsipi on 2001-04-21 17:54:59 +0000
 1.2.132.2 04-May-2009  yamt sync with head.
 1.2.132.1 16-May-2008  yamt sync with head.
 1.2.130.1 18-May-2008  yamt sync with head.
 1.2.128.2 28-Sep-2008  mjf Sync with HEAD.
 1.2.128.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.10.2 26-Apr-2001  kleink Add definitions for C99 fastest minimum-width integer types.
 1.2.10.1 26-Apr-2001  kleink file int_fmtio.h was added on branch nathanw_sa on 2001-04-26 16:25:28 +0000
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.6.1 19-Oct-2008  haad Sync with HEAD.
 1.3.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.38.1 03-Dec-2017  jdolecek update from HEAD
 1.9 13-Aug-2014  matt Include <sys/common_init_limits.h> if __SIG_ATOMIC_MAX__ is defined.
 1.8 29-Aug-2008  matt branches: 1.8.38;
Drop support for compiling a.out kernel. Elves rule!
 1.7 28-Apr-2008  martin branches: 1.7.2; 1.7.6;
Remove clause 3 and 4 from TNF licenses
 1.6 17-Oct-2007  garbled branches: 1.6.16; 1.6.18; 1.6.20;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.5 31-Aug-2007  drochner Fix definitions of UCHAR_MAX/USHRT_MAX and related
types. C99 requires that these definitions promote to (signed/unsigned)
integer the same way as the types the definition is for. And since
unsigned char/short fit into an "int" on all our archs and thus promote
to signed int, the definitions must not be unsigned.
Fixes PR lib/31306 by Neil Booth.
 1.4 11-Dec-2005  christos branches: 1.4.30; 1.4.38; 1.4.44; 1.4.48; 1.4.50;
merge ktrace-lwp.
 1.3 08-May-2004  kleink branches: 1.3.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.2 26-Apr-2001  kleink branches: 1.2.2; 1.2.10; 1.2.26;
Add definitions for C99 fastest minimum-width integer types.
 1.1 15-Apr-2001  kleink branches: 1.1.2;
Add definitions of C99 specified-width integer type limits.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_limits.h was added on branch thorpej_scsipi on 2001-04-21 17:54:59 +0000
 1.2.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.26.1 03-Aug-2004  skrll Sync with HEAD
 1.2.10.2 26-Apr-2001  kleink Add definitions for C99 fastest minimum-width integer types.
 1.2.10.1 26-Apr-2001  kleink file int_limits.h was added on branch nathanw_sa on 2001-04-26 16:25:28 +0000
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.12.1 03-Sep-2007  yamt sync with head.
 1.4.50.1 06-Nov-2007  matt sync with HEAD
 1.4.48.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.4.44.1 03-Sep-2007  skrll Sync with HEAD.
 1.4.38.1 03-Oct-2007  garbled Sync with HEAD
 1.4.30.1 09-Oct-2007  ad Sync with head.
 1.6.20.2 04-May-2009  yamt sync with head.
 1.6.20.1 16-May-2008  yamt sync with head.
 1.6.18.1 18-May-2008  yamt sync with head.
 1.6.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.6.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.6.1 19-Oct-2008  haad Sync with HEAD.
 1.7.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.8.38.1 03-Dec-2017  jdolecek update from HEAD
 1.5 13-Aug-2014  matt include <sys/common_int_mwgwtypes.h> if __UINT_FAST64_TYPE__ is defined.
 1.4 28-Apr-2008  martin branches: 1.4.44;
Remove clause 3 and 4 from TNF licenses
 1.3 24-Dec-2005  perry branches: 1.3.74; 1.3.76; 1.3.78;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 26-Apr-2001  kleink branches: 1.2.2; 1.2.10; 1.2.42;
Add definitions for C99 fastest minimum-width integer types.
 1.1 14-Apr-2001  kleink branches: 1.1.2;
Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 14-Apr-2001  bouyer file int_mwgwtypes.h was added on branch thorpej_scsipi on 2001-04-21 17:55:00 +0000
 1.2.42.1 21-Jun-2006  yamt sync with head.
 1.2.10.2 26-Apr-2001  kleink Add definitions for C99 fastest minimum-width integer types.
 1.2.10.1 26-Apr-2001  kleink file int_mwgwtypes.h was added on branch nathanw_sa on 2001-04-26 16:25:28 +0000
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.78.1 16-May-2008  yamt sync with head.
 1.3.76.1 18-May-2008  yamt sync with head.
 1.3.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.44.1 03-Dec-2017  jdolecek update from HEAD
 1.12 13-Aug-2014  matt Include <sys/common_int_types.h> if __UINTPTR_TYPE__ is defined.
 1.11 29-Aug-2008  matt branches: 1.11.38;
Drop support for compiling a.out kernel. Elves rule!
 1.10 24-Dec-2005  perry branches: 1.10.74; 1.10.78; 1.10.80; 1.10.84;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 25-May-2005  kleink branches: 1.8.2;
Include <sys/cdefs.h> for __signed; related to lib/30072.
 1.7 07-Aug-2003  agc branches: 1.7.6; 1.7.14;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 28-Apr-2001  kleink branches: 1.6.8; 1.6.24;
* Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
intmax_t, pointer-type and size_t arguments.
 1.5 15-Apr-2001  kleink Catch up with ansi.h rev. 1.12: define intptr_t and uintptr_t as long
integers in ELF environments, like is done with ptrdiff_t.
 1.4 12-Apr-2001  kleink Replace the 'unsigned __COMPILER_INT64__' construct with a new name,
__COMPILER_UINT64__, to be supplied - if such a case is made, it shouldn't
be assumed that the unsigned type-specifier may be applied to it.
 1.3 03-Jan-2001  takemura branches: 1.3.2;
replace 'long long' with int64_t to compile stand alone program with
compiler other than GCC.
 1.2 27-Jun-2000  kleink branches: 1.2.2;
Resolve some formatting nits; add __intptr_t and __uintptr_t.
 1.1 26-Jun-2000  kleink Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.2.2.4 21-Apr-2001  bouyer Sync with HEAD
 1.2.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.2.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 27-Jun-2000  bouyer file int_types.h was added on branch thorpej_scsipi on 2000-11-20 20:32:52 +0000
 1.3.2.1 21-Jun-2001  nathanw Catch up to -current.
 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.6.8.2 28-Apr-2001  kleink * Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
intmax_t, pointer-type and size_t arguments.
 1.6.8.1 28-Apr-2001  kleink file int_types.h was added on branch nathanw_sa on 2001-04-28 15:41:34 +0000
 1.7.14.1 28-May-2005  tron Pull up revision 1.8 (requested by klein in ticket #346):
Include <sys/cdefs.h> for __signed; related to lib/30072.
 1.7.6.1 29-May-2005  riz Pull up revision 1.8 (requested by kleink in ticket #1555):
Include <sys/cdefs.h> for __signed; related to lib/30072.
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.10.84.1 19-Oct-2008  haad Sync with HEAD.
 1.10.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.10.78.1 04-May-2009  yamt sync with head.
 1.10.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.11.38.1 03-Dec-2017  jdolecek update from HEAD
 1.31 11-Jul-2023  riastradh vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
 1.30 02-Nov-2021  ryo branches: 1.30.4;
In order to prevent _mcount() from being recursively called when built with COPTS=-O0,
sprinkle `__always_inline' to make _mcount() be generated as a single function.
 1.29 13-May-2009  mhitch Revert using __insn_barrier(); changed to use "memory" clobber in the
mtpr() macro.
 1.28 06-May-2009  mhitch Add __insn_barrier() to _splset(). See also kern/38637.
 1.27 20-Feb-2008  matt branches: 1.27.24;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.26 03-Feb-2008  matt Change IPL_SOFTBIO to 0x0b
 1.25 03-Dec-2007  ad Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.24 12-Mar-2007  matt branches: 1.24.16; 1.24.18; 1.24.24;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.23 16-Feb-2007  ad branches: 1.23.2; 1.23.6;
Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
 1.22 16-Feb-2007  matt Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.21 21-Dec-2006  yamt merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.20 16-Feb-2006  perry branches: 1.20.14; 1.20.16;
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.19 24-Dec-2005  perry branches: 1.19.2; 1.19.4; 1.19.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.18 04-Dec-2005  christos Give splraiseipl() to the vax, from Johnny Billquist
 1.17 27-Nov-2005  yamt implement splraiseipl() for the following ports.
evbppc, evbmips, evbsh3, hp700, mac68k, vax, x68k.
 1.16 03-Jun-2005  ragge branches: 1.16.2; 1.16.8;
Rename val -> __val in macros, to avoid variable shadowing, as reported
by Johnny Billquist. While here, add spaludio().
 1.15 01-Jul-2004  kleink Tidy up the namespace: lint -> __lint__.
 1.14 16-Jun-2003  thorpej branches: 1.14.2; 1.14.4;
Rename IPL_IMP -> IPL_VM.
 1.13 04-Jun-2001  ragge branches: 1.13.8; 1.13.12;
Add splipi().
 1.12 13-Apr-2001  thorpej Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.11 12-Apr-2001  thorpej Add spluba().
 1.10 15-Jan-2001  thorpej branches: 1.10.2;
Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.9 14-Jan-2001  thorpej Rename __GENERIC_SOFT_INTERRUPTS to __HAVE_GENERIC_SOFT_INTERRUPTS,
and place the definition in <machine/types.h>. This can now be used
as a flag to indicate whether or not <machine/intr.h> can be included
to get the generic soft interrupt API.
 1.8 14-Jan-2001  thorpej Make sure everybody has an splvm() and equate it with splimp() (splimp()
is the historical name for this interrupt level, and the historical name
is going to go away in the near future).
 1.7 22-Aug-2000  thorpej Add spllock(). See spl(9) for details.
 1.6 21-Aug-2000  thorpej Make sure we provide splsched() as described in spl(9).
 1.5 01-Jul-2000  matt GCC 2.96 wants the = constraint first. Older gcc(s) don't care.
 1.4 11-Jun-2000  matt Make spl0 & spllowersoftclock return void.
 1.3 02-Jun-2000  matt no need to raise ipl since the definition of softintr_schedule is that
it's from at or above softipl.
 1.2 02-Jun-2000  matt Move spl macros from <machine/param.h> to <machine/intr.h>
Fix botch on my part and make the IPL_* match reality on VAX.
Redefine spl macro using the symbolic IPL_ instead of being hardcoded.
Move schedsoftnet, schedsoftclock from <machine/cpu.h> to <machine/intr.h>
Add a _setsirr macro for schedsoft*.
Add softintr function and framework.
 1.1 18-Aug-1998  matt branches: 1.1.12; 1.1.20;
Initial steps to getting the VAX to use the MI driver framework.
 1.1.20.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.12.3 21-Apr-2001  bouyer Sync with HEAD
 1.1.12.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.1.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.13.12.1 17-Mar-2002  thorpej IPL_IMP -> IPL_VM
 1.13.8.2 04-Jun-2001  ragge Add splipi().
 1.13.8.1 04-Jun-2001  ragge file intr.h was added on branch nathanw_sa on 2001-06-04 15:34:58 +0000
 1.14.4.1 02-Jul-2004  he Pull up revision 1.15 (requested by kleink in ticket #580):
Tidy up the namespace: lint -> __lint__.
 1.14.2.5 11-Dec-2005  christos Sync with head.
 1.14.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.8.1 29-Nov-2005  yamt sync with head.
 1.16.2.7 27-Feb-2008  yamt sync with head.
 1.16.2.6 04-Feb-2008  yamt sync with head.
 1.16.2.5 07-Dec-2007  yamt sync with head
 1.16.2.4 03-Sep-2007  yamt sync with head.
 1.16.2.3 26-Feb-2007  yamt sync with head.
 1.16.2.2 30-Dec-2006  yamt sync with head.
 1.16.2.1 21-Jun-2006  yamt sync with head.
 1.19.6.1 22-Apr-2006  simonb Sync with head.
 1.19.4.1 09-Sep-2006  rpaulo sync with head
 1.19.2.1 18-Feb-2006  yamt sync with head.
 1.20.16.1 19-Sep-2006  yamt implement new api for vax.
 1.20.14.1 12-Jan-2007  ad Sync with head.
 1.23.6.2 03-Dec-2007  ad Sync with HEAD.
 1.23.6.1 13-Mar-2007  ad Sync with head.
 1.23.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.24.2 18-Feb-2008  mjf Sync with HEAD.
 1.24.24.1 08-Dec-2007  mjf Sync with HEAD.
 1.24.18.2 23-Mar-2008  matt sync with HEAD
 1.24.18.1 09-Jan-2008  matt sync with HEAD
 1.24.16.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.27.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.4.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.
 1.13 01-Jul-2010  ragge A big bunch of bugfixes from Johnny Billquist. Highlights:
- Makes the VAX8600 work as expected (500kg of hardware :-)
- Fix a hard-tracked bug causing VAXen to hang at splhigh.
 1.12 04-Mar-2007  christos branches: 1.12.44; 1.12.64; 1.12.66;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 11-Dec-2005  christos branches: 1.11.26;
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 19-Jan-2003  ragge branches: 1.9.2;
Add some instrumentation and clean up some VAX8600 code.
From Johnny Billquist.
 1.8 16-May-2001  matt branches: 1.8.8;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.7 12-Jun-2000  ragge branches: 1.7.4;
Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.6 24-Jan-2000  matt branches: 1.6.2;
Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.5 12-Apr-1999  pk branches: 1.5.2;
Ungarble the copyright notice.
 1.4 07-Mar-1996  ragge branches: 1.4.24;
Support for VAX 8600/8650 added. Works with lots of Unibus adapters,
and will probably work with Massbus adapters as well. (Not tested,
but it's the same code as for 11/780). Ubareset's may cause crashes
on 8600 also like 11/780, but they are more uncommon. No support
for console RL02 yet, but it's likely to come.
 1.3 03-Nov-1995  ragge No need anymore.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file ioa.h was added on branch netbsd-1-0 on 1994-08-02 20:20:29 +0000
 1.4.24.1 12-Apr-1999  pk branches: 1.4.24.1.2;
Pullup copyright text corrections.
 1.4.24.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.8.2 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.8.8.1 16-May-2001  matt file ioa.h was added on branch nathanw_sa on 2001-05-16 05:36:58 +0000
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.1 03-Sep-2007  yamt sync with head.
 1.11.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.66.1 03-Jul-2010  rmind sync with head
 1.12.64.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.12.44.1 11-Aug-2010  yamt sync with head.
 1.6 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.5 01-Dec-2002  matt branches: 1.5.156; 1.5.176;
Add multiple inclusion protection.
 1.4 06-Oct-1998  matt branches: 1.4.30;
Change backplace0 to mainbus0 (for consistency with other ports).
Remove unused function protocols from ka410.h and ka43.h
Fix some ka46 missing references
 1.3 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.2 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.1 20-Jul-1996  ragge branches: 1.1.6;
Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.1.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.4.30.1 11-Dec-2002  thorpej Sync with HEAD.
 1.5.176.1 28-Aug-2017  skrll Sync with HEAD
 1.5.156.1 03-Dec-2017  jdolecek update from HEAD
 1.4 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.3 01-Dec-2002  matt branches: 1.3.156; 1.3.176;
Add multiple inclusion protection.
 1.2 07-Jun-1998  ragge branches: 1.2.32;
Enable use of secondary cache, if present.
 1.1 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.2.32.1 11-Dec-2002  thorpej Sync with HEAD.
 1.3.176.1 28-Aug-2017  skrll Sync with HEAD
 1.3.156.1 03-Dec-2017  jdolecek update from HEAD
 1.8 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.7 11-Dec-2005  christos branches: 1.7.122; 1.7.142;
merge ktrace-lwp.
 1.6 14-Jan-2005  ragge Fix halt/reboot register write syntax. From Johnny Billquist.
 1.5 01-Dec-2002  matt branches: 1.5.6;
Add multiple inclusion protection.
 1.4 06-Oct-1998  matt branches: 1.4.30;
Change backplace0 to mainbus0 (for consistency with other ports).
Remove unused function protocols from ka410.h and ka43.h
Fix some ka46 missing references
 1.3 13-Apr-1998  ragge Wall cleaning.
 1.2 18-Apr-1997  ragge Updates to KA43 (VS3100/76) support by Bertram Barth.
 1.1 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.4.30.1 11-Dec-2002  thorpej Sync with HEAD.
 1.5.6.1 17-Jan-2005  skrll Sync with HEAD.
 1.7.142.1 28-Aug-2017  skrll Sync with HEAD
 1.7.122.1 03-Dec-2017  jdolecek update from HEAD
 1.4 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.3 01-Dec-2002  matt branches: 1.3.156; 1.3.176;
Add multiple inclusion protection.
 1.2 11-Aug-1998  ragge branches: 1.2.30;
Cache and microsecond clock resolution on KA46.
 1.1 10-Aug-1998  ragge Basic support for VS4000/60.
 1.2.30.1 11-Dec-2002  thorpej Sync with HEAD.
 1.3.176.1 28-Aug-2017  skrll Sync with HEAD
 1.3.156.1 03-Dec-2017  jdolecek update from HEAD
 1.5 03-Aug-2021  andvar Fix various typos in comments. Also add missing NetBSD RCS Id in some of these files.
 1.4 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.3 01-Dec-2002  matt branches: 1.3.156; 1.3.176;
Add multiple inclusion protection.
 1.2 18-Apr-2000  mhitch branches: 1.2.12;
Add some defines gleaned from OpenVMS to enable cache on the 4000/VLC.
 1.1 09-Mar-1999  ragge branches: 1.1.8;
Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.1.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.12.1 11-Dec-2002  thorpej Sync with HEAD.
 1.3.176.1 28-Aug-2017  skrll Sync with HEAD
 1.3.156.1 03-Dec-2017  jdolecek update from HEAD
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 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 19-Jul-2000  matt branches: 1.5.24;
Move KA630 definitions from boot/boot/consio.c to here.
 1.4 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.3 13-Apr-1998  ragge branches: 1.3.14;
Wall cleaning.
 1.2 26-Jul-1997  ragge Actually do 'halt' or 'reboot' on MicroVAX.
 1.1 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.24.1 03-Aug-2004  skrll Sync with HEAD
 1.13 08-Apr-2022  andvar fix various typos, mainly in comments, but also log messages, docs, game text.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.10 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.9 01-Dec-2002  matt branches: 1.9.6;
Add multiple inclusion protection.
 1.8 31-Aug-2001  simonb branches: 1.8.6;
Use comments around the token after a #endif.
 1.7 07-Aug-1999  ragge branches: 1.7.16;
Clean up all bus handling stuff, it has become a mess the latest years.
Add a new bus; "ibus" that is the internal MicroVAX bus.
 1.6 26-Jul-1997  ragge Actually do 'halt' or 'reboot' on MicroVAX.
 1.5 12-Feb-1997  ragge Improve sub-type identification of the CVAX CPU, for later cache handling.
 1.4 19-May-1996  ragge branches: 1.4.8;
Fixed all (proto)type errors. Fixes PR 2377.
 1.3 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.2 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.1 13-Dec-1995  ragge MicroVAX III support added.
 1.4.8.1 12-Mar-1997  is Merge in changes from Trunk
 1.7.16.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.8.6.2 11-Dec-2002  thorpej Sync with HEAD.
 1.8.6.1 31-Aug-2001  thorpej file ka650.h was added on branch nathanw_sa on 2002-12-11 06:12:39 +0000
 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.4 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.3 01-Dec-2002  matt branches: 1.3.156; 1.3.176;
Add multiple inclusion protection.
 1.2 06-Jul-2000  ragge branches: 1.2.8;
Some defines for the 6000/400 CPU.
 1.1 06-Jun-1999  ragge branches: 1.1.2; 1.1.4;
Complete support for VAX 4000/300. From Michael Kukat. (michael@camaronet.de)
 1.1.4.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.8.1 11-Dec-2002  thorpej Sync with HEAD.
 1.3.176.1 28-Aug-2017  skrll Sync with HEAD
 1.3.156.1 03-Dec-2017  jdolecek update from HEAD
 1.3 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.2 01-Dec-2002  matt branches: 1.2.156; 1.2.176;
Add multiple inclusion protection.
 1.1 05-Feb-2001  ragge branches: 1.1.2; 1.1.10;
Oops, forgot this file.
 1.1.10.1 11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 05-Feb-2001  bouyer file ka680.h was added on branch thorpej_scsipi on 2001-02-11 19:12:58 +0000
 1.2.176.1 28-Aug-2017  skrll Sync with HEAD
 1.2.156.1 03-Dec-2017  jdolecek update from HEAD
 1.2 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.1 22-Jan-2009  christos branches: 1.1.4; 1.1.6; 1.1.28; 1.1.46;
Patches from Brad Parker to support vax730.
 1.1.46.1 28-Aug-2017  skrll Sync with HEAD
 1.1.28.1 03-Dec-2017  jdolecek update from HEAD
 1.1.6.2 04-May-2009  yamt sync with head.
 1.1.6.1 22-Jan-2009  yamt file ka730.h was added on branch yamt-nfs-mp on 2009-05-04 08:12:04 +0000
 1.1.4.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.4.1 22-Jan-2009  skrll file ka730.h was added on branch nick-hppapmap on 2009-03-03 18:29:35 +0000
 1.11 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.10 01-Dec-2002  matt branches: 1.10.156; 1.10.176;
Add multiple inclusion protection.
 1.9 07-Aug-1999  ragge branches: 1.9.20;
Clean up all bus handling stuff, it has become a mess the latest years.
Add a new bus; "ibus" that is the internal MicroVAX bus.
 1.8 12-Feb-1997  ragge Remove bogus prototypes.
 1.7 20-Jul-1996  ragge branches: 1.7.6;
Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.6 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.5 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.4 02-Feb-1996  mycroft Fix #includes.
 1.3 12-Nov-1995  ragge 11/750 specific things moved to ka750.h
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file ka750.h was added on branch netbsd-1-0 on 1994-08-02 20:20:31 +0000
 1.7.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.9.20.1 11-Dec-2002  thorpej Sync with HEAD.
 1.10.176.1 28-Aug-2017  skrll Sync with HEAD
 1.10.156.1 03-Dec-2017  jdolecek update from HEAD
 1.9 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.8 11-Dec-2005  christos branches: 1.8.50; 1.8.70; 1.8.74;
merge ktrace-lwp.
 1.7 13-Feb-2004  wiz branches: 1.7.16;
Uppercase CPU, plural is CPUs.
 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 01-Dec-2002  matt branches: 1.5.6;
Add multiple inclusion protection.
 1.4 03-Jun-2001  ragge branches: 1.4.8;
Add define for IPI vector.
 1.3 24-Jan-2000  matt branches: 1.3.6;
Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.2 19-Jan-1999  ragge branches: 1.2.8;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.1 20-Jul-1996  ragge Support for VAX8200; the ka820/ka825 CPUs.
 1.2.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.8.2 11-Dec-2002  thorpej Sync with HEAD.
 1.4.8.1 03-Jun-2001  thorpej file ka820.h was added on branch nathanw_sa on 2002-12-11 06:12:40 +0000
 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.7.16.1 17-Mar-2008  yamt sync with head.
 1.8.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.70.1 24-Mar-2008  keiichi sync with head.
 1.8.50.1 23-Mar-2008  matt sync with HEAD
 1.6 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.5 11-Mar-2008  matt branches: 1.5.48; 1.5.68;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.4 11-Dec-2005  christos branches: 1.4.50; 1.4.70; 1.4.74;
merge ktrace-lwp.
 1.3 13-Feb-2004  wiz branches: 1.3.16;
Uppercase CPU, plural is CPUs.
 1.2 01-Dec-2002  matt branches: 1.2.6;
Add multiple inclusion protection.
 1.1 26-Jul-2000  ragge branches: 1.1.2; 1.1.10;
Support for the KA88 CPU and the NMI backplane.
 1.1.10.1 11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 26-Jul-2000  bouyer file ka88.h was added on branch thorpej_scsipi on 2000-11-20 20:32:54 +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.3.16.1 17-Mar-2008  yamt sync with head.
 1.4.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.4.70.1 24-Mar-2008  keiichi sync with head.
 1.4.50.1 23-Mar-2008  matt sync with HEAD
 1.5.68.1 28-Aug-2017  skrll Sync with HEAD
 1.5.48.1 03-Dec-2017  jdolecek update from HEAD
 1.3 03-Nov-1995  ragge No need anymore.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file kg.h was added on branch netbsd-1-0 on 1994-08-02 20:20:32 +0000
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.76; 1.4.78;
merge ktrace-lwp.
 1.3 12-Dec-2004  abs Fix comments regarding configration bounaries
 1.2 10-Jun-2004  matt Update RESIDUE_LW[01] to their correct offsets
 1.1 24-Apr-2000  matt branches: 1.1.6; 1.1.30;
Initial definition of registers for VS400 LCG cards. Still needs more.
 1.1.30.4 18-Dec-2004  skrll Sync with HEAD.
 1.1.30.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.30.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.30.1 03-Aug-2004  skrll Sync with HEAD
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 24-Apr-2000  bouyer file lcgreg.h was added on branch thorpej_scsipi on 2000-11-20 20:32:55 +0000
 1.4.78.1 16-May-2008  yamt sync with head.
 1.4.76.1 18-May-2008  yamt sync with head.
 1.4.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 18-Feb-2001  ragge branches: 1.1.4; 1.1.128; 1.1.130; 1.1.132;
Support to control the leds on VAXstations, taken from Sun3 and ported
to vax by Shinmyoh Koji (yesu@rb3.so-net.ne.jp).
 1.1.132.1 16-May-2008  yamt sync with head.
 1.1.130.1 18-May-2008  yamt sync with head.
 1.1.128.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.1.4.1 18-Feb-2001  bouyer file leds.h was added on branch thorpej_scsipi on 2001-03-12 13:29:45 +0000
 1.21 21-Jan-2019  dholland Fix wrong scoping of {U,}LLONG_MAX. More cases, not just amd64.
PR 53298 from Roberto E. Vargas Caballero.
 1.20 11-Apr-2013  christos branches: 1.20.34; 1.20.36;
add missing SSIZE_MIN
 1.19 28-Mar-2012  christos branches: 1.19.2;
- Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
 1.18 07-Jun-2010  tnozaki branches: 1.18.8; 1.18.12;
1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
prepareing for next libc major crunk.
4. bump libc minor version.
 1.17 29-Aug-2008  matt branches: 1.17.14; 1.17.16;
Drop support for compiling a.out kernel. Elves rule!
 1.16 17-Oct-2007  garbled branches: 1.16.16; 1.16.20; 1.16.22; 1.16.26;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.15 31-Aug-2007  drochner Fix definitions of UCHAR_MAX/USHRT_MAX and related
types. C99 requires that these definitions promote to (signed/unsigned)
integer the same way as the types the definition is for. And since
unsigned char/short fit into an "int" on all our archs and thus promote
to signed int, the definitions must not be unsigned.
Fixes PR lib/31306 by Neil Booth.
 1.14 11-Dec-2005  christos branches: 1.14.30; 1.14.38; 1.14.44; 1.14.48; 1.14.50;
merge ktrace-lwp.
 1.13 07-Aug-2003  agc branches: 1.13.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.12 28-Apr-2003  bjh21 branches: 1.12.2;
Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.11 15-Apr-2001  kleink branches: 1.11.8;
Catch up with ansi.h rev. 1.12: define SIZE_T_MAX and SSIZE_MAX as long
integer constants in ELF environments.
 1.10 08-Aug-2000  tshiozak branches: 1.10.2;
Preparation for the future introduction of multibyte locale.
- MB_LEN_MAX is increased to 32.
- To ensure binary compatibility for old executables
under multibyte locale, versioned setlocale is added.
- __mb_len_cur definision is added in setlocale.c
and enable it in stdlib.h .
It is also important for multibyte locale stuffs,
but I just forgot.
 1.9 07-Mar-2000  kleink branches: 1.9.2; 1.9.4;
Define ISO C99 (unsigned) long long (min, max) symbols.
 1.8 06-Aug-1998  kleink branches: 1.8.12;
_POSIX_SOURCE -> _POSIX_C_SOURCE
 1.7 09-Jan-1998  perry multiple include protect machine/limits.h, fixes pr 4473 (from Mika Nystrom)
 1.6 31-Dec-1995  ragge Changes requested by Charles Hannum.
 1.5 28-May-1995  ragge Changed *_MIN to be correct.
 1.4 16-Apr-1995  ragge Added SSIZE_MAX, SIZE_T_MAX, UQUAD_MAX, QUAD_MAX and QUAD_MIN.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 05-Oct-1994  jtc Add constants required by XPG3
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file limits.h was added on branch netbsd-1-0 on 1994-08-02 20:20:33 +0000
 1.8.12.2 21-Apr-2001  bouyer Sync with HEAD
 1.8.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.4.1 09-Aug-2000  tshiozak pull up the following changes (approved by thorpej):
> cvs rdiff -r1.9 -r1.10 basesrc/include/locale.h
> cvs rdiff -r1.45 -r1.46 basesrc/include/stdlib.h
> cvs rdiff -r1.16 -r1.17 basesrc/lib/libc/locale/Makefile.inc
> cvs rdiff -r1.17 -r1.18 basesrc/lib/libc/locale/setlocale.c
> cvs rdiff -r0 -r1.2 basesrc/lib/libc/locale/setlocale_sb.c
> cvs rdiff -r1.6 -r1.7 syssrc/sys/arch/alpha/include/limits.h
> cvs rdiff -r1.1 -r1.2 syssrc/sys/arch/arm26/include/limits.h
> cvs rdiff -r1.7 -r1.8 syssrc/sys/arch/arm32/include/limits.h
> cvs rdiff -r1.14 -r1.15 syssrc/sys/arch/i386/include/limits.h
> cvs rdiff -r1.12 -r1.13 syssrc/sys/arch/m68k/include/limits.h
> cvs rdiff -r1.13 -r1.14 syssrc/sys/arch/mips/include/limits.h
> cvs rdiff -r1.10 -r1.11 syssrc/sys/arch/pc532/include/limits.h
> cvs rdiff -r1.6 -r1.7 syssrc/sys/arch/powerpc/include/limits.h
> cvs rdiff -r1.2 -r1.3 syssrc/sys/arch/sh3/include/limits.h
> cvs rdiff -r1.11 -r1.12 syssrc/sys/arch/sparc/include/limits.h
> cvs rdiff -r1.7 -r1.8 syssrc/sys/arch/sparc64/include/limits.h
> cvs rdiff -r1.9 -r1.10 syssrc/sys/arch/vax/include/limits.h
>
> Outline:
>
> Preparation for the future introduction of multibyte locale.
> - MB_LEN_MAX is increased to 32.
> - To ensure binary compatibility for old executables
> under multibyte locale, versioned setlocale is added.
> - __mb_len_cur definision is added in setlocale.c
> and enable it in stdlib.h .
> It is also important for multibyte locale stuffs,
> but I just forgot.
 1.9.2.1 28-May-2000  minoura Citrus Project XPG4DL, an implementation of I18N (locale) framework,
is imported.
 1.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.8.2 15-Apr-2001  kleink Catch up with ansi.h rev. 1.12: define SIZE_T_MAX and SSIZE_MAX as long
integer constants in ELF environments.
 1.11.8.1 15-Apr-2001  kleink file limits.h was added on branch nathanw_sa on 2001-04-15 14:16:09 +0000
 1.12.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.16.1 03-Sep-2007  yamt sync with head.
 1.14.50.1 06-Nov-2007  matt sync with HEAD
 1.14.48.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.14.44.1 03-Sep-2007  skrll Sync with HEAD.
 1.14.38.1 03-Oct-2007  garbled Sync with HEAD
 1.14.30.1 09-Oct-2007  ad Sync with head.
 1.16.26.1 19-Oct-2008  haad Sync with HEAD.
 1.16.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.16.20.2 11-Aug-2010  yamt sync with head.
 1.16.20.1 04-May-2009  yamt sync with head.
 1.16.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.17.16.1 03-Jul-2010  rmind sync with head
 1.17.14.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.18.12.1 05-Apr-2012  mrg sync to latest -current.
 1.18.8.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.8.1 17-Apr-2012  yamt sync with head
 1.19.2.1 23-Jun-2013  tls resync from head
 1.20.36.1 10-Jun-2019  christos Sync with HEAD
 1.20.34.1 26-Jan-2019  pgoyette Sync with HEAD
 1.8 06-Aug-2014  joerg Consistently define WARN in a way that passes format string checks, i.e.
always uses the same number of arguments as given in the format string.
 1.7 28-Apr-2008  martin branches: 1.7.44; 1.7.60;
Remove clause 3 and 4 from TNF licenses
 1.6 25-Jan-2006  christos branches: 1.6.72; 1.6.74; 1.6.76;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.5 31-May-2002  ragge branches: 1.5.22; 1.5.34;
ALIGNENTRY must always be 0 on vax, otherwise loadfile_aout won't work.
 1.4 31-Mar-2002  matt branches: 1.4.2; 1.4.4;
Make ddb symbol loading work for ELF as well a.out.
 1.3 31-Oct-2001  thorpej branches: 1.3.2;
Split elf32 vs. elf64 handling in loadfile(), including support for
each separately and explicitly. BOOT_ELF is now BOOT_ELF32 and
BOOT_ELF64, and ELFSIZE should no longer be defined in loadfile_machdep.h.
 1.2 19-Jul-2000  matt branches: 1.2.2; 1.2.6; 1.2.8;
More ELF changes (a.out still works).
 1.1 25-May-2000  matt branches: 1.1.4;
Add loadfile() support. soon to be needed by bootblocks.
 1.1.4.1 27-Jul-2000  matt Makefile: Pullup revision 1.13
boot.c: Pullup revision 1.12
loadfile_machdep.h: Pullup revision 1.2
Add support for loading elf kernels
 1.2.8.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 19-Jul-2000  bouyer file loadfile_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:32:55 +0000
 1.3.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.3.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.3.2.1 31-Oct-2001  nathanw file loadfile_machdep.h was added on branch nathanw_sa on 2002-04-17 00:04:39 +0000
 1.4.4.1 31-May-2002  tv Pull up revision 1.5 (requested by ragge in ticket #107):
ALIGNENTRY must always be 0 on vax, otherwise loadfile_aout won't work.
 1.4.2.1 15-Jul-2002  gehenna catch up with -current.
 1.5.34.1 01-Feb-2006  yamt sync with head.
 1.5.22.1 21-Jun-2006  yamt sync with head.
 1.6.76.1 16-May-2008  yamt sync with head.
 1.6.74.1 18-May-2008  yamt sync with head.
 1.6.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.60.1 10-Aug-2014  tls Rebase.
 1.7.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.34 13-Feb-2022  riastradh vax: __cpu_simple_lock audit.

Fix missing "memory" asm clobber so the compiler can't reorder memory
access around __cpu_simple_lock/lock_try/unlock.
 1.33 12-Feb-2022  riastradh __cpu_simple_lock(9): Omit needless barriers in init.

It is, and always has been, the caller's responsibility to ensure the
lock is initialized before it can be used -- otherwise the memory
could hold garbage; it is nonsensical to even attempt locking
operations on it before initialization.

So there's no need to issue explicit barriers here. The barrier
seems to have been introduced in sys/arch/alpha/alpha/lock_machdep.c
rev. 1.1 (since moved to inline asm in alpha/include/lock.h) and then
copied & pasted into several other architectures.
 1.32 29-Nov-2019  riastradh Nix mb_* on vax.
 1.31 17-Sep-2017  christos branches: 1.31.4;
more const.
 1.30 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.29 14-Jan-2009  pooka branches: 1.29.24; 1.29.42;
Use kernel locking routines only with _HARDKERNEL
 1.28 23-Feb-2008  matt branches: 1.28.4; 1.28.12;
A number of performance changes:
Change internal register SSP to contain curlwp insread curcpu(). This
shrinks the GENERIC by 2KB.
Add rwlock stubs (rw_enter, rw_exit, rw_tryenter).
Simplify simple lock code for uniprocessors.
Do SPL raise/lower in cpu_handle_ipi instead of simple_locks.
 1.27 17-Oct-2007  garbled branches: 1.27.12; 1.27.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.26 10-Sep-2007  skrll Merge nick-csl-alignment.
 1.25 04-Mar-2007  ragge branches: 1.25.2; 1.25.10; 1.25.14; 1.25.18; 1.25.20;
cpu_simple_lock() calls are emitted in the UP case if DEBUG || DIAGNOSTIC.
This should probably be fixed somewhere else, but currently just include
it here. Fixes PR#35866 from Henry R. Bent.
 1.24 26-Feb-2007  christos - use __inline like the other ports do.
- use __ in parameter names
- provide separate prototype lines.
 1.23 24-Feb-2007  mrg fix a typo - s/_inline/inline/
 1.22 16-Feb-2007  matt branches: 1.22.2;
Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.21 28-Dec-2005  perry inline -> __inline
 1.20 24-Dec-2005  perry __asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.19 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.18 11-Dec-2005  christos merge ktrace-lwp.
 1.17 20-Jul-2005  he Fixes to make GENERIC.MP build again. Several changes:
o Rename global variable "tramp" to "vax_mp_tramp" to avoid warning
with -Wshadow when compiling the signal code.
o Rename a macro-local variable _s to __s in __cpu_simple_lock()
to avoid -Wshadow warning when MALLOC() is used (also declares _s).
o Follow up -Wcast-qual by making a number of function arguments const char*
where string literals are used.
 1.16 19-May-2004  he branches: 1.16.12;
Hm, let ipfresend also compile; move <machine/intr.h> include
in under the _KERNEL_OPT define.
 1.15 19-May-2004  he Since we are using the spl() functions here, also include <machine/intr.h>.
 1.14 26-Sep-2003  nathanw Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.h
so that they can be used in a namespace-friendly way.
 1.13 26-Jun-2003  he branches: 1.13.2;
#ifdef _KERNEL_OPT police; identd defines _KERNEL before some includes.
 1.12 23-Jun-2003  martin Make sure to include opt_foo.h if a defflag option FOO is used.
 1.11 25-Feb-2003  matt This file has a _KERNEL dependency on <machine/cpu.h>. So include it.
[GENERIC.MP builds again.]
 1.10 10-Oct-2002  thorpej Add missing register prefixes.
 1.9 12-Sep-2002  matt Add non-_KERNEL variants so regress/sys/kern/lock will compile.
 1.8 04-Jun-2001  ragge branches: 1.8.2; 1.8.8;
Add rudimentary multiprocessor support for DDB.
 1.7 04-Jun-2001  ragge Check for console printf's in spinlocks, per discussion on tech-smp.
 1.6 03-Jun-2001  ragge Implement spinlocks as subroutines instead of inlines.
Add SPINLOCK_SPIN_HOOK; the VAX has low-priority IPIs like Alpha.
 1.5 01-Jul-2000  matt branches: 1.5.2; 1.5.4;
GCC 2.96 wants the = constraint first. Also change to be a bit more
efficient. Instead of using indirect register access, change the
constraint to memory and use the value directly. This allow PC-rel
access among other things.
 1.4 02-May-2000  thorpej Let each platform typedef the new __cpu_simple_lock_t, which should
be the most efficient type used for the atomic operations in the
simplelock structure, and should also be __volatile.
 1.3 01-May-2000  ragge #define __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED.
 1.2 29-Apr-2000  thorpej Require that each each MACHINE/MACHINE_ARCH supply a lock.h. This file
contains the values __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED, which
replace the old SIMPLELOCK_LOCKED and SIMPLELOCK_UNLOCKED. These files
are also required to supply inline functions __cpu_simple_lock(),
__cpu_simple_lock_try(), and __cpu_simple_unlock() if locking is to be
supported on that platform (i.e. if MULTIPROCESSOR is defined in the
_KERNEL case). Change these functions to take an int * (&alp->lock_data)
rather than the struct simplelock * itself.

These changes make it possible for userland to use the locking primitives
by including <machine/lock.h>.
 1.1 19-Mar-2000  ragge First cut of multiprocessor support for vax. Still much to do before
other CPUs than the master can spin up.
 1.5.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.2.1 01-Jul-2000  bouyer file lock.h was added on branch thorpej_scsipi on 2000-11-20 20:32:56 +0000
 1.8.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.8.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.8.8.1 04-Jun-2001  nathanw file lock.h was added on branch nathanw_sa on 2002-09-17 21:18:28 +0000
 1.8.2.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.13.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.12.5 27-Feb-2008  yamt sync with head.
 1.16.12.4 27-Oct-2007  yamt sync with head.
 1.16.12.3 03-Sep-2007  yamt sync with head.
 1.16.12.2 26-Feb-2007  yamt sync with head.
 1.16.12.1 21-Jun-2006  yamt sync with head.
 1.22.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.22.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.25.20.2 23-Mar-2008  matt sync with HEAD
 1.25.20.1 06-Nov-2007  matt sync with HEAD
 1.25.18.1 02-Oct-2007  joerg Sync with HEAD.
 1.25.14.1 15-Aug-2007  skrll Provide __SIMPLELOCK_{UN,}LOCKED_P and __cpu_simple_lock_{set,clear}
for all architectures.
 1.25.10.1 03-Oct-2007  garbled Sync with HEAD
 1.25.2.1 09-Oct-2007  ad Sync with head.
 1.27.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.27.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.27.12.1 24-Mar-2008  keiichi sync with head.
 1.28.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.28.4.1 04-May-2009  yamt sync with head.
 1.29.42.1 28-Aug-2017  skrll Sync with HEAD
 1.29.24.1 03-Dec-2017  jdolecek update from HEAD
 1.31.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3 03-Nov-1995  ragge No need for this file anymore; it's defines moved to other places.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file loconf.h was added on branch netbsd-1-0 on 1994-08-02 20:20:35 +0000
 1.2 04-Nov-2024  christos Undo previous lwp.h change.
 1.1 03-Nov-2024  christos Split __lwp_getprivate_fast and __lwp_*tcb from mcontext.h into a separate
lwp.h file.
 1.1 30-Nov-2024  christos branches: 1.1.4;
Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 30-Nov-2024  perseant file lwp_private.h was added on branch perseant-exfatfs on 2025-08-02 05:56:13 +0000
 1.46 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.45 01-Oct-2011  chs branches: 1.45.12; 1.45.30;
use gcc builtin for memset() on vax too.
 1.44 22-Nov-2007  plunky remove alias for _insque and _remque since they are no longer
used. leave the vax_insque function for no reason except that
it maps to an actual instruction.
 1.43 20-Nov-2007  yamt sync the prototype of cpu_switchto with sys/cpu.h.
 1.42 17-Oct-2007  garbled branches: 1.42.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.41 17-May-2007  yamt branches: 1.41.8; 1.41.10; 1.41.14;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.40 08-Apr-2007  matt branches: 1.40.4;
Use the ffs builtin in gcc4.1
 1.39 31-Mar-2007  matt s/volatile/__volatile
 1.38 04-Mar-2007  christos branches: 1.38.2; 1.38.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 08-Jul-2006  matt branches: 1.37.8; 1.37.10; 1.37.14;
Make GCC3/GCC4 happy with these asms.
 1.36 16-Feb-2006  perry branches: 1.36.2; 1.36.10;
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.35 24-Dec-2005  perry branches: 1.35.2; 1.35.4; 1.35.6;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.34 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.33 11-Dec-2005  christos merge ktrace-lwp.
 1.32 26-Jan-2005  he branches: 1.32.6;
Preserve the const qualifier even if we cast the "from" argument in the
memcpy() and memmove() inline functions.
 1.31 01-Jul-2004  kleink branches: 1.31.4; 1.31.6;
Tidy up the namespace: lint -> __lint__.
 1.30 18-Sep-2003  ragge branches: 1.30.2;
Remove ; after setrunqueue/remrunqueue macro.
 1.29 13-Aug-2003  ragge Some of the vax-specific mem*() functions did not check for len > 65535,
and when MAXDSIZ were increased memcpy() length sometimes were larger
than 64k (like in amap_extend()) All functions now checks the length.
This fixes PR#19968.

Disable the inline string functions and use the C versions instead.
 1.28 18-Jan-2003  thorpej branches: 1.28.2;
Merge the nathanw_sa branch.
 1.27 22-Sep-2002  gmcgarry Update for cpu_switch() prototype changes. No functional change.
 1.26 09-Jun-2002  matt Add -ffreestanding and LIBC= to stand/boot/*/Makefile. Fix various
asm's to work with gcc-current.
 1.25 24-Feb-2002  matt branches: 1.25.8;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.24 10-Feb-2002  thorpej * Add __unused__ attribute to inline functions.
* Call __blkclr() and __blkset() as appropriate.
 1.23 03-Jun-2001  ragge branches: 1.23.2; 1.23.8;
Add bbssi/bbcci (bit set/clear and branch interlocked) as inline functions.
 1.22 02-Jan-2001  matt branches: 1.22.2;
Redefine the memset/memmove/bcopy/bzero/memset macros to use more agressive
constraints in their inline asm. Gcc generates much better code now.
 1.21 27-Aug-2000  matt Since cpu_switch (aka Swtch) is now called at splsched() with sched_lock
locked, cpu_exit needs to do that too. Since in the lock debug case we
have to use a CALLS which wipes out R0-R6, change the convention for Swtch
so that the proc is passed in R6 and that R6 is clobbered. This is so
Swtch itself doesn't have to save/restore the proc pointer explicitly.
 1.20 19-Jul-2000  matt use size_t instead of u_int.
 1.19 01-Jul-2000  matt GCC 2.96 wants the = constraint first. Older gcc(s) don't care.
 1.18 09-Apr-2000  ragge Add insqti/remqhi macros. These macros are interlock queue instructions
used in multiprocessor systems as well as in uniprocessor environments
with intelligent I/O devices.
 1.17 07-Nov-1998  ragge branches: 1.17.12;
EGCS fixes. Implement htons as a C macro instead of asm; generates as
good code as the asm implementation _and_ can be optimized.
 1.16 08-Aug-1998  ragge Lots of kernlib functions rewritten as inline macros.
 1.15 02-Mar-1998  ragge Support for UVM on VAXen.
 1.14 18-Jan-1998  ragge Garbage-collect unnecessary functions. Don't have blkcpy/blkclr
as inline.
 1.13 05-Nov-1997  thorpej asm -> __asm__
 1.12 03-Nov-1997  ragge Use genassym for the first time in vax port history. Rewrite cpu_exit,
cpu_switch, setrunqueue and remrunqueue in assembler for efficiency.
 1.11 15-Mar-1997  ragge branches: 1.11.8;
Do not use inline functions in boot blocks. Some CPUs doesn't have
all instructions.
 1.10 11-Jan-1997  ragge Prototype change of scanc needs change here also.
 1.9 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.8 17-Mar-1996  ragge Fix type clashes.
 1.7 02-Feb-1996  mycroft ASSEMBLER -> _LOCORE
 1.6 13-Dec-1995  ragge waitabit() macro removed.
 1.5 20-Oct-1995  ragge branches: 1.5.2;
Use macros.h when STANDALONE is defined.
 1.4 05-Jul-1995  ragge nton?/ntoh? moved to endian.h.
 1.3 13-Feb-1995  ragge Lots of fixes...
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file macros.h was added on branch netbsd-1-0 on 1994-08-02 20:20:37 +0000
 1.5.2.2 20-Oct-1995  ragge Use macros.h when STANDALONE is defined.
 1.5.2.1 20-Oct-1995  ragge file macros.h was added on branch netbsd-1-1 on 1995-10-20 12:55:07 +0000
 1.11.8.1 05-Nov-1997  thorpej Update from trunk: asm -> __asm__
 1.17.12.2 05-Jan-2001  bouyer Sync with HEAD
 1.17.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.22.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.23.8.8 31-Dec-2002  thorpej Rename cpu_preempt() to cpu_switchto(), and make the caller remove the
new process from its run queue before calling cpu_switchto().

While here, make a few cpu_switch() and cpu_switchto() implementations
get the outgoing LWP from the args, rather than looking at the curlwp
variable.
 1.23.8.7 30-Dec-2002  thorpej Fix a couple of obvious problems with cpu_preempt():
* Change the calling convention so that it will work with the REI
executed at the end (i.e. push the PSL and use JSB, rather can CALLS,
as is done for cpu_switch()). This makes cpu_preempt() a macro, with
the actual routine being named Swtchto.
* Make sure to release the sched_lock, as appropriate.
 1.23.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.23.8.5 24-Jun-2002  nathanw Satisfy gcc by changing the declaration "register ret;" to "register int ret;",
as is done elsewhere in this file.
 1.23.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.23.8.3 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.23.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.23.8.1 03-Jun-2001  nathanw file macros.h was added on branch nathanw_sa on 2002-02-28 04:12:29 +0000
 1.23.2.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.23.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.23.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.25.8.1 15-Jul-2002  gehenna catch up with -current.
 1.28.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.28.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.2.1 03-Aug-2004  skrll Sync with HEAD
 1.30.2.1 02-Jul-2004  he Pull up revision 1.31 (requested by kleink in ticket #580):
Tidy up the namespace: lint -> __lint__.
 1.31.6.1 12-Feb-2005  yamt sync with head.
 1.31.4.1 29-Apr-2005  kent sync with -current
 1.32.6.4 07-Dec-2007  yamt sync with head
 1.32.6.3 03-Sep-2007  yamt sync with head.
 1.32.6.2 30-Dec-2006  yamt sync with head.
 1.32.6.1 21-Jun-2006  yamt sync with head.
 1.35.6.1 22-Apr-2006  simonb Sync with head.
 1.35.4.1 09-Sep-2006  rpaulo sync with head
 1.35.2.1 18-Feb-2006  yamt sync with head.
 1.36.10.1 13-Jul-2006  gdamore Merge from HEAD.
 1.36.2.1 11-Aug-2006  yamt sync with head
 1.37.14.1 07-Apr-2008  skrll Pullup changes to get vax shlibs working.
 1.37.10.3 15-Apr-2007  yamt sync with head.
 1.37.10.2 04-Apr-2007  matt Not quite functional idlelwp adaption for VAX. lwp fork works but the
kernel never seems to return/stay in usermode.
 1.37.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.8.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.38.4.1 11-Jul-2007  mjf Sync with head.
 1.38.2.3 03-Dec-2007  ad Sync with HEAD.
 1.38.2.2 27-May-2007  ad Sync with head.
 1.38.2.1 10-Apr-2007  ad Sync with head.
 1.40.4.1 22-May-2007  matt Update to HEAD.
 1.41.14.1 21-Nov-2007  bouyer Sync with HEAD
 1.41.10.2 09-Jan-2008  matt sync with HEAD
 1.41.10.1 06-Nov-2007  matt sync with HEAD
 1.41.8.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.41.8.1 21-Nov-2007  joerg Sync with HEAD.
 1.42.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.45.30.1 28-Aug-2017  skrll Sync with HEAD
 1.45.12.1 03-Dec-2017  jdolecek update from HEAD
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 11-Mar-2008  matt branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.10; 1.1.12;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.1.12.1 16-May-2008  yamt sync with head.
 1.1.10.1 18-May-2008  yamt sync with head.
 1.1.8.3 02-Jun-2008  mjf Sync with HEAD.
 1.1.8.2 03-Apr-2008  mjf Sync with HEAD.
 1.1.8.1 11-Mar-2008  mjf file mainbus.h was added on branch mjf-devfs2 on 2008-04-03 12:42:27 +0000
 1.1.6.2 24-Mar-2008  keiichi sync with head.
 1.1.6.1 11-Mar-2008  keiichi file mainbus.h was added on branch keiichi-mipv6 on 2008-03-24 07:15:06 +0000
 1.1.4.2 23-Mar-2008  matt sync with HEAD
 1.1.4.1 11-Mar-2008  matt file mainbus.h was added on branch matt-armv6 on 2008-03-23 02:04:25 +0000
 1.1.2.2 17-Mar-2008  yamt sync with head.
 1.1.2.1 11-Mar-2008  yamt file mainbus.h was added on branch yamt-lazymbuf on 2008-03-17 09:14:29 +0000
 1.10 30-Oct-2024  riastradh Sprinkle <sys/featuretest.h> where _*_SOURCE macros are consulted.

Otherwise, the feature tests might come out wrong. For example,
header files that check for _NETBSD_SOURCE won't get the default when
no other _*_SOURCE macros are defined; header files that check for
_POSIX_C_SOURCE might miss _XOPEN_SOURCE, which is supposed to imply
a corresponding _POSIX_C_SOURCE.

PR lib/58752: various header files test _*_SOURCE macros but don't
include sys/featuretest.h
 1.9 24-Jan-2023  christos branches: 1.9.6;
mark unused arguments as such
 1.8 27-Jul-2017  martin Some stupid pkgsrc stuff insists on -std=c89, duh!
Use __inline instead of inline.
 1.7 16-Sep-2013  martin branches: 1.7.6;
Change __isinf and __isnan from macros to inline functions. The macros do
collide with newer gcc libstdc++.
 1.6 05-Feb-2012  matt branches: 1.6.6; 1.6.10;
Define __INFINITY as huge_val since VAX FP doesn't have infinities.
 1.5 11-Dec-2005  christos branches: 1.5.112; 1.5.116;
merge ktrace-lwp.
 1.4 04-Mar-2004  kleink * Turn isinf(3) and isnan(3) into C99-style macros.
* Make it possible for ports to override these (i.e., VAX).
* Remove isnanl(), which was internal to libc only.
 1.3 20-Jan-2004  kleink Move FP_ROP and FP_DIRTYZERO from <math.h> to <vax/math.h> (where they
would have ended up if I hadn't missed the latter file in the commit).
 1.2 26-Oct-2003  kleink C99 7.12#4: provide INFINITY, which defaults to HUGE_VALF.
If infinities are not available, the machine-dependent header must define
__INFINITY as a positive constant of type float that overflows.
 1.1 23-Dec-1999  kleink branches: 1.1.6; 1.1.30;
C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
 1.1.30.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.30.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.30.1 03-Aug-2004  skrll Sync with HEAD
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 23-Dec-1999  bouyer file math.h was added on branch thorpej_scsipi on 2000-11-20 20:32:56 +0000
 1.5.116.1 18-Feb-2012  mrg merge to -current.
 1.5.112.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.112.1 17-Apr-2012  yamt sync with head
 1.6.10.1 18-May-2014  rmind sync with head
 1.6.6.2 03-Dec-2017  jdolecek update from HEAD
 1.6.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.6.1 28-Aug-2017  skrll Sync with HEAD
 1.9.6.1 02-Aug-2025  perseant Sync with HEAD
 1.15 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.14 04-Nov-2024  christos Undo previous lwp.h change.
 1.13 03-Nov-2024  christos Split __lwp_getprivate_fast and __lwp_*tcb from mcontext.h into a separate
lwp.h file.
 1.12 18-May-2024  thorpej branches: 1.12.2;
Clean up the <sys/ucontext.h> <-> <machine/mcontext.h> interface up
a little:
- Define _UC_MD_BIT* constants for the available machine-dependent bits,
and use those constants to define the machine-dependent bits as well
as the machine-independent bits that have machine-dependent values.
- Explicitly generate an error if _UC_TLSBASE, _UC_SETSTACK, or
_UC_CLRSTACK are not defined by <machine/mcontext.h>.
 1.11 17-May-2024  thorpej Implement _UC_SETSTACK / _UC_CLRSTACK.
 1.10 27-Dec-2019  kamil branches: 1.10.26;
Harmonize the namespace of fast TLS base pointer getter functions

Protect __lwp_getprivate_fast() with _RTLD_SOURCE, _LIBC_SOURCE and
__LIBPTHREAD_SOURCE__.

Include in this namespace <sys/tcl.h> and use __BEGIN_DECLS/__END_DECLS
for the sake of consistency.
 1.9 15-Feb-2018  kamil branches: 1.9.4;
Introduce _UC_MACHINE_FP() as a macro

_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer.

Don't rely on this interface as a compiler might strip frame pointer or
optimize it making this interface unreliable.


For hppa assume a small frame context, for larger frames FP might be located
in a different register (4 instead of 3).

For ia64 there is no strict frame pointer, and registers might rotate.
Reuse 79 following:

./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM LOC_REG (79)

Once ia64 will mature, this should be revisited.

A macro can encapsulate a real function for extracting Frame Pointer on
more complex CPUs / ABIs.


For the remaining CPUs, reuse standard register as defined in appropriate ABI.

The direct users of this macro are LLVM and GCC with Sanitizers.

Proposed on tech-userlevel@.

Sponsored by <The NetBSD Foundation>
 1.8 02-Feb-2012  matt branches: 1.8.40;
For fast lwp_getprivate, just do the chmk $SYS_lwp_getprivate inline.
 1.7 07-Jan-2012  chs define _UC_TLSBASE and use it to pass the TLS pointer to setcontext().
since there is no available space in ucontext_t on vax, pass the
TLS pointer on the stack referenced by the ucontext_t instead.
suggested by joerg.
 1.6 12-Apr-2011  matt branches: 1.6.4; 1.6.8;
Add __lwp_getprivate_fast
 1.5 28-Apr-2008  martin branches: 1.5.22; 1.5.28;
Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.76; 1.4.78;
merge ktrace-lwp.
 1.3 08-Oct-2003  thorpej Add some accessor macros for the ucontext:
* _UC_MACHINE_PC() - access the program counter
* _UC_MACHINE_INTRV() - access the integer return value register
* _UC_MACHINE_SET_PC() - set the program counter (this requires
special handling on some platforms).
 1.2 18-Jan-2003  thorpej branches: 1.2.2;
Merge the nathanw_sa branch.
 1.1 17-Nov-2001  matt branches: 1.1.2;
file mcontext.h was initially added on branch nathanw_sa.
 1.1.2.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.1.2.1 17-Nov-2001  matt Add initial version for VAX.
 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.78.1 16-May-2008  yamt sync with head.
 1.4.76.1 18-May-2008  yamt sync with head.
 1.4.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.22.1 21-Apr-2011  rmind sync with head
 1.6.8.1 18-Feb-2012  mrg merge to -current.
 1.6.4.1 17-Apr-2012  yamt sync with head
 1.8.40.3 21-Mar-2018  martin Pull up the following, requested by kamil in ticket #552:

external/gpl3/gcc{.old}/dist/libsanitizer/asan/asan_linux.cc 1.4
sys/arch/aarch64/include/mcontext.h 1.2
sys/arch/alpha/include/mcontext.h 1.9
sys/arch/amd64/include/mcontext.h 1.19
sys/arch/arm/include/mcontext.h 1.19
sys/arch/hppa/include/mcontext.h 1.9
sys/arch/i386/include/mcontext.h 1.14
sys/arch/ia64/include/mcontext.h 1.6
sys/arch/m68k/include/mcontext.h 1.10
sys/arch/mips/include/mcontext.h 1.22
sys/arch/or1k/include/mcontext.h 1.2
sys/arch/powerpc/include/mcontext.h 1.18
sys/arch/riscv/include/mcontext.h 1.5
sys/arch/sh3/include/mcontext.h 1.11
sys/arch/sparc/include/mcontext.h 1.14-1.17
sys/arch/sparc64/include/mcontext.h 1.10
sys/arch/vax/include/mcontext.h 1.9
tests/lib/libc/sys/Makefile 1.50
tests/lib/libc/sys/t_ucontext.c 1.2-1.5
sys/arch/hppa/include/mcontext.h 1.10
sys/arch/ia64/include/mcontext.h 1.7

- Introduce _UC_MACHINE_FP(). _UC_MACHINE_FP() is a helper
macro to extract from mcontext a frame pointer.
- Add new tests in lib/libc/sys/t_ucontext:
* ucontext_sp (testing _UC_MACHINE_SP)
* ucontext_fp (testing _UC_MACHINE_FP)
* ucontext_pc (testing _UC_MACHINE_PC)
* ucontext_intrv (testing _UC_MACHINE_INTRV)

Add a dummy implementation of _UC_MACHINE_INTRV() for ia64.

Implement _UC_MACHINE_INTRV() for hppa.

Make the t_ucontext.c test more portable.

We now have _UC_MACHINE_FP.
 1.8.40.2 26-Feb-2018  snj revert ticket 552, which broke the build
 1.8.40.1 25-Feb-2018  snj Pull up following revision(s) (requested by kamil in ticket #552):
sys/arch/aarch64/include/mcontext.h: 1.2
sys/arch/alpha/include/mcontext.h: 1.9
sys/arch/amd64/include/mcontext.h: 1.19
sys/arch/arm/include/mcontext.h: 1.19
sys/arch/hppa/include/mcontext.h: 1.9
sys/arch/i386/include/mcontext.h: 1.14
sys/arch/ia64/include/mcontext.h: 1.6
sys/arch/m68k/include/mcontext.h: 1.10
sys/arch/mips/include/mcontext.h: 1.22
sys/arch/or1k/include/mcontext.h: 1.2
sys/arch/powerpc/include/mcontext.h: 1.18
sys/arch/riscv/include/mcontext.h: 1.5
sys/arch/sh3/include/mcontext.h: 1.11
sys/arch/sparc/include/mcontext.h: 1.14-1.17
sys/arch/sparc64/include/mcontext.h: 1.10
sys/arch/vax/include/mcontext.h: 1.9
tests/lib/libc/sys/Makefile: 1.50
tests/lib/libc/sys/t_ucontext.c: 1.2
Introduce _UC_MACHINE_FP() as a macro
_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer.
Don't rely on this interface as a compiler might strip frame pointer or
optimize it making this interface unreliable.
For hppa assume a small frame context, for larger frames FP might be located
in a different register (4 instead of 3).
For ia64 there is no strict frame pointer, and registers might rotate.
Reuse 79 following:
./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM LOC_REG (79)
Once ia64 will mature, this should be revisited.
A macro can encapsulate a real function for extracting Frame Pointer on
more complex CPUs / ABIs.
For the remaining CPUs, reuse standard register as defined in appropriate ABI.
The direct users of this macro are LLVM and GCC with Sanitizers.
Proposed on tech-userlevel@.
Sponsored by <The NetBSD Foundation>
--
Improve _UC_MACHINE_FP() for SPARC/SPARC64
Introduce a static inline function _uc_machine_fp() that contains improved
caluclation of a frame pointer.
Algorithm:
uptr *stk_ptr;
# if defined (__arch64__)
stk_ptr = (uptr *) (*sp + 2047);
# else
stk_ptr = (uptr *) *sp;
# endif
*bp = stk_ptr[15];
Noted by <mrg>
--
Make _UC_MACHINE_FP() compile again and fix it so that it does not add
the offset twice.
--
fix _UC_MACHINE32_FP() -- use 32 bit pointer value so that [15] is
the right offset. do this by using __greg32_t, which is only in
the sparc64 version, and these are only useful there, so move them.
--
Add new tests in lib/libc/sys/t_ucontext
New tests:
- ucontext_sp
- ucontext_fp
- ucontext_pc
- ucontext_intrv
They test respectively:
- _UC_MACHINE_SP
- _UC_MACHINE_FP
- _UC_MACHINE_PC
- _UC_MACHINE_INTRV
These tests attempt to access and print the values from ucontext, without
interpreting the values.
This is a follow up of the _UC_MACHINE_FP() introduction.
These tests use PRIxREGISTER, and require to be built with -D_KERNTYPES.
Sponsored by <The NetBSD Foundation>
 1.9.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.10.26.1 17-Jun-2024  martin Pull up following revision(s) (requested by thorpej in ticket #694):

sys/arch/vax/vax/sig_machdep.c: revision 1.27
sys/arch/vax/include/mcontext.h: revision 1.11
sys/arch/vax/vax/machdep.c: revision 1.200

Implement _UC_SETSTACK / _UC_CLRSTACK.
 1.12.2.1 02-Aug-2025  perseant Sync with HEAD
 1.24 02-Nov-2021  ryo In order to prevent _mcount() from being recursively called when built with COPTS=-O0,
sprinkle `__always_inline' to make _mcount() be generated as a single function.
 1.23 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.22 13-May-2009  skrll branches: 1.22.22; 1.22.40;
Fix obvious typo in last.
 1.21 13-May-2009  mhitch Add "memory" clobber to mtpr for barrier. See also kern/38637.
 1.20 16-Feb-2007  matt branches: 1.20.48; 1.20.58; 1.20.62; 1.20.64;
Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.19 24-Dec-2005  perry __asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.18 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 27-Jun-2005  ragge branches: 1.16.2;
Update according to cast-qual addition.
 1.15 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.14 22-Jan-2003  ragge branches: 1.14.2;
Explicitly cast "g" arg to mtpr to long; to tell gcc that this
instruction will use long indexing.
 1.13 06-Jul-2000  ragge Some defines for the 6000/400 CPU.
 1.12 06-Jun-1999  ragge branches: 1.12.2;
Add some more IPRs for KA670.
 1.11 10-Aug-1998  ragge branches: 1.11.8;
Basic support for VS4000/60.
 1.10 05-Nov-1997  thorpej asm -> __asm__
 1.9 20-Jul-1996  ragge branches: 1.9.14;
Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.8 07-Mar-1996  ragge Support for VAX 8600/8650 added. Works with lots of Unibus adapters,
and will probably work with Massbus adapters as well. (Not tested,
but it's the same code as for 11/780). Ubareset's may cause crashes
on 8600 also like 11/780, but they are more uncommon. No support
for console RL02 yet, but it's likely to come.
 1.7 02-Feb-1996  mycroft ASSEMBLER -> _LOCORE
 1.6 02-Feb-1996  mycroft Fix #includes.
 1.5 03-May-1995  ragge mtpr support for 11/780 added. DELAY added. mcount() corrected.
trapframe fixed to support all registers.
 1.4 13-Feb-1995  ragge Lots of fixes...
 1.3 25-Nov-1994  ragge Lots of updates & fixes.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file mtpr.h was added on branch netbsd-1-0 on 1994-08-02 20:20:39 +0000
 1.9.14.1 05-Nov-1997  thorpej Update from trunk: asm -> __asm__
 1.11.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.2.2 26-Feb-2007  yamt sync with head.
 1.16.2.1 21-Jun-2006  yamt sync with head.
 1.20.64.1 18-May-2009  bouyer branches: 1.20.64.1.2;
Pull up following revision(s) (requested by mhitch in ticket #767):
sys/arch/vax/include/mtpr.h: revisions 1.21, 1.22
Add "memory" clobber to mtpr for barrier. See also kern/38637.
 1.20.64.1.2.1 21-Apr-2010  matt sync to netbsd-5
 1.20.62.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.58.1 18-May-2009  bouyer Pull up following revision(s) (requested by mhitch in ticket #767):
sys/arch/vax/include/mtpr.h: revisions 1.21, 1.22
Add "memory" clobber to mtpr for barrier. See also kern/38637.
 1.20.48.1 16-May-2009  yamt sync with head
 1.22.40.1 28-Aug-2017  skrll Sync with HEAD
 1.22.22.1 03-Dec-2017  jdolecek update from HEAD
 1.20 12-Jul-2023  riastradh machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.
 1.19 12-Jul-2023  mrg fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
 1.18 09-Jul-2023  riastradh machine/mutex.h: Sprinkle includes so this can be used by crash(8).

XXX pullup-10
 1.17 06-Apr-2022  riastradh branches: 1.17.4;
Nix trailing whitespace in files of membars, atomics, and lock stubs.

Will be touching many of these files soon for functional changes.

No functional change intended.
 1.16 25-Aug-2021  thorpej - In kern_mutex.c, if MUTEX_CAS() is not defined, define it in terms of
atomic_cas_ulong().
- For arm, ia64, m68k, mips, or1k, riscv, vax: don't define our own
MUTEX_CAS(), as they either use atomic_cas_ulong() or equivalent
(atomic_cas_uint() on m68k).
- For alpha and sparc64, don't define MUTEX_CAS() in terms of their own
_lock_cas(), which has its own memory barriers; the call sites in
kern_mutex.c already have the appropriate memory barrier calls. Thus,
alpha and sparc64 can use default definition.
- For sh3, don't define MUTEX_CAS() in terms of its own _lock_cas();
atomic_cas_ulong() is strong-aliased to _lock_cas(), therefore defining
our own MUTEX_CAS() is redundant.

Per thread:
https://mail-index.netbsd.org/tech-kern/2021/07/25/msg027562.html
 1.15 29-Nov-2019  riastradh Nix now-unused definitions of MUTEX_GIVE/MUTEX_RECEIVE.
 1.14 14-Aug-2014  martin branches: 1.14.20;
Revert previous changes, gcc configuration will be adapted instead.
 1.13 14-Aug-2014  martin Previously we used unsigned long int as __uintptr_t, but gcc prefers
__UINTPTR_TYPE__ as unsigned int, and now we use that for __uintptr_t
as well, so adapt MUTEX_CAS() accordingly.
 1.12 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.11 22-Feb-2008  matt branches: 1.11.2; 1.11.4;
Switch NetBSD/vax to the CAS model of mutexes. Fix the locking primitives
in lock_stubs.S so they actually function correctly.
 1.10 21-Nov-2007  yamt branches: 1.10.10; 1.10.14;
add comments
 1.9 21-Nov-2007  yamt make kmutex_t and krwlock_t smaller by killing lock id.
ok'ed by Andrew Doran.
 1.8 06-Apr-2007  matt branches: 1.8.12; 1.8.14; 1.8.18; 1.8.20;
Fix boolean inversion and missing definition.
 1.7 12-Mar-2007  matt branches: 1.7.2;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.6 09-Mar-2007  thorpej branches: 1.6.2;
Fix the INSV instruction in MUTEX_ACQUIRE(). From Hans Rosenfeld.
 1.5 19-Feb-2007  matt branches: 1.5.2;
Return rv, not 1, in MUTEX_ACQUIRE (spotted by mhitch)
 1.4 19-Feb-2007  ad MUTEX_NO_SPIN_ACTIVE_P() needs to be a macro, otherwise we end up in
circular dependency hell.
 1.3 17-Feb-2007  matt branches: 1.3.2;
Add an implementation for krwlock_t. Initialize ci_mtx_count to 1 (biased).
Fix a few buglets in the kmutex_t implementation.
 1.2 16-Feb-2007  ad MUTEX_SET_WAITERS(): return zero if the mutex has become unheld.
 1.1 16-Feb-2007  matt Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.3.2.4 07-Apr-2007  matt Sync with HEAD
 1.3.2.3 12-Mar-2007  rmind Sync with HEAD.
 1.3.2.2 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.3.2.1 17-Feb-2007  yamt file mutex.h was added on branch yamt-idlelwp on 2007-02-27 16:53:21 +0000
 1.5.2.5 27-Feb-2008  yamt sync with head.
 1.5.2.4 07-Dec-2007  yamt sync with head
 1.5.2.3 03-Sep-2007  yamt sync with head.
 1.5.2.2 26-Feb-2007  yamt sync with head.
 1.5.2.1 19-Feb-2007  yamt file mutex.h was added on branch yamt-lazymbuf on 2007-02-26 09:08:40 +0000
 1.6.2.3 03-Dec-2007  ad Sync with HEAD.
 1.6.2.2 10-Apr-2007  ad Sync with head.
 1.6.2.1 13-Mar-2007  ad Sync with head.
 1.7.2.1 11-Jul-2007  mjf Sync with head.
 1.8.20.1 08-Dec-2007  mjf Sync with HEAD.
 1.8.18.1 21-Nov-2007  bouyer Sync with HEAD
 1.8.14.2 23-Mar-2008  matt sync with HEAD
 1.8.14.1 09-Jan-2008  matt sync with HEAD
 1.8.12.1 21-Nov-2007  joerg Sync with HEAD.
 1.10.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.10.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.10.1 24-Mar-2008  keiichi sync with head.
 1.11.4.1 16-May-2008  yamt sync with head.
 1.11.2.1 18-May-2008  yamt sync with head.
 1.14.20.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.17.4.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.
 1.27 05-Jun-2011  matt device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.26 01-Jul-2010  ragge branches: 1.26.2; 1.26.6;
A big bunch of bugfixes from Johnny Billquist. Highlights:
- Makes the VAX8600 work as expected (500kg of hardware :-)
- Fix a hard-tracked bug causing VAXen to hang at splhigh.
 1.25 11-Mar-2008  matt branches: 1.25.4; 1.25.24; 1.25.26;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.24 04-Mar-2007  christos branches: 1.24.20; 1.24.36; 1.24.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.23 11-Dec-2005  christos branches: 1.23.26;
merge ktrace-lwp.
 1.22 27-Jun-2005  ragge branches: 1.22.2;
Update according to cast-qual addition.
 1.21 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.20 04-Jun-2002  ragge branches: 1.20.6;
Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.19 16-May-2001  matt branches: 1.19.2; 1.19.8; 1.19.16; 1.19.18;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.18 12-Jun-2000  ragge branches: 1.18.4;
Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.17 04-Jun-2000  ragge Clean up the sbi_attach_args struct and put in tag/handle.
Move a nice macro to scb.h.
 1.16 24-Jan-2000  matt branches: 1.16.2;
Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.15 07-Aug-1999  ragge branches: 1.15.2;
Clean up all bus handling stuff, it has become a mess the latest years.
Add a new bus; "ibus" that is the internal MicroVAX bus.
 1.14 23-May-1999  ragge Better and more understandable way to find out CPU type.
 1.13 02-Feb-1999  ragge branches: 1.13.4;
Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.12 20-Aug-1996  ragge Modify bus code arguments. Cleanup.
 1.11 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.10 02-Mar-1996  ragge Changes due to 11/780 support. Raise splimp() to BR7.
 1.9 02-Feb-1996  mycroft ASSEMBLER -> _LOCORE
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.6 13-Dec-1995  ragge Prevent against multiple includes.
 1.5 12-Nov-1995  ragge 11/750 specific things moved to ka750.h
 1.4 23-Feb-1995  ragge Def's for uVAXII added.
 1.3 13-Feb-1995  ragge Lots of fixes...
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file nexus.h was added on branch netbsd-1-0 on 1994-08-02 20:20:40 +0000
 1.13.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.15.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.16.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.18.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.19.18.1 05-Jun-2002  lukem Pull up revision 1.20 (requested by ragge in ticket #157):
Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.19.16.1 15-Jul-2002  gehenna catch up with -current.
 1.19.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.19.8.1 16-May-2001  nathanw file nexus.h was added on branch nathanw_sa on 2002-06-20 03:42:14 +0000
 1.19.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.6.1 03-Aug-2004  skrll Sync with HEAD
 1.22.2.2 17-Mar-2008  yamt sync with head.
 1.22.2.1 03-Sep-2007  yamt sync with head.
 1.23.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.24.36.1 24-Mar-2008  keiichi sync with head.
 1.24.20.1 23-Mar-2008  matt sync with HEAD
 1.25.26.2 12-Jun-2011  rmind sync with head
 1.25.26.1 03-Jul-2010  rmind sync with head
 1.25.24.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.25.4.1 11-Aug-2010  yamt sync with head.
 1.26.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.26.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.64 31-May-2021  simonb Include "opt_param.h" (ifdef _KERNEL_OPT) everywhere that MSGBUFSIZE is
referenced since some sources include <machine/param.h>.
 1.63 01-May-2020  isaki branches: 1.63.6;
Move machine dependent AUDIO_BLK_MS default value to <machine/param.h>.
If the port has __AUDIO_BLK_MS in <machine/param.h>, it will be used.
Otherwise the default value (currently 10 msec) defined in audio.c will
be used. This mechanism is for very old ports which cannot satisfactorily
handle 10 msec block. Currently hppa, m68k, sh3, sparc(!64) and vax are.

For port maintainers, if general models in your port cannot satisfactorily
handle 10 msec block, please consider to define your suitable longer period
(40 msec would be a good first choice).
But please don't be eager to make the default value shorter.

<machine/param.h> was discussed in source-changes-d. It's better than
ifdef storm, or adding 60+ new header files in every arch/*/include/
directories for this. Thanks mrg@, ad@, and everyone.
http://mail-index.netbsd.org/source-changes-d/2020/05/01/msg012572.html
 1.62 07-Jan-2019  jdolecek branches: 1.62.4;
move DEV_BSIZE, DEV_BSHIFT out of MD param.h, they are same on all ports

also move BLKDEV_IOSIZE, MAXPHYS, but allow override since some ports
have different value (powerpc uses NBPG for BLKDEV_IOSIZE, sun2/sun3
have lower MAXPHYS)
 1.61 23-Jan-2014  jklos branches: 1.61.28; 1.61.30;
Removed MAXBSIZE. Cleared with Anders Magnusson and tested myself.
 1.60 24-Jan-2012  christos branches: 1.60.6; 1.60.10;
Use and define ALIGN() ALIGN_POINTER() and STACK_ALIGN() consistently,
and avoid definining them in 10 different places if not needed.
 1.59 20-Jan-2012  joerg Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressions
again. This was changed in sys/socket.h r1.51 to work around fallout
from the IPv6 aux data migration. It broke the historic ABI on some
platforms. This commit restores compatibility for netbsd32 code on such
platforms and provides a template for future changes to the CMSG_*
alignment. Revert PCC/Clang workarounds in postfix and tmux.
 1.58 08-Feb-2010  joerg branches: 1.58.10; 1.58.14;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
 1.57 21-Nov-2009  rmind branches: 1.57.2;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.56 02-Jul-2008  ad Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.55 11-Mar-2008  matt branches: 1.55.4; 1.55.6; 1.55.8;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.54 28-Aug-2006  yamt branches: 1.54.32; 1.54.52; 1.54.56;
- remove unused bdbtofsb.
- move the following macros from MD headers to sys/param.h.
ctod
dtoc
ctob
btoc
dbtob
btodb
 1.53 11-Dec-2005  christos branches: 1.53.4; 1.53.8;
merge ktrace-lwp.
 1.52 07-Aug-2003  agc branches: 1.52.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.51 26-Feb-2003  matt branches: 1.51.2;
Make common macros like every other port. Now newfs_lfs builds again.
 1.50 21-Apr-2002  ragge Cast some args to unsigned long (used with pointers).
 1.49 24-Mar-2002  jdolecek Limit the KVA used for pipe loaned memory to 64KB, vax doesn't have too
much KVA space spare. This fixes port-vax/13333 by Manuel Bouyer.
Reviewed by: Anders Magnusson

XXX this is not ideal, need to find better solution
 1.48 26-Feb-2002  simonb Purge CLSIZE, CLSIZELOG2 and MCLOFSET.
Be consistant in the way that MSIZE, MCLSHIFT, MCLBYTES and NMBCLUSTERS
are defined.
Remove old VM constants from cesfic port.
Bump MSIZE to 256 on mipsco (the only one that wasn't already 256).
 1.47 27-Jul-2001  ragge branches: 1.47.6;
Set MAXPHYS to 64k instead of 63k.
 1.46 30-May-2001  mrg branches: 1.46.2;
use _KERNEL_OPT
 1.45 15-Nov-2000  matt branches: 1.45.2;
Convert some spaces to tabs.
 1.44 30-Jun-2000  itojun raise MSIZE from 128 to 256.
- for sizeof(void *) == 8 arch, this is mandatory. MHLEN is too small
already (less than 80) and there are chances for unwanted packet loss due
to m_pullup restriction.
- for other cases, the change should avoid allocating clusters in most cases
(even when you have IPv4 IPsec tunnel, or IPv6 with moderate amount of
extension header)

portmasters: if your arch chokes with the change (high memory usage or
whatever), please backout the change for your arch.
 1.43 02-Jun-2000  matt branches: 1.43.2;
Move spl macros from <machine/param.h> to <machine/intr.h>
Fix botch on my part and make the IPL_* match reality on VAX.
Redefine spl macro using the symbolic IPL_ instead of being hardcoded.
Move schedsoftnet, schedsoftclock from <machine/cpu.h> to <machine/intr.h>
Add a _setsirr macro for schedsoft*.
Add softintr function and framework.
 1.42 07-Mar-2000  matt branches: 1.42.2;
add real vmapbuf/vunmapbuf routines. needed for VS4000 SCSI support.
 1.41 11-Feb-2000  thorpej Update for the NKMEMPAGES changes.
 1.40 12-Dec-1999  ragge CL* discarding.
 1.39 22-Oct-1999  ragge Remove the vmapbuf()/vunmapbuf() routines. They are quite unneccessary
on a machine that has MMU for its I/O devices.
 1.38 05-Aug-1999  thorpej branches: 1.38.2; 1.38.4; 1.38.6;
Implement priority raising, and use it as appropriate.
 1.37 05-Aug-1999  thorpej Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied. Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

This fixes a problem with using the "rnd" pseudo-device from within
interrupt context to extract random data (e.g. from within the softnet
interrupt) where doing so would incorrectly unblock interrupts (causing
all sorts of lossage).

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX. This platforms still have this bug until their
XXX spl*() functions are fixed.
 1.36 02-May-1999  ragge EEEK! The signal changes a while ago caused the user struct to be
on top of the "red zone" in the kernel stack. This phenomenon has
caused many unexplainable things to happen the last year.
 1.35 19-Jan-1999  ragge branches: 1.35.2;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.34 01-Jan-1999  ragge Giant change: NBPG now set to 4k and CLSIZE == 1 for vax. This change
made a whole bunch of annoying bugs disappear; mostly depending on
bad use of NBPG in non-MD code. The VAX port was the only port that
used this historical "feature".

The CL* macros should probably go away totally, there is no reason
at all to keep them.
 1.33 29-Nov-1998  ragge the btoc/ctob/btop macros must use CLBYTES, not NBPG. How this should
work in the long run is an open issue; some parts must be reworked
in a MI way.
 1.32 25-Aug-1998  ragge Kernel stach should be 4K, not 32K. Increase MCLSHIFT to 11.
Remove ovbcopy().
 1.31 21-Aug-1998  ragge VAX logical page size increased to 4k.
 1.30 20-Jun-1998  ragge Expand kmem map.
 1.29 29-Apr-1998  thorpej Pull in opt_gateway.h as appropriate.
 1.28 05-Nov-1997  thorpej asm -> __asm__
 1.27 02-Nov-1997  ragge Major rewriting, optimization and simplifying of the pmap code:

- Map in all physical memory first in system space. This reduces
pmap_copy_page() and pmap_zero_page to 3 resp. 2 instructions.
- Have fized position user page tables. Makes the pv_table smaller
and all reverse references faster (and simpler).
- Remove the wiring code. Nobody doesn't even know what a DR32 is anymore.
- Simulate page reference bit by setting page invalid, as suggested by
Rich Draves in a paper for 1991 Mach Usenix Symposium.

This reduced the time spent in the pmap module to between 70-75% of
the previous; and made process startup _much_ faster.
 1.26 19-Oct-1997  ragge branches: 1.26.2;
MSGBUFSIZE must be in CLBYTES, not NBPG. Also expand it to 4 * CLBYTES.
 1.25 19-Sep-1997  leo Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
 1.24 05-Aug-1997  ragge delay() must be protected by #ifdef _KERNEL.
 1.23 24-Feb-1997  fvdl branches: 1.23.4;
Define ALIGNED_POINTER
 1.22 11-Jan-1997  ragge branches: 1.22.6;
#define MAXBSIZE to some nice value.
 1.21 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.20 10-Jul-1996  ragge Add spl4 - spl7 macros, easy to use when playing with buses.
 1.19 04-Mar-1996  cgd add _MACHINE and _MACHINE_ARCH, which are like MACHINE and MACHINE_ARCH,
execpt without quotes. meant to be __CONCAT()ted for easy #includes
of machine-dependent headers for MI code (e.g. for the MI ISA/EISA/PCI/TC
bus code).
 1.18 02-Mar-1996  ragge Changes due to 11/780 support. Raise splimp() to BR7.
 1.17 01-Mar-1996  cgd Clean up tabbing/spacing in defns of MACHINE, MACHINE_ARCH, and MID_MACHINE.
 1.16 11-Feb-1996  ragge Prototype for delay().
 1.15 02-Feb-1996  mycroft Fix #includes.
 1.14 30-Dec-1995  ragge An '&' missing in splx macro; causing that sometimes didn't
the interrupt level get set.
 1.13 04-Dec-1995  ragge Added earlier forgotten MACHINE_ARCH, pointed out by Arne Henrik Juul.
Cleaned up a bit.
 1.12 13-Aug-1995  mycroft Fix comment on splnet().
 1.11 13-Aug-1995  mycroft Replace splnet() with splsoftnet(). Add splnet().
 1.10 26-Jun-1995  cgd clean up definitions of ctod(), dtoc(), ctob(), btoc(), btodb(), and
dbtob(). remove unused definitions of ctos(), stoc(), and dtob().
 1.9 16-Jun-1995  ragge DDB support. splddb() and trapcode for ddb.
 1.8 03-May-1995  ragge mtpr support for 11/780 added. DELAY added. mcount() corrected.
trapframe fixed to support all registers.
 1.7 30-Mar-1995  ragge Some bug fixes & update of pcb.
 1.6 18-Mar-1995  cgd don't be so quick to cast macro arguments to unsigned; if the
arguments are really off_t's (e.g. to btodb), then you can lose
information. This was the "> 4G file systems don't work" bug; physio
uses btodb, which was broken.
 1.5 13-Feb-1995  ragge Lots of fixes...
 1.4 25-Nov-1994  ragge Lots of updates & fixes.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Minor updates of some errouneous parameters.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Minor updates of some errouneous parameters.
 1.2.2.1 16-Aug-1994  ragge file param.h was added on branch netbsd-1-0 on 1994-08-16 23:41:55 +0000
 1.22.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.23.4.2 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.26.2.1 05-Nov-1997  thorpej Update from trunk: asm -> __asm__
 1.35.2.1 03-May-1999  perry branches: 1.35.2.1.2;
pullup 1.35->1.36 (ragge)
 1.35.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.38.6.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.38.6.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.38.4.1 15-Nov-1999  fvdl Sync with -current
 1.38.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.38.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.42.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.43.2.1 23-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)

raise MSIZE from 128 to 256.
- for sizeof(void *) == 8 arch, this is mandatory. MHLEN is too small
already (less than 80) and there are chances for unwanted packet loss due
to m_pullup restriction.
- for other cases, the change should avoid allocating clusters in most cases
(even when you have IPv4 IPsec tunnel, or IPv6 with moderate amount of
extension header)

portmasters: if your arch chokes with the change (high memory usage or
whatever), please backout the change for your arch.

1.1 -> 1.2 syssrc/sys/arch/amigappc/include/param.h
1.13 -> 1.14 syssrc/sys/arch/arc/include/param.h
1.1 -> 1.2 syssrc/sys/arch/arm26/include/param.h
1.17 -> 1.18 syssrc/sys/arch/arm32/include/param.h
1.6 -> 1.7 syssrc/sys/arch/bebox/include/param.h
1.4 -> 1.5 syssrc/sys/arch/cobalt/include/param.h
1.4 -> 1.5 syssrc/sys/arch/evbsh3/include/param.h
1.2 -> 1.3 syssrc/sys/arch/hpcmips/include/param.h
1.40 -> 1.41 syssrc/sys/arch/i386/include/param.h
1.7 -> 1.8 syssrc/sys/arch/m68k/include/param.h
1.9 -> 1.10 syssrc/sys/arch/macppc/include/param.h
1.4 -> 1.5 syssrc/sys/arch/mmeye/include/param.h
1.6 -> 1.7 syssrc/sys/arch/newsmips/include/param.h
1.7 -> 1.8 syssrc/sys/arch/ofppc/include/param.h
1.23 -> 1.24 syssrc/sys/arch/pc532/include/param.h
1.32 -> 1.33 syssrc/sys/arch/pmax/include/param.h
1.7 -> 1.8 syssrc/sys/arch/powerpc/include/param.h
1.1 -> 1.2 syssrc/sys/arch/prep/include/param.h
1.1 -> 1.2 syssrc/sys/arch/sgimips/include/param.h
1.3 -> 1.4 syssrc/sys/arch/sh3/include/param.h
1.44 -> 1.45 syssrc/sys/arch/sparc/include/param.h
1.21 -> 1.22 syssrc/sys/arch/sparc64/include/param.h
1.43 -> 1.44 syssrc/sys/arch/vax/include/param.h
 1.45.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.46.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.46.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.46.2.1 03-Aug-2001  lukem update to -current
 1.47.6.4 20-Jun-2002  nathanw Catch up to -current.
 1.47.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.47.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.47.6.1 27-Jul-2001  nathanw file param.h was added on branch nathanw_sa on 2002-02-28 04:12:29 +0000
 1.51.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.51.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.51.2.1 03-Aug-2004  skrll Sync with HEAD
 1.52.16.2 17-Mar-2008  yamt sync with head.
 1.52.16.1 30-Dec-2006  yamt sync with head.
 1.53.8.1 03-Sep-2006  yamt sync with head.
 1.53.4.1 09-Sep-2006  rpaulo sync with head
 1.54.56.2 02-Jul-2008  mjf Sync with HEAD.
 1.54.56.1 03-Apr-2008  mjf Sync with HEAD.
 1.54.52.1 24-Mar-2008  keiichi sync with head.
 1.54.32.1 23-Mar-2008  matt sync with HEAD
 1.55.8.1 03-Jul-2008  simonb Sync with head.
 1.55.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.55.4.2 11-Mar-2010  yamt sync with head
 1.55.4.1 04-May-2009  yamt sync with head.
 1.57.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.58.14.1 18-Feb-2012  mrg merge to -current.
 1.58.10.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.58.10.1 17-Apr-2012  yamt sync with head
 1.60.10.1 18-May-2014  rmind sync with head
 1.60.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.61.30.1 10-Jun-2019  christos Sync with HEAD
 1.61.28.1 18-Jan-2019  pgoyette Synch with HEAD
 1.62.4.1 18-May-2020  martin Pull up following revision(s) (requested by isaki in ticket #911):

sys/dev/audio/audiodef.h: revision 1.13
sys/dev/audio/audiodef.h: revision 1.14
sys/arch/sparc/include/param.h: revision 1.74
sys/arch/evbarm/conf/GENERIC64: revision 1.148
sys/arch/sh3/include/param.h: revision 1.25
sys/arch/evbarm/conf/GENERIC: revision 1.75
sys/arch/m68k/include/param.h: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.564
sys/arch/hppa/include/param.h: revision 1.27
sys/dev/audio/audio.c: revision 1.68
sys/arch/vax/include/param.h: revision 1.63
sys/dev/audio/audio.c: revision 1.69

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.

- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.

Set AUDIO_BLK_MS 40 msec on other old(slow) architectures not only m68k.

Thanks tsutsui@ for comment about architecture choice.
And move it from audiodef.h to audio.c as suggested by joerg@.


Move machine dependent AUDIO_BLK_MS default value to <machine/param.h>.
If the port has __AUDIO_BLK_MS in <machine/param.h>, it will be used.

Otherwise the default value (currently 10 msec) defined in audio.c will
be used. This mechanism is for very old ports which cannot satisfactorily
handle 10 msec block. Currently hppa, m68k, sh3, sparc(!64) and vax are.

For port maintainers, if general models in your port cannot satisfactorily
handle 10 msec block, please consider to define your suitable longer period
(40 msec would be a good first choice).

But please don't be eager to make the default value shorter.
<machine/param.h> was discussed in source-changes-d. It's better than
ifdef storm, or adding 60+ new header files in every arch/*/include/
directories for this. Thanks mrg@, ad@, and everyone.
http://mail-index.netbsd.org/source-changes-d/2020/05/01/msg012572.html
 1.63.6.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.16 11-Dec-2022  oster Support save/restore of AST levels in the PCB for context switching.

Code written by ragge@ , tested by oster@.
 1.15 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.14 03-Jul-2011  matt branches: 1.14.12; 1.14.30;
Cleanup trapframe handling. Instead of keeping a trapframe pointer in the
pcb, put in the mdlwp instead. We had a dummy field so it didn't grow in
size. This also follows the practice that mips and powerpc follow that a
pointer to the user trapframe is in l->l_md.md_utf. Make trapframe members
start with tf_
 1.13 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.12 22-Feb-2008  matt branches: 1.12.4; 1.12.24; 1.12.26;
Fix a bug in the pmap pcb tracking code. While here, rewrite it to simplier.
Use a field in the pcb itself (since it's basically free) and keep track of
what pmap "owns" a pcb (for consistency checking). use M_ZERO as appropriate.
 1.11 20-Feb-2008  matt branches: 1.11.2; 1.11.6;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.10 02-Feb-1996  mycroft branches: 1.10.80; 1.10.142;
Fix #includes.
 1.9 28-Jan-1996  ragge Change void* to struct pcb* for page table pointers.
 1.8 07-May-1995  ragge Machine dependent core dump struct added.
 1.7 30-Mar-1995  ragge Some bug fixes & update of pcb.
 1.6 23-Feb-1995  ragge Def's for uVAXII added.
 1.5 13-Feb-1995  ragge Lots of fixes...
 1.4 25-Nov-1994  ragge Lots of updates & fixes.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Changes to make files more 4.4/1.0B working.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file pcb.h was added on branch netbsd-1-0 on 1994-08-02 20:20:43 +0000
 1.10.142.1 23-Mar-2008  matt sync with HEAD
 1.10.80.1 27-Feb-2008  yamt sync with head.
 1.11.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.2.1 24-Mar-2008  keiichi sync with head.
 1.12.26.1 30-May-2010  rmind sync with head
 1.12.24.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.12.4.1 11-Aug-2010  yamt sync with head.
 1.14.30.1 28-Aug-2017  skrll Sync with HEAD
 1.14.12.1 03-Dec-2017  jdolecek update from HEAD
 1.82 21-Mar-2020  ad PR port-vax/55094: vax pmap needs locking adjustments

Make the adjustments noted in the PR and don't call uvm_wait() or do
WAITOK ever - UVM takes care of that.
 1.81 14-Mar-2020  ad pmap_remove_all(): Return a boolean value to indicate the behaviour. If
true, all mappings have been removed, the pmap is totally cleared out, and
UVM can then avoid doing the work to call pmap_remove() for each map entry.
If false, either nothing has been done, or some helpful arch-specific voodoo
has taken place.
 1.80 24-May-2011  matt branches: 1.80.56;
Remove pmap's simple_lock; switch to atomic ops
Change pvtable simple_lock to mutex
Switch to kmem (goodbye malloc).
 1.79 14-Nov-2010  uebayasi branches: 1.79.2;
Move struct vm_page_md definition from vmparam.h to pmap.h, because
it's used only by pmap. vmparam.h has definitions for wider
audience.

All GENERIC kernels build tested, except ia64.

powerpc/include/booke/vmparam.h has one too, but it has no pmap.h,
so it's left as is.
 1.78 12-Nov-2010  uebayasi Pull in uvm/uvm.h for VM_PAGE_TO_PHYS().
 1.77 21-Oct-2009  rmind branches: 1.77.2; 1.77.4;
Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.76 09-Dec-2008  pooka Make pmap_kernel() a MI macro for struct pmap *kernel_pmap_ptr,
which is now the "API" provided by the pmap module. pmap_kernel()
remains as the syntactic sugar.

Bonus cosmetics round: move all the pmap_t pointer typedefs into
uvm_pmap.h.

Thanks to Greg Oster for providing cpu muscle for doing test builds.
 1.75 11-Mar-2008  matt branches: 1.75.4; 1.75.10; 1.75.12;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.74 22-Feb-2008  matt Fix a bug in the pmap pcb tracking code. While here, rewrite it to simplier.
Use a field in the pcb itself (since it's basically free) and keep track of
what pmap "owns" a pcb (for consistency checking). use M_ZERO as appropriate.
 1.73 03-Feb-2008  matt branches: 1.73.2; 1.73.6;
Add PMAP_VTOPHYS
 1.72 04-Jan-2008  joerg Needs sys/simplelock.h.
 1.71 22-Feb-2007  thorpej branches: 1.71.22; 1.71.28; 1.71.34;
TRUE -> true, FALSE -> false
 1.70 21-Feb-2007  thorpej 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.69 19-Feb-2007  chs in pmap_extract(), check for the PTE being valid in addition to
the PTP being valid when deciding if a user mapping exists.
 1.68 08-Jul-2006  matt branches: 1.68.8; 1.68.10;
Reorganize pmap_extract so that *pap is always set to quash gcc4
uninitialized use warnings.
 1.67 15-Apr-2006  matt branches: 1.67.4;
No reason to do *(vaddr_t *)& dance. We only assign to vaddr_t
 1.66 12-Mar-2006  matt branches: 1.66.2;
Fix various places where assignment happen to casted lvalues.
(t)v = foo; is not legal C.
 1.65 16-Feb-2006  perry branches: 1.65.2; 1.65.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.64 16-Jan-2006  is branches: 1.64.2; 1.64.4;
pmap_is_referenced - copied from pmap_clear_reference, reviewd by ragge@
 1.63 24-Dec-2005  perry branches: 1.63.2;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.62 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.61 11-Dec-2005  christos merge ktrace-lwp.
 1.60 14-Dec-2003  ragge branches: 1.60.16;
TOPDOWN_VM is now mandatory on vax.
 1.59 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.58 02-Mar-2003  ragge branches: 1.58.2;
Change the pmap to use 512-byte pages as user page table pages instead of
PAGE_SIZE pages (4k). An average small program uses ~6 4k pages (24k),
while the same program only uses ~20 512 byte pages (10k), so it will be
a small memory usage improvement. The large improvement will be the upcoming
ability to share page table pages between processes for shared libraries.

Remaining: should be able to give back ptp pages to the system.
 1.57 26-Feb-2003  ragge Enable USE_TOPDOWN_VM. This also makes it possible to use large address
spaces, so bump MAXDSIZ to 1GB.
 1.56 22-Sep-2002  chs it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.
 1.55 22-Sep-2002  chs add pmap_remove_all() hook (empty on most platforms so far).
 1.54 13-May-2002  matt Eliminate commons.
 1.53 21-Mar-2002  ragge Inline functions that mostly do not need to be called. Partly
rearrange/change the code to be able to avoid some inefficient functions.
Profiling shows that the time spent in pmap now is decreased by 20%. (!)
 1.52 10-Mar-2002  ragge Major update of the vax pmap:
- Reinstall the "dynamic page table length" that was removed some
years ago.
- Limit the user page table submap to max 5% of available memory.
- Free the page table space when a process is swapped out.
- If the UPT submap runs out of space, throw away pmap mappings
using the same algorithm as for swapping processes.

As a result of this, 4MB machines are useable again and it's even possible
to compile a kernel for 2MB machines (but it will be slow... :-)

Still to do:
- Multiprocessor fixes.
- More profiling.
 1.51 01-Mar-2002  ragge usrptsize was not correct calculated, fixed.
Add space to system page table for the UVM kernel area.
This fixes the KVM usage problem that Manuel Bouyer reported a while ago.
 1.50 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.49 24-Sep-2001  chs branches: 1.49.4;
implement pmap_wired_count().
 1.48 10-Sep-2001  chris Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.47 31-Aug-2001  simonb branches: 1.47.2;
Use comments around the token after a #endif.
 1.46 04-Jun-2001  ragge branches: 1.46.2;
The beginning of pmap locks. While here, some cleaning and KNF.
 1.45 26-May-2001  chs replace vm_page_t with struct vm_page *.
 1.44 22-Apr-2001  thorpej Undo a misguided previous change to the pmap_update() API.
 1.43 22-Apr-2001  thorpej Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.
 1.42 21-Apr-2001  thorpej pmap_update() should not be equated with "flush entire TLB", it is
used to process deferred pmap operations. Since these pmaps don't
defer anything, pmap_update() is a noop.
 1.41 21-Nov-2000  chs branches: 1.41.2;
eliminate TRUNC_PAGE() and ROUND_PAGE() in favor of their
lowercase counterparts. also, a little misc cleanup.
 1.40 08-Aug-2000  ragge Remove some unneccessary TBIA's. Keep track of wired pages.
Fix PR#8503 (refcount error).
 1.39 19-Mar-2000  ragge branches: 1.39.4;
First cut of multiprocessor support for vax. Still much to do before
other CPUs than the master can spin up.
 1.38 04-Mar-2000  matt expunge vm_offset_t and vm_size_t.
add bus_dma support for the vs4000 dma translation map (sgmap).
enhance the vsbus for the lance to work with it.
remove the sgmap init code from ka46/48/49.c
 1.37 01-Aug-1999  ragge branches: 1.37.2;
A bunch of changes:
- Free pte pages not in use anymore.
- Inline pmap_extract().
- Fix annoying page reference/modify bug. Fixes PR#7858 & PR#7859.
 1.36 30-Jun-1999  ragge Use pmap_steal_memory() for early memory allocation.
 1.35 17-Jun-1999  thorpej pmap_change_wiring() -> pmap_unwire().
 1.34 17-Jun-1999  thorpej Remove pmap_pageable(); no pmap implements it, and it is not really useful,
because pmap_enter()/pmap_change_wiring() (soon to be pmap_unwire())
communicate the information in greater detail.
 1.33 14-Apr-1999  ragge Use the pool allocator for mbufs instead of a separate submap.
 1.32 24-Mar-1999  mrg branches: 1.32.4;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.31 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.30 01-Jan-1999  ragge Giant change: NBPG now set to 4k and CLSIZE == 1 for vax. This change
made a whole bunch of annoying bugs disappear; mostly depending on
bad use of NBPG in non-MD code. The VAX port was the only port that
used this historical "feature".

The CL* macros should probably go away totally, there is no reason
at all to keep them.
 1.29 29-Nov-1998  ragge - Save R/M bits after a page is unmapped.
- Keep track of mapping count (for statistics).
- vm_offset_t -> vaddr_t/paddr_t.
- Move away counting of available memory.
 1.28 21-Aug-1998  ragge VAX logical page size increased to 4k.
 1.27 03-May-1998  ragge Remove the ancient kernel-stack area at top of P1 region. Make PMAP_NEW
almost work. Also Wall cleaning.
 1.26 18-Feb-1998  cgd Move pmap_map() function definition to MD headers, as appropriate. It's
an internal function, and the VM system shouldn't try to prototype it.
(Note that some ports _don't_ prototype it.)
 1.25 31-Jan-1998  ragge Re-implement page reference bit emulation by using the (otherwise unused)
valid bit. This is faster than the "unmap all" solution that were described
in that Mach paper _and_ it eliminates the need for checking the wired bit.
As a result of this; swapping started working again on vax :-)
 1.24 18-Jan-1998  ragge Fix page size initialisation.
 1.23 03-Jan-1998  thorpej Now that all ports have pmap_activate(), and it has an identical interface,
prototype it in <vm/pmap.h>
 1.22 03-Jan-1998  thorpej - Remove the PCB pointer from the pmap structure. Instead, store the
page {0,1} base and length registers in the pmap structure. They will
be loaded in to the PCB when the process's address space is activated
by way of pmap_activate().
- Remove pmap_pinit() macro; it's now a real function.
- Prototypes for pmap_pinit(), pmap_activate(), pmap_deactivate().
 1.21 05-Nov-1997  thorpej asm -> __asm__
 1.20 02-Nov-1997  ragge Major rewriting, optimization and simplifying of the pmap code:

- Map in all physical memory first in system space. This reduces
pmap_copy_page() and pmap_zero_page to 3 resp. 2 instructions.
- Have fized position user page tables. Makes the pv_table smaller
and all reverse references faster (and simpler).
- Remove the wiring code. Nobody doesn't even know what a DR32 is anymore.
- Simulate page reference bit by setting page invalid, as suggested by
Rich Draves in a paper for 1991 Mach Usenix Symposium.

This reduced the time spent in the pmap module to between 70-75% of
the previous; and made process startup _much_ faster.
 1.19 06-Jul-1997  ragge Remove __VM_PMAP_HACK.
 1.18 16-May-1997  gwr Add #define __VM_PMAP_HACK as a temporary measure.
 1.17 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.16 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.15 09-Mar-1996  ragge We lost declaration of kernel_pmap_store somewhere, put it back.
 1.14 07-Mar-1996  ragge Support for VAX 8600/8650 added. Works with lots of Unibus adapters,
and will probably work with Massbus adapters as well. (Not tested,
but it's the same code as for 11/780). Ubareset's may cause crashes
on 8600 also like 11/780, but they are more uncommon. No support
for console RL02 yet, but it's likely to come.
 1.13 11-Feb-1996  ragge PAGE_SIZE should be PAGE_SHIFT. Really ugly bug!
 1.12 02-Feb-1996  mycroft Fix #includes.
 1.11 12-Nov-1995  ragge Macros for locore mapping added.
 1.10 11-May-1995  jtc KERNEL -> _KERNEL
 1.9 05-May-1995  ragge BROKEN_SWAP removed, swapping verified OK.
pmap_collect(pmap) added as null define.
 1.8 12-Apr-1995  ragge Added regs for trace.
 1.7 10-Apr-1995  mycroft Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.
 1.6 13-Feb-1995  ragge Lots of fixes...
 1.5 25-Nov-1994  ragge Lots of updates & fixes.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Changes to make files more 4.4/1.0B working.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Minor updates of some errouneous parameters.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Minor updates of some errouneous parameters.
 1.2.2.1 16-Aug-1994  ragge file pmap.h was added on branch netbsd-1-0 on 1994-08-16 23:41:57 +0000
 1.32.4.3 02-Aug-1999  thorpej Update from trunk.
 1.32.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.32.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.37.2.3 23-Apr-2001  bouyer Sync with HEAD.
 1.37.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.37.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.39.4.1 13-Aug-2000  ragge Pull up revisions (requested by ragge):
pmap.c 1.85-1.86
pmap.h 1.40

Remove some unneccessary TBIA's. Keep track of wired pages.
Fix PR#8503 (refcount error).
 1.41.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.46.2.5 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.46.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.46.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.46.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.46.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.47.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.49.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.49.4.4 20-Jun-2002  nathanw Catch up to -current.
 1.49.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.49.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.49.4.1 24-Sep-2001  nathanw file pmap.h was added on branch nathanw_sa on 2002-02-28 04:12:29 +0000
 1.58.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.58.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.58.2.1 03-Aug-2004  skrll Sync with HEAD
 1.60.16.7 17-Mar-2008  yamt sync with head.
 1.60.16.6 27-Feb-2008  yamt sync with head.
 1.60.16.5 04-Feb-2008  yamt sync with head.
 1.60.16.4 21-Jan-2008  yamt sync with head
 1.60.16.3 26-Feb-2007  yamt sync with head.
 1.60.16.2 30-Dec-2006  yamt sync with head.
 1.60.16.1 21-Jun-2006  yamt sync with head.
 1.63.2.2 18-Feb-2006  yamt sync with head.
 1.63.2.1 01-Feb-2006  yamt sync with head.
 1.64.4.1 22-Apr-2006  simonb Sync with head.
 1.64.2.1 09-Sep-2006  rpaulo sync with head
 1.65.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.65.2.3 11-Aug-2006  yamt sync with head
 1.65.2.2 24-May-2006  yamt sync with head.
 1.65.2.1 13-Mar-2006  yamt sync with head.
 1.66.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.67.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.68.10.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.68.8.1 10-Mar-2007  bouyer Pull up following revision(s) (requested by chs in ticket #507):
sys/arch/vax/include/pmap.h: revision 1.69
in pmap_extract(), check for the PTE being valid in addition to
the PTP being valid when deciding if a user mapping exists.
 1.71.34.1 08-Jan-2008  bouyer Sync with HEAD
 1.71.28.1 18-Feb-2008  mjf Sync with HEAD.
 1.71.22.2 23-Mar-2008  matt sync with HEAD
 1.71.22.1 09-Jan-2008  matt sync with HEAD
 1.73.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.73.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.73.2.1 24-Mar-2008  keiichi sync with head.
 1.75.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.75.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.75.4.2 11-Mar-2010  yamt sync with head
 1.75.4.1 04-May-2009  yamt sync with head.
 1.77.4.2 31-May-2011  rmind sync with head
 1.77.4.1 05-Mar-2011  rmind sync with head
 1.77.2.2 16-Nov-2010  uebayasi Sync with HEAD.
 1.77.2.1 27-May-2010  uebayasi Fix build.
 1.79.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.80.56.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.1 07-Aug-2002  briggs branches: 1.1.2; 1.1.4; 1.1.6; 1.1.202; 1.1.204;
Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.1.204.1 10-Jun-2019  christos Sync with HEAD
 1.1.202.1 28-Jul-2018  pgoyette Sync with HEAD
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 07-Aug-2002  jdolecek file pmc.h was added on branch kqueue on 2002-09-06 08:42:18 +0000
 1.1.4.2 31-Aug-2002  gehenna catch up with -current.
 1.1.4.1 07-Aug-2002  gehenna file pmc.h was added on branch gehenna-devsw on 2002-08-31 14:52:47 +0000
 1.1.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 07-Aug-2002  nathanw file pmc.h was added on branch nathanw_sa on 2002-08-13 02:19:02 +0000
 1.16 17-May-2024  thorpej G/C MDP_AST -- it's not referenced anywhere.
 1.15 03-Jul-2011  matt Cleanup trapframe handling. Instead of keeping a trapframe pointer in the
pcb, put in the mdlwp instead. We had a dummy field so it didn't grow in
size. This also follows the practice that mips and powerpc follow that a
pointer to the user trapframe is in l->l_md.md_utf. Make trapframe members
start with tf_
 1.14 14-Jan-2011  rmind Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete. Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
 1.13 21-Nov-2009  rmind branches: 1.13.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.12 22-Dec-2007  tsutsui branches: 1.12.10;
Use (char *) on pointer arithmetic.
 1.11 04-Mar-2007  christos branches: 1.11.20; 1.11.28; 1.11.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 14-May-2006  elad branches: 1.10.14;
integrate kauth.
 1.9 13-Mar-2006  he Add a forward declaration of "struct trapframe", to allow declaration
of a pointer to it in the syscall handling function.
 1.8 12-Mar-2006  christos welcome to syscall_intern.
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10;
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 22-Jan-2003  yamt branches: 1.5.2;
make KSTACK_CHECK_* compile after sa merge.
 1.4 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.3 02-Jul-2002  yamt add KSTACK_CHECK_MAGIC. discussed on tech-kern.
 1.2 26-Oct-1994  cgd branches: 1.2.46; 1.2.50; 1.2.58;
new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file proc.h was added on branch netbsd-1-0 on 1994-08-02 20:20:47 +0000
 1.2.58.1 17-Jul-2002  gehenna catch up with -current.
 1.2.50.2 01-Aug-2002  nathanw Catch up to -current.
 1.2.50.1 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.2.46.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 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.16.3 21-Jan-2008  yamt sync with head
 1.6.16.2 03-Sep-2007  yamt sync with head.
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.7.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.8.2 01-Apr-2006  yamt sync with head.
 1.7.8.1 13-Mar-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.10.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.11.28.1 26-Dec-2007  ad Sync with head.
 1.11.20.1 09-Jan-2008  matt sync with HEAD
 1.12.10.1 11-Mar-2010  yamt sync with head
 1.13.4.1 05-Mar-2011  rmind sync with head
 1.12 29-Aug-2008  matt Drop support for compiling a.out kernel. Elves rule!
 1.11 24-Dec-2005  perry branches: 1.11.74; 1.11.78; 1.11.80; 1.11.84;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 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 24-Feb-2002  matt branches: 1.8.16;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.7 01-Jul-2000  matt branches: 1.7.4; 1.7.8;
Add ELF support.
 1.6 05-Nov-1997  thorpej branches: 1.6.14;
asm -> __asm__
 1.5 31-Dec-1995  ragge branches: 1.5.16;
Don't declare _mcount as static, gcc will optimize it away then.
 1.4 11-May-1995  jtc KERNEL -> _KERNEL
 1.3 03-May-1995  ragge mtpr support for 11/780 added. DELAY added. mcount() corrected.
trapframe fixed to support all registers.
 1.2 30-Mar-1995  ragge Some bug fixes & update of pcb.
 1.1 13-Feb-1995  ragge Lots of fixes...
 1.5.16.1 05-Nov-1997  thorpej Update from trunk: asm -> __asm__
 1.6.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.7.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.8.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.16.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.11.84.1 19-Oct-2008  haad Sync with HEAD.
 1.11.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.11.78.1 04-May-2009  yamt sync with head.
 1.11.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.12 14-Dec-2010  matt Since CLKF_BASEPRI isn't used any more, merge its test into CLKF_INTR which
results in a simplier comparision.
 1.11 05-Aug-2008  matt branches: 1.11.16;
Add PSL_{IV,FU,DV} bits.
 1.10 11-Dec-2005  christos branches: 1.10.74; 1.10.78; 1.10.80; 1.10.84;
merge ktrace-lwp.
 1.9 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.8 29-May-2001  ragge branches: 1.8.8; 1.8.24;
Add ci_cpuid.
Change the CLKF_ macros because the idle loop is now running at IPL1.
 1.7 05-Aug-1999  thorpej branches: 1.7.14;
Correct a comment.
 1.6 07-Jun-1997  ragge System statistics fixes. From Johnny Billquist (bqt@update.uu.se).
 1.5 28-Jan-1996  ragge Remove PSL_ALLCC definition. Was commented out anyway.
 1.4 25-Nov-1994  ragge Lots of updates & fixes.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Changes to make files more 4.4/1.0B working.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file psl.h was added on branch netbsd-1-0 on 1994-08-02 20:20:48 +0000
 1.7.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.24.1 03-Aug-2004  skrll Sync with HEAD
 1.8.8.2 29-May-2001  ragge Add ci_cpuid.
Change the CLKF_ macros because the idle loop is now running at IPL1.
 1.8.8.1 29-May-2001  ragge file psl.h was added on branch nathanw_sa on 2001-05-29 21:29:33 +0000
 1.10.84.1 19-Oct-2008  haad Sync with HEAD.
 1.10.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.10.78.1 04-May-2009  yamt sync with head.
 1.10.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.11.16.1 05-Mar-2011  rmind sync with head
 1.24 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.23 10-Aug-2009  matt branches: 1.23.22; 1.23.40;
Change kvtopte and kvtophys from ({ }) to static inline and while there
make them tolerable of rump.
 1.22 29-Aug-2008  matt Drop support for compiling a.out kernel. Elves rule!
 1.21 24-Dec-2005  perry branches: 1.21.74; 1.21.78; 1.21.80; 1.21.84;
bare asm -> __asm
 1.20 14-Oct-2002  chs branches: 1.20.22;
eliminate PT_ENTRY_NULL in favor of plain old NULL.
 1.19 31-Aug-2001  simonb branches: 1.19.6;
Use comments around the token after a #endif.
 1.18 21-Nov-2000  chs branches: 1.18.4;
eliminate TRUNC_PAGE() and ROUND_PAGE() in favor of their
lowercase counterparts. also, a little misc cleanup.
 1.17 15-Oct-2000  ragge By accident, a previously unused bit in the PTE got used as wired bit.
Because of this kvtophys() of wired pages did set the leftmost bit, causing
the pager to hang while swapping. This is now fixed by using another
free bit in the PTE as wired bit instead.
This fixes PR#11121.

Many thanks to Chuck Silvers that found what the problem was!
 1.16 19-Jul-2000  matt More ELF changes (a.out still works).
 1.15 01-Jul-2000  matt GCC 2.96 wants the = constraint first. Older gcc(s) don't care.
 1.14 27-May-2000  ragge branches: 1.14.2;
Write kvtopte() and kvtophys() as inline assembler. GCC create quite bad
code for them, and they are only 2-3 instructions each if written by hand.
 1.13 03-Aug-1999  ragge branches: 1.13.2; 1.13.10;
Protect against multiple includes.
 1.12 23-May-1999  ragge Rewrite the "emulate page reference bits" code to avoid a bunch of
pv_lists traversal and unneccessary page faults.
 1.11 01-Jan-1999  ragge branches: 1.11.2; 1.11.4; 1.11.6;
Giant change: NBPG now set to 4k and CLSIZE == 1 for vax. This change
made a whole bunch of annoying bugs disappear; mostly depending on
bad use of NBPG in non-MD code. The VAX port was the only port that
used this historical "feature".

The CL* macros should probably go away totally, there is no reason
at all to keep them.
 1.10 23-Feb-1996  ragge Fixed bug causing DMA to user stack from Massbus disks to give segfaults.
 1.9 02-Feb-1996  mycroft ASSEMBLER -> _LOCORE
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 28-Jan-1996  ragge Add uvtopte() macro, to get user pte address easy.
 1.6 12-Nov-1995  ragge pt_entry_t now struct pte. cleanup.
 1.5 21-Aug-1995  ragge Added PG_URKW: World readable, kernel writable.
 1.4 13-Feb-1995  ragge Lots of fixes...
 1.3 25-Nov-1994  ragge Lots of updates & fixes.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file pte.h was added on branch netbsd-1-0 on 1994-08-02 20:20:51 +0000
 1.11.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11.2.1 12-Jul-1999  perry pullup 1.11->1.12 (ragge): fix critical paging/swapping problems
 1.13.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.13.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.13.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.2.1 17-Oct-2000  tv Pullup 1.17 by patch [ragge]:
By accident, a previously unused bit in the PTE got used as wired bit.
Because of this kvtophys() of wired pages did set the leftmost bit, causing
the pager to hang while swapping. This is now fixed by using another
free bit in the PTE as wired bit instead.
This fixes PR#11121.
 1.18.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.19.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.19.6.1 31-Aug-2001  nathanw file pte.h was added on branch nathanw_sa on 2002-10-18 02:40:31 +0000
 1.20.22.1 21-Jun-2006  yamt sync with head.
 1.21.84.1 19-Oct-2008  haad Sync with HEAD.
 1.21.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.21.78.2 19-Aug-2009  yamt sync with head.
 1.21.78.1 04-May-2009  yamt sync with head.
 1.21.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.23.40.1 28-Aug-2017  skrll Sync with HEAD
 1.23.22.1 03-Dec-2017  jdolecek update from HEAD
 1.11 18-Jun-2019  kamil Introduce PTRACE_REG_FP() a helper macro to retrieve the frame pointer

The macro is dummy for ia64 (the FP register is unknown and can change
freely) and sparc/sparc64 (not stored in struct reg).
 1.10 22-May-2017  ragge branches: 1.10.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.9 12-Apr-2017  kamil Add new macro PTRACE_BREAKPOINT_ASM in <sys/ptrace.h> MD part

This macro ships with a MD-specific assembly instruction triggering
a software breakpoint.

Missing instruction for powerpc targets.

This code is used in ATF tests (lib/libc/sys/t_ptrace_wait).

Original patch by Nick Hudson, thanks!
 1.8 11-Apr-2017  skrll Trailing whitespace
 1.7 08-Apr-2017  kamil Add new ptrace(2) API: PT_SETSTEP & PT_CLEARSTEP

These operations allow to mark thread as a single-stepping one.

This allows to i.a.:
- single step and emit a signal (PT_SETSTEP & PT_CONTINUE)
- single step and trace syscall entry and exit (PT_SETSTEP & PT_SYSCALL)

The former is useful for debuggers like GDB or LLDB. The latter can be used
to singlestep a usermode kernel. These examples don't limit use-cases of
this interface.

Define PT_*STEP only for platforms defining PT_STEP.

Add new ATF tests setstep[1234].

These ptrace(2) operations first appeared in FreeBSD.

Sponsored by <The NetBSD Foundation>
 1.6 25-Sep-2015  christos branches: 1.6.2; 1.6.4;
For processors that have memory breakpoints, add macros for them to help
libproc
 1.5 15-Sep-2015  christos Provide access to pc/sp/syscall-return registers like we have for mcontext
 1.4 25-Jan-2008  skrll branches: 1.4.54; 1.4.74;
Define PT_MACHDEP_STRINGS
 1.3 12-Apr-1995  ragge branches: 1.3.82; 1.3.144; 1.3.150;
Added regs for trace.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file ptrace.h was added on branch netbsd-1-0 on 1994-08-02 20:20:52 +0000
 1.3.150.1 18-Feb-2008  mjf Sync with HEAD.
 1.3.144.1 23-Mar-2008  matt sync with HEAD
 1.3.82.1 04-Feb-2008  yamt sync with head.
 1.4.74.3 28-Aug-2017  skrll Sync with HEAD
 1.4.74.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.4.74.1 22-Sep-2015  skrll Sync with HEAD
 1.4.54.1 03-Dec-2017  jdolecek update from HEAD
 1.6.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.6.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.10.10.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 09-Oct-2006  christos branches: 1.4.4;
include headers needed for the ioctls.
 1.3 11-Dec-2005  christos branches: 1.3.20; 1.3.22;
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 21-Mar-1998  ragge branches: 1.1.48;
Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 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.2.16.2 03-Sep-2007  yamt sync with head.
 1.2.16.1 30-Dec-2006  yamt sync with head.
 1.3.22.1 22-Oct-2006  yamt sync with head
 1.3.20.1 18-Nov-2006  ad Sync with head.
 1.4.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.7 06-Feb-2023  tsutsui Add a support for gpx(4) color framebuffer found on VAXstation 3100.

Poted from OpenBSD/vax. Note smg(4) monochrome onboard framebuffer
driver is also changed attached only if gpx(4) is not installed
or flags 1 is specified in config files, as OpenBSD did.

Tested on my VAXstation 3100/m30 with and without 8bpp gpx(4).
Revied on port-vax@ and "Please go ahead!" from ragge@.
https://mail-index.netbsd.org/port-vax/2023/01/thread1.html#004147

Worth to pullup to netbsd-10.
 1.6 17-Aug-2021  andvar branches: 1.6.4;
fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 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 06-Jan-2003  wiz branches: 1.3.2;
interrupt with two rs.
 1.2 29-Sep-2002  wiz "definitions" has lots of 'i's, but that's not reason to leave one out.
 1.1 21-Mar-1998  ragge branches: 1.1.28; 1.1.32;
Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.1.32.2 07-Jan-2003  thorpej Sync with HEAD.
 1.1.32.1 18-Oct-2002  nathanw Catch up to -current.
 1.1.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.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.6.4.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #79):

sys/arch/vax/conf/GENERIC: revision 1.217
sys/arch/vax/conf/VAX780: revision 1.34
sys/arch/vax/conf/files.vax: revision 1.126
sys/arch/vax/vsa/smg.c: revision 1.63
sys/arch/vax/include/qdreg.h: revision 1.7
sys/arch/vax/vax/conf.c: revision 1.69
sys/arch/vax/conf/INSTALL: revision 1.76
sys/arch/vax/vsa/gpx.c: revision 1.1

Add a support for gpx(4) color framebuffer found on VAXstation 3100.

Ported from OpenBSD/vax. Note smg(4) monochrome onboard framebuffer
driver is also changed attached only if gpx(4) is not installed
or flags 1 is specified in config files, as OpenBSD did.

Tested on my VAXstation 3100/m30 with and without 8bpp gpx(4).

Revied on port-vax@ and "Please go ahead!" from ragge@.
https://mail-index.netbsd.org/port-vax/2023/01/thread1.html#004147
 1.6 14-Sep-2024  andvar s/programmming/programming/ in comment.
 1.5 09-Oct-2006  oster branches: 1.5.180;
Add #inclusion protection.
vax/uba/qevent.h has been vax/qevent.h for ages now.
Fixes -current build on vax.
 1.4 11-Dec-2005  christos branches: 1.4.20; 1.4.22;
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-Jun-2001  wiz branches: 1.2.8; 1.2.24;
Fix various misspellings of compatible/compatibility.
 1.1 21-Mar-1998  ragge branches: 1.1.26;
Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 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.2.8.2 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.2.8.1 11-Jun-2001  wiz file qduser.h was added on branch nathanw_sa on 2001-06-11 01:50:56 +0000
 1.3.16.1 30-Dec-2006  yamt sync with head.
 1.4.22.1 22-Oct-2006  yamt sync with head
 1.4.20.1 18-Nov-2006  ad Sync with head.
 1.5.180.1 02-Aug-2025  perseant 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 21-Mar-1998  ragge branches: 1.1.48;
Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 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.7 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.6 11-Dec-2005  christos branches: 1.6.122; 1.6.142;
merge ktrace-lwp.
 1.5 25-Oct-2003  matt Add a dummy fpset for gdb.
 1.4 01-Dec-2002  matt branches: 1.4.6;
Add multiple inclusion protection.
 1.3 12-Apr-1995  ragge branches: 1.3.50;
Added regs for trace.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file reg.h was added on branch netbsd-1-0 on 1994-08-02 20:20:54 +0000
 1.3.50.1 11-Dec-2002  thorpej Sync with HEAD.
 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.6.142.1 28-Aug-2017  skrll Sync with HEAD
 1.6.122.1 03-Dec-2017  jdolecek update from HEAD
 1.10 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.9 11-Mar-2008  matt branches: 1.9.48; 1.9.68;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.8 01-Dec-2002  matt branches: 1.8.22; 1.8.84; 1.8.104; 1.8.108;
Add multiple inclusion protection.
 1.7 18-Apr-2000  ragge branches: 1.7.12;
Add RPB number for VS4000 SCSI.
 1.6 01-Jul-1998  ragge branches: 1.6.14;
RPB number for SGEC Ethernet controller (ze).
 1.5 13-Apr-1998  ragge Wall cleaning.
 1.4 13-Jun-1997  ragge Some new definitions for different boot devices.
 1.3 15-Mar-1997  ragge Add definitions for DEC HW device numbers.
 1.2 20-Oct-1995  ragge branches: 1.2.10;
Added #ifdef _KERNEL around definition of struct rpb.
 1.1 05-Jun-1995  ragge New file pcb.h. USRTEXT changed to 0x400.
 1.2.10.2 20-Oct-1995  ragge Added #ifdef _KERNEL around definition of struct rpb.
 1.2.10.1 20-Oct-1995  ragge file rpb.h was added on branch netbsd-1-1 on 1995-10-20 13:47:28 +0000
 1.6.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.12.1 11-Dec-2002  thorpej Sync with HEAD.
 1.8.108.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.104.1 24-Mar-2008  keiichi sync with head.
 1.8.84.1 23-Mar-2008  matt sync with HEAD
 1.8.22.1 17-Mar-2008  yamt sync with head.
 1.9.68.1 28-Aug-2017  skrll Sync with HEAD
 1.9.48.1 03-Dec-2017  jdolecek update from HEAD
 1.3 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.2 15-May-2001  ragge branches: 1.2.8; 1.2.174; 1.2.194;
Octal numbers _must_ have a heading '0'!
 1.1 17-Feb-1996  ragge branches: 1.1.42;
Definition file for RSP (Radial Serial Protocol) used by DECtape II.
 1.1.42.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.194.1 28-Aug-2017  skrll Sync with HEAD
 1.2.174.1 03-Dec-2017  jdolecek update from HEAD
 1.2.8.2 15-May-2001  ragge Octal numbers _must_ have a heading '0'!
 1.2.8.1 15-May-2001  ragge file rsp.h was added on branch nathanw_sa on 2001-05-15 18:59:46 +0000
 1.7 29-Nov-2019  riastradh Largely eliminate the MD rwlock.h header file.

This was full of definitions that have been obsolete for over a
decade. The file still remains for __HAVE_RW_STUBS but that's all.
Used only internally in kern_rwlock.c now, not by <sys/rwlock.h>.
 1.6 28-Apr-2008  martin branches: 1.6.88;
Remove clause 3 and 4 from TNF licenses
 1.5 23-Feb-2008  matt branches: 1.5.2; 1.5.4;
A number of performance changes:
Change internal register SSP to contain curlwp insread curcpu(). This
shrinks the GENERIC by 2KB.
Add rwlock stubs (rw_enter, rw_exit, rw_tryenter).
Simplify simple lock code for uniprocessors.
Do SPL raise/lower in cpu_handle_ipi instead of simple_locks.
 1.4 03-Feb-2008  matt branches: 1.4.2; 1.4.6;
Switch this to use atomic_cas_ulong.
 1.3 21-Nov-2007  yamt make kmutex_t and krwlock_t smaller by killing lock id.
ok'ed by Andrew Doran.
 1.2 17-Feb-2007  matt branches: 1.2.2; 1.2.4; 1.2.8; 1.2.24; 1.2.26; 1.2.30; 1.2.32;
Add an implementation for krwlock_t. Initialize ci_mtx_count to 1 (biased).
Fix a few buglets in the kmutex_t implementation.
 1.1 16-Feb-2007  matt Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.2.32.2 18-Feb-2008  mjf Sync with HEAD.
 1.2.32.1 08-Dec-2007  mjf Sync with HEAD.
 1.2.30.1 21-Nov-2007  bouyer Sync with HEAD
 1.2.26.2 23-Mar-2008  matt sync with HEAD
 1.2.26.1 09-Jan-2008  matt sync with HEAD
 1.2.24.1 21-Nov-2007  joerg Sync with HEAD.
 1.2.8.1 03-Dec-2007  ad Sync with HEAD.
 1.2.4.5 27-Feb-2008  yamt sync with head.
 1.2.4.4 04-Feb-2008  yamt sync with head.
 1.2.4.3 07-Dec-2007  yamt sync with head
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 17-Feb-2007  yamt file rwlock.h was added on branch yamt-lazymbuf on 2007-02-26 09:08:40 +0000
 1.2.2.2 17-Feb-2007  matt Add an implementation for krwlock_t. Initialize ci_mtx_count to 1 (biased).
Fix a few buglets in the kmutex_t implementation.
 1.2.2.1 17-Feb-2007  matt file rwlock.h was added on branch yamt-idlelwp on 2007-02-17 05:34:08 +0000
 1.4.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.4.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.4.2.1 24-Mar-2008  keiichi sync with head.
 1.5.4.1 16-May-2008  yamt sync with head.
 1.5.2.1 18-May-2008  yamt sync with head.
 1.6.88.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.15 10-Apr-2022  andvar fix various typos in comments and output/log messages.
 1.14 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.13 14-Dec-2010  matt branches: 1.13.18; 1.13.36;
Include <sys/evcnt.h> since <sys/cpu.h> no includes <sys/device.h>
 1.12 20-Feb-2008  matt branches: 1.12.32;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.11 10-Jul-2000  ragge branches: 1.11.40; 1.11.102;
Nexus vector number is 0x14-0x17, not 14-17! Fortunately, 3 wrong did
one right. Pointed out by Kenn Humborg (kenn@linux.ie).
 1.10 05-Jun-2000  matt branches: 1.10.2;
Adjust to new evcnt stuff.
 1.9 04-Jun-2000  ragge Clean up the sbi_attach_args struct and put in tag/handle.
Move a nice macro to scb.h.
 1.8 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.7 04-Jun-2000  matt Add extra argument to scb_vecalloc (a struct evcnt *)
Move ivec_dsp from trap.h to scb.h
Add interrupt counting to asc, le, ze, ncr, dz interrupts.
add common support for counting interrupts to cnm_idisp so
it can be done very efficiently.
 1.6 24-Jan-2000  matt branches: 1.6.2;
Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.5 19-Jan-1999  ragge branches: 1.5.8;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.4 13-Dec-1995  ragge A complete SCB struct included.
 1.3 12-Nov-1995  ragge extern struct scb *scb; added.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file scb.h was added on branch netbsd-1-0 on 1994-08-02 20:20:57 +0000
 1.5.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.2.1 27-Jul-2000  matt mba.c: Pullup revision 1.25
scb.h: Pullup revision 1.11
Correct vector initialization to use correct values
 1.11.102.1 23-Mar-2008  matt sync with HEAD
 1.11.40.1 27-Feb-2008  yamt sync with head.
 1.12.32.1 05-Mar-2011  rmind sync with head
 1.13.36.1 28-Aug-2017  skrll Sync with HEAD
 1.13.18.1 03-Dec-2017  jdolecek update from HEAD
 1.5 29-Aug-2008  matt Drop support for compiling a.out kernel. Elves rule!
 1.4 27-Mar-2002  matt branches: 1.4.112; 1.4.116; 1.4.118; 1.4.122;
Make the comment reflect reality a bit more.
 1.3 01-May-2001  matt branches: 1.3.2; 1.3.8;
Make the jmp_buf bigger under ELF so it can store a full context.
 1.2 01-Oct-1998  christos branches: 1.2.24;
Need more room for signal mask
 1.1 20-Dec-1994  cgd make the definition of _JBLEN mach. dep. header-dependent.
 1.2.24.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.8.1 01-May-2001  nathanw file setjmp.h was added on branch nathanw_sa on 2002-04-01 07:43:29 +0000
 1.3.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.122.1 19-Oct-2008  haad Sync with HEAD.
 1.4.118.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.116.1 04-May-2009  yamt sync with head.
 1.4.112.1 28-Sep-2008  mjf Sync with HEAD.
 1.8 03-Dec-2023  thorpej Use vmem(9) rather than extent(9) to manage SGMAP space.
 1.7 05-Jul-2015  matt Hooks needed for QVSS support
 1.6 28-Apr-2008  martin branches: 1.6.44; 1.6.64;
Remove clause 3 and 4 from TNF licenses
 1.5 03-Feb-2008  matt branches: 1.5.6; 1.5.8; 1.5.10;
De-__P
 1.4 16-Nov-2000  matt branches: 1.4.40; 1.4.102; 1.4.108;
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.3 17-May-2000  matt branches: 1.3.4;
Preliminary support for the VS4000/90 SGMAP. Needed for SCSI. Does not
quite work right yet.
 1.2 10-Apr-2000  matt Add fix for VS4000 SCSI hangs on disk writes. Add a VAX_BUS_DMA_SPILLPAGE
and use it in the asc_vsbus driver.
 1.1 06-Jun-1999  ragge branches: 1.1.2; 1.1.4;
sgmap files, copied from the Alpha port and modified for vax.
 1.1.4.2 22-Nov-2000  bouyer Sync with HEAD.
 1.1.4.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.4.1 16-Nov-2000  tv Pullup 1.4 [matt]:
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.4.108.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.102.1 23-Mar-2008  matt sync with HEAD
 1.4.40.1 04-Feb-2008  yamt sync with head.
 1.5.10.1 16-May-2008  yamt sync with head.
 1.5.8.1 18-May-2008  yamt sync with head.
 1.5.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.64.1 22-Sep-2015  skrll Sync with HEAD
 1.6.44.1 03-Dec-2017  jdolecek update from HEAD
 1.22 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.21 18-Sep-2001  ragge branches: 1.21.4; 1.21.170; 1.21.190;
Some ID strings + other consistency fixes, from Michael Kukat.
 1.20 02-May-2001  ragge branches: 1.20.2; 1.20.4;
KA690 is not a Mariah. From Michael Kukat.
 1.19 01-May-2001  ragge More CPU definitions. From Michael Kukat.
 1.18 24-Apr-2001  ragge Support for KA681 (4000/500A) from Michael Kukat.
 1.17 21-Mar-2001  ragge VAX_STYP_690 added, from Lord Isildur.
 1.16 04-Feb-2001  ragge branches: 1.16.2;
Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.15 28-Jan-2001  ragge A bunch of new CPUs that are supported, from Michael Kukat
(michael@unixiron.org). Among them are 4000/400, 4000/500 and 4000/105A.
 1.14 22-May-2000  matt Obviously we don't use the symbol, but we might give it the correct value.
We support up to NVAX platforms.
 1.13 08-May-2000  ragge Add 4000/105 and VXT2000. From Michael Kukat.
 1.12 11-Dec-1999  ragge Detect "Infoserver 1000" also.
 1.11 28-Jun-1999  ragge branches: 1.11.2; 1.11.8;
Wrong definition of SID for MicroVAX I, from Brian Chase.
 1.10 09-Mar-1999  ragge branches: 1.10.4;
Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.9 12-Feb-1997  ragge Improve sub-type identification of the CVAX CPU, for later cache handling.
 1.8 20-Aug-1996  ragge branches: 1.8.6;
Modify bus code arguments. Cleanup.
 1.7 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.6 12-Nov-1995  ragge 11/750 specific things moved to ka750.h
 1.5 23-Feb-1995  ragge Def's for uVAXII added.
 1.4 13-Feb-1995  ragge Lots of fixes...
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Changes to make files more 4.4/1.0B working.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file sid.h was added on branch netbsd-1-0 on 1994-08-02 20:20:58 +0000
 1.8.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.10.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.11.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.11.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.11.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.16.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.16.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.20.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.20.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.21.190.1 28-Aug-2017  skrll Sync with HEAD
 1.21.170.1 03-Dec-2017  jdolecek update from HEAD
 1.21.4.2 18-Sep-2001  ragge Some ID strings + other consistency fixes, from Michael Kukat.
 1.21.4.1 18-Sep-2001  ragge file sid.h was added on branch nathanw_sa on 2001-09-18 16:41:26 +0000
 1.23 29-Oct-2021  thorpej Define __HAVE_STRUCT_SIGCONTEXT regardless of its current visibility.
 1.22 28-Oct-2021  christos The genassym code in libc also needs struct sigcontext13
 1.21 27-Oct-2021  thorpej The stupid CPP has proven me too clever by half.
 1.20 27-Oct-2021  thorpej Centrally define constants that define the signal return trampoline
versioning scheme, and add a big block comment describing how it works.
 1.19 27-Oct-2021  thorpej Make sigcontext13 visible only to _KERNEL. Make sigcontext visible only
to _LIBC and _KERNEL.
 1.18 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.17 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.16 29-Nov-2017  christos branches: 1.16.2; 1.16.4;
include <sys/sigtypes.h> for sigset_t
 1.15 13-Jan-2009  mjf branches: 1.15.24;
- Separate the COMPAT_13 and COMPAT_16 code into their own files and
compile them only when the relevant config options are set.

- Provide a sendsig_sigcontext() implementation using the existing vax
signal code; it already does the correct thing.
 1.14 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.13 11-Dec-2005  christos branches: 1.13.74; 1.13.78; 1.13.84; 1.13.86;
merge ktrace-lwp.
 1.12 26-Mar-2004  drochner nothing cares about __HAVE_SIGINFO anymore, so nuke it
 1.11 29-Sep-2003  matt Add SA_SIGINFO support for VAX.
 1.10 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.9 28-Apr-2003  bjh21 branches: 1.9.2;
Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 30-Sep-1998  ragge branches: 1.7.30;
Typo.
 1.6 17-Sep-1998  thorpej Define the new sigcontext structure.
 1.5 25-May-1998  kleink If any of _ANSI_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE are defined, don't
provide any identifiers other than sig_atomic_t.
 1.4 10-Jan-1995  jtc Only define sig_atomic_t when _ANSI_SOURCE is defined.
 1.3 25-Nov-1994  ragge Lots of updates & fixes.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file signal.h was added on branch netbsd-1-0 on 1994-08-02 20:20:59 +0000
 1.7.30.1 16-Jan-2003  thorpej * Include <sys/sigtypes.h> rather than <sys/signal.h> in <sys/ucontext.h>.
* Define _UCONTEXT_TO_SIGCONTEXT() and _SIGCONTEXT_TO_UCONTEXT()
macros for converting a ucontext -> sigcontext and back again.
These macros in turn use machine-dependent macros _MCONTEXT_TO_SIGCONTEXT()
and _SIGCONTEXT_TO_MCONTEXT() provided by <machine/signal.h>.

The conversion process is not 100% accurate, but should be close enough.

Also note that the mcontext conversion may not be enough for all platforms
(m68k is a good example of this). These macros should be used only if
you really know what you're doing.
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.13.84.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.13.78.1 04-May-2009  yamt sync with head.
 1.13.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.24.1 03-Dec-2017  jdolecek update from HEAD
 1.16.4.1 10-Jun-2019  christos Sync with HEAD
 1.16.2.1 18-Jan-2019  pgoyette Synch with HEAD
 1.19 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.18 22-Jun-2011  mrg deal with __builtin_va_start()'s introduction.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 19-Mar-2004  kleink Fix == vs = typo from rev. 1.13 in __va_copy; from David H. Gutteridge
in PR port-vax/24846.
 1.15 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.14 28-Apr-2003  bjh21 branches: 1.14.2;
Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.13 01-Jul-2000  matt branches: 1.13.18;
More GCC 2.96 changes.
 1.12 03-Feb-2000  kleink Add a C99-style va_copy macro.
 1.11 03-May-1999  christos branches: 1.11.2;
Define __builtin_*() for lint
 1.10 22-Jan-1999  mycroft branches: 1.10.4;
Use __builtin_next_arg(). Fixed PR 6862.
 1.9 27-Jul-1998  mycroft Delint.
 1.8 25-Dec-1995  mycroft branches: 1.8.16;
Stylistic changes.
 1.7 25-Dec-1995  mycroft Stylistic changes.
 1.6 25-Dec-1995  mycroft Update for GCC 2.7, and fix bugs.
 1.5 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.4 28-Jan-1995  jtc ANSI says that <stdarg.h>'s va_end macro must expand to a void expression.
For consistancy, I'm changing <varargs.h> too.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 15-Oct-1994  cgd make <stdarg.h> a symlink, and clean up ports' stdarg.h and varargs.h files.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file stdarg.h was added on branch netbsd-1-0 on 1994-08-02 20:21:01 +0000
 1.8.16.1 01-Feb-1999  cgd pull up revs 1.9-1.10 from trunk (PR#6862). (mycroft)
 1.10.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.18.1 28-Mar-2004  jmc Pullup rev 1.16 (requested by kleink in ticket #1634)

Fix == vs = typo from rev. 1.13 in __va_copy. PR#24846
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.2 13-Feb-2008  matt branches: 1.2.2; 1.2.6;
Add VAX_PHYS_TO_S0 (for asc_tcds)
Include <machine/cpu.h> for badaddr
 1.1 15-Apr-2007  matt branches: 1.1.4; 1.1.6; 1.1.8; 1.1.18; 1.1.20; 1.1.26;
Add TURBOChannel machine-dependent include for VAX.
 1.1.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.1.20.4 17-Mar-2008  yamt sync with head.
 1.1.20.3 27-Feb-2008  yamt sync with head.
 1.1.20.2 03-Sep-2007  yamt sync with head.
 1.1.20.1 15-Apr-2007  yamt file tc_machdep.h was added on branch yamt-lazymbuf on 2007-09-03 14:30:49 +0000
 1.1.18.1 23-Mar-2008  matt sync with HEAD
 1.1.8.2 11-Jul-2007  mjf Sync with head.
 1.1.8.1 15-Apr-2007  mjf file tc_machdep.h was added on branch mjf-ufs-trans on 2007-07-11 20:02:55 +0000
 1.1.6.2 09-Jun-2007  ad Sync with head.
 1.1.6.1 15-Apr-2007  ad file tc_machdep.h was added on branch vmlocking on 2007-06-09 21:37:04 +0000
 1.1.4.2 07-May-2007  yamt sync with head.
 1.1.4.1 15-Apr-2007  yamt file tc_machdep.h was added on branch yamt-idlelwp on 2007-05-07 10:55:04 +0000
 1.2.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.2.2.1 24-Mar-2008  keiichi sync with head.
 1.25 26-Mar-2023  ragge Change CASMAGIC to 0xFEDABABE so that it cannot accidentally end up in
valid kernel memory. Due to the VARM accesses above S0 should always
give a ptelen trap.
Bug found by Kalvis Duckmanton.
 1.24 03-Jul-2011  matt branches: 1.24.46; 1.24.58; 1.24.84;
Cleanup trapframe handling. Instead of keeping a trapframe pointer in the
pcb, put in the mdlwp instead. We had a dummy field so it didn't grow in
size. This also follows the practice that mips and powerpc follow that a
pointer to the user trapframe is in l->l_md.md_utf. Make trapframe members
start with tf_
 1.23 13-Nov-2010  matt Implement CAS using a RAS for non-MP VAX systems. This technique uses the
atomicity of indirect addressing for correctness. It also uses the knowledge
of dereferencing an address outside the page table length will cause a PTELEN
trap. [Tested on netbsd-5]
 1.22 16-Feb-2009  christos branches: 1.22.4;
- add siginfo translation for all arithmetic faults and traps.
- skip the current instruction for all faults, to avoid infinite loops on
SIGFPE (from OpenBSD)
Info from: http://bitsavers.vt100.net/pdf/dec/vax/archSpec/EK-VAXAR-RM-001_Arch_May82.pdf
 1.21 05-Aug-2008  matt branches: 1.21.2; 1.21.4; 1.21.8;
Add the AFLT_FLT* code for T_ARITHFLT.
 1.20 11-Dec-2005  christos branches: 1.20.74; 1.20.78; 1.20.80; 1.20.84;
merge ktrace-lwp.
 1.19 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.18 04-Jun-2000  matt branches: 1.18.26;
Add extra argument to scb_vecalloc (a struct evcnt *)
Move ivec_dsp from trap.h to scb.h
Add interrupt counting to asc, le, ze, ncr, dz interrupts.
add common support for counting interrupts to cnm_idisp so
it can be done very efficiently.
 1.17 24-Jan-2000  matt branches: 1.17.2;
Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.16 28-Jul-1997  ragge branches: 1.16.20;
Handle XFC instruction faults.
 1.15 16-Feb-1997  ragge unsigned -> long to match ddb change.
 1.14 11-Jan-1997  ragge branches: 1.14.6;
Put in another external declaration.
 1.13 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.12 02-Feb-1996  mycroft ASSEMBLER -> _LOCORE
 1.11 28-Jan-1996  ragge Change struct trapframe to also contain stackpointer.
 1.10 13-Dec-1995  ragge Type change: u_int hoppaddr to void (*hoppaddr)();
 1.9 12-Nov-1995  ragge struct ivec_dsp for interrupt vector allocation added.
 1.8 16-Jun-1995  ragge DDB support. splddb() and trapcode for ddb.
 1.7 05-Jun-1995  ragge New file pcb.h. USRTEXT changed to 0x400.
 1.6 07-May-1995  ragge Machine dependent core dump struct added.
 1.5 03-May-1995  ragge mtpr support for 11/780 added. DELAY added. mcount() corrected.
trapframe fixed to support all registers.
 1.4 13-Feb-1995  ragge Lots of fixes...
 1.3 25-Nov-1994  ragge Lots of updates & fixes.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file trap.h was added on branch netbsd-1-0 on 1994-08-02 20:21:02 +0000
 1.14.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.16.20.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.17.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.18.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.26.1 03-Aug-2004  skrll Sync with HEAD
 1.20.84.1 19-Oct-2008  haad Sync with HEAD.
 1.20.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.20.78.1 04-May-2009  yamt sync with head.
 1.20.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.21.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.21.4.1 24-Feb-2009  snj Pull up following revision(s) (requested by mhitch in ticket #479):
sys/arch/vax/conf/files.vax: revision 1.116
sys/arch/vax/include/trap.h: revision 1.22
sys/arch/vax/vax/db_disasm.h: revision 1.6
sys/arch/vax/vax/opcodes.c: revision 1.1
sys/arch/vax/vax/trap.c: revision 1.117
- add siginfo translation for all arithmetic faults and traps.
- skip the current instruction for all faults, to avoid infinite loops on
SIGFPE (from OpenBSD)
Info from: http://bitsavers.vt100.net/pdf/dec/vax/archSpec/EK-VAXAR-RM-001_Arch_May82.pdf
 1.21.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.22.4.1 05-Mar-2011  rmind sync with head
 1.24.84.1 21-Jun-2023  martin Pull up following revision(s) (requested by abs in ticket #201):

sys/arch/vax/vax/pmap.c: revision 1.196
sys/arch/vax/include/trap.h: revision 1.25

Change CASMAGIC to 0xFEDABABE so that it cannot accidentally end up in
valid kernel memory. Due to the VARM accesses above S0 should always
give a ptelen trap.

Bug found by Kalvis Duckmanton.


Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.
 1.24.58.1 21-Jun-2023  martin Pull up following revision(s) (requested by abs in ticket #1648):

sys/arch/vax/vax/pmap.c: revision 1.196
sys/arch/vax/include/trap.h: revision 1.25

Change CASMAGIC to 0xFEDABABE so that it cannot accidentally end up in
valid kernel memory. Due to the VARM accesses above S0 should always
give a ptelen trap.

Bug found by Kalvis Duckmanton.


Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.
 1.24.46.1 21-Jun-2023  martin Pull up following revision(s) (requested by abs in ticket #1829):

sys/arch/vax/vax/pmap.c: revision 1.196
sys/arch/vax/include/trap.h: revision 1.25

Change CASMAGIC to 0xFEDABABE so that it cannot accidentally end up in
valid kernel memory. Due to the VARM accesses above S0 should always
give a ptelen trap.

Bug found by Kalvis Duckmanton.


Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.
 1.51 01-Apr-2021  simonb Whitespace: #define<tab>
 1.50 23-Jan-2016  christos branches: 1.50.30; 1.50.32;
expose the kernel types for standalone code.
 1.49 23-Jan-2016  christos Hide {p,v}{addr,size}_t and register_t (and a couple more types that
are machine-specific) from userland unless _KERNEL/_KMEMUSER and a
new _KERNTYPES variables is defined. The _KERNTYPES should be fixed
for many subsystems that should not be using it (rump)...
 1.48 27-Aug-2015  pooka Fix PTHREAD_FOO_INITIALIZER for C++ by not using volatile in the relevant
pthread types in C++ builds, attempt 2.

The problem with attempt 1 was making assumptions of what the MD
__cpu_simple_lock_t (declared volatile) looks like. To get a same type
except non-volatile, we change the MD type to __cpu_simple_lock_nv_t
and typedef __cpu_simple_lock_t as a volatile __cpu_simple_lock_nv_t.
IMO, __cpu_simple_lock_t should not be volatile at all, but changing it
now is too risky.

Fixes at least Rumprun w/ gcc 5.1/5.2. Furthermore, the mpd application
(and possibly others) will no longer require NetBSD-specific patches.

Tested: build.sh for i386, Rumprun for x86_64 w/ gcc 5.2.

Based on the patch from Christos in lib/49989.
 1.47 25-Aug-2013  matt branches: 1.47.6;
add #define __HAVE_MD_SOFTINT_TRIGGER to <vax/types.h>
Only define a function prototype for softint_trigger
if __HAVE_MD_SOFTINT_TRIGGER is undefined.
 1.46 02-Jul-2012  abs branches: 1.46.2; 1.46.4;
- Increase MAXPARTITIONS for vax from 8 to 16, using the standard NetBSD
mechanism to ensure all existing /dev nodes continue to work
- Adjust boot block layout to fit additional partitions
- Adjust number of inodes on install media
 1.45 25-May-2012  matt Implement __HAVE_RAS. Unlike most implementation, this is done in userret
instead of cpu_switchto since we already accessing the proc structure so
the additional overhead of check p_raslist is minimal.
 1.44 17-Jan-2012  joerg branches: 1.44.2;
Introduce __HAVE_NO___THREAD for sun2 and vax to disable the TLS usage.
Require __HAVE_TLS_VARIANT_I or __HAVE_TLS_VARIANT_II as well as
__lwp_getprivate_fast / __lwp_gettcb_fast to exist for libpthread.
Define VAX as going to use TLS variant I, if it is ever implemented.
 1.43 12-Jun-2011  rmind branches: 1.43.2; 1.43.6;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.42 05-Jun-2011  matt device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.41 22-Dec-2010  matt branches: 1.41.2; 1.41.6;
Add a define __HAVE_CPU_DATA_FIRST which means that cpu_data is the first
member in struct cpu_info.
 1.40 11-Dec-2009  matt branches: 1.40.4;
Add PRIx{P,V}{ADDR,SIZE}, PRIu{P,V}SIZE, and PRIxREGISTER{,32,64} for all
(except where they will be added via merge). These should be used to print
{p,v}{addr,size}_t and register*_t as appropriate.
 1.39 20-Feb-2008  matt branches: 1.39.10;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.38 20-Jan-2008  joerg Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
 1.37 07-Jan-2008  joerg Timecounter support for VAX. Basic testing in simh done on a backported
version to netbsd-4.
 1.36 17-Oct-2007  garbled branches: 1.36.2; 1.36.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.35 14-Jul-2007  ad branches: 1.35.10;
Generic soft interrupts are mandatory.
 1.34 01-Jun-2007  skrll __HAVE_MD_RUNQUEUE is no longer relevant.
 1.33 16-Feb-2007  matt branches: 1.33.6; 1.33.8; 1.33.14;
Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.32 05-Sep-2006  matt #define __HAVE_GENERIC_TODR
 1.31 12-Mar-2006  christos welcome to syscall_intern.
 1.30 24-Dec-2005  perry branches: 1.30.4; 1.30.6; 1.30.8; 1.30.10;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.29 11-Dec-2005  christos merge ktrace-lwp.
 1.28 26-Sep-2003  nathanw branches: 1.28.16;
Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.h
so that they can be used in a namespace-friendly way.
 1.27 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.26 28-Apr-2003  bjh21 branches: 1.26.2;
Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.25 22-Sep-2002  simonb Use "#define\t" instead of "#define ".
 1.24 22-Sep-2002  gmcgarry Add __HAVE_MD_RUNQUEUE flag for MD code to override MI run queue primitives.
 1.23 02-May-2002  thorpej Define __NO_STRICT_ALIGNMENT.
 1.22 28-Feb-2002  simonb Use "#define<tab>".
 1.21 28-Apr-2001  kleink branches: 1.21.2; 1.21.8;
* Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
intmax_t, pointer-type and size_t arguments.
 1.20 14-Jan-2001  thorpej branches: 1.20.2;
Rename __GENERIC_SOFT_INTERRUPTS to __HAVE_GENERIC_SOFT_INTERRUPTS,
and place the definition in <machine/types.h>. This can now be used
as a flag to indicate whether or not <machine/intr.h> can be included
to get the generic soft interrupt API.
 1.19 03-Jan-2001  takemura replace 'long long' with int64_t to compile stand alone program with
compiler other than GCC.
 1.18 04-Mar-2000  matt expunge vm_offset_t and vm_size_t.
add bus_dma support for the vs4000 dma translation map (sgmap).
enhance the vsbus for the lance to work with it.
remove the sgmap init code from ka46/48/49.c
 1.17 12-Feb-2000  ragge Remove __BROKEN_CONFIG_UNIT_USAGE.
 1.16 05-Feb-2000  cgd add __BROKEN_CONFIG_UNIT_USAGE #define, becuase these ports do very
wrong things with device configuration data "cf_unit" information.
 1.15 01-Feb-2000  danw #define __HAVE_DEVICE_REGISTER on ports that have it, and check for
that, rather than a list of architecture defines, in config_attach
 1.14 13-Aug-1998  eeh branches: 1.14.12;
Merge paddr_t changes into the main branch.
 1.13 14-Jun-1998  kleink branches: 1.13.2;
GC the unused `physadr' type, which was not able to hold a complete physical
address on 2 architectures anyhow. Also, move the definition of the `label_t'
type inside _KERNEL protection, since it is specific to the in-kernel
setjmp()/longjmp() implementations.
 1.12 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.11 05-Nov-1997  thorpej Mark uses of long long with /* LONGLONG */ for lint. From
Chris Demetriou <cgd@pa.dec.com>.
 1.10 05-Dec-1996  cgd branches: 1.10.14;
First step inn removing config_scan() and the hacks that gave devices
on indirect-config busses a (permanent) softc that they could share
between 'match' and 'attach' routines:

Define __BROKEN_INDIRECT_CONFIG so that old autoconfiguration
interfaces are used, until drivers are converted to use the new
interfaces (actually, converted back to use the _older_ interfaces)
which prohibit indirect configuration devices from receiving a softc
in their match routine that they can share with their attach routine.
 1.9 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.8 03-Mar-1996  ragge Enable label_t.
 1.7 24-Feb-1996  ragge Remove __FORK_BRAINDAMAGE, and the reason to why it was there.
 1.6 09-Dec-1995  mycroft Define __FORK_BRAINDAMAGE.
 1.5 06-Jul-1995  cgd add <sys/cdefs.h> inclusions. namsspace-protect physadr, label_t
def'ns against _POSIX_SOURCE and _ANSI_SOURCE.
 1.4 26-Jun-1995  cgd define __BDEVSW_DUMP_OLD_TYPE for ports where it's true. clean up
some m68k ports inclusion of common header.
 1.3 13-Feb-1995  ragge Lots of fixes...
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file types.h was added on branch netbsd-1-0 on 1994-08-02 20:21:04 +0000
 1.10.14.1 05-Nov-1997  thorpej Update from trunk: Mark usese of long long with /* LONGLONG */ for lint.
 1.13.2.2 12-Aug-1998  eeh Protect XOPEN and POSIX code from vm_offset_t, paddr_t, vaddr_t, vm_size_t, psize_t, and vsize_t.
 1.13.2.1 30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.14.12.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.14.12.2 05-Jan-2001  bouyer Sync with HEAD
 1.14.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.20.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.21.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.21.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.21.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.21.8.1 28-Apr-2001  nathanw file types.h was added on branch nathanw_sa on 2002-04-01 07:43:30 +0000
 1.21.2.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.21.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.21.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.26.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.26.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.16.6 27-Feb-2008  yamt sync with head.
 1.28.16.5 21-Jan-2008  yamt sync with head
 1.28.16.4 03-Sep-2007  yamt sync with head.
 1.28.16.3 26-Feb-2007  yamt sync with head.
 1.28.16.2 30-Dec-2006  yamt sync with head.
 1.28.16.1 21-Jun-2006  yamt sync with head.
 1.30.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.30.8.2 14-Sep-2006  yamt sync with head.
 1.30.8.1 13-Mar-2006  yamt sync with head.
 1.30.6.1 22-Apr-2006  simonb Sync with head.
 1.30.4.1 09-Sep-2006  rpaulo sync with head
 1.33.14.2 03-Oct-2007  garbled Sync with HEAD
 1.33.14.1 26-Jun-2007  garbled Sync with HEAD.
 1.33.8.1 11-Jul-2007  mjf Sync with head.
 1.33.6.2 15-Jul-2007  ad Sync with head.
 1.33.6.1 09-Jun-2007  ad Sync with head.
 1.35.10.3 23-Mar-2008  matt sync with HEAD
 1.35.10.2 09-Jan-2008  matt sync with HEAD
 1.35.10.1 06-Nov-2007  matt sync with HEAD
 1.36.8.2 23-Jan-2008  bouyer Sync with HEAD.
 1.36.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.36.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.39.10.1 11-Mar-2010  yamt sync with head
 1.40.4.4 12-Jun-2011  rmind sync with head
 1.40.4.3 05-Mar-2011  rmind sync with head
 1.40.4.2 25-Apr-2010  rmind - Invent mm_md_getva() and mm_md_relva() routines, provided by MD and
indicated with __HAVE_MM_MD_PREFER_VA. It will be used to deal with
cache aliasing issues and thus fix little MIPS, ARM and friends.

- Convert dev_mem_readwrite() to use unmanaged mappings. Fix a missed
offset addition in a case of direct map. Sprinkle various comments in
the memory device driver.

- Add missing direct map handling on hp700 and vax. Make checks across
m68k ports more consistent, reduce the diffs. Fix kernacc check miss
on news68k. Minor off-by-one fix for alpha. Add MEMC_PHYS_BASE for
mmap() case check on acorn26. Misc clean-up.
 1.40.4.1 18-Mar-2010  rmind Unify /dev/{mem,kmem,zero,null} implementations in MI code. Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
 1.41.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.41.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.43.6.2 02-Jun-2012  mrg sync to latest -current.
 1.43.6.1 18-Feb-2012  mrg merge to -current.
 1.43.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.43.2.2 30-Oct-2012  yamt sync with head
 1.43.2.1 17-Apr-2012  yamt sync with head
 1.44.2.1 05-Jul-2012  riz Pull up following revision(s) (requested by abs in ticket #403):
sys/arch/vax/include/disklabel.h: revision 1.6
sys/sys/bootblock.h: revision 1.54
sys/arch/vax/include/types.h: revision 1.46
distrib/vax/miniroot/Makefile.inc: revision 1.21
- Increase MAXPARTITIONS for vax from 8 to 16, using the standard NetBSD
mechanism to ensure all existing /dev nodes continue to work
- Adjust boot block layout to fit additional partitions
- Adjust number of inodes on install media
 1.46.4.1 28-Aug-2013  rmind sync with head
 1.46.2.2 03-Dec-2017  jdolecek update from HEAD
 1.46.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.6.2 19-Mar-2016  skrll Sync with HEAD
 1.47.6.1 22-Sep-2015  skrll Sync with HEAD
 1.50.32.1 03-Apr-2021  thorpej Sync with HEAD.
 1.50.30.1 03-Apr-2021  thorpej Sync with HEAD.
 1.15 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.14 25-May-2012  matt branches: 1.14.2; 1.14.16;
Implement __HAVE_RAS. Unlike most implementation, this is done in userret
instead of cpu_switchto since we already accessing the proc structure so
the additional overhead of check p_raslist is minimal.
 1.13 03-Jul-2011  matt branches: 1.13.2; 1.13.6;
Cleanup trapframe handling. Instead of keeping a trapframe pointer in the
pcb, put in the mdlwp instead. We had a dummy field so it didn't grow in
size. This also follows the practice that mips and powerpc follow that a
pointer to the user trapframe is in l->l_md.md_utf. Make trapframe members
start with tf_
 1.12 27-Feb-2010  snj Spell "exception" properly.
 1.11 22-Oct-2008  hans branches: 1.11.14;
fix userret() and resurrect cpu_setfunc() to make vax build again. ok by matt.
 1.10 15-Oct-2008  wrstuden Merge wrstuden-revivesa into HEAD.
 1.9 05-Nov-2007  ad branches: 1.9.16; 1.9.20; 1.9.22; 1.9.26;
Don't set l_usrpri / spc_curpriority here. mi_userret() does it.
 1.8 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.7 01-Oct-2007  ad branches: 1.7.2;
ci_need_resched -> ci_want_resched
 1.6 17-May-2007  yamt branches: 1.6.8; 1.6.10; 1.6.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.5 19-Feb-2007  matt branches: 1.5.4; 1.5.6; 1.5.12;
L_USERRET -> LW_USERRET
 1.4 17-Feb-2007  matt branches: 1.4.2;
Add an implementation for krwlock_t. Initialize ci_mtx_count to 1 (biased).
Fix a few buglets in the kmutex_t implementation.
 1.3 16-Feb-2007  ad More MD changes to get vax compiling.
 1.2 09-Feb-2007  ad Merge newlock2 to head.
 1.1 12-Mar-2006  christos branches: 1.1.2; 1.1.6; 1.1.8; 1.1.14; 1.1.18; 1.1.20;
welcome to syscall_intern.
 1.1.20.2 09-Sep-2006  rpaulo sync with head
 1.1.20.1 12-Mar-2006  rpaulo file userret.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:44:14 +0000
 1.1.18.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.1.14.6 15-Nov-2007  yamt sync with head.
 1.1.14.5 27-Oct-2007  yamt sync with head.
 1.1.14.4 03-Sep-2007  yamt sync with head.
 1.1.14.3 26-Feb-2007  yamt sync with head.
 1.1.14.2 21-Jun-2006  yamt sync with head.
 1.1.14.1 12-Mar-2006  yamt file userret.h was added on branch yamt-lazymbuf on 2006-06-21 14:57:33 +0000
 1.1.8.2 22-Apr-2006  simonb Sync with head.
 1.1.8.1 12-Mar-2006  simonb file userret.h was added on branch simonb-timecounters on 2006-04-22 11:38:06 +0000
 1.1.6.2 19-Apr-2006  elad sync with head - hopefully this will work
 1.1.6.1 12-Mar-2006  elad file userret.h was added on branch elad-kernelauth on 2006-04-19 02:33:57 +0000
 1.1.2.2 13-Mar-2006  yamt sync with head.
 1.1.2.1 12-Mar-2006  yamt file userret.h was added on branch yamt-pdpolicy on 2006-03-13 09:07:03 +0000
 1.4.2.3 04-Apr-2007  matt Not quite functional idlelwp adaption for VAX. lwp fork works but the
kernel never seems to return/stay in usermode.
 1.4.2.2 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.4.2.1 17-Feb-2007  yamt file userret.h was added on branch yamt-idlelwp on 2007-02-27 16:53:21 +0000
 1.5.12.2 03-Oct-2007  garbled Sync with HEAD
 1.5.12.1 22-May-2007  matt Update to HEAD.
 1.5.6.1 11-Jul-2007  mjf Sync with head.
 1.5.4.3 03-Dec-2007  ad Sync with HEAD.
 1.5.4.2 09-Oct-2007  ad Sync with head.
 1.5.4.1 27-May-2007  ad Sync with head.
 1.6.12.1 07-Oct-2007  yamt sync with head.
 1.6.10.1 06-Nov-2007  matt sync with HEAD
 1.6.8.2 06-Nov-2007  joerg Sync with HEAD.
 1.6.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.7.2.1 13-Nov-2007  bouyer Sync with HEAD
 1.9.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.9.26.1 19-Oct-2008  haad Sync with HEAD.
 1.9.22.1 22-Jun-2008  wrstuden Re-add cpu_upcall() and page fault code. i386 kernels now compile.
They don't boot, but that seems to be a consequence of current from the
day this branch was started.
 1.9.20.2 11-Mar-2010  yamt sync with head
 1.9.20.1 04-May-2009  yamt sync with head.
 1.9.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.11.14.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.13.6.1 02-Jun-2012  mrg sync to latest -current.
 1.13.2.1 30-Oct-2012  yamt sync with head
 1.14.16.1 28-Aug-2017  skrll Sync with HEAD
 1.14.2.1 03-Dec-2017  jdolecek update from HEAD
 1.9 10-Aug-2023  andvar s/VAXststions/VAXstations/ in comment.
 1.8 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.7 28-Sep-2002  ragge branches: 1.7.156; 1.7.176;
Add common routines to talk with the CPMBX, from Hugh Graham (hugh@openbsd.org)
This makes halt/reboot work correctly on a bunch of machines.
 1.6 02-Jun-2000  matt branches: 1.6.6; 1.6.10;
Include offsets in vs_cpu register in comments.
 1.5 02-Feb-1999  ragge branches: 1.5.8; 1.5.16;
Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.4 11-Aug-1998  ragge Cache and microsecond clock resolution on KA46.
 1.3 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.2 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.1 20-Jul-1996  ragge branches: 1.1.6;
Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.1.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.5.16.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.6.6.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.7.176.1 28-Aug-2017  skrll Sync with HEAD
 1.7.156.1 03-Dec-2017  jdolecek update from HEAD
 1.5 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.4 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.3 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.2 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.1 23-Feb-1995  ragge Def's for uVAXII added.
 1.12 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 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.9 26-Dec-1995  mycroft branches: 1.9.64;
Make the type of __builtin_va_list a long.
 1.8 26-Dec-1995  mycroft Use __builtin_va_alist.
 1.7 25-Dec-1995  mycroft Stylistic changes.
 1.6 25-Dec-1995  mycroft Update for GCC 2.7, and fix bugs.
 1.5 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.4 28-Jan-1995  jtc ANSI says that <stdarg.h>'s va_end macro must expand to a void expression.
For consistancy, I'm changing <varargs.h> too.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 15-Oct-1994  cgd make <stdarg.h> a symlink, and clean up ports' stdarg.h and varargs.h files.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Initial VAX port merging.
 1.1.2.2 02-Aug-1994  ragge Initial VAX port merging.
 1.1.2.1 02-Aug-1994  ragge file varargs.h was added on branch netbsd-1-0 on 1994-08-02 20:21:05 +0000
 1.9.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.64.1 03-Aug-2004  skrll Sync with HEAD
 1.8 05-Aug-2008  matt Update <machine/ieeefp.h> to use the C99 FE_* definitions instead of the
NetBSD defined ones. Redefine the NetBSD ones in terms of the C99 ones.
Step 1 to having <fenv.h>
 1.7 28-Apr-2008  martin branches: 1.7.2; 1.7.6;
Remove clause 3 and 4 from TNF licenses
 1.6 26-Feb-2007  christos branches: 1.6.42; 1.6.44; 1.6.46;
Provide constants for the widths of the bitfields and use them.
 1.5 11-Dec-2005  christos branches: 1.5.24; 1.5.26;
merge ktrace-lwp.
 1.4 18-Mar-2004  kleink branches: 1.4.4; 1.4.18;
Normalize multiple inclusion protection symbol names.
 1.3 20-Jan-2004  matt Add multiple protection inclusion.
s/u_int/unsigned int/
Fix typo.
 1.2 30-Oct-2003  kleink s/sgn/sign/, for consistency with IEEE headers.
 1.1 27-Oct-2003  kleink Enter vaxfp.h, the VAX pendant of <machine/ieee.h>.
 1.4.18.1 03-Sep-2007  yamt sync with head.
 1.4.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.4.2 03-Aug-2004  skrll Sync with HEAD
 1.4.4.1 18-Mar-2004  skrll file vaxfp.h was added on branch ktrace-lwp on 2004-08-03 10:42:23 +0000
 1.5.26.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.5.24.1 12-May-2007  snj Pull up following revision(s) (requested by mhitch in ticket #646):
lib/libc/gdtoa/hdtoa.c: revision 1.5
sys/arch/vax/include/vaxfp.h: revision 1.6
deal with the vax in a slightly disgusting way.
Provide constants for the widths of the bitfields and use them.
 1.6.46.2 04-May-2009  yamt sync with head.
 1.6.46.1 16-May-2008  yamt sync with head.
 1.6.44.1 18-May-2008  yamt sync with head.
 1.6.42.2 28-Sep-2008  mjf Sync with HEAD.
 1.6.42.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.6.1 19-Oct-2008  haad Sync with HEAD.
 1.7.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.51 31-Mar-2018  ragge Shrink MAXDSIZ to 512MB.
XXX this should be depending of amount of physical memory.
 1.50 26-Jan-2014  christos branches: 1.50.28;
don't re-specify the defaults
 1.49 25-Jan-2014  christos delete VM_DEFAULT_ADDRESS; some of those should be GC'ed because they match
the default definition.
 1.48 18-Sep-2013  martin Bump MAXTSIZ to 32 MB (it is an arbitrary limit anyway)
 1.47 14-Nov-2010  uebayasi branches: 1.47.8; 1.47.18; 1.47.22;
Move struct vm_page_md definition from vmparam.h to pmap.h, because
it's used only by pmap. vmparam.h has definitions for wider
audience.

All GENERIC kernels build tested, except ia64.

powerpc/include/booke/vmparam.h has one too, but it has no pmap.h,
so it's left as is.
 1.46 06-Nov-2010  uebayasi Remove incomplete, never worked dynamic run-time memory registration
(uvm_page_physload(9)). This functionality will be re-added later.
 1.45 06-Mar-2009  joerg branches: 1.45.2; 1.45.4;
Remove SHMMAXPGS from all kernel configs. Dynamically compute the
initial limit as 1/4 of the physical memory. Ensure the limit is at
least 1024 pages, the old default on most platforms.
 1.44 11-Mar-2008  matt branches: 1.44.4; 1.44.12; 1.44.18;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.43 11-Dec-2005  christos branches: 1.43.50; 1.43.70; 1.43.74;
merge ktrace-lwp.
 1.42 14-Dec-2003  ragge branches: 1.42.16;
TOPDOWN_VM is now mandatory on vax.
 1.41 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.40 26-Feb-2003  ragge branches: 1.40.2;
Enable USE_TOPDOWN_VM. This also makes it possible to use large address
spaces, so bump MAXDSIZ to 1GB.
 1.39 10-Dec-2002  thorpej Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
 1.38 01-Apr-2002  ragge Wrap up SHMMAXPGS to 1024, no reason to keep it low.
 1.37 19-Feb-2002  thorpej Bump the default data limit to 32M and the max data limit to 64M.
These are the same values that the hp300 port uses (lesser hp300s
have roughly the same memory constraints as "lesser" vaxen), and
bumping them allows us to run a statically linked ELF groff(1).
 1.36 15-Nov-2001  soren branches: 1.36.2;
MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
 1.35 01-May-2001  thorpej branches: 1.35.2;
Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.
 1.34 29-Apr-2001  thorpej Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.
 1.33 14-Nov-2000  thorpej branches: 1.33.2;
We use 4K VM pages on the VAX. Make PAGE_SIZE and friends into
compile-time constants.
 1.32 07-Mar-2000  matt add real vmapbuf/vunmapbuf routines. needed for VS4000 SCSI support.
 1.31 04-Mar-2000  matt expunge vm_offset_t and vm_size_t.
add bus_dma support for the vs4000 dma translation map (sgmap).
enhance the vsbus for the lance to work with it.
remove the sgmap init code from ka46/48/49.c
 1.30 11-Feb-2000  thorpej Update for the NKMEMPAGES changes.
 1.29 26-Jan-2000  tsutsui Remove obsoleted macros.
 1.28 12-Dec-1999  ragge CL* discarding.
 1.27 22-Oct-1999  ragge Remove the vmapbuf()/vunmapbuf() routines. They are quite unneccessary
on a machine that has MMU for its I/O devices.
 1.26 20-Jun-1999  ragge branches: 1.26.2; 1.26.4; 1.26.6;
Add macros to round/trunc vax pages.
 1.25 26-Apr-1999  thorpej Garbage-collect VM_MBUF_SIZE.
 1.24 06-Mar-1999  ragge branches: 1.24.4;
pmap_physseg must be visible.
 1.23 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.22 16-Jan-1999  chuck MNN is no longer optional
 1.21 01-Jan-1999  ragge Giant change: NBPG now set to 4k and CLSIZE == 1 for vax. This change
made a whole bunch of annoying bugs disappear; mostly depending on
bad use of NBPG in non-MD code. The VAX port was the only port that
used this historical "feature".

The CL* macros should probably go away totally, there is no reason
at all to keep them.
 1.20 29-Nov-1998  ragge Protect against multiple inclusion. Struct needs at least one argument.
 1.19 21-Aug-1998  ragge VAX logical page size increased to 4k.
 1.18 08-Jul-1998  thorpej Define one page free list, and put all pages on it.
 1.17 03-May-1998  ragge Remove the ancient kernel-stack area at top of P1 region. Make PMAP_NEW
almost work. Also Wall cleaning.
 1.16 02-Mar-1998  ragge Support for UVM on VAXen.
 1.15 12-Jul-1997  perry update comment from 1981 on memory and disk prices -- pr-2754 from Curt Sampson
 1.14 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainilne.
 1.13 12-Feb-1997  ragge branches: 1.13.2;
Walk a step closer to more intelligent User PTE handling.
 1.12 20-Jul-1996  ragge branches: 1.12.4; 1.12.6;
Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.11 02-Feb-1996  mycroft ASSEMBLER -> _LOCORE
 1.10 13-Dec-1995  ragge PG_SHIFT -> PGSHIFT.
 1.9 22-Aug-1995  ragge Changed way to calculate USRPTSIZE.
 1.8 05-Jun-1995  ragge New file pcb.h. USRTEXT changed to 0x400.
 1.7 05-May-1995  ragge Removed cpu_set_init_frame() use.
Increased default limits of memory use, ridiculously small before.
 1.6 13-Feb-1995  ragge Lots of fixes...
 1.5 25-Nov-1994  ragge Lots of updates & fixes.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Changes to make files more 4.4/1.0B working.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Minor updates of some errouneous parameters.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Minor updates of some errouneous parameters.
 1.2.2.1 16-Aug-1994  ragge file vmparam.h was added on branch netbsd-1-0 on 1994-08-16 23:41:58 +0000
 1.12.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.12.4.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.13.2.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.24.4.2 06-Aug-1999  chs take an initial guess at UBC parameters.
 1.24.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.26.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.26.4.1 15-Nov-1999  fvdl Sync with -current
 1.26.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.26.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.33.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.35.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.35.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.36.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.36.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.36.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.36.2.1 15-Nov-2001  nathanw file vmparam.h was added on branch nathanw_sa on 2002-02-28 04:12:30 +0000
 1.40.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.40.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.40.2.1 03-Aug-2004  skrll Sync with HEAD
 1.42.16.1 17-Mar-2008  yamt sync with head.
 1.43.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.43.70.1 24-Mar-2008  keiichi sync with head.
 1.43.50.1 23-Mar-2008  matt sync with HEAD
 1.44.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.44.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.44.4.1 04-May-2009  yamt sync with head.
 1.45.4.1 05-Mar-2011  rmind sync with head
 1.45.2.3 16-Nov-2010  uebayasi Sync with HEAD.
 1.45.2.2 26-Apr-2010  uebayasi Remove the unfinished code to add a memory segment after uvm_page_init().
It doesn't even compile.

(In the future, we should allocate struct vm_page [] on the added memory
segment for NUMA's sake.)
 1.45.2.1 23-Feb-2010  uebayasi Convert all VM_MDPAGE_INIT()'s to take struct vm_page_md * and paddr_t.
 1.47.22.1 18-May-2014  rmind sync with head
 1.47.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.8.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.50.28.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.21 12-Dec-2022  jakllsch vsbus vax: sprinkle volatile for register accesses
 1.20 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.19 28-Jun-2012  abs branches: 1.19.2; 1.19.16;
Define and use VS_REGS_KA49 rather than magic numbers. From OpenBSD.
 1.18 11-Mar-2008  matt branches: 1.18.38;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.17 03-Feb-2008  matt branches: 1.17.2; 1.17.6;
use memt instead of iot since everything is memory mapped.
 1.16 04-Mar-2007  christos branches: 1.16.20; 1.16.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 11-Dec-2005  christos branches: 1.15.26;
merge ktrace-lwp.
 1.14 13-Feb-2004  wiz branches: 1.14.16;
Uppercase CPU, plural is CPUs.
 1.13 25-Jun-2000  ragge branches: 1.13.24;
Make the HDC9224 MFM device driver up-to-date; has been not-working
since NetBSD 1.2 (!) It also uses interrupts instead of polling now.
Also fix the DMA area locking between SCSI and MFM disks.
Still missing - floppy support.
 1.12 23-Apr-2000  matt branches: 1.12.4;
Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.11 04-Mar-2000  matt expunge vm_offset_t and vm_size_t.
add bus_dma support for the vs4000 dma translation map (sgmap).
enhance the vsbus for the lance to work with it.
remove the sgmap init code from ka46/48/49.c
 1.10 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.9 22-Oct-1999  ragge Add routines to copy to/from a user process from/to the vsbus DMA area.
 1.8 14-Apr-1999  ragge branches: 1.8.2; 1.8.4; 1.8.6;
First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.7 13-Mar-1999  ragge branches: 1.7.4;
Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.6 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.5 01-Jan-1999  ragge Giant change: NBPG now set to 4k and CLSIZE == 1 for vax. This change
made a whole bunch of annoying bugs disappear; mostly depending on
bad use of NBPG in non-MD code. The VAX port was the only port that
used this historical "feature".

The CL* macros should probably go away totally, there is no reason
at all to keep them.
 1.4 10-Aug-1998  ragge Basic support for VS4000/60.
 1.3 07-Jun-1998  ragge Enable use of secondary cache, if present.
 1.2 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.1 20-Jul-1996  ragge Numerous changes to be able to put Bertram Barth's VAXstation support in.
(Some) Support for VAXstation 2000/MicroVAX 2000, VAXstation 3100/76.
 1.7.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.1 15-Nov-1999  fvdl Sync with -current
 1.8.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.4.1 28-Jun-2000  ragge Pull up revision 1.13 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.13.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.24.1 03-Aug-2004  skrll Sync with HEAD
 1.14.16.3 17-Mar-2008  yamt sync with head.
 1.14.16.2 04-Feb-2008  yamt sync with head.
 1.14.16.1 03-Sep-2007  yamt sync with head.
 1.15.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.16.20.1 23-Mar-2008  matt sync with HEAD
 1.17.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.17.2.1 24-Mar-2008  keiichi sync with head.
 1.18.38.1 30-Oct-2012  yamt sync with head
 1.19.16.1 28-Aug-2017  skrll Sync with HEAD
 1.19.2.1 03-Dec-2017  jdolecek update from HEAD
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 11-Dec-2005  christos branches: 1.2.74; 1.2.76; 1.2.78;
merge ktrace-lwp.
 1.1 08-May-2004  kleink branches: 1.1.2;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 08-May-2004  skrll file wchar_limits.h was added on branch ktrace-lwp on 2004-08-03 10:42:23 +0000
 1.2.78.1 16-May-2008  yamt sync with head.
 1.2.76.1 18-May-2008  yamt sync with head.
 1.2.74.1 02-Jun-2008  mjf Sync with HEAD.

RSS XML Feed