Home | History | Annotate | only in /src/sys/arch/vax
History log of /src/sys/arch/vax
RevisionDateAuthorComments
 1.4 20-Jun-1998  ragge Remove since long unused files.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 05-Jul-1995  ragge More near reality.
 1.1 30-Mar-1995  ragge Bug log...
 1.3 20-Jun-1998  ragge Remove since long unused files.
 1.2 15-Mar-1997  ragge Make install docs more up-to-date.
 1.1 16-Sep-1995  ragge Readme & install files added and updated.
 1.6 06-Jan-2003  lukem Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile. Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
 1.5 14-May-2002  lukem deprecate MD installboot in favour of MI installboot in /usr/sbin
 1.4 09-Apr-2002  matt Add stand/pcs
 1.3 17-Jun-2000  matt branches: 1.3.6; 1.3.10;
Add an installboot.
 1.2 12-Jun-1998  cgd branches: 1.2.14; 1.2.22;
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.1 16-Mar-1996  ragge Support installation of /usr/mdec files.
 1.2.22.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.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.3.10.3 07-Jan-2003  thorpej Sync with HEAD.
 1.3.10.2 20-Jun-2002  nathanw Catch up to -current.
 1.3.10.1 17-Apr-2002  nathanw Catch up to -current.
 1.3.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.11 20-Jun-1998  ragge Remove since long unused files.
 1.10 15-Mar-1997  ragge Make install docs more up-to-date.
 1.9 16-Sep-1995  ragge Readme & install files added and updated.
 1.8 05-Jul-1995  ragge More near reality.
 1.7 30-Mar-1995  ragge Bug log...
 1.6 13-Feb-1995  ragge *** empty log message ***
 1.5 25-Nov-1994  ragge *** empty log message ***
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge New information about VAX port
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Update of vax port.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Update of vax port.
 1.2.2.1 16-Aug-1994  ragge file README was added on branch netbsd-1-0 on 1994-08-16 23:39:53 +0000
 1.4 20-Jun-1998  ragge Remove since long unused files.
 1.3 15-Mar-1997  ragge Make install docs more up-to-date.
 1.2 29-Sep-1995  ragge Some typos.
 1.1 16-Sep-1995  ragge Readme & install files added and updated.
 1.2 20-Jun-1998  ragge Remove since long unused files.
 1.1 16-Sep-1995  ragge Readme & install files added and updated.
 1.12 04-Aug-1999  ragge Moved to dev/bi.
 1.11 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.10 29-Nov-1998  ragge Wall fix.
 1.9 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.8 31-Aug-1998  ragge Support for all 4 console lines on KA820. Support for this written
by Sergey Svishchev (svs@ropnet.ru).
 1.7 13-Apr-1998  ragge Wall cleaning.
 1.6 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.5 12-Jan-1998  thorpej Update for changes to config.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.1 19-Jul-1996  ragge Support for the VAXBI bus, and KDB50 device driver (MSCP disk).
Parts of this written by Chris Torek at the beginning of time.
 1.12 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.11 14-Dec-2010  matt branches: 1.11.18; 1.11.36;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.10 11-Mar-2008  matt branches: 1.10.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.9 11-Dec-2005  christos branches: 1.9.50; 1.9.70; 1.9.74;
merge ktrace-lwp.
 1.8 15-Jul-2003  lukem branches: 1.8.16;
__KERNEL_RCSID()
 1.7 02-Oct-2002  thorpej branches: 1.7.6;
Add trailing ; to CFATTACH_DECL.
 1.6 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 26-Jul-2000  ragge branches: 1.4.4; 1.4.8;
VAX-specific bi support changes.
 1.3 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.2 26-Mar-2000  ragge branches: 1.2.2;
Implement bi_intr_establish(). Add some fields about which CPU to interrupt.
 1.1 07-Aug-1999  ragge branches: 1.1.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.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.2.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.4.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.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 17-Mar-2008  yamt sync with head.
 1.9.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.9.70.1 24-Mar-2008  keiichi sync with head.
 1.9.50.1 23-Mar-2008  matt sync with HEAD
 1.10.26.1 05-Mar-2011  rmind sync with head
 1.11.36.1 28-Aug-2017  skrll Sync with HEAD
 1.11.18.1 03-Dec-2017  jdolecek update from HEAD
 1.9 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.8 14-Dec-2010  matt branches: 1.8.18; 1.8.36;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.7 11-Mar-2008  matt branches: 1.7.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.6 11-Dec-2005  christos branches: 1.6.50; 1.6.70; 1.6.74;
merge ktrace-lwp.
 1.5 15-Jul-2003  lukem branches: 1.5.16;
__KERNEL_RCSID()
 1.4 02-Oct-2002  thorpej branches: 1.4.6;
Add trailing ; to CFATTACH_DECL.
 1.3 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.2 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.1 26-Jul-2000  ragge branches: 1.1.2; 1.1.6; 1.1.10;
Support for the KA88 CPU and the NMI backplane.
 1.1.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.1.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.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 bi_nmi.c was added on branch thorpej_scsipi on 2000-11-20 20:32:34 +0000
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 17-Mar-2008  yamt sync with head.
 1.6.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.70.1 24-Mar-2008  keiichi sync with head.
 1.6.50.1 23-Mar-2008  matt sync with HEAD
 1.7.26.1 05-Mar-2011  rmind sync with head
 1.8.36.1 28-Aug-2017  skrll Sync with HEAD
 1.8.18.1 03-Dec-2017  jdolecek update from HEAD
 1.5 04-Aug-1999  ragge Moved to dev/bi.
 1.4 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.3 31-Aug-1998  ragge Support for all 4 console lines on KA820. Support for this written
by Sergey Svishchev (svs@ropnet.ru).
 1.2 13-Apr-1998  ragge Wall cleaning.
 1.1 19-Jul-1996  ragge Support for the VAXBI bus, and KDB50 device driver (MSCP disk).
Parts of this written by Chris Torek at the beginning of time.
 1.3 04-Aug-1999  ragge Moved to dev/bi.
 1.2 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.1 19-Jul-1996  ragge Support for the VAXBI bus, and KDB50 device driver (MSCP disk).
Parts of this written by Chris Torek at the beginning of time.
 1.16 04-Aug-1999  ragge Moved to dev/bi.
 1.15 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.14 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.13 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.12 02-Mar-1998  ragge Support for UVM on VAXen.
 1.11 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.10 18-Jan-1998  ragge Make kernel compile & run again after latest config changes.
 1.9 12-Jan-1998  thorpej Update for changes to config.
 1.8 03-Jan-1998  thorpej Grab the PCB directly from the u-area, not by indirecting through VM
structures.
 1.7 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.6 06-Jul-1997  ragge Remove __VM_PMAP_HACK.
 1.5 11-Jan-1997  ragge Update due to changes to uba/mscp functions.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.1 19-Jul-1996  ragge Support for the VAXBI bus, and KDB50 device driver (MSCP disk).
Parts of this written by Chris Torek at the beginning of time.
 1.2 04-Aug-1999  ragge Moved to dev/bi.
 1.1 19-Jul-1996  ragge Support for the VAXBI bus, and KDB50 device driver (MSCP disk).
Parts of this written by Chris Torek at the beginning of time.
 1.4 04-Aug-1999  ragge Moved to dev/bi.
 1.3 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.2 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.1 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.2 16-Sep-1995  ragge Obsolete when not using Microvax rom anymore.
 1.1 29-Mar-1995  ragge Added support for uVAX boot.
 1.22 29-Mar-2002  matt Add a xxboot_ustarfs for floppies.
 1.21 06-Mar-1999  ragge branches: 1.21.22; 1.21.26;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.20 11-Nov-1998  matt Make DHCP/BOOTP the default for VAX net booting
 1.19 09-Oct-1998  matt include <bsd.prog.mk> and make changes so that "make obj" works.
Make it easy to build an boot which uses BOOTP/DHCP instead
RARP/BOOTPARAMS.
 1.18 01-Jul-1998  ragge Added boot program support for the SGEC Ethernet controller, present on
some VAX 4000 maachines. Written by Jay Maynard. (jmaynard@phoenix.net)
 1.17 11-Mar-1998  ragge Standalone routine for DEQNA, written by Roar Thronaes.
 1.16 28-Feb-1998  ragge Move the boot program higher up in memory; to allow loading of bigger kernels.
 1.15 20-Oct-1997  ragge Fix vers.c dependency; PR#4090.
 1.14 29-Jun-1997  ragge Must grok includes. Also; prettier compile-time printout.
 1.13 08-Jun-1997  ragge Use correct console on KA65? machines. Bugfix when specifying adaptor
number. Show compile-time for boot. Prettier printout.
 1.12 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.11 18-Oct-1996  thorpej Use ${INSTALL}.
 1.10 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.9 16-Mar-1996  ragge Support installation of /usr/mdec files.
 1.8 02-Mar-1996  ragge Add VAX780 support to the boot program.
 1.7 17-Feb-1996  ragge Add standalone driver for TU58 (DECtape II). Now initial installation
from TU58 on 11/750 is possible.
Change types on pte pointers, due to the change of pte's from
int to struct pte.
 1.6 28-Dec-1995  ragge Create libkern as a .a instead of a .o file.
 1.5 20-Oct-1995  ragge branches: 1.5.2;
SA_LIB -> SALIB
Include rpb.h. Typeclash fixes.
Removed #include of non-existing file.
 1.4 16-Sep-1995  ragge TMSCP support added.
 1.3 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.2 29-Mar-1995  ragge Added support for uVAX boot.
 1.1 13-Feb-1995  ragge Boot program added.
 1.5.2.2 20-Oct-1995  ragge SA_LIB -> SALIB
Include rpb.h. Typeclash fixes.
Removed #include of non-existing file.
 1.5.2.1 20-Oct-1995  ragge file Makefile was added on branch netbsd-1-1 on 1995-10-20 13:35:45 +0000
 1.21.26.1 17-Apr-2002  nathanw Catch up to -current.
 1.21.22.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19 29-Jan-2023  tsutsui Make a vax bootloader work on 8MB VAXen.

64KB (0x800000 - 0x7f0000) is not enough for the bootloader itself
and more spaces are required for heap on loading a kernel.
https://mail-index.netbsd.org/port-vax/2023/01/24/msg004149.html

"Go ahead" from ragge@. Should be pulled up to netbsd-10 and netbsd-9.
 1.18 22-Mar-2018  ragge branches: 1.18.6; 1.18.32;
Let boot relocate to just below 8MB. This solves the problem with
booting a kernel larger than below 4MB.
 1.17 13-Mar-2016  christos branches: 1.17.10; 1.17.16;
Add NO variables for the things that boot block does not support
(SSP/PIE/DEBUG/FORTIFY)
 1.16 21-Aug-2013  matt branches: 1.16.6;
Use <bsd.klinks.mk>
 1.15 18-Jul-2013  joerg Explicitly disable unwind tables for the boot loader.
 1.14 31-Mar-2007  matt branches: 1.14.72; 1.14.82; 1.14.88; 1.14.96;
Add -fno-pic to CFLAGS and AFLAGS
 1.13 13-Mar-2007  ragge Link the boot loader for address 4M-64k, as requested by Hans Rosenfeld.
It's not likely that a vax has less than 4MB of memory today, if someone
has a small-memory-machine he have to recompile boot himself.
 1.12 06-Sep-2006  matt branches: 1.12.6; 1.12.8; 1.12.12; 1.12.14; 1.12.16;
Define LIBCRTBEGIN/LIBCRTEND so we don't need to build userland before
building the bootloaders.
 1.11 02-Jun-2006  mrg remove support for building (with) GCC 2.95. also:
- always install <stdbool.h>
- don't generate a fake one for vax / gettext.
 1.10 07-Apr-2006  mrg branches: 1.10.2;
retire HAVE_GCC3/HAVE_GCC4 and introduce HAVE_GCC that is set to 2, 3 or 4.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.6; 1.9.8; 1.9.10; 1.9.12;
merge ktrace-lwp.
 1.8 11-Dec-2003  matt branches: 1.8.16;
Rework things to move common stuff into Makefile.inc.
 1.7 08-Dec-2003  matt Move common CFLAGS/AFLAGS to Makefile.inc.
For now, only suppy -mno-asm-pic when not using gcc3.
 1.6 24-Feb-2002  matt branches: 1.6.16;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.5 02-Nov-2000  ragge branches: 1.5.4; 1.5.8;
Remove unused define.
 1.4 19-Jul-2000  matt Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.3 03-Jul-2000  matt Make cross-compile friendly
 1.2 18-Jul-1999  abs branches: 1.2.2;
Work with obj dirs (It seems that ${.CURDIR}/... is your friend).
If I _had_ to pick an arch on which to learn how this stuff works, it probably
would not have been vax... unless of course I was experimenting with time
compressing drugs. If we have a 1.4.2, this is definitely a candidate.
 1.1 06-Mar-1999  ragge branches: 1.1.2; 1.1.4;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.4.1 02-Aug-1999  thorpej Update from trunk.
 1.1.2.1 01-Mar-2000  he Apply patch (requested by toddpw):
Finish porting sysinst to vax, and build various bootable installers
in new directory distrib/vax/bootfs.
 1.2.2.2 22-Nov-2000  bouyer Sync with HEAD.
 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.5.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.5.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.6.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.16.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.3 03-Sep-2007  yamt sync with head.
 1.8.16.2 30-Dec-2006  yamt sync with head.
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.9.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.9.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.9.8.3 14-Sep-2006  yamt sync with head.
 1.9.8.2 26-Jun-2006  yamt sync with head.
 1.9.8.1 11-Apr-2006  yamt sync with head
 1.9.6.2 03-Jun-2006  kardel Sync with head.
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.2.1 19-Jun-2006  chap Sync with head.
 1.12.16.1 07-Apr-2008  skrll Pullup changes to get vax shlibs working.
 1.12.14.1 11-Jul-2007  mjf Sync with head.
 1.12.12.1 10-Apr-2007  ad Sync with head.
 1.12.8.2 15-Apr-2007  yamt sync with head.
 1.12.8.1 24-Mar-2007  yamt sync with head.
 1.12.6.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.14.96.1 23-Jul-2013  riastradh sync with HEAD
 1.14.88.1 28-Aug-2013  rmind sync with head
 1.14.82.2 03-Dec-2017  jdolecek update from HEAD
 1.14.82.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.72.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.16.6.1 19-Mar-2016  skrll Sync with HEAD
 1.17.16.1 30-Mar-2018  pgoyette Resolve conflicts between branch and HEAD
 1.17.10.1 24-Mar-2018  snj Pull up following revision(s) (requested by ragge in ticket #657):
sys/arch/vax/boot/Makefile.inc: 1.18
Let boot relocate to just below 8MB. This solves the problem with
booting a kernel larger than below 4MB.
 1.18.32.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #64):

sys/arch/vax/boot/Makefile.inc: revision 1.19

Make a vax bootloader work on 8MB VAXen.

64KB (0x800000 - 0x7f0000) is not enough for the bootloader itself
and more spaces are required for heap on loading a kernel.

https://mail-index.netbsd.org/port-vax/2023/01/24/msg004149.html

"Go ahead" from ragge@. Should be pulled up to netbsd-10 and netbsd-9.
 1.18.6.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1582):

sys/arch/vax/boot/Makefile.inc: revision 1.19

Make a vax bootloader work on 8MB VAXen.

64KB (0x800000 - 0x7f0000) is not enough for the bootloader itself
and more spaces are required for heap on loading a kernel.

https://mail-index.netbsd.org/port-vax/2023/01/24/msg004149.html

"Go ahead" from ragge@. Should be pulled up to netbsd-10 and netbsd-9.
 1.14 20-Jun-1999  ragge Remove old unused files.
 1.13 09-Mar-1999  ragge branches: 1.13.4;
Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.12 08-Aug-1998  ragge Netboot support for KA46 (VS4000/60).
 1.11 01-Jul-1998  ragge Added boot program support for the SGEC Ethernet controller, present on
some VAX 4000 maachines. Written by Jay Maynard. (jmaynard@phoenix.net)
 1.10 18-Oct-1997  ragge Make UBA adapter selection work on 8600 again.
 1.9 10-Apr-1997  ragge Add better boot support for VS3100/??.
 1.8 22-Mar-1997  ragge Bugfixes to lance routines. Get memory size from rpb to pass to kernel.
Support some more CPU types in boot.
 1.7 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.6 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.5 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.4 02-Mar-1996  ragge Add VAX780 support to the boot program.
 1.3 16-Sep-1995  ragge ka650 added. Converted to KNF.
 1.2 29-Mar-1995  ragge uVAX II support.
 1.1 13-Feb-1995  ragge Boot program added.
 1.13.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.10 20-Jun-1999  ragge Remove old unused files.
 1.9 22-Aug-1998  ragge branches: 1.9.8;
New times, new pagesize, use magic number in exec header.
 1.8 01-Jul-1998  ragge Added boot program support for the SGEC Ethernet controller, present on
some VAX 4000 maachines. Written by Jay Maynard. (jmaynard@phoenix.net)
 1.7 08-Jun-1997  ragge Use correct console on KA65? machines. Bugfix when specifying adaptor
number. Show compile-time for boot. Prettier printout.
 1.6 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.5 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.4 16-Sep-1995  ragge Load microcode file on 11/750.
 1.3 16-Jun-1995  ragge Pass symtab address to kernel.
 1.2 29-Mar-1995  ragge Added support for uVAX boot.
 1.1 13-Feb-1995  ragge Boot program added.
 1.9.8.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3 16-Sep-1995  ragge Obsolete when not using Microvax rom anymore.
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 29-Mar-1995  ragge Added support for uVAX boot.
 1.15 13-Mar-1999  ragge Outdated files.
 1.14 21-Oct-1998  ragge Make boot recognize MSCP disks on VAX8200. From Sergey Svishchev.
 1.13 20-Mar-1998  ragge Use rom routines on MicroVAX II, so that the QDSS/QVSS display will
be used if present. Fix provided by Boris Gjenero.
 1.12 28-Feb-1998  ragge Move the boot program higher up in memory; to allow loading of bigger kernels.
 1.11 08-Jun-1997  ragge Use correct console on KA65? machines. Bugfix when specifying adaptor
number. Show compile-time for boot. Prettier printout.
 1.10 10-Apr-1997  ragge Add better boot support for VS3100/??.
 1.9 22-Mar-1997  ragge Bugfixes to lance routines. Get memory size from rpb to pass to kernel.
Support some more CPU types in boot.
 1.8 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.7 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.6 15-Jul-1996  ragge Put in boot support for VAX 8200.
 1.5 17-Feb-1996  ragge Add standalone driver for TU58 (DECtape II). Now initial installation
from TU58 on 11/750 is possible.
Change types on pte pointers, due to the change of pte's from
int to struct pte.
 1.4 20-Oct-1995  ragge branches: 1.4.2;
SA_LIB -> SALIB
Include rpb.h. Typeclash fixes.
Removed #include of non-existing file.
 1.3 16-Sep-1995  ragge Bootblock support for tmscp added, used on MicroVAX.
MicroVAX rom routines not used anymore, too inconsistent when
not using FILES-11 filesystem.
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 29-Mar-1995  ragge Added support for uVAX boot.
 1.4.2.2 20-Oct-1995  ragge SA_LIB -> SALIB
Include rpb.h. Typeclash fixes.
Removed #include of non-existing file.
 1.4.2.1 20-Oct-1995  ragge file bootxx.c was added on branch netbsd-1-1 on 1995-10-20 13:35:44 +0000
 1.11 20-Jun-1999  ragge Remove old unused files.
 1.10 01-Jul-1998  ragge branches: 1.10.8; 1.10.10;
Added boot program support for the SGEC Ethernet controller, present on
some VAX 4000 maachines. Written by Jay Maynard. (jmaynard@phoenix.net)
 1.9 11-Mar-1998  ragge Standalone routine for DEQNA, written by Roar Thronaes.
 1.8 10-Apr-1997  ragge Add better boot support for VS3100/??.
 1.7 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.6 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.5 17-Feb-1996  ragge Add standalone driver for TU58 (DECtape II). Now initial installation
from TU58 on 11/750 is possible.
Change types on pte pointers, due to the change of pte's from
int to struct pte.
 1.4 16-Sep-1995  ragge TMSCP support added.
 1.3 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.2 29-Mar-1995  ragge Added support for uVAX boot.
 1.1 13-Feb-1995  ragge Boot program added.
 1.10.10.1 01-Jul-1999  thorpej Sync w/ -current.
 1.10.8.1 01-Mar-2000  he Apply patch (requested by toddpw):
Finish porting sysinst to vax, and build various bootable installers
in new directory distrib/vax/bootfs.
 1.13 20-Jun-1999  ragge Remove more unused files.
 1.12 09-Mar-1999  ragge branches: 1.12.4;
Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.11 08-Aug-1998  ragge Netboot support for KA46 (VS4000/60).
 1.10 01-Jul-1998  ragge Added boot program support for the SGEC Ethernet controller, present on
some VAX 4000 maachines. Written by Jay Maynard. (jmaynard@phoenix.net)
 1.9 20-Mar-1998  ragge Use rom routines on MicroVAX II, so that the QDSS/QVSS display will
be used if present. Fix provided by Boris Gjenero.
 1.8 08-Jun-1997  ragge Use correct console on KA65? machines. Bugfix when specifying adaptor
number. Show compile-time for boot. Prettier printout.
 1.7 10-Apr-1997  ragge Add better boot support for VS3100/??.
 1.6 22-Mar-1997  ragge Bugfixes to lance routines. Get memory size from rpb to pass to kernel.
Support some more CPU types in boot.
 1.5 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.4 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.3 16-Sep-1995  ragge Take care of xon/xoff (== discard them).
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 13-Feb-1995  ragge Boot program added.
 1.12.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.6 16-Jun-2000  matt these are obsolete now that vax uses sysinst.
 1.5 10-Nov-1997  ragge branches: 1.5.14; 1.5.22;
Fix multivolume installation bug; PR#4454.
 1.4 12-Feb-1997  ragge branches: 1.4.8;
s/tms/mt/
 1.3 02-Aug-1996  ragge branches: 1.3.6;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.2 29-Sep-1995  ragge Arg to printf forgot.
 1.1 16-Sep-1995  ragge Rick Macklem's copy hack that can do standalone (multi-)volume
copies from anything to anything.
 1.3.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.4.8.1 12-Nov-1997  mellon Pull rev 1.5 up from trunk (ragge)
 1.5.22.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.2 20-Jun-1999  ragge Remove old unused files.
 1.1 17-Feb-1996  ragge branches: 1.1.26;
Add standalone driver for TU58 (DECtape II). Now initial installation
from TU58 on 11/750 is possible.
Change types on pte pointers, due to the change of pte's from
int to struct pte.
 1.1.26.1 01-Jul-1999  thorpej Sync w/ -current.
 1.5 20-Jun-1999  ragge Remove old unused files.
 1.4 16-Sep-1995  ragge branches: 1.4.28;
struct rpb -> include/rpb.h
 1.3 16-Jun-1995  ragge Passing symtab address to kernel.
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 29-Mar-1995  ragge Added support for uVAX boot.
 1.4.28.1 01-Jul-1999  thorpej Sync w/ -current.
 1.9 20-Jun-1999  ragge Remove old unused files.
 1.8 08-Jun-1997  ragge branches: 1.8.18;
Use correct console on KA65? machines. Bugfix when specifying adaptor
number. Show compile-time for boot. Prettier printout.
 1.7 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.6 02-Aug-1996  ragge Do not use any emulated insn's in boot program. (in this case cmpc3).
Add strncmp to get around this.
 1.5 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.4 16-Mar-1996  ragge Accept adapter numbering in boot.
 1.3 16-Sep-1995  ragge TMSCP support added.
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 13-Feb-1995  ragge Boot program added.
 1.8.18.1 01-Jul-1999  thorpej Sync w/ -current.
 1.4 16-Jun-2000  matt these are obsolete now that vax uses sysinst.
 1.3 01-Jul-1998  ragge branches: 1.3.14; 1.3.22;
Added boot program support for the SGEC Ethernet controller, present on
some VAX 4000 maachines. Written by Jay Maynard. (jmaynard@phoenix.net)
 1.2 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.1 16-Sep-1995  ragge Foolish and easy standalone prog to edit disklabels.
 1.3.22.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.7 13-Mar-1999  ragge Outdated files.
 1.6 09-Oct-1998  matt Commit out include of "../include/macros.h" since its bcopy conflict with
the one in "lib/libsa/stand.h".
 1.5 17-Feb-1996  ragge Add standalone driver for TU58 (DECtape II). Now initial installation
from TU58 on 11/750 is possible.
Change types on pte pointers, due to the change of pte's from
int to struct pte.
 1.4 16-Sep-1995  ragge Removed bug to prevent division-by-zero when accessing unlabelled disks.
 1.3 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.2 29-Mar-1995  ragge Added support for uVAX boot.
 1.1 13-Feb-1995  ragge Boot program added.
 1.8 20-Jun-1999  ragge Remove old unused files.
 1.7 25-Mar-1999  thorpej branches: 1.7.4;
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.6 09-Oct-1998  matt Workaround problem with le driver forgetting its address
 1.5 08-Aug-1998  ragge Netboot support for KA46 (VS4000/60).
 1.4 26-Jul-1998  ragge Fix netboot support for 3100/m76 which uses diagmem for its lance buffers.
 1.3 21-Jul-1998  drochner adapt to LANCE driver split
 1.2 22-Mar-1997  ragge Bugfixes to lance routines. Get memory size from rpb to pass to kernel.
Support some more CPU types in boot.
 1.1 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.7.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3 20-Jun-1999  ragge Remove old unused files.
 1.2 31-Aug-1998  ragge branches: 1.2.8;
Bug fixes and improvements. By Roar Thron�s and myself.
 1.1 11-Mar-1998  ragge Standalone routine for DEQNA, written by Roar Thronaes.
 1.2.8.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3 20-Jun-1999  ragge Remove old unused files.
 1.2 25-Mar-1999  thorpej branches: 1.2.4;
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.1 01-Jul-1998  ragge Added boot program support for the SGEC Ethernet controller, present on
some VAX 4000 maachines. Written by Jay Maynard. (jmaynard@phoenix.net)
 1.2.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.4 15-Jul-1996  ragge Obsoleted by now.
 1.3 16-Sep-1995  ragge ka650 added. Converted to KNF.
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 29-Mar-1995  ragge Added support for uVAX boot.
 1.2 20-Jun-1999  ragge Remove old unused files.
 1.1 02-Aug-1996  ragge branches: 1.1.24;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.1.24.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3 20-Jun-1999  ragge Remove more unused files.
 1.2 15-Mar-1997  ragge branches: 1.2.18;
Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.1 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.2.18.1 01-Jul-1999  thorpej Sync w/ -current.
 1.5 20-Jun-1999  ragge Remove more unused files.
 1.4 07-May-1999  drochner include <lib/libkern/libkern.h> for intoa()/inet_ntoa()
 1.3 09-Oct-1998  matt branches: 1.3.8;
Remove define for SUPPORT_BOOTPARAMS and put in the Makefile instead.
Fix DHCP code so it works.
 1.2 05-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 15-Mar-1997  ragge branches: 1.1.4;
Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.8.2 01-Jul-1999  thorpej Sync w/ -current.
 1.3.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.7 20-Jun-1999  ragge Remove more unused files.
 1.6 09-Oct-1998  matt branches: 1.6.8;
Commit out include of "../include/macros.h" since its bcopy conflict with
the one in "lib/libsa/stand.h".
 1.5 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.4 17-Feb-1996  ragge Add standalone driver for TU58 (DECtape II). Now initial installation
from TU58 on 11/750 is possible.
Change types on pte pointers, due to the change of pte's from
int to struct pte.
 1.3 16-Sep-1995  ragge ka650 added. Converted to KNF.
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 29-Mar-1995  ragge Added support for uVAX boot.
 1.6.8.1 01-Jul-1999  thorpej Sync w/ -current.
 1.2 16-Jun-2000  matt now lives one level down in boot.
 1.1 02-Aug-1996  ragge branches: 1.1.28; 1.1.36;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.1.36.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.28.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.5 16-Jun-2000  matt This file now lives one level down in common.
 1.4 02-Aug-1996  ragge branches: 1.4.28; 1.4.36;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.3 16-Sep-1995  ragge Calls to MicroVAX rom routines removed.
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 29-Mar-1995  ragge Added support for uVAX boot.
 1.4.36.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.28.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.2 20-Jun-1999  ragge Remove old unused files.
 1.1 02-Aug-1996  ragge branches: 1.1.24;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.1.24.1 01-Jul-1999  thorpej Sync w/ -current.
 1.2 31-Mar-2002  matt These haven't been use for a long time. Move 'em to the attic.
 1.1 02-Aug-1996  ragge branches: 1.1.42; 1.1.46;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.1.46.1 17-Apr-2002  nathanw Catch up to -current.
 1.1.42.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2 31-Mar-2002  matt These haven't been use for a long time. Move 'em to the attic.
 1.1 02-Aug-1996  ragge branches: 1.1.42; 1.1.46;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.1.46.1 17-Apr-2002  nathanw Catch up to -current.
 1.1.42.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2 31-Mar-2002  matt These haven't been use for a long time. Move 'em to the attic.
 1.1 02-Aug-1996  ragge branches: 1.1.42; 1.1.46;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.1.46.1 17-Apr-2002  nathanw Catch up to -current.
 1.1.42.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2 31-Mar-2002  matt These haven't been use for a long time. Move 'em to the attic.
 1.1 02-Aug-1996  ragge branches: 1.1.42; 1.1.46;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.1.46.1 17-Apr-2002  nathanw Catch up to -current.
 1.1.42.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10 20-Jun-1999  ragge Remove old unused files.
 1.9 22-Mar-1997  ragge branches: 1.9.18;
Bugfixes to lance routines. Get memory size from rpb to pass to kernel.
Support some more CPU types in boot.
 1.8 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.7 27-Feb-1997  ragge Be able to find out if we are booted from network.
 1.6 02-Aug-1996  ragge branches: 1.6.6;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.5 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.4 16-Sep-1995  ragge Calls to MicroVAX rom routines removed.
 1.3 16-Jun-1995  ragge Passing symtab address to kernel.
 1.2 29-Mar-1995  ragge Added support for uVAX boot.
 1.1 13-Feb-1995  ragge Boot program added.
 1.6.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.9.18.1 01-Jul-1999  thorpej Sync w/ -current.
 1.11 20-Jun-1999  ragge Remove old unused files.
 1.10 22-Mar-1997  ragge branches: 1.10.18;
Bugfixes to lance routines. Get memory size from rpb to pass to kernel.
Support some more CPU types in boot.
 1.9 27-Feb-1997  ragge Be able to find out if we are booted from network.
 1.8 02-Aug-1996  ragge branches: 1.8.6;
Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.7 02-Feb-1996  mycroft ASSEMBLER -> _LOCORE
 1.6 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.5 20-Oct-1995  ragge branches: 1.5.2;
SA_LIB -> SALIB
Include rpb.h. Typeclash fixes.
Removed #include of non-existing file.
 1.4 16-Sep-1995  ragge Calls to MicroVAX rom routines removed.
 1.3 16-Jun-1995  ragge Passing symtab address to kernel.
 1.2 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.1 29-Mar-1995  ragge Added support for uVAX boot.
 1.5.2.2 20-Oct-1995  ragge SA_LIB -> SALIB
Include rpb.h. Typeclash fixes.
Removed #include of non-existing file.
 1.5.2.1 20-Oct-1995  ragge file start.s was added on branch netbsd-1-1 on 1995-10-20 13:35:42 +0000
 1.8.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.10.18.1 01-Jul-1999  thorpej Sync w/ -current.
 1.5 20-Jun-1999  ragge Remove more unused files.
 1.4 09-Oct-1998  matt branches: 1.4.8;
Add strncpy (needed for bootp/dhcp). Tighten up some of the assembly.
 1.3 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.2 02-Aug-1996  ragge Do not use any emulated insn's in boot program. (in this case cmpc3).
Add strncmp to get around this.
 1.1 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.4.8.1 01-Jul-1999  thorpej Sync w/ -current.
 1.6 20-Jun-1999  ragge Remove more unused files.
 1.5 09-Oct-1998  matt branches: 1.5.8;
Commit out include of "../include/macros.h" since its bcopy conflict with
the one in "lib/libsa/stand.h".
 1.4 15-Mar-1997  ragge Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.3 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.2 17-Feb-1996  ragge Add standalone driver for TU58 (DECtape II). Now initial installation
from TU58 on 11/750 is possible.
Change types on pte pointers, due to the change of pte's from
int to struct pte.
 1.1 16-Sep-1995  ragge Standalone support for TMSCP tapes, based on ra disk driver.
 1.5.8.1 01-Jul-1999  thorpej Sync w/ -current.
 1.7 20-Jun-1999  ragge Remove more unused files.
 1.6 15-Mar-1997  ragge branches: 1.6.18;
Add routines for network handling and standalone le driver.
To make this work nice, big changes to the boot unit handling
was also required. From now only DEC HW unit numbering are used
in boot, to easy match boot device in kernel.
 1.5 02-Aug-1996  ragge Add support for booting Vaxstations; from MFM and SCSI. (PROM-based boot).
 1.4 17-Feb-1996  ragge Add standalone driver for TU58 (DECtape II). Now initial installation
from TU58 on 11/750 is possible.
Change types on pte pointers, due to the change of pte's from
int to struct pte.
 1.3 25-Apr-1995  ragge Cleanup and fixes for uVAX boot.
 1.2 29-Mar-1995  ragge Added support for uVAX boot.
 1.1 13-Feb-1995  ragge Boot program added.
 1.6.18.1 01-Jul-1999  thorpej Sync w/ -current.
 1.48 23-Oct-2024  kalvisd vax: use vax-mopcopy to generate usr/mdec/boot.mop from usr/mdec/boot;
include boot.mop in the base set once again.

OK rin@
 1.47 30-Sep-2024  kalvisd vax/boot: XXX: Silence GCC12 -Warray-bounds for autoconf.c at the moment

OK rin@ (from rin@)
 1.46 19-Mar-2018  ragge branches: 1.46.38;
gcc 5.5 has no problem with -O2 on boot.
 1.45 08-Apr-2017  christos branches: 1.45.12;
centralize vers.c building for standalone programs.
 1.44 17-Jan-2016  tsutsui branches: 1.44.2; 1.44.4;
Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
Tested on simh 4.0-Beta1 emulationg MicroVAX 3900.
 1.43 17-Jan-2016  tsutsui Make this build without installed DESTDIR files.
 1.42 24-May-2014  martin branches: 1.42.4;
Force -O1 when compiling this, it doesn't work with -O2 (need to investigate
later)
 1.41 21-Aug-2013  matt branches: 1.41.2;
Use <bsd.klinks.mk>
 1.40 14-May-2012  abs branches: 1.40.2; 1.40.4;
Revert hax to fix boot blocks for gcc 4.5, accudently committed in last
 1.39 14-May-2012  abs From the "why was this not done before" box:
Implement WSDISPLAYIO_LINEBYTES so xwsfb works
 1.38 22-Jan-2011  joerg branches: 1.38.4;
Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
 1.37 08-Mar-2006  sekiya branches: 1.37.90; 1.37.96; 1.37.98;
The network bootloader entry point should be nisse(), not start(). Fixes a
very long-standing netboot issue.

Patch contributed by Hans Rosenfeld.
 1.36 11-Dec-2005  christos branches: 1.36.4; 1.36.6; 1.36.8; 1.36.10;
merge ktrace-lwp.
 1.35 21-Apr-2004  matt branches: 1.35.12;
Add ${_MKTARGET_LINK} to the link step
 1.34 11-Dec-2003  matt Rework things to move common stuff into Makefile.inc.
 1.33 08-Dec-2003  matt Move common CFLAGS/AFLAGS to Makefile.inc.
For now, only suppy -mno-asm-pic when not using gcc3.
 1.32 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.31 19-Jan-2003  ragge branches: 1.31.2;
Bring back "START=start", otherwise booting via real VMB don't work.
 1.30 05-Nov-2002  thorpej Add -mno-asm-pic to CFLAGS and AFLAGS.
 1.29 05-Nov-2002  thorpej Set the entry point to 0 for the ELF case, too.
 1.28 09-Jun-2002  matt Add -ffreestanding and LIBC= to stand/boot/*/Makefile. Fix various
asm's to work with gcc-current.
 1.27 07-Apr-2002  matt branches: 1.27.2; 1.27.4;
Use ${PROG}.sym in CLEANFILES
 1.26 31-Mar-2002  matt Don't build boot.mop. Remove a redundant ${INSTALL_FILE}
 1.25 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.24 24-Feb-2002  matt Change the default entry for ELF.
 1.23 09-Feb-2002  lukem use ${INSTALL_FILE} as appropriate
 1.22 23-Dec-2001  matt Don't install boot.mop if ELF.
 1.21 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.20 02-May-2001  matt branches: 1.20.2; 1.20.8;
Keep around a version of boot with symbols.
 1.19 09-Nov-2000  matt branches: 1.19.2;
NOMAN needs to be *before* we include bsd.own.mk
 1.18 02-Nov-2000  matt Change the way we make machine-links so that only occurs when we are building
on VAX.
 1.17 01-Nov-2000  ragge Define NO_MID_CHECK, to allow booting of old VAX kernels with other (or
none) mid.
 1.16 23-Sep-2000  simonb Use ${COPY} instead of -c for ${INSTALL} commands.
 1.15 30-Aug-2000  jdolecek Switch to newvers_stand.sh-based boot block versioning. Add sensible 'version'
template, the boot block changes were picked from cvs annotates for Makefile
and boot.c.

Reviewed by Ragge.
 1.14 25-Aug-2000  matt Need <bsd.own.mk> for OBJECT_FMT.
 1.13 19-Jul-2000  matt Switch to loadfile instead of exec. Now we can load a.out or ELF kernels.
 1.12 19-Jul-2000  matt Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.11 03-Jul-2000  matt Make cross-compile friendly
 1.10 15-Jun-2000  ragge branches: 1.10.2;
Standalone device driver for DEBNx (ni) ethernet controllers.
 1.9 11-Jun-2000  matt Add local symlink so that machine & vax refer ../../include instead of the
system ones.
 1.8 22-May-2000  matt branches: 1.8.2;
The double / in the path has been bothering me for awhile.
 1.7 21-May-2000  ragge Standalone driver for the Digital Equipment Unibus Network Adapter (DEUNA).
This allows 11/750 owners to install from a single TU58 cassette.
(Are there still any 11/750 owners left out there? :-)
 1.6 20-May-2000  ragge WARNS=1. Unify the ra and tmscp driver.
 1.5 04-Mar-2000  ragge Install the boot programs in /usr/mdec also. From Todd Whitesel.
 1.4 23-May-1999  ragge branches: 1.4.2;
Use common routines to identify cpu type.
Set up a SCB to be able to handle clock interrupts in the boot program.
Now timer countdown should work on all types of vaxen.
 1.3 01-Apr-1999  ragge branches: 1.3.2; 1.3.4;
A bunch of small fixes to make boot work on most VAXen.
 1.2 27-Mar-1999  ragge #define was wrong. Some .c should be .s.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 1.3.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.1 01-Mar-2000  he Apply patch (requested by toddpw):
Finish porting sysinst to vax, and build various bootable installers
in new directory distrib/vax/bootfs.
 1.4.2.2 22-Nov-2000  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.8.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.2.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.19.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.20.8.6 11-Nov-2002  nathanw Catch up to -current
 1.20.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.20.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.20.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.20.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.20.8.1 02-May-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:29 +0000
 1.20.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.20.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.27.4.3 23-Mar-2003  jmc Pullup rev 1.31 (requested by jklos in ticket #1227)
Bring back START=start, otherwise booting via real VMB don't work.
 1.27.4.2 26-Jan-2003  jmc Pullup revisions 1.27-1.28 and 1.29-1.30 (requested by he in ticket #1072)
Add -mno-asm-pic to CFLAGS and AFLAGS, and add -ffreestanding and
empty LIBC setting to bootloader Makefiles.
 1.27.4.1 11-Dec-2002  he Pull up revision 1.29 (requested by thorpej in ticket #963):
Set the entry point to 0 for the ELF case as well.
 1.27.2.1 15-Jul-2002  gehenna catch up with -current.
 1.31.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.31.2.1 03-Aug-2004  skrll Sync with HEAD
 1.35.12.1 21-Jun-2006  yamt sync with head.
 1.36.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.36.8.1 13-Mar-2006  yamt sync with head.
 1.36.6.1 22-Apr-2006  simonb Sync with head.
 1.36.4.1 09-Sep-2006  rpaulo sync with head
 1.37.98.1 08-Feb-2011  bouyer Sync with HEAD
 1.37.96.1 06-Jun-2011  jruoho Sync with HEAD.
 1.37.90.1 05-Mar-2011  rmind sync with head
 1.38.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.40.4.1 28-Aug-2013  rmind sync with head
 1.40.2.2 03-Dec-2017  jdolecek update from HEAD
 1.40.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.41.2.1 10-Aug-2014  tls Rebase.
 1.42.4.2 28-Aug-2017  skrll Sync with HEAD
 1.42.4.1 19-Mar-2016  skrll Sync with HEAD
 1.44.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.44.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.45.12.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.46.38.1 02-Aug-2025  perseant Sync with HEAD
 1.29 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.28 18-Mar-2009  cegger branches: 1.28.22; 1.28.40;
Ansify function definitions w/o arguments. Generated with sed.
 1.27 12-Jan-2009  tsutsui branches: 1.27.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.26 31-Mar-2008  he branches: 1.26.4; 1.26.12;
Convert from use of bcopy() to memcpy() so that this builds again.
 1.25 04-Mar-2007  christos branches: 1.25.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.24 08-Jun-2006  he branches: 1.24.12;
Get rid of lvalue casts by either using an extra temporary variable
or by using the appropriate casts in the first place.
 1.23 24-Dec-2005  perry branches: 1.23.4; 1.23.8; 1.23.14;
bare asm -> __asm
 1.22 11-Dec-2005  christos merge ktrace-lwp.
 1.21 08-Dec-2003  matt branches: 1.21.16;
Suppress a gcc3 type-punning warning.
 1.20 09-Jun-2002  matt branches: 1.20.6;
Add -ffreestanding and LIBC= to stand/boot/*/Makefile. Fix various
asm's to work with gcc-current.
 1.19 01-Jun-2002  ragge Add 11/780 and 8600 to list for who to create a RPB.
 1.18 31-May-2002  ragge Handle machine checks separate from other "stray" interrupts.
 1.17 24-May-2002  ragge Boot support for the VXT2000 X terminal, based on some info on the VAXLinux
mailing list.
 1.16 24-Feb-2002  matt branches: 1.16.8; 1.16.10;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.15 19-Jul-2000  matt branches: 1.15.4; 1.15.8;
Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.14 10-Jul-2000  ragge Forgot a debug printf.
 1.13 10-Jul-2000  ragge Add support for VAX 6000 + VAX 8000. Tweak console routines.
Create a fake RPB if either netbooted (on machine without RPB) or
loaded from console storage (without VMB intervention).
 1.12 04-Jun-2000  matt 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.11 20-May-2000  ragge branches: 1.11.2;
Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.
 1.10 08-May-2000  ragge Console support for VXT 2000, VAX 4000/105 and VAX 4000/500.
From Michael Kukat.
 1.9 24-Apr-2000  ragge Add 4000/90 to the countdown hack.
 1.8 24-Apr-2000  mhitch Fix bootblock countdown for 4000/VLC.
 1.7 22-Apr-2000  ragge Fix boot block countdown on 4000/60. Easy to add for other 4000 machines also.
 1.6 24-Jan-2000  matt More files that were changed.
 1.5 23-Aug-1999  ragge branches: 1.5.2;
Add support for 4000/90. Also handle interrupts more intelligent.
XXX - countdown doesn't work on 4000/90.
 1.4 20-Jun-1999  ragge Some 4000/200 fixes. From Michael Kukat.
 1.3 23-May-1999  ragge Use common routines to identify cpu type.
Set up a SCB to be able to handle clock interrupts in the boot program.
Now timer countdown should work on all types of vaxen.
 1.2 14-Apr-1999  ragge Machines using KA48 must have memory mapped in, and use the same
addresses for console as KA46. From Michael Kukat.
 1.1 06-Mar-1999  ragge branches: 1.1.2;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.2.1 15-Apr-1999  ragge branches: 1.1.2.1.2;
Pull up autoconf.c 1.2 and consio.c 1.3.
 1.1.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.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.11.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.15.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.15.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.15.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.16.10.1 02-Jun-2002  tv Pull up revision 1.19 (requested by ragge in ticket #125):
Add 11/780 and 8600 to list for who to create a RPB.
 1.16.8.2 15-Jul-2002  gehenna catch up with -current.
 1.16.8.1 30-May-2002  gehenna Catch up with -current.
 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.21.16.2 03-Sep-2007  yamt sync with head.
 1.21.16.1 21-Jun-2006  yamt sync with head.
 1.23.14.1 19-Jun-2006  chap Sync with head.
 1.23.8.1 26-Jun-2006  yamt sync with head.
 1.23.4.1 09-Sep-2006  rpaulo sync with head
 1.24.12.1 12-Mar-2007  rmind Sync with HEAD.
 1.25.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.25.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.26.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.26.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.26.4.1 04-May-2009  yamt sync with head.
 1.27.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.28.40.1 28-Aug-2017  skrll Sync with HEAD
 1.28.22.1 03-Dec-2017  jdolecek update from HEAD
 1.36 23-Oct-2024  rin vax: boot: Fix my typo in comment. No binary changes.
 1.35 30-Sep-2024  kalvisd vax/boot: loadpcs: Silence GCC12 -Warray-bounds for 0-th page accesss

as done for evbppc:
http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/sys/arch/evbppc/wii/mainbus.c#rev1.4

(from rin@)
OK rin@
 1.34 11-Jun-2016  dholland branches: 1.34.54;
PR 51200 gets in libsa considered harmful: use kgets
 1.33 05-Jun-2015  martin Close the file descriptor used for loading before jumping to the kernel.
Pointed out by Felix Deichmann on port-vax.
 1.32 09-Nov-2013  christos branches: 1.32.4; 1.32.6;
remove unused
 1.31 22-Jan-2011  joerg branches: 1.31.4; 1.31.14; 1.31.18;
Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
 1.30 26-Oct-2009  cegger branches: 1.30.4; 1.30.6; 1.30.8;
kill extra whitespaces
reviewed by tsutsui@
 1.29 18-Mar-2009  cegger bcopy -> memcpy
 1.28 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.27 12-Jan-2009  tsutsui branches: 1.27.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.26 24-Dec-2005  perry branches: 1.26.74; 1.26.78; 1.26.86;
bare asm -> __asm
 1.25 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.24 11-Dec-2005  christos merge ktrace-lwp.
 1.23 27-Jun-2005  junyoung branches: 1.23.2;
Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.22 27-Jun-2005  junyoung Remove trailing spaces.
 1.21 01-Nov-2003  jdolecek rename local index() to strchr()
 1.20 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.19 09-Jun-2002  matt branches: 1.19.6;
Add -ffreestanding and LIBC= to stand/boot/*/Makefile. Fix various
asm's to work with gcc-current.
 1.18 31-May-2002  ragge Handle machine checks separate from other "stray" interrupts.
 1.17 02-May-2001  matt branches: 1.17.2; 1.17.8; 1.17.16;
Pass the numbers of syms down as well.
 1.16 02-May-2001  matt Use loadfile with boot commands, not exec.
 1.15 01-Nov-2000  ragge branches: 1.15.2;
Declare revision correctly.
 1.14 24-Sep-2000  jdolecek add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.13 30-Aug-2000  jdolecek Switch to newvers_stand.sh-based boot block versioning. Add sensible 'version'
template, the boot block changes were picked from cvs annotates for Makefile
and boot.c.

Reviewed by Ragge.
 1.12 19-Jul-2000  matt Switch to loadfile instead of exec. Now we can load a.out or ELF kernels.
 1.11 13-Jul-2000  matt Include libkern.h
 1.10 10-Jul-2000  ragge Add support for VAX 6000 + VAX 8000. Tweak console routines.
Create a fake RPB if either netbooted (on machine without RPB) or
loaded from console storage (without VMB intervention).
 1.9 26-May-2000  ragge branches: 1.9.4;
Avoid hanging if boot fails on some machines.
 1.8 25-May-2000  matt Modify the file list for kernel to supress errors/text for certain ones.
 1.7 23-May-2000  matt Allow for boot.vax and netbsd.vax when booting. this allows a multi
architecture CD to be made which includes VAX support.
 1.6 20-May-2000  ragge Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.
 1.5 22-Apr-2000  ragge Fix boot block countdown on 4000/60. Easy to add for other 4000 machines also.
 1.4 23-Oct-1999  ragge Use romread() routines if we are booted from SCSI disks.
 1.3 30-Jun-1999  ragge branches: 1.3.2; 1.3.4; 1.3.6;
Clean up the boot command selection a bit. Add a command "halt".
 1.2 01-Apr-1999  ragge branches: 1.2.2; 1.2.4;
A bunch of small fixes to make boot work on most VAXen.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 1.2.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.2.2.1 01-Mar-2000  he Apply patch (requested by toddpw):
Finish porting sysinst to vax, and build various bootable installers
in new directory distrib/vax/bootfs.
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.4.1 15-Nov-1999  fvdl Sync with -current
 1.3.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.3.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.9.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.15.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.17.16.1 15-Jul-2002  gehenna catch up with -current.
 1.17.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.17.8.1 02-May-2001  nathanw file boot.c was added on branch nathanw_sa on 2002-06-20 03:42:06 +0000
 1.17.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.19.6.1 03-Aug-2004  skrll Sync with HEAD
 1.23.2.1 21-Jun-2006  yamt sync with head.
 1.26.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.26.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.26.78.2 11-Mar-2010  yamt sync with head
 1.26.78.1 04-May-2009  yamt sync with head.
 1.26.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.27.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.30.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.30.4.1 05-Mar-2011  rmind sync with head
 1.31.18.1 18-May-2014  rmind sync with head
 1.31.14.2 03-Dec-2017  jdolecek update from HEAD
 1.31.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.31.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.32.6.2 09-Jul-2016  skrll Sync with HEAD
 1.32.6.1 06-Jun-2015  skrll Sync with HEAD
 1.32.4.1 05-Jul-2015  snj Pull up following revision(s) (requested by martin in ticket #852):
sys/arch/vax/boot/boot/boot.c: revision 1.33
Close the file descriptor used for loading before jumping to the kernel.
Pointed out by Felix Deichmann on port-vax.
 1.34.54.1 02-Aug-2025  perseant Sync with HEAD
 1.19 14-Jul-2025  hans vax/boot: fix detection of CMD CQD-22x MSCP controllers

Certain models of CMD MSCP controllers fail to be detected by uda(4) if
they have been booted from. This failure mode has been introduced in
revision 1.11 of uba_mainbus.c, when scanning for Qbus/Unibus memories
was added. They are deteced fine when NetBSD is booted from any other
device such as over the network.

When NetBSD is booted from a MSCP controller, the boot loader sets up
the Qbus map to provide the controller with a small command/response
ring in memory to be used for I/O. Once the kernel is loaded and uba(4)
is attaching, the Qbus map is cleared while scanning for memories. It
appears that sudden loss of access to the command/response ring causes
the firmware of these CMD controllers to drop dead.

As a result, these controllers don't react in a reasonable time (100ms
by the spec) when their IP register is written to re-initialze the
controller. Even though uda(4)'s udamatch() waits up to 10s for a sign
of life from the controller, that's usually not enough for it to wake
up and it is assumed to be absent. Which, of course, causes the kernel
to fail booting as the boot device can't be found.

This needs to be addressed both in the kernel and the bootloader.

To fix this properly, the standalone ra.c driver in the boot loader
should provide a close() entry point which clears the IP register to
issue a controller reset. Thus when the kernel is loaded, the firmware
of the MSCP controller is again in reset state and can't get confused
anymore by the initialization of the Qbus map in uba(4).
 1.18 01-May-2018  ragge branches: 1.18.38;
Enable ffsv2 in boot.
 1.17 22-May-2017  ragge branches: 1.17.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.16 28-Jun-2013  matt branches: 1.16.10;
ufs -> ffsv1 (ffsv2 is commentout due to size limitations)
 1.15 18-Mar-2009  cegger branches: 1.15.12; 1.15.22;
bzero -> memset
 1.14 11-Dec-2005  christos branches: 1.14.78; 1.14.86; 1.14.92;
merge ktrace-lwp.
 1.13 27-Jun-2005  junyoung Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.12 23-Jun-2005  junyoung Use FS_OPS() macro.
 1.11 06-Jan-2004  matt Add proper boot/autoconf support for SDN devices. Take from Hugh Graham;
see http://mail-index.netbsd.org/port-vax/2002/06/28/0005.html
 1.10 15-Jun-2000  ragge branches: 1.10.26;
Standalone device driver for DEBNx (ni) ethernet controllers.
 1.9 26-May-2000  ragge branches: 1.9.2;
Fake success when trying to use the strategy() routine on a network device.
This avoids clobbering errno and bad error messages.
 1.8 21-May-2000  ragge Standalone driver for the Digital Equipment Unibus Network Adapter (DEUNA).
This allows 11/750 owners to install from a single TU58 cassette.
(Are there still any 11/750 owners left out there? :-)
 1.7 20-May-2000  ragge Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.
 1.6 24-Apr-2000  matt Add cd9660 support to the secondary boot blocks.
 1.5 22-Apr-2000  ragge Add device switch entry for RL disks. Only uses rom to boot so far.
 1.4 16-Apr-2000  matt move ustarfs to end so that '@" can be avoided. from mhitch.
 1.3 23-Oct-1999  ragge Use romread() routines if we are booted from SCSI disks.
 1.2 30-Jun-1999  ragge branches: 1.2.2; 1.2.4; 1.2.6;
Support loading the kernel from ustarfs.
 1.1 06-Mar-1999  ragge branches: 1.1.2; 1.1.4;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 01-Mar-2000  he Apply patch (requested by toddpw):
Finish porting sysinst to vax, and build various bootable installers
in new directory distrib/vax/bootfs.
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.4.1 15-Nov-1999  fvdl Sync with -current
 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.9.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.26.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.26.1 03-Aug-2004  skrll Sync with HEAD
 1.14.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.14.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.14.78.1 04-May-2009  yamt sync with head.
 1.15.22.2 03-Dec-2017  jdolecek update from HEAD
 1.15.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.10.1 28-Aug-2017  skrll Sync with HEAD
 1.17.8.1 02-May-2018  pgoyette Synch with HEAD
 1.18.38.1 02-Aug-2025  perseant Sync with HEAD
 1.17 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.16 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.15 14-Mar-2009  dsl branches: 1.15.22; 1.15.40;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.14 01-Jul-2006  mrg branches: 1.14.62; 1.14.70; 1.14.76;
fix pointer signedness and build with GCC4.
 1.13 24-May-2002  ragge branches: 1.13.22; 1.13.36; 1.13.40; 1.13.48;
Boot support for the VXT2000 X terminal, based on some info on the VAXLinux
mailing list.
 1.12 04-May-2001  ragge branches: 1.12.2; 1.12.8; 1.12.16;
Remove forgotten VAX_BTYP_690. From Michael Kukat.
 1.11 19-Jul-2000  matt branches: 1.11.2;
Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.10 10-Jul-2000  ragge Add support for VAX 6000 + VAX 8000. Tweak console routines.
Create a fake RPB if either netbooted (on machine without RPB) or
loaded from console storage (without VMB intervention).
 1.9 20-May-2000  ragge Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.
 1.8 09-May-2000  ragge Get boot device CSR from RPB instead of trying to guess it.
 1.7 08-May-2000  ragge Console support for VXT 2000, VAX 4000/105 and VAX 4000/500.
From Michael Kukat.
 1.6 23-Aug-1999  ragge branches: 1.6.2;
Add support for 4000/90. Also handle interrupts more intelligent.
XXX - countdown doesn't work on 4000/90.
 1.5 20-Jun-1999  ragge Some 4000/200 fixes. From Michael Kukat.
 1.4 23-May-1999  ragge Use common routines to identify cpu type.
Set up a SCB to be able to handle clock interrupts in the boot program.
Now timer countdown should work on all types of vaxen.
 1.3 14-Apr-1999  ragge Machines using KA48 must have memory mapped in, and use the same
addresses for console as KA46. From Michael Kukat.
 1.2 27-Mar-1999  ragge branches: 1.2.2;
#define was wrong. Some .c should be .s.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 1.2.2.1 15-Apr-1999  ragge branches: 1.2.2.1.2;
Pull up autoconf.c 1.2 and consio.c 1.3.
 1.2.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.2.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.6.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.11.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.16.1 30-May-2002  gehenna Catch up with -current.
 1.12.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.12.8.1 04-May-2001  nathanw file consio.c was added on branch nathanw_sa on 2002-06-20 03:42:06 +0000
 1.12.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.13.48.1 13-Jul-2006  gdamore Merge from HEAD.
 1.13.40.1 11-Aug-2006  yamt sync with head
 1.13.36.1 09-Sep-2006  rpaulo sync with head
 1.13.22.1 30-Dec-2006  yamt sync with head.
 1.14.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.14.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.14.62.1 04-May-2009  yamt sync with head.
 1.15.40.2 28-Aug-2017  skrll Sync with HEAD
 1.15.40.1 09-Jul-2016  skrll Sync with HEAD
 1.15.22.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 24-Feb-2002  matt branches: 1.1.2; 1.1.8; 1.1.170; 1.1.190;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1.190.1 28-Aug-2017  skrll Sync with HEAD
 1.1.170.1 03-Dec-2017  jdolecek update from HEAD
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file consio2.S was added on branch kqueue on 2002-03-16 16:00:11 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file consio2.S was added on branch nathanw_sa on 2002-02-28 04:12:26 +0000
 1.2 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1 19-Jul-2000  matt branches: 1.1.2; 1.1.6; 1.1.10;
Put the assembly consio routines in a separate file so it can deal with
a.out/ELF differences.
 1.1.10.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.6.1 16-Mar-2002  jdolecek Catch up with -current.
 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 19-Jul-2000  bouyer file consio2.s was added on branch thorpej_scsipi on 2000-11-20 20:32:36 +0000
 1.9 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.8 18-Mar-2009  cegger branches: 1.8.22; 1.8.40;
Ansify function definitions w/o arguments. Generated with sed.
 1.7 17-Mar-2009  dsl Add some 'int' into function definitions where the K&R one didn't
specify a type.
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 20-May-2000  ragge branches: 1.3.134; 1.3.142; 1.3.148;
Change all devices to use the RPB info when autobooting, this allows for
booting from unsupported devices also. As a side effect; it fixes PR#9202.
 1.2 16-Mar-2000  darrenr __P(()) -> __P((void))
 1.1 06-Mar-1999  ragge branches: 1.1.8;
New boot program for vax. Appearance similar to the i386 boot blocks.
 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.3.148.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.142.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.134.1 04-May-2009  yamt sync with head.
 1.8.40.1 28-Aug-2017  skrll Sync with HEAD
 1.8.22.1 03-Dec-2017  jdolecek update from HEAD
 1.5 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.4 01-Jul-2006  mrg branches: 1.4.106; 1.4.126;
fix pointer signedness and build with GCC4.
 1.3 26-Jul-2001  wiz branches: 1.3.6; 1.3.38; 1.3.52; 1.3.56; 1.3.64;
Various typos in comments (neccessary, sceme, choise, ...).
 1.2 20-May-2000  ragge branches: 1.2.8;
Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.
 1.1 06-Mar-1999  ragge branches: 1.1.8;
New boot program for vax. Appearance similar to the i386 boot blocks.
 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.1 03-Aug-2001  lukem update to -current
 1.3.64.1 13-Jul-2006  gdamore Merge from HEAD.
 1.3.56.1 11-Aug-2006  yamt sync with head
 1.3.52.1 09-Sep-2006  rpaulo sync with head
 1.3.38.1 30-Dec-2006  yamt sync with head.
 1.3.6.2 26-Jul-2001  wiz Various typos in comments (neccessary, sceme, choise, ...).
 1.3.6.1 26-Jul-2001  wiz file data.h was added on branch nathanw_sa on 2001-07-26 15:05:10 +0000
 1.4.126.1 28-Aug-2017  skrll Sync with HEAD
 1.4.106.1 03-Dec-2017  jdolecek update from HEAD
 1.20 21-Mar-2018  ragge Fix bug causing autoboot on 750/780 not to work. Cleanup.
 1.19 19-Mar-2018  ragge Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
 1.18 22-May-2017  ragge branches: 1.18.2; 1.18.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.17 10-Aug-2014  martin branches: 1.17.4;
Remove atoi() prototype
 1.16 14-Mar-2009  dsl branches: 1.16.22;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.15 16-Oct-2008  hans branches: 1.15.2; 1.15.8;
Set nexaddr on qbus vaxen to enable remapping of buffers when booting
from MSCP devices. Fixes MSCP boot problem introduced by moving boot up
to allow for bigger kernels. OK by matt.
 1.14 11-Dec-2005  christos branches: 1.14.74; 1.14.78; 1.14.84;
merge ktrace-lwp.
 1.13 27-Jun-2005  junyoung Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.12 27-Jun-2005  junyoung Remove trailing spaces.
 1.11 01-Nov-2003  jdolecek rename local index() to strchr()
 1.10 24-May-2002  ragge branches: 1.10.6;
Boot support for the VXT2000 X terminal, based on some info on the VAXLinux
mailing list.
 1.9 01-May-2001  ragge branches: 1.9.2; 1.9.8; 1.9.16;
Do not (try to) remap the qbus on MV1.
 1.8 20-Mar-2001  matt Add a diagnostic when we encounter an unknown boot device type.
 1.7 13-Jul-2000  matt branches: 1.7.2;
Include libkern.h
 1.6 10-Jul-2000  ragge Add support for VAX 6000 + VAX 8000. Tweak console routines.
Create a fake RPB if either netbooted (on machine without RPB) or
loaded from console storage (without VMB intervention).
 1.5 11-Jun-2000  ragge Fix booting from BI-based disks.
 1.4 21-May-2000  ragge branches: 1.4.2;
Set correct adapter addresses if none is given.
 1.3 20-May-2000  ragge Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.
 1.2 30-Jun-1999  ragge branches: 1.2.2;
Support loading the kernel from ustarfs.
 1.1 06-Mar-1999  ragge branches: 1.1.4;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.2.2.2 27-Mar-2001  bouyer Sync with HEAD.
 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.4.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.7.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.9.16.1 30-May-2002  gehenna Catch up with -current.
 1.9.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.9.8.1 01-May-2001  nathanw file devopen.c was added on branch nathanw_sa on 2002-06-20 03:42:07 +0000
 1.9.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14.84.1 19-Oct-2008  haad Sync with HEAD.
 1.14.78.1 04-May-2009  yamt sync with head.
 1.14.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.16.22.2 03-Dec-2017  jdolecek update from HEAD
 1.16.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.4.1 28-Aug-2017  skrll Sync with HEAD
 1.18.8.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.18.2.1 24-Mar-2018  snj Pull up following revision(s) (requested by ragge in ticket #655):
sys/arch/vax/boot/boot/devopen.c: 1.19-1.20
sys/arch/vax/boot/boot/hp.c: 1.11
sys/arch/vax/boot/boot/if_de.c: 1.10
sys/arch/vax/boot/boot/if_qe.c: 1.10
sys/arch/vax/boot/boot/ra.c: 1.21-1.22
sys/arch/vax/boot/boot/vaxstand.h: 1.10
Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
--
Change the driver to map the data structures onto the qbus.
--
Fix bug causing autoboot on 750/780 not to work. Cleanup.
 1.11 19-Mar-2018  ragge Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
 1.10 22-May-2017  ragge branches: 1.10.2; 1.10.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.9 18-Mar-2009  cegger branches: 1.9.22; 1.9.40;
bzero -> memset
 1.8 11-Dec-2005  christos branches: 1.8.78; 1.8.86; 1.8.92;
merge ktrace-lwp.
 1.7 27-Jun-2005  junyoung Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.6 27-Jun-2005  junyoung Remove trailing spaces.
 1.5 19-Jul-2000  matt branches: 1.5.24;
Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.4 04-Jun-2000  ragge Adopt to latest mba/hp changes.
 1.3 20-May-2000  ragge branches: 1.3.2;
Change all devices to use the RPB info when autobooting, this allows for
booting from unsupported devices also. As a side effect; it fixes PR#9202.
 1.2 01-Apr-1999  ragge branches: 1.2.8;
A bunch of small fixes to make boot work on most VAXen.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 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.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.24.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.9.40.1 28-Aug-2017  skrll Sync with HEAD
 1.9.22.1 03-Dec-2017  jdolecek update from HEAD
 1.10.8.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.10.2.1 24-Mar-2018  snj Pull up following revision(s) (requested by ragge in ticket #655):
sys/arch/vax/boot/boot/devopen.c: 1.19-1.20
sys/arch/vax/boot/boot/hp.c: 1.11
sys/arch/vax/boot/boot/if_de.c: 1.10
sys/arch/vax/boot/boot/if_qe.c: 1.10
sys/arch/vax/boot/boot/ra.c: 1.21-1.22
sys/arch/vax/boot/boot/vaxstand.h: 1.10
Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
--
Change the driver to map the data structures onto the qbus.
--
Fix bug causing autoboot on 750/780 not to work. Cleanup.
 1.10 19-Mar-2018  ragge Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
 1.9 22-May-2017  ragge branches: 1.9.2; 1.9.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.8 26-Oct-2009  cegger branches: 1.8.22; 1.8.40;
kill extra whitespaces
reviewed by tsutsui@
 1.7 18-Mar-2009  cegger bcopy -> memcpy
 1.6 18-Mar-2009  cegger bzero -> memset
 1.5 12-Jan-2009  tsutsui branches: 1.5.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.4 01-Jul-2006  mrg branches: 1.4.58; 1.4.62; 1.4.70;
fix pointer signedness and build with GCC4.
 1.3 08-Jun-2006  he branches: 1.3.2;
Get rid of lvalue casts by either using an extra temporary variable
or by using the appropriate casts in the first place.
 1.2 24-May-2002  ragge branches: 1.2.22; 1.2.36; 1.2.40; 1.2.46;
%d -> %ld in some debug messages, after the ELF switch.
 1.1 21-May-2000  ragge branches: 1.1.6; 1.1.10; 1.1.14; 1.1.22;
Standalone driver for the Digital Equipment Unibus Network Adapter (DEUNA).
This allows 11/750 owners to install from a single TU58 cassette.
(Are there still any 11/750 owners left out there? :-)
 1.1.22.1 30-May-2002  gehenna Catch up with -current.
 1.1.14.1 20-Jun-2002  nathanw Catch up to -current.
 1.1.10.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 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 21-May-2000  bouyer file if_de.c was added on branch thorpej_scsipi on 2000-11-20 20:32:37 +0000
 1.2.46.1 19-Jun-2006  chap Sync with head.
 1.2.40.2 11-Aug-2006  yamt sync with head
 1.2.40.1 26-Jun-2006  yamt sync with head.
 1.2.36.1 09-Sep-2006  rpaulo sync with head
 1.2.22.2 30-Dec-2006  yamt sync with head.
 1.2.22.1 21-Jun-2006  yamt sync with head.
 1.3.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.4.70.2 28-Apr-2009  skrll Sync with HEAD.
 1.4.70.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.62.2 11-Mar-2010  yamt sync with head
 1.4.62.1 04-May-2009  yamt sync with head.
 1.4.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.40.1 28-Aug-2017  skrll Sync with HEAD
 1.8.22.1 03-Dec-2017  jdolecek update from HEAD
 1.9.8.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.9.2.1 24-Mar-2018  snj Pull up following revision(s) (requested by ragge in ticket #655):
sys/arch/vax/boot/boot/devopen.c: 1.19-1.20
sys/arch/vax/boot/boot/hp.c: 1.11
sys/arch/vax/boot/boot/if_de.c: 1.10
sys/arch/vax/boot/boot/if_qe.c: 1.10
sys/arch/vax/boot/boot/ra.c: 1.21-1.22
sys/arch/vax/boot/boot/vaxstand.h: 1.10
Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
--
Change the driver to map the data structures onto the qbus.
--
Fix bug causing autoboot on 750/780 not to work. Cleanup.
 1.13 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.12 12-Jan-2009  tsutsui branches: 1.12.24; 1.12.42;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.11 31-Mar-2008  he branches: 1.11.4; 1.11.12;
Convert from use of bcopy() to memcpy() so that this builds again.
 1.10 11-Jun-2006  he branches: 1.10.60;
Correct mistakes I made when getting rid of lvalue casts.
 1.9 08-Jun-2006  he Get rid of lvalue casts by either using an extra temporary variable
or by using the appropriate casts in the first place.
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.8; 1.8.14;
merge ktrace-lwp.
 1.7 10-Nov-2003  wiz branches: 1.7.16;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.6 20-May-2000  ragge branches: 1.6.28;
Change all devices to use the RPB info when autobooting, this allows for
booting from unsupported devices also. As a side effect; it fixes PR#9202.
 1.5 09-May-2000  ragge Get boot device CSR from RPB instead of trying to guess it.
 1.4 14-Aug-1999  ragge branches: 1.4.2;
Add boot support for the VAX 3300/3400 LANCE chip.
 1.3 01-Apr-1999  ragge A bunch of small fixes to make boot work on most VAXen.
 1.2 25-Mar-1999  thorpej Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 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.6.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.28.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.8.14.1 19-Jun-2006  chap Sync with head.
 1.8.8.1 26-Jun-2006  yamt sync with head.
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.10.60.2 17-Jan-2009  mjf Sync with HEAD.
 1.10.60.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.11.4.1 04-May-2009  yamt sync with head.
 1.12.42.1 28-Aug-2017  skrll Sync with HEAD
 1.12.24.1 03-Dec-2017  jdolecek update from HEAD
 1.11 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.10 09-Nov-2013  christos branches: 1.10.6;
fix unused variable warnings
 1.9 03-Jul-2011  mrg branches: 1.9.2; 1.9.12; 1.9.16;
avoid some multi-level pointer cast issues.
 1.8 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.7 18-Mar-2009  cegger bcopy -> memcpy
 1.6 18-Mar-2009  cegger bzero -> memset
 1.5 12-Jan-2009  tsutsui branches: 1.5.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.4 04-Mar-2007  christos branches: 1.4.40; 1.4.44; 1.4.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.3 01-Jul-2006  mrg branches: 1.3.10;
fix pointer signedness and build with GCC4.
 1.2 10-Jul-2000  ragge branches: 1.2.2; 1.2.42; 1.2.56; 1.2.60; 1.2.68;
NODESIZE -> BI_NODESIZE.
 1.1 15-Jun-2000  ragge branches: 1.1.4;
Standalone device driver for DEBNx (ni) ethernet controllers.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 15-Jun-2000  minoura file if_ni.c was added on branch minoura-xpg4dl on 2000-06-22 17:04:56 +0000
 1.2.68.1 13-Jul-2006  gdamore Merge from HEAD.
 1.2.60.1 11-Aug-2006  yamt sync with head
 1.2.56.1 09-Sep-2006  rpaulo sync with head
 1.2.42.2 03-Sep-2007  yamt sync with head.
 1.2.42.1 30-Dec-2006  yamt 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 10-Jul-2000  bouyer file if_ni.c was added on branch thorpej_scsipi on 2000-11-20 20:32:37 +0000
 1.3.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.4.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.4.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.44.2 11-Mar-2010  yamt sync with head
 1.4.44.1 04-May-2009  yamt sync with head.
 1.4.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.16.1 18-May-2014  rmind sync with head
 1.9.12.2 03-Dec-2017  jdolecek update from HEAD
 1.9.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.6.1 28-Aug-2017  skrll Sync with HEAD
 1.10 20-Mar-2018  ragge Change the driver to map the data structures onto the qbus.
 1.9 26-Oct-2009  cegger branches: 1.9.56; 1.9.62;
kill extra whitespaces
reviewed by tsutsui@
 1.8 18-Mar-2009  cegger bcopy -> memcpy
 1.7 18-Mar-2009  cegger bzero -> memset
 1.6 12-Jan-2009  tsutsui branches: 1.6.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.5 04-Mar-2007  christos branches: 1.5.40; 1.5.44; 1.5.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 01-Jul-2006  mrg branches: 1.4.10;
fix pointer signedness and build with GCC4.
 1.3 20-May-2000  ragge branches: 1.3.44; 1.3.58; 1.3.62; 1.3.70;
Change all devices to use the RPB info when autobooting, this allows for
booting from unsupported devices also. As a side effect; it fixes PR#9202.
 1.2 30-Jun-1999  ragge branches: 1.2.2;
Search for include files in new locations.
 1.1 06-Mar-1999  ragge branches: 1.1.4;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.4.1 01-Jul-1999  thorpej Sync w/ -current.
 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.70.1 13-Jul-2006  gdamore Merge from HEAD.
 1.3.62.1 11-Aug-2006  yamt sync with head
 1.3.58.1 09-Sep-2006  rpaulo sync with head
 1.3.44.2 03-Sep-2007  yamt sync with head.
 1.3.44.1 30-Dec-2006  yamt sync with head.
 1.4.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.5.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.44.2 11-Mar-2010  yamt sync with head
 1.5.44.1 04-May-2009  yamt sync with head.
 1.5.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.6.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.62.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.9.56.1 24-Mar-2018  snj Pull up following revision(s) (requested by ragge in ticket #655):
sys/arch/vax/boot/boot/devopen.c: 1.19-1.20
sys/arch/vax/boot/boot/hp.c: 1.11
sys/arch/vax/boot/boot/if_de.c: 1.10
sys/arch/vax/boot/boot/if_qe.c: 1.10
sys/arch/vax/boot/boot/ra.c: 1.21-1.22
sys/arch/vax/boot/boot/vaxstand.h: 1.10
Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
--
Change the driver to map the data structures onto the qbus.
--
Fix bug causing autoboot on 750/780 not to work. Cleanup.
 1.17 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.16 18-Mar-2009  cegger bcopy -> memcpy
 1.15 18-Mar-2009  cegger bzero -> memset
 1.14 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.13 12-Jan-2009  tsutsui branches: 1.13.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.12 27-May-2002  ragge branches: 1.12.108; 1.12.112; 1.12.120;
Use correct ethernet address address on VXT2000.
 1.11 24-May-2002  ragge Boot support for the VXT2000 X terminal, based on some info on the VAXLinux
mailing list.
 1.10 20-May-2000  ragge branches: 1.10.8; 1.10.12; 1.10.20;
Change all devices to use the RPB info when autobooting, this allows for
booting from unsupported devices also. As a side effect; it fixes PR#9202.
 1.9 18-May-2000  matt fix comments.
 1.8 09-May-2000  ragge Get boot device CSR from RPB instead of trying to guess it.
 1.7 08-May-2000  ragge Console support for VXT 2000, VAX 4000/105 and VAX 4000/500.
From Michael Kukat.
 1.6 28-Apr-2000  matt Dump NRCV to 8 from 5. Note that a 8K NFS reply takes 6 full size
Ethernet packets so the chances are that if the server was fast enough
this driver would continuously lose one of the fragments. Eventually
causing the kernel load to fail. Add 2 extra for random ARP or other
packets that might be picked up.
 1.5 23-Aug-1999  ragge branches: 1.5.2;
Add support for 4000/90. Also handle interrupts more intelligent.
XXX - countdown doesn't work on 4000/90.
 1.4 07-Aug-1999  ragge Reset the interface when loading is finished, to avoid spurious writing
to memory.
 1.3 01-Apr-1999  ragge A bunch of small fixes to make boot work on most VAXen.
 1.2 25-Mar-1999  thorpej Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 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.10.20.1 30-May-2002  gehenna Catch up with -current.
 1.10.12.1 20-Jun-2002  nathanw Catch up to -current.
 1.10.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.120.2 28-Apr-2009  skrll Sync with HEAD.
 1.12.120.1 19-Jan-2009  skrll Sync with HEAD.
 1.12.112.2 11-Mar-2010  yamt sync with head
 1.12.112.1 04-May-2009  yamt sync with head.
 1.12.108.1 17-Jan-2009  mjf Sync with HEAD.
 1.13.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.16 28-Oct-2019  christos Rewrite the floppy selection logic, and fix an always false condition.
 1.15 22-May-2017  ragge branches: 1.15.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.14 09-Nov-2013  christos branches: 1.14.6;
fix unused variable warnings
 1.13 26-Oct-2009  cegger branches: 1.13.12; 1.13.22; 1.13.26;
kill extra whitespaces
reviewed by tsutsui@
 1.12 18-Mar-2009  cegger bcopy -> memcpy
 1.11 18-Mar-2009  cegger bzero -> memset
 1.10 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.9 17-Mar-2009  dsl Add some 'int' into function definitions where the K&R one didn't
specify a type.
 1.8 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.7 08-Jun-2006  he branches: 1.7.64; 1.7.72; 1.7.78;
Get rid of lvalue casts by either using an extra temporary variable
or by using the appropriate casts in the first place.
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8; 1.6.14;
merge ktrace-lwp.
 1.5 27-Jun-2005  junyoung branches: 1.5.2;
Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.4 26-Jul-2001  wiz branches: 1.4.6; 1.4.22;
issueing -> issuing
 1.3 19-Jul-2000  matt branches: 1.3.4;
Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.2 20-May-2000  ragge Change all devices to use the RPB info when autobooting, this allows for
booting from unsupported devices also. As a side effect; it fixes PR#9202.
 1.1 06-Mar-1999  ragge branches: 1.1.8;
New boot program for vax. Appearance similar to the i386 boot blocks.
 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.3.4.1 03-Aug-2001  lukem update to -current
 1.4.22.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.6.2 26-Jul-2001  wiz issueing -> issuing
 1.4.6.1 26-Jul-2001  wiz file mfm.c was added on branch nathanw_sa on 2001-07-26 22:55:14 +0000
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.6.14.1 19-Jun-2006  chap Sync with head.
 1.6.8.1 26-Jun-2006  yamt sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.78.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.72.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.64.2 11-Mar-2010  yamt sync with head
 1.7.64.1 04-May-2009  yamt sync with head.
 1.13.26.1 18-May-2014  rmind sync with head
 1.13.22.2 03-Dec-2017  jdolecek update from HEAD
 1.13.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.6.1 28-Aug-2017  skrll Sync with HEAD
 1.15.10.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16 19-May-2011  jakllsch Specify that the sock argument of socktodesc() is an int,
instead of letting it default to int.
 1.15 26-Oct-2009  cegger branches: 1.15.4; 1.15.6;
kill extra whitespaces
reviewed by tsutsui@
 1.14 21-Oct-2009  snj Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder).
 1.13 18-Mar-2009  cegger bcopy -> memcpy
 1.12 18-Mar-2009  cegger bzero -> memset
 1.11 12-Jan-2009  tsutsui branches: 1.11.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.10 28-Apr-2008  martin branches: 1.10.8;
Remove clause 3 and 4 from TNF licenses
 1.9 11-Dec-2005  christos branches: 1.9.74; 1.9.76; 1.9.78;
merge ktrace-lwp.
 1.8 27-Jun-2005  junyoung Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.7 28-Mar-2003  he branches: 1.7.2;
Compensate for the change of type for io_netif by adding a cast so
that this compiles again.
 1.6 26-May-2000  ragge Don't init the net info more than once.
 1.5 20-May-2000  ragge Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.
 1.4 30-Jun-1999  ragge branches: 1.4.2;
Stop the network interface after kernel is loaded but before starting it.
Not doing this caused packets to be read into memory somewhere after the
kernel was started but before the device was probed, normally in the
system page table. This gave quite unpredictable results...
 1.3 07-May-1999  drochner include <lib/libkern/libkern.h> for intoa()/inet_ntoa()
 1.2 01-Apr-1999  ragge branches: 1.2.4;
A bunch of small fixes to make boot work on most VAXen.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 1.2.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.2.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
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.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.78.3 11-Mar-2010  yamt sync with head
 1.9.78.2 04-May-2009  yamt sync with head.
 1.9.78.1 16-May-2008  yamt sync with head.
 1.9.76.1 18-May-2008  yamt sync with head.
 1.9.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.9.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.10.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.11.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.15.4.1 31-May-2011  rmind sync with head
 1.23 14-Jul-2025  hans vax/boot: fix detection of CMD CQD-22x MSCP controllers

Certain models of CMD MSCP controllers fail to be detected by uda(4) if
they have been booted from. This failure mode has been introduced in
revision 1.11 of uba_mainbus.c, when scanning for Qbus/Unibus memories
was added. They are deteced fine when NetBSD is booted from any other
device such as over the network.

When NetBSD is booted from a MSCP controller, the boot loader sets up
the Qbus map to provide the controller with a small command/response
ring in memory to be used for I/O. Once the kernel is loaded and uba(4)
is attaching, the Qbus map is cleared while scanning for memories. It
appears that sudden loss of access to the command/response ring causes
the firmware of these CMD controllers to drop dead.

As a result, these controllers don't react in a reasonable time (100ms
by the spec) when their IP register is written to re-initialze the
controller. Even though uda(4)'s udamatch() waits up to 10s for a sign
of life from the controller, that's usually not enough for it to wake
up and it is assumed to be absent. Which, of course, causes the kernel
to fail booting as the boot device can't be found.

This needs to be addressed both in the kernel and the bootloader.

To fix this properly, the standalone ra.c driver in the boot loader
should provide a close() entry point which clears the IP register to
issue a controller reset. Thus when the kernel is loaded, the firmware
of the MSCP controller is again in reset state and can't get confused
anymore by the initialization of the Qbus map in uba(4).
 1.22 21-Mar-2018  ragge branches: 1.22.38;
Fix bug causing autoboot on 750/780 not to work. Cleanup.
 1.21 19-Mar-2018  ragge Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
 1.20 22-May-2017  ragge branches: 1.20.2; 1.20.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.19 09-Nov-2013  christos branches: 1.19.6;
fix unused variable warnings
 1.18 18-Mar-2009  cegger branches: 1.18.12; 1.18.22; 1.18.26;
bzero -> memset
 1.17 01-Jul-2006  mrg branches: 1.17.62; 1.17.70; 1.17.76;
fix pointer signedness and build with GCC4.
 1.16 11-Jun-2006  he branches: 1.16.2;
Correct a mistake I introduced when getting rid of lvalue casts.
 1.15 08-Jun-2006  he Get rid of lvalue casts by either using an extra temporary variable
or by using the appropriate casts in the first place.
 1.14 11-Dec-2005  christos branches: 1.14.4; 1.14.8; 1.14.14;
merge ktrace-lwp.
 1.13 27-Jun-2005  junyoung branches: 1.13.2;
Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.12 27-Jun-2005  junyoung Remove trailing spaces.
 1.11 04-Jun-2002  ragge branches: 1.11.6;
Need longer delay while waiting for mscp packets, otherwise it times out
on VAX8650.
 1.10 24-May-2002  ragge %d -> %ld in some debug messages, after the ELF switch.
 1.9 19-Jul-2000  matt branches: 1.9.4; 1.9.8; 1.9.16;
Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.8 10-Jul-2000  ragge Add support for VAX 6000 + VAX 8000. Tweak console routines.
Create a fake RPB if either netbooted (on machine without RPB) or
loaded from console storage (without VMB intervention).
 1.7 11-Jun-2000  ragge Fix booting from BI-based disks.
 1.6 21-May-2000  ragge branches: 1.6.2;
Remove forgotten debug printf.
 1.5 20-May-2000  ragge Change all devices to use the RPB info when autobooting, this allows for
booting from unsupported devices also. As a side effect; it fixes PR#9202.
 1.4 07-Aug-1999  ragge branches: 1.4.2;
BI bus files has moved.
 1.3 30-Jun-1999  ragge Search for include files in new locations.
 1.2 01-Apr-1999  ragge branches: 1.2.4;
A bunch of small fixes to make boot work on most VAXen.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 1.2.4.1 01-Jul-1999  thorpej Sync w/ -current.
 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.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.16.2 15-Jul-2002  gehenna catch up with -current.
 1.9.16.1 30-May-2002  gehenna Catch up with -current.
 1.9.8.1 20-Jun-2002  nathanw Catch up to -current.
 1.9.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.11.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.2.2 30-Dec-2006  yamt sync with head.
 1.13.2.1 21-Jun-2006  yamt sync with head.
 1.14.14.1 19-Jun-2006  chap Sync with head.
 1.14.8.2 11-Aug-2006  yamt sync with head
 1.14.8.1 26-Jun-2006  yamt sync with head.
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.16.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.17.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.17.62.1 04-May-2009  yamt sync with head.
 1.18.26.1 18-May-2014  rmind sync with head
 1.18.22.2 03-Dec-2017  jdolecek update from HEAD
 1.18.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.6.1 28-Aug-2017  skrll Sync with HEAD
 1.20.8.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.20.2.1 24-Mar-2018  snj Pull up following revision(s) (requested by ragge in ticket #655):
sys/arch/vax/boot/boot/devopen.c: 1.19-1.20
sys/arch/vax/boot/boot/hp.c: 1.11
sys/arch/vax/boot/boot/if_de.c: 1.10
sys/arch/vax/boot/boot/if_qe.c: 1.10
sys/arch/vax/boot/boot/ra.c: 1.21-1.22
sys/arch/vax/boot/boot/vaxstand.h: 1.10
Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
--
Change the driver to map the data structures onto the qbus.
--
Fix bug causing autoboot on 750/780 not to work. Cleanup.
 1.22.38.1 02-Aug-2025  perseant Sync with HEAD
 1.11 25-Apr-2022  mlelstv libsa now needs ioctl support to handle media with large sectors.
Provide dummy functions.
 1.10 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.9 18-Mar-2009  cegger branches: 1.9.22; 1.9.40;
bzero -> memset
 1.8 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.7 11-Dec-2005  christos branches: 1.7.78; 1.7.86; 1.7.92;
merge ktrace-lwp.
 1.6 27-Jun-2005  junyoung Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.5 19-Sep-2002  ragge branches: 1.5.6;
Remove the (today) unneccessary boot unit number conversions for rom-booted
disks. This allows for booting from different LUNs on SCSI disks.
 1.4 24-Jun-2002  mrg make booting from FS_RAID work. tested on vs4000/90.
 1.3 19-Jul-2000  matt branches: 1.3.4; 1.3.8; 1.3.16; 1.3.18;
Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.2 20-May-2000  ragge Change all devices to use the RPB info when autobooting, this allows for
booting from unsupported devices also. As a side effect; it fixes PR#9202.
 1.1 06-Mar-1999  ragge branches: 1.1.8;
New boot program for vax. Appearance similar to the i386 boot blocks.
 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.3.18.1 26-Jun-2002  lukem Pull up revision 1.4 (requested by mrg in ticket #370):
make booting from FS_RAID work. tested on vs4000/90.
 1.3.16.1 17-Jul-2002  gehenna catch up with -current.
 1.3.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.3.8.1 01-Aug-2002  nathanw Catch up to -current.
 1.3.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.4.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.5.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.78.1 04-May-2009  yamt sync with head.
 1.9.40.1 28-Aug-2017  skrll Sync with HEAD
 1.9.22.1 03-Dec-2017  jdolecek update from HEAD
 1.9 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.8 17-Mar-2009  dsl branches: 1.8.22; 1.8.40;
Add some 'int' into function definitions where the K&R one didn't
specify a type.
 1.7 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.6 11-Dec-2005  christos branches: 1.6.78; 1.6.86; 1.6.92;
merge ktrace-lwp.
 1.5 27-Jun-2005  junyoung Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.4 27-Jun-2005  junyoung Remove trailing spaces.
 1.3 30-Jun-1999  ragge branches: 1.3.36;
Search for include files in new locations.
 1.2 01-Apr-1999  ragge branches: 1.2.4;
A bunch of small fixes to make boot work on most VAXen.
 1.1 06-Mar-1999  ragge New boot program for vax. Appearance similar to the i386 boot blocks.
 1.2.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3.36.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.6.78.1 04-May-2009  yamt sync with head.
 1.8.40.1 28-Aug-2017  skrll Sync with HEAD
 1.8.22.1 03-Dec-2017  jdolecek update from HEAD
 1.12 14-Jul-2025  hans vax/boot: fix detection of CMD CQD-22x MSCP controllers

Certain models of CMD MSCP controllers fail to be detected by uda(4) if
they have been booted from. This failure mode has been introduced in
revision 1.11 of uba_mainbus.c, when scanning for Qbus/Unibus memories
was added. They are deteced fine when NetBSD is booted from any other
device such as over the network.

When NetBSD is booted from a MSCP controller, the boot loader sets up
the Qbus map to provide the controller with a small command/response
ring in memory to be used for I/O. Once the kernel is loaded and uba(4)
is attaching, the Qbus map is cleared while scanning for memories. It
appears that sudden loss of access to the command/response ring causes
the firmware of these CMD controllers to drop dead.

As a result, these controllers don't react in a reasonable time (100ms
by the spec) when their IP register is written to re-initialze the
controller. Even though uda(4)'s udamatch() waits up to 10s for a sign
of life from the controller, that's usually not enough for it to wake
up and it is assumed to be absent. Which, of course, causes the kernel
to fail booting as the boot device can't be found.

This needs to be addressed both in the kernel and the bootloader.

To fix this properly, the standalone ra.c driver in the boot loader
should provide a close() entry point which clears the IP register to
issue a controller reset. Thus when the kernel is loaded, the firmware
of the MSCP controller is again in reset state and can't get confused
anymore by the initialization of the Qbus map in uba(4).
 1.11 25-Apr-2022  mlelstv branches: 1.11.10;
libsa now needs ioctl support to handle media with large sectors.
Provide dummy functions.
 1.10 19-Mar-2018  ragge Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
 1.9 22-May-2017  ragge branches: 1.9.2; 1.9.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.8 11-Dec-2005  christos branches: 1.8.122; 1.8.142;
merge ktrace-lwp.
 1.7 04-Nov-2003  jdolecek yield to the strchr() prototype from libkern.h
 1.6 01-Nov-2003  jdolecek rename local index() to strchr()
 1.5 15-Jun-2000  ragge branches: 1.5.26;
Standalone device driver for DEBNx (ni) ethernet controllers.
 1.4 21-May-2000  ragge branches: 1.4.2;
Standalone driver for the Digital Equipment Unibus Network Adapter (DEUNA).
This allows 11/750 owners to install from a single TU58 cassette.
(Are there still any 11/750 owners left out there? :-)
 1.3 20-May-2000  ragge Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.
 1.2 09-May-2000  ragge Get boot device CSR from RPB instead of trying to guess it.
 1.1 06-Mar-1999  ragge branches: 1.1.8;
New boot program for vax. Appearance similar to the i386 boot blocks.
 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.4.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.26.1 03-Aug-2004  skrll Sync with HEAD
 1.8.142.1 28-Aug-2017  skrll Sync with HEAD
 1.8.122.1 03-Dec-2017  jdolecek update from HEAD
 1.9.8.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.9.2.1 24-Mar-2018  snj Pull up following revision(s) (requested by ragge in ticket #655):
sys/arch/vax/boot/boot/devopen.c: 1.19-1.20
sys/arch/vax/boot/boot/hp.c: 1.11
sys/arch/vax/boot/boot/if_de.c: 1.10
sys/arch/vax/boot/boot/if_qe.c: 1.10
sys/arch/vax/boot/boot/ra.c: 1.21-1.22
sys/arch/vax/boot/boot/vaxstand.h: 1.10
Use a common routine ubmap() that setup the map registers as needed,
not expecting everything to be below 4M. This solves the problem
that large kernels cannot be loaded reported on port-vax.
--
Change the driver to map the data structures onto the qbus.
--
Fix bug causing autoboot on 750/780 not to work. Cleanup.
 1.11.10.1 02-Aug-2025  perseant Sync with HEAD
 1.8 17-Jan-2016  tsutsui Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
Tested on simh 4.0-Beta1 emulationg MicroVAX 3900.
 1.7 18-Oct-2014  snj branches: 1.7.2;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.6 11-Dec-2005  christos branches: 1.6.122;
merge ktrace-lwp.
 1.5 13-Feb-2004  wiz Uppercase CPU.
 1.4 09-Nov-2001  scw branches: 1.4.2; 1.4.18;
Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.3 02-Aug-2001  bjh21 branches: 1.3.4;
Bump version numbers of all bootloaders that use loadfile/ELF, to account for
my changes to symbol loading. I should probably have done this at the time,
but it's better late than never.
 1.2 24-Sep-2000  jdolecek branches: 1.2.2; 1.2.6;
add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.1 30-Aug-2000  jdolecek Switch to newvers_stand.sh-based boot block versioning. Add sensible 'version'
template, the boot block changes were picked from cvs annotates for Makefile
and boot.c.

Reviewed by Ragge.
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 03-Aug-2001  lukem update to -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 24-Sep-2000  bouyer file version was added on branch thorpej_scsipi on 2000-11-20 20:32:39 +0000
 1.3.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.4.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.18.1 03-Aug-2004  skrll Sync with HEAD
 1.4.2.2 09-Nov-2001  scw Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.4.2.1 09-Nov-2001  scw file version was added on branch nathanw_sa on 2001-11-09 19:53:16 +0000
 1.6.122.1 03-Dec-2017  jdolecek update from HEAD
 1.7.2.1 19-Mar-2016  skrll Sync with HEAD
 1.2 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.1 24-Feb-2002  matt branches: 1.1.2; 1.1.8; 1.1.170; 1.1.190;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1.190.1 28-Aug-2017  skrll Sync with HEAD
 1.1.170.1 03-Dec-2017  jdolecek update from HEAD
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file romread.S was added on branch kqueue on 2002-03-16 16:00:11 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file romread.S was added on branch nathanw_sa on 2002-02-28 04:12:27 +0000
 1.3 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.2 20-May-2000  ragge branches: 1.2.8; 1.2.12;
New arguments to the rom routines. Adapt srt0 to new world also.
 1.1 06-Mar-1999  ragge branches: 1.1.8;
New boot program for vax. Appearance similar to the i386 boot blocks.
 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 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 16-Mar-2002  jdolecek Catch up with -current.
 1.6 19-Mar-2018  ragge Do not use movc3 to copy boot program, it may be larger than 64k.
 1.5 22-May-2017  ragge branches: 1.5.2; 1.5.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.4 02-Dec-2002  ragge branches: 1.4.156; 1.4.176;
Revert Jason's changes to the boot startup code:
- All regs must be saved before any register is altered.
- movc{3,5} alters r0-r5, so clearing bss would clear the text instead.
This needs more thinking/testing to get it work correct; there are
different ways different CPUs call "boot".
 1.3 05-Nov-2002  thorpej Only skip the copy if we are already relocated; always clear
the BSS.
 1.2 31-Mar-2002  matt branches: 1.2.4;
Make ddb symbol loading work for ELF as well a.out.
 1.1 24-Feb-2002  matt branches: 1.1.2; 1.1.8;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1.8.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file srt0.S was added on branch kqueue on 2002-03-16 16:00:11 +0000
 1.1.2.5 11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.4 11-Nov-2002  nathanw Catch up to -current
 1.1.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file srt0.S was added on branch nathanw_sa on 2002-02-28 04:12:27 +0000
 1.2.4.2 12-Dec-2002  he Pull up revision 1.4 (requested by thorpej in ticket #1032):
Revert the effects of the previous pull-up, it has undesireable
and unintended side-effects.
 1.2.4.1 11-Dec-2002  he Pull up revision 1.3 (requested by thorpej in ticket #964):
Only skip the copy if we are already relocated; always
clear the BSS.
 1.4.176.1 28-Aug-2017  skrll Sync with HEAD
 1.4.156.1 03-Dec-2017  jdolecek update from HEAD
 1.5.8.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.5.2.1 24-Mar-2018  snj Pull up following revision(s) (requested by ragge in ticket #656):
sys/arch/vax/boot/common/srt0.S: 1.6
Do not use movc3 to copy boot program, it may be larger than 64k.
 1.10 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.9 18-Feb-2002  matt Add code to pass symbol table from loadfile to kernel.
 1.8 01-Nov-2000  ragge branches: 1.8.4; 1.8.8;
Start address must be == 0, otherwise loading on some MicroVAXen will
fail (boot program loaded at address 0 anyway, but tries to start at
the compiled entry point).
 1.7 19-Jul-2000  matt Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.6 13-Jul-2000  matt Use <machine/asm.h>. (e.g. prepare for ELF)
 1.5 10-Jul-2000  ragge Save registers for eventually later usage.
Use REI to clear pipes after code copy.
 1.4 24-May-2000  ragge Four more instructions makes it possible to boot old kernels also.
 1.3 20-May-2000  ragge New arguments to the rom routines. Adapt srt0 to new world also.
 1.2 23-May-1999  ragge branches: 1.2.2;
Use common routines to identify cpu type.
Set up a SCB to be able to handle clock interrupts in the boot program.
Now timer countdown should work on all types of vaxen.
 1.1 06-Mar-1999  ragge branches: 1.1.4;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.2.2 22-Nov-2000  bouyer Sync with HEAD.
 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.8.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.8.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.6 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.5 11-Dec-2005  christos branches: 1.5.122; 1.5.142;
merge ktrace-lwp.
 1.4 01-Nov-2003  jdolecek rename local index() to strchr()
 1.3 07-Oct-2003  ragge The last commit broke the boot code (memset may be larger than 64k).
Johnny Billquist fixed it and bugfixed some routines.
 1.2 04-Sep-2003  dsl Add memcmp, memcpy and memset
Fix strncmp(x, y, 0)
Use unsigned compares for strcmp and memcmp (and bcmp).
Compiles but untested
AFAICT http://h71000.www7.hp.com/doc/72final/4515/4515pro_025.html#4515ch9_146
cmpc3/5 set %r4 and %r5 to zero, It doesn't look as though the procedure
call is set to preserve these, and I doubt that gcc is treating them as
scratch registers - does our vax pcs actually have %r2 and %r3 as scratch regs?
 1.1 24-Feb-2002  matt branches: 1.1.2; 1.1.8; 1.1.20;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.20.1 03-Aug-2004  skrll Sync with HEAD
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file str.S was added on branch kqueue on 2002-03-16 16:00:12 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file str.S was added on branch nathanw_sa on 2002-02-28 04:12:27 +0000
 1.5.142.1 28-Aug-2017  skrll Sync with HEAD
 1.5.122.1 03-Dec-2017  jdolecek update from HEAD
 1.4 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.3 13-Jul-2000  matt branches: 1.3.4; 1.3.8;
Use <machine/asm.h>. (e.g. prepare for ELF)
 1.2 22-Apr-2000  ragge Fix boot block countdown on 4000/60. Easy to add for other 4000 machines also.
 1.1 06-Mar-1999  ragge branches: 1.1.8;
New boot program for vax. Appearance similar to the i386 boot blocks.
 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.3.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.22 15-Sep-2020  mrg make build (and run) with GCC 9.
 1.21 11-Dec-2005  christos merge ktrace-lwp.
 1.20 11-Dec-2003  matt Rework things to move common stuff into Makefile.inc.
 1.19 09-Dec-2003  matt Make sure to include <bsd.own.mk> to pick up the definition of HAVE_GCC3
 1.18 08-Dec-2003  matt Move common CFLAGS/AFLAGS to Makefile.inc.
For now, only suppy -mno-asm-pic when not using gcc3.
 1.17 04-Feb-2003  matt branches: 1.17.2;
Add CPPFLAGS=-D__daddr_t=int32_t to shrink primary boot block.
 1.16 05-Nov-2002  thorpej Add -mno-asm-pic to CFLAGS and AFLAGS.
 1.15 15-Jun-2002  matt Make sure to cleanup the ${PROG}.out files
 1.14 09-Jun-2002  matt Add -ffreestanding and LIBC= to stand/boot/*/Makefile. Fix various
asm's to work with gcc-current.
 1.13 29-Mar-2002  matt branches: 1.13.2; 1.13.4;
Add a xxboot_ustarfs for floppies.
 1.12 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.11 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.10 03-May-2001  matt branches: 1.10.2; 1.10.8;
change to let make obj work right with MAKEOBJDIRPREFIX and read-only source
 1.9 19-Jul-2000  matt branches: 1.9.2;
Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.8 03-Jul-2000  matt Make cross-compile friendly
 1.7 19-Jun-2000  matt Rename ncr[5380] device to si to more consistent with other ports.
Add VAX660 to cputype.h. Remove needs-flag from si & asc entries.
 1.6 22-May-2000  matt branches: 1.6.2;
get rid of a double /
 1.5 20-May-2000  ragge Rewriting of the VAX boot block. Differences:

- Use the RPB for passing boot device info up to kernel, instead of the
old BSD "hack" with an encoded longword (see sys/reboot.h for details)
- Instead of separate drivers for all devices, use the HW-provided ROM
routines as much as possible.
- Add filesystem support for CD9660 also (now when there is space).
- Make everything compile with WARNS=1.

The boot block is now <7K in size and have support for UFS, CD9660 and USTAR.
 1.4 18-Apr-2000  matt Compile -Os instead of -O2 (optimize for space).
 1.3 16-Apr-2000  matt Use objcopy to emit the binary and linked around for debugging.
 1.2 23-Oct-1999  ragge Boot block code fixed to 1) understand SCSI disks and 2) read from a
ustar filesystem (used in installation).
 1.1 06-Mar-1999  ragge branches: 1.1.8; 1.1.10; 1.1.12;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.10.1 15-Nov-1999  fvdl Sync with -current
 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.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.8.6 11-Nov-2002  nathanw Catch up to -current
 1.10.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.10.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.10.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.10.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.10.8.1 03-May-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:29 +0000
 1.10.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.10.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.4.2 26-Jan-2003  jmc Pullup revisions 1.13-1.14 and 1.15-1.16 (requested by he in ticket #1072)
Add -mno-asm-pic to CFLAGS and AFLAGS, and add -ffreestanding and
empty LIBC setting to bootloader Makefiles.
 1.13.4.1 18-Jun-2002  lukem Pull up revision 1.15 (requested by matt in ticket #287):
Make sure to cleanup the ${PROG}.out files
 1.13.2.1 15-Jul-2002  gehenna catch up with -current.
 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.2 16-Apr-2000  matt This should have never been checked in. it's what this directory is supposed
to make. opps.
 1.1 06-Mar-1999  ragge branches: 1.1.8;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.8.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.39 25-Apr-2022  mlelstv libsa now needs ioctl support to handle media with large sectors.
Provide dummy functions.
 1.38 01-May-2018  ragge Enable ffsv2 in boot.
 1.37 28-Jun-2013  matt branches: 1.37.32;
ufs -> ffsv1 (ffsv2 is commentout due to size limitations)
 1.36 18-Sep-2009  mhitch branches: 1.36.12; 1.36.22;
Explicitly include sys/exec_aout.h.
 1.35 23-Mar-2009  tsutsui Revert kludge in previous.
The warning was triggered by __builtin_memcpy() on vax, and
it has been disabled in libkern.h for _STANDALONE programs.
 1.34 19-Mar-2009  he It seems gcc is unhappy about a literal 0 as a pointer argument
to memcpy(). Work around that by using a local variable instead.
(This looks a bit dubious, but who am I to judge the restrictions
in the standalone environment on the vax -- this should not change
the semantics of what was here before.)
 1.33 18-Mar-2009  cegger bcopy -> memcpy
 1.32 18-Mar-2009  cegger bzero -> memset
 1.31 18-Mar-2009  cegger bcmp -> memcmp
 1.30 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.29 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.28 05-Mar-2007  christos branches: 1.28.44; 1.28.52; 1.28.58;
another caddr_t botch
 1.27 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 01-Jul-2006  mrg branches: 1.26.10;
fix pointer signedness and build with GCC4.
 1.25 08-Jun-2006  he branches: 1.25.2;
Get rid of another instance of an lvalue cast.
 1.24 08-Mar-2006  sekiya branches: 1.24.4;
The network bootloader entry point should be nisse(), not start(). Fixes a
very long-standing netboot issue.

Patch contributed by Hans Rosenfeld.
 1.23 27-Jan-2006  he branches: 1.23.2; 1.23.4; 1.23.6; 1.23.8;
Track latest changes elsewhere: free() is now dealloc(), and alloc/dealloc
size argument is now a size_t.
 1.22 24-Dec-2005  perry branches: 1.22.2;
bare asm -> __asm
 1.21 11-Dec-2005  christos merge ktrace-lwp.
 1.20 27-Jun-2005  junyoung branches: 1.20.2;
Use the form of #include <...> rather than #include "..." for headers of
which paths don't start from the current directory.
 1.19 27-Jun-2005  junyoung Remove trailing spaces.
 1.18 06-Jan-2004  matt Add proper boot/autoconf support for SDN devices. Take from Hugh Graham;
see http://mail-index.netbsd.org/port-vax/2002/06/28/0005.html
 1.17 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.16 29-Mar-2002  matt branches: 1.16.10;
Add a xxboot_ustarfs for floppies.
 1.15 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.14 09-Nov-2000  matt branches: 1.14.4; 1.14.8;
Fix a thinko or two i made a few days ago. I could have sworn i compiled
this. :)
 1.13 03-Nov-2000  simonb Use the canonical RF_PROTECTED_SECTORS #define hack.
 1.12 02-Nov-2000  matt Add code to read the disklabel and add the beginning offset for A. Add
support for booting off a RAID root parition.
 1.11 19-Jul-2000  matt Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.10 10-Jul-2000  ragge Add code that allows the boot blocks to be loaded by VMB.EXE, and
also have optional MTPR printf available.
 1.9 04-Jun-2000  ragge branches: 1.9.2;
Adapt to mba changes. Fix assembler buf (EDIV uses 64-bit arg, not 32).
 1.8 23-May-2000  matt branches: 1.8.2;
Allow for boot.vax and netbsd.vax when booting. this allows a multi
architecture CD to be made which includes VAX support.
 1.7 21-May-2000  ragge 11/750 fixes:
- Set the correct adapter address in RPB for Unibus devices.
- Repair the disk read routines for HP disks. ROM routines do not work
on HP disks, therefore use a small home-written routine.
 1.6 20-May-2000  ragge Rewriting of the VAX boot block. Differences:

- Use the RPB for passing boot device info up to kernel, instead of the
old BSD "hack" with an encoded longword (see sys/reboot.h for details)
- Instead of separate drivers for all devices, use the HW-provided ROM
routines as much as possible.
- Add filesystem support for CD9660 also (now when there is space).
- Make everything compile with WARNS=1.

The boot block is now <7K in size and have support for UFS, CD9660 and USTAR.
 1.5 22-Apr-2000  ragge Recognize RL02 as boot device.
 1.4 18-Apr-2000  ragge Handle NCR5394 SCSI as NCR5380. (Doesn't matter, it will use the ROM
routines anyway).
 1.3 16-Apr-2000  matt Add missing cases for MARIAH/SOC/NVAX and fix a comment or two.
 1.2 23-Oct-1999  ragge Boot block code fixed to 1) understand SCSI disks and 2) read from a
ustar filesystem (used in installation).
 1.1 06-Mar-1999  ragge branches: 1.1.8; 1.1.10; 1.1.12;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.10.1 15-Nov-1999  fvdl Sync with -current
 1.1.8.2 22-Nov-2000  bouyer Sync with HEAD.
 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.8.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.2.1 27-Jul-2000  matt Pullup revision 1.11
Add support for loading ELF 2nd stage bootstrap
 1.14.8.2 17-Apr-2002  nathanw Catch up to -current.
 1.14.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.14.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.16.10.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.16.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.10.1 03-Aug-2004  skrll Sync with HEAD
 1.20.2.3 03-Sep-2007  yamt sync with head.
 1.20.2.2 30-Dec-2006  yamt sync with head.
 1.20.2.1 21-Jun-2006  yamt sync with head.
 1.22.2.1 01-Feb-2006  yamt sync with head.
 1.23.8.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.23.6.3 11-Aug-2006  yamt sync with head
 1.23.6.2 26-Jun-2006  yamt sync with head.
 1.23.6.1 13-Mar-2006  yamt sync with head.
 1.23.4.1 22-Apr-2006  simonb Sync with head.
 1.23.2.1 09-Sep-2006  rpaulo sync with head
 1.24.4.1 19-Jun-2006  chap Sync with head.
 1.25.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.26.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.28.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.28.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.28.44.2 11-Mar-2010  yamt sync with head
 1.28.44.1 04-May-2009  yamt sync with head.
 1.36.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.36.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.37.32.1 02-May-2018  pgoyette Synch with HEAD
 1.7 06-Apr-2020  snj fix comment in typo
 1.6 22-May-2017  ragge branches: 1.6.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.5 04-Apr-2013  martin branches: 1.5.12;
Rearrange primary bootstrap slightly to free up all space between the disk
label and the uVAX rom boot parameter block.
 1.4 11-Dec-2005  christos branches: 1.4.88; 1.4.112; 1.4.118; 1.4.122;
merge ktrace-lwp.
 1.3 21-Oct-2005  he Make it possible to use <sys/disklabel.h> from assembly source by
introducing OMIT_DKTYPENUMS and OMIT_FSTYPENUMS, which omits the
declaration of the enums. Use this in the vax boot code to make
it build again. Also use __CONCAT() instead of ##.
 1.2 10-Nov-2003  wiz branches: 1.2.16; 1.2.18;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.1 24-Feb-2002  matt branches: 1.1.2; 1.1.8; 1.1.20;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1.20.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.20.1 03-Aug-2004  skrll Sync with HEAD
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file start.S was added on branch kqueue on 2002-03-16 16:00:12 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file start.S was added on branch nathanw_sa on 2002-02-28 04:12:28 +0000
 1.2.18.1 26-Oct-2005  yamt sync with head
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4.122.2 03-Dec-2017  jdolecek update from HEAD
 1.4.122.1 23-Jun-2013  tls resync from head
 1.4.118.1 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.4.112.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.88.1 12-Jun-2013  msaitoh Pull up following revision(s) (requested by martin in ticket #1856):
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-1.15
Rearrange primary bootstrap slightly to free up all space between the disk
label and the uVAX rom boot parameter block.
Calculate the disklabel size (for asm code) dynamically based on MAXPARTITIONS.
Adapt to new vax primary bootstrap layout.
Fix installboot for VAX, as discussed on port-vax. Problem pointed out
by Jonny Billquist, thanks to Marl Pizzolato for patiently explaining
the various ways of booting a vax to me.
Now VAX 780 can boot directly from VMB.EXE again.
Provide an empty __CTASSERT() for toolbuilds
 1.5.12.1 28-Aug-2017  skrll Sync with HEAD
 1.6.10.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.12 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.11 02-Nov-2000  matt branches: 1.11.4; 1.11.8;
Add code to read the disklabel and add the beginning offset for A. Add
support for booting off a RAID root parition.
 1.10 19-Jul-2000  matt Add support for loading a 2nd stage boot in either a.out or ELF.
Add support for loading a 2nd stage boot directly to it's desired address
if possible.
cleanup use of u_int/size_t.
 1.9 13-Jul-2000  matt Use <machine/asm.h>
 1.8 10-Jul-2000  ragge Add code that allows the boot blocks to be loaded by VMB.EXE, and
also have optional MTPR printf available.
 1.7 19-Jun-2000  ragge Variable "from" must be in first block read from disk, otherwise it will be
overwritten on non-VMB machines.
 1.6 17-Jun-2000  matt Adjust this a bit so that the primary entry point is 0x200, not 0x0a.
 1.5 22-May-2000  matt branches: 1.5.2;
cpp can be so annoying. to appease it, can't -> cannot
 1.4 21-May-2000  ragge On the 11/750, the stack will be placed by ROM in the code area.
Start with moving it to a safe place.
 1.3 20-May-2000  ragge Rewriting of the VAX boot block. Differences:

- Use the RPB for passing boot device info up to kernel, instead of the
old BSD "hack" with an encoded longword (see sys/reboot.h for details)
- Instead of separate drivers for all devices, use the HW-provided ROM
routines as much as possible.
- Add filesystem support for CD9660 also (now when there is space).
- Make everything compile with WARNS=1.

The boot block is now <7K in size and have support for UFS, CD9660 and USTAR.
 1.2 23-Oct-1999  ragge Boot block code fixed to 1) understand SCSI disks and 2) read from a
ustar filesystem (used in installation).
 1.1 06-Mar-1999  ragge branches: 1.1.8; 1.1.10; 1.1.12;
New boot program for vax. Appearance similar to the i386 boot blocks.
 1.1.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.10.1 15-Nov-1999  fvdl Sync with -current
 1.1.8.2 22-Nov-2000  bouyer Sync with HEAD.
 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.5.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.11.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.11.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.9 15-Sep-2020  mrg make build (and run) with GCC 9.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 11-Dec-2003  matt Rework things to move common stuff into Makefile.inc.
 1.6 09-Dec-2003  matt Make sure to include <bsd.own.mk> to pick up the definition of HAVE_GCC3
 1.5 08-Dec-2003  matt Move common CFLAGS/AFLAGS to Makefile.inc.
For now, only suppy -mno-asm-pic when not using gcc3.
 1.4 05-Nov-2002  thorpej branches: 1.4.6;
Add -mno-asm-pic to CFLAGS and AFLAGS.
 1.3 15-Jun-2002  matt branches: 1.3.2;
Make sure to cleanup the ${PROG}.out files
 1.2 09-Jun-2002  matt Add -ffreestanding and LIBC= to stand/boot/*/Makefile. Fix various
asm's to work with gcc-current.
 1.1 29-Mar-2002  matt branches: 1.1.2; 1.1.4; 1.1.6;
Add a xxboot_ustarfs for floppies.
 1.1.6.2 26-Jan-2003  jmc Pullup revisions 1.1-1.2 and 1.3-1.4 (requested by he in ticket #1072)
Add -mno-asm-pic to CFLAGS and AFLAGS, and add -ffreestanding and
empty LIBC setting to bootloader Makefiles.
 1.1.6.1 18-Jun-2002  lukem Pull up revision 1.3 (requested by matt in ticket #287):
Make sure to cleanup the ${PROG}.out files
 1.1.4.1 15-Jul-2002  gehenna catch up with -current.
 1.1.2.4 11-Nov-2002  nathanw Catch up to -current
 1.1.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.1.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.1 29-Mar-2002  nathanw file Makefile was added on branch nathanw_sa on 2002-04-17 00:04:38 +0000
 1.3.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.1 15-Jun-2002  jdolecek file Makefile was added on branch kqueue on 2002-06-23 17:42:58 +0000
 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.4 06-Jan-2003  lukem Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile. Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
 1.3 26-Oct-1994  cgd branches: 1.3.50;
new RCS ID format.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 19-Apr-1993  cgd compile needs to be kept in the distribution
 1.3.50.1 07-Jan-2003  thorpej Sync with HEAD.
 1.1 06-Jan-2003  lukem branches: 1.1.2;
Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile. Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
 1.1.2.2 07-Jan-2003  thorpej Sync with HEAD.
 1.1.2.1 06-Jan-2003  thorpej file Makefile was added on branch nathanw_sa on 2003-01-07 21:23:45 +0000
 1.2 02-Mar-1996  ragge All devices can now be in GENERIC.
 1.1 29-Mar-1995  ragge All supported devices.
 1.220 29-Jun-2024  rin vax: GENERIC: Enable some features useful for full ATF runs:

- PUFFS and putter
- crypto and swcrypto
 1.219 12-Feb-2023  abs Add optoion GENERIC.local include to the end of ~all GENERIC configs

This excludes atari, sgimips, evbmips, evbppc, evbsh3, and hpcarm
all of which have somewhat specific kernel config file layouts
 1.218 11-Feb-2023  tsutsui Add comments that "options VAX410" also supports VS3100/m30,m38,m40,m48.
 1.217 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.216 29-Sep-2022  riastradh branches: 1.216.4;
swwdog(4): Add to GENERIC kernels.

Plus a handful of others that I'm familiar with. Lots of special-
purpose kernels should probably have this too but I'm not going
through all the arm, mips, and ppc evaluation board kernels to see
which ones are relevant.

Omitted from systems I know to be very small:
- sun2/GENERIC
- dreamcast/GENERIC
Feel free to remove it from others that need to be kept smaller.

Compile-tested a few of these just in case:
- alpha/GENERIC
- amd64/GENERIC
- evbmips/OCTEON
- i386/GENERIC
- riscv/GENERIC

PR kern/29702
 1.215 07-Aug-2022  simonb UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.
 1.214 27-Sep-2020  roy vether: Add to kernel configurations

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.213 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.212 20-Jan-2020  thorpej Remove FDDI support.
 1.211 24-May-2019  msaitoh branches: 1.211.4;
Add il(4). Commented out.
 1.210 26-Apr-2019  sevan Enable BUFQ_PRIOCSCAN, CARP, Veriexec by default in GENERIC kernel configs.
On ports without a GENERIC kernel config enable in individul files, e.g evbmips.
Omit on:
atari, dreamcast, emips, epoc32, evbppc/VIRTEX*, ia64, luna68x, mvme68k,
mvmeppc, playstation2, riscv, sun2, sun3, x68k, zaurus due to resource
constraints or port infancy.
 1.209 13-Apr-2019  isaki Add drvctl to kernel which has audio device.
audiocfg(1) requires drvctl(4).
 1.208 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.207 29-Dec-2018  maxv Disable compat_ibcs2, it is being retired.
 1.206 01-Aug-2018  maxv Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
 1.205 25-Apr-2018  ragge branches: 1.205.2;
Enable CPU_IN_CKSUM.
 1.204 23-Jan-2018  sevan branches: 1.204.2;
Alternate buffer queue strategies no longer considered experimental, update
description.

Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
 1.203 14-Sep-2017  mrg clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
 1.202 13-Sep-2017  sevan Remove support for VERIFIED_EXEC_FP_RMD160, VERIFIED_EXEC_FP_SHA1, and VERIFIED_EXEC_FP_MD5 options.
These algorithms are either broken or on their way to being broken.

Discussed on tech-security
http://mail-index.netbsd.org/tech-security/2017/08/21/msg000936.html

ok riastradh
 1.201 04-Aug-2017  maxv typos
 1.200 27-Dec-2016  flxd branches: 1.200.8;
Fix TC adaptor's CSR address.
Add "PMAD" LANCE TC Ethernet.
 1.199 13-Dec-2016  christos wildcard speaker attachments, now that we can handle many of them.
 1.198 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.197 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.196 08-Aug-2015  maxv branches: 1.196.2;
Remove KMEMSTATS.
 1.195 20-Dec-2014  jklos Enable lcg0 framebuffer support for VAXstation 4000/30, 60, 90 and friends.
 1.194 19-Dec-2014  jklos Add audio support for VAXstation VLC, 60 and 90 machines. Originally rom
Blaz Antonic and ported from OpenBSD by Björn Johannesso. Tested on VLC
and 4000/60.
 1.193 16-Nov-2014  manu branches: 1.193.2;
Remove unused extended attributes kernel options

As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate
 1.192 12-Nov-2014  manu Support for UFS1 extended attributes in GENERIC and GENERIC-like kernels

This change just brings UFS1 extended attribute *support* in the kernel,
extended attributes are not enabled unless three conditions are met:
1) filesystem is UFS1 (newfs -O1)
2) .attribute/system and .attribute/user directories are created at fs root
3) filesystem is mounted with -o extattr

Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
 1.191 23-Aug-2014  dholland Systematize (and in many cases, fix) the comments on options COMPAT_NN.

There are quite a few configs that are missing some COMPAT_NN options
in ways that don't make sense; this should probably get cleaned up
too, but for the time being I've not added or removed anything.
 1.190 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.189 30-Jun-2013  rmind branches: 1.189.6;
G/C PFIL_HOOKS from the kernel configs.
 1.188 05-Jun-2013  christos branches: 1.188.2;
remove obsolete networking options
 1.187 27-Apr-2013  christos the bogus number police
 1.186 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.185 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.184 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.183 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.182 22-Jun-2012  abs branches: 1.182.2;
- Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number
 1.181 05-Jun-2012  abs If a port is going to have wscons for virtual terminals then it really makes
sense to enable WSDISPLAY_COMPAT_USL so the system can switch between the
virtual terminals...
 1.180 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.179 18-Dec-2011  dholland branches: 1.179.2;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.178 22-Nov-2011  tls branches: 1.178.2;

The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself. Move it to std. This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports. Thanks to Havard Eidnes for
pointing them out.
 1.177 30-Jun-2011  wiz branches: 1.177.2;
dependant -> dependent
 1.176 06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.175 08-Aug-2010  chs branches: 1.175.2; 1.175.4;
enable DDB_HISTORY_SIZE since DDB is enabled.
 1.174 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.173 08-May-2010  mrg enable IPFILTER_COMPAT in all kernels that have ipfilter already.
canonicalise several of the ipf option segments in various files
(this mostly means adding commented out IPFILTER_DEFAULT_BLOCK,
or adding commented or uncommented IPFILTER_LOG or IPFILTER_LOOKUP
option statements.)

i built about 20 of these kernels to check, but not all of them.
 1.172 29-Apr-2010  chs enable TMPFS in all GENERICs that have MFS enabled.
 1.171 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.170 24-Jan-2009  mrg branches: 1.170.4; 1.170.6;
add COMPAT_50 to all the configs with COMPAT_40.
 1.169 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.168 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.167 12-Aug-2008  hans branches: 1.167.2;
Add new accelerated driver for SPX graphics found in some VAXstations,
remove old broken lcspx driver. This is a bugfixed and refactored
version of the spx driver originally developed by Blaz Antonic in 2005.
OK'ed by mhitch.
 1.166 10-Aug-2008  tls Add accept filters to GENERIC kernels where they exist.
 1.165 31-Jul-2008  simonb Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.164 30-May-2008  tsutsui branches: 1.164.4;
Add options COMPAT_40 to files which have options COMPAT_30.
 1.163 15-Mar-2008  matt branches: 1.163.2; 1.163.4; 1.163.6;
Comment out xmi and nmi devices.
 1.162 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.161 03-Feb-2008  matt branches: 1.161.2; 1.161.6;
Preliminatry TC support.
 1.160 31-Dec-2007  ad Remove systrace. Ok core@.
 1.159 04-Nov-2007  xtraeme branches: 1.159.2; 1.159.8;
Remove System V semaphores and share memory options to set the limits:
SEMMNI, SEMMNS, SEMUME and SHMMAXPGS.

They can be tweaked via sysctl now. Ports that were setting values on
them weren't touched, I only removed the ones that were commented out.
 1.158 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.157 04-Jun-2007  martin branches: 1.157.8; 1.157.10; 1.157.14;
Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.156 11-Nov-2006  jmmv branches: 1.156.2; 1.156.8; 1.156.10; 1.156.16; 1.156.18;
Remove tmpfs's experimental status. OK'ed by core@.
 1.155 26-Aug-2006  christos branches: 1.155.2; 1.155.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.154 26-Aug-2006  tsutsui Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.153 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.152 28-Jun-2006  liamjfoy branches: 1.152.2;
Add CARP to GENERIC kernel configs. CARP is not enabled by default.

ok: christos
 1.151 28-Mar-2006  pavel branches: 1.151.4;
Add stf to all kernel configs which have INET6 and gif, except the INSTALL
ones and those for specific machines of developers. PR 32304.

OK'ed by rpaulo.

N.B. stf is a cloning device, so it still must be enabled by
"ifconfig stf0 create".
 1.150 05-Feb-2006  cube branches: 1.150.2; 1.150.4; 1.150.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.149 04-Feb-2006  rpaulo bpfilter is already supported.
 1.148 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.147 02-Feb-2006  reinoud branches: 1.147.2;
Add commented out UDF file-system entry in all GENERIC configurations.
 1.146 20-Dec-2005  thorpej branches: 1.146.2; 1.146.4;
Remove the tablet line discipline.
 1.145 09-Dec-2005  elad Add (commented out) Veriexec options and pseudo-device to GENERIC kernels,
and remove the i386 GENERIC_VERIEXEC config.
 1.144 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.143 03-Nov-2005  chs turn off DEBUG and DIAGNOSTIC in GENERIC kernels so that they
are compatible with the LKMs that are part of the release.
 1.142 10-Oct-2005  hubertf Find second qe interface, taken from the INSTALL file.
Reported by someone on IRCnet #NetBSD.
 1.141 10-Sep-2005  jmmv Initial addition of tmpfs, an efficient memory file-system. This project
was developed as part of Google's Summer of Code 2005 program. This
change adds the kernel code, the mount_tmpfs utility, a regression test
suite and does all other related changes to integrate these.

The file-system is still *experimental*. Therefore, it is disabled by
default in all kernels. However, as typically done, a commented-out
entry is added in them to ease its setup.

Note that I haven't commited the required mountd(8) changes to be able
to export tmpfs file-systems because NFS support is still very unstable
and because, before enabling it, I'd like to do some other changes.

OK'ed by my project mentor, William Studenmund (wrstuden@).
 1.140 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.139 19-Aug-2005  christos 64 bit inode changes.
 1.138 31-Jul-2005  yamt revert "defflag VMSWAP" changes for now.
there seems to be far more people who don't want to edit
their kernel config files than i thought.
 1.137 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.136 17-Jul-2005  hubertf Add support for reading cloop2 compressed filesystem image,
enable by putting VND_COMPRESSION into kernel config file.
Written by Cliff Wright, polished up slightly by me.
 1.135 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.134 25-Jun-2005  rpaulo branches: 1.134.2;
Add file-system PTYFS (commented out) so that people know its existence.

Ok'ed by Christos Zoulas and Hubert Feyrer.
 1.133 09-Jun-2005  tsutsui - Rename options NEW_BUFQ_STRATEGY -> options BUFQ_READPRIO.
(still commented out)
- Add (also commented out) options BUFQ_PRIOCSCAN.

Suggested by perry and soda on tech-kern.
Please refer options(4) for details for these options.
 1.132 25-Feb-2005  simonb branches: 1.132.2;
Add COMPAT_20 (and COMPAT_16 in some cases) to kernel config files
that didn't have those options but had other earlier compat options.
 1.131 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.130 11-Feb-2005  dsl Add 'option FFS_SNAPSHOT' to most of the config files.
Commented out for kernels that appear to hace space constraints.
 1.129 31-Jan-2005  hannken Add file system snapshots to kernel configs.

- Ffs internal snapshots get compiled in unconditionally.

- File system snapshot device fss(4) added to all kernel configs that
have a disk. Device is commented out on all non-GENERIC kernels.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
 1.128 28-Jan-2005  rumble Sprinkle options UFS_DIRHASH on GENERIC kernels. It's presently
commented out and labeled experimental pending further review and
testing.
 1.127 17-Jan-2005  cube branches: 1.127.2;
Add tap(4) support to a random^Wcarefully chosen set of kernel configs.
All those kernels have a line for both tun and bridge, and if either is
commented out, tap is commented out also. With the exception of i386's
GENERIC_TINY.

XXX: we _need_ some way of making this more simple.
 1.126 10-Nov-2004  christos branches: 1.126.4;
Add COMPAT_BSDPTY to the rest of the config files.
 1.125 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.124 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.123 28-Jun-2004  bouyer Add options P1003_1B_SEMAPHORE
to all GENERIC-like kernel config files where SYSV* options were already
present (commented out if the SYSV* options are commented out).
Fix lib/25897 and lib/25898.
 1.122 26-Jun-2004  abs Add (commented out) ALTQ options to all GENERIC-like files
 1.121 22-Jun-2004  itojun have pf and pflog pseudo-device (commented out).
reviewed by matt, perry, christos
 1.120 18-Jun-2004  christos ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM
 1.119 16-Jun-2004  christos Add pseudo-device ptm on all the generic flavored kernels.
 1.118 19-Mar-2004  mhitch branches: 1.118.2;
Add commented-out entries for the VS4000/(60,VLC} LCG graphics.
Add the wsmux psuedo-device to allow the keyboard to attach to the
wsdisplay device when the wsdisplay device is not the console.
 1.117 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.116 14-Dec-2003  ragge TOPDOWN_VM is now mandatory on vax.
 1.115 19-Oct-2003  ragge Add lcspx console device driver.
 1.114 29-Aug-2003  ragge Add the qt driver to GENERIC.
 1.113 26-Apr-2003  ragge branches: 1.113.2;
Add pseudo-device ksyms.
 1.112 23-Mar-2003  ragge Add rf (RX01/02 floppy device driver)
 1.111 27-Feb-2003  perseant Make BRIDGE_IPF an option, and document it. Add it (commented) to GENERIC.
Let brconfig tell whether the bridge is using the ipfilter hook, or not.
 1.110 26-Feb-2003  ragge Enable USE_TOPDOWN_VM. This also makes it possible to use large address
spaces, so bump MAXDSIZ to 1GB.
 1.109 22-Nov-2002  wiz Fix typo (responsiness -> responsiveness).
 1.108 18-Oct-2002  junyoung Add NEW_BUFQ_STRATEGY (disabled by default).
 1.107 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.106 06-Oct-2002  provos add SYSTRACE; approved perry.
 1.105 01-Oct-2002  abs Enable PPP_* options for ppp
 1.104 01-Oct-2002  abs Enable ppp
 1.103 25-Sep-2002  martti Add one space between "#option" and "<tab>IPFILTER_DEFAULT_BLOCK"
 1.102 20-Sep-2002  martti Added (commented out) IPFILTER_DEFAULT_BLOCK.
 1.101 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.100 12-Sep-2002  ragge Add COMPAT_15 and COMPAT_16 and commented-out dmf.
 1.99 17-Jun-2002  lukem Enable "pseudo-device clockctl" in all kernels, except
installation related kernels (INSTALL* and RAMDISK*).
This enables rc.conf(5) $ntpd_chroot to be used "out of the box"
 1.98 07-Jun-2002  ragge Change the uba devices from "xx0" to "xx*". Even if they have an exact
csr there may be multiple uba's in a machine and therefore multiple
matches for devices.
 1.97 25-Apr-2002  atatat branches: 1.97.2; 1.97.4;
Add the INCLUDE_CONFIG_FILE option to all config files. In config
files that are generic (ie, GENERIC, GENERICSBC, GENERIC32, ALL, or
ALPHA), it is uncommented.
 1.96 12-Apr-2002  gmcgarry Add commented-out USERCONF option. Mainly useful for install media
and can be optionally enabled based on miniroot and ramdisk size
requirements.
 1.95 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.94 19-Jan-2002  oster Add new RF_* options for RAIDframe bits that are no longer built by default.

While we're here, enable RAIDframe (and RAID_AUTOCONFIG) by default for
architectures that I'm comfortable can deal with it being on by default.

Also: bump the number of 'raid' devices from 4 to 8, since 4 seems to
be insufficient in practise.
 1.93 28-Dec-2001  martin Add PPPoE to all generic kernels that should be able to use it.
XXX TODO: do this for INSTALL kernels too, add sysinst support and make the
XXX needed binaries available on the ramdisk root fs.
 1.92 14-Dec-2001  gmcgarry Add a blurb to the top of all GENERIC files. This serves three purposes:
- to clarify some terminology
- to clarify the intention of the GENERIC file
- to cross-reference some useful man pages
 1.91 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.90 01-Sep-2001  atatat branches: 1.90.6;
Add bridge pseudo devices to GENERIC configs
 1.89 30-Jun-2001  darcy branches: 1.89.2;
Add System V semaphore resource limits to each GENERIC file that has an
option for System V semaphores. It appears that there are no overrides
in the code and each file has the following added.

options SYSVSEM # System V semaphores
+#options SEMMNI=10 # number of semaphore identifiers
+#options SEMMNS=60 # number of semaphores in system
+#options SEMUME=10 # max number of undo entries per process
+#options SEMMNU=30 # number of undo structures in system
options SYSVSHM # System V shared memory

If anyone thinks that this is incorrect for any of these files, please
correct it.

Note - the i386 port was not forgotten. It was done separately.
 1.88 18-Feb-2001  ragge Support to control the leds on VAXstations, taken from Sun3 and ported
to vax by Shinmyoh Koji (yesu@rb3.so-net.ne.jp).
 1.87 05-Feb-2001  abs Add ipfilter, and a bunch of (commented out) network options.
 1.86 04-Feb-2001  ragge 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.85 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.84 19-Dec-2000  tsutsui Remove "rnd is EXPERIMENTAL" comments.
 1.83 19-Dec-2000  bouyer Add pseudo-device vlan
 1.82 02-Dec-2000  ragge Add lkkbd/lkms/fonts, remove lkc.
 1.81 04-Oct-2000  itojun enable rnd device. they are now mandatory for ssh/sshd support,
so it makes more sense to enable it.
please disable them if there's any issues, but in that case, in-tree
ssh/sshd won't work.
 1.80 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.79 26-Aug-2000  matt Reverse polarity on INSN_EMULATION to NO_INSN_EMULATION. Thus by default
all kernels will have instruction emulation.
 1.78 13-Aug-2000  itojun move "options PULLDOWN_TEST" into sys/sys/mbuf.h (in #ifdef _KERNEL),
as it is no wthe default setting for everyone.

the reason we still use the name "PULLDOWN_TEST" while it is now default:
kame code sharing.
 1.77 08-Aug-2000  ragge Write code to handle unimplemented instructions trapped via SCB vector 0x18.
This may happen on machines missing parts of the instruction set (like
some floating point formats).
Only one new instruction added; POLYD, so that the libm assembly files can
be used on architectures missing that instruction.
Also; include emulation code if compile-time option INSN_EMULATE is defined
instead of trying to match on which cputype it is.
N.B. POLYD isn't fully implemented, just enough to make libm happy.
 1.76 27-Jul-2000  mason Moving to a default of 64 PTYs.
 1.75 06-Jul-2000  ragge Add NMI and XMI outcommented, the same with VAX 6400 and VAX 8000.
 1.74 30-Jun-2000  itojun add PULLDOWN_TEST for all the platforms.
XXX should be moved to somewhere else when stabilized
 1.73 27-Jun-2000  ragge Add hdc controller and rd disks.
 1.72 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.71 19-Jun-2000  matt branches: 1.71.2;
Rename ncr[5380] device to si to more consistent with other ports.
Add VAX660 to cputype.h. Remove needs-flag from si & asc entries.
 1.70 14-Jun-2000  veego Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.69 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.68 31-May-2000  matt add placeholders for the MicroVAX 3400 (ka640).
 1.67 28-May-2000  matt Enable DDB.
 1.66 08-May-2000  ragge branches: 1.66.2;
Sorry, no KA680.
 1.65 08-May-2000  ragge Add 4000/200 and 4000/500.
 1.64 23-Apr-2000  matt Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.63 22-Apr-2000  ragge Add "rl" disk.
 1.62 21-Apr-2000  matt enable in-kernel NTP (so xntpd doesn't die).
 1.61 19-Apr-2000  itojun add stf pseudo interface (commented out due to possible security risks)
 1.60 09-Mar-2000  matt add VS400 scsi attachment + a few other things
 1.59 29-Feb-2000  simonb Do the "<space><tab>" thing with the RAID_AUTOCONFIG option.
 1.58 26-Feb-2000  oster Defopt 'RAID_AUTOCONFIG'. Adding 'options RAID_AUTOCONFIG' turns on
the component auto-detection and auto-configuration of RAID sets.
Also, add "#options RAID_AUTOCONFIG" to the GENERIC config files.
 1.57 23-Jan-2000  hubertf Add commented out "ident"-command
 1.56 20-Jan-2000  wrstuden Add overlay to kernel configs.
 1.55 13-Jan-2000  matt Enable IBCS2 (DEC SVR3) compatibility.
 1.54 21-Nov-1999  itojun bring in content of GENERIC.v6 into GENERIC.
remove GENERIC.v6 file (as it is part of GENERIC now).

"faith" interface is commented out by default as it is not really for
general use.
IPsec items are commented out as well, though we can enable "options IPSEC"
without export-related issue ("options IPSEC" will enable authentication
portion only). We may need to think about it again.

if you have problem compiling with INET6 on archs I do not have access to,
please contact me.

XXX what to do with arch/arm32/SHARK{,.v6}?
 1.53 15-Nov-1999  fvdl Add commented out option SOFTDEP to all GENERIC kernels.
 1.52 13-Nov-1999  matt Nuke TCP_COMPAT_42. Use sysctl to set it as needed instead.
 1.51 27-Aug-1999  ragge branches: 1.51.2; 1.51.4; 1.51.8;
Support for 4000/90.
 1.50 14-Aug-1999  ragge Support for ibus-attached LANCE.
 1.49 08-Aug-1999  ragge Add support for the SGEC.
 1.48 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.47 04-Aug-1999  ragge For now; don't include the devices that are not yet converted.
 1.46 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.45 26-Mar-1999  ragge branches: 1.45.2; 1.45.4;
Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.44 13-Mar-1999  ragge 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.43 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.42 10-Dec-1998  ragge Use vt100 console emulation instead of sun. :-)
 1.41 25-Nov-1998  hwr Add (commented out) 'gre' pseudo device line. Feedback is welcome.
Inspired by Klaus Klein.
 1.40 16-Nov-1998  oster Added a (commented out) configuration line for the RAIDframe device driver.
 1.39 16-Nov-1998  mrg move vax "options UVM" from GENERIC to std.vax
 1.38 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.37 06-Oct-1998  matt 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.36 21-Aug-1998  ragge VAX logical page size increased to 4k.
 1.35 18-Jul-1998  ragge Fix PMAP_NEW and make it the default.
 1.34 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.33 07-Jun-1998  ragge UVM default on vax for now.
 1.32 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.31 22-May-1998  ragge Remove unneccessary file. Remove stale dependency. Disable not-working
devices by default.
 1.30 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.29 18-Mar-1998  bouyer Add commented out "options FFS_EI"
 1.28 08-Feb-1998  ragge Split out MSCP floppies as a separate device (rx) instead of handling
them as disk drives. It is now also allowed to change floppies without
the system complaining :-)
 1.27 01-Dec-1997  kleink Add COMPAT_13.
 1.26 20-Nov-1997  fair add pseudo-device rnd, commented out
 1.25 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.24 23-Aug-1997  mjacob branches: 1.24.4;
add a before tab to SCSIVERBOSE
 1.23 20-Aug-1997  mjacob add commented out reference SCSIVERBOSE option
 1.22 04-Feb-1997  ragge branches: 1.22.8;
Support for DL11 (-compatible) async ctlr.
Written by Ben Harris (bjh@mail.dotcom.fr).
 1.21 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.20 12-Jan-1997  ragge branches: 1.20.2;
std.vax readded, shall be here anyway.
 1.19 11-Jan-1997  ragge Add EXEC_AOUT and EXEC_SCRIPT. std.vax not needed anymore; removed.
 1.18 11-Jan-1997  mikel add 'pseudo-device ccd' where necessary; PR kern/1830.
 1.17 20-Aug-1996  ragge Add another parent bus for 11/750 (cmi). remove mtc.c.
 1.16 20-Jul-1996  ragge Update config files for VAX8200 and VAXstations.
 1.15 10-Jul-1996  ragge Add MSCP tape to this file.
 1.14 01-Jul-1996  ragge Update to match new MSCP device handling.
Remove support for old config system.
 1.13 19-May-1996  ragge Add DZ-11 to GENERIC & files.vax.
 1.12 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.11 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.10 02-Mar-1996  ragge Add VAX780 and DHU11 to the GENERIC file. Put the corresponding
file lines in files.vax.
 1.9 11-Feb-1996  ragge Add VAX650, mba, hp, ts. Change uba to be *'ed.
 1.8 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.7 05-Jul-1995  ragge branches: 1.7.2;
DDB file added.
 1.6 29-Mar-1995  ragge Support for tmscp tapes.
 1.5 23-Feb-1995  ragge Support for new CPU type (KA630 == uVAXII) added, tape driver.
 1.4 13-Feb-1995  ragge Program to make a fast convert from new to old config (Ugly!)
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge New filenames; changes applying to 1.o Beta
 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 GENERIC was added on branch netbsd-1-0 on 1994-08-02 20:19:22 +0000
 1.7.2.1 15-Oct-1995  ragge vmunix -> netbsd + some cleanup.
 1.20.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.22.8.2 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.22.8.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.24.4.1 20-Nov-1997  mellon Pull rev 1.26 up from trunk (fair)
 1.45.4.1 02-Aug-1999  thorpej Update from trunk.
 1.45.2.1 03-Jun-2000  he Apply patch (requested by he):
Disable the UNION file system, to avoid a repeat of the 1.4.1
and 1.4.2 LAST_MINUTE changes. It is reportedly buggy, and can
be used by ordinary users to crash the system.
 1.51.8.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.51.8.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.51.4.1 15-Nov-1999  fvdl Sync with -current
 1.51.2.5 12-Mar-2001  bouyer Sync with HEAD.
 1.51.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.51.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.51.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.51.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.66.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.71.2.7 01-May-2001  he Pull up revision 1.83-1.84 (requested by he):
Add pseudo-device vlan.
Make sure "rnd is EXPERIMENTAL" comment is removed.
 1.71.2.6 04-Oct-2000  itojun pullup (approved by releng-1-5)

enable rnd device. they are now mandatory for ssh/sshd support,
so it makes more sense to enable it.
please disable them if there's any issues, but in that case, in-tree
ssh/sshd won't work.

cvs rdiff -r1.166 -r1.167 syssrc/sys/arch/alpha/conf/GENERIC
cvs rdiff -r1.149 -r1.150 syssrc/sys/arch/amiga/conf/GENERIC
cvs rdiff -r1.11 -r1.12 syssrc/sys/arch/arm26/conf/GENERIC
cvs rdiff -r1.72 -r1.73 syssrc/sys/arch/atari/conf/GENERIC
cvs rdiff -r1.60 -r1.61 syssrc/sys/arch/hp300/conf/GENERIC
cvs rdiff -r1.10 -r1.11 syssrc/sys/arch/luna68k/conf/GENERIC
cvs rdiff -r1.35 -r1.36 syssrc/sys/arch/next68k/conf/GENERIC
cvs rdiff -r1.32 -r1.33 syssrc/sys/arch/ofppc/conf/GENERIC
cvs rdiff -r1.73 -r1.74 syssrc/sys/arch/sun3/conf/GENERIC
cvs rdiff -r1.80 -r1.81 syssrc/sys/arch/vax/conf/GENERIC
cvs rdiff -r1.52 -r1.53 syssrc/sys/arch/x68k/conf/GENERIC
 1.71.2.5 26-Aug-2000  matt Pullup approved by thorpej:
GENERIC 1.79, files.vax 1.76, intvec.s 1.56
>Reverse polarity on INSN_EMULATION to NO_INSN_EMULATION. Thus by default
>all kernels will have instruction emulation.
 1.71.2.4 14-Aug-2000  ragge Pull up (requested by ragge, approved by thorpej):

sys/arch/vax/conf/GENERIC 1.76-1.77
sys/arch/vax/conf/files.vax 1.74-1.75
sys/arch/vax/vax/intvec.s 1.54-1.55
sys/arch/vax/vax/unimpl_emul.s -1.2

This adds emulation code for the POLYD instruction that some VAX CPUs
are missing. POLYD is used for example in libm.
 1.71.2.3 11-Aug-2000  mason Move to default of 64 PTYs in GENERIC kernel config.
Requested by mason, approved by jhawk.
 1.71.2.2 28-Jun-2000  ragge Apply patch (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.71.2.1 23-Jun-2000  fvdl As on the trunk, update these for the move of ffs_softdep.c into the
kernel source itself. Remove prefix construction, and add the SOFTDEP
option to GENERIC kernels.
 1.89.2.6 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.89.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.89.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.89.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.89.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.89.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.90.6.9 11-Dec-2002  thorpej Sync with HEAD.
 1.90.6.8 11-Nov-2002  nathanw Catch up to -current
 1.90.6.7 18-Oct-2002  nathanw Catch up to -current.
 1.90.6.6 17-Sep-2002  nathanw Catch up to -current.
 1.90.6.5 20-Jun-2002  nathanw Catch up to -current.
 1.90.6.4 17-Apr-2002  nathanw Catch up to -current.
 1.90.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.90.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.90.6.1 01-Sep-2001  nathanw file GENERIC was added on branch nathanw_sa on 2002-01-08 00:28:30 +0000
 1.97.4.4 07-Dec-2002  he Pull up revisions 1.104-1.105 (requested by abs in ticket #889):
Enable ppp and PPP_* options.
 1.97.4.3 24-Oct-2002  lukem Pull up upgrade to IPfilter 3.4.29 (requested by martti in ticket #905).
Affected files & revisions:

dist/ipf/HISTORY 1.14
dist/ipf/fils.c 1.17-1.21
dist/ipf/ipf.c 1.11-1.13
dist/ipf/ipfs.c 1.8-1.10
dist/ipf/ipft_ef.c 1.6-1.7
dist/ipf/ipft_td.c 1.6-1.7
dist/ipf/ipft_tx.c 1.7-1.8
dist/ipf/ipmon.c 1.12-1.17
dist/ipf/ipnat.c 1.11-1.12
dist/ipf/ipsend/ip_var.h 1.2
dist/ipf/ipsend/ipsend.c 1.8
dist/ipf/ipsend/iptests.c 1.5
dist/ipf/ipt.c 1.8-1.10
dist/ipf/kmem.c 1.8-1.10
dist/ipf/man/ipf.4 1.10
dist/ipf/man/ipf.5 1.8
dist/ipf/man/ipftest.1 1.3
dist/ipf/man/ipmon.8 1.10
dist/ipf/man/ipnat.5 1.9-1.10
dist/ipf/man/ipnat.8 1.4
dist/ipf/misc.c 1.7
dist/ipf/natparse.c 1.10
dist/ipf/parse.c 1.13
dist/ipf/printnat.c 1.8-1.10
dist/ipf/relay.c 1.5-1.6
dist/ipf/rules/example.9 1.2
etc/rc.d/ipnat 1.8
regress/sys/kern/ipf/Makefile 1.3-1.4
regress/sys/kern/ipf/dotest6 1.2
regress/sys/kern/ipf/expected/f13 1.1.1.2
regress/sys/kern/ipf/expected/i12 1.1.1.1
regress/sys/kern/ipf/expected/ni3 1.1.1.1
regress/sys/kern/ipf/expected/ni5 1.2
regress/sys/kern/ipf/input/f13 1.1.1.2
regress/sys/kern/ipf/input/ipv6.1 1.1.1.1
regress/sys/kern/ipf/input/ni3 1.1.1.1
regress/sys/kern/ipf/regress/i12 1.1.1.1
regress/sys/kern/ipf/regress/ipv6.1 1.1.1.1
regress/sys/kern/ipf/regress/ni3.ipf 1.1.1.1
regress/sys/kern/ipf/regress/ni3.nat 1.1.1.1
sys/arch/alpha/conf/ALPHA 1.169,1.171
sys/arch/amiga/conf/GENERIC 1.185-1.186
sys/arch/arc/conf/GENERIC 1.71-1.72
sys/arch/atari/conf/GENERIC.in 1.24-1.25
sys/arch/cats/conf/GENERIC 1.31-1.32
sys/arch/cobalt/conf/GENERIC 1.34-1.35
sys/arch/hp300/conf/GENERIC 1.83-1.84
sys/arch/i386/conf/CARDBUS 1.66-1.67
sys/arch/i386/conf/GENERIC 1.510,1.512
sys/arch/i386/conf/GENERIC_LAPTOP 1.58-1.59
sys/arch/i386/conf/GENERIC_PS2TINY 1.19-1.20
sys/arch/i386/conf/GENERIC_TINY 1.47-1.48
sys/arch/luna68k/conf/GENERIC 1.33-1.33
sys/arch/mac68k/conf/GENERIC 1.130-1.131
sys/arch/mac68k/conf/GENERICSBC 1.21-1.22
sys/arch/mac68k/conf/SMALLRAM 1.4-1.5
sys/arch/macppc/conf/GENERIC 1.142-1.143
sys/arch/mipsco/conf/GENERIC 1.21-1.22
sys/arch/mmeye/conf/GENERIC 1.44-1.45
sys/arch/news68k/conf/GENERIC 1.36-1.37
sys/arch/news68k/conf/GENERIC_TINY 1.18-1.19
sys/arch/newsmips/conf/GENERIC 1.50-1.51
sys/arch/ofppc/conf/GENERIC 1.56-1.57
sys/arch/pmax/conf/GENERIC 1.103-1.104
sys/arch/prep/conf/GENERIC 1.55-1.56
sys/arch/sbmips/conf/GENERIC 1.11-1.12
sys/arch/sgimips/conf/GENERIC 1.7-1.8
sys/arch/sparc/conf/GENERIC 1.138-1.139
sys/arch/sparc64/conf/GENERIC32 1.46-1.47
sys/arch/vax/conf/GENERIC 1.102-1.103
sys/arch/x68k/conf/ALL 1.55-1.56
sys/arch/x68k/conf/GENERIC 1.80-1.81
sys/lkm/netinet/if_ipl/mln_ipl.c 1.29
sys/netinet/fil.c 1.57-1.58
sys/netinet/ip_auth.c 1.29-1.30
sys/netinet/ip_compat.h 1.30-1.31
sys/netinet/ip_fil.c 1.81-1.86
sys/netinet/ip_fil.h 1.46-1.49
sys/netinet/ip_frag.c 1.33-1.34
sys/netinet/ip_frag.h 1.18
sys/netinet/ip_ftp_pxy.c 1.25-1.26
sys/netinet/ip_h323_pxy.c 1.5-1.6
sys/netinet/ip_log.c 1.22-1.23
sys/netinet/ip_nat.c 1.51-1.53
sys/netinet/ip_nat.h 1.27
sys/netinet/ip_netbios_pxy.c 1.4
sys/netinet/ip_proxy.c 1.35-1.36
sys/netinet/ip_proxy.h 1.18
sys/netinet/ip_state.c 1.41-1.42
sys/netinet/ip_state.h 1.23
sys/netinet/ipl.h 1.14
 1.97.4.2 01-Aug-2002  lukem Pull up revision 1.99 (requested by lukem in ticket #312):
Enable "pseudo-device clockctl" in all kernels, except
installation related kernels (INSTALL* and RAMDISK*).
This enables rc.conf(5) $ntpd_chroot to be used "out of the box"
 1.97.4.1 07-Jun-2002  thorpej pullup-1-6 ticket #203:

syssrc/sys/arch/vax/conf/GENERIC 1.98
syssrc/sys/arch/vax/conf/INSTALL 1.27

Original log message:

Change the uba devices from "xx0" to "xx*". Even if they have an exact
csr there may be multiple uba's in a machine and therefore multiple
matches for devices.
 1.97.2.1 15-Jul-2002  gehenna catch up with -current.
 1.113.2.10 11-Dec-2005  christos Sync with head.
 1.113.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.113.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.113.2.7 15-Feb-2005  skrll Sync with HEAD.
 1.113.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.113.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.113.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.113.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.113.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.113.2.1 03-Aug-2004  skrll Sync with HEAD
 1.118.2.3 15-Jul-2004  he Pull up revision 1.124 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.118.2.2 02-Jul-2004  he Pull up revision 1.123 (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.118.2.1 30-Jun-2004  jdc Pull up revision 1.122 (requested by abs in ticket #567).

Add (commented out) ALTQ options to all GENERIC-like files
 1.126.4.1 29-Apr-2005  kent sync with -current
 1.127.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.127.2.1 12-Feb-2005  yamt sync with head.
 1.132.2.3 05-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #929):
sys/arch/hp300/conf/GENERIC: revision 1.124
sys/arch/acorn32/conf/GENERIC: revision 1.62
sys/arch/pdp10/conf/GENERIC: revision 1.19
sys/arch/mvme68k/conf/GENERIC: revision 1.61
sys/arch/netwinder/conf/GENERIC: revision 1.70
sys/arch/sbmips/conf/GENERIC: revision 1.46
sys/arch/macppc/conf/GENERIC: revision 1.214
sys/arch/bebox/conf/GENERIC: revision 1.89
sys/arch/cobalt/conf/GENERIC: revision 1.83
sys/arch/cats/conf/GENERIC: revision 1.92
sys/arch/shark/conf/GENERIC: revision 1.53
sys/arch/amiga/conf/GENERIC.in: revision 1.45
sys/arch/acorn26/conf/GENERIC: revision 1.37
sys/arch/cesfic/conf/GENERIC: revision 1.38
sys/arch/iyonix/conf/GENERIC: revision 1.21
sys/arch/alpha/conf/GENERIC: revision 1.277
sys/arch/vax/conf/GENERIC: revision 1.143
sys/arch/atari/conf/GENERIC.in: revision 1.56
sys/arch/mipsco/conf/GENERIC: revision 1.53
sys/arch/ofppc/conf/GENERIC: revision 1.85
sys/arch/next68k/conf/GENERIC: revision 1.96
sys/arch/arc/conf/GENERIC: revision 1.125
sys/arch/dreamcast/conf/GENERIC: revision 1.62
turn off DEBUG and DIAGNOSTIC in GENERIC kernels so that they
are compatible with the LKMs that are part of the release.
 1.132.2.2 14-Aug-2005  riz Pull up revision 1.136 (requested by hubertf in ticket #625):
Add support for reading cloop2 compressed filesystem images,
enable by putting VND_COMPRESSION into kernel config file.
Written by Cliff Wright, polished up slightly by me.
 1.132.2.1 18-Jul-2005  riz Pull up revision 1.135 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.134.2.7 17-Mar-2008  yamt sync with head.
 1.134.2.6 04-Feb-2008  yamt sync with head.
 1.134.2.5 21-Jan-2008  yamt sync with head
 1.134.2.4 15-Nov-2007  yamt sync with head.
 1.134.2.3 03-Sep-2007  yamt sync with head.
 1.134.2.2 30-Dec-2006  yamt sync with head.
 1.134.2.1 21-Jun-2006  yamt sync with head.
 1.146.4.1 09-Sep-2006  rpaulo sync with head
 1.146.2.1 18-Feb-2006  yamt sync with head.
 1.147.2.1 22-Apr-2006  simonb Sync with head.
 1.150.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.150.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.150.2.3 03-Sep-2006  yamt sync with head.
 1.150.2.2 11-Aug-2006  yamt sync with head
 1.150.2.1 01-Apr-2006  yamt sync with head.
 1.151.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.152.2.2 22-Sep-2006  riz Pull up following revision(s) (requested by tsutsui in ticket #170):
sys/arch/sparc64/conf/GENERIC: revision 1.63
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.55
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.54
sys/arch/next68k/conf/GENERIC: revision 1.105
sys/arch/ews4800mips/conf/GENERIC: revision 1.12
sys/arch/arc/conf/GENERIC: revision 1.142
sys/arch/sun3/conf/GENERIC3X: revision 1.91
sys/arch/amd64/conf/GENERIC: revision 1.105
sys/arch/sun2/conf/GENERIC: revision 1.58
sys/arch/amiga/conf/GENERIC.in: revision 1.55
sys/arch/mac68k/conf/GENERIC: revision 1.175
sys/arch/acorn26/conf/GENERIC: revision 1.46
sys/arch/shark/conf/GENERIC: revision 1.65
sys/arch/cesfic/conf/GENERIC: revision 1.45
sys/arch/sandpoint/conf/GENERIC: revision 1.36
sys/arch/iyonix/conf/GENERIC: revision 1.32
sys/arch/mvme68k/conf/GENERIC: revision 1.69
sys/arch/evbarm/conf/ARMADILLO210: revision 1.3
sys/arch/vax/conf/GENERIC: revision 1.154
sys/arch/mipsco/conf/GENERIC: revision 1.61
sys/arch/evbarm/conf/ARMADILLO9: revision 1.14
sys/arch/cobalt/conf/GENERIC: revision 1.103
sys/arch/ofppc/conf/GENERIC: revision 1.94
sys/arch/hp700/conf/GENERIC: revision 1.69
sys/arch/playstation2/conf/GENERIC: revision 1.8
sys/arch/dreamcast/conf/GENERIC: revision 1.73
sys/arch/news68k/conf/GENERIC: revision 1.81
sys/arch/macppc/conf/GENERIC: revision 1.234
sys/arch/hp300/conf/GENERIC: revision 1.134
sys/arch/mmeye/conf/GENERIC: revision 1.83
sys/arch/ibmnws/conf/GENERIC: revision 1.26
sys/arch/cats/conf/GENERIC: revision 1.109
sys/arch/sparc/conf/GENERIC: revision 1.191
sys/arch/pdp10/conf/GENERIC: revision 1.27
sys/arch/acorn32/conf/GENERIC: revision 1.75
sys/arch/luna68k/conf/GENERIC: revision 1.74
sys/arch/bebox/conf/GENERIC: revision 1.101
sys/arch/pmax/conf/GENERIC: revision 1.148
sys/arch/x68k/conf/GENERIC: revision 1.130
sys/arch/sun3/conf/GENERIC: revision 1.134
sys/arch/prep/conf/GENERIC: revision 1.126
sys/arch/alpha/conf/GENERIC: revision 1.293
sys/arch/newsmips/conf/GENERIC: revision 1.94
sys/arch/netwinder/conf/GENERIC: revision 1.83
sys/arch/hpcsh/conf/GENERIC: revision 1.69
sys/arch/sbmips/conf/GENERIC: revision 1.55
sys/arch/pc532/conf/GENERIC: revision 1.65
sys/arch/hpcmips/conf/GENERIC: revision 1.192
Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.152.2.1 14-Aug-2006  tron Pull up following revision(s) (requested by elad in ticket #17):
sys/arch/sparc/conf/KRUPS: revision 1.38
sys/arch/i386/conf/XEN2_DOMU: revision 1.2
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.197
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.53
sys/arch/evbsh5/conf/SIMULATOR: revision 1.12
sys/arch/sparc/conf/MRCOFFEE: revision 1.17
sys/arch/next68k/conf/GENERIC: revision 1.104
sys/arch/i386/conf/VIRTUALPC: revision 1.44
sys/arch/ews4800mips/conf/GENERIC: revision 1.11
sys/arch/evbsh5/conf/CAYMAN: revision 1.23
sys/arch/arc/conf/GENERIC: revision 1.141
sys/arch/amd64/conf/GENERIC: revision 1.103
sys/arch/sun3/conf/GENERIC3X: revision 1.90
sys/arch/evbarm/conf/HDL_G: revision 1.3
sys/arch/sun2/conf/GENERIC: revision 1.57
sys/arch/news68k/conf/GENERIC_TINY: revision 1.51
sys/arch/evbppc/conf/EXPLORA451: revision 1.27
sys/arch/amiga/conf/GENERIC.in: revision 1.54
sys/arch/mac68k/conf/GENERIC: revision 1.174
sys/arch/acorn26/conf/GENERIC: revision 1.45
sys/arch/shark/conf/GENERIC: revision 1.64
sys/arch/cesfic/conf/GENERIC: revision 1.44
sys/arch/mvme68k/conf/GENERIC: revision 1.68
sys/arch/i386/conf/XEN2_DOM0: revision 1.4
sys/arch/atari/conf/GENERIC.in: revision 1.63
sys/arch/amiga/conf/GENERIC: revision 1.240
sys/arch/i386/conf/LAMB: revision 1.65
sys/arch/i386/conf/GENERIC: revision 1.773
sys/arch/acorn32/conf/EB7500ATX: revision 1.26
sys/arch/x68k/conf/GENERIC: revision 1.128
sys/arch/vax/conf/GENERIC: revision 1.153
sys/arch/atari/conf/ATARITT: revision 1.81
sys/arch/mipsco/conf/GENERIC: revision 1.60
sys/arch/cobalt/conf/GENERIC: revision 1.101
sys/arch/evbarm/conf/ARMADILLO9: revision 1.13
sys/arch/ofppc/conf/GENERIC: revision 1.93
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.51
sys/arch/arc/conf/RPC44: revision 1.26
sys/arch/sparc64/conf/GENERIC: revision 1.59
sys/arch/i386/conf/XEN3_DOMU: revision 1.2
sys/arch/hp700/conf/GENERIC: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.47
sys/arch/macppc/conf/GENERIC: revision 1.231
sys/arch/dreamcast/conf/GENERIC: revision 1.72
sys/arch/news68k/conf/GENERIC: revision 1.80
sys/arch/hp300/conf/GENERIC: revision 1.133
sys/arch/mmeye/conf/GENERIC: revision 1.82
sys/arch/macppc/conf/MAMBO: revision 1.2
sys/arch/cats/conf/GENERIC: revision 1.107
sys/arch/atari/conf/FALCON: revision 1.79
sys/arch/acorn32/conf/GENERIC: revision 1.71
sys/arch/sparc/conf/GENERIC: revision 1.190
sys/arch/news68k/conf/LIBERO: revision 1.40
sys/arch/amiga/conf/DRACO: revision 1.114
sys/arch/cobalt/conf/INSTALL: revision 1.23
sys/arch/luna68k/conf/GENERIC: revision 1.73
sys/arch/bebox/conf/GENERIC: revision 1.100
sys/arch/pmax/conf/GENERIC: revision 1.147
sys/arch/amiga/conf/WSCONS: revision 1.52
sys/arch/macppc/conf/POWERMAC_G5: revision 1.2
sys/arch/alpha/conf/ALPHA: revision 1.218
sys/arch/sun3/conf/GENERIC: revision 1.133
sys/arch/prep/conf/GENERIC: revision 1.124
sys/arch/alpha/conf/GENERIC: revision 1.291
sys/arch/atari/conf/HADES: revision 1.71
sys/arch/newsmips/conf/GENERIC: revision 1.93
sys/arch/netwinder/conf/GENERIC: revision 1.82
sys/arch/hpcmips/conf/GENERIC: revision 1.190
sys/arch/amiga/conf/AMIGA: revision 1.98
sys/arch/sbmips/conf/GENERIC: revision 1.54
sys/arch/pc532/conf/GENERIC: revision 1.64
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.53
Disable SYSTRACE by default on all kernels (discussed with core)
 1.155.4.1 10-Dec-2006  yamt sync with head.
 1.155.2.1 18-Nov-2006  ad Sync with head.
 1.156.18.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.156.16.1 26-Jun-2007  garbled Sync with HEAD.
 1.156.10.1 11-Jul-2007  mjf Sync with head.
 1.156.8.2 03-Dec-2007  ad Sync with HEAD.
 1.156.8.1 09-Jun-2007  ad Sync with head.
 1.156.2.1 05-Jun-2007  bouyer Pull up following revision(s) (requested by martin in ticket #699):
sys/arch/hpcmips/conf/GENERIC: revision 1.196
sys/arch/hp700/conf/GENERIC: revision 1.74
sys/arch/i386/conf/GENERIC: revision 1.831
sys/arch/next68k/conf/GENERIC: revision 1.108
sys/arch/alpha/conf/GENERIC: revision 1.313
sys/arch/arc/conf/GENERIC: revision 1.146
sys/arch/cats/conf/GENERIC: revision 1.115
sys/arch/ews4800mips/conf/GENERIC: revision 1.18
sys/arch/landisk/conf/GENERIC: revision 1.8 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.85
sys/arch/pmax/conf/GENERIC: revision 1.152
sys/arch/iyonix/conf/GENERIC: revision 1.38 via patch
sys/arch/amiga/conf/GENERIC: revision 1.245
sys/arch/vax/conf/GENERIC: revision 1.157
sys/arch/prep/conf/GENERIC: revision 1.135
sys/arch/pc532/conf/GENERIC: revision 1.70
sys/arch/sbmips/conf/GENERIC: revision 1.61
sys/arch/mipsco/conf/GENERIC: revision 1.65
sys/arch/cobalt/conf/GENERIC: revision 1.108
sys/arch/ofppc/conf/GENERIC: revision 1.98
sys/arch/amd64/conf/GENERIC: revision 1.148
sys/arch/acorn26/conf/GENERIC: revision 1.50
sys/arch/dreamcast/conf/GENERIC: revision 1.78
sys/arch/mac68k/conf/GENERIC: revision 1.181
sys/arch/hp300/conf/GENERIC: revision 1.139
sys/arch/mmeye/conf/GENERIC: revision 1.88
sys/arch/news68k/conf/GENERIC: revision 1.88
sys/arch/mvme68k/conf/GENERIC: revision 1.71
sys/arch/acorn32/conf/GENERIC: revision 1.79
sys/arch/sparc/conf/GENERIC: revision 1.199
sys/arch/luna68k/conf/GENERIC: revision 1.78
sys/arch/bebox/conf/GENERIC: revision 1.105
sys/arch/macppc/conf/GENERIC: revision 1.256 via patch
sys/arch/x68k/conf/GENERIC: revision 1.134
sys/arch/sun3/conf/GENERIC: revision 1.138
sys/arch/newsmips/conf/GENERIC: revision 1.98
Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.157.14.1 13-Nov-2007  bouyer Sync with HEAD
 1.157.10.3 23-Mar-2008  matt sync with HEAD
 1.157.10.2 09-Jan-2008  matt sync with HEAD
 1.157.10.1 06-Nov-2007  matt sync with HEAD
 1.157.8.1 04-Nov-2007  jmcneill Sync with HEAD.
 1.159.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.159.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.161.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.161.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.161.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.161.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.161.2.1 24-Mar-2008  keiichi sync with head.
 1.163.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.163.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.163.4.2 11-Aug-2010  yamt sync with head.
 1.163.4.1 04-May-2009  yamt sync with head.
 1.163.2.1 04-Jun-2008  yamt sync with head
 1.164.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.164.4.1 19-Oct-2008  haad Sync with HEAD.
 1.167.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.167.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.170.6.4 21-Apr-2011  rmind sync with head
 1.170.6.3 05-Mar-2011  rmind sync with head
 1.170.6.2 03-Jul-2010  rmind sync with head
 1.170.6.1 30-May-2010  rmind sync with head
 1.170.4.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.170.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.175.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.175.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.177.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.177.2.2 30-Oct-2012  yamt sync with head
 1.177.2.1 17-Apr-2012  yamt sync with head
 1.178.2.2 11-Mar-2012  mrg sync to latest -current
 1.178.2.1 18-Feb-2012  mrg merge to -current.
 1.179.2.2 04-Jul-2012  jdc Pull up revisions:
src/etc/etc.vax/MAKEDEV.conf revision 1.14
src/sys/arch/vax/conf/GENERIC revision 1.182
src/sys/arch/vax/conf/INSTALL revision 1.60
src/sys/arch/vax/conf/VAX780 revision 1.9
src/sys/arch/vax/conf/majors.vax revision 1.24
src/sys/arch/vax/vax/disksubr.c revision 1.53
src/sys/dev/DEVNAMES revision 1.275
src/sys/dev/mscp/files.mscp revision 1.8
src/sys/dev/mscp/mscp_disk.c revision 1.72
src/sys/dev/mscp/mscp_subr.c revision 1.42
src/distrib/vax/ramdisk/Makefile revision 1.29
(requested by abs in ticket #385).

- Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number

Include racd0 and racd1 on ramdisk
 1.179.2.1 12-Jun-2012  riz Pull up following revision(s) (requested by abs in ticket #311):
sys/arch/netwinder/conf/GENERIC: revision 1.112
sys/arch/i386/conf/GENERIC: revision 1.1074
sys/arch/atari/conf/MILAN.in: revision 1.26
sys/arch/zaurus/conf/GENERIC: revision 1.54
sys/arch/shark/conf/GENERIC: revision 1.101
sys/arch/hpcmips/conf/MPC303: revision 1.60
sys/arch/i386/conf/XEN3_DOM0: revision 1.67
sys/arch/evbarm/conf/MPCSA_GENERIC: revision 1.29
sys/arch/vax/conf/GENERIC: revision 1.181
sys/arch/sparc/conf/KRUPS: revision 1.59
sys/arch/evbarm/conf/BEAGLEBOARD: revision 1.27
sys/arch/i386/conf/INSTALL_FLOPPY: revision 1.16
sys/arch/prep/conf/GENERIC: revision 1.163
sys/arch/hpcmips/conf/GENERIC: revision 1.216
sys/arch/sparc/conf/TADPOLE3GX: revision 1.56
sys/arch/shark/conf/INSTALL: revision 1.50
sys/arch/next68k/conf/GENERIC: revision 1.127
sys/arch/evbppc/conf/VIRTEX_GSRD2: revision 1.16
sys/arch/evbppc/conf/VIRTEX_DFC: revision 1.17
sys/arch/evbppc/conf/EXPLORA451: revision 1.48
sys/arch/bebox/conf/INSTALL: revision 1.54
sys/arch/next68k/conf/SLAB: revision 1.46
sys/arch/i386/conf/GENERIC_TINY: revision 1.132
sys/arch/bebox/conf/GENERIC: revision 1.131
sys/arch/amd64/conf/XEN3_DOM0: revision 1.84
sys/arch/amd64/conf/GENERIC: revision 1.356
sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.6
share/man/man4/wscons.4: revision 1.31
sys/arch/hpcmips/conf/TX3912: revision 1.79
sys/arch/evbarm/conf/ARMADILLO9: revision 1.35
sys/arch/hpcsh/conf/GENERIC: revision 1.97
sys/arch/i386/conf/ALL: revision 1.339
sys/arch/hpcmips/conf/TX3922: revision 1.93
sys/arch/cats/conf/INSTALL: revision 1.82
sys/arch/sparc64/conf/GENERIC: revision 1.151
sys/arch/i386/conf/INSTALL_TINY: revision 1.135
sys/arch/evbppc/conf/VIRTEX_GSRD1: revision 1.15
sys/arch/evbarm/conf/TS7200: revision 1.49
sys/arch/hpcmips/conf/VR41XX: revision 1.55
sys/arch/hp700/conf/GENERIC: revision 1.115
sys/arch/cats/conf/GENERIC: revision 1.140
Mention wsconscfg(8) needs WSDISPLAY_COMPAT_USL
If a port is going to have wscons for virtual terminals then it really make=
s
sense to enable WSDISPLAY_COMPAT_USL so the system can switch between the
virtual terminals...
Adjust the WSDISPLAY_COMPAT_USL comment to mention wsconscfg, to at least
give a hint that its not just for third party compat. No functional change.
 1.182.2.4 03-Dec-2017  jdolecek update from HEAD
 1.182.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.182.2.2 23-Jun-2013  tls resync from head
 1.182.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.188.2.1 28-Aug-2013  rmind sync with head
 1.189.6.2 18-Nov-2014  snj Pull up following revision(s) (requested by manu in ticket #251):
sys/arch/acorn26/conf/GENERIC: revision 1.81
sys/arch/acorn32/conf/GENERIC: revision 1.116
sys/arch/alpha/conf/GENERIC: revision 1.362
sys/arch/amd64/conf/ALL: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.404
sys/arch/amd64/conf/XEN3_DOM0: revision 1.112
sys/arch/amd64/conf/XEN3_DOMU: revision 1.60
sys/arch/amiga/conf/GENERIC.in: revision 1.129
sys/arch/amiga/conf/GENERIC: revision 1.311
sys/arch/amigappc/conf/GENERIC: revision 1.24
sys/arch/arc/conf/GENERIC: revision 1.184
sys/arch/bebox/conf/GENERIC: revision 1.145
sys/arch/cats/conf/GENERIC: revision 1.155
sys/arch/cesfic/conf/GENERIC: revision 1.65
sys/arch/cobalt/conf/GENERIC: revision 1.147
sys/arch/dreamcast/conf/GENERIC: revision 1.121
sys/arch/emips/conf/GENERIC: revision 1.15
sys/arch/epoc32/conf/GENERIC: revision 1.8
sys/arch/ews4800mips/conf/GENERIC: revision 1.51
sys/arch/hp300/conf/GENERIC: revision 1.190
sys/arch/hpcmips/conf/GENERIC: revision 1.229
sys/arch/hpcsh/conf/GENERIC: revision 1.106
sys/arch/hppa/conf/GENERIC: revision 1.6
sys/arch/i386/conf/ALL: revision 1.389
sys/arch/i386/conf/GENERIC: revision 1.1118
sys/arch/i386/conf/XEN3_DOM0: revision 1.93
sys/arch/i386/conf/XEN3_DOMU: revision 1.65
sys/arch/ibmnws/conf/GENERIC: revision 1.46
sys/arch/iyonix/conf/GENERIC: revision 1.88
sys/arch/landisk/conf/GENERIC: revision 1.45
sys/arch/luna68k/conf/GENERIC: revision 1.119
sys/arch/mac68k/conf/GENERIC: revision 1.220
sys/arch/macppc/conf/GENERIC: revision 1.320
sys/arch/macppc/conf/MAMBO: revision 1.24
sys/arch/macppc/conf/POWERMAC_G5: revision 1.25
sys/arch/mipsco/conf/GENERIC: revision 1.88
sys/arch/mmeye/conf/GENERIC: revision 1.120
sys/arch/mvme68k/conf/GENERIC: revision 1.94
sys/arch/mvmeppc/conf/GENERIC: revision 1.24
sys/arch/netwinder/conf/GENERIC: revision 1.126
sys/arch/news68k/conf/GENERIC: revision 1.125
sys/arch/newsmips/conf/GENERIC: revision 1.129
sys/arch/next68k/conf/GENERIC: revision 1.139
sys/arch/ofppc/conf/GENERIC: revision 1.157
sys/arch/pmax/conf/GENERIC64: revision 1.21
sys/arch/pmax/conf/GENERIC: revision 1.185
sys/arch/prep/conf/GENERIC: revision 1.174
sys/arch/rs6000/conf/GENERIC: revision 1.33
sys/arch/sandpoint/conf/GENERIC: revision 1.88
sys/arch/sbmips/conf/GENERIC: revision 1.101
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.28
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.104
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.106
sys/arch/shark/conf/GENERIC: revision 1.121
sys/arch/sparc/conf/GENERIC: revision 1.248
sys/arch/sparc/conf/TADPOLE3GX: revision 1.65
sys/arch/sparc64/conf/GENERIC: revision 1.177
sys/arch/sparc64/conf/NONPLUS64: revision 1.44
sys/arch/sun2/conf/GENERIC: revision 1.94
sys/arch/sun3/conf/GENERIC: revision 1.171
sys/arch/vax/conf/GENERIC: revision 1.193
sys/arch/vax/conf/VAX780: revision 1.19
sys/arch/x68k/conf/GENERIC: revision 1.179
sys/arch/zaurus/conf/GENERIC: revision 1.65
sys/ufs/files.ufs: revision 1.38
Remove unused extended attributes kernel options

As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate
 1.189.6.1 14-Nov-2014  martin Pull up following revision(s) (requested by manu in ticket #232):
sys/arch/next68k/conf/GENERIC: revision 1.138
sys/arch/cobalt/conf/GENERIC: revision 1.146
sys/arch/mvme68k/conf/GENERIC: revision 1.93
sys/arch/vax/conf/VAX780: revision 1.18
sys/arch/newsmips/conf/GENERIC: revision 1.128
sys/arch/luna68k/conf/GENERIC: revision 1.118
sys/arch/sbmips/conf/GENERIC: revision 1.100
sys/arch/pmax/conf/GENERIC: revision 1.184
sys/arch/alpha/conf/GENERIC: revision 1.361
sys/arch/sparc64/conf/GENERIC: revision 1.176
sys/arch/sun3/conf/GENERIC: revision 1.170
sys/arch/shark/conf/GENERIC: revision 1.120
sys/arch/landisk/conf/GENERIC: revision 1.44
sys/arch/bebox/conf/GENERIC: revision 1.144
sys/arch/sparc64/conf/NONPLUS64: revision 1.43
sys/arch/sandpoint/conf/GENERIC: revision 1.87
sys/arch/emips/conf/GENERIC: revision 1.14
sys/arch/amd64/conf/XEN3_DOM0: revision 1.111
sys/arch/dreamcast/conf/GENERIC: revision 1.120
sys/arch/cesfic/conf/GENERIC: revision 1.64
sys/arch/mmeye/conf/GENERIC: revision 1.119
sys/arch/epoc32/conf/GENERIC: revision 1.7
sys/arch/x68k/conf/GENERIC: revision 1.178
sys/arch/iyonix/conf/GENERIC: revision 1.87
sys/arch/sun2/conf/GENERIC: revision 1.93
sys/arch/ews4800mips/conf/GENERIC: revision 1.50
sys/arch/amd64/conf/XEN3_DOMU: revision 1.59
sys/arch/acorn26/conf/GENERIC: revision 1.80
sys/arch/acorn32/conf/GENERIC: revision 1.115
sys/arch/macppc/conf/POWERMAC_G5: revision 1.24
sys/arch/i386/conf/GENERIC: revision 1.1117
sys/arch/arc/conf/GENERIC: revision 1.183
sys/arch/cats/conf/GENERIC: revision 1.154
sys/arch/amiga/conf/GENERIC.in: revision 1.128
sys/arch/zaurus/conf/GENERIC: revision 1.64
sys/arch/netwinder/conf/GENERIC: revision 1.125
sys/arch/hppa/conf/GENERIC: revision 1.5
sys/arch/mvmeppc/conf/GENERIC: revision 1.23
sys/arch/macppc/conf/GENERIC: revision 1.319
sys/arch/amiga/conf/GENERIC: revision 1.310
sys/arch/pmax/conf/GENERIC64: revision 1.20
sys/arch/macppc/conf/MAMBO: revision 1.23
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.27
sys/arch/amigappc/conf/GENERIC: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.403
sys/arch/ofppc/conf/GENERIC: revision 1.156
sys/arch/mac68k/conf/GENERIC: revision 1.219
sys/arch/i386/conf/XEN3_DOMU: revision 1.64
sys/arch/mipsco/conf/GENERIC: revision 1.87
sys/arch/hp300/conf/GENERIC: revision 1.189
sys/arch/vax/conf/GENERIC: revision 1.192
sys/arch/news68k/conf/GENERIC: revision 1.124
sys/arch/ibmnws/conf/GENERIC: revision 1.45
sys/arch/hpcsh/conf/GENERIC: revision 1.105
sys/arch/sparc/conf/TADPOLE3GX: revision 1.64
sys/arch/i386/conf/XEN3_DOM0: revision 1.92
sys/arch/sparc/conf/GENERIC: revision 1.247
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.105
sys/arch/prep/conf/GENERIC: revision 1.173
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.103
sys/arch/rs6000/conf/GENERIC: revision 1.32
sys/arch/hpcmips/conf/GENERIC: revision 1.228
Support for UFS1 extended attributes in GENERIC and GENERIC-like kernels
This change just brings UFS1 extended attribute *support* in the kernel,
extended attributes are not enabled unless three conditions are met:
1) filesystem is UFS1 (newfs -O1)
2) .attribute/system and .attribute/user directories are created at fs root
3) filesystem is mounted with -o extattr
Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
 1.193.2.4 28-Aug-2017  skrll Sync with HEAD
 1.193.2.3 05-Feb-2017  skrll Sync with HEAD
 1.193.2.2 22-Sep-2015  skrll Sync with HEAD
 1.193.2.1 06-Apr-2015  skrll Sync with HEAD
 1.196.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.200.8.1 26-Jan-2018  martin Pull up following revision(s) (requested by sevan in ticket #510):
sys/arch/sun3/conf/GENERIC3X: revision 1.130
sys/arch/sparc64/conf/GENERIC: revision 1.203
sys/arch/news68k/conf/LIBERO: revision 1.66
sys/arch/amiga/conf/DRACO: revision 1.185
sys/arch/evbarm/conf/MV2120: revision 1.35
sys/arch/x68k/conf/GENERIC: revision 1.187
sys/arch/rs6000/conf/GENERIC: revision 1.39
sys/arch/news68k/conf/GENERIC_TINY: revision 1.86
sys/arch/i386/conf/XEN3_DOMU: revision 1.88
sys/arch/iyonix/conf/GENERIC: revision 1.97
sys/arch/evbarm64/conf/A64EMUL: revision 1.11
sys/arch/mvme68k/conf/GENERIC: revision 1.98
sys/arch/acorn32/conf/GENERIC: revision 1.124
sys/arch/i386/conf/XEN3_DOM0: revision 1.125
sys/arch/cobalt/conf/INSTALL: revision 1.65
sys/arch/macppc/conf/GENERIC_601: revision 1.16
sys/arch/hppa/conf/GENERIC: revision 1.17
sys/arch/amiga/conf/GENERIC.in: revision 1.137
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.33
sys/arch/netwinder/conf/GENERIC: revision 1.134
sys/arch/amd64/conf/XEN3_DOMU: revision 1.83
sys/arch/mac68k/conf/GENERIC: revision 1.225
sys/arch/arc/conf/RPC44: revision 1.54
sys/arch/mipsco/conf/GENERIC: revision 1.92
sys/arch/cats/conf/GENERIC: revision 1.166
sys/arch/amd64/conf/XEN3_DOM0: revision 1.145
sys/arch/amigappc/conf/GENERIC: revision 1.33
sys/arch/sun3/conf/GENERIC: revision 1.176
sys/arch/news68k/conf/GENERIC: revision 1.130
sys/arch/hpcsh/conf/GENERIC: revision 1.110
sys/arch/hp300/conf/GENERIC: revision 1.198
sys/arch/atari/conf/GENERIC.in: revision 1.115
sys/arch/sparc/conf/MRCOFFEE: revision 1.54
sys/arch/evbppc/conf/EXPLORA451: revision 1.62
sys/arch/cesfic/conf/GENERIC: revision 1.69
sys/arch/vax/conf/GENERIC: revision 1.204
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.115
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.112
sys/arch/sparc/conf/GENERIC: revision 1.258
sys/arch/next68k/conf/GENERIC: revision 1.145
sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.34
sys/arch/prep/conf/GENERIC: revision 1.185
sys/arch/amiga/conf/INSTALL: revision 1.129
sys/arch/newsmips/conf/GENERIC: revision 1.133
sys/arch/cobalt/conf/GENERIC: revision 1.156
sys/arch/sun2/conf/GENERIC: revision 1.99
sys/arch/luna68k/conf/INSTALL: revision 1.25
sys/arch/amigappc/conf/NULL: revision 1.53
sys/arch/acorn26/conf/GENERIC: revision 1.85
sys/arch/vax/conf/VAX780: revision 1.25
sys/arch/luna68k/conf/GENERIC: revision 1.125
sys/arch/ews4800mips/conf/GENERIC: revision 1.56
sys/arch/macppc/conf/POWERMAC_G5: revision 1.29
sys/arch/arc/conf/GENERIC: revision 1.189
sys/arch/macppc/conf/MAMBO: revision 1.27
sys/arch/acorn32/conf/EB7500ATX: revision 1.64
sys/arch/pmax/conf/GENERIC: revision 1.196
sys/arch/pmax/conf/GENERIC64: revision 1.28
sys/arch/amiga/conf/GENERIC: revision 1.319
sys/arch/evbarm/conf/MPCSA_GENERIC: revision 1.55
sys/arch/macppc/conf/GENERIC: revision 1.339
sys/arch/emips/conf/GENERIC: revision 1.21
sys/arch/sandpoint/conf/GENERIC: revision 1.97
sys/arch/landisk/conf/GENERIC: revision 1.58
sys/arch/bebox/conf/GENERIC: revision 1.157
sys/arch/alpha/conf/GENERIC: revision 1.379
Alternate buffer queue strategies no longer considered experimental, update
description.
Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
 1.204.2.3 18-Jan-2019  pgoyette Synch with HEAD
 1.204.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.204.2.1 02-May-2018  pgoyette Synch with HEAD
 1.205.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.205.2.1 10-Jun-2019  christos Sync with HEAD
 1.211.4.1 25-Jan-2020  ad Sync with head.
 1.216.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.1 19-Mar-2000  ragge branches: 1.1.6;
First cut of multiprocessor support for vax. Still much to do before
other CPUs than the master can spin up.
 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 19-Mar-2000  bouyer file GENERIC.MP was added on branch thorpej_scsipi on 2000-11-20 20:32:43 +0000
 1.3 21-Nov-1999  itojun bring in content of GENERIC.v6 into GENERIC.
remove GENERIC.v6 file (as it is part of GENERIC now).

"faith" interface is commented out by default as it is not really for
general use.
IPsec items are commented out as well, though we can enable "options IPSEC"
without export-related issue ("options IPSEC" will enable authentication
portion only). We may need to think about it again.

if you have problem compiling with INET6 on archs I do not have access to,
please contact me.

XXX what to do with arch/arm32/SHARK{,.v6}?
 1.2 09-Jul-1999  thorpej branches: 1.2.2; 1.2.8;
Add examples for including the kernel crypto bits from either crypto-us
or crypto-intl, commented out, with instructions to use only one, and
adjust the prefix as necessary.
 1.1 01-Jul-1999  itojun branches: 1.1.2;
kernel configuration for IPv6/IPsec. should be in GENERIC in the future.
(source code will be committed soon)
 1.1.2.3 02-Aug-1999  thorpej Update from trunk.
 1.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 01-Jul-1999  thorpej file GENERIC.v6 was added on branch chs-ubc2 on 1999-07-01 23:27:17 +0000
 1.2.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.2 06-Feb-2019  rin Add ure(4) to kernel config files. Also add PHY drivers where necessary.
 1.1 22-Jun-2017  flxd branches: 1.1.2; 1.1.6; 1.1.8; 1.1.12;
USB for vax (similar to pmax; no/negligible impact on legacy):
* Add USB device files/majors.
* Make kernel configs with USB work.
* Provide a USB-enabled kernel config.
 1.1.12.1 10-Jun-2019  christos Sync with HEAD
 1.1.8.2 03-Dec-2017  jdolecek update from HEAD
 1.1.8.1 22-Jun-2017  jdolecek file GENERIC_USB was added on branch tls-maxphys on 2017-12-03 11:36:47 +0000
 1.1.6.2 28-Aug-2017  skrll Sync with HEAD
 1.1.6.1 22-Jun-2017  skrll file GENERIC_USB was added on branch nick-nhusb on 2017-08-28 17:51:54 +0000
 1.1.2.2 05-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #95):
etc/etc.vax/MAKEDEV.conf: revision 1.19
etc/etc.vax/Makefile.inc: revision 1.25
sys/arch/vax/conf/GENERIC_USB: revision 1.1
sys/arch/vax/conf/files.vax: revision 1.123
sys/arch/vax/conf/majors.vax: revision 1.27
USB for vax (similar to pmax; no/negligible impact on legacy):
* Add USB device files/majors.
* Make kernel configs with USB work.
* Provide a USB-enabled kernel config.
--
Add GENERIC_USB to vax kernel sets, but not to sysinst (yet), as bootloader
cannot handle kernels that large (yet).
 1.1.2.1 22-Jun-2017  snj file GENERIC_USB was added on branch netbsd-8 on 2017-07-05 20:13:37 +0000
 1.78 27-May-2025  christos bump.
 1.77 11-Feb-2023  tsutsui branches: 1.77.6;
Add comments that "options VAX410" also supports VS3100/m30,m38,m40,m48.
 1.76 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.75 20-Jan-2020  thorpej branches: 1.75.24;
Remove FDDI support.
 1.74 25-Apr-2018  ragge branches: 1.74.2; 1.74.8;
Enable CPU_IN_CKSUM.
 1.73 14-Sep-2017  mrg branches: 1.73.2;
clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
 1.72 27-Dec-2016  flxd Fix TC adaptor's CSR address.
Add "PMAD" LANCE TC Ethernet.
 1.71 12-Aug-2015  maxv branches: 1.71.2;
Remove KMEMSTATS.
 1.70 23-Aug-2014  dholland branches: 1.70.2;
Systematize (and in many cases, fix) the comments on options COMPAT_NN.

There are quite a few configs that are missing some COMPAT_NN options
in ways that don't make sense; this should probably get cleaned up
too, but for the time being I've not added or removed anything.
 1.69 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.68 16-Mar-2014  joerg Bump INSTALL ramdisk size slightly to allow building with DBG=-g.
 1.67 09-Nov-2013  christos bump md image size
 1.66 27-Apr-2013  christos branches: 1.66.4;
the bogus number police
 1.65 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.64 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.63 17-Aug-2012  abs branches: 1.63.2;
Update all kernel configs mentioning WSEMUL_* but not already including
WSDISPLAY_COMPAT_USL using the following rules:
- If WSEMUL_ is commented out, add commented out out WSDISPLAY_COMPAT_USL
- If INSTALL or obviously memory constrained, add WSDISPLAY_DEFAULTSCREENS=1
and commented out WSDISPLAY_COMPAT_USL
- Otherwise add WSDISPLAY_COMPAT_USL

Some of the INSTALL configs for larger memory machines are probably suitable
for adding WSDISPLAY_COMPAT_USL.

Now wsconscfg(8) should be able to switch VTs when expected.

Implemented after no objection from tech-kern to the following:

On 5 June 2012 09:47, David Brownlee <abs@absd.org> wrote:
> wsconscfg(8) requires WSDISPLAY_COMPAT_USL in order to switch virtual
> terminals.
>
> Except when in an exceptionally memory or space constrained
> environment (INSTALL being the obvious case), is there any reason why
> all GENERIC and GENERIC-like kernels which have wscons enabled
> shouldn't also have WSDISPLAY_COMPAT_USL?
 1.62 03-Jul-2012  abs Sync devices with GENERIC, and include bpfilter to allow dhcpcd to work
 1.61 03-Jul-2012  abs All apply to vax only:
- Drop KERNFS from INSTALL kernel
- Add dmesg to sysinst ramdisk
- Add 'ramdisk' target to MAKEDEV and use
- Add dhcpcd to sysinst ramdisk
- Drop old install.md script
- Misc install image cleanup (reduce diff to zaurus of all things)
 1.60 22-Jun-2012  abs - Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number
 1.59 18-Mar-2012  he Bump the ramdisk size so that the contents fits again.
 1.58 18-Dec-2011  dholland branches: 1.58.2;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.57 22-Nov-2011  tls branches: 1.57.2;

The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself. Move it to std. This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports. Thanks to Havard Eidnes for
pointing them out.
 1.56 30-Jun-2011  wiz branches: 1.56.2;
dependant -> dependent
 1.55 06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.54 23-Nov-2010  hannken branches: 1.54.2; 1.54.4;
Remove unused count from pseudo-device md.
 1.53 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.52 06-Feb-2009  jym branches: 1.52.4; 1.52.6;
Changes to MEMORY_RBFLAGS option:
- renamed to MEMORY_DISK_RBFLAGS to better fit the rest of the
MEMORY_DISK options(4)
- change default value to RB_AUTOBOOT instead of RB_SINGLE, and adapt
the config(5) files accordingly
- document this option inside options(4)

See also http://mail-index.netbsd.org/tech-kern/2008/12/25/msg003924.html

Reviewed by abs@ in private mail.
 1.51 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.50 31-Jul-2008  simonb branches: 1.50.2;
Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.49 30-May-2008  tsutsui branches: 1.49.4;
Add options COMPAT_40 to files which have options COMPAT_30.
 1.48 11-Mar-2008  matt branches: 1.48.2; 1.48.4; 1.48.6;
Update to new world order
 1.47 29-Dec-2006  yamt branches: 1.47.24; 1.47.40; 1.47.44;
update comments on NFS_V2_ONLY after nqnfs removal. no functional changes.
from Arnaud Lacombe.
 1.46 02-Oct-2006  chs remove MALLOC_NOINLINE, it doesn't do anything anymore.
 1.45 05-Feb-2006  cube branches: 1.45.14; 1.45.16;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.44 04-Feb-2006  rpaulo bpfilter is already supported.
 1.43 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.42 20-Dec-2005  thorpej branches: 1.42.2; 1.42.4; 1.42.6;
Remove the tablet line discipline.
 1.41 07-Dec-2005  tsutsui Remove obsolete options VNODE_OP_NOINLINE.
 1.40 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.39 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.38 19-Aug-2005  christos 64 bit inode changes.
 1.37 25-Feb-2005  simonb branches: 1.37.4;
Add COMPAT_20 (and COMPAT_16 in some cases) to kernel config files
that didn't have those options but had other earlier compat options.
 1.36 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.35 11-Feb-2005  dsl Add 'option FFS_SNAPSHOT' to most of the config files.
Commented out for kernels that appear to hace space constraints.
 1.34 31-Jan-2005  hannken Add file system snapshots to kernel configs.

- Ffs internal snapshots get compiled in unconditionally.

- File system snapshot device fss(4) added to all kernel configs that
have a disk. Device is commented out on all non-GENERIC kernels.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
 1.33 10-Nov-2004  christos branches: 1.33.4; 1.33.6;
Add COMPAT_BSDPTY to the rest of the config files.
 1.32 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.31 13-Feb-2004  wiz branches: 1.31.2;
Uppercase CPU, plural is CPUs.
 1.30 06-Sep-2003  itojun add rnd(4) device to installation media.
necessary for many purposes, including password seeding, tcp sequence number,
and more. see tech-security
 1.29 18-Sep-2002  lukem branches: 1.29.6;
enable USERCONF by default; it's small and extremely useful to have available.
 1.28 05-Jul-2002  abs Ensure all INSTALL config files consistantly include PIPE_SOCKETPAIR,
MALLOC_NOINLINE, and VNODE_OP_NOINLINE. The exceptions are when they
include another config files that already defines the options, or if
they are for an embedded board, just define a few extra options, and
do not already define PIPE_SOCKETPAIR.
 1.27 07-Jun-2002  ragge Change the uba devices from "xx0" to "xx*". Even if they have an exact
csr there may be multiple uba's in a machine and therefore multiple
matches for devices.
 1.26 25-Apr-2002  atatat branches: 1.26.2; 1.26.4;
Add the INCLUDE_CONFIG_FILE option to all config files. In config
files that are generic (ie, GENERIC, GENERICSBC, GENERIC32, ALL, or
ALPHA), it is uncommented.
 1.25 12-Apr-2002  gmcgarry Add commented-out USERCONF option. Mainly useful for install media
and can be optionally enabled based on miniroot and ramdisk size
requirements.
 1.24 02-Apr-2002  lukem Rename MEMORY_DISK_SIZE (formerly MINIROOTSIZE) to MEMORY_DISK_ROOT_SIZE,
which was suggested by Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> as
being more consistent with what it's controlling...
 1.23 29-Mar-2002  matt Make ramdisk 1.5MB in size. cleanup miniroot makefile
 1.22 28-Mar-2002  matt Add missing wskbd
 1.21 28-Mar-2002  matt Adapt to recent dz/wscons changes
 1.20 10-Mar-2002  lukem * rename MINIROOTSIZE to MEMORY_DISK_SIZE, so that all md(4) options
are now consistently named
* fold opt_mdsize.h into opt_md.h
 1.19 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.18 11-Dec-2001  ragge Add forgotten "hdc" and "rd" disks.
 1.17 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.16 16-May-2001  matt branches: 1.16.2; 1.16.8;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.15 13-May-2001  matt Add VAX640
 1.14 28-Jan-2001  ragge branches: 1.14.2;
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.13 19-Dec-2000  tsutsui Remove "rnd is EXPERIMENTAL" comments.
 1.12 10-Dec-2000  matt Add VAX 4000/200
 1.11 07-Dec-2000  matt Enable VS4000/90 SCSI controller in INSTALL kernel.
 1.10 02-Oct-2000  abs Ensure all INSTALL* kernels have two ptys, and a note explaining why:
pseudo-device pty 2 # pseudo-terminals (Sysinst needs two)
(Some installers may not be using sysinst, in which case this just reduces
the number of ptys from 16 that are not used to 2 that are not used)
For i386 conf files, no change other than comments.
 1.9 25-Sep-2000  abs Use "options<SPACE><TAB>" not "options<TAB>" - noted by simonb.
Move VNODE_OP_NOINLINE and NFS_V2_ONLY into '# Filesystem options' section.
Consistently label '# Filesystem options' and '#File systems' sections.
 1.8 25-Sep-2000  abs Ensure all INSTALL config files have (at least) COPTS="-Os", cincluding bebox
based on it working already for macppc.
Also add commented out:
#options VNODE_OP_NOINLINE # Don't inline vnode op calls
#options NFS_V2_ONLY # Exclude NFS3 and NQNFS code
as suggestions for additional savings
 1.7 26-Aug-2000  matt add a COMPAT_15 and remove TCP_COMPAT_42
 1.6 19-Jun-2000  matt branches: 1.6.2;
Rename ncr[5380] device to si to more consistent with other ports.
Add VAX660 to cputype.h. Remove needs-flag from si & asc entries.
 1.5 11-Jun-2000  matt Comment out asc0 for vs4000/90. remove slip/ppp.
 1.4 17-May-2000  matt branches: 1.4.2;
Sync closer to GENERIC.
 1.3 04-Mar-2000  ragge Change some install options. From Todd Whitesel.
 1.2 29-Jul-1999  augustss branches: 1.2.2;
It's time to be COMPAT_14.
 1.1 01-Apr-1999  ragge branches: 1.1.2; 1.1.4;
Slimmed install kernel with md-root.
 1.1.4.1 02-Aug-1999  thorpej Update from trunk.
 1.1.2.1 01-Mar-2000  he Apply patch (requested by toddpw):
Finish porting sysinst to vax, and build various bootable installers
in new directory distrib/vax/bootfs.
 1.2.2.5 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.2.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.2.2.2 08-Dec-2000  bouyer Sync with HEAD.
 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.4.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.2.2 20-Mar-2001  he Pull up revision 1.12 (requested by matt):
Add VAX 4000/200.
 1.6.2.1 13-Dec-2000  he Pull up revision 1.11 (requested by matt):
Enable VS4000/90 SCSI controller.
 1.14.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.16.8.8 18-Oct-2002  nathanw Catch up to -current.
 1.16.8.7 01-Aug-2002  nathanw Catch up to -current.
 1.16.8.6 20-Jun-2002  nathanw Catch up to -current.
 1.16.8.5 17-Apr-2002  nathanw Catch up to -current.
 1.16.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.16.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.16.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.16.8.1 16-May-2001  nathanw file INSTALL was added on branch nathanw_sa on 2002-01-08 00:28:30 +0000
 1.16.2.6 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.16.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.16.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.16.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.16.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.16.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.26.4.1 07-Jun-2002  thorpej pullup-1-6 ticket #203:

syssrc/sys/arch/vax/conf/GENERIC 1.98
syssrc/sys/arch/vax/conf/INSTALL 1.27

Original log message:

Change the uba devices from "xx0" to "xx*". Even if they have an exact
csr there may be multiple uba's in a machine and therefore multiple
matches for devices.
 1.26.2.2 17-Jul-2002  gehenna catch up with -current.
 1.26.2.1 15-Jul-2002  gehenna catch up with -current.
 1.29.6.9 11-Dec-2005  christos Sync with head.
 1.29.6.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.29.6.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.29.6.6 15-Feb-2005  skrll Sync with HEAD.
 1.29.6.5 04-Feb-2005  skrll Sync with HEAD.
 1.29.6.4 14-Nov-2004  skrll Sync with HEAD.
 1.29.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.29.6.1 03-Aug-2004  skrll Sync with HEAD
 1.31.2.1 15-Jul-2004  he Pull up revision 1.32 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.33.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.33.6.1 12-Feb-2005  yamt sync with head.
 1.33.4.1 29-Apr-2005  kent sync with -current
 1.37.4.3 17-Mar-2008  yamt sync with head.
 1.37.4.2 30-Dec-2006  yamt sync with head.
 1.37.4.1 21-Jun-2006  yamt sync with head.
 1.42.6.1 22-Apr-2006  simonb Sync with head.
 1.42.4.1 09-Sep-2006  rpaulo sync with head
 1.42.2.1 18-Feb-2006  yamt sync with head.
 1.45.16.1 22-Oct-2006  yamt sync with head
 1.45.14.2 12-Jan-2007  ad Sync with head.
 1.45.14.1 18-Nov-2006  ad Sync with head.
 1.47.44.4 17-Jan-2009  mjf Sync with HEAD.
 1.47.44.3 28-Sep-2008  mjf Sync with HEAD.
 1.47.44.2 02-Jun-2008  mjf Sync with HEAD.
 1.47.44.1 03-Apr-2008  mjf Sync with HEAD.
 1.47.40.1 24-Mar-2008  keiichi sync with head.
 1.47.24.1 23-Mar-2008  matt sync with HEAD
 1.48.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.48.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.48.4.2 11-Aug-2010  yamt sync with head.
 1.48.4.1 04-May-2009  yamt sync with head.
 1.48.2.1 04-Jun-2008  yamt sync with head
 1.49.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.49.4.1 19-Oct-2008  haad Sync with HEAD.
 1.50.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.50.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.52.6.3 21-Apr-2011  rmind sync with head
 1.52.6.2 05-Mar-2011  rmind sync with head
 1.52.6.1 30-May-2010  rmind sync with head
 1.52.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.54.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.54.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.56.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.56.2.2 30-Oct-2012  yamt sync with head
 1.56.2.1 17-Apr-2012  yamt sync with head
 1.57.2.2 05-Apr-2012  mrg sync to latest -current.
 1.57.2.1 18-Feb-2012  mrg merge to -current.
 1.58.2.3 25-Jul-2012  martin Pull up following revision(s) (requested by abs in ticket #446):
gnu/dist/gcc4/gcc/config/vax/vax.md: revision 1.16
external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.6
distrib/vax/ramdisk/Makefile: revision 1.27
gnu/dist/gcc4/gcc/config/vax/builtins.md: revision 1.4
external/gpl3/binutils/dist/bfd/elf32-vax.c: revision 1.6
sys/arch/vax/conf/INSTALL: revision 1.59
Two fixes. Better PLT pruning (don't emit PLTs for local functions).
If emitting a reloc against a readonly section in a shared image,
cause TEXTREL to be set.
Warn about using a symbol as a displacement in PIC mode.
Fix ffssi2 again.
Use a UNSPEC for the internal ffs.
use (match_dup 1) since Z will be set if it is 0 just as if tst:SI was done.
This can let gcc produce better code if you code appropriately.
Bump the ramdisk size so that the contents fits again.
 1.58.2.2 05-Jul-2012  riz Pull up following revision(s) (requested by abs in ticket #405):
etc/etc.vax/MAKEDEV.conf: revision 1.15
etc/etc.vax/MAKEDEV.conf: revision 1.16
sys/arch/vax/conf/INSTALL: revision 1.61
sys/arch/vax/conf/INSTALL: revision 1.62
distrib/vax/install.md: file removal
distrib/vax/ramdisk/list: revision 1.30
distrib/vax/miniroot/list: revision 1.15
distrib/vax/miniroot/Makefile.inc: revision 1.22
distrib/vax/ramdisk/Makefile: revision 1.30
distrib/vax/ramdisk/dot.profile: revision 1.9
All apply to vax only:
- Drop KERNFS from INSTALL kernel
- Add dmesg to sysinst ramdisk
- Add 'ramdisk' target to MAKEDEV and use
- Add dhcpcd to sysinst ramdisk
- Drop old install.md script
- Misc install image cleanup (reduce diff to zaurus of all things)
Sync devices with GENERIC, and include bpfilter to allow dhcpcd to work
Ensure the ramdisk has bpf for dhcpcd
 1.58.2.1 04-Jul-2012  jdc Pull up revisions:
src/etc/etc.vax/MAKEDEV.conf revision 1.14
src/sys/arch/vax/conf/GENERIC revision 1.182
src/sys/arch/vax/conf/INSTALL revision 1.60
src/sys/arch/vax/conf/VAX780 revision 1.9
src/sys/arch/vax/conf/majors.vax revision 1.24
src/sys/arch/vax/vax/disksubr.c revision 1.53
src/sys/dev/DEVNAMES revision 1.275
src/sys/dev/mscp/files.mscp revision 1.8
src/sys/dev/mscp/mscp_disk.c revision 1.72
src/sys/dev/mscp/mscp_subr.c revision 1.42
src/distrib/vax/ramdisk/Makefile revision 1.29
(requested by abs in ticket #385).

- Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number

Include racd0 and racd1 on ramdisk
 1.63.2.4 03-Dec-2017  jdolecek update from HEAD
 1.63.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.63.2.2 23-Jun-2013  tls resync from head
 1.63.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.66.4.1 18-May-2014  rmind sync with head
 1.70.2.2 05-Feb-2017  skrll Sync with HEAD
 1.70.2.1 22-Sep-2015  skrll Sync with HEAD
 1.71.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.73.2.1 02-May-2018  pgoyette Synch with HEAD
 1.74.8.1 25-Jan-2020  ad Sync with head.
 1.74.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.75.24.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.77.6.1 02-Aug-2025  perseant Sync with HEAD
 1.86 07-Oct-2023  rin Drop -O[01] hacks for vax; no longer necessary for patched GCC 10

PR port-vax/57646: Import major vax toolchain fix by Kalvis Duckmanton

XXXRO: GCC 12 may require hacks for a while, but it turned out that
GCC 12 should be treated differently from older versions; a lot of new
files need -O[01] flags, while some may no longer require it.

I will take a look later.

Note that these hacks are not required if Kalvis's patches for GCC 12
are applied.

Keep doc/HACKS entries for a while (will be sync with update for GCC 12).

diff --git a/crypto/external/bsd/openssh/lib/Makefile b/crypto/external/bsd/openssh/lib/Makefile
index 96a93f5e396..4e38be1b642 100644
--- a/crypto/external/bsd/openssh/lib/Makefile
+++ b/crypto/external/bsd/openssh/lib/Makefile
@@ -117,12 +117,6 @@ COPTS.${f}.c+= -Wno-pointer-sign
# XXX
COPTS.channels.c+= -fno-strict-aliasing

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.poly1305.c+= -O0
-COPTS.umac.c+= -O0
-.endif
-
COPTS.hostfile.c+= ${CC_WNO_FORMAT_TRUNCATION}
COPTS.sshkey.c+= ${CC_WNO_FORMAT_TRUNCATION}
COPTS.cipher.c+= -Wno-error=deprecated-declarations
diff --git a/distrib/utils/x_ping/Makefile b/distrib/utils/x_ping/Makefile
index f1c452a0d60..8ee77580a3f 100644
--- a/distrib/utils/x_ping/Makefile
+++ b/distrib/utils/x_ping/Makefile
@@ -12,10 +12,6 @@ CPPFLAGS+= -I${SRCDIR} -DCRUNCHOPS
DPADD= ${LIBM}
LDADD= -lm

-.if ${MACHINE_ARCH} == "vax"
-COPTS.ping.c=-O0
-.endif
-
.include <bsd.prog.mk>

.PATH: ${SRCDIR}
diff --git a/external/apache2/argon2/lib/libargon2/Makefile.inc b/external/apache2/argon2/lib/libargon2/Makefile.inc
index d3f4470c6c7..6a1dd146d7d 100644
--- a/external/apache2/argon2/lib/libargon2/Makefile.inc
+++ b/external/apache2/argon2/lib/libargon2/Makefile.inc
@@ -16,7 +16,3 @@ CFLAGS+= -pthread
LDADD+=-lpthread
DPADD+=${LIBPTHREAD}
.endif
-
-.if ${MACHINE} == "vax"
-COPTS.blake2b.c+= -O0
-.endif
diff --git a/external/bsd/jemalloc/lib/Makefile.inc b/external/bsd/jemalloc/lib/Makefile.inc
index 2f524358f46..d5da774f293 100644
--- a/external/bsd/jemalloc/lib/Makefile.inc
+++ b/external/bsd/jemalloc/lib/Makefile.inc
@@ -53,12 +53,6 @@ COPTS.ctl.c+=-Wno-error=stack-protector
COPTS.stats.c+=-Wno-error=stack-protector
COPTS.tcache.c+=-Wno-error=stack-protector

-.if ${MACHINE_ARCH} == "vax"
-# in merge_overlapping_regs, at regrename.c
-COPTS.arena.c+=-O0
-COPTS.extent.c+=-O0
-.endif
-
SRCS+=${JEMALLOC_SRCS}

jemalloc.d jemalloc.pico jemalloc.o jemalloc.ln jemalloc.po jemalloc.go: \
diff --git a/external/bsd/mdocml/lib/libmandoc/Makefile b/external/bsd/mdocml/lib/libmandoc/Makefile
index 40d7e29ae88..dfd3077a2c7 100644
--- a/external/bsd/mdocml/lib/libmandoc/Makefile
+++ b/external/bsd/mdocml/lib/libmandoc/Makefile
@@ -39,11 +39,6 @@ tbl_opts.c

MAN= mandoc.3

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.mdoc_macro.c+=-O0
-.endif
-
COPTS.man_validate.c+=-Wno-error=array-bounds

.include <bsd.lib.mk>
diff --git a/external/gpl3/binutils.old/lib/libbfd/Makefile b/external/gpl3/binutils.old/lib/libbfd/Makefile
index 03477232b55..74a354532fa 100644
--- a/external/gpl3/binutils.old/lib/libbfd/Makefile
+++ b/external/gpl3/binutils.old/lib/libbfd/Makefile
@@ -41,10 +41,6 @@ CPPFLAGS+= -I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \
-DDEBUGDIR=\"${DEBUGDIR}\" -DLIBDIR=\"${LIBDIR}\" \
-DBINDIR=\"${BINDIR}\"

-.if (${BFD_MACHINE_ARCH} == "vax")
-CPPFLAGS.elf.c += -O0
-.endif
-
COPTS.pei-x86_64.c+= -Wno-stack-protector
COPTS.elfxx-mips.c+= -Wno-stack-protector
COPTS.elf.c+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-overflow :}
diff --git a/external/gpl3/binutils/lib/libbfd/Makefile b/external/gpl3/binutils/lib/libbfd/Makefile
index 00cb2b20081..a3f0c25fd35 100644
--- a/external/gpl3/binutils/lib/libbfd/Makefile
+++ b/external/gpl3/binutils/lib/libbfd/Makefile
@@ -41,10 +41,6 @@ CPPFLAGS+= -I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \
-DDEBUGDIR=\"${DEBUGDIR}\" -DLIBDIR=\"${LIBDIR}\" \
-DBINDIR=\"${BINDIR}\"

-.if (${BFD_MACHINE_ARCH} == "vax")
-CPPFLAGS.elf.c += -O0
-.endif
-
COPTS.pei-x86_64.c+= -Wno-stack-protector
COPTS.elfxx-mips.c+= -Wno-stack-protector
COPTS.elf.c+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-overflow :}
diff --git a/external/gpl3/gcc.old/lib/Makefile.sanitizer b/external/gpl3/gcc.old/lib/Makefile.sanitizer
index efd36ae4bee..5173a5109a0 100644
--- a/external/gpl3/gcc.old/lib/Makefile.sanitizer
+++ b/external/gpl3/gcc.old/lib/Makefile.sanitizer
@@ -88,22 +88,3 @@ COPTS+=-fno-builtin -fno-exceptions -fno-rtti -funwind-tables

# Can't profile without it`
#-fomit-frame-pointer
-
-.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_allocator.cc += -O1
-COPTS.sanitizer_common.cc += -O1
-COPTS.sanitizer_common_libcdep.cc += -O1
-COPTS.sanitizer_coverage_libcdep.cc += -O1
-COPTS.sanitizer_coverage_mapping_libcdep.cc += -O1
-COPTS.sanitizer_deadlock_detector1.cc += -O1
-COPTS.sanitizer_mac.cc += -O1
-COPTS.sanitizer_netbsd.cc += -O1
-COPTS.sanitizer_posix.cc += -O1
-COPTS.sanitizer_printf.cc += -O1
-COPTS.sanitizer_procmaps_common.cc += -O1
-COPTS.sanitizer_stackdepot.cc += -O1
-COPTS.sanitizer_symbolizer_libcdep.cc += -O1
-COPTS.sanitizer_symbolizer_report.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
-.endif
diff --git a/external/gpl3/gcc.old/lib/libasan/Makefile b/external/gpl3/gcc.old/lib/libasan/Makefile
index 1e6f9608abe..3da7bbf2f58 100644
--- a/external/gpl3/gcc.old/lib/libasan/Makefile
+++ b/external/gpl3/gcc.old/lib/libasan/Makefile
@@ -49,14 +49,6 @@ LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
CPPFLAGS+=-DCAN_SANITIZE_UB=0

-.if ${MACHINE_ARCH} == "vax"
-COPTS.asan_allocator.cc += -O1
-COPTS.asan_report.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
-.endif
-
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
COPTS.asan_interceptors.cc += -O1
.endif
diff --git a/external/gpl3/gcc.old/lib/liblsan/Makefile b/external/gpl3/gcc.old/lib/liblsan/Makefile
index 4578544a9a8..ddb7981077c 100644
--- a/external/gpl3/gcc.old/lib/liblsan/Makefile
+++ b/external/gpl3/gcc.old/lib/liblsan/Makefile
@@ -16,11 +16,6 @@ LSAN_SRCS+= \
lsan_linux.cc \
lsan_thread.cc

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lsan_allocator.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-.endif
-
LIB= lsan
SRCS+= ${LSAN_SRCS}
LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
diff --git a/external/gpl3/gcc.old/lib/libubsan/Makefile b/external/gpl3/gcc.old/lib/libubsan/Makefile
index 2e2faca7b1c..9de82550d14 100644
--- a/external/gpl3/gcc.old/lib/libubsan/Makefile
+++ b/external/gpl3/gcc.old/lib/libubsan/Makefile
@@ -26,10 +26,6 @@ UBSAN_SRCS= \
COPTS.${_s}.cc+=-frtti
.endfor

-.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_file.cc += -O1
-.endif
-
LIB= ubsan
SRCS+= ${UBSAN_SRCS}
LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
diff --git a/external/gpl3/gcc.old/usr.bin/cc1/Makefile b/external/gpl3/gcc.old/usr.bin/cc1/Makefile
index c55e292ee8e..ff12a5be524 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1/Makefile
@@ -46,17 +46,6 @@ CPPFLAGS.default-c.c+= -I${BACKENDOBJ}
BUILDSYMLINKS+= ${GNUHOSTDIST}/gcc/config/sh/sh-c.cc sh-c.c
.endif

-.if ${MACHINE_CPU} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1-checksum.c+=-O0
-.endif
-
.if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
COPTS.c-common.c+=-O3
.endif
diff --git a/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile b/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
index 3123ee0d60b..aab82ad3448 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
@@ -44,16 +44,8 @@ COPTS.objc-act.c+= -Wno-stack-protector
COPTS.objc-gnu-runtime-abi-01.c+= -Wno-stack-protector
COPTS.objc-next-runtime-abi-01.c+= -Wno-stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1obj-checksum.c+=-O0
-.endif
+COPTS.c-cppbuiltin.c+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=format-overflow :}
+COPTS.c-typeck.c+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=format-overflow :}

.if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
COPTS.c-common.c+=-O3
diff --git a/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile b/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
index b9c108251c5..e04e8fc7f53 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
@@ -69,18 +69,6 @@ COPTS.objc-act.c+= -Wno-stack-protector
COPTS.objc-gnu-runtime-abi-01.c+= -Wno-stack-protector
COPTS.objc-next-runtime-abi-01.c+= -Wno-stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1obj-checksum.c+=-O0
-COPTS.decl.c+=-O0
-.endif
-
.if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
COPTS.c-common.c+=-O3
.endif
diff --git a/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile b/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
index 7936efd3a5e..7c54559e21a 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
@@ -31,23 +31,6 @@ CHECKSUM_OBJS= ${LIBBACKTRACEOBJ}/libbacktrace.a \

CFLAGS+= -Wno-error=stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.call.c+=-O0
-COPTS.decl.c+=-O0
-COPTS.typeck2.c+=-O0
-COPTS.class.c+=-O0
-COPTS.typeck.c+=-O0
-COPTS.init.c+=-O0
-COPTS.semantics.c+=-O0
-COPTS.mangle.c+=-O0
-COPTS.constexpr.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1plus-checksum.c+=-O0
-.endif
-
.if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
COPTS.c-common.c+=-O3
.endif
diff --git a/external/gpl3/gcc.old/usr.bin/gcc/Makefile b/external/gpl3/gcc.old/usr.bin/gcc/Makefile
index 7a66d77ffc7..a5a4b1c3adf 100644
--- a/external/gpl3/gcc.old/usr.bin/gcc/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/gcc/Makefile
@@ -25,9 +25,6 @@ ${SRCS}: ${GCCARCH}/defs.mk
.include <bsd.info.mk>

COPTS.gcc.c= -Wno-stack-protector
-.if ${MACHINE_ARCH} == "vax"
-COPTS.dse.c= -O1
-.endif

.PATH: ${DIST}/gcc ${DIST}/gcc/doc ${DIST}/gcc/c

diff --git a/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile b/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
index 751d1513eec..33aeb1c9898 100644
--- a/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
@@ -14,10 +14,6 @@ SRCS= decNumber.c decContext.c decimal32.c decimal64.c decimal128.c
CPPFLAGS+= -I${.CURDIR}/arch/${GCC_MACHINE_ARCH} -I${DIST}/libdecnumber
CPPFLAGS+= -I${DIST}/libgcc

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
.include <bsd.lib.mk>

# Force using C++ for this
diff --git a/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile b/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
index 90f44a9fcf6..fd251464fb7 100644
--- a/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
@@ -24,11 +24,6 @@ COPTS.lto-common.c+= -Wno-stack-protector
.include "../Makefile.backtrace"
.include "../Makefile.libdecnumber"

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lto-lang.c+=-O0
-COPTS.lto-symtab.c+=-O0
-.endif
-
LDADD+= ${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
DPADD+= ${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} ${LIBINTL} ${LIBZ} ${LIBM}

diff --git a/external/gpl3/gcc.old/usr.bin/lto1/Makefile b/external/gpl3/gcc.old/usr.bin/lto1/Makefile
index 4c49161a64c..340d3c6124f 100644
--- a/external/gpl3/gcc.old/usr.bin/lto1/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/lto1/Makefile
@@ -21,11 +21,6 @@ COPTS.lto-common.c+= -Wno-stack-protector
.include "../Makefile.libcpp"
.include "../Makefile.libdecnumber"

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lto-lang.c+=-O0
-COPTS.lto-symtab.c+=-O0
-.endif
-
LDADD+= ${LIBIBERTYOBJ}/libiberty.a
DPADD+= ${LIBIBERTYOBJ}/libiberty.a
LDADD+= ${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
diff --git a/external/gpl3/gdb.old/lib/libdecnumber/Makefile b/external/gpl3/gdb.old/lib/libdecnumber/Makefile
index bcd4ae5b222..ce28811526b 100644
--- a/external/gpl3/gdb.old/lib/libdecnumber/Makefile
+++ b/external/gpl3/gdb.old/lib/libdecnumber/Makefile
@@ -18,10 +18,6 @@ CPPFLAGS+= -I${.CURDIR}/arch/${GDB_MACHINE_ARCH} \

SRCS= ${G_OBJS:.o=.c} ${G_SOURCES}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
.PATH: ${DIST}/libdecnumber ${DIST}/libdecnumber/dpd

.include <bsd.lib.mk>
diff --git a/external/gpl3/gdb/lib/libdecnumber/Makefile b/external/gpl3/gdb/lib/libdecnumber/Makefile
index c95d36e3dfa..e3169865304 100644
--- a/external/gpl3/gdb/lib/libdecnumber/Makefile
+++ b/external/gpl3/gdb/lib/libdecnumber/Makefile
@@ -18,10 +18,6 @@ CPPFLAGS+= -I${.CURDIR}/arch/${GDB_MACHINE_ARCH} \

SRCS= ${G_OBJS:.o=.c} ${G_SOURCES}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
.PATH: ${DIST}/libdecnumber ${DIST}/libdecnumber/dpd ${DIST}/libdecnumber/bid

.include <bsd.lib.mk>
diff --git a/external/gpl3/gdb/lib/libgdb/Makefile b/external/gpl3/gdb/lib/libgdb/Makefile
index b87a515d13a..c118c363975 100644
--- a/external/gpl3/gdb/lib/libgdb/Makefile
+++ b/external/gpl3/gdb/lib/libgdb/Makefile
@@ -66,12 +66,6 @@ CFLAGS:= ${CXXFLAGS} -std=gnu++17 -Wno-error=stack-protector

ada-exp.c: ada-lex.c

-.if ${MACHINE} == "vax"
-. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
-COPTS.read.c+= -O0
-. endif
-.endif
-
# These are generated by implicit rules and are not easy to generate
CLEANDIRFILES+= \
ada-exp.c ada-lex.c \
diff --git a/external/mit/xorg/lib/gallium.old/Makefile b/external/mit/xorg/lib/gallium.old/Makefile
index 55b2fe3d1c1..bfa40c8974f 100644
--- a/external/mit/xorg/lib/gallium.old/Makefile
+++ b/external/mit/xorg/lib/gallium.old/Makefile
@@ -1211,10 +1211,6 @@ SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHL
COPTS+= ${${ACTIVE_CC} == "clang":? -Wa,-Av8plus :}
.endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.nir.c += -O1
-.endif
-
# XXXGCC12
.if ${MACHINE_ARCH} == "m68k"
COPTS.st_glsl_to_tgsi.cpp += -O1
diff --git a/external/mit/xorg/lib/gallium/Makefile b/external/mit/xorg/lib/gallium/Makefile
index 6778a8c11c8..9f1422080fe 100644
--- a/external/mit/xorg/lib/gallium/Makefile
+++ b/external/mit/xorg/lib/gallium/Makefile
@@ -1428,10 +1428,6 @@ SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHL
COPTS+= ${${ACTIVE_CC} == "clang":? -Wa,-Av8plus :}
.endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.nir.c += -O1
-.endif
-
COPTS.u_atomic.c+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-builtin-declaration-mismatch :}

.include <bsd.lib.mk>
diff --git a/external/mit/xorg/lib/libX11/Makefile.libx11 b/external/mit/xorg/lib/libX11/Makefile.libx11
index e103d9ace12..0e55c2a4732 100644
--- a/external/mit/xorg/lib/libX11/Makefile.libx11
+++ b/external/mit/xorg/lib/libX11/Makefile.libx11
@@ -471,11 +471,6 @@ COPTS.OpenDis.c+= -Wno-error # XXX xf86bigfstr.h
COPTS.XlibInt.c+= -Wno-error # XXX xcmiscstr.h
COPTS.XKBBind.c+= -Wno-deprecated-declarations # uses XKeycodeToKeysym

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.lcWrap.c+= -O0
-.endif
-
CWARNFLAGS.clang+= -Wno-string-plus-int

.include "${NETBSDSRCDIR}/external/mit/xorg/tools/makekeys/Makefile.makekeys"
diff --git a/games/gomoku/Makefile b/games/gomoku/Makefile
index e86a63aaea7..678537066ed 100644
--- a/games/gomoku/Makefile
+++ b/games/gomoku/Makefile
@@ -9,10 +9,6 @@ LDADD= -lcurses -lterminfo
HIDEGAME=hidegame
CPPFLAGS+= ${DEBUG:D-DDEBUG}

-.if ${MACHINE} == "vax"
-COPTS.pickmove.c += -O0
-.endif
-
#WARNS= 6 # would produce warnings about small integer types
LINTFLAGS+= -w # treat warnings as errors
LINTFLAGS+= -T # strict bool mode
diff --git a/games/phantasia/Makefile b/games/phantasia/Makefile
index e9c53f23ae5..b919dac17c6 100644
--- a/games/phantasia/Makefile
+++ b/games/phantasia/Makefile
@@ -52,7 +52,3 @@ map: map.c
./map | plot > /dev/tty

.include <bsd.prog.mk>
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.misc.c+= -O0
-.endif
diff --git a/lib/i18n_module/UTF7/Makefile b/lib/i18n_module/UTF7/Makefile
index 712c1515d42..7136f7f0cc3 100644
--- a/lib/i18n_module/UTF7/Makefile
+++ b/lib/i18n_module/UTF7/Makefile
@@ -3,6 +3,3 @@
SRCPRE=citrus_
.include <bsd.lib.mk>

-.if ${MACHINE_ARCH} == "vax" && defined(HAVE_GCC)
-COPTS.citrus_utf7.c+= -O0
-.endif
diff --git a/lib/libbz2/Makefile b/lib/libbz2/Makefile
index b2aea1e04b0..e60a2862d48 100644
--- a/lib/libbz2/Makefile
+++ b/lib/libbz2/Makefile
@@ -15,11 +15,6 @@ SRCS= blocksort.c huffman.c crctable.c randtable.c compress.c \
INCS= bzlib.h
INCSDIR= /usr/include

-# XXX huffman.c gets mis-compiled with 2.95.3
-.if ${MACHINE_ARCH} == "vax"
-COPTS+= -O0
-.endif
-
COPTS+= ${CC_WNO_IMPLICIT_FALLTHROUGH}

# XXX blocksort.c gets mis-compiled with 4.1
diff --git a/lib/libc/gdtoa/Makefile.inc b/lib/libc/gdtoa/Makefile.inc
index 132686fc33d..609da919803 100644
--- a/lib/libc/gdtoa/Makefile.inc
+++ b/lib/libc/gdtoa/Makefile.inc
@@ -44,10 +44,3 @@ SRCS+= dmisc.c \
.if ${MACHINE_ARCH} != "vax"
SRCS+= strtord.c
.endif
-
-# XXX revisit with newer GCC.
-# Ensure numbers like 0xffff319f5fa95963 print correctly
-# ("999999999999999.98", not garbage like "?A>C>@>C:BA;A><.:<")
-.if ${MACHINE_ARCH} == "vax" && defined(HAVE_GCC)
-COPTS.misc.c+= -O0
-.endif
diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile
index cb3f89d6d09..e9c8be820da 100644
--- a/lib/libcrypt/Makefile
+++ b/lib/libcrypt/Makefile
@@ -30,9 +30,6 @@ SRCS+= crypt-argon2.c
SRCS+= ${src}
COPTS.${src}+= -fvisibility=hidden
. endfor
-. if ${MACHINE} == "vax"
-COPTS.blake2b.c+= -O0
-. endif
.endif

WARNS?= 5
diff --git a/libexec/ld.elf_so/Makefile b/libexec/ld.elf_so/Makefile
index f5baae1e883..24f7e1121e5 100644
--- a/libexec/ld.elf_so/Makefile
+++ b/libexec/ld.elf_so/Makefile
@@ -141,10 +141,6 @@ CPPFLAGS+= -DRTLD_DEFAULT_LIBRARY_PATH=\"${SHLIBDIR}:${LIBDIR}\"
COPTS.rtld.c+= -Wno-stack-protector
COPTS.symbol.c+=-Wno-stack-protector

-.if ${MACHINE_CPU} == "vax"
-COPTS.rtld.c+= -O0
-.endif
-
LDADD+= -Wl,--version-script=${.CURDIR}/symbols.map
LDADD+= -L${CLIBOBJ} -L${DESTDIR}${LIBDIR}
.if ${MKPICLIB} != "no"
diff --git a/sbin/fsck_ffs/Makefile.common b/sbin/fsck_ffs/Makefile.common
index 765638b2801..824e3bf2628 100644
--- a/sbin/fsck_ffs/Makefile.common
+++ b/sbin/fsck_ffs/Makefile.common
@@ -36,7 +36,3 @@ COPTS.ffs_appleufs.c+= -Wno-pointer-sign
.if ${MACHINE_ARCH} == "m68000"
COPTS.pass1.c+= -fno-tree-fre -fno-tree-lrs
.endif
-.if ${MACHINE_ARCH} == "vax"
-COPTS.pass1.c+= -O0
-COPTS.inode.c+= -O0
-.endif
diff --git a/sbin/fsdb/Makefile b/sbin/fsdb/Makefile
index c039f73a1eb..3b0331e5880 100644
--- a/sbin/fsdb/Makefile
+++ b/sbin/fsdb/Makefile
@@ -39,12 +39,6 @@ COPTS.${f}.c+= -Wno-pointer-sign
COPTS.pass1.c+= -fno-tree-fre -fno-tree-lrs
.endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.pass1.c+= -O0
-COPTS.inode.c+= -O0
-COPTS.fsdb.c+= -O0
-.endif
-
CWARNFLAGS.gcc+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

.include <bsd.prog.mk>
diff --git a/sbin/newfs_ext2fs/Makefile b/sbin/newfs_ext2fs/Makefile
index 40a44b9a038..ecfdbff4d3a 100644
--- a/sbin/newfs_ext2fs/Makefile
+++ b/sbin/newfs_ext2fs/Makefile
@@ -20,8 +20,4 @@ DPADD+=${LIBPROP}

.PATH: ${NETBSDSRCDIR}/sys/ufs/ext2fs ${FSCK}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.mke2fs.c=-O0
-.endif
-
.include <bsd.prog.mk>
diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile
index 4f33501ea7a..1f7f56e3ea5 100644
--- a/sbin/ping/Makefile
+++ b/sbin/ping/Makefile
@@ -12,8 +12,4 @@ CPPFLAGS+= -DIPSEC
LDADD+= -lipsec
DPADD+= ${LIBIPSEC}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.ping.c=-O0
-.endif
-
.include <bsd.prog.mk>
diff --git a/sys/arch/vax/conf/Makefile.vax b/sys/arch/vax/conf/Makefile.vax
index cf095d54a86..c483eaa644a 100644
--- a/sys/arch/vax/conf/Makefile.vax
+++ b/sys/arch/vax/conf/Makefile.vax
@@ -34,7 +34,6 @@ GENASSYM_CONF= ${VAX}/vax/genassym.cf
CPPFLAGS+= -D_VAX_INLINE_
AFLAGS+= -x assembler-with-cpp -fno-pic
CFLAGS+= -fno-pic
-COPTS.wsmux.c+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -O1 :}


##
diff --git a/sys/lib/libsa/Makefile b/sys/lib/libsa/Makefile
index 718c97ce857..4ef3840c753 100644
--- a/sys/lib/libsa/Makefile
+++ b/sys/lib/libsa/Makefile
@@ -96,7 +96,3 @@ SRCS+= ufs.c
lib${LIB}.o:: ${OBJS:O} __buildstdlib

CPPFLAGS+= -Wno-pointer-sign
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.bootp.c+= -O0
-.endif
diff --git a/sys/lib/libz/Makefile b/sys/lib/libz/Makefile
index 6945c0da6c6..61fb7d4f652 100644
--- a/sys/lib/libz/Makefile
+++ b/sys/lib/libz/Makefile
@@ -25,7 +25,3 @@ CLEANFILES+= lib${LIB}.o
.include <bsd.lib.mk>

lib${LIB}.o:: ${OBJS:O} __buildstdlib
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.inftrees.c+= -O0
-.endif
diff --git a/sys/modules/lfs/Makefile b/sys/modules/lfs/Makefile
index 962538821a5..ea8f187e160 100644
--- a/sys/modules/lfs/Makefile
+++ b/sys/modules/lfs/Makefile
@@ -18,9 +18,4 @@ SRCS+= ulfs_bmap.c ulfs_dirhash.c ulfs_inode.c ulfs_lookup.c \

WARNS= 3

-.if ${MACHINE} == "vax"
-# GCC 6.5 and 7.4 cannot compile this with -DDIAGNOSTIC and -O2/-O1
-COPTS.lfs_inode.c+= -O0
-.endif
-
.include <bsd.kmodule.mk>
diff --git a/sys/rump/fs/lib/liblfs/Makefile b/sys/rump/fs/lib/liblfs/Makefile
index abade3767d9..68b74c62502 100644
--- a/sys/rump/fs/lib/liblfs/Makefile
+++ b/sys/rump/fs/lib/liblfs/Makefile
@@ -17,9 +17,6 @@ SRCS+= ulfs_bmap.c ulfs_dirhash.c ulfs_extattr.c \


CFLAGS+= -DLFS_KERNEL_RFW
-.if ${MACHINE_ARCH} == "vax"
-COPTS.lfs_inode.c+=-O0
-.endif

.include <bsd.lib.mk>
.include <bsd.klinks.mk>
diff --git a/usr.sbin/mtrace/Makefile b/usr.sbin/mtrace/Makefile
index aef09db6198..9c125c15265 100644
--- a/usr.sbin/mtrace/Makefile
+++ b/usr.sbin/mtrace/Makefile
@@ -12,10 +12,6 @@ PROG= mtrace
SRCS= igmp.c inet.c kern.c mtrace.c
MAN= mtrace.8

-.if ${MACHINE_ARCH} == "vax"
-COPTS.mtrace.c=-O0
-.endif
-
BINMODE=4555
BINOWN= root

diff --git a/external/gpl3/gcc.old/usr.bin/backend/Makefile b/external/gpl3/gcc.old/usr.bin/backend/Makefile
index d69a26fe619..99e881c783d 100644
--- a/external/gpl3/gcc.old/usr.bin/backend/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/backend/Makefile
@@ -533,68 +533,9 @@ COPTS.insn-recog.c+=-Wno-error

.if ${GCC_MACHINE_ARCH} == "vax"
CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}
-COPTS.builtins.c+=-O0
-COPTS.calls.c+=-O0
-COPTS.convert.c+=-O0
-COPTS.data-streamer-out.c+=-O0
-COPTS.dse.c+=-O0 # XXX port-vax/51967
-COPTS.dwarf2out.c+=-O0
-COPTS.expmed.c+=-O0
-COPTS.expr.c+=-O0 -Wno-error=tautological-compare
-COPTS.fixed-value.c+=-O0
-COPTS.fold-const.c+=-O0
-COPTS.generic-match.c+=-O0
-COPTS.gimple-fold.c+=-O0
-COPTS.gimple-match.c+=-O0
-COPTS.gimple-ssa-strength-reduction.c+=-O0
-COPTS.gimple-ssa-warn-restrict.c+=-O0
-COPTS.gimple.c+=-O0
-COPTS.internal-fn.c+=-O0
-COPTS.lto-streamer-out.c+=-O0
-COPTS.omp-low.c+=-O0
-COPTS.predict.c+=-O0
-COPTS.range-op.cc+=-O0
-COPTS.recog.c+=-O0
-COPTS.sanopt.c+=-O0
-COPTS.stmt.c+=-O0
-COPTS.stor-layout.c+=-O0
-COPTS.targhooks.c+=-O0
-COPTS.tree-affine.c+=-O0
-COPTS.tree-cfg.c+=-O0
-COPTS.tree-data-ref.c+=-O0
-COPTS.tree-eh.c+=-O0
-COPTS.tree-if-conv.c+=-O0
-COPTS.tree-object-size.c+=-O0
-COPTS.tree-parloops.c+=-O0
-COPTS.tree-predcom.c+=-O0
-COPTS.tree-pretty-print.c+=-O0
-COPTS.tree-ssa-alias.c+=-O0
-COPTS.tree-ssa-ccp.c+=-O0
-COPTS.tree-ssa-forwprop.c+=-O0
-COPTS.tree-ssa-loop-ivopts.c+=-O0
-COPTS.tree-ssa-loop-manip.c+=-O0
-COPTS.tree-ssa-loop-niter.c+=-O0
-COPTS.tree-ssa-math-opts.c+=-O0
-COPTS.tree-ssa-phiopt.c+= -O0
-COPTS.tree-ssa-pre.c+=-O0
-COPTS.tree-ssa-reassoc.c+=-O0
-COPTS.tree-ssa-strlen.c+=-O0
-COPTS.tree-ssa-uninit.c+=-O0
-COPTS.tree-ssa.c+=-O0
-COPTS.tree-switch-conversion.c+=-O0
-COPTS.tree-vect-data-refs.c+=-O0
-COPTS.tree-vect-loop-manip.c+=-O0
-COPTS.tree-vect-loop.c+=-O0
-COPTS.tree-vect-patterns.c+=-O0
-COPTS.tree-vect-stmts.c+=-O0
-COPTS.tree-vrp.c+=-O0
-COPTS.tree.c+=-O0
-COPTS.ubsan.c+=-O0
-COPTS.varasm.c+=-O0
-COPTS.vr-values.c+=-O0
-COPTS.web.c+=-O0
-COPTS.wide-int-range.cc+=-O0
-COPTS.wide-int.cc+=-O0
+
+COPTS.expmed.c+=-Wno-error=tautological-compare
+COPTS.expr.c+=-Wno-error=tautological-compare
.else
COPTS.tree.c= ${${ACTIVE_CC} == "clang" :? -O0 :}
.endif
 1.85 15-Sep-2020  mrg branches: 1.85.20;
make build (and run) with GCC 9.
 1.84 22-Sep-2018  rin - Determine KERN_AS automatically depending on whether OPT_MODULAR is
set or not, in the same way as libcompat.

- Specify OPT_MODULAR in the port Makefile instead of KERN_AS.

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

OK christos
 1.83 14-Jun-2014  mrg branches: 1.83.26; 1.83.28;
remove remaining makefile support for GCC < 45 that i found.
 1.82 04-Jun-2014  matt Modify compiler HACK to be for GCC 4.1 only
 1.81 21-Jan-2011  joerg branches: 1.81.14; 1.81.28;
Switch remaining platforms to modern CPP for assembler.
 1.80 01-Mar-2008  joerg branches: 1.80.26; 1.80.32; 1.80.34;
Missing assym.h dependency.
 1.79 22-Dec-2007  tsutsui branches: 1.79.2; 1.79.6;
Put a workaround for gcc ICE on ddb/db_command.c.
 1.78 31-Mar-2007  matt branches: 1.78.14; 1.78.22; 1.78.26;
Build kernels with -fno-pic.
 1.77 02-Jun-2006  mrg branches: 1.77.10; 1.77.12; 1.77.16; 1.77.18; 1.77.22;
remove support for building (with) GCC 2.95. also:
- always install <stdbool.h>
- don't generate a fake one for vax / gettext.
 1.76 07-Apr-2006  mrg branches: 1.76.2;
retire HAVE_GCC3/HAVE_GCC4 and introduce HAVE_GCC that is set to 2, 3 or 4.
 1.75 11-Dec-2005  christos branches: 1.75.4; 1.75.6; 1.75.8; 1.75.10; 1.75.12;
merge ktrace-lwp.
 1.74 31-May-2005  christos branches: 1.74.2;
s/GENASSYM/GENASSYM_CONF/ so we can use "GENASSYM" as the program name.
 1.73 04-Jun-2004  thorpej Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
 1.72 10-Dec-2003  simonb branches: 1.72.4;
Make unimpl_emul.o depend on assym.h so that "make -j N" kernel builds
work.
 1.71 08-Dec-2003  matt Make -mno-asm-pic dependend on HAVE_GCC3 == no
 1.70 05-Nov-2002  thorpej branches: 1.70.6;
Add -mno-asm-pic to CFLAGS and AFLAGS.
 1.69 23-Feb-2002  matt branches: 1.69.10;
Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.68 11-Feb-2002  thorpej Don't pass -mno-pic if we're using ELF.
 1.67 23-Dec-2001  matt Make VAX kernels work again. Entry on vax is start, not _start.
 1.66 23-Nov-2001  atatat Oops. Add in missing entry point settings.
 1.65 23-Nov-2001  atatat Instead of checking for previous usage, just append to some make
variables. Tweak some variables to provide for more uniform defaults.
Minor adaption to makefiles for already converted ports.
 1.64 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.63 16-Nov-2001  atatat branches: 1.63.2;
Abstract out a large chunk of the kernel build machinery so that new
build features (such as ross's DEBUGLIST) can easily be applied to all
ports. This should reduce the complexity of each port's kernel
Makefile considerably. Line counts:

227 arch/i386/conf/Makefile.i386.orig
98 arch/i386/conf/Makefile.i386
227 arch/alpha/conf/Makefile.alpha.orig
99 arch/alpha/conf/Makefile.alpha
219 arch/sparc/conf/Makefile.sparc.orig
102 arch/sparc/conf/Makefile.sparc
215 arch/vax/conf/Makefile.vax.orig
102 arch/vax/conf/Makefile.vax
253 conf/Makefile.kern.inc

Roll i386, alpha, sparc, and vax over to the new build machinery.
 1.62 26-Oct-2001  jmc Change defaults for kernel compiles. Default all to USETOOLS?=no and have
the etc Makefile override that by putting USETOOLS into $.MAKEOVERRIDES
This way the default for kernel compiles is still to use the installed
toolchain instead of depending on $TOOLDIR. $TOOLDIR can be used by
simply adding USETOOLS=yes to the command line as usual.

Adjust each ports template to set the default no setting and also pull in
bsd.own.mk if they weren't already to ensure they'll build correctly
with the new toolchain setup.
 1.61 23-Oct-2001  thorpej branches: 1.61.2;
Set MACHINE_ARCH explicitly in Makefiles for which it is constant.
Also, since config(8) now explcitly sets MACHINE, there is no need
to do it here in the Makefile.
 1.60 09-Sep-2001  matt Always include -Wno-main
 1.59 25-Jun-2001  matt branches: 1.59.2; 1.59.4;
Don't include -mno-pic on gcc 2.95
 1.58 29-May-2001  mrg define _KERNEL_OPT as well as _KERNEL. we will use this in the future to
get kernel "opt_foo.h" headers, rather than _KERNEL && !_LKM.
 1.57 08-Feb-2001  chs branches: 1.57.2;
create dependency info for assym.h.
 1.56 17-Dec-2000  jdolecek delete obsolete comment
 1.55 09-May-2000  hubertf Add "install" target, so "make install" after building the kernel
does something useful. The target can be redefined by putting a
install-kernel-${MACHINE_NAME} target that fits your needs into
/etc/mk.conf.
 1.54 09-May-2000  thorpej HAVE_GCC28 -> HAVE_EGCS, and make it match gcc 2.9 as well. Also,
make the use of -Wno-uninitialized explicit, don't rely on a compiler
hack to do it for us.
 1.53 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.52 24-Jan-2000  tron Add "dependall" target for comfort.
 1.51 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.50 19-Jan-2000  tsutsui Change STRIPFLAGS=-g for cross-toolchains.
 1.49 26-Jul-1999  cgd branches: 1.49.2;
be more efficient when doing the SYSTEM_LD_TAIL for -g kernels: don't
copy them just to strip them, use strip -o.
 1.48 09-Jul-1999  mrg clean up a bit after jason :)

- fix emitrules() like emitfiles() to deal with the prefix (otherwise it
would attempt to find the file in the normal base for the NORMAL_C rule).
- add emitincludes() which adds include directives for each prefix to the
$INCLUDES variable in the makefile.
- add %INCLUDES to each Makefile.arch to deal with the above.

this makes "prefix" actually work in a usable manner, and now i can move
on to fixing compiler warnings (errors) in the ESP code. :)
 1.47 17-Jan-1999  matt branches: 1.47.4;
If using egcs, use -mno-pic to generate better code.
 1.46 08-Jan-1999  augustss Add -Wpointer-arith warning since `void *' arithmetic is not ANSI C.
 1.45 15-Oct-1998  drochner change handling of libkern:
-sys/lib/libkern builds as library per default (as it was documented all
the time)
-ports able to LKM set "KERN_AS=obj" explicitely in their Makefiles
(for now; should depend on actual "option LKM" or -better- functions
included for LKM use should be pulled in by a stub)
-always link libcompat before libkern - libkern stuff can be referred to
by libcompat, but not the other way
 1.44 05-Sep-1998  lukem distclean is a synonym for cleandir
 1.43 22-Aug-1998  ragge New times, new pagesize, use magic number in exec header.
 1.42 31-May-1998  thorpej Specify a non-profiling C rule.
 1.41 22-May-1998  ragge Remove unneccessary file. Remove stale dependency. Disable not-working
devices by default.
 1.40 03-May-1998  ragge Enable -Wall -Wmissing-prototypes -Wstrict-prototypes.
 1.39 12-Apr-1998  tv Add -Wno-main conditional on compiler being gcc 2.8 or egcs. (This adds
a HAVE_GCC28 check-variable that can now be used to add other gcc-2.8
flags in cases where they may be useful, or to remove gcc 2.7.2 "bug
workaround" flags.)
 1.38 12-Nov-1997  thorpej Make sure CPP, AR, AS, and RANLIB are defined.
 1.37 12-Nov-1997  thorpej Define LORDER, NM, and TSORT here, like we do the rest of the tools.
 1.36 04-Nov-1997  ragge Move some interrupt routines out to assembler.
Optimize (slightly) pmap_clear_modify.
 1.35 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.34 03-Oct-1997  lukem branches: 1.34.2;
define SIZE?=size, and use ${SIZE} instead of size. makes cross
compilation easier
 1.33 30-Sep-1997  christos PR/4162: Chris Jones: make cleandir does not work properly; it does not
remove the object files and the .depend file in the kernel build directory.
 1.32 14-Mar-1997  mycroft branches: 1.32.4;
Define the `cleankernel' target consistently with other ports.
 1.31 12-Feb-1997  ragge Remove ::
 1.30 04-Feb-1997  perry branches: 1.30.4;
Nuke some options GENERIC residue.
 1.29 04-Feb-1997  perry Nuke some GENERIC residue.
 1.28 01-Dec-1996  jonathan * Replace explicit -O2 in CFLAGS with COPTS macro. Default COPTS?= -O2.
Lets users over-ride with makeoptions COPTS="..." in kernel config files.

Leave `mandatory' flags (like -msoft-float which on m68k enforces no
FP in kernel) in CFLAGS.
 1.27 09-Sep-1996  mycroft Move strip(1) flags into a separate variable, so that $STRIP can
be passed to subordinate make(1)s. Remove $TOUCH. Add HOSTED_CC,
HOSTED_CPPFLAGS, and HOSTED_CFLAGS, and use them when depending genassym.
 1.26 31-Aug-1996  mycroft Wrap the default definition of `S' in `.ifndef'.
 1.25 12-Aug-1996  mycroft Put into . Remove hooks for `config-dependent' and
`device-driver' flags.
 1.24 10-Aug-1996  mycroft * Add a HOSTED_C_C variable, which strips `-p', `-pg', and
`-nostdinc', and use it when building genassym.
* Use `-nostdinc' just to be sure we're self-contained.
 1.23 10-Aug-1996  mycroft * Define CWARNFLAGS and MKDEP in some moderately consistent fashion.
* Make S expand to an absolute path at compile time.
* Use `-S' rather than `-x' to remove debugging symbols.
* Garbage collect unused variables.
* Reverse a handful of port-specific changes that do not correspond to
the common build model and are not needed.
 1.22 01-Jul-1996  ragge Update to match new MSCP device handling.
Remove support for old config system.
 1.21 11-May-1996  mycroft Make `make depend' work for libraries.
 1.20 29-Feb-1996  cgd Do not build vnode_if.[ch] for each kernel. Build them once, like the
various syscall sources/headers, and just compile them. From PR 2142, OK'd
by mycroft.
 1.19 26-Feb-1996  mycroft Define build programs with `?=', so they can be overridden with `makeoptions'.
 1.18 09-Feb-1996  mycroft Fix mkdep problems due to missing flags.
 1.17 03-Feb-1996  mycroft Use `-traditional-cpp' when building .s and .S files.
 1.16 02-Feb-1996  mycroft Clone these, and fix many bugs.
 1.15 02-Feb-1996  mycroft ASSEMBLER -> _LOCORE
 1.14 02-Feb-1996  mycroft Don't special-case conf.c.
 1.13 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.12 19-Sep-1995  thorpej Compile kernel with -Werror and -fno-builtin.
 1.11 24-Jul-1995  ragge maxpartitions added. Kernel now loaded with -Z flag.
 1.10 05-Jul-1995  ragge DDB file added.
 1.9 24-Jun-1995  christos Makefile.`arch`: - Add -lcompat
- Change clean: target to be a double dep one,
so libraries can use the clean target too
- Add genassym to the clean targets
 1.8 16-May-1995  jtc Removing -DKERNEL, transition to _KERNEL has been completed
 1.7 23-Mar-1995  jtc Added -D_KERNEL to CFLAGS alongside each -DKERNEL.
 1.6 23-Feb-1995  ragge Support for new CPU type (KA630 == uVAXII) added, tape driver.
 1.5 13-Feb-1995  ragge Program to make a fast convert from new to old config (Ugly!)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge New filenames; changes applying to 1.o Beta
 1.2 16-Aug-1994  ragge branches: 1.2.2;
genconf.c added to files.vax.newconf
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge genconf.c added to files.vax.newconf
 1.2.2.1 16-Aug-1994  ragge file Makefile.vax was added on branch netbsd-1-0 on 1994-08-16 23:41:12 +0000
 1.30.4.1 12-Mar-1997  is Merge in changes from Trunk
 1.32.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.34.2.1 12-Nov-1997  thorpej Pull up "make sure tools are defined" changes from trunk.
 1.47.4.1 02-Aug-1999  thorpej Update from trunk.
 1.49.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.49.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.49.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.57.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.59.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.59.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.59.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.59.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.61.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.63.2.4 11-Nov-2002  nathanw Catch up to -current
 1.63.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.63.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.63.2.1 16-Nov-2001  nathanw file Makefile.vax was added on branch nathanw_sa on 2002-01-08 00:28:30 +0000
 1.69.10.1 26-Jan-2003  jmc Pullup revisions 1.69-1.70 (requested by he in ticket #1072)
Add -mno-asm-pic to CFLAGS and AFLAGS, and add -ffreestanding and
empty LIBC setting to bootloader Makefiles.
 1.70.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.70.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.70.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.70.6.1 03-Aug-2004  skrll Sync with HEAD
 1.72.4.1 06-Feb-2005  jmc Pull up patch (requested by martti in ticket #1086)
Move ipf to sys/dist/ipf and sync w. trunk
 1.74.2.4 17-Mar-2008  yamt sync with head.
 1.74.2.3 21-Jan-2008  yamt sync with head
 1.74.2.2 03-Sep-2007  yamt sync with head.
 1.74.2.1 21-Jun-2006  yamt sync with head.
 1.75.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.75.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.75.8.2 26-Jun-2006  yamt sync with head.
 1.75.8.1 11-Apr-2006  yamt sync with head
 1.75.6.2 03-Jun-2006  kardel Sync with head.
 1.75.6.1 22-Apr-2006  simonb Sync with head.
 1.75.4.1 09-Sep-2006  rpaulo sync with head
 1.76.2.1 19-Jun-2006  chap Sync with head.
 1.77.22.1 07-Apr-2008  skrll Pullup changes to get vax shlibs working.
 1.77.18.1 11-Jul-2007  mjf Sync with head.
 1.77.16.1 10-Apr-2007  ad Sync with head.
 1.77.12.1 07-Apr-2007  matt Sync with -current
 1.77.10.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.78.26.1 02-Jan-2008  bouyer Sync with HEAD
 1.78.22.1 26-Dec-2007  ad Sync with head.
 1.78.14.2 23-Mar-2008  matt sync with HEAD
 1.78.14.1 09-Jan-2008  matt sync with HEAD
 1.79.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.79.2.1 24-Mar-2008  keiichi sync with head.
 1.80.34.1 08-Feb-2011  bouyer Sync with HEAD
 1.80.32.1 06-Jun-2011  jruoho Sync with HEAD.
 1.80.26.1 05-Mar-2011  rmind sync with head
 1.81.28.1 10-Aug-2014  tls Rebase.
 1.81.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.83.28.1 10-Jun-2019  christos Sync with HEAD
 1.83.26.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.85.20.1 08-Oct-2023  martin Pull up following revision(s) (requested by rin in ticket #394):

external/gpl3/binutils/dist/gas/config/tc-vax.h: revision 1.10
tools/gcc/Makefile: revision 1.109
external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.16
external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.17
external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.18
external/gpl3/gcc.old/dist/gcc/recog.c: revision 1.12
external/gpl3/gcc.old/dist/gcc/function.c: revision 1.16
external/gpl3/gcc.old/dist/gcc/dse.c: revision 1.14 - 1.16
external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.13
external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.14
external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.15
external/gpl3/gcc.old/dist/gcc/doc/tm.texi.in: revision 1.10
external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.16
external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.17
external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.18
external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.19
external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.12
external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.13
external/gpl3/gcc.old/usr.bin/backend/Makefile: revision 1.20
external/gpl3/gcc.old/dist/gcc/targhooks.c: revision 1.12
external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.14
external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.15
external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md: revision 1.12
external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.16
external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md: revision 1.13
external/gpl3/gcc.old/dist/gcc/doc/tm.texi: revision 1.12
external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.17
external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.18
external/gpl3/gcc.old/dist/gcc/config/vax/elf.h: revision 1.12
external/gpl3/gcc.old/dist/gcc/config/vax/elf.h: revision 1.13
external/gpl3/gcc.old/dist/gcc/targhooks.h: revision 1.12
external/gpl3/gcc.old/dist/gcc/target.def: revision 1.10
external/gpl3/gcc.old/dist/gcc/rtlanal.c: revision 1.14
external/gpl3/gcc.old/dist/gcc/reload.c: revision 1.12
external/gpl3/gcc.old/usr.bin/gcc/Makefile: revision 1.11
external/gpl3/gcc.old/usr.bin/lto-dump/Makefile: revision 1.3
external/gpl3/gcc.old/lib/Makefile.sanitizer: revision 1.7
external/gpl3/binutils.old/lib/libbfd/Makefile: revision 1.10
distrib/utils/x_ping/Makefile: revision 1.9
games/phantasia/Makefile: revision 1.38
external/apache2/argon2/lib/libargon2/Makefile.inc: revision 1.2
external/gpl3/gcc.old/lib/libubsan/Makefile: revision 1.8
external/bsd/mdocml/lib/libmandoc/Makefile: revision 1.13
sbin/ping/Makefile: revision 1.18
sbin/newfs_ext2fs/Makefile: revision 1.7
sys/lib/libz/Makefile: revision 1.24
sys/lib/libsa/Makefile: revision 1.97
external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile: revision 1.3
external/gpl3/gdb/lib/libgdb/Makefile: revision 1.36
sys/modules/lfs/Makefile: revision 1.11
external/mit/xorg/lib/gallium/Makefile: revision 1.51
external/gpl3/gdb.old/lib/libdecnumber/Makefile: revision 1.10
external/mit/xorg/lib/libX11/Makefile.libx11: revision 1.26
libexec/ld.elf_so/Makefile: revision 1.148
external/bsd/jemalloc/lib/Makefile.inc: revision 1.16
external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile: revision 1.14
crypto/external/bsd/openssh/lib/Makefile: revision 1.38
external/gpl3/gcc.old/usr.bin/backend/Makefile: revision 1.21
external/gpl3/gcc.old/usr.bin/cc1/Makefile: revision 1.12
external/gpl3/gcc.old/lib/libasan/Makefile: revision 1.11
external/gpl3/gcc.old/usr.bin/cc1plus/Makefile: revision 1.13
lib/libcrypt/Makefile: revision 1.36
external/gpl3/gdb/lib/libdecnumber/Makefile: revision 1.5
lib/libc/gdtoa/Makefile.inc: revision 1.13
games/gomoku/Makefile: revision 1.13
sbin/fsdb/Makefile: revision 1.43
external/gpl3/gcc.old/usr.bin/lto1/Makefile: revision 1.9
external/mit/xorg/lib/gallium.old/Makefile: revision 1.8
lib/libbz2/Makefile: revision 1.22
external/gpl3/gcc.old/usr.bin/cc1obj/Makefile: revision 1.12
usr.sbin/mtrace/Makefile: revision 1.14
external/gpl3/gcc.old/usr.bin/cc1obj/Makefile: revision 1.13
sys/arch/vax/conf/Makefile.vax: revision 1.86
sys/rump/fs/lib/liblfs/Makefile: revision 1.18
sbin/fsck_ffs/Makefile.common: revision 1.3
external/gpl3/binutils/lib/libbfd/Makefile: revision 1.27
lib/i18n_module/UTF7/Makefile: revision 1.5
external/gpl3/gcc.old/lib/liblsan/Makefile: revision 1.7
doc/CHANGES (apply patch)
(all external/gpl3/gcc.old/ changes applied to external/gpl3/gcc/)

PR 57646: Import major vax toolchain fix.
 1.1 01-Mar-2000  he branches: 1.1.2;
file POSTAGE_STAMP was initially added on branch netbsd-1-4.
 1.1.2.1 01-Mar-2000  he Apply patch (create new files, requested by toddpw):
Provide minimal kernels for VaxStation 2000 (POSTAGE_STAMP) and
MicroVax II (SMIDGEN).
 1.1 01-Mar-2000  he branches: 1.1.2;
file SMIDGEN was initially added on branch netbsd-1-4.
 1.1.2.1 01-Mar-2000  he Apply patch (create new files, requested by toddpw):
Provide minimal kernels for VaxStation 2000 (POSTAGE_STAMP) and
MicroVax II (SMIDGEN).
 1.35 19-Mar-2025  jakllsch Remove last traces of 'options LKM' from kernel config files.
 1.34 06-Feb-2023  tsutsui branches: 1.34.6;
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.33 07-Aug-2022  simonb branches: 1.33.4;
UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.
 1.32 27-Sep-2020  roy vether: Add to kernel configurations

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.31 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.30 20-Jan-2020  thorpej Remove FDDI support.
 1.29 26-Apr-2019  sevan branches: 1.29.4;
Use veriexec.config to reduce duplication
 1.28 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.27 01-Aug-2018  maxv Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
 1.26 25-Apr-2018  ragge branches: 1.26.2;
Enable CPU_IN_CKSUM.
 1.25 23-Jan-2018  sevan branches: 1.25.2;
Alternate buffer queue strategies no longer considered experimental, update
description.

Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
 1.24 14-Sep-2017  mrg clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
 1.23 13-Sep-2017  sevan Remove support for VERIFIED_EXEC_FP_RMD160, VERIFIED_EXEC_FP_SHA1, and VERIFIED_EXEC_FP_MD5 options.
These algorithms are either broken or on their way to being broken.

Discussed on tech-security
http://mail-index.netbsd.org/tech-security/2017/08/21/msg000936.html

ok riastradh
 1.22 04-Aug-2017  maxv typos
 1.21 27-Dec-2016  flxd branches: 1.21.8;
Fix TC adaptor's CSR address.
Add "PMAD" LANCE TC Ethernet.
 1.20 08-Aug-2015  maxv branches: 1.20.2;
Remove KMEMSTATS.
 1.19 16-Nov-2014  manu branches: 1.19.2;
Remove unused extended attributes kernel options

As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate
 1.18 12-Nov-2014  manu Support for UFS1 extended attributes in GENERIC and GENERIC-like kernels

This change just brings UFS1 extended attribute *support* in the kernel,
extended attributes are not enabled unless three conditions are met:
1) filesystem is UFS1 (newfs -O1)
2) .attribute/system and .attribute/user directories are created at fs root
3) filesystem is mounted with -o extattr

Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
 1.17 23-Aug-2014  dholland Systematize (and in many cases, fix) the comments on options COMPAT_NN.

There are quite a few configs that are missing some COMPAT_NN options
in ways that don't make sense; this should probably get cleaned up
too, but for the time being I've not added or removed anything.
 1.16 30-Jun-2013  rmind branches: 1.16.6;
G/C PFIL_HOOKS from the kernel configs.
 1.15 05-Jun-2013  christos branches: 1.15.2;
remove obsolete networking options
 1.14 27-Apr-2013  christos the bogus number police
 1.13 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.12 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.11 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.10 17-Aug-2012  abs branches: 1.10.2;
Update all kernel configs mentioning WSEMUL_* but not already including
WSDISPLAY_COMPAT_USL using the following rules:
- If WSEMUL_ is commented out, add commented out out WSDISPLAY_COMPAT_USL
- If INSTALL or obviously memory constrained, add WSDISPLAY_DEFAULTSCREENS=1
and commented out WSDISPLAY_COMPAT_USL
- Otherwise add WSDISPLAY_COMPAT_USL

Some of the INSTALL configs for larger memory machines are probably suitable
for adding WSDISPLAY_COMPAT_USL.

Now wsconscfg(8) should be able to switch VTs when expected.

Implemented after no objection from tech-kern to the following:

On 5 June 2012 09:47, David Brownlee <abs@absd.org> wrote:
> wsconscfg(8) requires WSDISPLAY_COMPAT_USL in order to switch virtual
> terminals.
>
> Except when in an exceptionally memory or space constrained
> environment (INSTALL being the obvious case), is there any reason why
> all GENERIC and GENERIC-like kernels which have wscons enabled
> shouldn't also have WSDISPLAY_COMPAT_USL?
 1.9 22-Jun-2012  abs - Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number
 1.8 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.7 18-Dec-2011  dholland branches: 1.7.2;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.6 22-Nov-2011  tls branches: 1.6.2;

The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself. Move it to std. This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports. Thanks to Havard Eidnes for
pointing them out.
 1.5 30-Jun-2011  wiz branches: 1.5.2;
dependant -> dependent
 1.4 06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.3 16-Apr-2010  pooka branches: 1.3.2; 1.3.4;
Remove unused count (invariably "4") from pseudo-device fss.
 1.2 22-Feb-2009  ad branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
PR kern/26878 FFSv2 + softdep = livelock (no free ram)
PR kern/16942 panic with softdep and quotas
PR kern/19565 panic: softdep_write_inodeblock: indirect pointer #1 mismatch
PR kern/26274 softdep panic: allocdirect_merge: ...
PR kern/26374 Long delay before non-root users can write to softdep partitions
PR kern/28621 1.6.x "vp != NULL" panic in ffs_softdep.c:4653 while unmounting a softdep (+quota) filesystem
PR kern/29513 FFS+Softdep panic with unfsck-able file-corruption
PR kern/31544 The ffs softdep code appears to fail to write dirty bits to disk
PR kern/31981 stopping scsi disk can cause panic (softdep)
PR kern/32116 kernel panic in softdep (assertion failure)
PR kern/32532 softdep_trackbufs deadlock
PR kern/37191 softdep: locking against myself
PR kern/40474 Kernel panic after remounting raid root with softdep

Retire softdep, pass 2. As discussed and later formally announced on the
mailing lists.
 1.1 22-Jan-2009  christos branches: 1.1.2;
Patches from Brad Parker to support vax730.
 1.1.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.8.2 21-Apr-2011  rmind sync with head
 1.2.8.1 30-May-2010  rmind sync with head
 1.2.6.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.2.4.3 11-Aug-2010  yamt sync with head.
 1.2.4.2 04-May-2009  yamt sync with head.
 1.2.4.1 22-Feb-2009  yamt file VAX780 was added on branch yamt-nfs-mp on 2009-05-04 08:12:03 +0000
 1.2.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.2.2.1 22-Feb-2009  skrll file VAX780 was added on branch nick-hppapmap on 2009-03-03 18:29:35 +0000
 1.3.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.3.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.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.5.2.2 30-Oct-2012  yamt sync with head
 1.5.2.1 17-Apr-2012  yamt sync with head
 1.6.2.2 11-Mar-2012  mrg sync to latest -current
 1.6.2.1 18-Feb-2012  mrg merge to -current.
 1.7.2.1 04-Jul-2012  jdc Pull up revisions:
src/etc/etc.vax/MAKEDEV.conf revision 1.14
src/sys/arch/vax/conf/GENERIC revision 1.182
src/sys/arch/vax/conf/INSTALL revision 1.60
src/sys/arch/vax/conf/VAX780 revision 1.9
src/sys/arch/vax/conf/majors.vax revision 1.24
src/sys/arch/vax/vax/disksubr.c revision 1.53
src/sys/dev/DEVNAMES revision 1.275
src/sys/dev/mscp/files.mscp revision 1.8
src/sys/dev/mscp/mscp_disk.c revision 1.72
src/sys/dev/mscp/mscp_subr.c revision 1.42
src/distrib/vax/ramdisk/Makefile revision 1.29
(requested by abs in ticket #385).

- Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number

Include racd0 and racd1 on ramdisk
 1.10.2.3 03-Dec-2017  jdolecek update from HEAD
 1.10.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.2.1 23-Jun-2013  tls resync from head
 1.15.2.1 28-Aug-2013  rmind sync with head
 1.16.6.2 18-Nov-2014  snj Pull up following revision(s) (requested by manu in ticket #251):
sys/arch/acorn26/conf/GENERIC: revision 1.81
sys/arch/acorn32/conf/GENERIC: revision 1.116
sys/arch/alpha/conf/GENERIC: revision 1.362
sys/arch/amd64/conf/ALL: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.404
sys/arch/amd64/conf/XEN3_DOM0: revision 1.112
sys/arch/amd64/conf/XEN3_DOMU: revision 1.60
sys/arch/amiga/conf/GENERIC.in: revision 1.129
sys/arch/amiga/conf/GENERIC: revision 1.311
sys/arch/amigappc/conf/GENERIC: revision 1.24
sys/arch/arc/conf/GENERIC: revision 1.184
sys/arch/bebox/conf/GENERIC: revision 1.145
sys/arch/cats/conf/GENERIC: revision 1.155
sys/arch/cesfic/conf/GENERIC: revision 1.65
sys/arch/cobalt/conf/GENERIC: revision 1.147
sys/arch/dreamcast/conf/GENERIC: revision 1.121
sys/arch/emips/conf/GENERIC: revision 1.15
sys/arch/epoc32/conf/GENERIC: revision 1.8
sys/arch/ews4800mips/conf/GENERIC: revision 1.51
sys/arch/hp300/conf/GENERIC: revision 1.190
sys/arch/hpcmips/conf/GENERIC: revision 1.229
sys/arch/hpcsh/conf/GENERIC: revision 1.106
sys/arch/hppa/conf/GENERIC: revision 1.6
sys/arch/i386/conf/ALL: revision 1.389
sys/arch/i386/conf/GENERIC: revision 1.1118
sys/arch/i386/conf/XEN3_DOM0: revision 1.93
sys/arch/i386/conf/XEN3_DOMU: revision 1.65
sys/arch/ibmnws/conf/GENERIC: revision 1.46
sys/arch/iyonix/conf/GENERIC: revision 1.88
sys/arch/landisk/conf/GENERIC: revision 1.45
sys/arch/luna68k/conf/GENERIC: revision 1.119
sys/arch/mac68k/conf/GENERIC: revision 1.220
sys/arch/macppc/conf/GENERIC: revision 1.320
sys/arch/macppc/conf/MAMBO: revision 1.24
sys/arch/macppc/conf/POWERMAC_G5: revision 1.25
sys/arch/mipsco/conf/GENERIC: revision 1.88
sys/arch/mmeye/conf/GENERIC: revision 1.120
sys/arch/mvme68k/conf/GENERIC: revision 1.94
sys/arch/mvmeppc/conf/GENERIC: revision 1.24
sys/arch/netwinder/conf/GENERIC: revision 1.126
sys/arch/news68k/conf/GENERIC: revision 1.125
sys/arch/newsmips/conf/GENERIC: revision 1.129
sys/arch/next68k/conf/GENERIC: revision 1.139
sys/arch/ofppc/conf/GENERIC: revision 1.157
sys/arch/pmax/conf/GENERIC64: revision 1.21
sys/arch/pmax/conf/GENERIC: revision 1.185
sys/arch/prep/conf/GENERIC: revision 1.174
sys/arch/rs6000/conf/GENERIC: revision 1.33
sys/arch/sandpoint/conf/GENERIC: revision 1.88
sys/arch/sbmips/conf/GENERIC: revision 1.101
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.28
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.104
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.106
sys/arch/shark/conf/GENERIC: revision 1.121
sys/arch/sparc/conf/GENERIC: revision 1.248
sys/arch/sparc/conf/TADPOLE3GX: revision 1.65
sys/arch/sparc64/conf/GENERIC: revision 1.177
sys/arch/sparc64/conf/NONPLUS64: revision 1.44
sys/arch/sun2/conf/GENERIC: revision 1.94
sys/arch/sun3/conf/GENERIC: revision 1.171
sys/arch/vax/conf/GENERIC: revision 1.193
sys/arch/vax/conf/VAX780: revision 1.19
sys/arch/x68k/conf/GENERIC: revision 1.179
sys/arch/zaurus/conf/GENERIC: revision 1.65
sys/ufs/files.ufs: revision 1.38
Remove unused extended attributes kernel options

As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate
 1.16.6.1 14-Nov-2014  martin Pull up following revision(s) (requested by manu in ticket #232):
sys/arch/next68k/conf/GENERIC: revision 1.138
sys/arch/cobalt/conf/GENERIC: revision 1.146
sys/arch/mvme68k/conf/GENERIC: revision 1.93
sys/arch/vax/conf/VAX780: revision 1.18
sys/arch/newsmips/conf/GENERIC: revision 1.128
sys/arch/luna68k/conf/GENERIC: revision 1.118
sys/arch/sbmips/conf/GENERIC: revision 1.100
sys/arch/pmax/conf/GENERIC: revision 1.184
sys/arch/alpha/conf/GENERIC: revision 1.361
sys/arch/sparc64/conf/GENERIC: revision 1.176
sys/arch/sun3/conf/GENERIC: revision 1.170
sys/arch/shark/conf/GENERIC: revision 1.120
sys/arch/landisk/conf/GENERIC: revision 1.44
sys/arch/bebox/conf/GENERIC: revision 1.144
sys/arch/sparc64/conf/NONPLUS64: revision 1.43
sys/arch/sandpoint/conf/GENERIC: revision 1.87
sys/arch/emips/conf/GENERIC: revision 1.14
sys/arch/amd64/conf/XEN3_DOM0: revision 1.111
sys/arch/dreamcast/conf/GENERIC: revision 1.120
sys/arch/cesfic/conf/GENERIC: revision 1.64
sys/arch/mmeye/conf/GENERIC: revision 1.119
sys/arch/epoc32/conf/GENERIC: revision 1.7
sys/arch/x68k/conf/GENERIC: revision 1.178
sys/arch/iyonix/conf/GENERIC: revision 1.87
sys/arch/sun2/conf/GENERIC: revision 1.93
sys/arch/ews4800mips/conf/GENERIC: revision 1.50
sys/arch/amd64/conf/XEN3_DOMU: revision 1.59
sys/arch/acorn26/conf/GENERIC: revision 1.80
sys/arch/acorn32/conf/GENERIC: revision 1.115
sys/arch/macppc/conf/POWERMAC_G5: revision 1.24
sys/arch/i386/conf/GENERIC: revision 1.1117
sys/arch/arc/conf/GENERIC: revision 1.183
sys/arch/cats/conf/GENERIC: revision 1.154
sys/arch/amiga/conf/GENERIC.in: revision 1.128
sys/arch/zaurus/conf/GENERIC: revision 1.64
sys/arch/netwinder/conf/GENERIC: revision 1.125
sys/arch/hppa/conf/GENERIC: revision 1.5
sys/arch/mvmeppc/conf/GENERIC: revision 1.23
sys/arch/macppc/conf/GENERIC: revision 1.319
sys/arch/amiga/conf/GENERIC: revision 1.310
sys/arch/pmax/conf/GENERIC64: revision 1.20
sys/arch/macppc/conf/MAMBO: revision 1.23
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.27
sys/arch/amigappc/conf/GENERIC: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.403
sys/arch/ofppc/conf/GENERIC: revision 1.156
sys/arch/mac68k/conf/GENERIC: revision 1.219
sys/arch/i386/conf/XEN3_DOMU: revision 1.64
sys/arch/mipsco/conf/GENERIC: revision 1.87
sys/arch/hp300/conf/GENERIC: revision 1.189
sys/arch/vax/conf/GENERIC: revision 1.192
sys/arch/news68k/conf/GENERIC: revision 1.124
sys/arch/ibmnws/conf/GENERIC: revision 1.45
sys/arch/hpcsh/conf/GENERIC: revision 1.105
sys/arch/sparc/conf/TADPOLE3GX: revision 1.64
sys/arch/i386/conf/XEN3_DOM0: revision 1.92
sys/arch/sparc/conf/GENERIC: revision 1.247
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.105
sys/arch/prep/conf/GENERIC: revision 1.173
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.103
sys/arch/rs6000/conf/GENERIC: revision 1.32
sys/arch/hpcmips/conf/GENERIC: revision 1.228
Support for UFS1 extended attributes in GENERIC and GENERIC-like kernels
This change just brings UFS1 extended attribute *support* in the kernel,
extended attributes are not enabled unless three conditions are met:
1) filesystem is UFS1 (newfs -O1)
2) .attribute/system and .attribute/user directories are created at fs root
3) filesystem is mounted with -o extattr
Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
 1.19.2.3 28-Aug-2017  skrll Sync with HEAD
 1.19.2.2 05-Feb-2017  skrll Sync with HEAD
 1.19.2.1 22-Sep-2015  skrll Sync with HEAD
 1.20.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.21.8.1 26-Jan-2018  martin Pull up following revision(s) (requested by sevan in ticket #510):
sys/arch/sun3/conf/GENERIC3X: revision 1.130
sys/arch/sparc64/conf/GENERIC: revision 1.203
sys/arch/news68k/conf/LIBERO: revision 1.66
sys/arch/amiga/conf/DRACO: revision 1.185
sys/arch/evbarm/conf/MV2120: revision 1.35
sys/arch/x68k/conf/GENERIC: revision 1.187
sys/arch/rs6000/conf/GENERIC: revision 1.39
sys/arch/news68k/conf/GENERIC_TINY: revision 1.86
sys/arch/i386/conf/XEN3_DOMU: revision 1.88
sys/arch/iyonix/conf/GENERIC: revision 1.97
sys/arch/evbarm64/conf/A64EMUL: revision 1.11
sys/arch/mvme68k/conf/GENERIC: revision 1.98
sys/arch/acorn32/conf/GENERIC: revision 1.124
sys/arch/i386/conf/XEN3_DOM0: revision 1.125
sys/arch/cobalt/conf/INSTALL: revision 1.65
sys/arch/macppc/conf/GENERIC_601: revision 1.16
sys/arch/hppa/conf/GENERIC: revision 1.17
sys/arch/amiga/conf/GENERIC.in: revision 1.137
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.33
sys/arch/netwinder/conf/GENERIC: revision 1.134
sys/arch/amd64/conf/XEN3_DOMU: revision 1.83
sys/arch/mac68k/conf/GENERIC: revision 1.225
sys/arch/arc/conf/RPC44: revision 1.54
sys/arch/mipsco/conf/GENERIC: revision 1.92
sys/arch/cats/conf/GENERIC: revision 1.166
sys/arch/amd64/conf/XEN3_DOM0: revision 1.145
sys/arch/amigappc/conf/GENERIC: revision 1.33
sys/arch/sun3/conf/GENERIC: revision 1.176
sys/arch/news68k/conf/GENERIC: revision 1.130
sys/arch/hpcsh/conf/GENERIC: revision 1.110
sys/arch/hp300/conf/GENERIC: revision 1.198
sys/arch/atari/conf/GENERIC.in: revision 1.115
sys/arch/sparc/conf/MRCOFFEE: revision 1.54
sys/arch/evbppc/conf/EXPLORA451: revision 1.62
sys/arch/cesfic/conf/GENERIC: revision 1.69
sys/arch/vax/conf/GENERIC: revision 1.204
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.115
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.112
sys/arch/sparc/conf/GENERIC: revision 1.258
sys/arch/next68k/conf/GENERIC: revision 1.145
sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.34
sys/arch/prep/conf/GENERIC: revision 1.185
sys/arch/amiga/conf/INSTALL: revision 1.129
sys/arch/newsmips/conf/GENERIC: revision 1.133
sys/arch/cobalt/conf/GENERIC: revision 1.156
sys/arch/sun2/conf/GENERIC: revision 1.99
sys/arch/luna68k/conf/INSTALL: revision 1.25
sys/arch/amigappc/conf/NULL: revision 1.53
sys/arch/acorn26/conf/GENERIC: revision 1.85
sys/arch/vax/conf/VAX780: revision 1.25
sys/arch/luna68k/conf/GENERIC: revision 1.125
sys/arch/ews4800mips/conf/GENERIC: revision 1.56
sys/arch/macppc/conf/POWERMAC_G5: revision 1.29
sys/arch/arc/conf/GENERIC: revision 1.189
sys/arch/macppc/conf/MAMBO: revision 1.27
sys/arch/acorn32/conf/EB7500ATX: revision 1.64
sys/arch/pmax/conf/GENERIC: revision 1.196
sys/arch/pmax/conf/GENERIC64: revision 1.28
sys/arch/amiga/conf/GENERIC: revision 1.319
sys/arch/evbarm/conf/MPCSA_GENERIC: revision 1.55
sys/arch/macppc/conf/GENERIC: revision 1.339
sys/arch/emips/conf/GENERIC: revision 1.21
sys/arch/sandpoint/conf/GENERIC: revision 1.97
sys/arch/landisk/conf/GENERIC: revision 1.58
sys/arch/bebox/conf/GENERIC: revision 1.157
sys/arch/alpha/conf/GENERIC: revision 1.379
Alternate buffer queue strategies no longer considered experimental, update
description.
Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
 1.25.2.3 18-Jan-2019  pgoyette Synch with HEAD
 1.25.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.25.2.1 02-May-2018  pgoyette Synch with HEAD
 1.26.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.26.2.1 10-Jun-2019  christos Sync with HEAD
 1.29.4.1 25-Jan-2020  ad Sync with head.
 1.33.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.34.6.1 02-Aug-2025  perseant Sync with HEAD
 1.128 10-Feb-2024  andvar Fix various typos in comments, log messages and documentation.
 1.127 17-Jan-2024  tsutsui Add missed "rasops1" attribute to smg(4) rasops'fied a year ago.

This fixes silent boot failure on VS3100 with smg(4) framebuffer console.
Should be pulled up to netbsd-10.
 1.126 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.125 29-Dec-2018  maxv branches: 1.125.30;
Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.124 25-Apr-2018  ragge branches: 1.124.2;
Add cpu_in_cksum.S.
 1.123 22-Jun-2017  flxd branches: 1.123.4;
USB for vax (similar to pmax; no/negligible impact on legacy):
* Add USB device files/majors.
* Make kernel configs with USB work.
* Provide a USB-enabled kernel config.
 1.122 22-Jun-2017  flxd spelling (DEC called it "TURBOchannel")
 1.121 09-Jun-2017  flxd Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
 1.120 05-Jul-2015  matt branches: 1.120.10;
Configury support for QVSS (from Charles Dickman)
 1.119 19-Dec-2014  jklos Add audio support for VAXstation VLC, 60 and 90 machines. Originally rom
Blaz Antonic and ported from OpenBSD by Björn Johannesso. Tested on VLC
and 4000/60.
 1.118 12-Jun-2011  rmind branches: 1.118.12; 1.118.30;
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.117 01-Jul-2010  ragge branches: 1.117.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.116 16-Feb-2009  christos branches: 1.116.2; 1.116.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.115 22-Jan-2009  christos branches: 1.115.2;
Patches from Brad Parker to support vax730.
 1.114 13-Jan-2009  mjf - 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.113 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.112 12-Aug-2008  hans branches: 1.112.2; 1.112.4;
Add new accelerated driver for SPX graphics found in some VAXstations,
remove old broken lcspx driver. This is a bugfixed and refactored
version of the spx driver originally developed by Blaz Antonic in 2005.
OK'ed by mhitch.
 1.111 11-Mar-2008  matt branches: 1.111.4; 1.111.6; 1.111.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.110 22-Feb-2008  matt Revert last change.
 1.109 22-Feb-2008  matt Add back some includes which were inadvertantly removed.
 1.108 20-Feb-2008  drochner branches: 1.108.2; 1.108.6;
Since files.wscons et al. are included by ~all ports anyway, include
them in the mi "files" file, and remove include statements from md files.
These shouldn't pull in additional kernel code when not in use, so it
shouldn't do any harm except a risk of namespace collisions which
should be easy to fix.
 1.107 03-Feb-2008  matt Preliminatry TC support.
 1.106 25-Jan-2008  joerg Refactor in_cksum/in4_cksum/in6_cksum implementations:
- All three functions are included in the kernel by default.
They call a backend function cpu_in_cksum after possibly
computing the checksum of the pseudo header.
- cpu_in_cksum is the core to implement the one-complement sum.
The default implementation is moderate fast on most platforms
and provides a 32bit accumulator with 16bit addends for L32 platforms
and a 64bit accumulator with 32bit addends for L64 platforms.
It handles edge cases like very large mbuf chains (could happen with
native IPv6 in the future) and provides a good base for new native
implementations.
- Modify i386 and amd64 assembly to use the new interface.

This disables the MD implementations on !x86 until the conversion is
done. For Alpha, the portable version is faster.
 1.105 16-Feb-2007  matt branches: 1.105.24; 1.105.30;
Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.104 29-Jul-2006  ad Remove RASTERCONSOLE support from the pmax port.
 1.103 12-Mar-2006  christos welcome to syscall_intern.
 1.102 11-Dec-2005  christos branches: 1.102.4; 1.102.6; 1.102.8; 1.102.10;
merge ktrace-lwp.
 1.101 19-Oct-2003  ragge branches: 1.101.16;
Add lcspx console device driver.
 1.100 29-Sep-2003  matt Add SA_SIGINFO support for VAX.
 1.99 27-Jul-2003  thorpej Since everyone uses clock_subr.c (or should, if they don't currently),
list it in conf/files instead of in every port's files.*.
 1.98 06-Sep-2002  gehenna branches: 1.98.6;
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.97 26-Aug-2002  ragge Remove old dmf/dmz definitions.
 1.96 13-Mar-2002  ad branches: 1.96.4;
Give wskbdmap_lk201.c its own attribute.
 1.95 25-Feb-2002  ad Argh, dont reference any wscons parts in files.dec yet.
 1.94 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.93 24-Feb-2002  matt Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.92 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.91 21-Jan-2002  jdolecek Switch to MI dev/md_root.c for archs which don't have any special
memory disk hooks (i.e. everything except atari).
 1.90 28-Nov-2001  lukem - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
"options FOO=xxx"). options that take a value were converted to
defparam recently.
- minor whitespace & formatting cleanups
 1.89 20-Nov-2001  lukem - replace "defopt" with "defparam" for options which must take a value,
as config(8) will warn for value-less defparam options
- minor whitespace/formatting cleanup
- consolidate opt_tcp_recvspace.h and opt_tcp_sendspace.h into opt_tcp_space.h
 1.88 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.87 18-Aug-2001  wiz branches: 1.87.6;
if_il.c lives in dev/qbus now, and is mentioned in dev/qbus/files.uba.
Remove commented out line for it.
 1.86 13-Jun-2001  lukem branches: 1.86.2;
remove interlan np100 entry as the referenced files don't exist
 1.85 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.84 01-May-2001  ragge Add ka610, remove TS11.
 1.83 28-Apr-2001  ragge MD in4_cksum.
 1.82 27-Mar-2001  ragge Compile vsbus_dma.c if vax53, hinted by Michael Kukat.
 1.81 18-Feb-2001  ragge branches: 1.81.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.80 04-Feb-2001  ragge 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.79 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.78 17-Jan-2001  fvdl Add machdep file for procfs. Currently only used for linux-style
/proc/cpuinfo (only active when procfs is mounted with -o linux).
For ports other than the i386 this currently produces an empty
string.
 1.77 02-Dec-2000  ragge Recent lkkbd/lkms/lkc changes.
 1.76 26-Aug-2000  matt Reverse polarity on INSN_EMULATION to NO_INSN_EMULATION. Thus by default
all kernels will have instruction emulation.
 1.75 08-Aug-2000  ragge Write code to handle unimplemented instructions trapped via SCB vector 0x18.
This may happen on machines missing parts of the instruction set (like
some floating point formats).
Only one new instruction added; POLYD, so that the libm assembly files can
be used on architectures missing that instruction.
Also; include emulation code if compile-time option INSN_EMULATE is defined
instead of trying to match on which cputype it is.
N.B. POLYD isn't fully implemented, just enough to make libm happy.
 1.74 26-Jul-2000  ragge nmi files.
 1.73 22-Jul-2000  matt Enable emulation for everything but 7xx/8xxxx
 1.72 06-Jul-2000  ragge Add xmi_mainbus.c file.
 1.71 19-Jun-2000  matt branches: 1.71.2;
Rename ncr[5380] device to si to more consistent with other ports.
Add VAX660 to cputype.h. Remove needs-flag from si & asc entries.
 1.70 12-Jun-2000  ragge Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.69 10-Jun-2000  ragge Code to spin up other CPUs on a VAX 8200 system.
Haven't solved the printf() problem yet, though.
 1.68 08-May-2000  ragge branches: 1.68.2;
Add 4000/200 and 4000/500.
 1.67 22-Apr-2000  ragge Add "rl" disk.
 1.66 14-Mar-2000  oster Add the RAIDframe device major to the machine-dependent config files
so that the right entries get added to dev_name2blk[]. Needed for / on RAID.
(Whoops! I missed checking these in when adding the RAID_AUTOCONFIG stuff.)
 1.65 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.64 14-Feb-2000  thorpej Allow arch-specific code to specify in4_cksum() like it can specify
in_cksum().
 1.63 24-Jan-2000  matt More files that were changed.
 1.62 17-Jan-2000  matt defopt VAXnnn so the make depend does the right thing.
 1.61 10-Jan-2000  matt Add VS4000 scsi attachment (does not yet work).
Add COMPAT_IBCS2 hook (for running DEC VAX SVR3 images).
 1.60 27-Aug-1999  ragge branches: 1.60.2;
Support for 4000/90.
 1.59 14-Aug-1999  ragge Support for ibus-attached LANCE.
 1.58 08-Aug-1999  ragge Add support for the SGEC.
 1.57 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.56 04-Aug-1999  ragge smg/lkc must have "qfont".
 1.55 03-Aug-1999  ragge BI bus has become MI now.
 1.54 09-Jul-1999  thorpej Normalize include paths.
 1.53 20-Jun-1999  ragge Use uba & mscp code from dev/ instead.
 1.52 07-Jun-1999  thorpej Only declare block major numbers for devices which can be the root device.
 1.51 24-May-1999  ragge bus.h'ify more of the vax code.
 1.50 23-May-1999  ragge Better and more understandable way to find out CPU type.
 1.49 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.48 26-Mar-1999  ragge branches: 1.48.4;
Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.47 13-Mar-1999  ragge 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.46 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.45 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.44 29-Nov-1998  ragge Memory disk support.
 1.43 07-Nov-1998  ragge Support for KA820 console RX50. From 4.4, ported to NetBSD by Sergey Svishchev.
 1.42 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.41 06-Oct-1998  matt 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.40 10-Aug-1998  ragge Support for VS4000/60. Some needs-count -> needs-flag.
 1.39 02-Jul-1998  jonathan Change not-in-tree drier stubs to use needs-flag, not needs-count,
and use needs-count only where acutally used (qvss, qdss, ts-11)
 1.38 05-Jun-1998  ragge Don't compile in any rasterconsole code.
 1.37 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.36 22-May-1998  ragge Remove unneccessary file. Remove stale dependency. Disable not-working
devices by default.
 1.35 17-May-1998  ragge Change to use newly committed ln- and dz-drivers.
 1.34 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.33 22-Feb-1998  mycroft Remove random.s.
 1.32 16-Feb-1998  thorpej Remove "class" declarations, and add "devclass" declarations where
appropriate. Fix several inconsistencies between device class and
attributes. Mostly from Chris Demetriou.
 1.31 08-Feb-1998  ragge Split out MSCP floppies as a separate device (rx) instead of handling
them as disk drives. It is now also allowed to change floppies without
the system complaining :-)
 1.30 12-Jan-1998  thorpej Update for changes to config.
 1.29 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.28 13-Jun-1997  ragge branches: 1.28.2; 1.28.4;
Add clock_subr.c.
 1.27 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.26 15-Mar-1997  ragge Change the way boot device is figured out; now only using DEC numbers
and done when the device get attached.
 1.25 04-Feb-1997  ragge branches: 1.25.4;
Support for DL11 (-compatible) async ctlr.
Written by Ben Harris (bjh@mail.dotcom.fr).
 1.24 21-Jan-1997  thorpej "md" is declared in sys/conf/files, now.
 1.23 05-Jan-1997  ragge Add rd, sd, cd, md, st, ss, uk, ch and ipl device entries.
 1.22 20-Aug-1996  ragge Add another parent bus for 11/750 (cmi). remove mtc.c.
 1.21 20-Jul-1996  ragge Update config files for VAX8200 and VAXstations.
 1.20 01-Jul-1996  ragge Update to match new MSCP device handling.
Remove support for old config system.
 1.19 19-May-1996  ragge Add DZ-11 to GENERIC & files.vax.
 1.18 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.17 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.16 03-Mar-1996  ragge Added ns_cksum.c.
 1.15 02-Mar-1996  ragge Add VAX780 and DHU11 to the GENERIC file. Put the corresponding
file lines in files.vax.
 1.14 09-Feb-1996  ragge Support for ka650, tailored in_cksum and removal of a couple needs-count.
 1.13 24-Jul-1995  ragge maxpartitions added. Kernel now loaded with -Z flag.
 1.12 05-Jul-1995  ragge DDB file added.
 1.11 16-Jun-1995  ragge ddb file added.
 1.10 11-Apr-1995  mellon Reference cninit.c as well as cons.c
 1.9 29-Mar-1995  ragge Support for tmscp tapes.
 1.8 23-Feb-1995  ragge Support for new CPU type (KA630 == uVAXII) added, tape driver.
 1.7 13-Feb-1995  ragge Program to make a fast convert from new to old config (Ugly!)
 1.6 25-Jan-1995  cgd add 'maxpartitions' keyword as first 'intesting' thing in the file, to
facilitate the solution of config.new's hardcoded partition number
problems.
 1.5 25-Nov-1994  ragge Locore.c added.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge New filenames; changes applying to 1.o Beta
 1.2 16-Aug-1994  ragge genconf.c added to files.vax.newconf
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.25.4.1 10-Mar-1997  is make ether devices depend on arp
 1.28.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.28.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.48.4.2 02-Aug-1999  thorpej Update from trunk.
 1.48.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.60.2.6 21-Apr-2001  bouyer Sync with HEAD
 1.60.2.5 12-Mar-2001  bouyer Sync with HEAD.
 1.60.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.60.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.60.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.60.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.68.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.71.2.3 26-Aug-2000  matt Pullup approved by thorpej:
GENERIC 1.79, files.vax 1.76, intvec.s 1.56
>Reverse polarity on INSN_EMULATION to NO_INSN_EMULATION. Thus by default
>all kernels will have instruction emulation.
 1.71.2.2 14-Aug-2000  ragge Pull up (requested by ragge, approved by thorpej):

sys/arch/vax/conf/GENERIC 1.76-1.77
sys/arch/vax/conf/files.vax 1.74-1.75
sys/arch/vax/vax/intvec.s 1.54-1.55
sys/arch/vax/vax/unimpl_emul.s -1.2

This adds emulation code for the POLYD instruction that some VAX CPUs
are missing. POLYD is used for example in libm.
 1.71.2.1 27-Jul-2000  matt files.vax: Pullup revision 1.73
intvec.s: Pullup revision 1.53
Enable support for instruction emulate on almost all variants
 1.81.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.81.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.86.2.6 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.86.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.86.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.86.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.86.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.86.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.87.6.6 17-Sep-2002  nathanw Catch up to -current.
 1.87.6.5 27-Aug-2002  nathanw Catch up to -current.
 1.87.6.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.87.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.87.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.87.6.1 18-Aug-2001  nathanw file files.vax was added on branch nathanw_sa on 2002-01-08 00:28:30 +0000
 1.96.4.3 31-Aug-2002  gehenna catch up with -current.
 1.96.4.2 17-May-2002  gehenna Remove old block majors list.
 1.96.4.1 16-May-2002  gehenna Include the list of block/character major numbers.
 1.98.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.98.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.98.6.1 03-Aug-2004  skrll Sync with HEAD
 1.101.16.6 17-Mar-2008  yamt sync with head.
 1.101.16.5 27-Feb-2008  yamt sync with head.
 1.101.16.4 04-Feb-2008  yamt sync with head.
 1.101.16.3 26-Feb-2007  yamt sync with head.
 1.101.16.2 30-Dec-2006  yamt sync with head.
 1.101.16.1 21-Jun-2006  yamt sync with head.
 1.102.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.102.8.2 11-Aug-2006  yamt sync with head
 1.102.8.1 13-Mar-2006  yamt sync with head.
 1.102.6.1 22-Apr-2006  simonb Sync with head.
 1.102.4.1 09-Sep-2006  rpaulo sync with head
 1.105.30.1 18-Feb-2008  mjf Sync with HEAD.
 1.105.24.1 23-Mar-2008  matt sync with HEAD
 1.108.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.108.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.108.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.108.2.1 24-Mar-2008  keiichi sync with head.
 1.111.10.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.111.10.1 19-Oct-2008  haad Sync with HEAD.
 1.111.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.111.4.2 11-Aug-2010  yamt sync with head.
 1.111.4.1 04-May-2009  yamt sync with head.
 1.112.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.112.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.112.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.115.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.116.4.2 03-Jul-2010  rmind sync with head
 1.116.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.116.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.117.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.118.30.3 28-Aug-2017  skrll Sync with HEAD
 1.118.30.2 22-Sep-2015  skrll Sync with HEAD
 1.118.30.1 06-Apr-2015  skrll Sync with HEAD
 1.118.12.1 03-Dec-2017  jdolecek update from HEAD
 1.120.10.2 05-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #95):
etc/etc.vax/MAKEDEV.conf: revision 1.19
etc/etc.vax/Makefile.inc: revision 1.25
sys/arch/vax/conf/GENERIC_USB: revision 1.1
sys/arch/vax/conf/files.vax: revision 1.123
sys/arch/vax/conf/majors.vax: revision 1.27
USB for vax (similar to pmax; no/negligible impact on legacy):
* Add USB device files/majors.
* Make kernel configs with USB work.
* Provide a USB-enabled kernel config.
--
Add GENERIC_USB to vax kernel sets, but not to sysinst (yet), as bootloader
cannot handle kernels that large (yet).
 1.120.10.1 01-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #65):
share/man/man4/tc.4: revision 1.7
sys/arch/alpha/tc/tcasic.c: revision 1.46
sys/arch/pmax/tc/tcbus.c: revision 1.33
sys/arch/vax/conf/files.vax: revision 1.121
sys/arch/vax/vsa/tc_vsbus.c: revision 1.8, 1.9
sys/dev/tc/tc.c: revision 1.55
sys/dev/tc/tcvar.h: revision 1.27
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
--
whitespace
--
Add vax.
 1.123.4.2 18-Jan-2019  pgoyette Synch with HEAD
 1.123.4.1 02-May-2018  pgoyette Synch with HEAD
 1.124.2.1 10-Jun-2019  christos Sync with HEAD
 1.125.30.2 02-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #557):

sys/arch/vax/conf/files.vax: revision 1.127

Add missed "rasops1" attribute to smg(4) rasops'fied a year ago.

This fixes silent boot failure on VS3100 with smg(4) framebuffer console.
 1.125.30.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.11 28-Apr-1995  cgd rename files files for new config/config.old naming
 1.10 11-Apr-1995  mellon Reference cninit.c as well as cons.c
 1.9 29-Mar-1995  ragge Support for tmscp tapes.
 1.8 23-Feb-1995  ragge Support for new CPU type (KA630 == uVAXII) added, tape driver.
 1.7 13-Feb-1995  ragge Program to make a fast convert from new to old config (Ugly!)
 1.6 25-Jan-1995  cgd add 'maxpartitions' keyword as first 'intesting' thing in the file, to
facilitate the solution of config.new's hardcoded partition number
problems.
 1.5 25-Nov-1994  ragge Locore.c added.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge New filenames; changes applying to 1.o Beta
 1.2 16-Aug-1994  ragge branches: 1.2.2;
genconf.c added to files.vax.newconf
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge genconf.c added to files.vax.newconf
 1.2.2.1 16-Aug-1994  ragge file files.vax.newconf was added on branch netbsd-1-0 on 1994-08-16 23:41:14 +0000
 1.30 04-Apr-2020  jdolecek mark nsmb major obsolete
 1.29 28-Jan-2019  dholland Systematize handling of removed drivers.

- Every driver that was removed and whose number hasn't already been
reused is now listed with a commented-out "obsolete" line.
- The format of these has been systematized. Future format changes can
probably be safely done with a script.
- This does not include a few cases of assignments that only lasted a
couple days, or stuff from before major reorgs. Some of these may
be included nonetheless, because there was a lot of ground to cover
and therefore not a lot of time to dig into history in detail.

Note that the obsolete listings do not mean the major numbers can
never be reused; that's up to portmasters and/or core. It does mean
that they won't be reused by accident, however, which in some cases
(depending on the driver, how widely used it was, its family of device
nodes, their default permissions, etc.) can be quite dangerous.

Note that some of the things now explicitly listed as obsolete are
really ancient history. My scan went back as far as when the majors
files were added. (But not before that.)
 1.28 29-Mar-2018  ragge branches: 1.28.2;
Use same major for rx floppies for both b and c devices.
Works around a bug in the mscp disk driver, and solves PR port-vax/26138.
 1.27 22-Jun-2017  flxd branches: 1.27.4;
USB for vax (similar to pmax; no/negligible impact on legacy):
* Add USB device files/majors.
* Make kernel configs with USB work.
* Provide a USB-enabled kernel config.
 1.26 05-Jul-2015  matt branches: 1.26.10;
Configury support for QVSS (from Charles Dickman)
 1.25 19-Dec-2014  jklos Add audio support for VAXstation VLC, 60 and 90 machines. Originally rom
Blaz Antonic and ported from OpenBSD by Björn Johannesso. Tested on VLC
and 4000/60.
 1.24 22-Jun-2012  abs branches: 1.24.2; 1.24.16;
- Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number
 1.23 30-Jun-2011  wiz branches: 1.23.2; 1.23.8;
dependant -> dependent
 1.22 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.21 31-Dec-2007  ad branches: 1.21.6; 1.21.10; 1.21.16; 1.21.18;
Remove systrace. Ok core@.
 1.20 24-Nov-2006  wiz branches: 1.20.28; 1.20.34; 1.20.42;
s/independant/independent/, from Zafer.
 1.19 11-Dec-2005  christos branches: 1.19.20; 1.19.22;
merge ktrace-lwp.
 1.18 17-Sep-2005  yamt make VMSWAP optional again.
 1.17 31-Jul-2005  yamt revert "defflag VMSWAP" changes for now.
there seems to be far more people who don't want to edit
their kernel config files than i thought.
 1.16 30-Jul-2005  yamt defflag VMSWAP.
 1.15 10-May-2005  jdolecek branches: 1.15.2;
assign major for nsmb(4)
 1.14 10-Dec-2003  jmc Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
 1.13 24-Oct-2003  jdolecek add major for 'ses' for archs which have the other scsi devices
 1.12 22-Oct-2003  jdolecek add wsfont major to archs which have the other wscons devices
 1.11 10-Oct-2003  jdolecek reassing majors for crypto and pf to use the newly defined MI major
range
 1.10 10-Oct-2003  jdolecek update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
 1.9 05-Oct-2003  jdolecek Add some framework for MI assignment of device majors - add sys/dev/majors
which is automatically included during kernel config, and add comments
to individual machine-dependant majors.* files to assign new MI majors
in MI file.

Range 0-191 is reserved for machine-specific assignments, range
192+ are MI assignments.

Follows recent discussion on tech-kern@
 1.8 22-Aug-2003  itojun create /dev/crypto
 1.7 27-Jul-2003  itojun reserve cdev major # for PF. ok'ed by technical-exec
 1.6 25-Apr-2003  ragge branches: 1.6.2;
Add ksyms device major.
 1.5 23-Mar-2003  ragge Add rf (RX01/02 floppy device driver)
 1.4 23-Jan-2003  gehenna Add the block-device-only devices.

Reported by ragge.
 1.3 04-Oct-2002  elric branches: 1.3.2;
assign majors for raw and cooked cgd's.
 1.2 06-Sep-2002  gehenna branches: 1.2.2;
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.1 16-May-2002  gehenna branches: 1.1.2;
file majors.vax was initially added on branch gehenna-devsw.
 1.1.2.3 15-Jul-2002  gehenna catch up with -current.
 1.1.2.2 30-May-2002  gehenna Add $NetBSD$
 1.1.2.1 16-May-2002  gehenna Add the list of block/character majors.
 1.2.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.2.2.1 06-Sep-2002  nathanw file majors.vax was added on branch nathanw_sa on 2002-09-17 21:18:26 +0000
 1.3.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.3.2.1 04-Oct-2002  jdolecek file majors.vax was added on branch kqueue on 2002-10-10 18:37:15 +0000
 1.6.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.15.2.3 21-Jan-2008  yamt sync with head
 1.15.2.2 30-Dec-2006  yamt sync with head.
 1.15.2.1 21-Jun-2006  yamt sync with head.
 1.19.22.1 10-Dec-2006  yamt sync with head.
 1.19.20.1 12-Jan-2007  ad Sync with head.
 1.20.42.1 02-Jan-2008  bouyer Sync with HEAD
 1.20.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.20.28.1 09-Jan-2008  matt sync with HEAD
 1.21.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.21.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.21.10.1 04-May-2009  yamt sync with head.
 1.21.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.23.8.1 04-Jul-2012  jdc Pull up revisions:
src/etc/etc.vax/MAKEDEV.conf revision 1.14
src/sys/arch/vax/conf/GENERIC revision 1.182
src/sys/arch/vax/conf/INSTALL revision 1.60
src/sys/arch/vax/conf/VAX780 revision 1.9
src/sys/arch/vax/conf/majors.vax revision 1.24
src/sys/arch/vax/vax/disksubr.c revision 1.53
src/sys/dev/DEVNAMES revision 1.275
src/sys/dev/mscp/files.mscp revision 1.8
src/sys/dev/mscp/mscp_disk.c revision 1.72
src/sys/dev/mscp/mscp_subr.c revision 1.42
src/distrib/vax/ramdisk/Makefile revision 1.29
(requested by abs in ticket #385).

- Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number

Include racd0 and racd1 on ramdisk
 1.23.2.1 30-Oct-2012  yamt sync with head
 1.24.16.3 28-Aug-2017  skrll Sync with HEAD
 1.24.16.2 22-Sep-2015  skrll Sync with HEAD
 1.24.16.1 06-Apr-2015  skrll Sync with HEAD
 1.24.2.1 03-Dec-2017  jdolecek update from HEAD
 1.26.10.1 05-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #95):
etc/etc.vax/MAKEDEV.conf: revision 1.19
etc/etc.vax/Makefile.inc: revision 1.25
sys/arch/vax/conf/GENERIC_USB: revision 1.1
sys/arch/vax/conf/files.vax: revision 1.123
sys/arch/vax/conf/majors.vax: revision 1.27
USB for vax (similar to pmax; no/negligible impact on legacy):
* Add USB device files/majors.
* Make kernel configs with USB work.
* Provide a USB-enabled kernel config.
--
Add GENERIC_USB to vax kernel sets, but not to sysinst (yet), as bootloader
cannot handle kernels that large (yet).
 1.27.4.1 30-Mar-2018  pgoyette Resolve conflicts between branch and HEAD
 1.28.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.28.2.1 10-Jun-2019  christos Sync with HEAD
 1.8 01-Jul-1996  ragge Update to match new MSCP device handling.
Remove support for old config system.
 1.7 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.6 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.5 13-Feb-1996  mycroft Fix #include syntax.
 1.4 16-Dec-1995  ragge Generation of old config structs for de/qe cards removed.
 1.3 29-Mar-1995  ragge Support for tmscp tapes.
 1.2 23-Feb-1995  ragge Support for new CPU type (KA630 == uVAXII) added, tape driver.
 1.1 13-Feb-1995  ragge Program to make a fast convert from new to old config (Ugly!)
 1.17 04-Jun-2021  martin Sprinkle a few VMSWAP_DEFAULT_PLAINTEXT for architectures where we do not
have any spare cpu cycles to waste (encrypted swap still could be
enabled by the admin in /etc/sysctl.conf).
 1.16 11-Dec-2005  christos branches: 1.16.182; 1.16.186;
merge ktrace-lwp.
 1.15 17-Sep-2005  yamt include "conf/std".
 1.14 20-Nov-2001  lukem branches: 1.14.16; 1.14.32;
cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.13 19-Jul-2000  matt branches: 1.13.4; 1.13.8;
Tpyo
 1.12 19-Jul-2000  matt Include ELF support by default.
 1.11 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.10 15-Nov-1999  fvdl branches: 1.10.4;
Add

prefix ../gnu/sys
cinclude "conf/files.softdep"
prefix

to all std.* files, so that soft dependencies can be activated using
"options SOFTDEP".
 1.9 12-Sep-1999  chs branches: 1.9.2; 1.9.8;
eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
 1.8 24-Mar-1999  mrg clean up kernel/config files files for machVM lossage.
 1.7 16-Nov-1998  mrg move vax "options UVM" from GENERIC to std.vax
 1.6 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.5 12-Jan-1997  ragge std.vax readded, shall be here anyway.
 1.4 11-Jan-1997  ragge Add EXEC_AOUT and EXEC_SCRIPT. std.vax not needed anymore; removed.
 1.3 13-Feb-1995  ragge Program to make a fast convert from new to old config (Ugly!)
 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 std.vax was added on branch netbsd-1-0 on 1994-08-02 20:19:28 +0000
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.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.4.1 23-Jun-2000  fvdl As on the trunk, update these for the move of ffs_softdep.c into the
kernel source itself. Remove prefix construction, and add the SOFTDEP
option to GENERIC kernels.
 1.13.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.13.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.32.1 21-Jun-2006  yamt sync with head.
 1.14.16.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.16.186.1 06-Jun-2021  cjep sync with head
 1.16.182.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.2 30-Aug-2000  jhawk Use
${MAKE}
instead of
make
 1.1 08-Mar-1996  ragge branches: 1.1.30;
Files to generate usable console RL02 packs on 8600.
 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 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  ragge Files to generate usable console RL02 packs on 8600.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 21-Jun-2004  jmc Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
 1.1 02-Mar-1996  ragge branches: 1.1.64; 1.1.66;
Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.1.66.1 22-Jun-2004  tron Pull up revision 1.2 (requested by jmc in ticket #531):
Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
 1.1.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.64.1 03-Aug-2004  skrll Sync with HEAD
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 19-Apr-1997  ragge Update floppy boot files to confirm to new boot syntax.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 19-Apr-1997  ragge Update floppy boot files to confirm to new boot syntax.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 19-Apr-1997  ragge Update floppy boot files to confirm to new boot syntax.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 19-Apr-1997  ragge Update floppy boot files to confirm to new boot syntax.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 19-Apr-1997  ragge Update floppy boot files to confirm to new boot syntax.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 19-Apr-1997  ragge Update floppy boot files to confirm to new boot syntax.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 19-Apr-1997  ragge Update floppy boot files to confirm to new boot syntax.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.3 05-Dec-2021  msaitoh s/commmand/command/ in comment.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 02-Mar-1996  ragge Files needed to create boot floppies for 11/780, most of them
taken directly from 4.4BSD.
 1.48 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.47 05-Dec-2007  dyoung branches: 1.47.8; 1.47.12;
Use IFADDR_EMPTY().
 1.46 05-Dec-2007  dyoung Don't open-code queue(3) macros (x = ifnet.tqh_first; y =
x.if_list.tqe_next). Instead, use the macros themselves.
 1.45 04-Mar-2007  christos branches: 1.45.18; 1.45.20; 1.45.26; 1.45.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.44 28-Mar-2006  thorpej branches: 1.44.14;
Use device_unit().
 1.43 23-Feb-2006  thorpej branches: 1.43.2; 1.43.4; 1.43.6;
Use device_parent().
 1.42 11-Dec-2005  christos branches: 1.42.2; 1.42.4; 1.42.6;
merge ktrace-lwp.
 1.41 07-Aug-2003  agc branches: 1.41.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.40 15-Jul-2003  lukem __KERNEL_RCSID()
 1.39 02-Oct-2002  thorpej branches: 1.39.6;
Add trailing ; to CFATTACH_DECL.
 1.38 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 18-May-1999  thorpej branches: 1.36.16; 1.36.20;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.35 29-Nov-1998  ragge branches: 1.35.2; 1.35.6;
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.34 05-Nov-1998  ragge EGCS fixes.
 1.33 05-Jul-1998  jonathan defopt NS, NSIP.
 1.32 05-Jul-1998  jonathan defopt ISO TPIP.
 1.31 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.30 13-Apr-1998  ragge Wall cleaning.
 1.29 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.28 12-Jan-1998  thorpej Update for changes to config.
 1.27 19-Apr-1997  ragge Fix so that these files compile again after recent ARP changes.
 1.26 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.25 15-Nov-1996  thorpej branches: 1.25.6;
Use bitmask_snprintf().
 1.24 13-Oct-1996  christos backout previous kprintf change
 1.23 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.22 20-Aug-1996  ragge Change uba* functions to take pointers, rather than uba unit numbers.
 1.21 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.20 07-May-1996  thorpej Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.19 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.18 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.17 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.16 02-Mar-1996  ragge Change config delay's to more reasonable values.
 1.15 11-Feb-1996  ragge Add prototypes.
 1.14 02-Feb-1996  mycroft Fix #includes.
 1.13 02-Feb-1996  mycroft Fix #includes.
 1.12 30-Dec-1995  ragge Don't include de.h; it doesn't exist anymore.
 1.11 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.10 01-Dec-1995  ragge DELUA/DENUA & DELQA/DEQNA Ethernet adapters converted to new config.
 1.9 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.8 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.7 05-Jul-1995  ragge branches: 1.7.2;
Changes due to common network code mods.
 1.6 11-Apr-1995  mycroft Sync with the rest of the world. Say goodbye to Mr. Trailer.
 1.5 30-Mar-1995  ragge Support for DEQNA/DELQA added.
 1.4 13-Feb-1995  ragge Bug fixes to get network function OK.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge fixed minor problem with mtpr()
 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 if_de.c was added on branch netbsd-1-0 on 1994-08-02 20:19:46 +0000
 1.7.2.1 15-Oct-1995  ragge Type changing to be able to compile with -Werror.
 1.25.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.25.6.1 06-Mar-1997  is Convert to new ARP code.
 1.35.6.1 21-Jun-1999  thorpej Sync w/ -current.
 1.35.2.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.36.20.1 18-Oct-2002  nathanw Catch up to -current.
 1.36.16.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.39.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.39.6.1 03-Aug-2004  skrll Sync with HEAD
 1.41.16.4 17-Mar-2008  yamt sync with head.
 1.41.16.3 07-Dec-2007  yamt sync with head
 1.41.16.2 03-Sep-2007  yamt sync with head.
 1.41.16.1 21-Jun-2006  yamt sync with head.
 1.42.6.1 22-Apr-2006  simonb Sync with head.
 1.42.4.1 09-Sep-2006  rpaulo sync with head
 1.42.2.1 01-Mar-2006  yamt sync with head.
 1.43.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.43.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.43.2.1 01-Apr-2006  yamt sync with head.
 1.44.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.45.28.1 08-Dec-2007  ad Sync with head.
 1.45.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.45.20.2 23-Mar-2008  matt sync with HEAD
 1.45.20.1 09-Jan-2008  matt sync with HEAD
 1.45.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.47.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.47.8.1 24-Mar-2008  keiichi sync with head.
 1.6 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.5 11-Dec-2005  christos branches: 1.5.50; 1.5.70; 1.5.74;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc branches: 1.4.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 08-Apr-1996  ragge branches: 1.3.64;
Added prototypes to everything. Made all files compile with -Wall.
 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 if_dereg.h was added on branch netbsd-1-0 on 1994-08-02 20:19:49 +0000
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 17-Mar-2008  yamt sync with head.
 1.5.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.5.70.1 24-Mar-2008  keiichi sync with head.
 1.5.50.1 23-Mar-2008  matt sync with HEAD
 1.37 14-Dec-2010  matt Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.36 19-Jan-2010  pooka branches: 1.36.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.35 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.34 18-Mar-2009  cegger bcopy -> memcpy
 1.33 28-Apr-2008  martin branches: 1.33.8; 1.33.14;
Remove clause 3 and 4 from TNF licenses
 1.32 04-Apr-2008  tsutsui branches: 1.32.2; 1.32.4;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.31 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.30 04-Mar-2007  christos branches: 1.30.20; 1.30.36; 1.30.40;
Fix caddr_t fallout.
 1.29 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.28 11-Dec-2005  christos branches: 1.28.26;
merge ktrace-lwp.
 1.27 01-Apr-2005  yamt branches: 1.27.2;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.26 07-Aug-2003  agc branches: 1.26.8; 1.26.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.25 15-Jul-2003  lukem __KERNEL_RCSID()
 1.24 02-Oct-2002  thorpej branches: 1.24.6;
Add trailing ; to CFATTACH_DECL.
 1.23 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.21 28-Nov-2001  lukem use #ifdef INET instead of #if INET (for consistency with the rest of the kernel)
 1.20 29-Jun-2000  mrg branches: 1.20.4; 1.20.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.19 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.18 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.17 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.16 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.15 27-Jan-2000  bouyer branches: 1.15.2;
Adapt for matt's changes.
 1.14 14-Aug-1999  ragge branches: 1.14.2;
Support for on-board LANCE on MicroVAX 3300/3400. Also use MI LANCE
code for VAXstations again; though not functioning correctly on all
types of machines. (Will fix that later).
 1.13 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.12 21-Jul-1998  drochner adapt to LANCE driver split
 1.11 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.10 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.9 12-Jan-1998  thorpej Update for changes to config.
 1.8 21-Apr-1997  ragge Remove #define LEDEBUG.
 1.7 17-Mar-1997  thorpej #include <net/if_media.h>
 1.6 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.5 15-Mar-1997  ragge Change the way boot device is figured out; now only using DEC numbers
and done when the device get attached.
 1.4 26-Feb-1997  ragge Patches to make VS2000 to work. From Ari Suutari.
 1.3 13-Oct-1996  christos branches: 1.3.6;
backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 20-Jul-1996  ragge LANCE driver for vaxstations.
 1.3.6.3 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.3.6.2 06-Mar-1997  is Merge in patch from the Trunk.
 1.3.6.1 06-Mar-1997  is Convert to new ARP code.
 1.14.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.15.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.20.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.20.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.20.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.20.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.24.6.4 01-Apr-2005  skrll Sync with HEAD.
 1.24.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.6.1 03-Aug-2004  skrll Sync with HEAD
 1.26.10.1 12-Feb-2005  yamt use new apis.
 1.26.8.1 29-Apr-2005  kent sync with -current
 1.27.2.2 17-Mar-2008  yamt sync with head.
 1.27.2.1 03-Sep-2007  yamt sync with head.
 1.28.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.30.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.30.36.1 24-Mar-2008  keiichi sync with head.
 1.30.20.1 23-Mar-2008  matt sync with HEAD
 1.32.4.3 11-Mar-2010  yamt sync with head
 1.32.4.2 04-May-2009  yamt sync with head.
 1.32.4.1 16-May-2008  yamt sync with head.
 1.32.2.1 18-May-2008  yamt sync with head.
 1.33.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.33.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.36.4.1 05-Mar-2011  rmind sync with head
 1.29 29-May-2022  rin le(4): Fix resource leaks for error paths.

XXX
Compile test only (at least one arch per driver).
 1.28 14-Dec-2010  matt Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.27 19-Jan-2010  pooka branches: 1.27.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.26 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.25 18-Mar-2009  cegger bcopy -> memcpy
 1.24 28-Apr-2008  martin branches: 1.24.8; 1.24.14;
Remove clause 3 and 4 from TNF licenses
 1.23 04-Apr-2008  tsutsui branches: 1.23.2; 1.23.4;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.22 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.21 04-Mar-2007  christos branches: 1.21.20; 1.21.36; 1.21.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20 11-Dec-2005  christos branches: 1.20.26;
merge ktrace-lwp.
 1.19 07-Aug-2003  agc branches: 1.19.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.18 15-Jul-2003  lukem __KERNEL_RCSID()
 1.17 03-May-2003  wiz branches: 1.17.2;
DMA, not dma nor Dma.
 1.16 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.15 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.14 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 28-Nov-2001  lukem use #ifdef INET instead of #if INET (for consistency with the rest of the kernel)
 1.11 04-Feb-2001  ragge branches: 1.11.4; 1.11.8;
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.10 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.9 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.8 05-Jun-2000  matt Adjust to new evcnt stuff.
 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 22-May-2000  matt branches: 1.6.2;
Remove RPB hook from here and put in autoconf.c
 1.5 18-Mar-2000  ragge Fix typo that caused lance chip not to be detected.
 1.4 04-Mar-2000  matt Oopps. forgot to commit this.
 1.3 24-Jan-2000  matt More files that were changed.
 1.2 27-Aug-1999  ragge branches: 1.2.2;
Changes for 4000/90.
 1.1 14-Aug-1999  ragge Support for on-board LANCE on MicroVAX 3300/3400. Also use MI LANCE
code for VAXstations again; though not functioning correctly on all
types of machines. (Will fix that later).
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 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.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.11.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.11.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.11.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 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.19.16.2 17-Mar-2008  yamt sync with head.
 1.19.16.1 03-Sep-2007  yamt sync with head.
 1.20.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.21.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.21.36.1 24-Mar-2008  keiichi sync with head.
 1.21.20.1 23-Mar-2008  matt sync with HEAD
 1.23.4.3 11-Mar-2010  yamt sync with head
 1.23.4.2 04-May-2009  yamt sync with head.
 1.23.4.1 16-May-2008  yamt sync with head.
 1.23.2.1 18-May-2008  yamt sync with head.
 1.24.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.24.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.27.4.1 05-Mar-2011  rmind sync with head
 1.36 30-Jun-1999  ragge Outdated; moved to another location.
 1.35 23-May-1999  ragge Make this file compile again.
 1.34 18-May-1999  thorpej Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.33 29-Nov-1998  ragge branches: 1.33.2; 1.33.6;
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 05-Nov-1998  ragge EGCS fixes.
 1.31 05-Jul-1998  jonathan defopt NS, NSIP.
 1.30 05-Jul-1998  jonathan defopt ISO TPIP.
 1.29 05-Jul-1998  jonathan defopt LLC
 1.28 05-Jul-1998  jonathan defopt CCITT.
 1.27 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.26 20-Jun-1998  ragge Fix some compile-time warnings. Pointed out by David Brownlee.
 1.25 13-Mar-1998  ragge Add support for "root on qe".
 1.24 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.23 12-Jan-1998  thorpej Update for changes to config.
 1.22 02-May-1997  ragge BPF and multicast support added, patches provided by Jonathan Stone
and Ken Wellsch. Fixes PR#2796.
 1.21 19-Apr-1997  ragge Fix so that these files compile again after recent ARP changes.
 1.20 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.19 12-Feb-1997  ragge Fix so it works with root over NFS.
 1.18 13-Oct-1996  christos branches: 1.18.6;
backout previous kprintf change
 1.17 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.16 20-Aug-1996  ragge Change uba* functions to take pointers, rather than uba unit numbers.
 1.15 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.14 07-May-1996  thorpej Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.13 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.12 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.11 11-Feb-1996  ragge Add prototypes.
 1.10 02-Feb-1996  mycroft Fix #includes.
 1.9 02-Feb-1996  mycroft Fix #includes.
 1.8 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.7 01-Dec-1995  ragge DELUA/DENUA & DELQA/DEQNA Ethernet adapters converted to new config.
 1.6 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.5 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.4 05-Jul-1995  ragge branches: 1.4.2;
Changes due to common network code mods.
 1.3 16-Jun-1995  ragge DELAY() removed, now common.
 1.2 11-Apr-1995  mycroft Sync with the rest of the world. Say goodbye to Mr. Trailer.
 1.1 30-Mar-1995  ragge Support for DEQNA/DELQA added.
 1.4.2.1 15-Oct-1995  ragge Type changing to be able to compile with -Werror.
 1.18.6.3 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.18.6.2 06-Mar-1997  is Merge in fix from the Trunk.
 1.18.6.1 06-Mar-1997  is Convert to new ARP code.
 1.33.6.2 01-Jul-1999  thorpej Sync w/ -current.
 1.33.6.1 21-Jun-1999  thorpej Sync w/ -current.
 1.33.2.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.4 30-Jun-1999  ragge Outdated; moved to another location.
 1.3 12-Apr-1999  pk Ungarble the copyright notice.
 1.2 15-May-1997  ragge branches: 1.2.16;
Multicast definitions, forgotten in previous checkins.
 1.1 30-Mar-1995  ragge Support for DEQNA/DELQA added.
 1.2.16.1 12-Apr-1999  pk branches: 1.2.16.1.2;
Pullup copyright text corrections.
 1.2.16.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.2.16.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.22 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.21 04-Mar-2007  christos branches: 1.21.20; 1.21.36; 1.21.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20 11-Dec-2005  christos branches: 1.20.26;
merge ktrace-lwp.
 1.19 07-Aug-2003  agc branches: 1.19.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.18 15-Jul-2003  lukem __KERNEL_RCSID()
 1.17 25-Sep-2002  thorpej branches: 1.17.6;
Don't include <sys/map.h>.
 1.16 05-Mar-2002  simonb Don't cast argument to ffs() to long.
Per discussion on port-alpha, noticed by Robert Elz.
 1.15 01-Jan-1999  ragge branches: 1.15.22; 1.15.26;
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.14 29-Nov-1998  ragge branches: 1.14.2;
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.13 05-Nov-1998  ragge EGCS fixes.
 1.12 20-Aug-1996  ragge Change uba* functions to take pointers, rather than uba unit numbers.
 1.11 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.10 11-Feb-1996  ragge Add prototypes.
 1.9 02-Feb-1996  mycroft Fix #includes.
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.6 11-Apr-1995  mycroft GC old comment about trailers.
 1.5 11-Apr-1995  mycroft Sync with the rest of the world. Say goodbye to Mr. Trailer.
 1.4 13-Feb-1995  ragge Bug fixes to get network function OK.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge fixed minor problem with mtpr()
 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 if_uba.c was added on branch netbsd-1-0 on 1994-08-02 20:19:50 +0000
 1.14.2.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.15.26.2 18-Oct-2002  nathanw Catch up to -current.
 1.15.26.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.15.22.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.15.22.1 16-Mar-2002  jdolecek Catch up with -current.
 1.17.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.6.1 03-Aug-2004  skrll Sync with HEAD
 1.19.16.2 17-Mar-2008  yamt sync with head.
 1.19.16.1 03-Sep-2007  yamt sync with head.
 1.20.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.21.36.1 24-Mar-2008  keiichi sync with head.
 1.21.20.1 23-Mar-2008  matt sync with HEAD
 1.11 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.10 04-Mar-2007  christos branches: 1.10.20; 1.10.36; 1.10.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 11-Dec-2005  christos branches: 1.9.26;
merge ktrace-lwp.
 1.8 07-Aug-2003  agc branches: 1.8.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.7 03-May-2003  wiz branches: 1.7.2;
DMA, not dma nor Dma.
 1.6 20-Aug-1996  ragge Change uba* functions to take pointers, rather than uba unit numbers.
 1.5 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.4 11-Feb-1996  ragge Add prototypes.
 1.3 11-May-1995  jtc KERNEL -> _KERNEL
 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 if_uba.h was added on branch netbsd-1-0 on 1994-08-02 20:19:52 +0000
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.2 17-Mar-2008  yamt sync with head.
 1.8.16.1 03-Sep-2007  yamt sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.36.1 24-Mar-2008  keiichi sync with head.
 1.10.20.1 23-Mar-2008  matt sync with HEAD
 1.18 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.17 14-Dec-2010  matt branches: 1.17.18; 1.17.36;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.16 19-Jan-2010  pooka branches: 1.16.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.15 14-Mar-2008  jkunz branches: 1.15.4;
Fix falout from recent VAX code rototill:
MicroVAX 4000/[3-7]00 could not get HW Ethernet address.
 1.14 14-Mar-2008  jkunz Fix falout from recent VAX code rototill: MicroVAX 4000/1xx and 3100m9x could not get HW Ethernet address.
 1.13 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.12 11-Dec-2005  christos branches: 1.12.50; 1.12.70; 1.12.74;
merge ktrace-lwp.
 1.11 10-Nov-2003  wiz branches: 1.11.16;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.10 15-Jul-2003  lukem __KERNEL_RCSID()
 1.9 02-Oct-2002  thorpej branches: 1.9.6;
Add trailing ; to CFATTACH_DECL.
 1.8 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.7 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.6 27-May-2002  ragge Read correct Ethernet address on VXT2000.
 1.5 04-Jun-2000  matt branches: 1.5.6; 1.5.10; 1.5.18;
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.4 08-May-2000  ragge branches: 1.4.2;
Get correct MAC address out of rom on VAX 4000/200. From Michael Kukat.
 1.3 24-Jan-2000  matt More files that were changed.
 1.2 27-Aug-1999  ragge branches: 1.2.2;
Changes for 4000/90.
 1.1 08-Aug-1999  ragge Add support for the SGEC.
 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.4.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.18.1 30-May-2002  gehenna Catch up with -current.
 1.5.10.2 18-Oct-2002  nathanw Catch up to -current.
 1.5.10.1 20-Jun-2002  nathanw Catch up to -current.
 1.5.6.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.5.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.1 17-Mar-2008  yamt sync with head.
 1.12.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.12.70.1 24-Mar-2008  keiichi sync with head.
 1.12.50.1 23-Mar-2008  matt sync with HEAD
 1.15.4.1 11-Mar-2010  yamt sync with head
 1.16.4.1 05-Mar-2011  rmind sync with head
 1.17.36.1 28-Aug-2017  skrll Sync with HEAD
 1.17.18.1 03-Dec-2017  jdolecek update from 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 01-Jul-1998  ragge branches: 1.1.48;
Added boot program support for the SGEC Ethernet controller, present on
some VAX 4000 maachines. Written by Jay Maynard. (jmaynard@phoenix.net)
 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.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.
 1.54 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.53 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.52 31-Dec-2014  christos return error
 1.51 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.50 25-Jul-2014  dholland branches: 1.50.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.49 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.48 14-Dec-2010  matt branches: 1.48.18; 1.48.32;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.47 13-Jan-2009  yamt branches: 1.47.6;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.46 11-Mar-2008  matt branches: 1.46.4; 1.46.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.45 17-Oct-2007  garbled branches: 1.45.12; 1.45.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.44 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.43 04-Mar-2007  christos branches: 1.43.2; 1.43.10; 1.43.18; 1.43.20; 1.43.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.42 16-Apr-2006  he branches: 1.42.14;
Make this build again (replace indirection with field access).
 1.41 14-Apr-2006  blymn Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
 1.40 28-Mar-2006  thorpej Use device_unit().
 1.39 11-Dec-2005  christos branches: 1.39.4; 1.39.6; 1.39.8; 1.39.10; 1.39.12;
merge ktrace-lwp.
 1.38 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.37 28-Oct-2004  yamt branches: 1.37.12;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.36 29-Dec-2003  pk hpfinish: pass correct buffer to diskerr();
 1.35 15-Jul-2003  lukem __KERNEL_RCSID()
 1.34 10-May-2003  thorpej branches: 1.34.2;
Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.33 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.32 16-Apr-2003  bouyer Nake return values from bounds_check_with_label() conform to the man
page: -1 for error, 0 for EOF, 1 otherwise. Inspired by an OpenBSD commit
message, pointed out by Miod Vallat in private mail.
vax/mba/hp.c: check return value <= 0, not < 0 to be concistent with how
other places handle return values from bounds_check_with_label().
 1.31 01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.30 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 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.25 22-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.24 04-Jun-2000  ragge branches: 1.24.4; 1.24.6; 1.24.10; 1.24.18;
Remove home-grown interrupt vector handler.
Bus_space'ify; needed to get RH11 working. Still much more to do, though.
 1.23 23-May-2000  matt branches: 1.23.2;
boot detection moved autoconf.c; remove it from here.
 1.22 12-Feb-2000  ragge Nuke unused variable.
 1.21 07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.20 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.19 14-Aug-1999  ragge branches: 1.19.2; 1.19.8;
Erroneous checking of return value from bounds_check_with_label().
Massbus disks should work now.
 1.18 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.17 12-Jan-1998  thorpej Update for changes to config.
 1.16 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.15 24-Jun-1997  thorpej foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
 1.14 15-Mar-1997  ragge Change the way boot device is figured out; now only using DEC numbers
and done when the device get attached.
 1.13 31-Jan-1997  thorpej Pass a struct device ** down to the functions that find the boot device.
 1.12 13-Oct-1996  christos branches: 1.12.2;
backout previous kprintf change
 1.11 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.10 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.9 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.8 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.7 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.6 24-Feb-1996  ragge Add routine to convert phys device number to kernel unit number.
Allow to set disklabel area writable.
 1.5 23-Feb-1996  ragge Allow rewriting of disk label after newfs.
 1.4 11-Feb-1996  ragge Device drivers for massbus adapters and massbus disks.
Works with RP04/05/06/07 disks.
 1.3 02-Feb-1996  mycroft Fix #includes.
 1.2 02-Feb-1996  mycroft Fix #includes.
 1.1 13-Feb-1995  ragge Beginning ov Massbuss support.
 1.12.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.19.8.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.19.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.23.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.24.18.2 31-Aug-2002  gehenna catch up with -current.
 1.24.18.1 17-May-2002  gehenna Add device switch.
 1.24.10.4 11-Nov-2002  nathanw Catch up to -current
 1.24.10.3 18-Oct-2002  nathanw Catch up to -current.
 1.24.10.2 17-Sep-2002  nathanw Catch up to -current.
 1.24.10.1 01-Aug-2002  nathanw Catch up to -current.
 1.24.6.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.24.6.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.24.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.34.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.34.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.34.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.34.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.34.2.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.34.2.1 03-Aug-2004  skrll Sync with HEAD
 1.37.12.4 17-Mar-2008  yamt sync with head.
 1.37.12.3 27-Oct-2007  yamt sync with head.
 1.37.12.2 03-Sep-2007  yamt sync with head.
 1.37.12.1 21-Jun-2006  yamt sync with head.
 1.39.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.39.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.39.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.39.8.2 24-May-2006  yamt sync with head.
 1.39.8.1 01-Apr-2006  yamt sync with head.
 1.39.6.1 22-Apr-2006  simonb Sync with head.
 1.39.4.1 09-Sep-2006  rpaulo sync with head
 1.42.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.43.22.1 14-Oct-2007  yamt sync with head.
 1.43.20.2 23-Mar-2008  matt sync with HEAD
 1.43.20.1 06-Nov-2007  matt sync with HEAD
 1.43.18.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.43.10.1 16-Oct-2007  garbled Sync with HEAD
 1.43.2.1 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.45.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.45.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.45.12.1 24-Mar-2008  keiichi sync with head.
 1.46.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.46.4.1 04-May-2009  yamt sync with head.
 1.47.6.1 05-Mar-2011  rmind sync with head
 1.48.32.1 10-Aug-2014  tls Rebase.
 1.48.18.3 03-Dec-2017  jdolecek update from HEAD
 1.48.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.48.18.1 02-Dec-2012  tls Don't pass NULL struct dkdriver to disk_init. That's seriously bogus.
 1.50.4.3 28-Aug-2017  skrll Sync with HEAD
 1.50.4.2 09-Jul-2016  skrll Sync with HEAD
 1.50.4.1 06-Apr-2015  skrll Sync with HEAD
 1.2 12-Dec-1995  ragge Unneccessary.
 1.1 13-Feb-1995  ragge Beginning ov Massbuss support.
 1.6 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.5 04-Jun-2000  ragge branches: 1.5.176; 1.5.196;
Remove home-grown interrupt vector handler.
Bus_space'ify; needed to get RH11 working. Still much more to do, though.
 1.4 11-Feb-1996  ragge branches: 1.4.30; 1.4.38;
Device drivers for massbus adapters and massbus disks.
Works with RP04/05/06/07 disks.
 1.3 20-Oct-1995  ragge branches: 1.3.2;
Additions to be able to write to massbuss disks standalone.
 1.2 16-Jun-1995  ragge Some flags added to use in boot blocks.
 1.1 13-Feb-1995  ragge Beginning ov Massbuss support.
 1.3.2.2 20-Oct-1995  ragge Additions to be able to write to massbuss disks standalone.
 1.3.2.1 20-Oct-1995  ragge file hpreg.h was added on branch netbsd-1-1 on 1995-10-20 13:43:44 +0000
 1.4.38.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.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.5.196.1 28-Aug-2017  skrll Sync with HEAD
 1.5.176.1 03-Dec-2017  jdolecek update from HEAD
 1.42 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.41 24-Apr-2021  thorpej branches: 1.41.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.40 22-May-2017  ragge branches: 1.40.24;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.39 14-Dec-2010  matt branches: 1.39.18; 1.39.36;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.38 13-Jan-2009  yamt branches: 1.38.6;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.37 16-Oct-2008  hans branches: 1.37.2;
fix detection of unknown massbus devices, ok by matt
 1.36 11-Mar-2008  matt branches: 1.36.4; 1.36.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.35 11-Dec-2005  christos branches: 1.35.50; 1.35.70; 1.35.74;
merge ktrace-lwp.
 1.34 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.33 31-Oct-2004  he branches: 1.33.12;
Include the <sys/bufq.h> header to allow these to compile again.
 1.32 15-Jul-2003  lukem __KERNEL_RCSID()
 1.31 03-May-2003  wiz branches: 1.31.2;
DMA, not dma nor Dma.
 1.30 01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 22-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.25 10-Jul-2000  ragge branches: 1.25.4; 1.25.8; 1.25.16;
Nexus vector number is 0x14-0x17, not 14-17! Fortunately, 3 wrong did
one right. Pointed out by Kenn Humborg (kenn@linux.ie).
 1.24 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.23 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.22 05-Jun-2000  matt branches: 1.22.2;
Adjust to new evcnt stuff.
 1.21 04-Jun-2000  ragge Remove home-grown interrupt vector handler.
Bus_space'ify; needed to get RH11 working. Still much more to do, though.
 1.20 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.19 19-May-2000  thorpej branches: 1.19.2;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.18 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.17 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.16 17-Jan-2000  matt defopt VAX750 side effect.
 1.15 01-Jan-1999  ragge branches: 1.15.8;
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.14 21-May-1998  ragge Wall fix.
 1.13 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.12 18-Jan-1998  ragge Make kernel compile & run again after latest config changes.
 1.11 12-Jan-1998  thorpej Update for changes to config.
 1.10 13-Oct-1996  christos backout previous kprintf change
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.7 20-Aug-1996  ragge Use common routine to map in pages before DMA'ing.
 1.6 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.5 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.4 24-Feb-1996  ragge Add routine to convert phys device number to kernel unit number.
Allow to set disklabel area writable.
 1.3 11-Feb-1996  ragge Device drivers for massbus adapters and massbus disks.
Works with RP04/05/06/07 disks.
 1.2 02-Feb-1996  mycroft Fix #includes.
 1.1 13-Feb-1995  ragge Beginning ov Massbuss support.
 1.15.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.19.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.22.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.25.16.1 31-Aug-2002  gehenna catch up with -current.
 1.25.8.3 03-Jan-2003  thorpej Sync with HEAD.
 1.25.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.25.8.1 01-Aug-2002  nathanw Catch up to -current.
 1.25.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.25.4.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.31.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.31.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.31.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.31.2.1 03-Aug-2004  skrll Sync with HEAD
 1.33.12.2 17-Mar-2008  yamt sync with head.
 1.33.12.1 21-Jun-2006  yamt sync with head.
 1.35.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.35.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.35.70.1 24-Mar-2008  keiichi sync with head.
 1.35.50.1 23-Mar-2008  matt sync with HEAD
 1.36.10.1 19-Oct-2008  haad Sync with HEAD.
 1.36.4.1 04-May-2009  yamt sync with head.
 1.37.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.38.6.1 05-Mar-2011  rmind sync with head
 1.39.36.1 28-Aug-2017  skrll Sync with HEAD
 1.39.18.1 03-Dec-2017  jdolecek update from HEAD
 1.40.24.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.41.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.5 16-Oct-2008  hans branches: 1.5.38; 1.5.58;
fix detection of unknown massbus devices, ok by matt
 1.4 04-Jun-2000  ragge branches: 1.4.128; 1.4.132; 1.4.138;
Remove home-grown interrupt vector handler.
Bus_space'ify; needed to get RH11 working. Still much more to do, though.
 1.3 11-Feb-1996  ragge branches: 1.3.30; 1.3.38;
Device drivers for massbus adapters and massbus disks.
Works with RP04/05/06/07 disks.
 1.2 20-Oct-1995  ragge branches: 1.2.2;
Additions to be able to write to massbuss disks standalone.
 1.1 13-Feb-1995  ragge Beginning ov Massbuss support.
 1.2.2.2 20-Oct-1995  ragge Additions to be able to write to massbuss disks standalone.
 1.2.2.1 20-Oct-1995  ragge file mbareg.h was added on branch netbsd-1-1 on 1995-10-20 13:43:45 +0000
 1.3.38.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.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.4.138.1 19-Oct-2008  haad Sync with HEAD.
 1.4.132.1 04-May-2009  yamt sync with head.
 1.4.128.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.58.1 28-Aug-2017  skrll Sync with HEAD
 1.5.38.1 03-Dec-2017  jdolecek update from HEAD
 1.14 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.13 16-Oct-2008  hans branches: 1.13.38; 1.13.58;
fix detection of unknown massbus devices, ok by matt
 1.12 11-Mar-2008  matt branches: 1.12.4; 1.12.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.11 11-Dec-2005  christos branches: 1.11.50; 1.11.70; 1.11.74;
merge ktrace-lwp.
 1.10 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.9 03-Jun-2005  ragge branches: 1.9.2;
Declare string pointers const.
 1.8 22-Jul-2002  hannken branches: 1.8.6;
Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.7 04-Jun-2000  ragge branches: 1.7.6; 1.7.10; 1.7.18;
Remove home-grown interrupt vector handler.
Bus_space'ify; needed to get RH11 working. Still much more to do, though.
 1.6 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.5 21-Jan-2000  thorpej branches: 1.5.2;
Update for sys/buf.h/disksort_*() changes.
 1.4 08-Apr-1996  ragge branches: 1.4.30;
Added prototypes to everything. Made all files compile with -Wall.
 1.3 24-Feb-1996  ragge Add routine to convert phys device number to kernel unit number.
Allow to set disklabel area writable.
 1.2 11-Feb-1996  ragge Device drivers for massbus adapters and massbus disks.
Works with RP04/05/06/07 disks.
 1.1 13-Feb-1995  ragge Beginning ov Massbuss support.
 1.4.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.5.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.18.1 31-Aug-2002  gehenna catch up with -current.
 1.7.10.1 01-Aug-2002  nathanw Catch up to -current.
 1.7.6.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.8.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.2 17-Mar-2008  yamt sync with head.
 1.9.2.1 21-Jun-2006  yamt sync with head.
 1.11.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.11.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.70.1 24-Mar-2008  keiichi sync with head.
 1.11.50.1 23-Mar-2008  matt sync with HEAD
 1.12.10.1 19-Oct-2008  haad Sync with HEAD.
 1.12.4.1 04-May-2009  yamt sync with head.
 1.13.58.1 28-Aug-2017  skrll Sync with HEAD
 1.13.38.1 03-Dec-2017  jdolecek update from HEAD
 1.4 27-Aug-2002  lukem arch/*/stand stuff should be LDSTATIC=-static and not LDSTATIC?=-static.
It doesn't make sense to have standalone stuff dynamically linked just
because an end-user uses LDSTATIC="".
 1.3 12-Dec-2001  lukem branches: 1.3.8;
Set NOxxx= before <bsd.own.mk> is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
 1.2 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.1 17-Jun-2000  matt branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
Add an installboot(8) for vax. This is needed so the VAX can do multiboot
CDroms.
 1.1.14.2 27-Aug-2002  nathanw Catch up to -current.
 1.1.14.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.10.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 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 17-Jun-2000  bouyer file Makefile.inc was added on branch thorpej_scsipi on 2000-11-20 20:33:08 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 17-Jun-2000  minoura file Makefile.inc was added on branch minoura-xpg4dl on 2000-06-22 17:05:12 +0000
 1.3.8.1 31-Aug-2002  gehenna catch up with -current.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 19-Mar-2004  jmc Convert to usage of UUDECODE_FILES and standardize on filename extension
 1.3 10-Jul-2003  lukem Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO". The new variables are:
TOOL_ASN1_COMPILE TOOL_CAP_MKDB TOOL_CAT TOOL_CKSUM TOOL_COMPILE_ET
TOOL_CONFIG TOOL_CRUNCHGEN TOOL_CTAGS TOOL_DB TOOL_EQN TOOL_FGEN
TOOL_GENCAT TOOL_GROFF TOOL_HEXDUMP TOOL_INDXBIB TOOL_INSTALLBOOT
TOOL_INSTALL_INFO TOOL_M4 TOOL_MAKEFS TOOL_MAKEINFO TOOL_MAKEWHATIS
TOOL_MDSETIMAGE TOOL_MENUC TOOL_MKCSMAPPER TOOL_MKESDB
TOOL_MKLOCALE TOOL_MKMAGIC TOOL_MKTEMP TOOL_MSGC TOOL_MTREE
TOOL_PAX TOOL_PIC TOOL_PREPMKBOOTIMAGE TOOL_PWD_MKDB TOOL_REFER
TOOL_ROFF_ASCII TOOL_ROFF_DVI TOOL_ROFF_HTML TOOL_ROFF_PS
TOOL_ROFF_RAW TOOL_RPCGEN TOOL_SOELIM TOOL_SUNLABEL TOOL_TBL
TOOL_UUDECODE TOOL_VGRIND TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
TOOL_FOO?= foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
TOOL_FOO= ${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
 1.2 24-Apr-2002  lukem branches: 1.2.6; 1.2.12;
- in <bsd.files.mk>, don't clear FILES after using it, as that prevents
make -V FILES
from being useful (and given that every other variable can be
extracted using make -V, the behaviour was unusually inconsistent
given that the original reason for clearing it doesn't seem to be
relevant anymore)
- use <bsd.prog.mk> instead of directly including <bsd.files.mk>
(and possibly <bsd.man.mk> or <bsd.own.mk>)
- remove obsolete NOPROG
 1.1 09-Apr-2002  matt branches: 1.1.2;
Move installation of pcs750.bin from etc/etc.vax to here so we can get an
object directory.
 1.1.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.1.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.1 09-Apr-2002  nathanw file Makefile was added on branch nathanw_sa on 2002-04-17 00:04:40 +0000
 1.2.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.12.1 03-Aug-2004  skrll Sync with HEAD
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 24-Apr-2002  jdolecek file Makefile was added on branch kqueue on 2002-06-23 17:43:03 +0000
 1.1 09-Apr-2002  matt branches: 1.1.2; 1.1.8;
Move installation of pcs750.bin from etc/etc.vax to here so we can get an
object directory.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 09-Apr-2002  jdolecek file pcs750.bin.uue was added on branch kqueue on 2002-06-23 17:43:03 +0000
 1.1.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.1 09-Apr-2002  nathanw file pcs750.bin.uue was added on branch nathanw_sa on 2002-04-17 00:04:41 +0000
 1.14 20-Jun-1999  ragge Remove moved files.
 1.13 19-Jan-1999  ragge branches: 1.13.4;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.12 13-Apr-1998  ragge t_wopen fixes.
 1.11 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.10 12-Jan-1998  thorpej Update for changes to config.
 1.9 11-Jan-1997  ragge Update due to changes to uba/mscp functions.
 1.8 13-Oct-1996  christos backout previous kprintf change
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.6 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.5 19-May-1996  ragge Update from Ken Wellsch.
 1.4 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.3 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.2 17-Mar-1996  ragge Update from Ken Wellsch: The DHU driver can now handle DMA transfers.
 1.1 02-Mar-1996  ragge Unibus/Q22 bus device driver for DHU-11 serial card.
Written by Ken Wellsch. (kcwellsc@math.uwaterloo.ca)
 1.13.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3 20-Jun-1999  ragge Remove moved files.
 1.2 17-Mar-1996  ragge branches: 1.2.26;
Update from Ken Wellsch: The DHU driver can now handle DMA transfers.
 1.1 02-Mar-1996  ragge Unibus/Q22 bus device driver for DHU-11 serial card.
Written by Ken Wellsch. (kcwellsc@math.uwaterloo.ca)
 1.2.26.1 01-Jul-1999  thorpej Sync w/ -current.
 1.7 20-Jun-1999  ragge Remove moved files.
 1.6 19-Jan-1999  ragge branches: 1.6.4;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.5 13-Apr-1998  ragge t_wopen fixes.
 1.4 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.3 12-Jan-1998  thorpej Update for changes to config.
 1.2 05-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 04-Feb-1997  ragge branches: 1.1.8;
Support for DL11 (-compatible) async ctlr.
Written by Ben Harris (bjh@mail.dotcom.fr).
 1.1.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.2 20-Jun-1999  ragge Remove moved files.
 1.1 04-Feb-1997  ragge branches: 1.1.22;
Support for DL11 (-compatible) async ctlr.
Written by Ben Harris (bjh@mail.dotcom.fr).
 1.1.22.1 01-Jul-1999  thorpej Sync w/ -current.
 1.15 20-Jun-1999  ragge Remove moved files.
 1.14 13-Mar-1999  ragge branches: 1.14.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.13 05-Nov-1998  ragge EGCS fixes.
 1.12 10-Aug-1998  ragge Kickoff xmit interrupts, needed on chip DC7201.
 1.11 04-Jul-1998  jonathan defopt DDB.
 1.10 14-Jun-1998  ragge Add catch function for keyboard.
 1.9 23-May-1998  ragge Fixed bug with lost characters in DDB output.
 1.8 21-May-1998  ragge Support for DDB on DZ console.
 1.7 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.6 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.5 12-Jan-1998  thorpej Update for changes to config.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.1 08-Apr-1996  ragge Drivers for DZ11/DZV11/DZQ11 serial cards.
Written (mostly) by Ken Wellsch.
 1.14.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.4 20-Jun-1999  ragge Remove moved files.
 1.3 13-Mar-1999  ragge branches: 1.3.4;
Avoid warning if !QBA.
 1.2 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.1 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.3.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3 20-Jun-1999  ragge Remove moved files.
 1.2 17-May-1998  ragge branches: 1.2.10;
Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.1 08-Apr-1996  ragge Drivers for DZ11/DZV11/DZQ11 serial cards.
Written (mostly) by Ken Wellsch.
 1.2.10.1 01-Jul-1999  thorpej Sync w/ -current.
 1.4 20-Jun-1999  ragge Remove moved files.
 1.3 13-Mar-1999  ragge branches: 1.3.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.2 14-Jun-1998  ragge Add catch function for keyboard.
 1.1 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.3.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3 20-Aug-1996  ragge Use the same device driver for both uda and mtc. Actually, the only
difference is vcid. The unit names must differ, so that it is possible
to distinguish them at autoconf time.
 1.2 20-Jul-1996  ragge CPU determine code. ts driver converted to new config. May work, untested.
 1.1 10-Jul-1996  ragge Remove old (tape-only) tmscp driver. Add new uba/qba driver
for common MSCP routines.
 1.2 20-Aug-1996  ragge Use the same device driver for both uda and mtc. Actually, the only
difference is vcid. The unit names must differ, so that it is possible
to distinguish them at autoconf time.
 1.1 10-Jul-1996  ragge Remove old (tape-only) tmscp driver. Add new uba/qba driver
for common MSCP routines.
 1.16 04-Jun-2000  matt newer version exists in dev/qbus. nuke this one.
 1.15 27-May-2000  thorpej branches: 1.15.2;
sleep() -> tsleep()
 1.14 18-Jan-2000  thorpej iodone() -> biodone()
 1.13 17-Apr-1999  ragge branches: 1.13.2;
Only allocate QDSS memory if there is a QDSS as console.
QDSS should also work on KA650 now. (untested)
 1.12 19-Jan-1999  ragge branches: 1.12.4;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.11 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.10 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.9 05-Nov-1998  ragge EGCS fixes.
 1.8 04-Jul-1998  jonathan defopt DDB.
 1.7 20-Jun-1998  ragge Don't try to configure QDSS console on KA650 until it's fixed.
 1.6 13-Apr-1998  ragge Wall cleaning.
 1.5 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.1 18-Aug-1996  jonathan Import framebuffer drivers from 4.4-Lite2 as the root for NetBSD drivers.
Only change from Lite (or lite2, qv.c and qd.c do not change) is adding
NetBSD RCS ids.
 1.12.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.13.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.15.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3 04-Jun-2000  matt now in dev/qbus so nuke this version.
 1.2 13-Apr-1998  ragge branches: 1.2.14; 1.2.22;
Wall cleaning.
 1.1 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.2.22.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.38 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.37 24-Apr-2021  thorpej branches: 1.37.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.36 21-Nov-2020  thorpej branches: 1.36.2;
malloc(9) -> kmem(9)
 1.35 14-Jun-2020  chs branches: 1.35.2;
replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.34 14-Mar-2019  thorpej Use copyin(), not fusword().
 1.33 22-May-2017  ragge branches: 1.33.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.32 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.31 05-Jul-2015  matt Revamped QVSS (VCB01) support. (from Charles Dickman)
 1.30 25-Jul-2014  dholland branches: 1.30.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.29 16-Mar-2014  dholland branches: 1.29.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.28 30-Jun-2011  wiz branches: 1.28.2; 1.28.12; 1.28.16;
dependant -> dependent
 1.27 21-Nov-2009  rmind - Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.26 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.25 18-Mar-2009  cegger bcopy -> memcpy
 1.24 18-Mar-2009  cegger bzero -> memset
 1.23 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.22 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.21 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.20 11-Mar-2008  matt branches: 1.20.4; 1.20.12; 1.20.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.19 01-Mar-2008  rmind Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.18 19-Nov-2007  ad branches: 1.18.10; 1.18.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.17 04-Mar-2007  christos branches: 1.17.2; 1.17.18; 1.17.20; 1.17.24; 1.17.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.16 26-Nov-2005  thorpej branches: 1.16.26;
Use t_linesw instead of (the non-existent) t_line.
 1.15 13-Feb-2004  wiz branches: 1.15.16; 1.15.24;
Uppercase CPU, plural is CPUs.
 1.14 04-Jan-2004  wiz Spell controller with two ls. Inspired by miod@openbsd.
 1.13 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.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 23-Oct-2002  jdolecek branches: 1.11.6;
merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.10 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.9 19-Sep-2002  ragge Do not include <sys/clist.h>, it's not used in NetBSD at all.
 1.8 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.7 17-Mar-2002  atatat branches: 1.7.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.6 22-Jul-2001  wiz branches: 1.6.2; 1.6.6;
seperate -> separate
 1.5 02-May-2001  scw branches: 1.5.2;
Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.4 02-Nov-2000  eeh branches: 1.4.2;
Adapt to new line discipline scheme.
 1.3 01-Jan-1999  ragge branches: 1.3.8;
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.2 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.1 18-Aug-1996  jonathan Import framebuffer drivers from 4.4-Lite2 as the root for NetBSD drivers.
Only change from Lite (or lite2, qv.c and qd.c do not change) is adding
NetBSD RCS ids.
 1.3.8.1 22-Nov-2000  bouyer Sync with HEAD.
 1.4.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.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.5.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.1 03-Aug-2001  lukem update to -current
 1.6.6.5 11-Nov-2002  nathanw Catch up to -current
 1.6.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.6.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.6.6.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.6.1 22-Jul-2001  nathanw file qv.c was added on branch nathanw_sa on 2002-04-01 07:43:30 +0000
 1.6.2.1 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.7.4.1 17-May-2002  gehenna Add device switch.
 1.11.6.4 11-Dec-2005  christos Sync with head.
 1.11.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.6.1 03-Aug-2004  skrll Sync with HEAD
 1.15.24.1 29-Nov-2005  yamt sync with head.
 1.15.16.4 17-Mar-2008  yamt sync with head.
 1.15.16.3 07-Dec-2007  yamt sync with head
 1.15.16.2 03-Sep-2007  yamt sync with head.
 1.15.16.1 21-Jun-2006  yamt sync with head.
 1.16.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.17.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.17.24.1 21-Nov-2007  bouyer Sync with HEAD
 1.17.20.2 23-Mar-2008  matt sync with HEAD
 1.17.20.1 09-Jan-2008  matt sync with HEAD
 1.17.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.17.2.1 03-Dec-2007  ad Sync with HEAD.
 1.18.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.18.10.1 24-Mar-2008  keiichi sync with head.
 1.20.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.20.4.2 11-Mar-2010  yamt sync with head
 1.20.4.1 04-May-2009  yamt sync with head.
 1.28.16.1 18-May-2014  rmind sync with head
 1.28.12.2 03-Dec-2017  jdolecek update from HEAD
 1.28.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.29.2.1 10-Aug-2014  tls Rebase.
 1.30.4.3 28-Aug-2017  skrll Sync with HEAD
 1.30.4.2 09-Jul-2016  skrll Sync with HEAD
 1.30.4.1 22-Sep-2015  skrll Sync with HEAD
 1.33.10.1 10-Jun-2019  christos Sync with HEAD
 1.35.2.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.36.2.2 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.36.2.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.37.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 05-Jul-2015  matt branches: 1.1.2; 1.1.18;
Revamped QVSS (VCB01) support. (from Charles Dickman)
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 05-Jul-2015  jdolecek file qv_ic.h was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.1.2.2 22-Sep-2015  skrll Sync with HEAD
 1.1.2.1 05-Jul-2015  skrll file qv_ic.h was added on branch nick-nhusb on 2015-09-22 12:05:53 +0000
 1.1 05-Jul-2015  matt branches: 1.1.2; 1.1.18;
Revamped QVSS (VCB01) support. (from Charles Dickman)
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 05-Jul-2015  jdolecek file qvareg.h was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.1.2.2 22-Sep-2015  skrll Sync with HEAD
 1.1.2.1 05-Jul-2015  skrll file qvareg.h was added on branch nick-nhusb on 2015-09-22 12:05:53 +0000
 1.5 27-Oct-2022  riastradh vax/qvaux(4): Convert to ttylock/ttyunlock.
 1.4 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.3 24-Apr-2021  thorpej branches: 1.3.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.2 07-Jul-2016  msaitoh branches: 1.2.16; 1.2.34;
KNF. Remove extra spaces. No functional change.
 1.1 05-Jul-2015  matt branches: 1.1.2;
Revamped QVSS (VCB01) support. (from Charles Dickman)
 1.1.2.3 09-Jul-2016  skrll Sync with HEAD
 1.1.2.2 22-Sep-2015  skrll Sync with HEAD
 1.1.2.1 05-Jul-2015  skrll file qvaux.c was added on branch nick-nhusb on 2015-09-22 12:05:53 +0000
 1.2.34.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.2.16.2 03-Dec-2017  jdolecek update from HEAD
 1.2.16.1 07-Jul-2016  jdolecek file qvaux.c was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.3.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 27-Dec-2019  msaitoh s/recevive/receive/ in comment.
 1.1 05-Jul-2015  matt branches: 1.1.2; 1.1.18; 1.1.22;
Revamped QVSS (VCB01) support. (from Charles Dickman)
 1.1.22.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 05-Jul-2015  jdolecek file qvavar.h was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.1.2.2 22-Sep-2015  skrll Sync with HEAD
 1.1.2.1 05-Jul-2015  skrll file qvavar.h was added on branch nick-nhusb on 2015-09-22 12:05:53 +0000
 1.6 12-Feb-2022  riastradh sys: Omit vestigial struct devices in softcs after device_t split.
 1.5 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.4 24-Apr-2021  thorpej branches: 1.4.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.3 21-Nov-2020  thorpej branches: 1.3.2;
malloc(9) -> kmem(9)
 1.2 10-Nov-2019  chs branches: 1.2.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.1 05-Jul-2015  matt branches: 1.1.2; 1.1.18; 1.1.22;
Revamped QVSS (VCB01) support. (from Charles Dickman)
 1.1.22.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 05-Jul-2015  jdolecek file qvkbd.c was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.1.2.2 22-Sep-2015  skrll Sync with HEAD
 1.1.2.1 05-Jul-2015  skrll file qvkbd.c was added on branch nick-nhusb on 2015-09-22 12:05:53 +0000
 1.2.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.3.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.4.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 05-Jul-2015  matt branches: 1.1.2; 1.1.18;
Revamped QVSS (VCB01) support. (from Charles Dickman)
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 05-Jul-2015  jdolecek file qvkbdvar.h was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.1.2.2 22-Sep-2015  skrll Sync with HEAD
 1.1.2.1 05-Jul-2015  skrll file qvkbdvar.h was added on branch nick-nhusb on 2015-09-22 12:05:53 +0000
 1.3 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.2 24-Apr-2021  thorpej branches: 1.2.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.1 05-Jul-2015  matt branches: 1.1.2; 1.1.18; 1.1.36;
Revamped QVSS (VCB01) support. (from Charles Dickman)
 1.1.36.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 05-Jul-2015  jdolecek file qvms.c was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.1.2.2 22-Sep-2015  skrll Sync with HEAD
 1.1.2.1 05-Jul-2015  skrll file qvms.c was added on branch nick-nhusb on 2015-09-22 12:05:53 +0000
 1.2.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.13 10-Jul-1996  ragge Remove old (tape-only) tmscp driver. Add new uba/qba driver
for common MSCP routines.
 1.12 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.11 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.10 02-Mar-1996  ragge Fix some too long delays. Set some structs volatile that otherwise
caused hangs during autoconfig.
 1.9 02-Feb-1996  mycroft Fix #includes.
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 13-Dec-1995  ragge MicroVAX III support added.
Dummy match/attach routines for tmscp.
Conversion of uda.c towards new config.
 1.6 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.5 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.4 05-Jul-1995  ragge branches: 1.4.2;
uda/tmscp read/write added.
 1.3 16-Jun-1995  ragge DELAY() moved to common place.
 1.2 30-Mar-1995  ragge Bug fixes of interrupt handlers.
 1.1 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.4.2.1 15-Oct-1995  ragge tmscpstrategy() should be of type void.
 1.2 10-Jul-1996  ragge Remove old (tape-only) tmscp driver. Add new uba/qba driver
for common MSCP routines.
 1.1 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.37 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.36 15-Feb-2008  ad branches: 1.36.2; 1.36.6;
Give bbusy() an interlock argument. If the we need to wait for the buffer,
the interlock is dropped and reacquired when awoken. This allows for
busying buffers attached to a list that is not locked by bufcache_lock.
 1.35 02-Jan-2008  ad Merge vmlocking2 to head.
 1.34 17-Oct-2007  garbled branches: 1.34.2; 1.34.4; 1.34.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.33 29-Jul-2007  ad branches: 1.33.6;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.32 04-Mar-2007  christos branches: 1.32.2; 1.32.10; 1.32.12; 1.32.14;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.31 28-Mar-2006  thorpej branches: 1.31.14;
Use device_unit().
 1.30 23-Feb-2006  thorpej branches: 1.30.2; 1.30.4; 1.30.6;
Use device_parent().
 1.29 11-Dec-2005  christos branches: 1.29.2; 1.29.4; 1.29.6;
merge ktrace-lwp.
 1.28 17-Nov-2003  wiz branches: 1.28.16;
Various typo fixes from Jonathon Gray via jmc@openbsd.
 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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.25 20-Jan-2003  simonb branches: 1.25.2;
The Double-Semi-Colon Police.
 1.24 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.22 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.21 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.19 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.18 16-May-2001  matt branches: 1.18.2; 1.18.4; 1.18.8; 1.18.16;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.17 04-Jun-2000  matt branches: 1.17.4;
More event counter stuff. Plus a little cruft cleanup while doing it.
 1.16 27-May-2000  thorpej branches: 1.16.2;
sleep() -> tsleep()
 1.15 18-Jan-2000  thorpej iodone() -> biodone(), iowait() -> biowait()
 1.14 17-Jan-2000  matt defopt VAXnnn so the make depend does the right thing.
 1.13 12-Apr-1999  pk branches: 1.13.2;
Ungarble the copyright notice.
 1.12 12-Jan-1998  thorpej branches: 1.12.8;
Update for changes to config.
 1.11 11-Jan-1997  ragge Update due to changes to uba/mscp functions.
 1.10 15-Nov-1996  thorpej Use bitmask_snprintf().
 1.9 13-Oct-1996  christos backout previous kprintf change
 1.8 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.7 20-Jul-1996  ragge CPU determine code. ts driver converted to new config. May work, untested.
 1.6 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.5 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.4 02-Mar-1996  ragge Fix some too long delays. Set some structs volatile that otherwise
caused hangs during autoconfig.
 1.3 02-Feb-1996  mycroft Fix #includes.
 1.2 02-Feb-1996  mycroft Fix #includes.
 1.1 06-Jan-1996  ragge Device driver for TS11/TSV05 tape devices.
Written by Bertram Barth, based on TMSCP device driver.
 1.12.8.1 12-Apr-1999  pk branches: 1.12.8.1.2;
Pullup copyright text corrections.
 1.12.8.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 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.16.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.17.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.18.16.1 17-May-2002  gehenna Add device switch.
 1.18.8.4 11-Nov-2002  nathanw Catch up to -current
 1.18.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.18.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.18.8.1 16-May-2001  nathanw file ts.c was added on branch nathanw_sa on 2002-09-17 21:18:30 +0000
 1.18.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.18.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.25.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.16.5 17-Mar-2008  yamt sync with head.
 1.28.16.4 27-Feb-2008  yamt sync with head.
 1.28.16.3 21-Jan-2008  yamt sync with head
 1.28.16.2 03-Sep-2007  yamt sync with head.
 1.28.16.1 21-Jun-2006  yamt sync with head.
 1.29.6.1 22-Apr-2006  simonb Sync with head.
 1.29.4.1 09-Sep-2006  rpaulo sync with head
 1.29.2.1 01-Mar-2006  yamt sync with head.
 1.30.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.30.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.30.2.1 01-Apr-2006  yamt sync with head.
 1.31.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.32.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.32.12.1 07-Aug-2007  matt Sync with HEAD.
 1.32.10.1 03-Oct-2007  garbled Sync with HEAD
 1.32.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.33.6.3 23-Mar-2008  matt sync with HEAD
 1.33.6.2 09-Jan-2008  matt sync with HEAD
 1.33.6.1 06-Nov-2007  matt sync with HEAD
 1.34.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.34.4.1 31-Dec-2007  ad Catch up with buffer cache changes.
 1.34.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.36.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.36.2.1 24-Mar-2008  keiichi sync with head.
 1.2 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.1 06-Jan-1996  ragge branches: 1.1.80; 1.1.142; 1.1.162; 1.1.166;
Device driver for TS11/TSV05 tape devices.
Written by Bertram Barth, based on TMSCP device driver.
 1.1.166.1 03-Apr-2008  mjf Sync with HEAD.
 1.1.162.1 24-Mar-2008  keiichi sync with head.
 1.1.142.1 23-Mar-2008  matt sync with HEAD
 1.1.80.1 17-Mar-2008  yamt sync with head.
 1.52 28-Jan-2001  ragge These are not used anymore.
 1.51 09-Aug-2000  tv %b -> bitmask_snprintf()
 1.50 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.49 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.48 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.47 04-Jun-2000  matt 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.46 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.45 27-May-2000  thorpej branches: 1.45.2;
sleep() -> tsleep()
 1.44 19-May-2000  thorpej A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.43 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.42 02-Feb-1999  ragge branches: 1.42.8;
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.41 19-Jan-1999  ragge Fix some void pointers.
 1.40 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.39 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.38 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.37 05-Nov-1998  ragge EGCS fixes.
 1.36 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.35 06-Oct-1998  matt 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.34 21-Mar-1998  ragge ubasetup() must be non-static. (used by QDSS)
 1.33 02-Mar-1998  ragge Support for UVM on VAXen.
 1.32 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.31 18-Jan-1998  ragge Make kernel compile & run again after latest config changes.
 1.30 12-Jan-1998  thorpej Update for changes to config.
 1.29 13-Oct-1996  christos backout previous kprintf change
 1.28 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.27 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.26 20-Aug-1996  ragge Modified to get cleaner match/attach code for different parent buses.
Fix so that resource wait queueing works.
Changed all functions to take a pointer to uba_softc instead of unit
number, except for ubareset(). This must be done later.
 1.25 20-Jul-1996  ragge CPU determine code. ts driver converted to new config. May work, untested.
 1.24 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.23 01-Jul-1996  ragge Remove code that took care of old config devices. Don't support
old config anymore, all devices should use new config by now.
Add structures to handle DMA devices using new config.
Fixed bug that caused unwanted ubareset's on 11/780.
 1.22 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.21 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.20 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.19 09-Mar-1996  ragge Check on which SBI we are frobbing, not always 0.
 1.18 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.17 02-Mar-1996  ragge Add support for DW780. Note that ubareset's don't work properly.
This is not a problem on other Unibus adapters, but DW780's do
ubareset's more often. This needs to be fixed by someone someday.
 1.16 11-Feb-1996  ragge Remove csralloc(), not usable anymore.
Add ubasetvec() to steal interrupt vectors for device drivers that
need more than one vector. Add prototype for it.
 1.15 02-Feb-1996  mycroft Fix type errors.
 1.14 02-Feb-1996  mycroft Fix #includes.
 1.13 02-Feb-1996  mycroft Fix #includes.
 1.12 28-Dec-1995  thorpej Move the old-style disk instrumentation "structures" to a central location
(sys/kern/subr_disk.c) and note that they should/will be deperecated.
 1.11 13-Dec-1995  ragge MicroVAX III support added.
Dummy match/attach routines for tmscp.
Conversion of uda.c towards new config.
 1.10 01-Dec-1995  ragge UBA converted to new config. (uba's now can be *'ed). Bug causing
DMA writes to nonexistent memory pages fixed. Code for old config
of non-mass-storage devices removed. (they now must use new config).
 1.9 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.8 16-Jun-1995  ragge d_reset reference removed. Calling of ubareset must be solved.
 1.7 30-Mar-1995  ragge Bug fixes of interrupt handlers.
 1.6 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.5 13-Feb-1995  ragge Fixes for new config.
 1.4 25-Nov-1994  ragge New handling of pte:s for physio.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Fixed bugs according to old memory system.
 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 uba.c was added on branch netbsd-1-0 on 1994-08-02 20:21:23 +0000
 1.42.8.2 11-Feb-2001  bouyer Sync with HEAD.
 1.42.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.45.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.16 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.15 14-Dec-2010  matt branches: 1.15.18; 1.15.36;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.14 11-Mar-2008  matt branches: 1.14.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.13 11-Dec-2005  christos branches: 1.13.50; 1.13.70; 1.13.74;
merge ktrace-lwp.
 1.12 07-Aug-2003  agc branches: 1.12.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 15-Jul-2003  lukem __KERNEL_RCSID()
 1.10 02-Oct-2002  thorpej branches: 1.10.6;
Add trailing ; to CFATTACH_DECL.
 1.9 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.8 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.7 24-Aug-2002  ragge Must set correct HW unibus number so that disk autodetection on other
Unibuses than the first work.
 1.6 13-May-2001  ragge branches: 1.6.2; 1.6.8; 1.6.16;
Add bus type.
 1.5 04-Jun-2000  ragge branches: 1.5.4;
Changes of sbi_attach_args. (and cleanup)
 1.4 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.3 27-May-2000  ragge Only map in map registers and the I/O page if they are not mapped in already.
 1.2 14-Aug-1999  ragge branches: 1.2.2; 1.2.10;
Fix UBA IO space scan addresses; was searching at the wrong place.
 1.1 21-Jun-1999  ragge branches: 1.1.2;
Add DW750 and DW780 UBA support. Still no BDP's.
 1.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 21-Jun-1999  thorpej file uba_cmi.c was added on branch chs-ubc2 on 1999-07-01 23:27:18 +0000
 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.5.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.16.1 31-Aug-2002  gehenna catch up with -current.
 1.6.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.2 27-Aug-2002  nathanw Catch up to -current.
 1.6.8.1 13-May-2001  nathanw file uba_cmi.c was added on branch nathanw_sa on 2002-08-27 23:46:02 +0000
 1.6.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.6.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.12.16.1 17-Mar-2008  yamt sync with head.
 1.13.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.13.70.1 24-Mar-2008  keiichi sync with head.
 1.13.50.1 23-Mar-2008  matt sync with HEAD
 1.14.26.1 05-Mar-2011  rmind sync with head
 1.15.36.1 28-Aug-2017  skrll Sync with HEAD
 1.15.18.1 03-Dec-2017  jdolecek update from HEAD
 1.6 19-Nov-2008  hans uba device registers should be volatile. OK by ragge.
 1.5 11-Mar-2008  matt branches: 1.5.4; 1.5.10; 1.5.12; 1.5.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.4 11-Dec-2005  christos branches: 1.4.50; 1.4.70; 1.4.74;
merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 21-Jun-1999  ragge branches: 1.2.36;
Add DW750 and DW780 UBA support. Still no BDP's.
 1.1 06-Jun-1999  ragge branches: 1.1.2;
Ops, forgot this file.
 1.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.36.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 17-Mar-2008  yamt sync with head.
 1.4.74.2 17-Jan-2009  mjf 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.14.1 22-Nov-2008  snj Pull up following revision(s) (requested by hans in ticket #101):
sys/arch/vax/uba/uba_common.h: revision 1.6
uba device registers should be volatile. OK by ragge.
 1.5.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.5.4.1 04-May-2009  yamt sync with head.
 1.11 14-Dec-2010  matt Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.10 28-Apr-2008  martin branches: 1.10.22;
Remove clause 3 and 4 from TNF licenses
 1.9 11-Mar-2008  matt branches: 1.9.2; 1.9.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.8 11-Dec-2005  christos branches: 1.8.50; 1.8.70; 1.8.74;
merge ktrace-lwp.
 1.7 15-Jul-2003  lukem branches: 1.7.16;
__KERNEL_RCSID()
 1.6 27-Jul-2001  ragge branches: 1.6.6; 1.6.22;
Calculation of unibus map register size was wrong.
 1.5 29-Jun-2000  mrg branches: 1.5.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.4 27-May-2000  ragge Only map in map registers and the I/O page if they are not mapped in already.
 1.3 29-Feb-2000  matt branches: 1.3.2;
fix a too agressive s/CIA/UBA/ (e.g change SPEUBAL back to SPECIAL) in the
header.
 1.2 20-Jun-1999  ragge branches: 1.2.2; 1.2.4;
Fix of bug causing allocations of physical pages to get wrong address.
 1.1 06-Jun-1999  ragge Added support for Qbus DMA.
 1.2.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.2.2.2 21-Jun-1999  thorpej Sync w/ -current.
 1.2.2.1 20-Jun-1999  thorpej file uba_dma.c was added on branch chs-ubc2 on 1999-06-21 01:03:44 +0000
 1.3.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.4.1 03-Aug-2001  lukem update to -current
 1.6.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.22.1 03-Aug-2004  skrll Sync with HEAD
 1.6.6.2 27-Jul-2001  ragge Calculation of unibus map register size was wrong.
 1.6.6.1 27-Jul-2001  ragge file uba_dma.c was added on branch nathanw_sa on 2001-07-27 12:57:21 +0000
 1.7.16.1 17-Mar-2008  yamt sync with head.
 1.8.74.2 02-Jun-2008  mjf 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.9.4.1 16-May-2008  yamt sync with head.
 1.9.2.1 18-May-2008  yamt sync with head.
 1.10.22.1 05-Mar-2011  rmind sync with head
 1.11 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.10 11-Dec-2005  christos branches: 1.10.50; 1.10.70; 1.10.74;
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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 02-Oct-2002  thorpej branches: 1.7.6;
Add trailing ; to CFATTACH_DECL.
 1.6 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 16-May-2001  matt branches: 1.4.2; 1.4.8;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.3 13-May-2001  ragge Add bus type.
 1.2 01-May-2001  ragge Use linear memory mapping for MV1. No map registers.
 1.1 07-Aug-1999  ragge branches: 1.1.14;
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.1.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.4.8.1 16-May-2001  nathanw file uba_ibus.c was added on branch nathanw_sa on 2002-10-18 02:40:33 +0000
 1.4.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.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 17-Mar-2008  yamt sync with head.
 1.10.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.70.1 24-Mar-2008  keiichi sync with head.
 1.10.50.1 23-Mar-2008  matt sync with HEAD
 1.15 14-Jul-2025  hans vax/uba: fix detection of CMD CQD-22x MSCP controllers

Certain models of CMD MSCP controllers fail to be detected by uda(4) if
they have been booted from. This failure mode has been introduced in
revision 1.11 of uba_mainbus.c, when scanning for Qbus/Unibus memories
was added. They are deteced fine when NetBSD is booted from any other
device such as over the network.

When NetBSD is booted from a MSCP controller, the boot loader sets up
the Qbus map to provide the controller with a small command/response
ring in memory to be used for I/O. Once the kernel is loaded and uba(4)
is attaching, the Qbus map is cleared while scanning for memories. It
appears that sudden loss of access to the command/response ring causes
the firmware of these CMD controllers to drop dead.

As a result, these controllers don't react in a reasonable time (100ms
by the spec) when their IP register is written to re-initialze the
controller. Even though uda(4)'s udamatch() waits up to 10s for a sign
of life from the controller, that's usually not enough for it to wake
up and it is assumed to be absent. Which, of course, causes the kernel
to fail booting as the boot device can't be found.

This needs to be addressed both in the kernel and the bootloader.

We can work around this issue in the kernel by restoring the Qbus map
registers to their original values after we've used them for detecting
Qbus memories. The code to do that is already there but commented out,
it just needs uncommenting.
 1.14 22-May-2017  ragge branches: 1.14.46;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.13 22-Apr-2016  christos Use the right variable (Felix Deichmann)
 1.12 05-Jul-2015  matt Typo fxi.
 1.11 05-Jul-2015  matt Add code to probe the Q-bus/Unibus for memory. (From Charles Dickman)
 1.10 14-Dec-2010  matt branches: 1.10.18; 1.10.36;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.9 11-Mar-2008  matt branches: 1.9.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.8 11-Dec-2005  christos branches: 1.8.50; 1.8.70; 1.8.74;
merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 15-Jul-2003  lukem __KERNEL_RCSID()
 1.5 02-Oct-2002  thorpej branches: 1.5.6;
Add trailing ; to CFATTACH_DECL.
 1.4 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 06-Jun-1999  ragge branches: 1.2.2; 1.2.18; 1.2.22;
Added support for Qbus DMA.
 1.1 24-May-1999  ragge bus.h'ify more of the vax code.
 1.2.22.1 18-Oct-2002  nathanw Catch up to -current.
 1.2.18.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.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.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.9.26.1 05-Mar-2011  rmind sync with head
 1.10.36.3 28-Aug-2017  skrll Sync with HEAD
 1.10.36.2 29-May-2016  skrll Sync with HEAD
 1.10.36.1 22-Sep-2015  skrll Sync with HEAD
 1.10.18.1 03-Dec-2017  jdolecek update from HEAD
 1.14.46.1 02-Aug-2025  perseant Sync with HEAD
 1.31 09-Oct-2025  rillig vax/uba: fix details in message about UBA error

In NetBSD 10, the snprintb call had resulted in an empty string.
 1.30 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.29 14-Dec-2010  matt branches: 1.29.18; 1.29.36;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.28 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.27 14-Mar-2009  dsl branches: 1.27.2; 1.27.4;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.26 16-Dec-2008  christos branches: 1.26.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.25 20-Nov-2008  hans Fix unibus interrupts on SBI machines. OK by matt.
 1.24 11-Mar-2008  matt branches: 1.24.4; 1.24.10; 1.24.12; 1.24.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.23 04-Jan-2008  joerg branches: 1.23.2; 1.23.6;
time.tv_sec -> time_second
 1.22 11-Dec-2005  christos branches: 1.22.50; 1.22.56; 1.22.64;
merge ktrace-lwp.
 1.21 07-Aug-2003  agc branches: 1.21.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.20 15-Jul-2003  lukem __KERNEL_RCSID()
 1.19 02-Oct-2002  thorpej branches: 1.19.6;
Add trailing ; to CFATTACH_DECL.
 1.18 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.17 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.16 24-Aug-2002  ragge Must set correct HW unibus number so that disk autodetection on other
Unibuses than the first work.
 1.15 25-Jul-2002  ragge Count adapter, stray and device interrupts separately.
From Johnny Billquist.
 1.14 06-Jun-2002  ragge Just return if a zero uba vector is handled. It's OK to get them on Unibus
machines.
 1.13 04-Jun-2002  ragge Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.12 13-May-2001  ragge branches: 1.12.2; 1.12.8; 1.12.16; 1.12.18;
Add bus type.
 1.11 12-Apr-2001  thorpej splimp -> spluba
 1.10 24-Aug-2000  ragge branches: 1.10.2;
Fix after %b fixes.
 1.9 09-Aug-2000  tv %b -> bitmask_snprintf()
 1.8 10-Jul-2000  ragge Nexus vector number is 0x14-0x17, not 14-17! Fortunately, 3 wrong did
one right. Pointed out by Kenn Humborg (kenn@linux.ie).
 1.7 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.6 04-Jun-2000  ragge Changes of sbi_attach_args. (and cleanup)
 1.5 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.4 27-May-2000  ragge Only map in map registers and the I/O page if they are not mapped in already.
 1.3 30-Apr-2000  ragge branches: 1.3.2;
Ubareset() changed.
 1.2 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.1 21-Jun-1999  ragge branches: 1.1.2; 1.1.4;
Add DW750 and DW780 UBA support. Still no BDP's.
 1.1.4.2 21-Apr-2001  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.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 21-Jun-1999  thorpej file uba_sbi.c was added on branch chs-ubc2 on 1999-07-01 23:27:18 +0000
 1.3.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.18.3 10-Nov-2002  he Pull up revision 1.15 (requested by ragge in ticket #546):
Count adapter, stray and device interrupts separately.
 1.12.18.2 07-Jun-2002  thorpej pullup-1-6 ticket #196:

syssrc/sys/arch/vax/uba/uba_sbi.c 1.14

Original log message:

Just return if a zero uba vector is handled. It's OK to get them on Unibus
machines.
 1.12.18.1 05-Jun-2002  lukem Pull up revision 1.13 (requested by ragge in ticket #157):
Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.12.16.2 31-Aug-2002  gehenna catch up with -current.
 1.12.16.1 15-Jul-2002  gehenna catch up with -current.
 1.12.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.12.8.4 27-Aug-2002  nathanw Catch up to -current.
 1.12.8.3 01-Aug-2002  nathanw Catch up to -current.
 1.12.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.12.8.1 13-May-2001  nathanw file uba_sbi.c was added on branch nathanw_sa on 2002-06-20 03:42:17 +0000
 1.12.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.12.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.12.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.19.6.1 03-Aug-2004  skrll Sync with HEAD
 1.21.16.2 17-Mar-2008  yamt sync with head.
 1.21.16.1 21-Jan-2008  yamt sync with head
 1.22.64.1 08-Jan-2008  bouyer Sync with HEAD
 1.22.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.22.50.2 23-Mar-2008  matt sync with HEAD
 1.22.50.1 09-Jan-2008  matt sync with HEAD
 1.23.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.23.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.23.2.1 24-Mar-2008  keiichi sync with head.
 1.24.14.1 22-Nov-2008  snj Pull up following revision(s) (requested by hans in ticket #101):
sys/arch/vax/uba/uba_sbi.c: revision 1.25
Fix unibus interrupts on SBI machines. OK by matt.
 1.24.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.24.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.24.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.24.4.2 11-Aug-2010  yamt sync with head.
 1.24.4.1 04-May-2009  yamt sync with head.
 1.26.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.4.2 05-Mar-2011  rmind sync with head
 1.27.4.1 03-Jul-2010  rmind sync with head
 1.27.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.29.36.1 28-Aug-2017  skrll Sync with HEAD
 1.29.18.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 05-Jun-2011  matt branches: 1.3.12; 1.3.30;
device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.2 14-Dec-2010  matt branches: 1.2.2; 1.2.6;
Cleanup includes. Change <machine/XXX.h> to <sys/XXX.h> for bus, cpu, intr.
Remove unneeded includes.
 1.1 22-Jan-2009  christos branches: 1.1.4; 1.1.6; 1.1.10;
Patches from Brad Parker to support vax730.
 1.1.10.2 12-Jun-2011  rmind sync with head
 1.1.10.1 05-Mar-2011  rmind sync with head
 1.1.6.2 04-May-2009  yamt sync with head.
 1.1.6.1 22-Jan-2009  yamt file uba_ubi.c 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 uba_ubi.c was added on branch nick-hppapmap on 2009-03-03 18:29:35 +0000
 1.2.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.2.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.30.1 28-Aug-2017  skrll Sync with HEAD
 1.3.12.1 03-Dec-2017  jdolecek update from HEAD
 1.12 28-Jan-2001  ragge These are not used anymore.
 1.11 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.10 18-Oct-1998  ragge branches: 1.10.12;
Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.9 20-Aug-1996  ragge Modified to get cleaner match/attach code for different parent buses.
Fix so that resource wait queueing works.
Changed all functions to take a pointer to uba_softc instead of unit
number, except for ubareset(). This must be done later.
 1.8 20-Jul-1996  ragge CPU determine code. ts driver converted to new config. May work, untested.
 1.7 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.6 09-Mar-1996  ragge Check on which SBI we are frobbing, not always 0.
 1.5 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.4 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.3 13-Feb-1995  ragge Fixes for new config.
 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 ubareg.h was added on branch netbsd-1-0 on 1994-08-02 20:21:28 +0000
 1.10.12.2 11-Feb-2001  bouyer Sync with HEAD.
 1.10.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 04-Jun-2000  matt Nuke it. It's in dev/qbus now...
 1.21 19-Jan-1999  ragge branches: 1.21.8; 1.21.16;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.20 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.19 12-Jan-1998  thorpej Update for changes to config.
 1.18 20-Aug-1996  ragge Modified to get cleaner match/attach code for different parent buses.
Fix so that resource wait queueing works.
Changed all functions to take a pointer to uba_softc instead of unit
number, except for ubareset(). This must be done later.
 1.17 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.16 01-Jul-1996  ragge Changed data structures due to removal of old config system.
 1.15 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.14 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.13 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.12 02-Mar-1996  ragge Add support for DW780. Note that ubareset's don't work properly.
This is not a problem on other Unibus adapters, but DW780's do
ubareset's more often. This needs to be fixed by someone someday.
 1.11 11-Feb-1996  ragge Remove csralloc(), not usable anymore.
Add ubasetvec() to steal interrupt vectors for device drivers that
need more than one vector. Add prototype for it.
 1.10 02-Feb-1996  mycroft Fix #includes.
 1.9 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.8 01-Dec-1995  ragge UBA converted to new config. (uba's now can be *'ed). Bug causing
DMA writes to nonexistent memory pages fixed. Code for old config
of non-mass-storage devices removed. (they now must use new config).
 1.7 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.6 11-May-1995  jtc KERNEL -> _KERNEL
 1.5 30-Mar-1995  ragge Bug fixes of interrupt handlers.
 1.4 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.3 13-Feb-1995  ragge Fixes for new config.
 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 ubavar.h was added on branch netbsd-1-0 on 1994-08-02 20:21:29 +0000
 1.21.16.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.21.8.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.3 12-Nov-1995  ragge No longer needed; interrupt vectors now dynamic allocated.
 1.2 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.1 13-Feb-1995  ragge Fixes for new config.
 1.29 20-Jun-1999  ragge Remove moved files.
 1.28 24-Jan-1998  ragge branches: 1.28.10;
Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.27 12-Jan-1998  thorpej Update for changes to config.
 1.26 02-Nov-1997  ragge #include files must be in the correct order.
 1.25 04-Jul-1997  ragge Fix bug causing all uda's to be recognized as ctlr 1 from boot.
 1.24 12-Mar-1997  ragge Fast and dirty fix to avoid panics during autoconf of KFQSA DSSI disks.
Controller errors showing up can't be handled anyway.
 1.23 13-Oct-1996  christos backout previous kprintf change
 1.22 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.21 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.20 20-Aug-1996  ragge Use the same device driver for both uda and mtc. Actually, the only
difference is vcid. The unit names must differ, so that it is possible
to distinguish them at autoconf time.
 1.19 20-Jul-1996  ragge CPU determine code. ts driver converted to new config. May work, untested.
 1.18 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.17 01-Jul-1996  ragge Change to new config and to support new MSCP system.
 1.16 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.15 17-Mar-1996  ragge Convert all devices according to the changes to config.
 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 02-Mar-1996  ragge Fix some too long delays. Set some structs volatile that otherwise
caused hangs during autoconfig.
 1.12 11-Feb-1996  ragge register -> volatile in some places, to make it work OK with -O2.
 1.11 02-Feb-1996  mycroft Fix #includes.
 1.10 13-Dec-1995  ragge MicroVAX III support added.
Dummy match/attach routines for tmscp.
Conversion of uda.c towards new config.
 1.9 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.8 31-Aug-1995  ragge Patches from Ken Wellsch/Ken Lalonde to support some Dilog MSCP cards
(DQ256 SMD card, SQ706A and SU726A SCSI card).
 1.7 05-Jul-1995  ragge uda/tmscp read/write added.
 1.6 30-Mar-1995  ragge Bug fixes of interrupt handlers.
 1.5 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.4 13-Feb-1995  ragge Fixes for new config.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Fixed bugs according to old memory system.
 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 uda.c was added on branch netbsd-1-0 on 1994-08-02 20:21:31 +0000
 1.28.10.1 01-Jul-1999  thorpej Sync w/ -current.
 1.4 20-Jun-1999  ragge Remove moved files.
 1.3 01-Jul-1996  ragge branches: 1.3.24;
Change to new config and to support new MSCP system.
 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 udareg.h was added on branch netbsd-1-0 on 1994-08-02 20:21:32 +0000
 1.3.24.1 01-Jul-1999  thorpej Sync w/ -current.
 1.101 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.100 03-Mar-2022  riastradh vax: Use device_set_private.
 1.99 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.98 24-Apr-2021  thorpej branches: 1.98.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.97 22-May-2017  ragge branches: 1.97.24;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.96 20-May-2014  martin branches: 1.96.4;
Recognize racd* as boot device.
 1.95 27-Oct-2012  chs branches: 1.95.10;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.94 29-Jul-2012  mlelstv branches: 1.94.2;
Do not call setroot() from MD code and from MI code, which has
unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.

No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information
as a side effect. Instead call MI rootconf() from MD code which makes
rootconf() now a wrapper to setroot().

Adjust several MD routines to set the global booted_device,booted_partition
variables instead of passing partial information to setroot().

Make cpu_rootconf(9) describe the calling order.
 1.93 10-Nov-2011  njoly branches: 1.93.6;
Remove extra newlines.
 1.92 14-Dec-2010  matt branches: 1.92.8;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.91 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.90 11-Mar-2008  matt branches: 1.90.4; 1.90.24; 1.90.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.89 31-Jan-2008  christos branches: 1.89.2; 1.89.6;
complete removal of soft interrupts from Henry Bent
 1.88 29-Mar-2006  thorpej branches: 1.88.38; 1.88.44;
Use device_cfdata().
 1.87 26-Feb-2006  thorpej branches: 1.87.2; 1.87.4; 1.87.6;
Use device_is_a().
 1.86 23-Feb-2006  thorpej Use device_parent().
 1.85 11-Dec-2005  christos branches: 1.85.2; 1.85.4; 1.85.6;
merge ktrace-lwp.
 1.84 27-Jun-2005  ragge branches: 1.84.2;
Update according to cast-qual addition.
 1.83 14-Dec-2004  chs use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.82 31-Oct-2004  he Include the <sys/bufq.h> header to allow these to compile again.
 1.81 23-Oct-2004  thorpej Centralize the declaration of booted_device and booted_partition.
 1.80 06-Jan-2004  matt Add proper boot/autoconf support for SDN devices. Take from Hugh Graham;
see http://mail-index.netbsd.org/port-vax/2002/06/28/0005.html
 1.79 29-Aug-2003  ragge Understand qt as root device.
 1.78 15-Jul-2003  lukem __KERNEL_RCSID()
 1.77 01-Jan-2003  thorpej branches: 1.77.2;
Use aprint_normal() for cfprint routines.
 1.76 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.75 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.74 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.73 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.72 19-Sep-2002  ragge Adopt to boot block change; check for LUN on SCSI disks also.
 1.71 23-Mar-2002  ragge Check unit number when booting from rl disks.
 1.70 16-May-2001  matt branches: 1.70.2; 1.70.8;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.69 25-Apr-2001  bouyer Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.68 04-Feb-2001  ragge branches: 1.68.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.67 26-Jul-2000  ragge Remove the use of global "mastercpu", the world is different now.
 1.66 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.65 25-Jun-2000  ragge Detect "rd" as root device.
 1.64 19-Jun-2000  matt branches: 1.64.2;
Rename ncr[5380] device to si to more consistent with other ports.
Add VAX660 to cputype.h. Remove needs-flag from si & asc entries.
 1.63 15-Jun-2000  ragge Recognize "ni" as boot device.
 1.62 11-Jun-2000  ragge Remove some unneeded code.
 1.61 05-Jun-2000  matt add support for counting soft interrupts
 1.60 04-Jun-2000  ragge Changes to sbi_attach_args. (and some cleanup)
 1.59 01-Jun-2000  matt change void f() to void f(void)
 1.58 01-Jun-2000  matt Make booted_device global (and booted_parition for consitency).
Eliminate it from header files and other extern definitions.
 1.57 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.56 26-May-2000  ragge branches: 1.56.2;
Correct a comparision.
 1.55 23-May-2000  matt Add some missing ifdef's.
 1.54 22-May-2000  matt Move BDEV_LE detection to here.
 1.53 21-May-2000  ragge Boot device recognition for DEUNA added; combined with some cleanup.
 1.52 21-May-2000  ragge Compare the boot address with 1) physical address and 2) correct variable.
 1.51 20-May-2000  ragge Changes to use the RPB for different tasks. Much simpler now to find the
boot device.
 1.50 23-Apr-2000  matt fix booted_qe case to compare locators against controllers.
 1.49 22-Apr-2000  matt Detect controller number on boot_qe check.
 1.48 22-Apr-2000  ragge Detect "rl" as root device.
 1.47 16-Apr-2000  matt Autoconf for SCSI stuff on VS4000s.
 1.46 12-Feb-2000  ragge Remove an unneccessary reference to cf_unit.
 1.45 23-Oct-1999  ragge Detect SCSI as boot device.
 1.44 17-Sep-1999  thorpej branches: 1.44.2; 1.44.4; 1.44.6;
Centralize the declaration and clearing of `cold'.
 1.43 15-Sep-1999  thorpej Rename the machine-dependent autoconfiguration entry point `cpu_configure()',
and rename config_init() to configure() and call cpu_configure() from there.
 1.42 08-Aug-1999  ragge Detect "ze" as root device.
 1.41 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.40 04-Aug-1999  ragge Adopt to new BI bus design.
 1.39 20-Jun-1999  ragge Want device-register, to detect qbus boot devices.
 1.38 07-Jun-1999  thorpej Don't pass a nam2blk around at all; just have setroot() and friends reference
dev_name2blk[] directly. Addresses PR #7622 (ITOH Yasufumi), although
in a different way.
 1.37 02-Feb-1999  ragge branches: 1.37.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.36 27-Oct-1998  matt Latent support for revamped "local bus" support.
 1.35 06-Oct-1998  thorpej Provide configure(), rather than open-coding it in cpu_startup().
 1.34 06-Oct-1998  matt 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.33 08-Jun-1998  ragge Wall fixes.
 1.32 13-Apr-1998  ragge Wall cleaning.
 1.31 08-Feb-1998  ragge Split out MSCP floppies as a separate device (rx) instead of handling
them as disk drives. It is now also allowed to change floppies without
the system complaining :-)
 1.30 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.29 12-Jan-1998  thorpej Update for changes to config.
 1.28 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.27 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.26 26-Mar-1997  gwr Move findroot/setroot stuff from configure() to cpu_rootconf().
 1.25 22-Mar-1997  ragge Clean up DZ console routines. Use memory size from boot (if provided).
 1.24 15-Mar-1997  ragge Change the way boot device is figured out; now only using DEC numbers
and done when the device get attached.
 1.23 26-Feb-1997  ragge Patches to make VS2000 to work. From Ari Suutari.
 1.22 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.21 31-Jan-1997  thorpej branches: 1.21.2; 1.21.4;
Use new machine-independent setroot().
 1.20 11-Jan-1997  ragge branches: 1.20.2;
Need a couple of extra #ifdef's to compile.
 1.19 11-Jan-1997  ragge Prototype updates.
 1.18 13-Oct-1996  christos backout previous kprintf change
 1.17 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.16 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.15 20-Aug-1996  ragge Support for cmi bus on 11/750.
 1.14 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.13 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.12 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.11 04-Apr-1996  cgd update for the fact that config_found() and config_rootfound() now
return pointers. (Check vs. NULL, rather than just boolean tests.)
 1.10 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.9 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.8 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.7 02-Feb-1996  mycroft Fix #includes.
 1.6 02-Feb-1996  mycroft Fix #includes.
 1.5 13-Dec-1995  ragge MicroVAX III support added; now runs on VAX 3600/3800/3900 platforms.
 1.4 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.3 18-Apr-1995  ragge Added missing #ifdef VAX750
 1.2 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.1 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.20.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.21.4.1 12-Mar-1997  is Merge in changes from Trunk
 1.21.2.1 02-Mar-1997  mrg swapconf() is no more.
 1.37.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.44.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.44.4.1 15-Nov-1999  fvdl Sync with -current
 1.44.2.3 29-Mar-2001  bouyer Make this compile.
 1.44.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.44.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.56.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.64.2.1 28-Jun-2000  ragge Pull up revision 1.65 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.68.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.70.8.4 03-Jan-2003  thorpej Sync with HEAD.
 1.70.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.70.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.70.8.1 16-May-2001  nathanw file autoconf.c was added on branch nathanw_sa on 2002-04-01 07:43:30 +0000
 1.70.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.70.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.77.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.77.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.77.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.77.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.77.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.77.2.1 03-Aug-2004  skrll Sync with HEAD
 1.84.2.3 17-Mar-2008  yamt sync with head.
 1.84.2.2 04-Feb-2008  yamt sync with head.
 1.84.2.1 21-Jun-2006  yamt sync with head.
 1.85.6.1 22-Apr-2006  simonb Sync with head.
 1.85.4.1 09-Sep-2006  rpaulo sync with head
 1.85.2.1 01-Mar-2006  yamt sync with head.
 1.87.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.87.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.87.2.1 01-Apr-2006  yamt sync with head.
 1.88.44.1 18-Feb-2008  mjf Sync with HEAD.
 1.88.38.1 23-Mar-2008  matt sync with HEAD
 1.89.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.89.2.1 24-Mar-2008  keiichi sync with head.
 1.90.26.2 05-Mar-2011  rmind sync with head
 1.90.26.1 03-Jul-2010  rmind sync with head
 1.90.24.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.90.4.1 11-Aug-2010  yamt sync with head.
 1.92.8.2 30-Oct-2012  yamt sync with head
 1.92.8.1 17-Apr-2012  yamt sync with head
 1.93.6.1 08-Aug-2012  martin Pull up following revision(s) (requested by mlelstv in ticket #466):
sys/arch/amiga/amiga/autoconf.c: revision 1.113
sys/arch/rs6000/rs6000/autoconf.c: revision 1.4
sys/arch/emips/emips/autoconf.c: revision 1.6
sys/arch/sandpoint/sandpoint/autoconf.c: revision 1.27
sys/arch/evbmips/alchemy/autoconf.c: revision 1.18
sys/arch/sgimips/sgimips/autoconf.c: revision 1.43
sys/arch/atari/atari/autoconf.c: revision 1.63
sys/arch/powerpc/oea/ofw_autoconf.c: revision 1.17
sys/arch/mmeye/mmeye/autoconf.c: revision 1.9
distrib/sets/lists/comp/mi: revision 1.1771
sys/arch/mipsco/mipsco/autoconf.c: revision 1.25
sys/arch/iyonix/iyonix/autoconf.c: revision 1.14
sys/arch/hp300/hp300/autoconf.c: revision 1.100
sys/kern/init_main.c: revision 1.445
sys/arch/pmax/pmax/autoconf.c: revision 1.79
sys/arch/netwinder/netwinder/autoconf.c: revision 1.11
sys/arch/dreamcast/dreamcast/autoconf.c: revision 1.10
sys/arch/ibmnws/ibmnws/autoconf.c: revision 1.12
sys/arch/evbppc/ev64260/autoconf.c: revision 1.17
sys/arch/evbmips/gdium/autoconf.c: revision 1.5
sys/arch/algor/algor/autoconf.c: revision 1.21
share/man/man9/Makefile: revision 1.367
sys/arch/ews4800mips/ews4800mips/autoconf.c: revision 1.9
sys/arch/amigappc/amigappc/autoconf.c: revision 1.5
sys/arch/x86/x86/x86_autoconf.c: revision 1.65
sys/arch/acorn26/acorn26/autoconf.c: revision 1.9
sys/arch/mvmeppc/mvmeppc/autoconf.c: revision 1.13
sys/arch/vax/vax/autoconf.c: revision 1.94
sys/arch/usermode/dev/cpu.c: revision 1.72
sys/arch/evbppc/virtex/autoconf.c: revision 1.5
sys/arch/next68k/next68k/autoconf.c: revision 1.26
sys/arch/mac68k/mac68k/autoconf.c: revision 1.73
sys/arch/ia64/ia64/autoconf.c: revision 1.6
sys/arch/evbppc/obs405/obs405_autoconf.c: revision 1.6
share/man/man9/cpu_rootconf.9: revision 1.7
sys/arch/landisk/landisk/autoconf.c: revision 1.6
sys/arch/evbmips/malta/autoconf.c: revision 1.16
sys/arch/sun3/sun3/autoconf.c: revision 1.76
sys/arch/evbppc/explora/autoconf.c: revision 1.13
sys/arch/sun3/sun3/autoconf.c: revision 1.77
sys/arch/evbmips/loongson/autoconf.c: revision 1.3
sys/arch/evbmips/atheros/autoconf.c: revision 1.11
sys/arch/sparc64/sparc64/autoconf.c: revision 1.188
sys/arch/acorn32/acorn32/autoconf.c: revision 1.18
sys/arch/evbarm/evbarm/autoconf.c: revision 1.13
sys/arch/cobalt/cobalt/autoconf.c: revision 1.30
sys/arch/mvme68k/mvme68k/autoconf.c: revision 1.46
sys/arch/hp700/hp700/autoconf.c: revision 1.48
sys/arch/evbmips/adm5120/autoconf.c: revision 1.5
sys/arch/hpcmips/hpcmips/autoconf.c: revision 1.25
sys/arch/alpha/alpha/autoconf.c: revision 1.52
sys/arch/sparc/sparc/autoconf.c: revision 1.244
sys/arch/evbppc/pmppc/autoconf.c: revision 1.7
sys/arch/bebox/bebox/autoconf.c: revision 1.25
sys/arch/luna68k/luna68k/autoconf.c: revision 1.13
sys/arch/hpcarm/hpcarm/autoconf.c: revision 1.20
sys/arch/evbppc/walnut/autoconf.c: revision 1.21
sys/arch/cesfic/cesfic/autoconf.c: revision 1.26
sys/arch/cats/cats/autoconf.c: revision 1.17
sys/arch/x68k/x68k/autoconf.c: revision 1.67
sys/arch/news68k/news68k/autoconf.c: revision 1.21
sys/arch/arc/arc/autoconf.c: revision 1.34
sys/arch/evbsh3/evbsh3/autoconf.c: revision 1.11
sys/sys/conf.h: revision 1.143
sys/arch/evbmips/rasoc/autoconf.c: revision 1.3
sys/arch/hpcsh/hpcsh/autoconf.c: revision 1.26
sys/arch/sun68k/sun68k/autoconf.c: revision 1.29
sys/arch/evbmips/rmixl/autoconf.c: revision 1.6
sys/arch/zaurus/zaurus/autoconf.c: revision 1.12
sys/arch/xen/x86/autoconf.c: revision 1.15
sys/arch/evbppc/mpc85xx/autoconf.c: revision 1.6
sys/arch/shark/shark/autoconf.c: revision 1.18
sys/arch/prep/prep/autoconf.c: revision 1.25
sys/arch/newsmips/newsmips/autoconf.c: revision 1.36
sys/arch/sbmips/sbmips/autoconf.c: revision 1.8
Do not call setroot() from MD code and from MI code, which has
unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.
No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information
as a side effect. Instead call MI rootconf() from MD code which makes
rootconf() now a wrapper to setroot().
Adjust several MD routines to set the global booted_device,booted_partition
variables instead of passing partial information to setroot().
Make cpu_rootconf(9) describe the calling order.
add rootconf(9) as a link to cpu_rootconf(9)
make this compile again
 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.10.1 10-Aug-2014  tls Rebase.
 1.96.4.1 28-Aug-2017  skrll Sync with HEAD
 1.97.24.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.98.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.3 13-Feb-1995  mycroft Clean up deleted files.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge branches: 1.1.2;
Added bcopy.s
 1.1.2.2 02-Aug-1994  ragge Added bcopy.s
 1.1.2.1 02-Aug-1994  ragge file bcopy.s was added on branch netbsd-1-0 on 1994-08-02 18:43:01 +0000
 1.40 17-Dec-2023  andvar Fix printf format specifier for size. Fixes DEBUG_DMA build option.
 1.39 11-Oct-2022  andvar fix typos in log messages s/bus_dmamem_create/bus_dmamap_create/ and
s/bus_dmamem_load/bus_dmamap_load/.
Inspired by recent similar fixes in OpenBSD.
 1.38 26-Jul-2022  andvar s/functin/function/ in copy pasted comment.
 1.37 24-May-2022  andvar s/entrace/entrance/ in copy pasted comment.
 1.36 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.35 27-Apr-2018  maxv branches: 1.35.14;
M_CLUSTER -> M_EXT_CLUSTER
 1.34 12-Nov-2010  uebayasi branches: 1.34.58;
Pull in uvm/uvm.h where UVM's page level interface is used.
 1.33 18-Mar-2009  cegger branches: 1.33.4;
bzero -> memset
 1.32 04-Jun-2008  ad branches: 1.32.6; 1.32.12;
vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.
 1.31 28-Apr-2008  martin branches: 1.31.2;
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;
Add physaddr support from mbufs (commented out since it doesn't quite work
right yet).
 1.28 31-Mar-2007  matt branches: 1.28.14; 1.28.20;
Don't use an uninitialized lastaddr (initialize it to 0).
 1.27 04-Mar-2007  christos branches: 1.27.2; 1.27.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 01-Mar-2006  yamt branches: 1.26.20;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.
 1.25 11-Dec-2005  christos branches: 1.25.2; 1.25.4; 1.25.6;
merge ktrace-lwp.
 1.24 24-Nov-2005  yamt bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.23 01-Apr-2005  yamt branches: 1.23.2; 1.23.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.22 09-Mar-2005  matt 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.21 28-Nov-2004  thorpej branches: 1.21.4; 1.21.6;
bus_dmamap_load_mbuf(): Skip zero-length mbufs.
kern/24811
 1.20 15-Jul-2003  lukem __KERNEL_RCSID()
 1.19 29-Jun-2003  fvdl branches: 1.19.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.18 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.17 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.16 01-Dec-2002  matt Fix inconsistencies in various definitions of avail_*, virtual_*, and
proc0paddr.
 1.15 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.14 02-Jun-2002  drochner move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
 1.13 10-Sep-2001  chris branches: 1.13.4; 1.13.12;
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.12 26-May-2001  chs branches: 1.12.2; 1.12.4;
replace vm_page_t with struct vm_page *.
 1.11 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.10 21-Mar-2001  soren s/vm_page_alloc_memory/uvm_pglistalloc/ in panic message.
 1.9 29-Jun-2000  mrg branches: 1.9.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.8 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.7 26-Jun-2000  simonb 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.6 04-Mar-2000  matt branches: 1.6.4;
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.5 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.4 03-Aug-1999  ragge branches: 1.4.2; 1.4.4; 1.4.8;
Add a "generic" struct for dma without anything fancy.
 1.3 08-Jul-1999  thorpej Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.2 25-May-1999  thorpej branches: 1.2.2;
bus_dmamem_map() maps DMA safe memory, which is usually one or more
managed pages, into KVA space. Since the pages are managed, we should
use pmap_enter(), not pmap_kenter_pa().

Also, when entering the mappings, enter with an access_type of
VM_PROT_READ | VM_PROT_WRITE. We do this for a couple of reasons:

(1) On systems that have H/W mod/ref attributes, the hardware
may not be able to track mod/ref done by a bus master.

(2) On systems that have to do mod/ref emulation, this prevents
a mod/ref page fault from potentially happening while in an
interrupt context, which can be problematic.

This latter change is fairly important if we ever want to be able to
transfer DMA-safe memory pages to anonymous memory objects; we will need
to know that the pages are modified, or else data could be lost!

Note that while the pages are unowned (i.e. "just DMA-safe memory pages"),
they won't consume any swap resources, as the mappings are wired, and
the pages aren't on the active or inactive queues.
 1.1 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.2.2.2 02-Aug-1999  thorpej Update from trunk.
 1.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.4.1 15-Nov-1999  fvdl Sync with -current
 1.4.2.2 27-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.6.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.9.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.9.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.12.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.12.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.12.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.13.12.1 15-Jul-2002  gehenna catch up with -current.
 1.13.4.4 11-Dec-2002  thorpej Sync with HEAD.
 1.13.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.13.4.2 20-Jun-2002  nathanw Catch up to -current.
 1.13.4.1 10-Sep-2001  nathanw file bus_dma.c was added on branch nathanw_sa on 2002-06-20 03:42:18 +0000
 1.19.2.8 11-Dec-2005  christos Sync with head.
 1.19.2.7 01-Apr-2005  skrll Sync with HEAD.
 1.19.2.6 19-Feb-2005  skrll Don't deref a NULL struct lwp *. This shouldn't happen, but...
 1.19.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.19.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.19.2.2 03-Aug-2004  skrll Sync with HEAD
 1.19.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.21.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.21.6.1 12-Feb-2005  yamt use new apis.
 1.21.4.1 29-Apr-2005  kent sync with -current
 1.23.8.1 29-Nov-2005  yamt sync with head.
 1.23.2.4 17-Mar-2008  yamt sync with head.
 1.23.2.3 04-Feb-2008  yamt sync with head.
 1.23.2.2 03-Sep-2007  yamt sync with head.
 1.23.2.1 21-Jun-2006  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.3 18-Feb-2006  yamt actually adapt _bus_dmamap_load_buffer.
 1.25.2.2 18-Feb-2006  yamt remove a now unused variable.
 1.25.2.1 18-Feb-2006  yamt adapt vax.
 1.26.20.2 15-Apr-2007  yamt sync with head.
 1.26.20.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.4.1 11-Jul-2007  mjf Sync with head.
 1.27.2.1 10-Apr-2007  ad Sync with head.
 1.28.20.1 18-Feb-2008  mjf Sync with HEAD.
 1.28.14.1 23-Mar-2008  matt sync with HEAD
 1.29.6.3 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 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.2 04-May-2009  yamt sync with head.
 1.30.4.1 16-May-2008  yamt sync with head.
 1.30.2.2 17-Jun-2008  yamt sync with head.
 1.30.2.1 18-May-2008  yamt sync with head.
 1.31.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.32.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.32.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.33.4.1 05-Mar-2011  rmind sync with head
 1.34.58.1 02-May-2018  pgoyette Synch with HEAD
 1.35.14.1 14-Dec-2020  thorpej Sync w/ HEAD.
 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;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.12 24-Nov-2005  yamt branches: 1.12.100;
bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.11 01-Apr-2005  yamt branches: 1.11.2; 1.11.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.10 15-Jul-2003  lukem branches: 1.10.8; 1.10.10;
__KERNEL_RCSID()
 1.9 16-Sep-2001  ragge branches: 1.9.4; 1.9.20;
Add bus_space_mmap().
 1.8 29-Jun-2000  mrg branches: 1.8.2; 1.8.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.7 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.6 05-Mar-2000  matt Fix a bug with < 1 pages mappings.
 1.5 24-May-1999  ragge branches: 1.5.2;
bus.h'ify more of the vax code.
 1.4 26-Mar-1999  mycroft branches: 1.4.4;
Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.3 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.2 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.1 27-Oct-1998  matt Initial bus_space support routines (should be common across
all platforms and buses).
 1.4.4.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.8.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.20.5 11-Dec-2005  christos Sync with head.
 1.9.20.4 01-Apr-2005  skrll Sync with HEAD.
 1.9.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.20.1 03-Aug-2004  skrll Sync with HEAD
 1.9.4.2 16-Sep-2001  ragge Add bus_space_mmap().
 1.9.4.1 16-Sep-2001  ragge file bus_mem.c was added on branch nathanw_sa on 2001-09-16 20:39:03 +0000
 1.10.10.1 12-Feb-2005  yamt use new apis.
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.11.8.1 29-Nov-2005  yamt sync with head.
 1.11.2.1 21-Jun-2006  yamt sync with head.
 1.12.100.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.24 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.23 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.22 25-Jul-2014  dholland branches: 1.22.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.21 16-Mar-2014  dholland branches: 1.21.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.20 14-Dec-2010  matt branches: 1.20.8; 1.20.18; 1.20.22;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.19 21-Nov-2009  rmind branches: 1.19.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.18 11-Mar-2008  matt branches: 1.18.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.17 02-Jan-2008  ad branches: 1.17.2; 1.17.6;
Merge vmlocking2 to head.
 1.16 17-Oct-2007  garbled branches: 1.16.2; 1.16.4; 1.16.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.15 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.14 29-Jul-2007  ad branches: 1.14.4; 1.14.6; 1.14.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.13 04-Mar-2007  christos branches: 1.13.2; 1.13.10; 1.13.12; 1.13.14;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.12 11-Dec-2005  christos branches: 1.12.26;
merge ktrace-lwp.
 1.11 07-Aug-2003  agc branches: 1.11.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.10 15-Jul-2003  lukem __KERNEL_RCSID()
 1.9 23-Oct-2002  jdolecek branches: 1.9.6;
merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.8 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.7 20-Nov-2000  chs branches: 1.7.2; 1.7.4; 1.7.8; 1.7.16;
rationalize the use of b_flags for geteblk() buffers.
rather than assigning to the whole field, set or clear individual flags,
which implies that the B_BUSY and B_INVAL flags will remain set.
this allows us to make the assertion in brelse() that B_BUSY is set,
which is the purpose of all this.
 1.6 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.5 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.4 27-May-2000  thorpej branches: 1.4.2;
sleep() -> tsleep()
 1.3 19-May-2000  thorpej A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.2 13-Apr-1998  ragge branches: 1.2.14; 1.2.20;
Wall cleaning.
 1.1 13-Jun-1997  ragge Not-yet-finished console RX01 driver for 11/780.
 1.2.20.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.2.14.2 22-Nov-2000  bouyer Sync with HEAD.
 1.2.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.4.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.16.1 17-May-2002  gehenna Add device switch.
 1.7.8.2 11-Nov-2002  nathanw Catch up to -current
 1.7.8.1 17-Sep-2002  nathanw Catch up to -current.
 1.7.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.7.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.9.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.5 17-Mar-2008  yamt sync with head.
 1.11.16.4 21-Jan-2008  yamt sync with head
 1.11.16.3 27-Oct-2007  yamt sync with head.
 1.11.16.2 03-Sep-2007  yamt sync with head.
 1.11.16.1 21-Jun-2006  yamt sync with head.
 1.12.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.13.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.13.12.1 07-Aug-2007  matt Sync with HEAD.
 1.13.10.2 16-Oct-2007  garbled Sync with HEAD
 1.13.10.1 03-Oct-2007  garbled Sync with HEAD
 1.13.2.2 09-Oct-2007  ad Sync with head.
 1.13.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.14.8.1 14-Oct-2007  yamt sync with head.
 1.14.6.3 23-Mar-2008  matt sync with HEAD
 1.14.6.2 09-Jan-2008  matt sync with HEAD
 1.14.6.1 06-Nov-2007  matt sync with HEAD
 1.14.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.16.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.16.4.1 31-Dec-2007  ad Catch up with buffer cache changes.
 1.16.2.1 18-Feb-2008  mjf 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.4.1 11-Mar-2010  yamt sync with head
 1.19.4.1 05-Mar-2011  rmind sync with head
 1.20.22.1 18-May-2014  rmind sync with head
 1.20.18.2 03-Dec-2017  jdolecek update from HEAD
 1.20.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.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.21.2.1 10-Aug-2014  tls Rebase.
 1.22.4.2 28-Aug-2017  skrll Sync with HEAD
 1.22.4.1 09-Jul-2016  skrll Sync with HEAD
 1.61 07-Sep-2025  thorpej todr_chip_handle::base_time -> todr_chip_handle::todr_base_time

NFCI
 1.60 03-Jul-2020  maxv hardclock_ticks -> getticks()
 1.59 29-May-2020  rin For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.58 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.57 17-Nov-2014  christos branches: 1.57.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.56 06-Mar-2012  jklos branches: 1.56.2;
Missing end of line.
 1.55 14-Dec-2010  matt branches: 1.55.8; 1.55.12;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.54 19-Nov-2010  uwe 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.53 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.52 12-Dec-2009  tsutsui branches: 1.52.2; 1.52.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.51 14-Sep-2009  mhitch Not understanding what vax_mfpr_get_counter() was doing, my fix for
backwards time was incorrect, and actually disabled the use of mfpr for
timecounters. The intent was to emulate a 32 bit counter using the
hardclock_ticks from the clock interrupt and the contents of the
Interval Counter register. The problem with that was when the ICR
wrapped, but the clock interrupt was blocked resulted in an incorrect
count. Work around this by keeping track of the previous ICR value
and hardclock_ticks to ensure the 32 bit counter doesn't go backwards.
Also, the ICR runs from -10000 to -1, so adjust the value when reading it.
Now mfpr works quit nicely on my 4000/90.
 1.50 21-Feb-2009  mhitch Not all 32 bits of the interval count register are being used, so set
the counter_mask to the number of significant bits we are actually using.
Fixes user/system CPU usage times.
 1.49 07-Jan-2008  joerg branches: 1.49.10; 1.49.18; 1.49.20; 1.49.24; 1.49.26; 1.49.28;
Timecounter support for VAX. Basic testing in simh done on a backported
version to netbsd-4.
 1.48 17-Mar-2007  matt branches: 1.48.14; 1.48.20; 1.48.26;
Remove errant debug line.
 1.47 12-Mar-2007  matt branches: 1.47.2; 1.47.4;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.46 16-Sep-2006  gdamore branches: 1.46.6; 1.46.10;
Pass the filesystem time to clock drivers in the todr_chip_handle, so that
vax, and pmax can use it.
 1.45 05-Sep-2006  matt branches: 1.45.2;
Switch VAX over to generic TODR
 1.44 24-Dec-2005  perry branches: 1.44.4; 1.44.8;
bare asm -> __asm
 1.43 11-Dec-2005  christos merge ktrace-lwp.
 1.42 27-Jun-2005  ragge branches: 1.42.2;
Update according to cast-qual addition.
 1.41 15-Jul-2003  lukem __KERNEL_RCSID()
 1.40 16-May-2001  matt branches: 1.40.8; 1.40.24;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.39 04-Feb-2001  ragge branches: 1.39.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.38 26-Jul-2000  ragge Make yeartonum/numtoyear visible.
 1.37 12-Jun-2000  ragge Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.36 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.35 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.34 28-May-2000  matt Add VAX660/670/680 support.
 1.33 18-Apr-2000  mhitch branches: 1.33.2;
PC_ICR doesn't exist on the 4000/VLC and trying to read it apparently
causes problems when the cache is enabled. Don't access it if boardtype
is VAX_BTYP_48.
 1.32 29-Feb-2000  matt add missing cpu dependencies
 1.31 27-Jan-2000  bouyer Add missing '#include "opt_vax630.h"' for custom kernels.
 1.30 19-Jan-2000  msaitoh check whether tv_usec >= 1000000
 1.29 17-Jan-2000  matt defopt VAXnnn so the make depend does the right thing.
 1.28 01-May-1999  ragge branches: 1.28.2;
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.27 26-Mar-1999  ragge branches: 1.27.4;
Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.26 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.25 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.24 20-Aug-1998  matt The VAX46 (VS4000) needs the clock stuff the VAX43 does...
 1.23 11-Aug-1998  ragge Cache and microsecond clock resolution on KA46.
 1.22 13-Apr-1998  ragge Wall cleaning.
 1.21 22-Feb-1998  ragge Type fix so that time get read correct on VS2000, from Ken Wellsch.
 1.20 18-Apr-1997  ragge Change implementation of TOY clock addressing. Gives us only
one routine for three different HW implementations.
 1.19 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.18 13-Oct-1996  christos branches: 1.18.6;
backout previous kprintf change
 1.17 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.16 20-Jul-1996  ragge Reworked time handling; now also handles clock chip CPUs correctly.
 1.15 10-Jul-1996  ragge Slow down DELAY for 11/785.
 1.14 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.13 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.12 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.11 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.10 02-Feb-1996  mycroft Fix #includes.
 1.9 13-Dec-1995  ragge MicroVAX III support added; now runs on VAX 3600/3800/3900 platforms.
 1.8 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.7 12-Apr-1995  ragge branches: 1.7.2;
Fixes to conf.c
Cleaning of code.
 1.6 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.5 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.4 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.3 25-Nov-1994  ragge Lots of fixes and updates.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.7.2.1 15-Oct-1995  ragge Removed a compile complain. Cleanup.
 1.18.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.27.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.28.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.28.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 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.39.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.40.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.40.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.40.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.40.24.1 03-Aug-2004  skrll Sync with HEAD
 1.40.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.40.8.1 16-May-2001  matt file clock.c was added on branch nathanw_sa on 2001-05-16 05:36:56 +0000
 1.42.2.3 21-Jan-2008  yamt sync with head
 1.42.2.2 30-Dec-2006  yamt sync with head.
 1.42.2.1 21-Jun-2006  yamt sync with head.
 1.44.8.1 14-Sep-2006  yamt sync with head.
 1.44.4.1 09-Sep-2006  rpaulo sync with head
 1.45.2.1 18-Nov-2006  ad Sync with head.
 1.46.10.2 10-Apr-2007  ad Sync with head.
 1.46.10.1 13-Mar-2007  ad Sync with head.
 1.46.6.2 24-Mar-2007  yamt sync with head.
 1.46.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.47.4.1 18-Mar-2007  reinoud First attempt to bring branch in sync with HEAD
 1.47.2.1 11-Jul-2007  mjf Sync with head.
 1.48.26.1 08-Jan-2008  bouyer Sync with HEAD
 1.48.20.1 18-Feb-2008  mjf Sync with HEAD.
 1.48.14.1 09-Jan-2008  matt sync with HEAD
 1.49.28.1 21-Apr-2010  matt sync to netbsd-5
 1.49.26.1 16-Sep-2009  snj Pull up following revision(s) (requested by mhitch in ticket #955):
sys/arch/vax/vax/clock.c: revision 1.51
Not understanding what vax_mfpr_get_counter() was doing, my fix for
backwards time was incorrect, and actually disabled the use of mfpr for
timecounters. The intent was to emulate a 32 bit counter using the
hardclock_ticks from the clock interrupt and the contents of the
Interval Counter register. The problem with that was when the ICR
wrapped, but the clock interrupt was blocked resulted in an incorrect
count. Work around this by keeping track of the previous ICR value
and hardclock_ticks to ensure the 32 bit counter doesn't go backwards.
Also, the ICR runs from -10000 to -1, so adjust the value when reading it.
Now mfpr works quit nicely on my 4000/90.
 1.49.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.49.20.2 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.49.20.1 16-Sep-2009  snj Pull up following revision(s) (requested by mhitch in ticket #955):
sys/arch/vax/vax/clock.c: revision 1.51 via patch
Not understanding what vax_mfpr_get_counter() was doing, my fix for
backwards time was incorrect, and actually disabled the use of mfpr for
timecounters. The intent was to emulate a 32 bit counter using the
hardclock_ticks from the clock interrupt and the contents of the
Interval Counter register. The problem with that was when the ICR
wrapped, but the clock interrupt was blocked resulted in an incorrect
count. Work around this by keeping track of the previous ICR value
and hardclock_ticks to ensure the 32 bit counter doesn't go backwards.
Also, the ICR runs from -10000 to -1, so adjust the value when reading it.
Now mfpr works quit nicely on my 4000/90.
 1.49.18.1 03-Mar-2009  skrll Sync with HEAD.
 1.49.10.4 11-Aug-2010  yamt sync with head.
 1.49.10.3 11-Mar-2010  yamt sync with head
 1.49.10.2 16-Sep-2009  yamt sync with head
 1.49.10.1 04-May-2009  yamt sync with head.
 1.52.4.2 05-Mar-2011  rmind sync with head
 1.52.4.1 03-Jul-2010  rmind sync with head
 1.52.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.55.12.1 11-Mar-2012  mrg sync to latest -current
 1.55.8.1 17-Apr-2012  yamt sync with head
 1.56.2.1 03-Dec-2017  jdolecek update from HEAD
 1.57.2.1 28-Aug-2017  skrll Sync with HEAD
 1.16 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.15 24-Apr-2021  thorpej branches: 1.15.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.14 22-May-2017  ragge branches: 1.14.24;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.13 14-Dec-2010  matt branches: 1.13.18; 1.13.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.12 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.11 11-Mar-2008  matt branches: 1.11.4; 1.11.24; 1.11.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.10 04-Mar-2007  christos branches: 1.10.20; 1.10.36; 1.10.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 11-Dec-2005  christos branches: 1.9.26;
merge ktrace-lwp.
 1.8 15-Jul-2003  lukem branches: 1.8.16;
__KERNEL_RCSID()
 1.7 01-Jan-2003  thorpej branches: 1.7.2;
Use aprint_normal() for cfprint routines.
 1.6 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.5 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 04-Jun-2000  ragge branches: 1.3.6; 1.3.10;
Changes to sbi_attach_args. (and some cleanup)
 1.2 14-Aug-1999  ragge branches: 1.2.2; 1.2.10;
Fix CMI probe bug on VAX 11/750. Prettify CPU printout.
 1.1 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.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.10.2 03-Jan-2003  thorpej Sync with HEAD.
 1.3.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.3.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.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.2 17-Mar-2008  yamt sync with head.
 1.8.16.1 03-Sep-2007  yamt sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.36.1 24-Mar-2008  keiichi sync with head.
 1.10.20.1 23-Mar-2008  matt sync with HEAD
 1.11.26.2 05-Mar-2011  rmind sync with head
 1.11.26.1 03-Jul-2010  rmind sync with head
 1.11.24.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.11.4.1 11-Aug-2010  yamt 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.14.24.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.15.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.5 07-Jul-2016  msaitoh branches: 1.5.16; 1.5.18;
KNF. Remove extra spaces. No functional change.
 1.4 03-Jul-2011  matt branches: 1.4.12; 1.4.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.3 14-Dec-2010  matt Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.2 21-Nov-2009  rmind branches: 1.2.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.1 13-Jan-2009  mjf branches: 1.1.2; 1.1.4; 1.1.8;
- 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.1.8.3 11-Mar-2010  yamt sync with head
 1.1.8.2 04-May-2009  yamt sync with head.
 1.1.8.1 13-Jan-2009  yamt file compat_13_machdep.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:04 +0000
 1.1.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.4.1 13-Jan-2009  skrll file compat_13_machdep.c was added on branch nick-hppapmap on 2009-01-19 13:17:02 +0000
 1.1.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 13-Jan-2009  mjf file compat_13_machdep.c was added on branch mjf-devfs2 on 2009-01-17 13:28:35 +0000
 1.2.4.1 05-Mar-2011  rmind sync with head
 1.4.30.1 09-Jul-2016  skrll Sync with HEAD
 1.4.12.1 03-Dec-2017  jdolecek update from HEAD
 1.5.18.1 10-Jun-2019  christos Sync with HEAD
 1.5.16.1 18-Jan-2019  pgoyette Synch with HEAD
 1.5 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.4 03-Jul-2011  matt branches: 1.4.52; 1.4.54;
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.3 14-Dec-2010  matt Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.2 21-Nov-2009  rmind branches: 1.2.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.1 13-Jan-2009  mjf branches: 1.1.2; 1.1.4; 1.1.8;
- 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.1.8.3 11-Mar-2010  yamt sync with head
 1.1.8.2 04-May-2009  yamt sync with head.
 1.1.8.1 13-Jan-2009  yamt file compat_16_machdep.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:04 +0000
 1.1.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.4.1 13-Jan-2009  skrll file compat_16_machdep.c was added on branch nick-hppapmap on 2009-01-19 13:17:02 +0000
 1.1.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 13-Jan-2009  mjf file compat_16_machdep.c was added on branch mjf-devfs2 on 2009-01-17 13:28:35 +0000
 1.2.4.1 05-Mar-2011  rmind sync with head
 1.4.54.1 10-Jun-2019  christos Sync with HEAD
 1.4.52.1 18-Jan-2019  pgoyette Synch with HEAD
 1.69 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.68 05-Jul-2015  matt branches: 1.68.48;
Reorganize a bit. Add QVSS (from Charles Dickman).
 1.67 14-Dec-2010  matt branches: 1.67.18; 1.67.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.66 12-Aug-2008  hans branches: 1.66.16;
Add new accelerated driver for SPX graphics found in some VAXstations,
remove old broken lcspx driver. This is a bugfixed and refactored
version of the spx driver originally developed by Blaz Antonic in 2005.
OK'ed by mhitch.
 1.65 11-Dec-2005  christos branches: 1.65.74; 1.65.78; 1.65.80; 1.65.84;
merge ktrace-lwp.
 1.64 19-Mar-2004  mhitch Add the lcspx and lcg display drivers to the console table so they will
get properly probed and initialized. This also fixes the problem of the
keyboard getting the console output and the keyboard port getting the wrong
serial baud rate. The lcg driver is not currently present, but should be
"real soon now".
 1.63 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.62 15-Jul-2003  lukem __KERNEL_RCSID()
 1.61 26-Oct-2002  jdolecek branches: 1.61.6;
now that mem_no is emitted by config(8), there is no reason to keep
copy of more or less identical iskmemdev() for every arch; move the function
to spec_vnop.c, and g/c machine-dependant copies
 1.60 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.59 19-Jul-2002  thorpej Rename cdev_systrace_init() to cdev_clonemisc_init(), so it can
be properly used by any misc. cloning device. While here, correct
a comment to indicate that "open" is the only entry point and that
everything else is handled with fileops.
 1.58 17-Jun-2002  christos MD systrace gluons.
 1.57 12-Jan-2002  manu branches: 1.57.8;
Added clockctl
 1.56 28-Sep-2001  chs branches: 1.56.4;
don't depend on other headers to include sys/proc.h for us.
 1.55 22-Jun-2001  lukem branches: 1.55.2; 1.55.4;
remove remnants of np device, per my recent files.vax commit
 1.54 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.53 26-Mar-2001  lukem - add dev_noimpl(xxx,yyy) macro to replace "(dev_type_xxx((*))) yyy",
and use appropriately

- create more helper macros:
. cdev__xyz_init(c,n), such as cdev__ocri_init() for
/* open, close, read, ioctl */, etc.
. cdev__xRy_init(c,n), where nullop is used instead of enodev to dummy out
method `R' and the comments now read /* xxx (read) yyy */ instead
. cdev__xyz_t_init(c,n,t) - as per cdev__xyz_init, but sets d_type = t
as well

- use seltrue instead of dev_noimpl(poll,*), as (IIRC) cdevsw.d_poll should
always DTRT WRT returning a valid result. (a few devices previously
incorrectly returned ENODEV)

- use dev_noimpl(stop,enodev) instead of dev_noimpl(stop,nullop) if tty
== 0, because it doesn't matter if dev_type_stop isn't implemented in that
case, and it allows the use of the cdev__xyz_init macros. certain ports
(sparc,sparc64,x68k) used the nullop method for dev_type_stop in a few
drivers, whereas everything else uses enodev

- ensure that the comments are accurate WRT the behaviour of a given entry
 1.52 04-Feb-2001  ragge branches: 1.52.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.51 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.50 30-Dec-2000  matt Make this compile without having a SMG device.
 1.49 02-Dec-2000  ragge lkc is gone, long live wskbd.
 1.48 26-Jul-2000  ragge KA88 console support.
 1.47 12-Jun-2000  ragge Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.46 08-May-2000  ragge branches: 1.46.2;
VAX 4000/200 support. From Michael Kukat.
 1.45 17-Jan-2000  matt defopt VAXnnn so the make depend does the right thing.
 1.44 27-Oct-1999  ragge Let smg be probed as all other possible consoles.
 1.43 29-Jul-1999  augustss branches: 1.43.2; 1.43.4; 1.43.6;
Add wsmux device.
(Also add lots of missing chrtoblktbl[] entries.)
 1.42 06-Jun-1999  ragge Use gencons if VAX670.
 1.41 26-Mar-1999  ragge branches: 1.41.4;
Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.40 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.39 13-Nov-1998  oster Updating of bdev's and cdev's to support RAIDframe.
 1.38 07-Nov-1998  ragge Support for KA820 console RX50. From 4.4, ported to NetBSD by Sergey Svishchev.
 1.37 10-Oct-1998  thorpej Add scsibus entry points to the cdevsw[].
 1.36 30-Sep-1998  ragge Make kernel compile after recent signal changes.
 1.35 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.34 21-May-1998  ragge Support for DDB on DZ console.
 1.33 17-May-1998  ragge Mod~ify for new changes to lance/dz drivers.
 1.32 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.31 08-Feb-1998  ragge Split out MSCP floppies as a separate device (rx) instead of handling
them as disk drives. It is now also allowed to change floppies without
the system complaining :-)
 1.30 16-Oct-1997  christos fix chrtoblk declaration
 1.29 13-Oct-1997  explorer o Make usage of /dev/random dependant on
pseudo-device rnd # /dev/random and in-kernel generator
in config files.

o Add declaration to all architectures.

o Clean up copyright message in rnd.c, rnd.h, and rndpool.c to include
that this code is derived in part from Ted Tyso's linux code.
 1.28 04-Feb-1997  ragge branches: 1.28.8;
Support for DL11 (-compatible) async ctlr.
Written by Ben Harris (bjh@mail.dotcom.fr).
 1.27 07-Jan-1997  mrg use pseudo-device ipfilter, not ipl.
 1.26 05-Jan-1997  ragge Add rd, sd, cd, md, st, ss, uk, ch and ipl device entries.
 1.25 07-Sep-1996  mycroft Implement poll(2).
 1.24 05-Sep-1996  mycroft Remove duplicate declarations of LKM functions and macros.
 1.23 20-Jul-1996  ragge Put in rd (ST506 disk), sd and st.
 1.22 01-Jul-1996  ragge uda -> ra and tms -> mt (mscp changes).
 1.21 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.20 14-Mar-1996  christos fdopen -> filedescopen
 1.19 09-Mar-1996  ragge Change NTU to NHT.
 1.18 08-Mar-1996  ragge Support for the RL02 disk at the PDP11 frontend console added.
 1.17 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.16 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.15 28-Jan-1996  ragge bpf, vnd & tun added.
 1.14 17-Aug-1995  thorpej Add entries for the ccd.
 1.13 05-Jul-1995  ragge rx, rl and kdb needed cdev_decl's.
 1.12 04-Jul-1995  mycroft Make each disk and tape driver define its own read and write functions.
Deprecate rawread() and rawwrite() completely. Remove d_strategy from cdevsw to
force the abstraction barrier.
 1.11 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.10 03-May-1995  ragge Changed conf.c to new style. Took away double saving of regs in traps.
Changed boot() to use vfs_shutdown(). Updated setregs.
 1.9 12-Apr-1995  ragge Fixes to conf.c
Cleaning of code.
 1.8 10-Apr-1995  mycroft Partially update to match conf.h.
 1.7 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.6 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.5 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file conf.c was added on branch netbsd-1-0 on 1994-08-16 23:47:26 +0000
 1.28.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.41.4.2 02-Aug-1999  thorpej Update from trunk.
 1.41.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.43.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.43.4.1 15-Nov-1999  fvdl Sync with -current
 1.43.2.5 27-Mar-2001  bouyer Sync with HEAD.
 1.43.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.43.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.43.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.43.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.52.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.52.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.55.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.55.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.55.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.55.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.55.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.55.2.1 10-Jul-2001  lukem add kqfilter cdev methods as appropriate
 1.56.4.6 11-Nov-2002  nathanw Catch up to -current
 1.56.4.5 17-Sep-2002  nathanw Catch up to -current.
 1.56.4.4 01-Aug-2002  nathanw Catch up to -current.
 1.56.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.56.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.56.4.1 28-Sep-2001  nathanw file conf.c was added on branch nathanw_sa on 2002-02-28 04:12:30 +0000
 1.57.8.3 21-Jul-2002  gehenna catch up with -current.
 1.57.8.2 15-Jul-2002  gehenna catch up with -current.
 1.57.8.1 16-May-2002  gehenna Bye block/character device swicth tables.
 1.61.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.61.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.61.6.1 03-Aug-2004  skrll Sync with HEAD
 1.65.84.1 19-Oct-2008  haad Sync with HEAD.
 1.65.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.65.78.1 04-May-2009  yamt sync with head.
 1.65.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.66.16.1 05-Mar-2011  rmind sync with head
 1.67.36.1 22-Sep-2015  skrll Sync with HEAD
 1.67.18.1 03-Dec-2017  jdolecek update from HEAD
 1.68.48.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.9 08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.8 20-Nov-2019  pgoyette branches: 1.8.32;
Move all non-emulation-specific coredump code into the coredump module,
and remove all #ifdef COREDUMP conditional compilation. Now, the
coredump module is completely separated from the emulation modules, and
they can all be independently loaded and unloaded.

Welcome to 9.99.18 !
 1.7 22-May-2017  ragge branches: 1.7.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.6 01-Jan-2014  dsl branches: 1.6.6;
Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.
 1.5 03-Jul-2011  matt branches: 1.5.2; 1.5.12; 1.5.16;
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.4 14-Dec-2010  matt Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.3 21-Nov-2009  rmind branches: 1.3.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.2 15-Aug-2009  matt Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for us.
 1.1 19-Nov-2008  ad branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12;
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.1.12.4 11-Mar-2010  yamt sync with head
 1.1.12.3 19-Aug-2009  yamt sync with head.
 1.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 19-Nov-2008  yamt file core_machdep.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:04 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 19-Nov-2008  skrll file core_machdep.c was added on branch nick-hppapmap on 2009-01-19 13:17:02 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 19-Nov-2008  mjf file core_machdep.c was added on branch mjf-devfs2 on 2009-01-17 13:28:35 +0000
 1.1.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1 19-Nov-2008  haad file core_machdep.c was added on branch haad-dm on 2008-12-13 01:13:34 +0000
 1.3.4.1 05-Mar-2011  rmind sync with head
 1.5.16.1 18-May-2014  rmind sync with head
 1.5.12.2 03-Dec-2017  jdolecek update from HEAD
 1.5.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.6.1 28-Aug-2017  skrll Sync with HEAD
 1.7.10.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.8.32.1 02-Aug-2025  perseant Sync with HEAD
 1.1 25-Apr-2018  ragge branches: 1.1.2;
VAX version of cpu_in_checksum(). Increases network performance significantly.
 1.1.2.2 02-May-2018  pgoyette Synch with HEAD
 1.1.2.1 25-Apr-2018  pgoyette file cpu_in_cksum.S was added on branch pgoyette-compat on 2018-05-02 07:20:05 +0000
 1.4 13-Feb-1995  mycroft Clean up deleted files.
 1.3 25-Nov-1994  ragge Lots of fixes and updates.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.34 31-Mar-2017  msaitoh Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
 1.33 07-Jul-2016  msaitoh branches: 1.33.2; 1.33.4;
KNF. Remove extra spaces. No functional change.
 1.32 25-Jul-2014  dholland branches: 1.32.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.31 16-Mar-2014  dholland branches: 1.31.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.30 26-Oct-2011  martin branches: 1.30.2; 1.30.12; 1.30.16;
Obvious copy&pasto, PR port-vax/45525 from Henning Petersen
 1.29 14-Dec-2010  matt Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.28 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.27 21-Nov-2009  rmind branches: 1.27.2; 1.27.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.26 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.25 11-Mar-2008  matt branches: 1.25.4; 1.25.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.24 02-Jan-2008  ad branches: 1.24.2; 1.24.6;
Merge vmlocking2 to head.
 1.23 17-Oct-2007  garbled branches: 1.23.2; 1.23.4; 1.23.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.22 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.21 29-Jul-2007  ad branches: 1.21.4; 1.21.6; 1.21.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.20 04-Mar-2007  christos branches: 1.20.2; 1.20.10; 1.20.12; 1.20.14;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 11-Dec-2005  christos branches: 1.19.26;
merge ktrace-lwp.
 1.18 29-Sep-2003  matt branches: 1.18.16;
Fix GCC3'ism's
 1.17 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.16 15-Jul-2003  lukem __KERNEL_RCSID()
 1.15 30-Jan-2003  matt branches: 1.15.2;
Cleanup daddr_t fallout.
 1.14 19-Jan-2003  ragge Add some instrumentation and clean up some VAX8600 code.
From Johnny Billquist.
 1.13 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.12 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.11 20-Nov-2000  chs branches: 1.11.2; 1.11.4; 1.11.8; 1.11.16;
rationalize the use of b_flags for geteblk() buffers.
rather than assigning to the whole field, set or clear individual flags,
which implies that the B_BUSY and B_INVAL flags will remain set.
this allows us to make the assertion in brelse() that B_BUSY is set,
which is the purpose of all this.
 1.10 09-Aug-2000  tv %b -> bitmask_snprintf()
 1.9 02-Jun-2000  matt replace spl4 with splconsmedia
 1.8 27-May-2000  thorpej branches: 1.8.2;
sleep() -> tsleep()
 1.7 19-May-2000  thorpej A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.6 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.5 13-Oct-1996  christos branches: 1.5.28; 1.5.34;
backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.2 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.1 08-Mar-1996  ragge Support for the RL02 disk at the PDP11 frontend console added.
 1.5.34.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.5.28.2 22-Nov-2000  bouyer Sync with HEAD.
 1.5.28.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 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.11.16.1 17-May-2002  gehenna Add device switch.
 1.11.8.2 11-Nov-2002  nathanw Catch up to -current
 1.11.8.1 17-Sep-2002  nathanw Catch up to -current.
 1.11.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.11.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.15.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.18.16.5 17-Mar-2008  yamt sync with head.
 1.18.16.4 21-Jan-2008  yamt sync with head
 1.18.16.3 27-Oct-2007  yamt sync with head.
 1.18.16.2 03-Sep-2007  yamt sync with head.
 1.18.16.1 21-Jun-2006  yamt sync with head.
 1.19.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.20.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.20.12.1 07-Aug-2007  matt Sync with HEAD.
 1.20.10.2 16-Oct-2007  garbled Sync with HEAD
 1.20.10.1 03-Oct-2007  garbled Sync with HEAD
 1.20.2.2 09-Oct-2007  ad Sync with head.
 1.20.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.21.8.1 14-Oct-2007  yamt sync with head.
 1.21.6.3 23-Mar-2008  matt sync with HEAD
 1.21.6.2 09-Jan-2008  matt sync with HEAD
 1.21.6.1 06-Nov-2007  matt sync with HEAD
 1.21.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.23.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.23.4.1 31-Dec-2007  ad Catch up with buffer cache changes.
 1.23.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.24.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.24.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.24.2.1 24-Mar-2008  keiichi sync with head.
 1.25.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.25.4.3 11-Aug-2010  yamt sync with head.
 1.25.4.2 11-Mar-2010  yamt sync with head
 1.25.4.1 04-May-2009  yamt sync with head.
 1.27.4.2 05-Mar-2011  rmind sync with head
 1.27.4.1 03-Jul-2010  rmind sync with head
 1.27.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.30.16.1 18-May-2014  rmind sync with head
 1.30.12.2 03-Dec-2017  jdolecek update from HEAD
 1.30.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.31.2.1 10-Aug-2014  tls Rebase.
 1.32.4.2 28-Aug-2017  skrll Sync with HEAD
 1.32.4.1 09-Jul-2016  skrll Sync with HEAD
 1.33.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.33.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.3 31-Mar-2025  andvar s/transation/transaction/ in comment.
 1.2 12-Apr-1999  pk branches: 1.2.262;
Ungarble the copyright notice.
 1.1 08-Mar-1996  ragge branches: 1.1.24;
Support for the RL02 disk at the PDP11 frontend console added.
 1.1.24.1 12-Apr-1999  pk branches: 1.1.24.1.2;
Pullup copyright text corrections.
 1.1.24.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.262.1 02-Aug-2025  perseant Sync with HEAD
 1.16 17-Dec-2023  andvar Fix format specifier for ka820port_ptr->csr.

Fixed CRXDEBUG build option for vax.
 1.15 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.14 16-Mar-2014  dholland branches: 1.14.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.13 11-Mar-2008  matt branches: 1.13.38; 1.13.48; 1.13.54;
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.12 20-Feb-2008  matt branches: 1.12.2; 1.12.6;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.11 04-Mar-2007  christos branches: 1.11.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 11-Dec-2005  christos branches: 1.10.26;
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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 23-Oct-2002  jdolecek branches: 1.7.6;
merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.6 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.5 27-May-2000  thorpej branches: 1.5.6; 1.5.8; 1.5.12; 1.5.20;
sleep() -> tsleep()
 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 15-Feb-1999  ragge branches: 1.3.8;
Fix RCSid, pointed out by Hubert Feyrer.
 1.2 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.1 07-Nov-1998  ragge Support for KA820 console RX50. From 4.4, ported to NetBSD by Sergey Svishchev.
 1.3.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.5.20.1 17-May-2002  gehenna Add device switch.
 1.5.12.2 11-Nov-2002  nathanw Catch up to -current
 1.5.12.1 17-Sep-2002  nathanw Catch up to -current.
 1.5.8.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.7.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.4 17-Mar-2008  yamt sync with head.
 1.9.16.3 27-Feb-2008  yamt sync with head.
 1.9.16.2 03-Sep-2007  yamt sync with head.
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.10.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.20.1 23-Mar-2008  matt sync with HEAD
 1.12.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.12.2.1 24-Mar-2008  keiichi sync with head.
 1.13.54.1 18-May-2014  rmind sync with head
 1.13.48.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.38.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.2.1 10-Aug-2014  tls Rebase.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 19-Jan-1999  ragge branches: 1.2.42;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.1 07-Nov-1998  ragge Support for KA820 console RX50. From 4.4, ported to NetBSD by Sergey Svishchev.
 1.2.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.42.1 03-Aug-2004  skrll Sync with HEAD
 1.39 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.38 02-Jun-2023  andvar follow the steps of Andrew Doran (ad) commit and fix more s/loose/lose/ typos.
also s/beyound/beyond/ and few others along the way, mainly in comments.
 1.37 02-Apr-2018  mrg convert some spaces into new lines and tabs to make the gcc 6
indent checker happy.
 1.36 22-May-2017  ragge branches: 1.36.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.35 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.34 25-Jul-2014  dholland branches: 1.34.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.33 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.32 16-Mar-2014  dholland branches: 1.32.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.31 14-Dec-2010  matt branches: 1.31.8; 1.31.18; 1.31.22;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.30 13-Jan-2009  yamt branches: 1.30.6;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.29 11-Mar-2008  matt branches: 1.29.4; 1.29.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.28 17-Oct-2007  garbled branches: 1.28.12; 1.28.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.27 29-Jul-2007  ad branches: 1.27.6;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.26 09-Jul-2007  ad branches: 1.26.2; 1.26.4;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.25 04-Mar-2007  christos branches: 1.25.2; 1.25.4; 1.25.10;
Fix caddr_t fallout.
 1.24 04-Mar-2007  christos 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 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.21 28-Oct-2004  yamt branches: 1.21.12;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.20 06-Nov-2003  he Work around gcc 2.95.3's inability to detect that 'ck' will be set
in rounds 129 and 130 through the loop. Will be noted in doc/HACKS,
and should be reviewed when gcc 3.3.2 is ready for vax.
 1.19 15-Jul-2003  lukem __KERNEL_RCSID()
 1.18 23-Oct-2002  jdolecek branches: 1.18.6;
merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.17 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.16 22-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.15 01-Jul-2002  ragge Protect biodone() with spl7(). Found by art@openbsd, but fixed in the
wrong way.
 1.14 14-May-2001  ragge branches: 1.14.2; 1.14.4; 1.14.8; 1.14.16;
Write support for TU58 tapes written.
 1.13 13-May-2001  ragge Add checksum calculation, busy-wait loops for receive packets and use
correct interrupt levels (spl7). Reading tapes now work reliable.
 1.12 12-Apr-2001  thorpej splimp -> splbio.
 1.11 19-May-2000  thorpej branches: 1.11.6;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.10 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.9 07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.8 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.7 23-Jan-2000  matt remove volatile from softc. cleanup interrupt initialization.
 1.6 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.5 13-Oct-1996  christos branches: 1.5.28;
backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.2 02-Mar-1996  ragge Add a #ifdef TUDEBUG around a printf statement.
 1.1 17-Feb-1996  ragge Console TU58 device driver for 11/750 added.
It cannot write tapes yes, but reading works OK.
 1.5.28.2 21-Apr-2001  bouyer Sync with HEAD
 1.5.28.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.11.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.14.16.3 31-Aug-2002  gehenna catch up with -current.
 1.14.16.2 17-Jul-2002  gehenna catch up with -current.
 1.14.16.1 17-May-2002  gehenna Add device switch.
 1.14.8.4 11-Nov-2002  nathanw Catch up to -current
 1.14.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.14.8.2 01-Aug-2002  nathanw Catch up to -current.
 1.14.8.1 14-May-2001  nathanw file ctu.c was added on branch nathanw_sa on 2002-08-01 02:43:59 +0000
 1.14.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.14.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.14.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.18.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.6.5 02-Nov-2004  skrll Sync with HEAD.
 1.18.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.18.6.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.18.6.1 03-Aug-2004  skrll Sync with HEAD
 1.21.12.3 17-Mar-2008  yamt sync with head.
 1.21.12.2 03-Sep-2007  yamt sync with head.
 1.21.12.1 21-Jun-2006  yamt sync with head.
 1.23.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.25.10.1 03-Oct-2007  garbled Sync with HEAD
 1.25.4.1 11-Jul-2007  mjf Sync with head.
 1.25.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.25.2.1 15-Jul-2007  ad Sync with head.
 1.26.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.26.2.1 07-Aug-2007  matt Sync with HEAD.
 1.27.6.2 23-Mar-2008  matt sync with HEAD
 1.27.6.1 06-Nov-2007  matt sync with HEAD
 1.28.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.28.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.28.12.1 24-Mar-2008  keiichi sync with head.
 1.29.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.29.4.1 04-May-2009  yamt sync with head.
 1.30.6.1 05-Mar-2011  rmind sync with head
 1.31.22.1 18-May-2014  rmind sync with head
 1.31.18.2 03-Dec-2017  jdolecek update from HEAD
 1.31.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.31.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.32.2.1 10-Aug-2014  tls Rebase.
 1.34.4.2 28-Aug-2017  skrll Sync with HEAD
 1.34.4.1 09-Jul-2016  skrll Sync with HEAD
 1.36.8.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.26 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.25 28-Feb-2025  hans vax/ddb(4): fix disassembly of functions

On the VAX, functions normally begin with a 16bit entry mask
specifying which registers need to be saved on the stack by
the CALLS/CALLG instructions. The VAX disassembler tries to
take this into account, but the code didn't work as intended.
 1.24 24-Jul-2021  andvar branches: 1.24.10; 1.24.16;
Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
 1.23 29-Apr-2018  ragge branches: 1.23.18;
Fix bug causing small constants not to be printed out.
 1.22 22-May-2017  ragge branches: 1.22.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.21 26-Mar-2014  christos branches: 1.21.6;
fix printf issues
 1.20 02-Feb-2012  matt branches: 1.20.6; 1.20.10;
Deal with instruction with no arguments.
 1.19 18-Mar-2009  cegger branches: 1.19.12; 1.19.16;
bzero -> memset
 1.18 11-Mar-2008  matt branches: 1.18.4; 1.18.12; 1.18.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.17 21-Feb-2007  thorpej branches: 1.17.22; 1.17.38; 1.17.42;
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.16 11-Dec-2005  christos branches: 1.16.26;
merge ktrace-lwp.
 1.15 27-Jun-2005  ragge branches: 1.15.2;
Update according to cast-qual addition.
 1.14 31-May-2005  chs adapt to const changes.
 1.13 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 28-Jan-2001  ragge branches: 1.11.24;
Fix late "constifying" in ddb.
 1.10 13-Apr-1998  ragge branches: 1.10.14;
Wall cleaning.
 1.9 13-Oct-1996  christos backout previous kprintf change
 1.8 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.7 20-Jul-1996  ragge Bugfix causing erroneous address displaying.
 1.6 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.5 03-Mar-1996  ragge Fix include file ordering.
 1.4 02-Feb-1996  mycroft Fix #includes.
 1.3 28-Jan-1996  ragge DDB disassembly is fixed and now works good. Code written and
contributed to Ludd by Bertram Barth.
 1.2 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.1 05-Jul-1995  ragge branches: 1.1.2;
(some) support for DDB disassembly added.
 1.1.2.1 28-Oct-1995  ragge Copyright stuff.
 1.10.14.1 11-Feb-2001  bouyer Sync with HEAD.
 1.11.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.24.1 03-Aug-2004  skrll Sync with HEAD
 1.15.2.2 17-Mar-2008  yamt sync with head.
 1.15.2.1 26-Feb-2007  yamt sync with head.
 1.16.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.17.42.1 03-Apr-2008  mjf Sync with HEAD.
 1.17.38.1 24-Mar-2008  keiichi sync with head.
 1.17.22.1 23-Mar-2008  matt sync with HEAD
 1.18.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.18.4.1 04-May-2009  yamt sync with head.
 1.19.16.1 18-Feb-2012  mrg merge to -current.
 1.19.12.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.12.1 17-Apr-2012  yamt sync with head
 1.20.10.1 18-May-2014  rmind sync with head
 1.20.6.2 03-Dec-2017  jdolecek update from HEAD
 1.20.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.6.1 28-Aug-2017  skrll Sync with HEAD
 1.22.8.1 02-May-2018  pgoyette Synch with HEAD
 1.23.18.1 01-Aug-2021  thorpej Sync with HEAD.
 1.24.16.1 02-Aug-2025  perseant Sync with HEAD
 1.24.10.2 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.24.10.1 04-Mar-2025  martin Pull up following revision(s) (requested by hans in ticket #1072):

sys/arch/vax/vax/db_disasm.c: revision 1.25

vax/ddb(4): fix disassembly of functions

On the VAX, functions normally begin with a 16bit entry mask
specifying which registers need to be saved on the stack by
the CALLS/CALLG instructions. The VAX disassembler tries to
take this into account, but the code didn't work as intended.
 1.8 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.7 17-Feb-2009  christos branches: 1.7.22; 1.7.40;
Add INDEX_OPCODE()
 1.6 16-Feb-2009  christos - 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.5 11-Mar-2008  matt branches: 1.5.4; 1.5.12; 1.5.14; 1.5.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.4 11-Dec-2005  christos branches: 1.4.50; 1.4.70; 1.4.74;
merge ktrace-lwp.
 1.3 27-Jun-2005  ragge branches: 1.3.2;
Update according to cast-qual addition.
 1.2 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.1 28-Jan-1996  ragge branches: 1.1.64;
DDB disassembly is fixed and now works good. Code written and
contributed to Ludd by Bertram Barth.
 1.1.64.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.64.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.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.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.14.2 24-Feb-2009  snj Pull up following revision(s) (requested by mhitch in ticket #479):
sys/arch/vax/vax/db_disasm.h: revision 1.7
Add INDEX_OPCODE()
 1.5.14.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.5.12.1 03-Mar-2009  skrll Sync with HEAD.
 1.5.4.1 04-May-2009  yamt sync with head.
 1.7.40.1 28-Aug-2017  skrll Sync with HEAD
 1.7.22.1 03-Dec-2017  jdolecek update from HEAD
 1.61 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.60 26-Oct-2022  riastradh branches: 1.60.2; 1.60.8;
ddb/db_active.h: New home for extern db_active.

This can be included unconditionally, and db_active can then be
queried unconditionally; if DDB is not in the kernel, then db_active
is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
 1.59 23-Feb-2021  mrg introduce DDB_END_CMD and replace more than 20 copies of the same
list of NULLs and 0. idea from rillig@.

all touched ports built, several booted.
 1.58 03-Jul-2011  matt branches: 1.58.66;
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.57 14-Dec-2010  matt Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.56 01-Jul-2010  rmind Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour. Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
 1.55 09-Jun-2010  mrg document the acorn26, i386, ia64 and vax ddb commands in both the builtin
help and in ddb.4. fixes PR#38304, PR#38305, PR#38309 and PR#38313.
 1.54 26-Nov-2009  matt branches: 1.54.2; 1.54.4;
Kill proc0paddr. Use lwp0.l_addr instead.
 1.53 21-Nov-2009  rmind - Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.52 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.51 18-Mar-2009  cegger bcopy -> memcpy
 1.50 11-Mar-2008  matt branches: 1.50.4; 1.50.12; 1.50.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.49 03-Feb-2008  matt branches: 1.49.2; 1.49.6;
misc type cleanups
 1.48 17-Oct-2007  garbled branches: 1.48.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.47 22-Sep-2007  martin Add a new option DDB_VERBOSE_HELP that adds online help to ddb.
From Adam Hamsik.
Minor modifications by me, all bugs are probably mine.
 1.46 04-Mar-2007  christos branches: 1.46.2; 1.46.10; 1.46.18; 1.46.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.45 22-Feb-2007  dogcow miscellaneous fallout from the great boolean rototill.
 1.44 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.43 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.42 17-Feb-2007  dsl Pretend the ddb code has proclist_lock held to stop any deadlock.
 1.41 11-Dec-2005  christos branches: 1.41.26;
merge ktrace-lwp.
 1.40 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.39 27-Jun-2005  ragge branches: 1.39.2;
Update according to cast-qual addition.
 1.38 31-May-2005  chs adapt to const changes.
 1.37 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.36 15-Jul-2003  lukem __KERNEL_RCSID()
 1.35 20-Jan-2003  matt branches: 1.35.2;
Fix some SA lossage.
 1.34 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.33 13-May-2002  matt Nuke local extern label_t *db_recover; it's now in <ddb/db_extern.h>
 1.32 31-Mar-2002  matt In db_stack_dump, only symbolize pc if it's in the text segment.
 1.31 12-Jun-2001  ragge branches: 1.31.2; 1.31.8;
Make tracing of stack by frame argument work.
 1.30 06-Jun-2001  chs make this compile without MULTIPROCESSOR.
 1.29 04-Jun-2001  ragge Add rudimentary multiprocessor support for DDB.
 1.28 29-Apr-2001  matt Fix printing of stack traceback (last argument was always wrong). Use
%#x so that 0s are 0 and not 0x0
 1.27 12-Apr-2001  thorpej splimp -> splhigh
 1.26 18-Jan-2001  jdolecek branches: 1.26.2;
make db_[e]regs[] const
 1.25 31-Dec-2000  matt improv the stack trace by printing the fp at the start of each line and
noticing trap frames, and printing that information as well. For example
Stack traceback :
0x87ba2bc4: _arithflt+0x1a7(0x87ba2cac)
0x87ba2c50: trap type=0x8c code=0x8 pc=0x800008ef psl=0xc00000
0x87ba2c1c: _copystr+0x23(0x8095f378,0xa539f,0x86c0bd20)
 1.24 30-Dec-2000  matt Add a kludge that makes stack tracebacks work.
 1.23 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.22 04-Jun-2000  matt branches: 1.22.2;
More event counter stuff. Plus a little cruft cleanup while doing it.
 1.21 02-Jun-2000  matt use splsoftddb() instead of hardcoding the ipl.
 1.20 26-May-2000  ragge branches: 1.20.2;
Make it compile again.
 1.19 26-May-2000  jhawk Rename the machine-specific stack trace printing functions
from db_stack_trace_cmd() to db_stack_trace_print(),
and add an additional argument, a function pointer for an
output routine (i.e. printf() or db_printf()).

Add db_stack_trace_cmd() in db_command.[ch], calling
db_stack_trace_print() with db_printf() as the printer.

Move count==-1 special handling from db_stack_trace_print() [nee
db_stack_trace_cmd()] to db_stack_trace_cmd() [nascent here].

Again, I'm unable to test compilation on all affected platforms,
so advance apologies for potential brokenness.
 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 20-Jun-1999  ragge branches: 1.17.2;
Better support for tracing stacks. From Chuck McManis.
 1.16 12-Apr-1999  pk Quote "AS IS" as in the majority of Carnegy Mellon notices.
 1.15 06-Apr-1999  pk Fix a pasto in copyright text which has been procreating like rabbits..
 1.14 01-Jan-1999  ragge branches: 1.14.2;
A little better support for 'trace' command.
 1.13 20-Aug-1998  ragge Fix write/read of memory.
 1.12 04-Jul-1998  jonathan defopt DDB.
 1.11 07-Jun-1998  ragge DDB support on glass tty. Also smarter keyboard decoding.
 1.10 13-Apr-1998  ragge Wall cleaning.
 1.9 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.8 13-Oct-1996  christos backout previous kprintf change
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.6 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.5 17-Mar-1996  ragge Fix type clashes.
 1.4 03-Mar-1996  ragge Fix include file ordering.
 1.3 28-Jan-1996  ragge Handle DDB traps different when we get a panic.
It's more interesting to know the CPU state when panic was called
than in the Debugger() function.
 1.2 05-Jul-1995  ragge (some) support for DDB disassembly added.
 1.1 16-Jun-1995  ragge rudimentary DDB support.
 1.14.2.2 12-Apr-1999  pk branches: 1.14.2.2.2;
Pullup copyright text corrections.
 1.14.2.1 07-Apr-1999  pk Pull up from trunk: copyright text warts.
 1.14.2.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.2.4 21-Apr-2001  bouyer Sync with HEAD
 1.17.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.17.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.17.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.20.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.22.2.1 20-Mar-2001  he Pull up revisions 1.24-1.25 (requested by matt):
Make stack backtraces work. Prints FP at start of each line.
Notices and handles trap frames.
 1.26.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.31.8.5 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.31.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.31.8.3 17-Apr-2002  nathanw Catch up to -current.
 1.31.8.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.31.8.1 12-Jun-2001  ragge file db_machdep.c was added on branch nathanw_sa on 2002-03-29 23:22:45 +0000
 1.31.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.1 03-Aug-2004  skrll Sync with HEAD
 1.39.2.6 17-Mar-2008  yamt sync with head.
 1.39.2.5 04-Feb-2008  yamt sync with head.
 1.39.2.4 27-Oct-2007  yamt sync with head.
 1.39.2.3 03-Sep-2007  yamt sync with head.
 1.39.2.2 26-Feb-2007  yamt sync with head.
 1.39.2.1 21-Jun-2006  yamt sync with head.
 1.41.26.2 12-Mar-2007  rmind Sync with HEAD.
 1.41.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.46.20.2 23-Mar-2008  matt sync with HEAD
 1.46.20.1 06-Nov-2007  matt sync with HEAD
 1.46.18.1 02-Oct-2007  joerg Sync with HEAD.
 1.46.10.1 03-Oct-2007  garbled Sync with HEAD
 1.46.2.1 09-Oct-2007  ad Sync with head.
 1.48.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.49.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.49.2.1 24-Mar-2008  keiichi sync with head.
 1.50.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.50.4.3 11-Aug-2010  yamt sync with head.
 1.50.4.2 11-Mar-2010  yamt sync with head
 1.50.4.1 04-May-2009  yamt sync with head.
 1.54.4.2 05-Mar-2011  rmind sync with head
 1.54.4.1 03-Jul-2010  rmind sync with head
 1.54.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.58.66.1 03-Apr-2021  thorpej Sync with HEAD.
 1.60.8.1 02-Aug-2025  perseant Sync with HEAD
 1.60.2.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.54 03-Apr-2019  christos centralize setdisklabel(9)
 1.53 22-Jun-2012  abs branches: 1.53.40;
- Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number
 1.52 14-Dec-2010  matt branches: 1.52.8; 1.52.14;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.51 21-Nov-2009  rmind branches: 1.51.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.50 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.49 18-Mar-2009  cegger bcopy -> memcpy
 1.48 11-Mar-2008  matt branches: 1.48.4; 1.48.12; 1.48.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.47 22-Feb-2008  matt Fix panic in readdisksubr.c
 1.46 02-Jan-2008  ad branches: 1.46.2; 1.46.6;
Merge vmlocking2 to head.
 1.45 17-Oct-2007  garbled branches: 1.45.2; 1.45.4; 1.45.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.44 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.43 25-Apr-2007  matt branches: 1.43.2; 1.43.10; 1.43.12; 1.43.14;
Make this compile again if COMPAT_ULTRIX is enabled.
 1.42 04-Mar-2007  christos branches: 1.42.2; 1.42.4;
Fix caddr_t fallout.
 1.41 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.40 25-Nov-2006  scw branches: 1.40.4;
Replace the myriad copies of bounds_check_with_label() with a single MI
version.

Add disk_blocksize(9) so that disk drivers can record the physical
block size of a disk if it is different to DEV_BSIZE. Right now this
simply initialises dk_blkshift and dk_byteshift according to the
supplied block size. This information is used in the MI version of
bounds_check_with_label().
 1.39 11-Dec-2005  christos branches: 1.39.20; 1.39.22;
merge ktrace-lwp.
 1.38 27-Jun-2005  ragge branches: 1.38.2;
Update according to cast-qual addition.
 1.37 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.36 15-Jul-2003  lukem __KERNEL_RCSID()
 1.35 12-May-2003  thorpej branches: 1.35.2;
Include <sys/disk.h>.
 1.34 10-May-2003  thorpej Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.33 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.32 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.31 10-Jun-2002  ragge Support for reading Ultrix disklabels. From the pmax port, fixed and tested
by Valeriy E. Ushakov.
 1.30 05-Mar-2002  simonb branches: 1.30.6;
Don't cast argument to ffs() to long.
Per discussion on port-alpha, noticed by Robert Elz.
 1.29 19-Feb-2002  wiz strategy should have an 'r'. Inspired by similar change in OpenBSD.
 1.28 20-Nov-2000  chs branches: 1.28.2; 1.28.4; 1.28.8;
rationalize the use of b_flags for geteblk() buffers.
rather than assigning to the whole field, set or clear individual flags,
which implies that the B_BUSY and B_INVAL flags will remain set.
this allows us to make the assertion in brelse() that B_BUSY is set,
which is the purpose of all this.
 1.27 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.26 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.25 04-Jun-2000  ragge Remove some unneeded code. (and cleanup).
 1.24 19-May-2000  thorpej branches: 1.24.2;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.23 30-Mar-2000  tsutsui Remove register declarations.
 1.22 18-Jan-2000  thorpej Use b_cylinder as defined in sys/buf.h
 1.21 30-Jun-1999  ragge branches: 1.21.2; 1.21.8;
MSCP moved.
 1.20 24-Mar-1999  mrg branches: 1.20.4;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.19 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.18 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.17 05-Nov-1998  ragge EGCS fixes.
 1.16 02-Mar-1998  ragge Support for UVM on VAXen.
 1.15 18-Jan-1998  ragge Make kernel compile & run again after latest config changes.
 1.14 03-Jan-1998  thorpej Grab the PCB directly from the u-area, not by indirecting through VM
structures.
 1.13 06-Jul-1997  ragge Remove __VM_PMAP_HACK.
 1.12 07-Jun-1997  ragge Clean up disklabel checking.
 1.11 11-Jan-1997  ragge Put common map in code here instead of lots of places.
 1.10 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.9 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 28-Jan-1996  ragge Take away unneccessary code from i386? port.
 1.6 08-May-1995  ragge Typo
 1.5 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.4 25-Nov-1994  ragge Lots of fixes and updates.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 14-Oct-1994  cgd move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS.
 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 disksubr.c was added on branch netbsd-1-0 on 1994-08-02 20:21:52 +0000
 1.20.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.21.8.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.21.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.21.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.24.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.28.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.28.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.28.8.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.28.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.28.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.28.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.28.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.30.6.1 15-Jul-2002  gehenna catch up with -current.
 1.35.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.1 03-Aug-2004  skrll Sync with HEAD
 1.38.2.6 17-Mar-2008  yamt sync with head.
 1.38.2.5 27-Feb-2008  yamt sync with head.
 1.38.2.4 21-Jan-2008  yamt sync with head
 1.38.2.3 27-Oct-2007  yamt sync with head.
 1.38.2.2 03-Sep-2007  yamt sync with head.
 1.38.2.1 30-Dec-2006  yamt sync with head.
 1.39.22.1 10-Dec-2006  yamt sync with head.
 1.39.20.1 12-Jan-2007  ad Sync with head.
 1.40.4.2 07-May-2007  yamt sync with head.
 1.40.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.42.4.1 11-Jul-2007  mjf Sync with head.
 1.42.2.2 09-Oct-2007  ad Sync with head.
 1.42.2.1 27-May-2007  ad Sync with head.
 1.43.14.1 14-Oct-2007  yamt sync with head.
 1.43.12.3 23-Mar-2008  matt sync with HEAD
 1.43.12.2 09-Jan-2008  matt sync with HEAD
 1.43.12.1 06-Nov-2007  matt sync with HEAD
 1.43.10.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.43.2.1 16-Oct-2007  garbled Sync with HEAD
 1.45.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.45.4.1 31-Dec-2007  ad Make compile with new buffer cache locking scheme.

XXX This should be largely MI, please do not make another clone of disksubr.c.
 1.45.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.46.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.46.2.1 24-Mar-2008  keiichi sync with head.
 1.48.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.48.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.48.4.2 11-Mar-2010  yamt sync with head
 1.48.4.1 04-May-2009  yamt sync with head.
 1.51.4.1 05-Mar-2011  rmind sync with head
 1.52.14.1 04-Jul-2012  jdc Pull up revisions:
src/etc/etc.vax/MAKEDEV.conf revision 1.14
src/sys/arch/vax/conf/GENERIC revision 1.182
src/sys/arch/vax/conf/INSTALL revision 1.60
src/sys/arch/vax/conf/VAX780 revision 1.9
src/sys/arch/vax/conf/majors.vax revision 1.24
src/sys/arch/vax/vax/disksubr.c revision 1.53
src/sys/dev/DEVNAMES revision 1.275
src/sys/dev/mscp/files.mscp revision 1.8
src/sys/dev/mscp/mscp_disk.c revision 1.72
src/sys/dev/mscp/mscp_subr.c revision 1.42
src/distrib/vax/ramdisk/Makefile revision 1.29
(requested by abs in ticket #385).

- Add racd* devices for MSCP based CD-ROM drives (RRD40s), as opposed
to mixing them in with the ra* disks, modelled loosely on how MSCP
rx* floppies are handled
- racd* defaults to the same single iso9660 partition as cd*
- Cleanup config option handling slightly so any combination of ra*,
rx* (and now raccd*) can be defined without build errors.
- Avoid ugly printf when disks have all zero disklabel magic number

Include racd0 and racd1 on ramdisk
 1.52.8.1 30-Oct-2012  yamt sync with head
 1.53.40.1 10-Jun-2019  christos 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-Apr-2002  ragge branches: 1.1.6; 1.1.8; 1.1.14;
Add dkbad, from 4.4.
 1.1.14.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.14.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.14.1 03-Aug-2004  skrll Sync with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 21-Apr-2002  jdolecek file dkbad.c was added on branch kqueue on 2002-06-23 17:43:06 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 21-Apr-2002  nathanw file dkbad.c was added on branch nathanw_sa on 2002-06-20 03:42:20 +0000
 1.7 17-May-1998  ragge Not used anymore when now using the dz11 driver.
 1.6 21-Mar-1998  mycroft Eliminate uses of TS_WOPEN in hard-wired devices.
 1.5 22-Mar-1997  ragge Clean up DZ console routines. Use memory size from boot (if provided).
 1.4 15-Mar-1997  ragge Clean up console autoconfiguration so that the VAXstation DZ11-like
console work.
 1.3 26-Feb-1997  ragge Patches to make VS2000 to work. From Ari Suutari.
 1.2 02-Sep-1996  mycroft branches: 1.2.6;
tty stop functions really should return void, not int, and certainly not both.
 1.1 20-Jul-1996  ragge VAXstation CPU and serial console support.
 1.2.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 30-Nov-2003  ragge Bugfixes for emulated instructions MOVTC and MOVTUC, from Bertram Barth:

> - condition-codes should be set from (unmodified) srclen vs. dstlen
> instead from the modified (register-) values after completion.
>
> - for MOVTUC the V-bit should be set if the esc-char was found.
>
> - the arguments for comparison should be reversed.
>
> - count is unsigned word, but for condition-codes the comparison
> should be done with signed words (ie. N = srclen LSS dstlen)
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 24-Feb-2002  matt branches: 1.2.2; 1.2.8; 1.2.20;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.2.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.20.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.8.1 24-Feb-2002  jdolecek file emulate.S was added on branch kqueue on 2002-03-16 16:00:15 +0000
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 24-Feb-2002  nathanw file emulate.S was added on branch nathanw_sa on 2002-02-28 04:12:30 +0000
 1.4 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.3 17-Jul-2000  matt branches: 1.3.4; 1.3.8;
Changes so that the kernel can be compiled under __ELF__.
 1.2 15-Mar-1997  ragge branches: 1.2.22;
Put in some #ifdef's to compile only for MV2000.
 1.1 24-Feb-1995  ragge *** empty log message ***
 1.2.22.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.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 16-Mar-2002  jdolecek Catch up with -current.
 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;
dependent not dependend
 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 06-Sep-2006  matt branches: 1.17.32; 1.17.52; 1.17.56;
Don't include <sys/device.c> unless this is a _KERNEL
 1.16 24-Dec-2005  perry branches: 1.16.4; 1.16.8;
bare asm -> __asm
 1.15 11-Dec-2005  christos merge ktrace-lwp.
 1.14 28-Mar-2004  ragge branches: 1.14.16;
Add 11/730 to recognized cpu-types.
 1.13 18-Oct-2003  ragge Read out confdata for the VS4000/90 also.
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 01-May-2001  ragge branches: 1.11.8; 1.11.24;
Support for MicroVAX 1.
 1.10 24-Apr-2001  ragge Support for KA681 (4000/500A) from Michael Kukat.
 1.9 26-Jul-2000  ragge branches: 1.9.2;
Discover the KA88 cpu.
 1.8 22-May-2000  matt make the declaration of findcpu() ansi. (e.g add void to it).
 1.7 08-May-2000  ragge VAX 4000/200 support. From Michael Kukat.
 1.6 11-Dec-1999  ragge Detect "Infoserver 1000" also.
 1.5 23-Aug-1999  ragge branches: 1.5.2; 1.5.8;
Don't reference a unexisting address on 4000/90.
 1.4 19-Aug-1999  ragge Detect NVAX also.
 1.3 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.2 23-May-1999  ragge branches: 1.2.2;
Better and more understandable way to find out CPU type.
 1.1 23-May-1999  ragge Routine to figure out which system type is booted.
 1.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.8.1 27-Dec-1999  wrstuden Pull up to last week's -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.9.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.24.1 03-Aug-2004  skrll Sync with HEAD
 1.11.8.2 01-May-2001  ragge Support for MicroVAX 1.
 1.11.8.1 01-May-2001  ragge file findcpu.c was added on branch nathanw_sa on 2001-05-01 13:18:28 +0000
 1.14.16.3 17-Mar-2008  yamt sync with head.
 1.14.16.2 30-Dec-2006  yamt sync with head.
 1.14.16.1 21-Jun-2006  yamt sync with head.
 1.16.8.1 14-Sep-2006  yamt sync with head.
 1.16.4.1 09-Sep-2006  rpaulo sync with head
 1.17.56.1 03-Apr-2008  mjf Sync with HEAD.
 1.17.52.1 24-Mar-2008  keiichi sync with head.
 1.17.32.1 23-Mar-2008  matt 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.55 20-Feb-2020  skrll G/C
 1.54 08-Jan-2020  ad Hopefully fix some problems seen with MP support on non-x86, in particular
where curcpu() is defined as curlwp->l_cpu:

- mi_switch(): undo the ~2007ish optimisation to unlock curlwp before
calling cpu_switchto(). It's not safe to let other actors mess with the
LWP (in particular l->l_cpu) while it's still context switching. This
removes l->l_ctxswtch.

- Move the LP_RUNNING flag into l->l_flag and rename to LW_RUNNING since
it's now covered by the LWP's lock.

- Ditch lwp_exit_switchaway() and just call mi_switch() instead. Everything
is in cache anyway so it wasn't buying much by trying to avoid saving old
state. This means cpu_switchto() will never be called with prevlwp ==
NULL.

- Remove some KERNEL_LOCK handling which hasn't been needed for years.
 1.53 25-Apr-2018  ragge branches: 1.53.2; 1.53.8;
Extract M_DATA, M_LEN, M_NEXT.
 1.52 22-May-2017  ragge branches: 1.52.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.51 02-Feb-2012  matt branches: 1.51.6; 1.51.24;
In the syscall vector, deal with SYS_lwp_getprivate quickly. XXX what about
non-NetBSD syscall tables.
 1.50 14-Apr-2011  matt branches: 1.50.4; 1.50.8;
Add L_PRIVATE
 1.49 11-Apr-2011  rmind G/C unused MUTEX_COUNT_BIAS (it was for VAX)
 1.48 20-Dec-2010  matt branches: 1.48.2;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.47 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.46 12-May-2010  matt Add PSL_HIGHIPL for recent subr.S change
 1.45 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.44 10-Dec-2009  rmind branches: 1.44.2; 1.44.4;
Rename L_ADDR to L_PCB and amend some comments accordingly.
 1.43 04-Jun-2008  ad Remove ref to uvm.page_idle_zero
 1.42 23-Feb-2008  matt branches: 1.42.2; 1.42.4; 1.42.6;
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.41 22-Feb-2008  matt Switch NetBSD/vax to the CAS model of mutexes. Fix the locking primitives
in lock_stubs.S so they actually function correctly.
 1.40 21-Feb-2008  matt branches: 1.40.2; 1.40.6;
More softint fixes. We need to restore the softint lwp's pcb to it's initial
state since it may have been blocked or interrupted by another softint.
 1.39 20-Feb-2008  matt Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.38 13-Feb-2008  matt Add IPL_VM
 1.37 03-Feb-2008  matt No need for RW_OWNER/RW_LOCK anymore
 1.36 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.35 22-Nov-2007  yamt fix changes which i forgot to commit with sys/arch/vax/include/mutex.h rev.1.9.
 1.34 17-Oct-2007  garbled branches: 1.34.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.33 17-May-2007  yamt branches: 1.33.8; 1.33.10; 1.33.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.32 12-Mar-2007  matt branches: 1.32.2; 1.32.8;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.31 17-Feb-2007  matt branches: 1.31.2; 1.31.6;
Add an implementation for krwlock_t. Initialize ci_mtx_count to 1 (biased).
Fix a few buglets in the kmutex_t implementation.
 1.30 16-Feb-2007  matt Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.29 12-Mar-2006  christos welcome to syscall_intern.
 1.28 11-Dec-2005  christos branches: 1.28.4; 1.28.6; 1.28.8; 1.28.10;
merge ktrace-lwp.
 1.27 29-Sep-2003  matt branches: 1.27.16;
Add SA_SIGINFO support for VAX.
 1.26 19-Jan-2003  ragge branches: 1.26.2;
Add some instrumentation and clean up some VAX8600 code.
From Johnny Billquist.
 1.25 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.24 26-Jul-2000  ragge branches: 1.24.8;
Support for a machine-specific badaddr handler.
 1.23 02-Jul-2000  cgd Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.
 1.22 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.21 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.20 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.19 02-Jun-2000  matt Add IPL_* codes.
Add other codes for struct references.
Add softintr framework for IPL_SOFTNET and IPL_SOFTSERIAL.
General cleanup of .s files replacing hardcoded structure offsets with
symbolic ones.
 1.18 31-May-2000  thorpej In the MULTIPROCESSOR case, initialize p_cpu before a process is
marked SONPROC.
 1.17 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.16 27-May-2000  ragge Remove the pcbtrap global variable, use a per-CPU variable instead.
 1.15 26-May-2000  thorpej branches: 1.15.2;
Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor. Test against SONPROC as appropriate rather than
combinations of SRUN and curproc. Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
 1.14 09-May-2000  ragge Change copy*str() functions. More paranoid checking of legal address space.
Fixes PR#7838.
 1.13 01-May-2000  ragge Call uvm_pageidlezero() in idle loop.
 1.12 22-Apr-2000  ragge Forgot a protection #define.
Make use of raise-spl.
 1.11 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.10 19-Nov-1999  ragge Get symbol "NETISR_IPV6". This fixes PR#8790, but in a different way.
 1.9 09-Mar-1999  ragge branches: 1.9.6; 1.9.8; 1.9.14;
Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.8 30-Sep-1998  ragge Make kernel compile after recent signal changes.
 1.7 31-Aug-1998  ragge Support for all 4 console lines on KA820. Support for this written
by Sergey Svishchev (svs@ropnet.ru).
 1.6 11-Aug-1998  ragge Cache and microsecond clock resolution on KA46.
 1.5 03-May-1998  ragge Enable -Wall -Wmissing-prototypes -Wstrict-prototypes.
 1.4 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.3 04-Nov-1997  ragge Move some interrupt routines out to assembler.
Optimize (slightly) pmap_clear_modify.
 1.2 04-Nov-1997  ragge Optimized copy/fetch/store routines; rewritten in assembler.
 1.1 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.9.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 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.9.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.15.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.24.8.3 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.24.8.2 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.24.8.1 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 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.27.16.6 27-Feb-2008  yamt sync with head.
 1.27.16.5 04-Feb-2008  yamt sync with head.
 1.27.16.4 07-Dec-2007  yamt sync with head
 1.27.16.3 03-Sep-2007  yamt sync with head.
 1.27.16.2 26-Feb-2007  yamt sync with head.
 1.27.16.1 21-Jun-2006  yamt sync with head.
 1.28.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.28.8.1 13-Mar-2006  yamt sync with head.
 1.28.6.1 22-Apr-2006  simonb Sync with head.
 1.28.4.1 09-Sep-2006  rpaulo sync with head
 1.31.6.3 03-Dec-2007  ad Sync with HEAD.
 1.31.6.2 27-May-2007  ad Sync with head.
 1.31.6.1 13-Mar-2007  ad Sync with head.
 1.31.2.4 07-Apr-2007  matt Remove ci_exit, remove idlepcb and exitstack.
 1.31.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.31.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.31.2.1 17-Feb-2007  rmind file genassym.cf was added on branch yamt-idlelwp on 2007-03-12 05:51:16 +0000
 1.32.8.1 22-May-2007  matt Update to HEAD.
 1.32.2.1 11-Jul-2007  mjf Sync with head.
 1.33.14.1 22-Nov-2007  bouyer Sync with HEAD
 1.33.10.3 23-Mar-2008  matt sync with HEAD
 1.33.10.2 09-Jan-2008  matt sync with HEAD
 1.33.10.1 06-Nov-2007  matt sync with HEAD
 1.33.8.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.33.8.1 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.34.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.34.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.40.6.3 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.40.6.2 03-Apr-2008  mjf Sync with HEAD.
 1.40.6.1 21-Feb-2008  mjf file genassym.cf was added on branch mjf-devfs2 on 2008-04-03 12:42:28 +0000
 1.40.2.1 24-Mar-2008  keiichi sync with head.
 1.42.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.42.4.3 11-Aug-2010  yamt sync with head.
 1.42.4.2 11-Mar-2010  yamt sync with head
 1.42.4.1 04-May-2009  yamt sync with head.
 1.42.2.1 17-Jun-2008  yamt sync with head.
 1.44.4.3 21-Apr-2011  rmind sync with head
 1.44.4.2 05-Mar-2011  rmind sync with head
 1.44.4.1 30-May-2010  rmind sync with head
 1.44.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.44.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.48.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.50.8.1 18-Feb-2012  mrg merge to -current.
 1.50.4.1 17-Apr-2012  yamt sync with head
 1.51.24.1 28-Aug-2017  skrll Sync with HEAD
 1.51.6.1 03-Dec-2017  jdolecek update from HEAD
 1.52.8.1 02-May-2018  pgoyette Synch with HEAD
 1.53.8.2 29-Feb-2020  ad Sync with head.
 1.53.8.1 17-Jan-2020  ad Sync with head.
 1.53.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.56 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.55 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.54 25-Jul-2014  dholland branches: 1.54.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.53 16-Mar-2014  dholland branches: 1.53.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.52 24-Apr-2011  rmind branches: 1.52.4; 1.52.14; 1.52.18;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.51 14-Dec-2010  matt branches: 1.51.2;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.50 02-Apr-2009  tsutsui branches: 1.50.4;
Don't use relative path from <machine> in #include.
It won't work for symlinks.
 1.49 11-Mar-2008  matt branches: 1.49.4; 1.49.12; 1.49.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.48 19-Nov-2007  ad branches: 1.48.10; 1.48.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.47 04-Mar-2007  christos branches: 1.47.2; 1.47.18; 1.47.20; 1.47.24; 1.47.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.46 16-Feb-2007  matt branches: 1.46.2;
Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.45 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!

Also, add forgotten splx() calls in some places.
 1.44 23-Jul-2006  ad branches: 1.44.4; 1.44.6;
Use the LWP cached credentials where sane.
 1.43 14-May-2006  elad integrate kauth.
 1.42 11-Dec-2005  christos branches: 1.42.4; 1.42.6; 1.42.8; 1.42.10; 1.42.12;
merge ktrace-lwp.
 1.41 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.40 15-Jul-2003  lukem branches: 1.40.16;
__KERNEL_RCSID()
 1.39 23-Oct-2002  jdolecek branches: 1.39.6;
merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.38 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.37 04-Jun-2002  ragge Do not disable interrupts until output queue is drained.
 1.36 17-Mar-2002  atatat branches: 1.36.4; 1.36.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.35 12-Jun-2001  ragge branches: 1.35.2; 1.35.4; 1.35.8;
Fix problem where console interrupts never got enabled after RB_ASKNAME.
 1.34 03-Jun-2001  ragge A bunch of fixes:
- Make generic console routines not relying on running on master cpu.
- Add routine to start console transmitter (after IPI).
- Use real IPIs instead of the "console doorbell".
- Add routines cpu_send_ipi()/cpu_handle_ipi().
 1.33 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.32 02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.31 01-May-2001  ragge Support for MicroVAX 1.
 1.30 24-Apr-2001  ragge Support for KA681 (4000/500A) from Michael Kukat.
 1.29 28-Jan-2001  ragge branches: 1.29.2;
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.28 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.27 26-Jul-2000  ragge Oops, forgot a debug return.
 1.26 26-Jul-2000  ragge KA88 console support.
 1.25 06-Jul-2000  ragge Recognise VAX 6000/400.
 1.24 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.23 08-May-2000  ragge branches: 1.23.2;
VAX 4000/200 support. From Michael Kukat.
 1.22 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.21 06-Jun-1999  ragge branches: 1.21.2;
Complete support for VAX 4000/300. From Michael Kukat. (michael@camaronet.de)
 1.20 19-Jan-1999  ragge branches: 1.20.4;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.19 31-Aug-1998  ragge Support for all 4 console lines on KA820. Support for this written
by Sergey Svishchev (svs@ropnet.ru).
 1.18 04-Jul-1998  jonathan defopt DDB.
 1.17 08-Jun-1998  ragge Wall fixes.
 1.16 13-Apr-1998  ragge Wall cleaning.
 1.15 21-Mar-1998  mycroft Eliminate uses of TS_WOPEN in hard-wired devices.
 1.14 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.13 15-Mar-1997  ragge Clean up console autoconfiguration so that the VAXstation DZ11-like
console work.
 1.12 26-Feb-1997  ragge Patches to make VS2000 to work. From Ari Suutari.
 1.11 02-Sep-1996  mycroft branches: 1.11.6;
tty stop functions really should return void, not int, and certainly not both.
 1.10 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.9 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.8 02-Feb-1996  mycroft Fix #includes.
 1.7 28-Jan-1996  ragge Fix bug causing ^[ to be sent when returning from DDB.
 1.6 21-Aug-1995  ragge Added gencntty();
 1.5 16-Jun-1995  ragge rudimentary DDB support.
 1.4 03-May-1995  ragge Changed conf.c to new style. Took away double saving of regs in traps.
Changed boot() to use vfs_shutdown(). Updated setregs.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.1 16-Aug-1994  ragge branches: 1.1.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1.2.1 16-Aug-1994  ragge file gencons.c was added on branch netbsd-1-0 on 1994-08-16 23:47:27 +0000
 1.11.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.20.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.21.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.21.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.21.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.23.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.29.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.35.8.5 11-Nov-2002  nathanw Catch up to -current
 1.35.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.35.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.35.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.35.8.1 12-Jun-2001  nathanw file gencons.c was added on branch nathanw_sa on 2002-04-01 07:43:31 +0000
 1.35.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.35.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.35.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.35.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.36.6.1 05-Jun-2002  lukem Pull up revision 1.37 (requested by ragge in ticket #159):
Do not disable interrupts until output queue is drained.
 1.36.4.2 15-Jul-2002  gehenna catch up with -current.
 1.36.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.39.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.39.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.39.6.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.39.6.1 03-Aug-2004  skrll Sync with HEAD
 1.40.16.6 17-Mar-2008  yamt sync with head.
 1.40.16.5 07-Dec-2007  yamt sync with head
 1.40.16.4 03-Sep-2007  yamt sync with head.
 1.40.16.3 26-Feb-2007  yamt sync with head.
 1.40.16.2 30-Dec-2006  yamt sync with head.
 1.40.16.1 21-Jun-2006  yamt sync with head.
 1.42.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.42.10.3 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.42.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.42.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.42.8.2 11-Aug-2006  yamt sync with head
 1.42.8.1 24-May-2006  yamt sync with head.
 1.42.6.1 01-Jun-2006  kardel Sync with head.
 1.42.4.1 09-Sep-2006  rpaulo sync with head
 1.44.6.1 22-Oct-2006  yamt sync with head
 1.44.4.1 18-Nov-2006  ad Sync with head.
 1.46.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.47.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.47.24.1 21-Nov-2007  bouyer Sync with HEAD
 1.47.20.2 23-Mar-2008  matt sync with HEAD
 1.47.20.1 09-Jan-2008  matt sync with HEAD
 1.47.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.47.2.1 03-Dec-2007  ad Sync with HEAD.
 1.48.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.48.10.1 24-Mar-2008  keiichi sync with head.
 1.49.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.49.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.49.4.1 04-May-2009  yamt sync with head.
 1.50.4.2 31-May-2011  rmind sync with head
 1.50.4.1 05-Mar-2011  rmind sync with head
 1.51.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.52.18.1 18-May-2014  rmind sync with head
 1.52.14.2 03-Dec-2017  jdolecek update from HEAD
 1.52.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.52.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.53.2.1 10-Aug-2014  tls Rebase.
 1.54.4.2 28-Aug-2017  skrll Sync with HEAD
 1.54.4.1 09-Jul-2016  skrll Sync with HEAD
 1.11 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.10 03-Jun-2001  ragge branches: 1.10.8; 1.10.174; 1.10.194;
A bunch of fixes:
- Make generic console routines not relying on running on master cpu.
- Add routine to start console transmitter (after IPI).
- Use real IPIs instead of the "console doorbell".
- Add routines cpu_send_ipi()/cpu_handle_ipi().
 1.9 20-Jan-2000  matt branches: 1.9.6;
Don't need to include opt_vax8600.h. Always defined the 8600 specific bits.
 1.8 17-Jan-2000  matt defopt VAXnnn so the make depend does the right thing.
 1.7 19-Jan-1999  ragge branches: 1.7.8;
Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.6 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.5 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.4 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.3 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.2 25-Nov-1994  ragge *** empty log message ***
 1.1 25-Nov-1994  ragge Definitions for console & console media.
 1.7.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.9.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.194.1 28-Aug-2017  skrll Sync with HEAD
 1.10.174.1 03-Dec-2017  jdolecek update from HEAD
 1.10.8.2 03-Jun-2001  ragge A bunch of fixes:
- Make generic console routines not relying on running on master cpu.
- Add routine to start console transmitter (after IPI).
- Use real IPIs instead of the "console doorbell".
- Add routines cpu_send_ipi()/cpu_handle_ipi().
 1.10.8.1 03-Jun-2001  ragge file gencons.h was added on branch nathanw_sa on 2001-06-03 15:07:21 +0000
 1.3 13-Feb-1995  mycroft Clean up deleted files.
 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 glue.c was added on branch netbsd-1-0 on 1994-08-02 20:21:54 +0000
 1.14 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.13 14-Dec-2010  matt branches: 1.13.58; 1.13.60;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.12 10-Dec-2009  matt branches: 1.12.4;
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 21-Nov-2009  rmind - Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.10 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9 03-Feb-2008  matt branches: 1.9.6; 1.9.8; 1.9.10;
sysmachine uses lwp now.
 1.8 11-Dec-2005  christos branches: 1.8.50; 1.8.56;
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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 18-Jan-2003  thorpej branches: 1.4.2;
Merge the nathanw_sa branch.
 1.3 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.2 31-Mar-2002  christos branches: 1.2.2;
compat signal array renaming.
 1.1 10-Jan-2000  matt branches: 1.1.6; 1.1.10; 1.1.14;
Add ibcs2 machine dependent file for VAX.
 1.1.14.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.14.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.14.1 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.1.10.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.10.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 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 10-Jan-2000  bouyer file ibcs2_machdep.c was added on branch thorpej_scsipi on 2000-11-20 20:33:17 +0000
 1.2.2.1 17-Jul-2002  gehenna catch up with -current.
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 04-Feb-2008  yamt sync with head.
 1.8.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.8.50.1 23-Mar-2008  matt sync with HEAD
 1.9.10.2 11-Mar-2010  yamt sync with head
 1.9.10.1 16-May-2008  yamt sync with head.
 1.9.8.1 18-May-2008  yamt sync with head.
 1.9.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.13.60.1 10-Jun-2019  christos Sync with HEAD
 1.13.58.1 18-Jan-2019  pgoyette Synch with HEAD
 1.16 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.15 04-Mar-2007  christos branches: 1.15.20; 1.15.36; 1.15.40;
Fix caddr_t fallout.
 1.14 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 11-Dec-2005  christos branches: 1.13.26;
merge ktrace-lwp.
 1.12 15-Jul-2003  lukem branches: 1.12.16;
__KERNEL_RCSID()
 1.11 01-Jan-2003  thorpej branches: 1.11.2;
Use aprint_normal() for cfprint routines.
 1.10 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.9 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.8 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.7 04-Feb-2001  ragge branches: 1.7.4; 1.7.8;
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.6 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.5 04-Jun-2000  ragge Changes to sbi_attach_args. (and some cleanup)
 1.4 12-Feb-2000  ragge branches: 1.4.2;
Remove another unneccessary reference to cf_unit.
 1.3 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.2 14-Aug-1999  ragge branches: 1.2.2;
Search for LANCE.
 1.1 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.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 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.4.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.8.2 03-Jan-2003  thorpej Sync with HEAD.
 1.7.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.7.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.11.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.16.2 17-Mar-2008  yamt sync with head.
 1.12.16.1 03-Sep-2007  yamt sync with head.
 1.13.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.15.36.1 24-Mar-2008  keiichi sync with head.
 1.15.20.1 23-Mar-2008  matt sync with HEAD
 1.13 27-Apr-2018  ragge Remove the old unneccessary cksum files.
 1.12 11-Mar-2008  matt branches: 1.12.90;
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.11 31-Dec-2006  ragge branches: 1.11.24; 1.11.40; 1.11.44;
GCC constraints error for inline assembler, causing in_cksum to calculate
the checksum wrong in the non-optimized case. Fix provided in PR#14614
by Rhialto, so this solves this PR.
 1.10 24-Dec-2005  perry branches: 1.10.20; 1.10.24;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 29-Sep-2003  matt branches: 1.8.16;
Fix GCC3'ism's
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 15-Jul-2003  lukem __KERNEL_RCSID()
 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 19-May-2001  matt branches: 1.4.2; 1.4.8;
Move the diagnostic tests with the if.
 1.3 19-May-2001  matt Don't compute psuedo header checksum if nxt == 0.
 1.2 28-Apr-2001  ragge Fix a bug so that MD-optimized in4_cksum() now works.
While here; rewrite header checksum calculation in assembler.
 1.1 07-Jun-2000  matt branches: 1.1.4; 1.1.6; 1.1.8;
Slight stylistic changes. Add KAME checksum routine.
 1.1.8.1 21-Jun-2001  nathanw Catch up to -current.
 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 07-Jun-2000  bouyer file in4_cksum.c was added on branch thorpej_scsipi on 2000-11-20 20:33:18 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 07-Jun-2000  minoura file in4_cksum.c was added on branch minoura-xpg4dl on 2000-06-22 17:05:22 +0000
 1.4.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.8.1 19-May-2001  nathanw file in4_cksum.c was added on branch nathanw_sa on 2002-02-28 04:12:31 +0000
 1.4.2.1 16-Mar-2002  jdolecek Catch up 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.8.16.3 17-Mar-2008  yamt sync with head.
 1.8.16.2 26-Feb-2007  yamt sync with head.
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.10.24.1 04-Jan-2007  bouyer Pull up following revision(s) (requested by ragge in ticket #321):
sys/arch/vax/vax/in4_cksum.c: revision 1.11
sys/arch/vax/vax/in_cksum.c: revision 1.10
GCC constraints error for inline assembler, causing in_cksum to calculate
the checksum wrong in the non-optimized case. Fix provided in PR#14614
by Rhialto, so this solves this PR.
 1.10.20.1 12-Jan-2007  ad Sync with head.
 1.11.44.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.40.1 24-Mar-2008  keiichi sync with head.
 1.11.24.1 23-Mar-2008  matt sync with HEAD
 1.12.90.1 02-May-2018  pgoyette Synch with HEAD
 1.12 27-Apr-2018  ragge Remove the old unneccessary cksum files.
 1.11 11-Mar-2008  matt branches: 1.11.90;
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.10 31-Dec-2006  ragge branches: 1.10.24; 1.10.40; 1.10.44;
GCC constraints error for inline assembler, causing in_cksum to calculate
the checksum wrong in the non-optimized case. Fix provided in PR#14614
by Rhialto, so this solves this PR.
 1.9 24-Dec-2005  perry branches: 1.9.20; 1.9.24;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 15-Jul-2003  lukem __KERNEL_RCSID()
 1.5 07-Jun-2000  matt branches: 1.5.26;
Slight stylistic changes. Add KAME checksum routine.
 1.4 13-Oct-1996  christos branches: 1.4.28; 1.4.36;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.1 02-Apr-1996  ragge CVS trouble.
 1.4.36.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.28.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.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.26.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.3 17-Mar-2008  yamt sync with head.
 1.7.16.2 26-Feb-2007  yamt sync with head.
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.9.24.1 04-Jan-2007  bouyer Pull up following revision(s) (requested by ragge in ticket #321):
sys/arch/vax/vax/in4_cksum.c: revision 1.11
sys/arch/vax/vax/in_cksum.c: revision 1.10
GCC constraints error for inline assembler, causing in_cksum to calculate
the checksum wrong in the non-optimized case. Fix provided in PR#14614
by Rhialto, so this solves this PR.
 1.9.20.1 12-Jan-2007  ad Sync with head.
 1.10.44.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.40.1 24-Mar-2008  keiichi sync with head.
 1.10.24.1 23-Mar-2008  matt sync with HEAD
 1.11.90.1 02-May-2018  pgoyette Synch with HEAD
 1.23 02-Sep-2022  thorpej Remove unnecessary inclusion of <net/netisr.h>.
 1.22 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.21 02-Feb-2012  matt branches: 1.21.6; 1.21.24;
In the syscall vector, deal with SYS_lwp_getprivate quickly. XXX what about
non-NetBSD syscall tables.
 1.20 12-Apr-2011  matt branches: 1.20.4; 1.20.8;
Add a CHMU handler to implement __lwp_getprivate_fast.
 1.19 20-Dec-2010  matt branches: 1.19.2;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.18 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.17 05-Mar-2009  msaitoh branches: 1.17.2; 1.17.4;
Fix typo(s/interupt/interrupt/)
 1.16 23-Feb-2008  matt branches: 1.16.4; 1.16.12; 1.16.18;
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.15 20-Feb-2008  matt branches: 1.15.2; 1.15.6;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.14 31-Jan-2008  christos complete removal of soft interrupts from Henry Bent
 1.13 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.12 06-Apr-2007  matt branches: 1.12.12; 1.12.14; 1.12.20;
Change tstl/beql/clrl to bbcc in softintr_dispatch
 1.11 12-Mar-2007  matt branches: 1.11.2;
Fix softintrs (boolean test problem). Spotted by mhitch.
 1.10 12-Mar-2006  christos branches: 1.10.16; 1.10.20;
welcome to syscall_intern.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.6; 1.9.8; 1.9.10;
merge ktrace-lwp.
 1.8 31-May-2005  chs branches: 1.8.2;
remove vestigal {,e}intr{names,cnt} symbols now that vmstat doesn't need them.
 1.7 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.6 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.5 28-Mar-2003  he branches: 1.5.2;
Commit a workaround for PR toolchain/20924, so that this compiles again.
When/if the PR is fixed, this change should probably be reverted.
 1.4 19-Jan-2003  ragge Add some instrumentation and clean up some VAX8600 code.
From Johnny Billquist.
 1.3 13-May-2002  matt Eliminate commons.
 1.2 24-Feb-2002  matt branches: 1.2.2; 1.2.8;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.2.8.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.8.1 24-Feb-2002  jdolecek file intvec.S was added on branch kqueue on 2002-03-16 16:00:15 +0000
 1.2.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 24-Feb-2002  nathanw file intvec.S was added on branch nathanw_sa on 2002-02-28 04:12:31 +0000
 1.5.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.8.2.5 27-Feb-2008  yamt sync with head.
 1.8.2.4 04-Feb-2008  yamt sync with head.
 1.8.2.3 07-Dec-2007  yamt sync with head
 1.8.2.2 03-Sep-2007  yamt sync with head.
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.9.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.9.8.1 13-Mar-2006  yamt sync with head.
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.20.3 03-Dec-2007  ad Sync with HEAD.
 1.10.20.2 10-Apr-2007  ad Sync with head.
 1.10.20.1 13-Mar-2007  ad Sync with head.
 1.10.16.2 07-Apr-2007  matt change tstl/beql/clrl to bbcc
 1.10.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.2.1 11-Jul-2007  mjf Sync with head.
 1.12.20.2 18-Feb-2008  mjf Sync with HEAD.
 1.12.20.1 08-Dec-2007  mjf Sync with HEAD.
 1.12.14.2 23-Mar-2008  matt sync with HEAD
 1.12.14.1 09-Jan-2008  matt sync with HEAD
 1.12.12.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.15.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.15.2.1 24-Mar-2008  keiichi sync with head.
 1.16.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.16.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.16.4.2 11-Aug-2010  yamt sync with head.
 1.16.4.1 04-May-2009  yamt sync with head.
 1.17.4.3 21-Apr-2011  rmind sync with head
 1.17.4.2 05-Mar-2011  rmind sync with head
 1.17.4.1 03-Jul-2010  rmind sync with head
 1.17.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.19.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.8.1 18-Feb-2012  mrg merge to -current.
 1.20.4.1 17-Apr-2012  yamt sync with head
 1.21.24.1 28-Aug-2017  skrll Sync with HEAD
 1.21.6.1 03-Dec-2017  jdolecek update from HEAD
 1.64 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.63 16-Sep-2001  ragge branches: 1.63.4;
#define __HAVE_GENERIC_SOFT_INTERRUPTS for netisr_dispatch.h. This is
already defined in machine/types.h, but that file cannot be included
in an assembly file.
 1.62 12-Jun-2001  ragge branches: 1.62.2; 1.62.4;
Support to get into DDB from hardclock interrupts by putting a value in
the RPB wait field.
 1.61 29-May-2001  ragge Must lock kernel when softclock is called from outside hardclock.
 1.60 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.59 18-Feb-2001  ragge branches: 1.59.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.58 15-Jan-2001  thorpej Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.57 31-Dec-2000  matt Rename arithflt to trap. Change trap label to Xtrap. This is due to that
arithflt is really the trap handler so call it that.
 1.56 26-Aug-2000  matt Reverse polarity on INSN_EMULATION to NO_INSN_EMULATION. Thus by default
all kernels will have instruction emulation.
 1.55 08-Aug-2000  ragge Write code to handle unimplemented instructions trapped via SCB vector 0x18.
This may happen on machines missing parts of the instruction set (like
some floating point formats).
Only one new instruction added; POLYD, so that the libm assembly files can
be used on architectures missing that instruction.
Also; include emulation code if compile-time option INSN_EMULATE is defined
instead of trying to match on which cputype it is.
N.B. POLYD isn't fully implemented, just enough to make libm happy.
 1.54 26-Jul-2000  ragge Support for a machine-specific badaddr handler.
 1.53 22-Jul-2000  matt Enable emulation for everything but 7xx/8xxxx
 1.52 19-Jul-2000  matt More ELF changes (a.out still works).
 1.51 17-Jul-2000  matt Changes so that the kernel can be compiled under __ELF__.
 1.50 02-Jul-2000  cgd Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.
 1.49 12-Jun-2000  ragge branches: 1.49.2;
Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.48 10-Jun-2000  matt fix botch by me.
 1.47 05-Jun-2000  matt add support for counting soft interrupts
 1.46 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.45 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.44 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.43 02-Jun-2000  matt Add IPL_* codes.
Add other codes for struct references.
Add softintr framework for IPL_SOFTNET and IPL_SOFTSERIAL.
General cleanup of .s files replacing hardcoded structure offsets with
symbolic ones.
 1.42 01-Mar-2000  matt branches: 1.42.2;
include <sys/cdefs.h> since <net/netisr_dispatch.h> needs __CONCAT
 1.41 21-Feb-2000  erh Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.
 1.40 17-Jan-2000  matt defopt VAXnnn so the make depend does the right thing.
 1.39 28-Jun-1999  itojun branches: 1.39.2;
- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.
 1.38 23-May-1999  ragge Rewrite the "emulate page reference bits" code to avoid a bunch of
pv_lists traversal and unneccessary page faults.
 1.37 02-Feb-1999  ragge branches: 1.37.2; 1.37.4; 1.37.6;
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.36 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.35 07-Nov-1998  ragge Support for KA820 console RX50. From 4.4, ported to NetBSD by Sergey Svishchev.
 1.34 06-Oct-1998  matt Code references should use movab, not moval. Fix gas-2.9.1 complaints
with intvec.s
 1.33 30-Sep-1998  ragge Make kernel compile after recent signal changes.
 1.32 31-Aug-1998  ragge Support for all 4 console lines on KA820. Support for this written
by Sergey Svishchev (svs@ropnet.ru).
 1.31 11-Aug-1998  ragge Cache and microsecond clock resolution on KA46.
 1.30 05-Jul-1998  jonathan defopt NS, NSIP.
 1.29 05-Jul-1998  jonathan defopt ISO TPIP.
 1.28 05-Jul-1998  jonathan defopt CCITT.
 1.27 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.26 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.25 13-Nov-1997  veego Add a missing #if NARP > 0 around arpintr(); and add a #include "arp.h"
for NARP. This is for the 'new' arp system.
 1.24 04-Nov-1997  ragge Move some interrupt routines out to assembler.
Optimize (slightly) pmap_clear_modify.
 1.23 28-Jul-1997  ragge Handle XFC instruction faults.
 1.22 22-Mar-1997  ragge CPU support for MV3100. (KA41)
 1.21 15-Mar-1997  ragge Put in some #ifdef's to compile only for MV2000.
 1.20 20-Jul-1996  ragge Locore changes for VS and VAX8200.
 1.19 09-Mar-1996  ragge Panic on SBI fault.
 1.18 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.17 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.16 17-Feb-1996  ragge Console TU58 device driver for 11/750 added.
It cannot write tapes yes, but reading works OK.
 1.15 03-Feb-1996  mycroft Clean this up a little, and make it compile with `traditional' cpp.
 1.14 02-Feb-1996  mycroft Fix #includes.
 1.13 28-Jan-1996  ragge Save USP when trapping from userspace.
Change register save structs according to this.
Be compatible with the way old init passes flags (in registers).
 1.12 10-Nov-1995  ragge Allow for dynamic allocation of interrupt vectors.
COMPAT_RENO removed.
Handle memory errors.
uap->sigcntxp -> SCARG(uap, sigcntxp)
 1.11 16-Jun-1995  ragge rudimentary DDB support.
 1.10 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.9 03-May-1995  ragge Changed conf.c to new style. Took away double saving of regs in traps.
Changed boot() to use vfs_shutdown(). Updated setregs.
 1.8 12-Apr-1995  ragge Fixes to conf.c
Cleaning of code.
 1.7 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.6 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.5 25-Nov-1994  ragge Lots of fixes and updates.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file intvec.s was added on branch netbsd-1-0 on 1994-08-16 23:47:29 +0000
 1.37.6.2 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.37.6.1 06-Jul-1999  itojun KAME/NetBSD 1.4, SNAP kit 1999/07/05.
NOTE: this branch is just for reference purposes (i.e. for taking cvs diff).
do not touch anything on the branch. actual work must be done on HEAD branch.
 1.37.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.37.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.37.2.1 12-Jul-1999  perry pullup 1.37->1.38 (ragge): fix critical paging/swapping problems
 1.39.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.39.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.39.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.39.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.49.2.4 25-Jun-2001  he Apply patch (requested by matt):
Fix kernel linking problem.
 1.49.2.3 26-Aug-2000  matt Pullup approved by thorpej:
GENERIC 1.79, files.vax 1.76, intvec.s 1.56
>Reverse polarity on INSN_EMULATION to NO_INSN_EMULATION. Thus by default
>all kernels will have instruction emulation.
 1.49.2.2 14-Aug-2000  ragge Pull up (requested by ragge, approved by thorpej):

sys/arch/vax/conf/GENERIC 1.76-1.77
sys/arch/vax/conf/files.vax 1.74-1.75
sys/arch/vax/vax/intvec.s 1.54-1.55
sys/arch/vax/vax/unimpl_emul.s -1.2

This adds emulation code for the POLYD instruction that some VAX CPUs
are missing. POLYD is used for example in libm.
 1.49.2.1 27-Jul-2000  matt files.vax: Pullup revision 1.73
intvec.s: Pullup revision 1.53
Enable support for instruction emulate on almost all variants
 1.59.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.62.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.62.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.62.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.63.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.63.4.1 16-Sep-2001  nathanw file intvec.s was added on branch nathanw_sa on 2002-02-28 04:12:31 +0000
 1.34 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.33 14-Dec-2010  matt branches: 1.33.18; 1.33.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.32 18-Mar-2009  cegger branches: 1.32.4;
bzero -> memset
 1.31 11-Mar-2008  matt branches: 1.31.4; 1.31.12; 1.31.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.30 04-Mar-2007  christos branches: 1.30.20; 1.30.36; 1.30.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.29 05-Sep-2006  matt branches: 1.29.8;
Switch VAX over to generic TODR
 1.28 24-Dec-2005  perry branches: 1.28.4; 1.28.8;
bare asm -> __asm
 1.27 11-Dec-2005  christos merge ktrace-lwp.
 1.26 27-Jun-2005  ragge branches: 1.26.2;
Update according to cast-qual addition.
 1.25 15-Jul-2003  lukem __KERNEL_RCSID()
 1.24 29-Jun-2000  mrg branches: 1.24.24;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.23 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.22 22-Apr-2000  ragge Use RAISEIPL on all workstations.
 1.21 06-Sep-1999  ragge branches: 1.21.2;
Styr upp deklarationen av clockchippsparametrarna.
 1.20 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.19 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.18 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.17 13-Mar-1999  ragge branches: 1.17.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.16 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.15 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.14 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.13 10-Aug-1998  ragge Basic support for VS4000/60.
 1.12 07-Jun-1998  ragge Enable use of secondary cache, if present.
 1.11 04-Jun-1998  ragge Clean upp system detect code. Enable primary cache on VS3100.
 1.10 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.9 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.8 17-May-1998  ragge Mod~ify for new changes to lance/dz drivers.
 1.7 26-Jul-1997  ragge Actually do 'halt' or 'reboot' on MicroVAX.
 1.6 18-Apr-1997  ragge Change implementation of TOY clock addressing. Gives us only
one routine for three different HW implementations.
 1.5 22-Mar-1997  ragge CPU support for MV3100. (KA41)
 1.4 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.3 13-Oct-1996  christos branches: 1.3.6;
backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 20-Jul-1996  ragge VAXstation CPU and serial console support.
 1.3.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.17.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.21.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.24.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.24.1 03-Aug-2004  skrll Sync with HEAD
 1.26.2.4 17-Mar-2008  yamt sync with head.
 1.26.2.3 03-Sep-2007  yamt sync with head.
 1.26.2.2 30-Dec-2006  yamt sync with head.
 1.26.2.1 21-Jun-2006  yamt sync with head.
 1.28.8.1 14-Sep-2006  yamt sync with head.
 1.28.4.1 09-Sep-2006  rpaulo sync with head
 1.29.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.30.36.1 24-Mar-2008  keiichi sync with head.
 1.30.20.1 23-Mar-2008  matt sync with HEAD
 1.31.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.31.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.31.4.1 04-May-2009  yamt sync with head.
 1.32.4.1 05-Mar-2011  rmind sync with head
 1.33.36.1 28-Aug-2017  skrll Sync with HEAD
 1.33.18.1 03-Dec-2017  jdolecek update from HEAD
 1.36 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.35 14-Dec-2010  matt branches: 1.35.18; 1.35.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.34 16-Dec-2008  christos branches: 1.34.6;
replace bitmask_snprintf(9) with snprintb(3)
 1.33 11-Mar-2008  matt branches: 1.33.4; 1.33.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.32 04-Mar-2007  christos branches: 1.32.20; 1.32.36; 1.32.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.31 05-Sep-2006  matt branches: 1.31.8;
Switch VAX over to generic TODR
 1.30 24-Dec-2005  perry branches: 1.30.4; 1.30.8;
bare asm -> __asm
 1.29 11-Dec-2005  christos merge ktrace-lwp.
 1.28 27-Jun-2005  ragge branches: 1.28.2;
Update according to cast-qual addition.
 1.27 14-Jan-2005  ragge Fix halt/reboot register write syntax. From Johnny Billquist.
 1.26 15-Jul-2003  lukem __KERNEL_RCSID()
 1.25 27-Sep-2002  provos branches: 1.25.6;
remove trailing \n in panic(). approved perry.
 1.24 09-Aug-2000  tv branches: 1.24.4; 1.24.8;
%b -> bitmask_snprintf()
 1.23 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.22 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.21 22-Apr-2000  ragge Use RAISEIPL on all workstations.
 1.20 13-Mar-2000  soren Fix doubled 'the's in comments.
 1.19 06-Sep-1999  ragge branches: 1.19.2;
Styr upp deklarationen av clockchippsparametrarna.
 1.18 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.17 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.16 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.15 13-Mar-1999  ragge branches: 1.15.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.14 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.13 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.12 06-Jan-1999  ragge Make SCSI work on VS3100/m76 also. From "maximum entropy".
 1.11 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.10 10-Aug-1998  ragge Basic support for VS4000/60.
 1.9 20-Jun-1998  ragge Support for glass tty on /m76.
 1.8 09-Jun-1998  ragge Bugfix; now VS3100/m76 also works.
 1.7 04-Jun-1998  ragge Clean upp system detect code. Enable primary cache on VS3100.
 1.6 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.5 18-Apr-1997  ragge Updates to KA43 (VS3100/76) support by Bertram Barth.
 1.4 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.3 13-Oct-1996  christos branches: 1.3.6;
backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 20-Jul-1996  ragge VAXstation CPU and serial console support.
 1.3.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.15.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.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.24.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.24.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.25.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.25.6.4 17-Jan-2005  skrll Sync with HEAD.
 1.25.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.6.1 03-Aug-2004  skrll Sync with HEAD
 1.28.2.4 17-Mar-2008  yamt sync with head.
 1.28.2.3 03-Sep-2007  yamt sync with head.
 1.28.2.2 30-Dec-2006  yamt sync with head.
 1.28.2.1 21-Jun-2006  yamt sync with head.
 1.30.8.1 14-Sep-2006  yamt sync with head.
 1.30.4.1 09-Sep-2006  rpaulo sync with head
 1.31.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.32.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.32.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.32.36.1 24-Mar-2008  keiichi sync with head.
 1.32.20.1 23-Mar-2008  matt sync with HEAD
 1.33.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.33.4.1 04-May-2009  yamt sync with head.
 1.34.6.1 05-Mar-2011  rmind sync with head
 1.35.36.1 28-Aug-2017  skrll Sync with HEAD
 1.35.18.1 03-Dec-2017  jdolecek update from HEAD
 1.26 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.25 14-Dec-2010  matt branches: 1.25.18; 1.25.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.24 11-Mar-2008  matt branches: 1.24.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.23 04-Mar-2007  christos branches: 1.23.20; 1.23.36; 1.23.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 05-Sep-2006  matt branches: 1.22.8;
Switch VAX over to generic TODR
 1.21 24-Dec-2005  perry branches: 1.21.4; 1.21.8;
bare asm -> __asm
 1.20 11-Dec-2005  christos merge ktrace-lwp.
 1.19 27-Jun-2005  ragge branches: 1.19.2;
Update according to cast-qual addition.
 1.18 15-Jul-2003  lukem __KERNEL_RCSID()
 1.17 05-Jun-2001  ragge branches: 1.17.8; 1.17.24;
Detect MicroVAX 3100/m80 correctly. From Michael Kukat.
 1.16 18-Feb-2001  ragge branches: 1.16.2;
Make the machine halt when halted and reboot when rebooted.
From Shinmyoh Koji (yesu@rb3.so-net.ne.jp).
 1.15 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.14 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.13 22-Apr-2000  ragge Use RAISEIPL on all workstations.
 1.12 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.11 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.10 06-Sep-1999  ragge branches: 1.10.2;
Styr upp deklarationen av clockchippsparametrarna.
 1.9 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.8 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.7 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.6 13-Mar-1999  ragge branches: 1.6.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.5 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.4 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.3 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.2 11-Aug-1998  ragge Cache and microsecond clock resolution on KA46.
 1.1 10-Aug-1998  ragge Basic support for VS4000/60.
 1.6.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.10.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.10.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 21-Jun-2001  nathanw Catch up to -current.
 1.17.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.24.1 03-Aug-2004  skrll Sync with HEAD
 1.17.8.2 05-Jun-2001  ragge Detect MicroVAX 3100/m80 correctly. From Michael Kukat.
 1.17.8.1 05-Jun-2001  ragge file ka46.c was added on branch nathanw_sa on 2001-06-05 11:25:12 +0000
 1.19.2.4 17-Mar-2008  yamt sync with head.
 1.19.2.3 03-Sep-2007  yamt sync with head.
 1.19.2.2 30-Dec-2006  yamt sync with head.
 1.19.2.1 21-Jun-2006  yamt sync with head.
 1.21.8.1 14-Sep-2006  yamt sync with head.
 1.21.4.1 09-Sep-2006  rpaulo sync with head
 1.22.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.23.36.1 24-Mar-2008  keiichi sync with head.
 1.23.20.1 23-Mar-2008  matt sync with HEAD
 1.24.26.1 05-Mar-2011  rmind sync with head
 1.25.36.1 28-Aug-2017  skrll Sync with HEAD
 1.25.18.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 14-Dec-2010  matt branches: 1.21.18; 1.21.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.20 11-Mar-2008  matt branches: 1.20.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.19 04-Mar-2007  christos branches: 1.19.20; 1.19.36; 1.19.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.18 05-Sep-2006  matt branches: 1.18.8;
Switch VAX over to generic TODR
 1.17 24-Dec-2005  perry branches: 1.17.4; 1.17.8;
bare asm -> __asm
 1.16 11-Dec-2005  christos merge ktrace-lwp.
 1.15 27-Jun-2005  ragge branches: 1.15.2;
Update according to cast-qual addition.
 1.14 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.13 15-Jul-2003  lukem __KERNEL_RCSID()
 1.12 12-Jun-2001  ragge branches: 1.12.8; 1.12.24;
Detect 4000/VLC correctly + make halt/reboot work.
From Michael L. Hitch (mhitch@montana.edu).
 1.11 29-Jun-2000  mrg branches: 1.11.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.10 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.9 22-Apr-2000  ragge Use RAISEIPL on all workstations.
 1.8 18-Apr-2000  mhitch Enable cache on the 4000/VLC.
 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 06-Sep-1999  ragge branches: 1.6.2;
Styr upp deklarationen av clockchippsparametrarna.
 1.5 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.4 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.3 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.2 13-Mar-1999  ragge branches: 1.2.4;
Oops, forgot this file.
 1.1 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.2.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.6.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.11.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.24.1 03-Aug-2004  skrll Sync with HEAD
 1.12.8.2 12-Jun-2001  ragge Detect 4000/VLC correctly + make halt/reboot work.
From Michael L. Hitch (mhitch@montana.edu).
 1.12.8.1 12-Jun-2001  ragge file ka48.c was added on branch nathanw_sa on 2001-06-12 11:24:51 +0000
 1.15.2.4 17-Mar-2008  yamt sync with head.
 1.15.2.3 03-Sep-2007  yamt sync with head.
 1.15.2.2 30-Dec-2006  yamt sync with head.
 1.15.2.1 21-Jun-2006  yamt sync with head.
 1.17.8.1 14-Sep-2006  yamt sync with head.
 1.17.4.1 09-Sep-2006  rpaulo sync with head
 1.18.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.19.36.1 24-Mar-2008  keiichi sync with head.
 1.19.20.1 23-Mar-2008  matt sync with HEAD
 1.20.26.1 05-Mar-2011  rmind sync with head
 1.21.36.1 28-Aug-2017  skrll Sync with HEAD
 1.21.18.1 03-Dec-2017  jdolecek update from HEAD
 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;
drop some blank lines - no functional change
 1.18 14-Dec-2010  matt branches: 1.18.8;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.17 11-Mar-2008  matt branches: 1.17.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.16 04-Mar-2007  christos branches: 1.16.20; 1.16.36; 1.16.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 05-Sep-2006  matt branches: 1.15.8;
Switch VAX over to generic TODR
 1.14 24-Dec-2005  perry branches: 1.14.4; 1.14.8;
bare asm -> __asm
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 27-Jun-2005  ragge branches: 1.12.2;
Update according to cast-qual addition.
 1.11 15-Jul-2003  lukem __KERNEL_RCSID()
 1.10 24-Feb-2002  matt branches: 1.10.16;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.9 18-Feb-2001  ragge branches: 1.9.4; 1.9.8;
Make the machine halt when halted and reboot when rebooted.
From Shinmyoh Koji (yesu@rb3.so-net.ne.jp).
 1.8 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.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 17-May-2000  matt branches: 1.6.2;
Preliminary support for the VS4000/90 SGMAP. Needed for SCSI. Does not
quite work right yet.
 1.5 22-Apr-2000  ragge Use RAISEIPL on all workstations.
 1.4 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.3 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.2 17-Sep-1999  thorpej branches: 1.2.2;
Centralize the declaration and clearing of `cold'.
 1.1 27-Aug-1999  ragge CPU support for 4000/90 (KA49).
 1.2.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 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.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.9.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.10.16.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.16.1 03-Aug-2004  skrll Sync with HEAD
 1.12.2.4 17-Mar-2008  yamt sync with head.
 1.12.2.3 03-Sep-2007  yamt sync with head.
 1.12.2.2 30-Dec-2006  yamt sync with head.
 1.12.2.1 21-Jun-2006  yamt sync with head.
 1.14.8.1 14-Sep-2006  yamt sync with head.
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.15.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.16.36.1 24-Mar-2008  keiichi sync with head.
 1.16.20.1 23-Mar-2008  matt sync with HEAD
 1.17.26.1 05-Mar-2011  rmind sync with head
 1.18.8.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.17 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.16 14-Dec-2010  matt branches: 1.16.18; 1.16.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.15 11-Mar-2008  matt branches: 1.15.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.14 04-Mar-2007  christos branches: 1.14.20; 1.14.36; 1.14.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 05-Sep-2006  matt branches: 1.13.8;
Switch VAX over to generic TODR
 1.12 24-Dec-2005  perry branches: 1.12.4; 1.12.8;
bare asm -> __asm
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 27-Jun-2005  ragge branches: 1.10.2;
Update according to cast-qual addition.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 28-Sep-2002  ragge branches: 1.8.6;
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.7 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.6 18-Sep-2001  ragge branches: 1.6.4;
Some ID strings + other consistency fixes, from Michael Kukat.
 1.5 31-Mar-2001  ragge branches: 1.5.2; 1.5.4;
(Untested) recognition of KA55.
 1.4 04-Feb-2001  ragge branches: 1.4.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.3 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.2 04-Jun-2000  matt branches: 1.2.4;
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.1 08-May-2000  ragge branches: 1.1.2;
Rudimentary CPU support files for VAX 4000/105, 4000/200 and 4000/500.
From Michael Kukat.
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.4 21-Apr-2001  bouyer Sync with HEAD
 1.2.4.3 11-Feb-2001  bouyer 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 04-Jun-2000  bouyer file ka53.c was added on branch thorpej_scsipi on 2000-11-20 20:33:21 +0000
 1.4.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.5.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.5.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.5.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.5.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.4.1 18-Sep-2001  nathanw file ka53.c was added on branch nathanw_sa on 2002-02-28 04:12:31 +0000
 1.8.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.2.4 17-Mar-2008  yamt sync with head.
 1.10.2.3 03-Sep-2007  yamt sync with head.
 1.10.2.2 30-Dec-2006  yamt sync with head.
 1.10.2.1 21-Jun-2006  yamt sync with head.
 1.12.8.1 14-Sep-2006  yamt sync with head.
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.13.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.14.36.1 24-Mar-2008  keiichi sync with head.
 1.14.20.1 23-Mar-2008  matt sync with HEAD
 1.15.26.1 05-Mar-2011  rmind sync with head
 1.16.36.1 28-Aug-2017  skrll Sync with HEAD
 1.16.18.1 03-Dec-2017  jdolecek update from HEAD
 1.9 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.8 14-Dec-2010  matt branches: 1.8.18; 1.8.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.7 11-Mar-2008  matt branches: 1.7.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.6 04-Mar-2007  christos branches: 1.6.20; 1.6.36; 1.6.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 05-Sep-2006  matt branches: 1.5.8;
Switch VAX over to generic TODR
 1.4 24-Dec-2005  perry branches: 1.4.4; 1.4.8;
bare asm -> __asm
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 15-Jul-2003  lukem branches: 1.2.16;
__KERNEL_RCSID()
 1.1 01-May-2001  ragge branches: 1.1.2; 1.1.10; 1.1.26;
CPU support file for KA610 (MicroVAX I). Very simple.
 1.1.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.26.1 03-Aug-2004  skrll Sync with HEAD
 1.1.10.2 01-May-2001  ragge CPU support file for KA610 (MicroVAX I). Very simple.
 1.1.10.1 01-May-2001  ragge file ka610.c was added on branch nathanw_sa on 2001-05-01 13:17:56 +0000
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.16.4 17-Mar-2008  yamt sync with head.
 1.2.16.3 03-Sep-2007  yamt sync with head.
 1.2.16.2 30-Dec-2006  yamt sync with head.
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4.8.1 14-Sep-2006  yamt sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.36.1 24-Mar-2008  keiichi sync with head.
 1.6.20.1 23-Mar-2008  matt sync with HEAD
 1.7.26.1 05-Mar-2011  rmind sync with head
 1.8.36.1 28-Aug-2017  skrll Sync with HEAD
 1.8.18.1 03-Dec-2017  jdolecek update from HEAD
 1.30 14-Dec-2010  matt Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.29 11-Mar-2008  matt branches: 1.29.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.28 04-Mar-2007  christos branches: 1.28.20; 1.28.36; 1.28.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.27 05-Sep-2006  matt branches: 1.27.8;
Switch VAX over to generic TODR
 1.26 24-Dec-2005  perry branches: 1.26.4; 1.26.8;
bare asm -> __asm
 1.25 11-Dec-2005  christos merge ktrace-lwp.
 1.24 27-Jun-2005  ragge branches: 1.24.2;
Update according to cast-qual addition.
 1.23 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.22 15-Jul-2003  lukem __KERNEL_RCSID()
 1.21 29-Jun-2000  mrg branches: 1.21.24;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.20 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.19 12-Jun-2000  ragge Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.18 27-Jan-2000  bouyer branches: 1.18.2;
Add missing '#include "opt_vax630.h"' for custom kernels.
 1.17 06-Sep-1999  ragge branches: 1.17.2;
Styr upp deklarationen av clockchippsparametrarna.
 1.16 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.15 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.14 02-Feb-1999  ragge branches: 1.14.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.13 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.12 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.11 29-Nov-1998  ragge Don't map in unnecessary pages.
 1.10 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.9 13-Apr-1998  ragge Wall cleaning.
 1.8 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.7 26-Jul-1997  ragge Actually do 'halt' or 'reboot' on MicroVAX.
 1.6 18-Apr-1997  ragge Change implementation of TOY clock addressing. Gives us only
one routine for three different HW implementations.
 1.5 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.4 13-Oct-1996  christos branches: 1.4.6;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 20-Aug-1996  ragge Support for cmi bus on 11/750.
 1.1 20-Jul-1996  ragge VAXstation CPU and serial console support.
 1.4.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.14.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.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.18.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.21.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.24.1 03-Aug-2004  skrll Sync with HEAD
 1.24.2.4 17-Mar-2008  yamt sync with head.
 1.24.2.3 03-Sep-2007  yamt sync with head.
 1.24.2.2 30-Dec-2006  yamt sync with head.
 1.24.2.1 21-Jun-2006  yamt sync with head.
 1.26.8.1 14-Sep-2006  yamt sync with head.
 1.26.4.1 09-Sep-2006  rpaulo sync with head
 1.27.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.28.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.28.36.1 24-Mar-2008  keiichi sync with head.
 1.28.20.1 23-Mar-2008  matt sync with HEAD
 1.29.26.1 05-Mar-2011  rmind sync with head
 1.21 03-Mar-2022  riastradh vax: Use device_set_private.
 1.20 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.19 22-May-2017  ragge branches: 1.19.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.18 26-Mar-2014  christos branches: 1.18.6;
fix printf issues
 1.17 24-Mar-2014  christos use cpu_{g,s}etmodel
 1.16 05-Jun-2011  matt branches: 1.16.2; 1.16.12; 1.16.16;
device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.15 14-Dec-2010  matt branches: 1.15.2; 1.15.6;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.14 21-Nov-2009  rmind branches: 1.14.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.13 11-Mar-2008  matt branches: 1.13.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.12 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.11 04-Mar-2007  christos branches: 1.11.20; 1.11.36; 1.11.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 15-Feb-2007  ad branches: 1.10.2;
Count the number of CPUs at boot and stash in 'ncpu'. Eventually should
have each CPU register at attach, so we can figure out the topology for
the scheduler.
 1.9 05-Sep-2006  matt Switch VAX over to generic TODR
 1.8 24-Dec-2005  perry branches: 1.8.4; 1.8.8;
bare asm -> __asm
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 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.5 15-Jul-2003  lukem branches: 1.5.16;
__KERNEL_RCSID()
 1.4 02-Oct-2002  thorpej branches: 1.4.6;
Add trailing ; to CFATTACH_DECL.
 1.3 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.2 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.1 06-Jul-2000  ragge branches: 1.1.2; 1.1.6; 1.1.10;
CPU support for the 6000/400 CPU. No support for spinning up the
slave processor yet, though.
 1.1.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.1.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.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 ka6400.c was added on branch thorpej_scsipi on 2000-11-20 20:33:22 +0000
 1.4.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.6 17-Mar-2008  yamt sync with head.
 1.5.16.5 27-Feb-2008  yamt sync with head.
 1.5.16.4 03-Sep-2007  yamt sync with head.
 1.5.16.3 26-Feb-2007  yamt sync with head.
 1.5.16.2 30-Dec-2006  yamt sync with head.
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.8.8.1 14-Sep-2006  yamt sync with head.
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.10.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.36.1 24-Mar-2008  keiichi sync with head.
 1.11.20.1 23-Mar-2008  matt sync with HEAD
 1.13.4.1 11-Mar-2010  yamt sync with head
 1.14.4.2 12-Jun-2011  rmind sync with head
 1.14.4.1 05-Mar-2011  rmind sync with head
 1.15.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.15.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.16.16.1 18-May-2014  rmind sync with head
 1.16.12.2 03-Dec-2017  jdolecek update from HEAD
 1.16.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.6.1 28-Aug-2017  skrll Sync with HEAD
 1.19.10.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.39 21-Feb-2024  andvar Add 0x prefix before hex physmem in couple more places.
For netwinder move physmem arg to new line to keep line <80 symbols.
 1.38 31-Mar-2017  msaitoh Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
 1.37 23-Dec-2016  cherry branches: 1.37.2;
"Make NetBSD great again!"

Introduce uvm_hotplug(9) to the kernel.

Many thanks, in no particular order to:

TNF, for funding the project.

Chuck Silvers - for multiple API reviews and feedback.
Nick Hudson - for testing on multiple architectures and bugfix patches.
Everyone who helped with boot testing.

KeK (http://www.kek.org.in) for hosting the primary developers.
 1.36 14-Dec-2010  matt branches: 1.36.18; 1.36.36; 1.36.40;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.35 16-Dec-2008  christos branches: 1.35.6;
replace bitmask_snprintf(9) with snprintb(3)
 1.34 11-Mar-2008  matt branches: 1.34.4; 1.34.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.33 04-Jan-2008  joerg branches: 1.33.2; 1.33.6;
Use time_second instead of time.tv_sec.
 1.32 04-Mar-2007  christos branches: 1.32.20; 1.32.26; 1.32.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.31 05-Sep-2006  matt branches: 1.31.8;
Switch VAX over to generic TODR
 1.30 24-Dec-2005  perry branches: 1.30.4; 1.30.8;
bare asm -> __asm
 1.29 11-Dec-2005  christos merge ktrace-lwp.
 1.28 27-Jun-2005  ragge branches: 1.28.2;
Update according to cast-qual addition.
 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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.25 27-Apr-2001  ragge branches: 1.25.8; 1.25.24;
Enable the L1 cache on KA640. Problem reported and testing help from
Saku Setala.
 1.24 09-Aug-2000  tv branches: 1.24.2;
%b -> bitmask_snprintf()
 1.23 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.22 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.21 20-Apr-2000  ragge branches: 1.21.4;
Raise IPL after interrupt, for LANCE chip.
 1.20 07-Aug-1999  ragge branches: 1.20.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.19 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.18 19-Apr-1999  ragge Don't try to init the L2 cache if there is no L2 cache. (KA640)
 1.17 02-Feb-1999  ragge branches: 1.17.2;
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.16 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.15 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.14 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.13 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.12 13-Apr-1998  ragge Wall cleaning.
 1.11 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.10 26-Jul-1997  ragge Actually do 'halt' or 'reboot' on MicroVAX.
 1.9 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.8 12-Feb-1997  ragge Improve sub-type identification of the CVAX CPU, for later cache handling.
 1.7 11-Jan-1997  ragge branches: 1.7.6;
Oops, forgot an printf.
 1.6 13-Oct-1996  christos backout previous kprintf change
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.3 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.2 02-Feb-1996  mycroft Fix #includes.
 1.1 13-Dec-1995  ragge MicroVAX III support added; now runs on VAX 3600/3800/3900 platforms.
 1.7.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.17.2.1 19-Apr-1999  perry branches: 1.17.2.1.2;
pullup 1.17->1.18, for ragge. Fixes bug on KA640 initing nonexistent L2 cache.
 1.17.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.20.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.21.4.1 01-May-2001  he Pull up revision 1.25 (requested by ragge):
Enable the cache on KA640.
 1.24.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.25.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.25.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.24.1 03-Aug-2004  skrll Sync with HEAD
 1.25.8.2 27-Apr-2001  ragge Enable the L1 cache on KA640. Problem reported and testing help from
Saku Setala.
 1.25.8.1 27-Apr-2001  ragge file ka650.c was added on branch nathanw_sa on 2001-04-27 15:02:38 +0000
 1.28.2.5 17-Mar-2008  yamt sync with head.
 1.28.2.4 21-Jan-2008  yamt sync with head
 1.28.2.3 03-Sep-2007  yamt sync with head.
 1.28.2.2 30-Dec-2006  yamt sync with head.
 1.28.2.1 21-Jun-2006  yamt sync with head.
 1.30.8.1 14-Sep-2006  yamt sync with head.
 1.30.4.1 09-Sep-2006  rpaulo sync with head
 1.31.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.32.32.1 08-Jan-2008  bouyer Sync with HEAD
 1.32.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.32.20.2 23-Mar-2008  matt sync with HEAD
 1.32.20.1 09-Jan-2008  matt sync with HEAD
 1.33.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.33.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.33.2.1 24-Mar-2008  keiichi sync with head.
 1.34.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.34.4.1 04-May-2009  yamt sync with head.
 1.35.6.1 05-Mar-2011  rmind sync with head
 1.36.40.2 26-Apr-2017  pgoyette Sync with HEAD
 1.36.40.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.36.36.2 28-Aug-2017  skrll Sync with HEAD
 1.36.36.1 05-Feb-2017  skrll Sync with HEAD
 1.36.18.1 03-Dec-2017  jdolecek update from HEAD
 1.37.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.12 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.11 09-May-2015  ragge PR port-vax/49884
Fixes bug introduced in earlier cleanup.
 1.10 14-Dec-2010  matt branches: 1.10.14; 1.10.18; 1.10.34; 1.10.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.9 11-Mar-2008  matt branches: 1.9.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.8 04-Mar-2007  christos branches: 1.8.20; 1.8.36; 1.8.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 05-Sep-2006  matt branches: 1.7.8;
Switch VAX over to generic TODR
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8;
merge ktrace-lwp.
 1.5 15-Jul-2003  lukem branches: 1.5.16;
__KERNEL_RCSID()
 1.4 28-Sep-2002  ragge branches: 1.4.6;
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.3 29-Jun-2000  mrg branches: 1.3.2; 1.3.6; 1.3.10;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.2 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.1 08-May-2000  ragge Rudimentary CPU support files for VAX 4000/105, 4000/200 and 4000/500.
From Michael Kukat.
 1.3.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.3.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.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 29-Jun-2000  bouyer file ka660.c was added on branch thorpej_scsipi on 2000-11-20 20:33:22 +0000
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.3 17-Mar-2008  yamt sync with head.
 1.5.16.2 03-Sep-2007  yamt sync with head.
 1.5.16.1 30-Dec-2006  yamt sync with head.
 1.6.8.1 14-Sep-2006  yamt sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.36.1 24-Mar-2008  keiichi sync with head.
 1.8.20.1 23-Mar-2008  matt sync with HEAD
 1.9.26.1 05-Mar-2011  rmind sync with head
 1.10.36.2 28-Aug-2017  skrll Sync with HEAD
 1.10.36.1 06-Jun-2015  skrll Sync with HEAD
 1.10.34.1 13-May-2015  martin Pull up following revision(s) (requested by ragge in ticket #757):
sys/arch/vax/vax/ka660.c: revision 1.11
PR port-vax/49884
Fixes bug introduced in earlier cleanup.
 1.10.18.1 03-Dec-2017  jdolecek update from HEAD
 1.10.14.1 19-May-2015  snj Pull up following revision(s) (requested by ragge in ticket #1298):
sys/arch/vax/vax/ka660.c: revision 1.11
PR port-vax/49884
Fixes bug introduced in earlier cleanup.
 1.17 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.16 14-Dec-2010  matt branches: 1.16.18; 1.16.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.15 16-Dec-2008  christos branches: 1.15.6;
replace bitmask_snprintf(9) with snprintb(3)
 1.14 11-Mar-2008  matt branches: 1.14.4; 1.14.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.13 04-Mar-2007  christos branches: 1.13.20; 1.13.36; 1.13.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.12 05-Sep-2006  matt branches: 1.12.8;
Switch VAX over to generic TODR
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.8;
merge ktrace-lwp.
 1.10 15-Jul-2003  lukem branches: 1.10.16;
__KERNEL_RCSID()
 1.9 28-Sep-2002  ragge branches: 1.9.6;
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.8 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.7 09-Aug-2000  tv branches: 1.7.4; 1.7.8;
%b -> bitmask_snprintf()
 1.6 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.5 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.4 13-Mar-2000  soren Fix doubled 'the's in comments.
 1.3 08-Aug-1999  ragge branches: 1.3.2;
Give numeric machine checks, instead of incorrect strings.
 1.2 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.1 06-Jun-1999  ragge branches: 1.1.2;
Complete support for VAX 4000/300. From Michael Kukat. (michael@camaronet.de)
 1.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.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.7.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.7.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.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.3 17-Mar-2008  yamt sync with head.
 1.10.16.2 03-Sep-2007  yamt sync with head.
 1.10.16.1 30-Dec-2006  yamt sync with head.
 1.11.8.1 14-Sep-2006  yamt sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.13.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.13.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.13.36.1 24-Mar-2008  keiichi sync with head.
 1.13.20.1 23-Mar-2008  matt sync with HEAD
 1.14.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.4.1 04-May-2009  yamt sync with head.
 1.15.6.1 05-Mar-2011  rmind sync with head
 1.16.36.1 28-Aug-2017  skrll Sync with HEAD
 1.16.18.1 03-Dec-2017  jdolecek update from HEAD
 1.18 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.17 14-Dec-2010  matt branches: 1.17.18; 1.17.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.16 11-Mar-2008  matt branches: 1.16.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.15 04-Mar-2007  christos branches: 1.15.20; 1.15.36; 1.15.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 05-Sep-2006  matt branches: 1.14.8;
Switch VAX over to generic TODR
 1.13 24-Dec-2005  perry branches: 1.13.4; 1.13.8;
bare asm -> __asm
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 27-Jun-2005  ragge branches: 1.11.2;
Update according to cast-qual addition.
 1.10 11-Oct-2004  christos PR/27218: Kirk Russell: kernel incorrectly identifies a KA692 CPU as a
KA694 during boot
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 28-Sep-2002  ragge branches: 1.8.6;
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.7 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.6 01-May-2001  ragge branches: 1.6.2; 1.6.8;
Support for more NVAX types: VAX 4000/705A and (untested) 600A.
From Michael Kukat.
 1.5 24-Apr-2001  ragge Support for KA681 (4000/500A) from Michael Kukat.
 1.4 31-Mar-2001  ragge Support for the 4000/600 cache, from Lord Isildur. (mrfusion@vaxpower.org)
 1.3 28-Jan-2001  ragge branches: 1.3.2;
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.2 04-Jun-2000  matt branches: 1.2.4;
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.1 08-May-2000  ragge branches: 1.1.2;
Rudimentary CPU support files for VAX 4000/105, 4000/200 and 4000/500.
From Michael Kukat.
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.4 21-Apr-2001  bouyer Sync with HEAD
 1.2.4.3 11-Feb-2001  bouyer 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 04-Jun-2000  bouyer file ka680.c was added on branch thorpej_scsipi on 2000-11-20 20:33:23 +0000
 1.3.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.3.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.6.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.1 01-May-2001  nathanw file ka680.c was added on branch nathanw_sa on 2002-02-28 04:12:31 +0000
 1.6.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.6.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.8.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.6.4 19-Oct-2004  skrll Sync with HEAD
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11.2.4 17-Mar-2008  yamt sync with head.
 1.11.2.3 03-Sep-2007  yamt sync with head.
 1.11.2.2 30-Dec-2006  yamt sync with head.
 1.11.2.1 21-Jun-2006  yamt sync with head.
 1.13.8.1 14-Sep-2006  yamt sync with head.
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.14.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.15.36.1 24-Mar-2008  keiichi sync with head.
 1.15.20.1 23-Mar-2008  matt sync with HEAD
 1.16.26.1 05-Mar-2011  rmind sync with head
 1.17.36.1 28-Aug-2017  skrll Sync with HEAD
 1.17.18.1 03-Dec-2017  jdolecek update from HEAD
 1.6 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.5 26-Mar-2013  martin branches: 1.5.12;
Minor cosmetic tweaks for cpu attach messages
 1.4 29-Oct-2012  chs fix compile problems.
 1.3 05-Jun-2011  matt branches: 1.3.2; 1.3.12;
device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.2 14-Dec-2010  matt branches: 1.2.2; 1.2.6;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.1 22-Jan-2009  christos branches: 1.1.4; 1.1.6; 1.1.10;
Patches from Brad Parker to support vax730.
 1.1.10.2 12-Jun-2011  rmind sync with head
 1.1.10.1 05-Mar-2011  rmind sync with head
 1.1.6.2 04-May-2009  yamt sync with head.
 1.1.6.1 22-Jan-2009  yamt file ka730.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:05 +0000
 1.1.4.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.4.1 22-Jan-2009  skrll file ka730.c was added on branch nick-hppapmap on 2009-03-03 18:29:36 +0000
 1.2.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.2.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.12.3 03-Dec-2017  jdolecek update from HEAD
 1.3.12.2 23-Jun-2013  tls resync from head
 1.3.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.5.12.1 28-Aug-2017  skrll Sync with HEAD
 1.47 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.46 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.45 26-Mar-2013  martin branches: 1.45.12;
Minor cosmetic tweaks for cpu attach messages
 1.44 14-Dec-2010  matt branches: 1.44.8; 1.44.18;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.43 15-Mar-2008  matt branches: 1.43.26;
Fix device access. Use a 0 sized softc and switch to PRIVALLOC for mem_cmi.
 1.42 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.41 04-Mar-2007  christos branches: 1.41.20; 1.41.36; 1.41.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.40 05-Sep-2006  matt branches: 1.40.8;
Switch VAX over to generic TODR
 1.39 28-Mar-2006  thorpej Use device_unit().
 1.38 11-Dec-2005  christos branches: 1.38.4; 1.38.6; 1.38.8; 1.38.10; 1.38.12;
merge ktrace-lwp.
 1.37 27-Jun-2005  ragge branches: 1.37.2;
Update according to cast-qual addition.
 1.36 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.35 15-Jul-2003  lukem __KERNEL_RCSID()
 1.34 02-Oct-2002  thorpej branches: 1.34.6;
Add trailing ; to CFATTACH_DECL.
 1.33 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 04-Jun-2000  ragge branches: 1.31.6; 1.31.10;
Changes to sbi_attach_args. (and some cleanup)
 1.30 14-Aug-1999  ragge branches: 1.30.2; 1.30.10;
Fix CMI probe bug on VAX 11/750. Prettify CPU printout.
 1.29 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.28 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.27 02-Feb-1999  ragge branches: 1.27.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.26 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.25 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.24 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.23 13-Apr-1998  ragge Wall cleaning.
 1.22 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.21 12-Jan-1998  thorpej Update for changes to config.
 1.20 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.19 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.18 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.17 13-Oct-1996  christos branches: 1.17.6;
backout previous kprintf change
 1.16 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.15 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.14 20-Aug-1996  ragge Support for cmi bus on 11/750.
 1.13 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.12 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.11 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.10 17-Feb-1996  ragge Console TU58 device driver for 11/750 added.
It cannot write tapes yes, but reading works OK.
 1.9 02-Feb-1996  mycroft Fix #includes.
 1.8 13-Dec-1995  ragge CPU dependent code moved out of cpu independent modules.
 1.7 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.6 10-Nov-1995  ragge Major rewriting of pmap_bootstrap; CPU dependent allocations moved
to related file.
 1.5 30-Mar-1995  ragge branches: 1.5.2;
Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.4 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 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.c was added on branch netbsd-1-0 on 1994-08-02 20:21:59 +0000
 1.5.2.1 15-Oct-1995  ragge Fixed type error complaints.
 1.17.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.27.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.30.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.30.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.31.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.31.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.34.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.34.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.34.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.34.6.1 03-Aug-2004  skrll Sync with HEAD
 1.37.2.4 17-Mar-2008  yamt sync with head.
 1.37.2.3 03-Sep-2007  yamt sync with head.
 1.37.2.2 30-Dec-2006  yamt sync with head.
 1.37.2.1 21-Jun-2006  yamt sync with head.
 1.38.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.38.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.38.8.2 14-Sep-2006  yamt sync with head.
 1.38.8.1 01-Apr-2006  yamt sync with head.
 1.38.6.1 22-Apr-2006  simonb Sync with head.
 1.38.4.1 09-Sep-2006  rpaulo sync with head
 1.40.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.41.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.41.36.1 24-Mar-2008  keiichi sync with head.
 1.41.20.1 23-Mar-2008  matt sync with HEAD
 1.43.26.1 05-Mar-2011  rmind sync with head
 1.44.18.2 03-Dec-2017  jdolecek update from HEAD
 1.44.18.1 23-Jun-2013  tls resync from head
 1.44.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.45.12.2 28-Aug-2017  skrll Sync with HEAD
 1.45.12.1 09-Jul-2016  skrll Sync with HEAD
 1.35 04-Feb-2024  andvar s/interrrupt/interrupt/ in comment and editline(3) man page.
 1.34 17-Dec-2023  andvar Fix TRENDATA option build by moving TRENDATA code block with memlog() definition
over its usage in ka780_memerr() and making it static. Also return type is
changed to void and removed unnecessary break at the end of the method.

Finally fixed struct memlogtab initialization by adding missing braces around
each member in the array.

The code builds, but I am not sure weather it was fully finished.
 1.33 25-Mar-2018  ragge Fix cpu type printout error.
 1.32 07-Jul-2016  msaitoh branches: 1.32.16;
KNF. Remove extra spaces. No functional change.
 1.31 24-Mar-2014  christos branches: 1.31.6;
use cpu_{g,s}etmodel
 1.30 26-Mar-2013  martin branches: 1.30.4;
Minor cosmetic tweaks for cpu attach messages
 1.29 14-Dec-2010  matt branches: 1.29.8; 1.29.18;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.28 11-Mar-2008  matt branches: 1.28.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.27 04-Mar-2007  christos branches: 1.27.20; 1.27.36; 1.27.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 05-Sep-2006  matt branches: 1.26.8;
Switch VAX over to generic TODR
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.8;
merge ktrace-lwp.
 1.24 27-Jun-2005  ragge branches: 1.24.2;
Update according to cast-qual addition.
 1.23 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.22 15-Jul-2003  lukem __KERNEL_RCSID()
 1.21 04-Oct-2002  matt branches: 1.21.6;
CFATTACH mem_sbi, not sbi
 1.20 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.19 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.18 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.17 31-Aug-2001  simonb branches: 1.17.6;
Use comments around the token after a #endif.
 1.16 04-Jun-2000  ragge branches: 1.16.6;
Changes to sbi_attach_args. (and some cleanup)
 1.15 28-Mar-2000  simonb branches: 1.15.2;
Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
 1.14 07-Aug-1999  ragge branches: 1.14.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.13 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.12 02-Feb-1999  ragge branches: 1.12.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.11 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.10 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.9 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.8 12-Jan-1998  thorpej Update for changes to config.
 1.7 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.6 13-Oct-1996  christos branches: 1.6.6;
backout previous kprintf change
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.3 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.2 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.1 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.6.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.12.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.14.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.15.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.16.6.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.16.6.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.17.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.17.6.1 31-Aug-2001  nathanw file ka780.c was added on branch nathanw_sa on 2002-10-18 02:40:34 +0000
 1.21.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.6.1 03-Aug-2004  skrll Sync with HEAD
 1.24.2.3 17-Mar-2008  yamt sync with head.
 1.24.2.2 03-Sep-2007  yamt sync with head.
 1.24.2.1 30-Dec-2006  yamt sync with head.
 1.25.8.1 14-Sep-2006  yamt sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.26.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.27.36.1 24-Mar-2008  keiichi sync with head.
 1.27.20.1 23-Mar-2008  matt sync with HEAD
 1.28.26.1 05-Mar-2011  rmind sync with head
 1.29.18.3 03-Dec-2017  jdolecek update from HEAD
 1.29.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.18.1 23-Jun-2013  tls resync from head
 1.29.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.30.4.1 18-May-2014  rmind sync with head
 1.31.6.1 09-Jul-2016  skrll Sync with HEAD
 1.32.16.1 30-Mar-2018  pgoyette Resolve conflicts between branch and HEAD
 1.58 03-Mar-2022  riastradh vax: Use device_set_private.
 1.57 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.56 26-Mar-2014  christos branches: 1.56.30;
fix printf issues
 1.55 24-Mar-2014  christos use cpu_{g,s}etmodel
 1.54 05-Jun-2011  matt branches: 1.54.2; 1.54.12; 1.54.16;
device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.53 14-Dec-2010  matt branches: 1.53.2; 1.53.6;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.52 12-Dec-2009  tsutsui branches: 1.52.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.51 21-Nov-2009  rmind - Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.50 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.49 11-Mar-2008  matt branches: 1.49.4; 1.49.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.48 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.47 04-Mar-2007  christos branches: 1.47.20; 1.47.36; 1.47.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.46 05-Sep-2006  matt branches: 1.46.8;
Switch VAX over to generic TODR
 1.45 24-Dec-2005  perry branches: 1.45.4; 1.45.8;
bare asm -> __asm
 1.44 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.43 11-Dec-2005  christos merge ktrace-lwp.
 1.42 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.41 27-Jun-2005  ragge branches: 1.41.2;
Update according to cast-qual addition.
 1.40 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.39 29-Sep-2003  matt Fix GCC3'ism's
 1.38 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.37 15-Jul-2003  lukem __KERNEL_RCSID()
 1.36 18-Jan-2003  thorpej branches: 1.36.2;
Merge the nathanw_sa branch.
 1.35 10-Oct-2002  jdolecek use (volatile int) cast, rather than just (volatile); the latter gives a warning
 1.34 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.33 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 03-Jun-2001  ragge branches: 1.31.2; 1.31.8;
A bunch of fixes:
- Make generic console routines not relying on running on master cpu.
- Add routine to start console transmitter (after IPI).
- Use real IPIs instead of the "console doorbell".
- Add routines cpu_send_ipi()/cpu_handle_ipi().
 1.30 09-Aug-2000  tv branches: 1.30.2;
%b -> bitmask_snprintf()
 1.29 08-Aug-2000  ragge Be sure that cache is enabled.
 1.28 26-Jul-2000  ragge Remove the use of global "mastercpu", the world is different now.
 1.27 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.26 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.25 12-Jun-2000  ragge Evil bug: sizeof(struct cpu_info) -> sizeof(struct ka820_softc).
 1.24 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.23 10-Jun-2000  ragge Code to spin up other CPUs on a VAX 8200 system.
Haven't solved the printf() problem yet, though.
 1.22 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.21 09-Apr-2000  ragge branches: 1.21.2;
Fix TOY clock reading/writing on KA820.
 1.20 28-Mar-2000  simonb Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
 1.19 26-Mar-2000  ragge Need some vectors and pointers to be set before IPL is lowered.
 1.18 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.17 06-Sep-1999  ragge branches: 1.17.2;
Styr upp deklarationen av clockchippsparametrarna.
 1.16 04-Aug-1999  ragge Adopt to new BI bus design.
 1.15 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.14 02-Feb-1999  ragge branches: 1.14.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.13 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.12 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.11 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.10 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.9 13-Apr-1998  ragge Wall cleaning.
 1.8 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.7 12-Jan-1998  thorpej Update for changes to config.
 1.6 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.5 18-Apr-1997  ragge Change implementation of TOY clock addressing. Gives us only
one routine for three different HW implementations.
 1.4 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.3 13-Oct-1996  christos branches: 1.3.6;
backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 20-Jul-1996  ragge Support for VAX8200; the ka820/ka825 CPUs.
 1.3.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.14.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.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.21.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.30.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.31.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.31.8.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.31.8.1 03-Jun-2001  ragge file ka820.c was added on branch nathanw_sa on 2002-03-29 23:22:45 +0000
 1.31.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.36.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.36.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.36.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.36.2.1 03-Aug-2004  skrll Sync with HEAD
 1.41.2.5 17-Mar-2008  yamt sync with head.
 1.41.2.4 27-Feb-2008  yamt sync with head.
 1.41.2.3 03-Sep-2007  yamt sync with head.
 1.41.2.2 30-Dec-2006  yamt sync with head.
 1.41.2.1 21-Jun-2006  yamt sync with head.
 1.45.8.1 14-Sep-2006  yamt sync with head.
 1.45.4.1 09-Sep-2006  rpaulo sync with head
 1.46.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.47.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.47.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.47.36.1 24-Mar-2008  keiichi sync with head.
 1.47.20.1 23-Mar-2008  matt sync with HEAD
 1.49.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.49.4.2 11-Mar-2010  yamt sync with head
 1.49.4.1 04-May-2009  yamt sync with head.
 1.52.4.2 12-Jun-2011  rmind sync with head
 1.52.4.1 05-Mar-2011  rmind sync with head
 1.53.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.53.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.54.16.1 18-May-2014  rmind sync with head
 1.54.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.54.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.56.30.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.37 02-Feb-2024  andvar fix various typos in comments.
 1.36 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.35 24-Apr-2021  thorpej branches: 1.35.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.34 14-Dec-2010  matt branches: 1.34.74;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.33 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.32 16-Dec-2008  christos branches: 1.32.4; 1.32.6;
replace bitmask_snprintf(9) with snprintb(3)
 1.31 11-Mar-2008  matt branches: 1.31.4; 1.31.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.30 04-Mar-2007  christos branches: 1.30.20; 1.30.36; 1.30.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.29 05-Sep-2006  matt branches: 1.29.8;
Switch VAX over to generic TODR
 1.28 24-Dec-2005  perry branches: 1.28.4; 1.28.8;
bare asm -> __asm
 1.27 11-Dec-2005  christos merge ktrace-lwp.
 1.26 29-Jun-2005  ragge branches: 1.26.2;
Print manufacturing plant information at boot, from Johnny Billquist.
 1.25 27-Jun-2005  ragge Update according to cast-qual addition.
 1.24 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.23 15-Jul-2003  lukem __KERNEL_RCSID()
 1.22 19-Jan-2003  ragge branches: 1.22.2;
Add some instrumentation and clean up some VAX8600 code.
From Johnny Billquist.
 1.21 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.20 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.19 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.18 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.17 24-Jul-2002  ragge Don't complain about Abuses that don't exist and tell about unsupported CI's.
From Johnny Billquist.
 1.16 09-Aug-2000  tv branches: 1.16.4; 1.16.8; 1.16.16;
%b -> bitmask_snprintf()
 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 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.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 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.11 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.10 22-May-1998  ragge Remove unnecessary code for interrupt vector handling.
 1.9 13-Apr-1998  ragge Wall cleaning.
 1.8 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.7 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.6 13-Oct-1996  christos branches: 1.6.6;
backout previous kprintf change
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.3 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.2 08-Mar-1996  ragge Support for the RL02 disk at the PDP11 frontend console added.
 1.1 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.6.6.1 12-Mar-1997  is Merge in changes from Trunk
 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.16.1 31-Aug-2002  gehenna catch up with -current.
 1.16.8.3 03-Jan-2003  thorpej Sync with HEAD.
 1.16.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.16.8.1 01-Aug-2002  nathanw Catch up to -current.
 1.16.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.16.4.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.22.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.22.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.2.4 17-Mar-2008  yamt sync with head.
 1.26.2.3 03-Sep-2007  yamt sync with head.
 1.26.2.2 30-Dec-2006  yamt sync with head.
 1.26.2.1 21-Jun-2006  yamt sync with head.
 1.28.8.1 14-Sep-2006  yamt sync with head.
 1.28.4.1 09-Sep-2006  rpaulo sync with head
 1.29.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.30.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.30.36.1 24-Mar-2008  keiichi sync with head.
 1.30.20.1 23-Mar-2008  matt sync with HEAD
 1.31.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.31.4.2 11-Aug-2010  yamt sync with head.
 1.31.4.1 04-May-2009  yamt sync with head.
 1.32.6.2 05-Mar-2011  rmind sync with head
 1.32.6.1 03-Jul-2010  rmind sync with head
 1.32.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.34.74.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.35.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.22 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.21 03-Mar-2022  riastradh vax: Use device_set_private.
 1.20 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.19 22-May-2017  ragge branches: 1.19.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.18 26-Mar-2014  christos branches: 1.18.6;
fix printf issues
 1.17 24-Mar-2014  christos use cpu_{g,s}etmodel
 1.16 05-Jun-2011  matt branches: 1.16.2; 1.16.12; 1.16.16;
device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.15 14-Dec-2010  matt branches: 1.15.2; 1.15.6;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.14 21-Nov-2009  rmind branches: 1.14.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.13 11-Mar-2008  matt branches: 1.13.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.12 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.11 04-Mar-2007  christos branches: 1.11.20; 1.11.36; 1.11.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 05-Sep-2006  matt branches: 1.10.8;
Switch VAX over to generic TODR
 1.9 24-Dec-2005  perry branches: 1.9.4; 1.9.8;
bare asm -> __asm
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 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.6 15-Jul-2003  lukem branches: 1.6.16;
__KERNEL_RCSID()
 1.5 02-Oct-2002  thorpej branches: 1.5.6;
Add trailing ; to CFATTACH_DECL.
 1.4 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 12-Apr-2001  thorpej branches: 1.2.2; 1.2.8;
splimp -> splhigh
 1.1 26-Jul-2000  ragge branches: 1.1.2; 1.1.4;
Support for the KA88 CPU and the NMI backplane.
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.3 21-Apr-2001  bouyer 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.c was added on branch thorpej_scsipi on 2000-11-20 20:33:24 +0000
 1.2.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.8.1 12-Apr-2001  nathanw file ka88.c was added on branch nathanw_sa on 2002-10-18 02:40:35 +0000
 1.2.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.5.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.5 17-Mar-2008  yamt sync with head.
 1.6.16.4 27-Feb-2008  yamt sync with head.
 1.6.16.3 03-Sep-2007  yamt sync with head.
 1.6.16.2 30-Dec-2006  yamt sync with head.
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.9.8.1 14-Sep-2006  yamt sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.36.1 24-Mar-2008  keiichi sync with head.
 1.11.20.1 23-Mar-2008  matt sync with HEAD
 1.13.4.1 11-Mar-2010  yamt sync with head
 1.14.4.2 12-Jun-2011  rmind sync with head
 1.14.4.1 05-Mar-2011  rmind sync with head
 1.15.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.15.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.16.16.1 18-May-2014  rmind sync with head
 1.16.12.2 03-Dec-2017  jdolecek update from HEAD
 1.16.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.6.1 28-Aug-2017  skrll Sync with HEAD
 1.19.10.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 28-Apr-2023  skrll Pass local symbols relocations in both passes and provide the kobj_reloc
implementation visibility of these relocations.

Currently all implementations resolve local symbol relocations in the first
pass and simply skip them in the second. The RISC-V implementation will
make use of this visiblity.
 1.1 30-Apr-2018  ragge branches: 1.1.2;
Kernel linker support for vax. Now modules can be loaded again.
XXX - should keep modules on physical segment instead of in KVM.
 1.1.2.2 02-May-2018  pgoyette Synch with HEAD
 1.1.2.1 30-Apr-2018  pgoyette file kobj_machdep.c was added on branch pgoyette-compat on 2018-05-02 07:20:05 +0000
 1.19 06-Apr-2022  riastradh 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.18 09-Dec-2013  wiz Fix typo ("then" instead of "than")
 1.17 13-Nov-2010  matt branches: 1.17.8; 1.17.18; 1.17.22;
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.16 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.15 25-May-2008  chs branches: 1.15.18; 1.15.20;
enable profiling of assembly functions.
 1.14 28-Apr-2008  martin branches: 1.14.2;
Remove clause 3 and 4 from TNF licenses
 1.13 11-Mar-2008  matt branches: 1.13.2; 1.13.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.12 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.11 22-Feb-2008  matt Switch NetBSD/vax to the CAS model of mutexes. Fix the locking primitives
in lock_stubs.S so they actually function correctly.
 1.10 13-Feb-2008  matt branches: 1.10.2; 1.10.6;
Fix typo (casdata/cashash)
 1.9 10-Feb-2008  ad Add aliases for atomic_cas_foo_ni().
 1.8 03-Feb-2008  matt Add {,_}atomic_cas_{32,ptr,uint,ulong}. Nuke rw_cas
 1.7 22-Nov-2007  yamt fix changes which i forgot to commit with sys/arch/vax/include/mutex.h rev.1.9.
 1.6 17-Oct-2007  garbled branches: 1.6.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.5 17-May-2007  yamt branches: 1.5.8; 1.5.10; 1.5.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.4 06-Apr-2007  matt branches: 1.4.4;
Fix boolean inversion and missing definition.
 1.3 12-Mar-2007  matt branches: 1.3.2;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.2 17-Feb-2007  matt branches: 1.2.2; 1.2.4; 1.2.8;
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.8.4 03-Dec-2007  ad Sync with HEAD.
 1.2.8.3 27-May-2007  ad Sync with head.
 1.2.8.2 10-Apr-2007  ad Sync with head.
 1.2.8.1 13-Mar-2007  ad Sync with head.
 1.2.4.8 17-Mar-2008  yamt sync with head.
 1.2.4.7 27-Feb-2008  yamt sync with head.
 1.2.4.6 11-Feb-2008  yamt sync with head.
 1.2.4.5 04-Feb-2008  yamt sync with head.
 1.2.4.4 07-Dec-2007  yamt sync with head
 1.2.4.3 03-Sep-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 lock_stubs.S was added on branch yamt-lazymbuf on 2007-02-26 09:08:41 +0000
 1.2.2.4 15-Apr-2007  yamt sync with head.
 1.2.2.3 07-Apr-2007  matt sync with HEAD
 1.2.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.2.2.1 17-Feb-2007  rmind file lock_stubs.S was added on branch yamt-idlelwp on 2007-03-12 05:51:19 +0000
 1.3.2.1 11-Jul-2007  mjf Sync with head.
 1.4.4.1 22-May-2007  matt Update to HEAD.
 1.5.14.1 22-Nov-2007  bouyer Sync with HEAD
 1.5.10.3 23-Mar-2008  matt sync with HEAD
 1.5.10.2 09-Jan-2008  matt sync with HEAD
 1.5.10.1 06-Nov-2007  matt sync with HEAD
 1.5.8.1 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.6.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.6.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.10.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.10.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.2.1 24-Mar-2008  keiichi sync with head.
 1.13.4.3 11-Aug-2010  yamt sync with head.
 1.13.4.2 04-May-2009  yamt sync with head.
 1.13.4.1 16-May-2008  yamt sync with head.
 1.13.2.2 04-Jun-2008  yamt sync with head
 1.13.2.1 18-May-2008  yamt sync with head.
 1.14.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.15.20.2 05-Mar-2011  rmind sync with head
 1.15.20.1 03-Jul-2010  rmind sync with head
 1.15.18.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.17.22.1 18-May-2014  rmind sync with head
 1.17.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.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.3 08-Oct-1994  mycroft Clean up deleted files.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file locon.s was added on branch netbsd-1-0 on 1994-08-16 23:47:30 +0000
 1.84 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.83 27-Aug-2015  jklos Cosmetic fix for VAXstation 4000/90, 90a, 96 dmesg output from Felix
Deichmann.
 1.82 23-May-2014  martin branches: 1.82.4;
#ifdef a variable like its only use
 1.81 24-Mar-2014  christos branches: 1.81.2;
use cpu_{g,s}etmodel
 1.80 03-Jul-2011  matt branches: 1.80.2; 1.80.12; 1.80.16;
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.79 14-Dec-2010  matt Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.78 27-Nov-2009  rmind branches: 1.78.4;
- Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.
- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places. Reduce sys/user.h inclusions.
 1.77 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.76 22-Jan-2009  christos Patches from Brad Parker to support vax730.
 1.75 11-Mar-2008  matt branches: 1.75.4; 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 03-Feb-2008  matt branches: 1.74.2; 1.74.6;
misc type cleanups
 1.73 04-Mar-2007  christos branches: 1.73.20; 1.73.26;
Fix caddr_t fallout.
 1.72 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.71 24-Dec-2005  perry branches: 1.71.26;
bare asm -> __asm
 1.70 11-Dec-2005  christos merge ktrace-lwp.
 1.69 11-Oct-2004  christos branches: 1.69.12;
PR/27218: Kirk Russell: kernel incorrectly identifies a KA692 CPU as a
KA694 during boot
 1.68 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.67 15-Jul-2003  lukem __KERNEL_RCSID()
 1.66 18-Jan-2003  thorpej branches: 1.66.2;
Merge the nathanw_sa branch.
 1.65 01-Dec-2002  matt Fix inconsistencies in various definitions of avail_*, virtual_*, and
proc0paddr.
 1.64 04-Jun-2002  ragge Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.63 28-Sep-2001  chs branches: 1.63.4; 1.63.12; 1.63.14;
don't depend on other headers to include sys/proc.h for us.
 1.62 18-Sep-2001  ragge Some ID strings + other consistency fixes, from Michael Kukat.
 1.61 12-Jun-2001  ragge branches: 1.61.2; 1.61.4;
Detect 4000/VLC correctly + make halt/reboot work.
From Michael L. Hitch (mhitch@montana.edu).
 1.60 05-Jun-2001  ragge Detect MicroVAX 3100/m80 correctly. From Michael Kukat.
 1.59 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.58 01-May-2001  ragge Detect 4000/500A, 4000/600A and 4000/705A. Also detect MicroVAX 1.
 1.57 24-Apr-2001  ragge Support for KA681 (4000/500A) from Michael Kukat.
 1.56 31-Mar-2001  ragge (Untested) recognition of KA55.
 1.55 04-Feb-2001  ragge branches: 1.55.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.54 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.53 21-Nov-2000  chs eliminate TRUNC_PAGE() and ROUND_PAGE() in favor of their
lowercase counterparts. also, a little misc cleanup.
 1.52 04-Sep-2000  ragge Fix to correctly identify 3100/m30. From moj@stacken.kth.se.
 1.51 26-Jul-2000  ragge Remove the use of global "mastercpu", the world is different now.
 1.50 19-Jul-2000  matt More ELF changes (a.out still works).
 1.49 06-Jul-2000  ragge Recognise VAX 6000/400.
 1.48 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.47 12-Jun-2000  ragge branches: 1.47.2;
Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.46 20-May-2000  ragge branches: 1.46.2;
Changes to use the RPB for different tasks. Much simpler now to find the
boot device.
 1.45 08-May-2000  ragge Some more CPUs... From Michael Kukat.
 1.44 28-Mar-2000  simonb Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
 1.43 26-Mar-2000  ragge Identify ourselves.
 1.42 17-Jan-2000  matt defopt VAXnnn so the make depend does the right thing.
 1.41 20-Oct-1999  ragge Clear proc0 uarea, otherwise subsequent processes will inherit the
virtual timers and get unwanted signals. This has been around since
long time back...
 1.40 27-Aug-1999  ragge branches: 1.40.2; 1.40.4; 1.40.6;
CPU support for 4000/90 (KA49).
 1.39 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.38 06-Jun-1999  ragge Complete support for VAX 4000/300. From Michael Kukat. (michael@camaronet.de)
 1.37 23-May-1999  ragge Better and more understandable way to find out CPU type.
 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 26-Mar-1999  ragge branches: 1.35.2;
Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.34 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 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 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.31 29-Nov-1998  ragge vm_offset_t -> vaddr_t. Count up memory here.
 1.30 10-Aug-1998  ragge Basic support for VS4000/60.
 1.29 21-Jun-1998  ragge Fix more compile errors. Pointed out by David Brownlee.
 1.28 20-Jun-1998  ragge Fix some compile-time warnings. Pointed out by David Brownlee.
 1.27 08-Jun-1998  ragge Wall fixes.
 1.26 07-Jun-1998  ragge Identify 3100/m38 + /m48
 1.25 04-Jun-1998  ragge Clean upp system detect code. Enable primary cache on VS3100.
 1.24 03-May-1998  ragge Enable -Wall -Wmissing-prototypes -Wstrict-prototypes.
 1.23 18-Jan-1998  ragge Fix page size initialisation.
 1.22 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.21 06-Apr-1997  ragge & should be |.
 1.20 22-Mar-1997  ragge CPU support for MV3100. (KA41)
 1.19 15-Mar-1997  ragge Cleanup. Prepare for getting memory size from boot (VMB).
 1.18 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.17 20-Aug-1996  ragge branches: 1.17.6;
Support for cmi bus on 11/750.
 1.16 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.15 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.14 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.13 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.12 02-Feb-1996  mycroft Fix #includes.
 1.11 28-Jan-1996  ragge Fix bug causing the kernel symbol table not to be loaded.
Save all registers on panic().
 1.10 13-Dec-1995  ragge CPU dependent code moved out of cpu independent modules.
 1.9 10-Nov-1995  ragge Allow for dynamic allocation of interrupt vectors.
COMPAT_RENO removed.
Handle memory errors.
uap->sigcntxp -> SCARG(uap, sigcntxp)
 1.8 16-Jun-1995  ragge rudimentary DDB support.
 1.7 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.6 05-May-1995  ragge Removed kernel stack relocation and double-mapping.
Speeded up fork() significantly.
 1.5 03-May-1995  ragge Changed conf.c to new style. Took away double saving of regs in traps.
Changed boot() to use vfs_shutdown(). Updated setregs.
 1.4 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.3 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.2 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.1 25-Nov-1994  ragge Lots of fixes and updates.
 1.17.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.35.2.2 01-Mar-2000  he Apply patch (requested by toddpw):
Fix bugs in support for VaxStation 2000 and 3100, vax pmap, and
the NCR scsi driver.
 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.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.5 21-Apr-2001  bouyer Sync with HEAD
 1.40.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.40.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.40.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.40.2.1 20-Oct-1999  thorpej Sync w/ trunk.
 1.46.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.47.2.1 04-Sep-2000  ragge Pull up revision 1.52 (approved by thorpej):
Fix to correctly identify 3100/m30. From moj@stacken.kth.se.
 1.55.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.55.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.61.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.61.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.61.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.63.14.1 05-Jun-2002  lukem Pull up revision 1.64 (requested by ragge in ticket #157):
Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.63.12.1 15-Jul-2002  gehenna catch up with -current.
 1.63.4.5 11-Dec-2002  thorpej Sync with HEAD.
 1.63.4.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.63.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.63.4.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.63.4.1 28-Sep-2001  ragge file locore.c was added on branch nathanw_sa on 2002-03-29 23:22:45 +0000
 1.66.2.4 19-Oct-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.69.12.4 17-Mar-2008  yamt sync with head.
 1.69.12.3 04-Feb-2008  yamt sync with head.
 1.69.12.2 03-Sep-2007  yamt sync with head.
 1.69.12.1 21-Jun-2006  yamt sync with head.
 1.71.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.73.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.73.20.1 23-Mar-2008  matt sync with HEAD
 1.74.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.74.2.1 24-Mar-2008  keiichi sync with head.
 1.75.12.1 03-Mar-2009  skrll Sync with HEAD.
 1.75.4.2 11-Mar-2010  yamt sync with head
 1.75.4.1 04-May-2009  yamt sync with head.
 1.78.4.1 05-Mar-2011  rmind sync with head
 1.80.16.1 18-May-2014  rmind sync with head
 1.80.12.2 03-Dec-2017  jdolecek update from HEAD
 1.80.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.80.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.81.2.1 10-Aug-2014  tls Rebase.
 1.82.4.2 28-Aug-2017  skrll Sync with HEAD
 1.82.4.1 22-Sep-2015  skrll Sync with HEAD
 1.3 08-Oct-1994  mycroft Clean up deleted files.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file locore.s was added on branch netbsd-1-0 on 1994-08-16 23:47:32 +0000
 1.201 09-Mar-2025  hans vax: call config_init() before initializing the console

With console on dz(4) at vsbus, dzcnpollc() calls vsbus_setmask() to
mask interrupts, which in turn calls device_lookup_private() to find
the vsbus softc. When booting into ddb(4) with a DIAGNOSTIC kernel,
this panics as the autoconf alldevs_lock hasn't been initialized yet.
 1.200 17-May-2024  thorpej branches: 1.200.2;
Implement _UC_SETSTACK / _UC_CLRSTACK.
 1.199 05-Mar-2024  thorpej Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().

It's a small step, but it's a step.
 1.198 11-Jan-2024  mrg vax: set default RLIMIT_AS to the same as MAXDSIZ

this allows modern GCC to run without returning to the issues that
reported in PR#28379, and avoids a strange sort-of-invariant violation
where the rlimit for data equaled the rlimit for all address space, so
there is no room for text or stack etc.

ok ragge@

XXX: pullup-10
 1.197 05-Jan-2024  hans Include leds.h to make /dev/leds work.
 1.196 11-Jun-2020  ad branches: 1.196.20;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
 1.195 31-Dec-2019  ad Rename uvm_free() -> uvm_availmem().
 1.194 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.193 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.192 31-Mar-2018  ragge branches: 1.192.2;
Set max/dfl size for vm a process may have to the same as for data.
This avoids a problem where mmap may lock processes in the system,
and solves PR port-vax/28379.
 1.191 16-Dec-2014  jklos branches: 1.191.2; 1.191.8; 1.191.16;
Fix leds.h include.
 1.190 24-Mar-2014  christos branches: 1.190.6;
use cpu_{g,s}etmodel
 1.189 27-Aug-2012  martin branches: 1.189.2; 1.189.4;
Kernel crash dumps are not properly implemented - so do not pretend they
would exist and set dumplo to 0 if dumpsize is 0. This makes savecore
happy.
XXX - implement real dumps, most of the needed code seems to be in place
already.
 1.188 21-May-2012  martin Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.

To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.

Add an exhaustive atf test case, based partly on code from Joel Sing.

Should finally fix the remaining open part of PR kern/43903.
 1.187 27-Feb-2012  matt physmem is declared by uvm
 1.186 19-Feb-2012  rmind Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.185 27-Jan-2012  para branches: 1.185.2;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.184 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.183 12-Dec-2011  mrg implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.
 1.182 03-Jul-2011  matt branches: 1.182.2; 1.182.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.181 12-Jun-2011  rmind 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.180 14-Dec-2010  matt branches: 1.180.6;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.179 08-Feb-2010  joerg branches: 1.179.2;
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.178 21-Nov-2009  rmind branches: 1.178.2;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.177 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.176 21-Oct-2009  rmind 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.175 18-Mar-2009  cegger bcopy -> memcpy
 1.174 13-Feb-2009  apb Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
 1.173 21-Jan-2009  he branches: 1.173.2;
Re-adapt to the changed return types for major() and minor().
 1.172 11-Jan-2009  christos fix dev_t printf formats.
 1.171 30-Nov-2008  martin As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
 1.170 19-Nov-2008  hans fix build for kernel configs lacking KA46, KA48, KA49 and KA53 support.
OK by mhitch.
 1.169 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.168 11-Nov-2008  dyoung It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks(). Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown(). No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown(). I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that. Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
 1.167 17-Oct-2008  cegger branches: 1.167.2; 1.167.4;
build fix: get prototype for cpu_upcall()
 1.166 15-Oct-2008  wrstuden Merge wrstuden-revivesa into HEAD.
 1.165 02-Jul-2008  ad branches: 1.165.2;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.164 11-Mar-2008  matt branches: 1.164.4; 1.164.6; 1.164.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.163 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.162 21-Feb-2008  matt branches: 1.162.2; 1.162.6;
More softint fixes. We need to restore the softint lwp's pcb to it's initial
state since it may have been blocked or interrupted by another softint.
 1.161 20-Feb-2008  matt Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.160 03-Feb-2008  matt Make process_sstep use ANSI declaration.
 1.159 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.158 04-Mar-2007  christos branches: 1.158.2; 1.158.18; 1.158.20; 1.158.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.157 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.156 17-Feb-2007  pavel Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
 1.155 16-Feb-2007  matt branches: 1.155.2;
Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.154 09-Feb-2007  ad Merge newlock2 to head.
 1.153 25-Oct-2006  he Propagate const, prompted by new gcc.
 1.152 24-Dec-2005  perry branches: 1.152.20; 1.152.22;
bare asm -> __asm
 1.151 11-Dec-2005  christos merge ktrace-lwp.
 1.150 01-Jun-2005  scw branches: 1.150.2;
Declare the second arg of process_write_{fp,}regs() to be const.
This permits sh5 to continue to re-use those functions in cpu_setmcontext()
with the recent change to Makefile.kern.inc (revision 1.62).
 1.149 25-Apr-2005  lukem Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.
 1.148 09-Apr-2005  matt Rework cpu_upcall. Actually build a stack frame and argument list and
don't use a trampoline.
 1.147 01-Apr-2005  yamt merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.146 24-Apr-2004  atatat branches: 1.146.4; 1.146.6;
The second "console_device" node should really be called "booted_device".
 1.145 24-Mar-2004  atatat branches: 1.145.2;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
 1.144 30-Dec-2003  pk Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
 1.143 08-Dec-2003  matt Strings (even ifdef'ed out) can't run past the end of the line. Use
ANSI string concatenation.
 1.142 04-Dec-2003  atatat Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
 1.141 29-Sep-2003  matt Fix GCC3'ism's
 1.140 29-Sep-2003  matt Add SA_SIGINFO support for VAX.
 1.139 26-Sep-2003  simonb Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
 1.138 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.137 15-Jul-2003  lukem __KERNEL_RCSID()
 1.136 23-Jun-2003  martin branches: 1.136.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.135 26-Apr-2003  ragge Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.134 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.133 01-Mar-2003  matt Add machdep sysctl support. Support booted_device, consdev, and
printfataltraps.
 1.132 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.131 01-Dec-2002  matt Fix inconsistencies in various definitions of avail_*, virtual_*, and
proc0paddr.
 1.130 14-Nov-2002  ragge Fix for a problem where an user can crash the machine via sigreturn(),
noticed by and fix from Miod Vallat <miod@openbsd.org>.

Miod's OpenBSD log message:
> Don't uvm_useracc the user sigcontext in sys_sigreturn and then access
> the user addresses directly from the kernel. copyin is faster and can
> correctly deal properly with mappings that uvm_useracc thinks are
> correct but will fault anyway (to figure out how to generate such
> mappings is left as en excercise for the reader).
>
> Blatantly stolen from art@'s similar fix to sparc.
 1.129 28-Sep-2002  ragge 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.128 25-Sep-2002  thorpej Don't use rmaps; use extent maps instead.
 1.127 12-Sep-2002  ragge Fix a signal handler bug originally reported by Hugh Graham some year ago:
If two signals are sent after each other without the process being run in
userspace between them then the second one will overwrite part of the signal
info stored on the userstack.
Fixed by rewriting and simplifying both the signal delivery code and the
trampoline code. Also bump signal version number to 2.
 1.126 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.125 25-Aug-2002  thorpej Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
 1.124 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.123 31-Mar-2002  matt branches: 1.123.2;
Make ddb symbol loading work for ELF as well a.out.
 1.122 06-Mar-2002  tsutsui Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.
 1.121 24-Feb-2002  matt Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.120 10-Sep-2001  chris branches: 1.120.4;
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.119 24-Aug-2001  chs branches: 1.119.2;
use pmap_k* for buffer cache pages.
 1.118 30-Jun-2001  ragge branches: 1.118.2;
Do more intelligent calculation of KVM size. This reduces the amount of
pre-allocated physical memory significantly.
A 11/750, for example, get 2MB more free (of 14MB), about 12%.
 1.117 02-Jun-2001  chs replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.116 29-May-2001  ragge Must lock kernel when softclock is called from outside hardclock.
 1.115 02-May-2001  matt Use the symtab info given by loadfile in the booter instead of assuming
we know where it is. This is a requirement for ELF.
 1.114 30-Apr-2001  matt Move RB_KDB check to after VM is init so that there's an
interrupt stack for DDB to run on. This makes boot -d work.
 1.113 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.112 15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.111 15-Jan-2001  thorpej branches: 1.111.2;
Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.110 22-Dec-2000  jdolecek split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
 1.109 18-Oct-2000  matt add a clarifying comment.
 1.108 13-Sep-2000  thorpej Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.
 1.107 08-Sep-2000  ragge By some reason setstatclockrate() suddenly get called occationally
(it hasn't been called since -94 :-) Remove the panic that happens when
it is called.
 1.106 26-Jul-2000  ragge Add bi interrupt allocator. Should be somewhere else.
 1.105 02-Jul-2000  cgd Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.
 1.104 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.103 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.102 05-Jun-2000  jhawk Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)
 1.101 02-Jun-2000  matt Add IPL_* codes.
Add other codes for struct references.
Add softintr framework for IPL_SOFTNET and IPL_SOFTSERIAL.
General cleanup of .s files replacing hardcoded structure offsets with
symbolic ones.
 1.100 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.99 26-May-2000  thorpej branches: 1.99.2;
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.98 16-Apr-2000  ragge Call doshutdownhooks().
 1.97 28-Mar-2000  simonb Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
 1.96 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.95 07-Mar-2000  matt add real vmapbuf/vunmapbuf routines. needed for VS4000 SCSI support.
 1.94 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.93 19-Jan-2000  thorpej Move callout initialization to a single location; no need to duplicate
that code all over the place.
 1.92 16-Jan-2000  ragge Bogus context pointer sent to sigreturn() may crash the machine.
Bug found by der Mouse.
 1.91 11-Dec-1999  ragge CL* discarding.
Move physmem setting to pmap_bootstrap().
Fix security problem in process_write_regs(), found by Klaus Klein.
 1.90 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.89 27-Oct-1999  ragge Let smg be probed as all other possible consoles.
 1.88 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.87 17-Sep-1999  thorpej branches: 1.87.2; 1.87.4; 1.87.6;
Centralize the declaration and clearing of `cold'.
 1.86 12-Aug-1999  ragge PGOFSET should be VAX_PGOFSET.
Remove two unused prototypes.
 1.85 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.84 26-May-1999  thorpej Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.
 1.83 20-May-1999  lukem * convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes
 1.82 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.81 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.80 25-Apr-1999  simonb g/c REAL_CLISTS.
 1.79 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.78 14-Apr-1999  ragge Use the pool allocator for mbufs instead of a separate submap.
 1.77 11-Apr-1999  chs add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.
 1.76 01-Apr-1999  thorpej branches: 1.76.2;
Don't call configure() from cpu_startup().
 1.75 26-Mar-1999  mycroft Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.74 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.73 13-Mar-1999  ragge 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.72 27-Feb-1999  scottr defopt BUFCACHE and BUFPAGES.
 1.71 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.70 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.69 09-Jan-1999  thorpej Garbage-collect `mbutl'.
 1.68 19-Dec-1998  ragge Fix bufpages miscalculation. At the same time, make bufpages configurable
att compile time.
 1.67 29-Nov-1998  ragge uvm_km_alloc -> uvm_km_zalloc.
 1.66 05-Nov-1998  ragge EGCS fixes.
 1.65 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.64 06-Oct-1998  thorpej Provide configure(), rather than open-coding it in cpu_startup().
 1.63 06-Oct-1998  matt 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.62 02-Oct-1998  drochner use old sigmask in sigcontext and old sigreturn syscall in Ultrix
emulation mode
 1.61 30-Sep-1998  ragge Make kernel compile after recent signal changes.
 1.60 05-Jul-1998  jonathan defopt NS, NSIP.
 1.59 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.58 04-Jul-1998  jonathan defopt DDB.
 1.57 20-Jun-1998  ragge Fix after current DDB changes.
 1.56 08-Jun-1998  ragge Wall fixes.
 1.55 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.54 08-May-1998  kleink Fix some arithmetics lossage on typeless pointers.
 1.53 02-Mar-1998  ragge Support for UVM on VAXen.
 1.52 19-Feb-1998  thorpej Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.
 1.51 24-Jan-1998  mycroft When dumping, print out the device number as major,minor.
 1.50 04-Nov-1997  ragge Move some interrupt routines out to assembler.
Optimize (slightly) pmap_clear_modify.
 1.49 04-Nov-1997  ragge Optimized copy/fetch/store routines; rewritten in assembler.
 1.48 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.47 19-Oct-1997  ragge branches: 1.47.2;
#include <vm/vm.h>. Fix some erroneous declarations.
 1.46 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.45 26-Jul-1997  ragge branches: 1.45.2; 1.45.4;
Actually do 'halt' or 'reboot' on MicroVAX.
 1.44 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainilne.
 1.43 09-Jun-1997  veego Initialize machine from MACHINE and machine_arch from MACHINE_ARCH.
 1.42 06-Jun-1997  veego Add 'char machine_arch[] = "xxx";' for the new sysctl hw.machine_arch.
 1.41 19-Apr-1997  ragge branches: 1.41.2;
Fix so that these files compile again after recent ARP changes.
 1.40 03-Apr-1997  christos Add netatalk netisr
 1.39 27-Mar-1997  thorpej Don't allocate mclrefcnt[]; it's dead and gone.
 1.38 26-Mar-1997  gwr Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/
 1.37 15-Mar-1997  ragge Clean up console autoconfiguration so that the VAXstation DZ11-like
console work.
 1.36 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.35 11-Jan-1997  ragge branches: 1.35.4; 1.35.6;
Prototype updates.
 1.34 13-Oct-1996  christos backout previous kprintf change
 1.33 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.32 09-Aug-1996  mrg Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.
 1.31 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.30 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.29 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.28 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.27 03-Mar-1996  ragge Fix fuswintr/suswintr arguments to match prototype.
 1.26 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.25 11-Feb-1996  ragge Fix cpu_sysctl() arguments to be like prototype.
 1.24 02-Feb-1996  mycroft Fix #includes.
 1.23 28-Jan-1996  ragge Save USP when trapping from userspace.
Change register save structs according to this.
Be compatible with the way old init passes flags (in registers).
 1.22 04-Jan-1996  jtc Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.
 1.21 13-Dec-1995  ragge MicroVAX III support added; now runs on VAX 3600/3800/3900 platforms.
 1.20 10-Nov-1995  ragge Allow for dynamic allocation of interrupt vectors.
COMPAT_RENO removed.
Handle memory errors.
uap->sigcntxp -> SCARG(uap, sigcntxp)
 1.19 07-Oct-1995  mycroft branches: 1.19.2;
Prefix names of system call implementation functions with `sys_'.
 1.18 02-Oct-1995  ragge #include "sys/mount.h" added.
 1.17 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.16 01-Sep-1995  mycroft SA_ONSTACK --> SS_ONSTACK
 1.15 05-Jul-1995  ragge Calling of pppintr() included.
 1.14 16-Jun-1995  ragge rudimentary DDB support.
 1.13 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.12 06-May-1995  ragge Kernel message buffer implemented.
 1.11 03-May-1995  ragge Changed conf.c to new style. Took away double saving of regs in traps.
Changed boot() to use vfs_shutdown(). Updated setregs.
 1.10 12-Apr-1995  ragge Fixes to conf.c
Cleaning of code.
 1.9 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.8 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.7 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.6 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.5 25-Nov-1994  ragge Lots of fixes and updates.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file machdep.c was added on branch netbsd-1-0 on 1994-08-16 23:47:35 +0000
 1.19.2.1 15-Oct-1995  ragge #include "sys/systm.h". Fixed bad function definition due to
prototypes. Typo in netintr(). Use SCARG() in sys_sigreturn().
 1.35.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.35.4.1 12-Feb-1997  mrg don't allocate swap map in allocsys.
 1.41.2.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.45.4.1 08-Sep-1997  thorpej Significantly restructure the way signal state for a process is stored.
Rather than using bitmasks to redundantly store the information kept
in the process's sigacts (because the sigacts was kept in the u-area),
hang sigacts directly off the process, and access it directly.

Simplify signal setup code tremendously by storing information in
the sigacts as an array of struct sigactions, rather than in a different
format, since userspace uses sigactions.

Make sigacts sharable by adding reference counting.
 1.45.2.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.47.2.1 19-Nov-1997  mellon Temporary workaround for ARP problem (veego)
 1.76.2.3 17-Jan-2000  he Apply patch (requested by ragge):
Prevent a crash if a bogus sigcontext pointer is passed to
sigreturn().
 1.76.2.2 16-Dec-1999  he Apply patch (requested by ragge):
In process_write_regs(), no checks were made to which bits in
the PSL that was altered. This means that the traced process
could gain any hardware privileges.
 1.76.2.1 16-Apr-1999  chs branches: 1.76.2.1.2;
pull up 1.76 -> 1.77:
add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.
 1.76.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.87.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.87.4.1 15-Nov-1999  fvdl Sync with -current
 1.87.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.87.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.87.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.87.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.99.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.111.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.111.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.118.2.6 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.118.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.118.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.118.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.118.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.118.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.119.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.120.4.15 05-Jan-2003  thorpej In cpu_upcall(), build a CALLG frame holding the arguments/count on
the stack, and provide an upcall trampoline that uses it to actually
call the upcall. No need to save regs, etc., since upcalls never
return.
 1.120.4.14 11-Dec-2002  thorpej Sync with HEAD.
 1.120.4.13 18-Oct-2002  nathanw Catch up to -current.
 1.120.4.12 05-Oct-2002  gmcgarry LWPify
 1.120.4.11 17-Sep-2002  nathanw Catch up to -current.
 1.120.4.10 27-Aug-2002  nathanw Catch up to -current.
 1.120.4.9 02-Aug-2002  nathanw LWPify sigexit() call.
 1.120.4.8 01-Aug-2002  nathanw Catch up to -current.
 1.120.4.7 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.120.4.6 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.120.4.5 17-Apr-2002  nathanw Catch up to -current.
 1.120.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.120.4.3 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.120.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.120.4.1 10-Sep-2001  nathanw file machdep.c was added on branch nathanw_sa on 2002-02-28 04:12:31 +0000
 1.123.2.3 31-Aug-2002  gehenna catch up with -current.
 1.123.2.2 17-Jul-2002  gehenna catch up with -current.
 1.123.2.1 17-May-2002  gehenna Replace the access to devsw table and the hard-coded major with devsw API.
 1.136.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.136.2.4 01-Apr-2005  skrll Sync with HEAD.
 1.136.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.136.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.136.2.1 03-Aug-2004  skrll Sync with HEAD
 1.145.2.1 26-Apr-2004  jdc Pull up revision 1.146 (requested by atatat in ticket #183)

The second "console_device" node should really be called "booted_device".
 1.146.6.1 12-Feb-2005  yamt use new apis.
 1.146.4.1 29-Apr-2005  kent sync with -current
 1.150.2.8 17-Mar-2008  yamt sync with head.
 1.150.2.7 27-Feb-2008  yamt sync with head.
 1.150.2.6 04-Feb-2008  yamt sync with head.
 1.150.2.5 07-Dec-2007  yamt sync with head
 1.150.2.4 03-Sep-2007  yamt sync with head.
 1.150.2.3 26-Feb-2007  yamt sync with head.
 1.150.2.2 30-Dec-2006  yamt sync with head.
 1.150.2.1 21-Jun-2006  yamt sync with head.
 1.152.22.1 10-Dec-2006  yamt sync with head.
 1.152.20.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.152.20.1 18-Nov-2006  ad Sync with head.
 1.155.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.155.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.158.26.2 18-Feb-2008  mjf Sync with HEAD.
 1.158.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.158.20.2 23-Mar-2008  matt sync with HEAD
 1.158.20.1 09-Jan-2008  matt sync with HEAD
 1.158.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.158.2.1 03-Dec-2007  ad Sync with HEAD.
 1.162.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.162.6.3 02-Jul-2008  mjf Sync with HEAD.
 1.162.6.2 03-Apr-2008  mjf Sync with HEAD.
 1.162.6.1 21-Feb-2008  mjf file machdep.c was added on branch mjf-devfs2 on 2008-04-03 12:42:29 +0000
 1.162.2.1 24-Mar-2008  keiichi sync with head.
 1.164.8.1 03-Jul-2008  simonb Sync with head.
 1.164.6.4 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.164.6.3 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.164.6.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.164.6.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.164.4.2 11-Mar-2010  yamt sync with head
 1.164.4.1 04-May-2009  yamt sync with head.
 1.165.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.165.2.1 19-Oct-2008  haad Sync with HEAD.
 1.167.4.1 22-Nov-2008  snj Pull up following revision(s) (requested by hans in ticket #102):
sys/arch/vax/vax/machdep.c: revision 1.170
fix build for kernel configs lacking KA46, KA48, KA49 and KA53 support.
OK by mhitch.
 1.167.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.167.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.167.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.173.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.178.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.179.2.4 05-Mar-2011  rmind sync with head
 1.179.2.3 25-Apr-2010  rmind A round of compile and other fixes to previous.
 1.179.2.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.179.2.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.180.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.182.6.6 02-Jun-2012  mrg sync to latest -current.
 1.182.6.5 06-Mar-2012  mrg sync to -current
 1.182.6.4 06-Mar-2012  mrg sync to -current
 1.182.6.3 04-Mar-2012  mrg sync to latest -current.
 1.182.6.2 24-Feb-2012  mrg sync to -current.
 1.182.6.1 18-Feb-2012  mrg merge to -current.
 1.182.2.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.182.2.3 30-Oct-2012  yamt sync with head
 1.182.2.2 23-May-2012  yamt sync with head.
 1.182.2.1 17-Apr-2012  yamt sync with head
 1.185.2.2 03-Sep-2012  riz Pull up following revision(s) (requested by martin in ticket #532):
sys/arch/vax/vax/machdep.c: revision 1.189
Kernel crash dumps are not properly implemented - so do not pretend they
would exist and set dumplo to 0 if dumpsize is 0. This makes savecore
happy.
XXX - implement real dumps, most of the needed code seems to be in place
already.
 1.185.2.1 21-May-2012  riz branches: 1.185.2.1.2;
Pull up following revision(s) (requested by martin in ticket #274):
sys/arch/amd64/amd64/process_machdep.c: revision 1.20
sys/kern/sys_lwp.c: revision 1.54
sys/arch/sparc64/sparc64/machdep.c: revision 1.267
sys/arch/mips/mips/cpu_subr.c: revision 1.16
sys/arch/vax/vax/machdep.c: revision 1.188
sys/sys/lwp.h: revision 1.161
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.98
sys/arch/alpha/alpha/machdep.c: revision 1.339
sys/compat/sys/ucontext.h: revision 1.6
sys/arch/hppa/hppa/hppa_machdep.c: revision 1.28
distrib/sets/lists/tests/mi: revision 1.469
sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.42
tests/lib/libc/sys/t_lwp_create.c: revision 1.1
tests/lib/libc/sys/Makefile: revision 1.23
sys/arch/arm/arm/sig_machdep.c: revision 1.42
sys/arch/amd64/include/mcontext.h: revision 1.15
sys/arch/amd64/amd64/machdep.c: revision 1.183
sys/arch/sh3/sh3/sh3_machdep.c: revision 1.99
sys/arch/i386/i386/machdep.c: revision 1.727
sys/compat/netbsd32/netbsd32_lwp.c: revision 1.13
sys/arch/sparc/sparc/machdep.c: revision 1.319
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.76
sys/arch/m68k/m68k/sig_machdep.c: revision 1.49
sys/sys/ucontext.h: revision 1.16
sys/arch/mips/mips/netbsd32_machdep.c: revision 1.9
lib/libc/sys/_lwp_create.2: revision 1.5
Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.
To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.
Add an exhaustive atf test case, based partly on code from Joel Sing.
Should finally fix the remaining open part of PR kern/43903.
 1.185.2.1.2.1 01-Nov-2012  matt sync with netbsd-6-0-RELEASE.
 1.189.4.1 18-May-2014  rmind sync with head
 1.189.2.2 03-Dec-2017  jdolecek update from HEAD
 1.189.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.190.6.1 06-Apr-2015  skrll Sync with HEAD
 1.191.16.2 18-Jan-2019  pgoyette Synch with HEAD
 1.191.16.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.191.8.1 27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.191.2.1 20-Jul-2016  pgoyette Adapt the machine/arch dependent code to the new {b,c}devsw reference
counting.

XXX Most of these will require testing by someone other than myself, as
I have a limited selection of hardware!
 1.192.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.192.2.1 10-Jun-2019  christos Sync with HEAD
 1.196.20.4 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1086):

sys/arch/vax/vax/machdep.c: revision 1.201

vax: call config_init() before initializing the console

With console on dz(4) at vsbus, dzcnpollc() calls vsbus_setmask() to
mask interrupts, which in turn calls device_lookup_private() to find
the vsbus softc. When booting into ddb(4) with a DIAGNOSTIC kernel,
this panics as the autoconf alldevs_lock hasn't been initialized yet.
 1.196.20.3 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.196.20.2 17-Feb-2024  martin Pull up following revision(s) (requested by hans in ticket #590):

sys/arch/vax/vax/machdep.c: revision 1.197

Include leds.h to make /dev/leds work.
 1.196.20.1 14-Jan-2024  martin Pull up following revision(s) (requested by mrg in ticket #552):

sys/arch/vax/vax/machdep.c: revision 1.198

vax: set default RLIMIT_AS to the same as MAXDSIZ
this allows modern GCC to run without returning to the issues that
reported in PR#28379, and avoids a strange sort-of-invariant violation
where the rlimit for data equaled the rlimit for all address space, so
there is no room for text or stack etc.

ok ragge@
 1.200.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 21-Jan-2002  jdolecek Switch to MI dev/md_root.c for archs which don't have any special
memory disk hooks (i.e. everything except atari).
 1.2 17-Mar-1999  sommerfe branches: 1.2.22; 1.2.26;
defopt MINIROOTSIZE
 1.1 29-Nov-1998  ragge Memory disk support.
 1.2.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.40 12-Jun-2011  rmind 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.39 08-Feb-2011  rmind branches: 1.39.2;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.38 19-Dec-2008  cegger branches: 1.38.4; 1.38.6; 1.38.8; 1.38.10;
use M_ZERO on malloc() and remove subsequent bzero().
 1.37 11-Mar-2008  matt branches: 1.37.4; 1.37.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.36 04-Mar-2007  christos branches: 1.36.20; 1.36.36; 1.36.40;
Fix caddr_t fallout.
 1.35 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.34 26-Dec-2006  elad branches: 1.34.2;
Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.
 1.33 22-Dec-2006  elad Add requests indicating access to unmanaged memory for arm, pc532, powerpc,
sh3, sh5, and vax, and use them instead of KAUTH_GENERIC_ISSUSER.

Update documentation and example secmodel code.
 1.32 23-Jul-2006  ad branches: 1.32.4; 1.32.8;
Use the LWP cached credentials where sane.
 1.31 14-May-2006  elad integrate kauth.
 1.30 11-Dec-2005  christos branches: 1.30.4; 1.30.6; 1.30.8; 1.30.10; 1.30.12;
merge ktrace-lwp.
 1.29 19-Oct-2003  ragge branches: 1.29.16;
Allow mmap() of /dev/mem.
 1.28 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.27 15-Jul-2003  lukem __KERNEL_RCSID()
 1.26 01-Apr-2003  thorpej branches: 1.26.2;
Use PAGE_SIZE rather than NBPG.
 1.25 01-Dec-2002  matt Fix inconsistencies in various definitions of avail_*, virtual_*, and
proc0paddr.
 1.24 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23 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.22 27-Feb-2002  christos branches: 1.22.8;
- Use DEV_ constants, instead of documenting the numbers!
- Delete cdev_decl(mm); where appropriate, and other hand-crufting [hi powerpc!]
 1.21 18-Feb-2001  ragge branches: 1.21.2; 1.21.4; 1.21.8;
Support to control the leds on VAXstations, taken from Sun3 and ported
to vax by Shinmyoh Koji (yesu@rb3.so-net.ne.jp).
 1.20 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.19 27-Jun-2000  ragge Make this file compile again.
 1.18 26-Jun-2000  simonb 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.17 04-Mar-2000  matt branches: 1.17.4;
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.16 11-Dec-1999  ragge CL* discarding.
 1.15 24-Mar-1999  mrg branches: 1.15.8; 1.15.14;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.14 10-Feb-1999  kleink Use of casts as lvalues is a GNU C extension; rearrange slightly.
 1.13 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


XXX XXX XXX
the d_mmap cdev routine should be changed to have a prototype like:
paddr_t (*d_mmap) __P((dev_t, off_t, int));

by someone!
 1.12 07-May-1998  kleink Fix some arithmetics lossage on typeless pointers.
 1.11 02-Mar-1998  ragge Support for UVM on VAXen.
 1.10 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.9 08-Apr-1996  ragge branches: 1.9.16;
Added prototypes to everything. Made all files compile with -Wall.
 1.8 30-Oct-1995  ragge Must use PAGE_SIZE family instead of NBPG family.
(phys page size != virt page size)
 1.7 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.6 10-Apr-1995  mycroft Add mmopen(), mmclose(), and mmmmap() where appropriate. Lock vmmap when
needed. Make types consistent.
 1.5 10-Apr-1995  mycroft Update to match hp300 port.
 1.4 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.3 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.9.16.1 23-Nov-1998  cgd Fix many real and potential security problems with character device
driver mmap routines that did not properly bounds check offsets.
See NetBSD security advisory NetBSD-SA1998-005 for details. Done
as a patch because it's large, and a fair number of bits are different
in -current. (mrg)
 1.15.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.8.2 12-Mar-2001  bouyer Sync with HEAD.
 1.15.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.17.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.21.8.4 11-Dec-2002  thorpej Sync with HEAD.
 1.21.8.3 11-Nov-2002  nathanw Catch up to -current
 1.21.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.21.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.21.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.21.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.21.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.22.8.1 17-May-2002  gehenna Add the character device switch.
 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.29.16.4 17-Mar-2008  yamt sync with head.
 1.29.16.3 03-Sep-2007  yamt sync with head.
 1.29.16.2 30-Dec-2006  yamt sync with head.
 1.29.16.1 21-Jun-2006  yamt sync with head.
 1.30.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.30.10.3 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.30.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.30.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.30.8.2 11-Aug-2006  yamt sync with head
 1.30.8.1 24-May-2006  yamt sync with head.
 1.30.6.1 01-Jun-2006  kardel Sync with head.
 1.30.4.1 09-Sep-2006  rpaulo sync with head
 1.32.8.1 06-Jan-2007  bouyer Pull up following revision(s) (requested by elad in ticket #316):
share/examples/secmodel/secmodel_example.c: revision 1.10 via patch
sys/arch/i386/i386/sys_machdep.c: revision 1.79
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.31
share/man/man9/secmodel_bsd44.9: revision 1.9
sys/arch/vax/vax/mem.c: revision 1.34 via patch
sys/arch/sh3/sh3/mem.c: revision 1.23 via patch
sys/arch/sh5/sh5/mem.c: revision 1.14 via patch
sys/secmodel/bsd44/secmodel_bsd44_suser.c: revision 1.22 via patch
sys/arch/powerpc/powerpc/mem.c: revision 1.27 via patch
sys/arch/x86/x86/x86_machdep.c: revision 1.5
sys/arch/alpha/alpha/machdep.c: revision 1.291
sys/arch/arm/arm32/mem.c: revision 1.17 via patch
sys/secmodel/bsd44/secmodel_bsd44_securelevel.c: revision 1.20
sys/sys/kauth.h: revision 1.29 via patch
sys/arch/amd64/amd64/sys_machdep.c: revision 1.10
share/man/man9/kauth.9: revision 1.43 via patch
sys/arch/xen/i386/sys_machdep.c: revision 1.10
sys/kern/kern_auth.c: revision 1.35
sys/arch/pc532/pc532/mem.c: revision 1.43 via patch
Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.
 1.32.4.1 12-Jan-2007  ad Sync with head.
 1.34.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.36.40.3 17-Jan-2009  mjf Sync with HEAD.
 1.36.40.2 03-Apr-2008  mjf Sync with HEAD.
 1.36.40.1 29-Mar-2008  mjf Add a mem_init() function for each architecture that requests a device
node for /dev/mem, /dev/null, /dev/zero, etc.

This will disappear when I move this code (and others) to be a
pseudo-device. When we have machine-independent mem code this will all be
unnecessary anyway.
 1.36.36.1 24-Mar-2008  keiichi sync with head.
 1.36.20.1 23-Mar-2008  matt sync with HEAD
 1.37.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.37.4.1 04-May-2009  yamt sync with head.
 1.38.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.38.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.38.6.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.38.4.1 30-Oct-2010  uebayasi Implement pmap_physload_device(9) to replace xmd(4) MD backend.
Implement pmap_mmap(9) and use it from mem(4) and xmd(4).
 1.39.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.10 01-Jul-1996  ragge Rewritten and moved to vax/mscp.
 1.9 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 02-Feb-1996  mycroft Fix #includes.
 1.6 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.5 10-Nov-1995  ragge Removed some warnings.
 1.4 05-Jul-1995  ragge branches: 1.4.2;
mscp_requeue() should work now.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 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 mscp.c was added on branch netbsd-1-0 on 1994-08-02 20:22:05 +0000
 1.4.2.1 15-Oct-1995  ragge Fixed type error complaints.
 1.4 01-Jul-1996  ragge Rewritten and moved to vax/mscp.
 1.3 20-Oct-1995  ragge branches: 1.3.2;
Added M_OP_POS (positioning tape).
 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 mscp.h was added on branch netbsd-1-0 on 1994-08-02 20:22:07 +0000
 1.3.2.2 20-Oct-1995  ragge Added M_OP_POS (positioning tape).
 1.3.2.1 20-Oct-1995  ragge file mscp.h was added on branch netbsd-1-1 on 1995-10-20 13:51:57 +0000
 1.8 01-Jul-1996  ragge Rewritten and moved to vax/mscp.
 1.7 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.6 10-Nov-1995  ragge Removed some warnings.
 1.5 05-Jul-1995  ragge branches: 1.5.2;
Bug causing null pointer mscp buffer reference fixed. Thanx, Rick Macklem!
 1.4 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 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 mscpvar.h was added on branch netbsd-1-0 on 1994-08-02 20:22:08 +0000
 1.5.2.1 15-Oct-1995  ragge Fixed type error complaints.
 1.37 03-Mar-2022  riastradh vax: Use device_set_private.
 1.36 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.35 10-Nov-2019  chs branches: 1.35.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.34 22-May-2017  ragge branches: 1.34.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.33 19-May-2014  rmind branches: 1.33.4;
Implement MI IPI interface with cross-call support.
 1.32 05-Jun-2011  matt branches: 1.32.12; 1.32.26;
device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.31 14-Dec-2010  matt branches: 1.31.2; 1.31.6;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.30 12-Nov-2010  uebayasi Pull in uvm/uvm.h where UVM's page level interface is used.
 1.29 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.28 26-Nov-2009  matt branches: 1.28.2; 1.28.4;
Kill proc0paddr. Use lwp0.l_addr instead.
 1.27 21-Nov-2009  rmind - Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.26 02-Apr-2009  tsutsui Don't use relative path from <machine> in #include.
It won't work for symlinks.
 1.25 11-Mar-2008  matt branches: 1.25.4; 1.25.12; 1.25.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.24 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.23 17-Oct-2007  garbled branches: 1.23.12; 1.23.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.22 22-Jun-2007  mhitch branches: 1.22.10;
Get rid of pcb usages, not needed for idlelwp.
 1.21 17-May-2007  yamt 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.20 12-Mar-2007  matt branches: 1.20.2; 1.20.8;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.19 17-Feb-2007  matt branches: 1.19.2; 1.19.6;
Add an implementation for krwlock_t. Initialize ci_mtx_count to 1 (biased).
Fix a few buglets in the kmutex_t implementation.
 1.18 28-Mar-2006  thorpej Use device_unit().
 1.17 11-Dec-2005  christos branches: 1.17.4; 1.17.6; 1.17.8; 1.17.10; 1.17.12;
merge ktrace-lwp.
 1.16 19-Mar-2004  matt branches: 1.16.16;
Add CPU_INFO_INTERATOR/FOREACH support.
 1.15 15-Jul-2003  lukem __KERNEL_RCSID()
 1.14 01-Apr-2003  thorpej branches: 1.14.2;
Use PAGE_SIZE rather than NBPG.
 1.13 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.12 22-Sep-2002  gmcgarry Update for cpu_switch() prototype changes. No functional change.
 1.11 02-Jun-2002  drochner move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
 1.10 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.9 04-Jun-2001  ragge branches: 1.9.2; 1.9.8; 1.9.16;
Add rudimentary multiprocessor support for DDB.
 1.8 04-Jun-2001  ragge Add IPI_TBIA to flush the translation buffer.
 1.7 03-Jun-2001  ragge A bunch of fixes:
- Make generic console routines not relying on running on master cpu.
- Add routine to start console transmitter (after IPI).
- Use real IPIs instead of the "console doorbell".
- Add routines cpu_send_ipi()/cpu_handle_ipi().
 1.6 29-May-2001  ragge And now we're running!
 1.5 02-Nov-2000  matt branches: 1.5.2; 1.5.4;
Casting lvalues is evil. Do it the right way.
 1.4 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.3 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.2 11-Jun-2000  ragge branches: 1.2.4;
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.1 10-Jun-2000  ragge Code to spin up other CPUs on a VAX 8200 system.
Haven't solved the printf() problem yet, though.
 1.2.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 11-Jun-2000  minoura file multicpu.c was added on branch minoura-xpg4dl on 2000-06-22 17:05:27 +0000
 1.5.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.2.3 22-Nov-2000  bouyer Sync with HEAD.
 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 02-Nov-2000  bouyer file multicpu.c was added on branch thorpej_scsipi on 2000-11-20 20:33:26 +0000
 1.9.16.1 15-Jul-2002  gehenna catch up with -current.
 1.9.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.9.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.9.8.1 04-Jun-2001  nathanw file multicpu.c was added on branch nathanw_sa on 2002-06-20 03:42:21 +0000
 1.9.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.9.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 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.16.5 17-Mar-2008  yamt sync with head.
 1.16.16.4 27-Feb-2008  yamt sync with head.
 1.16.16.3 03-Sep-2007  yamt sync with head.
 1.16.16.2 26-Feb-2007  yamt sync with head.
 1.16.16.1 21-Jun-2006  yamt sync with head.
 1.17.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.17.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.17.8.1 01-Apr-2006  yamt sync with head.
 1.17.6.1 22-Apr-2006  simonb Sync with head.
 1.17.4.1 09-Sep-2006  rpaulo sync with head
 1.19.6.3 15-Jul-2007  ad Sync with head.
 1.19.6.2 27-May-2007  ad Sync with head.
 1.19.6.1 13-Mar-2007  ad Sync with head.
 1.19.2.4 07-Apr-2007  matt Remove ci_exit, remove idlepcb and exitstack.
 1.19.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.19.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.19.2.1 17-Feb-2007  rmind file multicpu.c was added on branch yamt-idlelwp on 2007-03-12 05:51:19 +0000
 1.20.8.2 26-Jun-2007  garbled Sync with HEAD.
 1.20.8.1 22-May-2007  matt Update to HEAD.
 1.20.2.1 11-Jul-2007  mjf Sync with head.
 1.22.10.2 23-Mar-2008  matt sync with HEAD
 1.22.10.1 06-Nov-2007  matt sync with HEAD
 1.23.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.23.12.1 24-Mar-2008  keiichi sync with head.
 1.25.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.4.3 11-Aug-2010  yamt sync with head.
 1.25.4.2 11-Mar-2010  yamt sync with head
 1.25.4.1 04-May-2009  yamt sync with head.
 1.28.4.3 12-Jun-2011  rmind sync with head
 1.28.4.2 05-Mar-2011  rmind sync with head
 1.28.4.1 03-Jul-2010  rmind sync with head
 1.28.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.31.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.31.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.32.26.1 10-Aug-2014  tls Rebase.
 1.32.12.2 03-Dec-2017  jdolecek update from HEAD
 1.32.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.4.1 28-Aug-2017  skrll Sync with HEAD
 1.34.10.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.35.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.14 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.13 24-Apr-2021  thorpej branches: 1.13.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.12 22-May-2017  ragge branches: 1.12.24;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.11 14-Dec-2010  matt branches: 1.11.18; 1.11.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.10 15-Mar-2008  matt branches: 1.10.26;
Use 0 sized softc and switch to PRIVALLOC
 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 04-Mar-2007  christos branches: 1.8.20; 1.8.36; 1.8.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 11-Dec-2005  christos branches: 1.7.26;
merge ktrace-lwp.
 1.6 15-Jul-2003  lukem branches: 1.6.16;
__KERNEL_RCSID()
 1.5 01-Jan-2003  thorpej branches: 1.5.2;
Use aprint_normal() for cfprint routines.
 1.4 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.3 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.2 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.1 26-Jul-2000  ragge branches: 1.1.2; 1.1.6; 1.1.10;
Support for the KA88 CPU and the NMI backplane.
 1.1.10.2 03-Jan-2003  thorpej Sync with HEAD.
 1.1.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.1.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.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 nmi_mainbus.c was added on branch thorpej_scsipi on 2000-11-20 20:33:27 +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.6.16.2 17-Mar-2008  yamt sync with head.
 1.6.16.1 03-Sep-2007  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.36.1 24-Mar-2008  keiichi sync with head.
 1.8.20.1 23-Mar-2008  matt sync with HEAD
 1.10.26.1 05-Mar-2011  rmind sync with head
 1.11.36.1 28-Aug-2017  skrll Sync with HEAD
 1.11.18.1 03-Dec-2017  jdolecek update from HEAD
 1.12.24.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.13.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 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 24-Dec-2005  perry branches: 1.8.50; 1.8.70; 1.8.74;
bare asm -> __asm
 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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 16-Sep-2001  wiz branches: 1.4.4; 1.4.20;
Spell 'occurred' with two 'r's.
 1.3 13-Oct-1996  christos branches: 1.3.40; 1.3.42;
backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 03-Mar-1996  ragge Machine-optimized version of ns_cksum.c.
 1.3.42.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.40.1 01-Oct-2001  fvdl Catch up with -current.
 1.4.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.20.1 03-Aug-2004  skrll Sync with HEAD
 1.4.4.2 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.4.4.1 16-Sep-2001  wiz file ns_cksum.c was added on branch nathanw_sa on 2001-09-16 16:34:36 +0000
 1.6.16.2 17-Mar-2008  yamt sync with head.
 1.6.16.1 21-Jun-2006  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.3 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.2 14-Mar-2009  dsl branches: 1.2.2; 1.2.4; 1.2.26; 1.2.44;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.1 16-Feb-2009  christos branches: 1.1.2; 1.1.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.1.4.3 28-Apr-2009  skrll Sync with HEAD.
 1.1.4.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.4.1 16-Feb-2009  skrll file opcodes.c was added on branch nick-hppapmap on 2009-03-03 18:29:36 +0000
 1.1.2.2 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.1.2.1 16-Feb-2009  snj file opcodes.c was added on branch netbsd-5 on 2009-02-24 03:01:10 +0000
 1.2.44.1 28-Aug-2017  skrll Sync with HEAD
 1.2.26.1 03-Dec-2017  jdolecek update from HEAD
 1.2.4.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.4.1 14-Mar-2009  jym file opcodes.c was added on branch jym-xensuspend on 2009-05-13 17:18:41 +0000
 1.2.2.2 04-May-2009  yamt sync with head.
 1.2.2.1 14-Mar-2009  yamt file opcodes.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:05 +0000
 1.201 22-Dec-2023  thorpej pmap_is_modified(): If we fall into the slow path and encounter a modified
page during PV list walk, set PG_M in the pvh_attrs to avoid falling into
the slow path again.
 1.200 22-Dec-2023  thorpej rmspace(): when a PT page is put back onto the free list, invalidate
it's VA in the TB.

rmptep(): Add a comment that the no TIBS is needed for newly-freed PT
pages here because all of the callers perform a TBIA.
 1.199 21-Dec-2023  mrg fix locking botch: use mutex_spin_exit(), not _exit(), for PMAP_UNLOCK.

fixes LOCKDEBUG issue in first attempt to unlock it.

also call PMAP_UNLOCK in one non-fatal out of memory case.

XXX: pullup-10
 1.198 17-Oct-2023  riastradh vax/pmap.c: Sort includes. Nix traliing whitespace.

No functional change intended.
 1.197 16-Oct-2023  martin This now needs <sys/syncobj.h> to compile.
 1.196 26-Mar-2023  ragge Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.
 1.195 11-Dec-2022  oster branches: 1.195.2;

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

Code written by ragge@ , tested by oster@.
 1.194 11-Feb-2022  riastradh vax: Remove a vestige from before the device_t/softc split.

Verified MicroVAX 4000/96 still boots.

cpu0 at mainbus0: KA49, NVAX, 10KB L1 cache, 256KB L2 cache
 1.193 12-Oct-2021  andvar fix various typos, mainly in comments.
 1.192 02-Aug-2021  andvar fix various typos in comments and log messages.
 1.191 23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.190 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.189 15-Feb-2020  ad - Move the LW_RUNNING flag back into l_pflag: updating l_flag without lock
in softint_dispatch() is risky. May help with the "softint screwup"
panic.

- Correct the memory barriers around zombies switching into oblivion.
 1.188 08-Jan-2020  ad Hopefully fix some problems seen with MP support on non-x86, in particular
where curcpu() is defined as curlwp->l_cpu:

- mi_switch(): undo the ~2007ish optimisation to unlock curlwp before
calling cpu_switchto(). It's not safe to let other actors mess with the
LWP (in particular l->l_cpu) while it's still context switching. This
removes l->l_ctxswtch.

- Move the LP_RUNNING flag into l->l_flag and rename to LW_RUNNING since
it's now covered by the LWP's lock.

- Ditch lwp_exit_switchaway() and just call mi_switch() instead. Everything
is in cache anyway so it wasn't buying much by trying to avoid saving old
state. This means cpu_switchto() will never be called with prevlwp ==
NULL.

- Remove some KERNEL_LOCK handling which hasn't been needed for years.
 1.187 10-Nov-2019  chs branches: 1.187.2;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.186 30-Mar-2018  ragge branches: 1.186.2; 1.186.6;
Allow allocation of PTE space to fail in pmap_enter if PMAP_CANFAIL is set.
This fixes the panic part of PR port-vax/28379.
 1.185 22-May-2017  ragge branches: 1.185.2; 1.185.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.184 23-Dec-2016  cherry "Make NetBSD great again!"

Introduce uvm_hotplug(9) to the kernel.

Many thanks, in no particular order to:

TNF, for funding the project.

Chuck Silvers - for multiple API reviews and feedback.
Nick Hudson - for testing on multiple architectures and bugfix patches.
Everyone who helped with boot testing.

KeK (http://www.kek.org.in) for hosting the primary developers.
 1.183 22-Dec-2016  cherry switch all ports to use uvm_init.c:uvm_md_init()

uvm_setpagesize() is now subsumed within this funciton.
 1.182 02-Feb-2012  para branches: 1.182.6; 1.182.24; 1.182.28;
- bringing kmeminit_nkmempages back and revert pmaps that called this early
- use nkmempages to scale the kmem_arena
- reducing diff to pre kmem/vmem change
(NKMEMPAGES_MAX_DEFAULT will need adjusting on some archs)
 1.181 02-Feb-2012  matt Fix the initial sizing of the system page table / address space.
 1.180 24-May-2011  matt branches: 1.180.4; 1.180.8;
Remove pmap's simple_lock; switch to atomic ops
Change pvtable simple_lock to mutex
Switch to kmem (goodbye malloc).
 1.179 14-Dec-2010  matt branches: 1.179.2;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.178 10-Nov-2010  uebayasi Use more VM_PHYSMEM_*() accessors. No functional changes.
 1.177 06-Nov-2010  uebayasi Machine dependent code is considered as part of UVM. Include
internal API header.
 1.176 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.175 27-Nov-2009  rmind branches: 1.175.2; 1.175.4;
- Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.
- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places. Reduce sys/user.h inclusions.
 1.174 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.173 21-Nov-2009  rmind - Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.172 07-Nov-2009  cegger Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
 1.171 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.170 25-Oct-2009  he Correct the previous by adding an obviously overlooked
"struct pmap *pm" argument declaration to pmap_vax_swappable().
 1.169 21-Oct-2009  rmind 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.168 21-Apr-2009  cegger change pmap flags argument from int to u_int.
discussed with christos@ on source-changes-d@
 1.167 18-Mar-2009  cegger bcopy -> memcpy
 1.166 18-Mar-2009  cegger bzero -> memset
 1.165 13-Feb-2009  apb Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
 1.164 17-Dec-2008  cegger branches: 1.164.2;
kill MALLOC and FREE macros.
 1.163 10-Dec-2008  pooka Make kernel_pmap_ptr a const. Requested by steve_martin.
 1.162 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.161 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.160 24-Apr-2008  ad branches: 1.160.2; 1.160.8; 1.160.10;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
 1.159 15-Mar-2008  matt branches: 1.159.2;
After a process in swapped in, refresh the pcb's paddr.
 1.158 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.157 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.156 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.155 20-Feb-2008  matt branches: 1.155.2; 1.155.6;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.154 19-Feb-2008  matt ci_curlwp must be set to &lwp0 very early in the boot. Now we get further
into the kernel before dying.
 1.153 03-Feb-2008  matt misc type cleanups
 1.152 25-Oct-2007  yamt branches: 1.152.2;
defparam PAGER_MAP_SIZE.
 1.151 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.150 17-May-2007  yamt branches: 1.150.8; 1.150.10; 1.150.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.149 11-Apr-2007  matt branches: 1.149.4;
Workaround a gcc 4.1 issue. don't use s.m = s2.m = s3.m = ...
assign them individually.
 1.148 12-Mar-2007  matt branches: 1.148.2;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.147 09-Mar-2007  ad branches: 1.147.2;
- Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
 1.146 04-Mar-2007  christos Fix caddr_t fallout.
 1.145 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.144 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.143 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.142 17-Feb-2007  pavel Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
 1.141 17-Feb-2007  matt branches: 1.141.2;
Add an implementation for krwlock_t. Initialize ci_mtx_count to 1 (biased).
Fix a few buglets in the kmutex_t implementation.
 1.140 16-Feb-2007  matt Partially adapt the VAX port to the newlock2 changes. These are untested
but they do at least compile.
 1.139 02-Oct-2006  chs branches: 1.139.2;
remove details of the kernel malloc() implementation from header files:
- change MALLOC() and FREE() to just call their function equivalents.
- remove references to other malloc()-related constants.
 1.138 08-Jul-2006  matt branches: 1.138.4; 1.138.6;
Don't bcopy to 0 because gcc4 doesn't like. Instead use a structure copy
to 0 to do the equivalent thing. XXX this is evil.
 1.137 15-Mar-2006  matt branches: 1.137.6;
Fix typo in lhs cast removal.
 1.136 12-Mar-2006  matt Fix various places where assignment happen to casted lvalues.
(t)v = foo; is not legal C.
 1.135 11-Dec-2005  christos branches: 1.135.4; 1.135.6; 1.135.8; 1.135.10;
merge ktrace-lwp.
 1.134 19-Mar-2004  matt branches: 1.134.16;
Add CPU_INFO_INTERATOR/FOREACH support.
 1.133 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.132 30-Dec-2003  pk Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
 1.131 14-Dec-2003  ragge TOPDOWN_VM is now mandatory on vax.
 1.130 06-Nov-2003  he Add a default: branch with a panic() to the switch statement to
handle "impossible" segment types, so that the compiler can know
that 'pt' has been initialized after the switch statement.
 1.129 19-Oct-2003  ragge Avoid the pvtable when devices are mapped. Fixes panics when unmapping
framebuffers. Set aside space in kernel map for framebuffer on VS4k.
 1.128 15-Jul-2003  lukem __KERNEL_RCSID()
 1.127 10-May-2003  thorpej branches: 1.127.2;
Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
 1.126 08-May-2003  thorpej Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
 1.125 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
XXX Except in one place, which will require more work.
 1.124 02-Mar-2003  ragge 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.123 26-Feb-2003  ragge Enable USE_TOPDOWN_VM. This also makes it possible to use large address
spaces, so bump MAXDSIZ to 1GB.
 1.122 02-Feb-2003  erh D'oh! Remove unused local variable too.
 1.121 01-Feb-2003  erh Remove references to nswbuf. It is entirely unused.
 1.120 31-Jan-2003  thorpej Use M_VMPMAP instead of M_HTABLE.
 1.119 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.118 01-Dec-2002  matt Fix inconsistencies in various definitions of avail_*, virtual_*, and
proc0paddr.
 1.117 25-Aug-2002  thorpej Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
 1.116 25-Jul-2002  ragge Increase the interrupt stack, to avoid problems reported on port-vax by
Olaf Seibert. (IPSec takes much stack space).
 1.115 09-Jun-2002  ragge Must multiply the pte count with its size when copying ptes when the P1
region is expanded. Fixes bug reported by Matt Thomas on port-vax.
 1.114 06-Jun-2002  ragge Pipes and swap disks takes a not insignificant amount of KVA, so therefore
it must be used in KVA calculation.
 1.113 04-Apr-2002  ragge branches: 1.113.2; 1.113.4;
Fix crash problems reported by mrg and bouyer in separate mails.
 1.112 02-Apr-2002  ragge Check that each region is inuse before freeing their related extent.
This fixes (hopefully) PR#16164.
 1.111 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.110 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.109 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.108 30-Sep-2001  ragge branches: 1.108.4;
Check if page to be remapped in pmap_enter() is entered by pmap_kenter_pa(),
to decide whether to remove the previous mapping from pv_table or not.
Should fix PR#12231.
 1.107 24-Sep-2001  chs implement pmap_wired_count().
 1.106 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.105 05-Aug-2001  matt branches: 1.105.2;
Don't substract KERNBASE, xor it to clear. The former causes GNU ld to
bitch about a signed overflow and this code is only done once, incurring
an extra instruction isn't going to matter much in the long run.
 1.104 30-Jun-2001  ragge branches: 1.104.2;
Do more intelligent calculation of KVM size. This reduces the amount of
pre-allocated physical memory significantly.
A 11/750, for example, get 2MB more free (of 14MB), about 12%.
 1.103 07-Jun-2001  chs implement pmap_clear_modify() correctly.
 1.102 06-Jun-2001  chs make this compile without DEBUG.
 1.101 04-Jun-2001  ragge The beginning of pmap locks. While here, some cleaning and KNF.
 1.100 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.99 23-Apr-2001  thorpej Garbage-collect pmap_bootstrap_alloc(); nothing uses it.
 1.98 22-Apr-2001  thorpej Remove pmap_kenter_pgs(). It was never really adopted by
anything, and the interface itself wasn't as flexible as
callers would have probably liked.
 1.97 22-Apr-2001  thorpej Make pmap_virtual_space() a required pmap function, even on platforms
which have pmap_steal_memory(). This is to reduce the API differences
between pmaps that implement pmap_steal_memory() and pmaps which do
not.

Note that pmap_steal_memory() needs to adjust *vstartp and/or
*vendp only if it used addresses within the range provided to UVM
via the pmap_virtual_space() call. I.e. it is not necessary to do
so in any current pmap_steal_memory() implementation.
 1.96 12-Apr-2001  thorpej splimp -> splvm
 1.95 01-Apr-2001  ragge Be sure that all kernel stack pages are valid after swapin. Fixes PR#12520.
 1.94 15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.93 11-Feb-2001  ragge branches: 1.93.2;
Check page reference in pmap_clear_reference(). Fixes vax hang problem
with ubc, tested by Chuck Silvers.
 1.92 31-Dec-2000  ragge Do not touch pv_table when mapping/unmapping I/O registers. This caused
mmap() of framebuffers to give unpredictable faults.
 1.91 21-Nov-2000  chs two changes to pmap_enter():
- allow entry of the same mapping that's already there.
this can happen with UBC.
- if PMAP_CANFAIL, return failure rather than sleeping
when we fail to allocate a ptp.
 1.90 21-Nov-2000  chs eliminate TRUNC_PAGE() and ROUND_PAGE() in favor of their
lowercase counterparts. also, a little misc cleanup.
 1.89 31-Oct-2000  ragge If a process is locked into memory with mlockall() (like ntpd is)
pmap_enter() will get called trying to wire an already wired page again
if sysctl() is called. To avoid a panic the "wired" check is moved after
the double-mapping check.
 1.88 27-Aug-2000  matt Make the pmap: enter on myself panic conditional under DIAGNOSTIC
 1.87 27-Aug-2000  ragge Wiring of a page were done at the wrong place, so pages in kernel space
never got the wired bit set. This caused panics if a swapped out process
was swapped in again and the kernel stack had not yet been unmapped.
While here, add a forgotten lock initializer.
 1.86 08-Aug-2000  ragge Remove some unneccessary TBIA's. Keep track of wired pages.
Fix PR#8503 (refcount error).
 1.85 19-Jul-2000  ragge Do mtpr(0, PR_TBIA), not mtpr(1, PR_TBIA). This has worked on all CPUs
except for KA88.
 1.84 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.83 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.82 11-Jun-2000  ragge branches: 1.82.2;
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.81 10-Jun-2000  ragge Code to spin up other CPUs on a VAX 8200 system.
Haven't solved the printf() problem yet, though.
 1.80 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.79 20-May-2000  ragge branches: 1.79.2;
Changes to use the RPB for different tasks. Much simpler now to find the
boot device.
 1.78 16-Apr-2000  ragge Be a little bit more generous with TBIA.
 1.77 02-Apr-2000  thorpej Instead of checking vm_physmem[<physseg>].pgs to determine if
uvm_page_init() has completed, add a boolean uvm.page_init_done,
and test against that. Use this same boolean (rather than
pmap_initialized) in pmap_growkernel() to determine if we are
being called via uvm_page_init() to grow the kernel address space.

This fixes a problem on some i386 configurations where pmap_init()
itself was needing to have the kernel page table grown, and since
pmap_initialized was not yet set to TRUE, pmap_growkernel() was
choosing the wrong code path.

Fix tested by Havard Eidnes.
 1.76 26-Mar-2000  kleink Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
make them type-generic, which is necessary i.e. to operate on file offsets
without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
 1.75 11-Dec-1999  ragge CL* discarding.
Move physmem setting to pmap_bootstrap().
Fix security problem in process_write_regs(), found by Klaus Klein.
 1.74 13-Nov-1999  matt adapt to jason new pmap_enter change
 1.73 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.72 27-Oct-1999  ragge Avoid calling cninit() too early.
 1.71 12-Sep-1999  chs branches: 1.71.2; 1.71.4; 1.71.6;
eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
 1.70 01-Aug-1999  ragge 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.69 10-Jul-1999  ragge Rewrite the page table entry routines. Don't take a pte invalid fault for
missing pte's, instead map in pte entries in pmap_enter(). The user ptes
is no more handled by the VM system. All this made swapping start working
on VAX again.
Still to do:
- Keep refcount per pte page, so that those pages get free'd when the
process is swapped out. Right now they are only free'd when the pmap
is destroyed.

Many thanks to Chuck Silvers for all help finding the deadlock problems.
 1.68 08-Jul-1999  thorpej Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.67 30-Jun-1999  ragge Use pmap_steal_memory() for early memory allocation.
 1.66 06-Jun-1999  ragge Page tables must be pageable (where did this disappear?)
Fix a PGOFSET -> VAX_PGOFSET miss.
Stylistic cleanup.
 1.65 26-May-1999  thorpej Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.
 1.64 23-May-1999  ragge Rewrite the "emulate page reference bits" code to avoid a bunch of
pv_lists traversal and unneccessary page faults.
 1.63 17-Apr-1999  ragge Only allocate QDSS memory if there is a QDSS as console.
QDSS should also work on KA650 now. (untested)
 1.62 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.61 26-Mar-1999  mycroft branches: 1.61.2; 1.61.4; 1.61.6;
Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.60 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.59 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.58 19-Jan-1999  ragge Fix some void pointers.
 1.57 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.56 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.55 19-Dec-1998  ragge A "return 1" should be "return 0". Caused machine to crash as soon as
it started paging.
 1.54 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.53 21-Aug-1998  ragge VAX logical page size increased to 4k.
 1.52 18-Jul-1998  ragge Fix PMAP_NEW and make it the default.
 1.51 08-Jul-1998  thorpej Define one page free list, and put all pages on it.
 1.50 23-May-1998  ragge Remove a forgotten debug printout.
 1.49 19-May-1998  thorpej It is no longer necessary for pmap_pinit() and pmap_release() to be
pmap interface functions, as NetBSD no longer uses statically allocated
pmaps (except for the kernel pmap, which is special-cased anyhow).
 1.48 03-May-1998  ragge Remove the ancient kernel-stack area at top of P1 region. Make PMAP_NEW
almost work. Also Wall cleaning.
 1.47 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.46 02-Mar-1998  ragge Support for UVM on VAXen.
 1.45 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.44 27-Jan-1998  ragge Fix to make vfork work on machines with separated PCB/mtpr PTE registers.
 1.43 18-Jan-1998  ragge Fix page size initialisation.
 1.42 03-Jan-1998  thorpej - Adjust so that access to the PCB is not required in most pmap functions.
Store the page {0,1} base and length registers in the pmap structure,
and implement pmap_activate(), which stores them in the PCB (for the
hardware's use).
- Re-implement pmap_pinit(); allocate the PTEs here, not in cpu_fork().
 1.41 04-Nov-1997  ragge Move some interrupt routines out to assembler.
Optimize (slightly) pmap_clear_modify.
 1.40 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.39 19-Oct-1997  ragge Add a sometimes needed round_page().
Always flush TLB when messing around with system mapping.
 1.38 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.37 25-Jul-1997  ragge branches: 1.37.2;
Fixed bug causing machines with a memory size not a multiple of 16k
to crash. This is true on many MicroVAXen.
 1.36 06-Jul-1997  ragge Remove __VM_PMAP_HACK.
 1.35 22-Mar-1997  ragge Clean up DZ console routines. Use memory size from boot (if provided).
 1.34 15-Mar-1997  ragge Clean up console autoconfiguration so that the VAXstation DZ11-like
console work.
 1.33 26-Feb-1997  ragge Patches to make VS2000 to work. From Ari Suutari.
 1.32 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.31 12-Feb-1997  ragge Walk a step closer to more intelligent User PTE handling.
 1.30 13-Oct-1996  christos branches: 1.30.6;
backout previous kprintf change
 1.29 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.28 20-Jul-1996  ragge Locore changes for VS and VAX8200.
 1.27 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.26 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.25 17-Mar-1996  ragge Do not have debugging enabled by default.
 1.24 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.23 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.22 11-Feb-1996  ragge Fix things that -O2 broke. Cleanup.
 1.21 02-Feb-1996  mycroft Fix type errors.
 1.20 02-Feb-1996  mycroft Fix #includes.
 1.19 13-Dec-1995  ragge CPU dependent code moved out of cpu independent modules.
 1.18 10-Nov-1995  ragge Major rewriting of pmap_bootstrap; CPU dependent allocations moved
to related file.
 1.17 22-Aug-1995  ragge Fixed USRPTSIZE trouble. Cleaned up.
 1.16 21-Aug-1995  ragge Bug fix: Must have user readability of kernel text on Microvax
even when using DDB.
 1.15 05-Jul-1995  ragge DDB needs writable kernel text.
 1.14 16-Jun-1995  ragge rudimentary DDB support.
 1.13 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.12 06-May-1995  ragge Kernel message buffer implemented.
 1.11 05-May-1995  ragge Removed kernel stack relocation and double-mapping.
Speeded up fork() significantly.
 1.10 10-Apr-1995  mycroft Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.
 1.9 10-Apr-1995  mycroft v_cmap --> vmmap
 1.8 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.7 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.6 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.5 25-Nov-1994  ragge Lots of fixes and updates.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file pmap.c was added on branch netbsd-1-0 on 1994-08-16 23:47:36 +0000
 1.30.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.37.2.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.61.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.61.4.3 02-Aug-1999  thorpej Update from trunk.
 1.61.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.61.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.61.2.3 01-Mar-2000  he Apply patch (requested by toddpw):
Fix bugs in support for VaxStation 2000 and 3100, vax pmap, and
the NCR scsi driver.
 1.61.2.2 31-Jan-2000  he Apply patch (requested by ragge):
Fix a problem when the system goes out of free pages.
 1.61.2.1 12-Jul-1999  perry pullup via patch (ragge): fix critical paging/swapping problems
 1.71.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.71.4.1 15-Nov-1999  fvdl Sync with -current
 1.71.2.7 23-Apr-2001  bouyer Sync with HEAD.
 1.71.2.6 21-Apr-2001  bouyer Sync with HEAD
 1.71.2.5 27-Mar-2001  bouyer Sync with HEAD.
 1.71.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.71.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.71.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.71.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.79.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.82.2.4 12-Nov-2001  he Apply patch (requested by ragge):
Handle remapping of pages entered by pmap_kenter_pa() properly.
Fixes PR#12231.
 1.82.2.3 01-Nov-2000  tv Pullup 1.89 by patch [ragge]:
If a process is locked into memory with mlockall() (like ntpd is)
pmap_enter() will get called trying to wire an already wired page again
if sysctl() is called. To avoid a panic the "wired" check is moved after
the double-mapping check.
 1.82.2.2 27-Aug-2000  ragge Pull up revision 1.87 (requested by ragge):

Wiring of a page were done at the wrong place, so pages in kernel space
never got the wired bit set. This caused panics if a swapped out process
was swapped in again and the kernel stack had not yet been unmapped.
While here, add a forgotten lock initializer.
 1.82.2.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.93.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.93.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.104.2.6 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.104.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.104.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.104.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.104.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.104.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.105.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.108.4.11 30-Dec-2002  thorpej Make this compile again.
 1.108.4.10 11-Dec-2002  thorpej Sync with HEAD.
 1.108.4.9 05-Oct-2002  gmcgarry LWPify pmap_rmproc(). The comment says it is based on uvm_swapout_threads().
Brought the same LWP changes across from there.
 1.108.4.8 27-Aug-2002  nathanw Catch up to -current.
 1.108.4.7 01-Aug-2002  nathanw Catch up to -current.
 1.108.4.6 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.108.4.5 20-Jun-2002  nathanw Catch up to -current.
 1.108.4.4 17-Apr-2002  nathanw Catch up to -current.
 1.108.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.108.4.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.108.4.1 30-Sep-2001  ragge file pmap.c was added on branch nathanw_sa on 2002-03-29 23:22:44 +0000
 1.113.4.3 29-Jul-2002  lukem Pull up revision 1.116 (requested by ragge in ticket #542):
Increase the interrupt stack, to avoid problems reported on port-vax by
Olaf Seibert. (IPSec takes much stack space).
 1.113.4.2 10-Jun-2002  tv Pull up revision 1.115 (requested by ragge in ticket #229):
Must multiply the pte count with its size when copying ptes when the P1
region is expanded. Fixes bug reported by Matt Thomas on port-vax.
 1.113.4.1 07-Jun-2002  thorpej pullup-1-6 ticket #192:

syssrc/sys/arch/vax/vax/pmap.c 1.114

Original log message:

Pipes and swap disks takes a not insignificant amount of KVA, so therefore
it must be used in KVA calculation.
 1.113.2.2 31-Aug-2002  gehenna catch up with -current.
 1.113.2.1 15-Jul-2002  gehenna catch up with -current.
 1.127.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.127.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.127.2.1 03-Aug-2004  skrll Sync with HEAD
 1.134.16.8 17-Mar-2008  yamt sync with head.
 1.134.16.7 27-Feb-2008  yamt sync with head.
 1.134.16.6 04-Feb-2008  yamt sync with head.
 1.134.16.5 27-Oct-2007  yamt sync with head.
 1.134.16.4 03-Sep-2007  yamt sync with head.
 1.134.16.3 26-Feb-2007  yamt sync with head.
 1.134.16.2 30-Dec-2006  yamt sync with head.
 1.134.16.1 21-Jun-2006  yamt sync with head.
 1.135.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.135.8.3 11-Aug-2006  yamt sync with head
 1.135.8.2 01-Apr-2006  yamt sync with head.
 1.135.8.1 13-Mar-2006  yamt sync with head.
 1.135.6.1 22-Apr-2006  simonb Sync with head.
 1.135.4.1 09-Sep-2006  rpaulo sync with head
 1.137.6.1 13-Jul-2006  gdamore Merge from HEAD.
 1.138.6.1 22-Oct-2006  yamt sync with head
 1.138.4.1 18-Nov-2006  ad Sync with head.
 1.139.2.1 12-Apr-2007  bouyer Pull up following revision(s) (requested by mhitch in ticket #569):
sys/arch/vax/vax/pmap.c: revision 1.149
Workaround a gcc 4.1 issue. don't use s.m = s2.m = s3.m = ...
assign them individually.
 1.141.2.5 15-Apr-2007  yamt sync with head.
 1.141.2.4 07-Apr-2007  matt Remove ci_exit, remove idlepcb and exitstack.
 1.141.2.3 12-Mar-2007  rmind Sync with HEAD.
 1.141.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.141.2.1 17-Feb-2007  yamt file pmap.c was added on branch yamt-idlelwp on 2007-02-27 16:53:22 +0000
 1.147.2.3 03-Dec-2007  ad Sync with HEAD.
 1.147.2.2 27-May-2007  ad Sync with head.
 1.147.2.1 13-Mar-2007  ad Sync with head.
 1.148.2.1 11-Jul-2007  mjf Sync with head.
 1.149.4.1 22-May-2007  matt Update to HEAD.
 1.150.14.1 13-Nov-2007  bouyer Sync with HEAD
 1.150.10.2 23-Mar-2008  matt sync with HEAD
 1.150.10.1 06-Nov-2007  matt sync with HEAD
 1.150.8.1 28-Oct-2007  joerg Sync with HEAD.
 1.152.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.155.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.155.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.155.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.155.2.1 24-Mar-2008  keiichi sync with head.
 1.159.2.1 18-May-2008  yamt sync with head.
 1.160.10.3 28-Apr-2009  skrll Sync with HEAD.
 1.160.10.2 03-Mar-2009  skrll Sync with HEAD.
 1.160.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.160.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.160.2.3 11-Aug-2010  yamt sync with head.
 1.160.2.2 11-Mar-2010  yamt sync with head
 1.160.2.1 04-May-2009  yamt sync with head.
 1.164.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.175.4.3 31-May-2011  rmind sync with head
 1.175.4.2 05-Mar-2011  rmind sync with head
 1.175.4.1 03-Jul-2010  rmind sync with head
 1.175.2.4 30-Oct-2010  uebayasi Implement pmap_physload_device(9) to replace xmd(4) MD backend.
Implement pmap_mmap(9) and use it from mem(4) and xmd(4).
 1.175.2.3 17-Aug-2010  uebayasi Sync with HEAD.
 1.175.2.2 27-May-2010  uebayasi Fix build.
 1.175.2.1 28-Apr-2010  uebayasi Always use struct vm_physseg *vm_physmem_ptrs[] in MD code.
 1.179.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.180.8.1 18-Feb-2012  mrg merge to -current.
 1.180.4.1 17-Apr-2012  yamt sync with head
 1.182.28.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.182.24.2 28-Aug-2017  skrll Sync with HEAD
 1.182.24.1 05-Feb-2017  skrll Sync with HEAD
 1.182.6.1 03-Dec-2017  jdolecek update from HEAD
 1.185.8.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.185.2.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.186.6.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.186.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.186.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.187.2.2 29-Feb-2020  ad Sync with head.
 1.187.2.1 17-Jan-2020  ad Sync with head.
 1.195.2.3 23-Dec-2023  martin Pull up following revision(s) (requested by mrg in ticket #516):

sys/arch/vax/vax/pmap.c: revision 1.199

fix locking botch: use mutex_spin_exit(), not _exit(), for PMAP_UNLOCK.
fixes LOCKDEBUG issue in first attempt to unlock it.

also call PMAP_UNLOCK in one non-fatal out of memory case.
 1.195.2.2 23-Dec-2023  martin Pull up following revision(s) (requested by thorpej in ticket #515):

sys/arch/vax/vax/pmap.c: revision 1.200

rmspace(): when a PT page is put back onto the free list, invalidate
it's VA in the TB.

rmptep(): Add a comment that the no TIBS is needed for newly-freed PT
pages here because all of the callers perform a TBIA.
 1.195.2.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.5 05-Apr-2014  christos adjust to new signature; return consistent stuff. 0 is ok -1 is error
 1.4 11-Dec-2005  christos branches: 1.4.112; 1.4.122; 1.4.128;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 18-Jan-2001  tv branches: 1.2.24;
No-op commit to force update to a non-"-kk" revision.
 1.1 17-Jan-2001  fvdl branches: 1.1.2;
Add machdep file for procfs. Currently only used for linux-style
/proc/cpuinfo (only active when procfs is mounted with -o linux).
For ports other than the i386 this currently produces an empty
string.
 1.1.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.1.2.1 17-Jan-2001  bouyer file procfs_machdep.c was added on branch thorpej_scsipi on 2001-01-18 09:23:09 +0000
 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.4.128.1 18-May-2014  rmind sync with head
 1.4.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.112.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3 22-Feb-1998  mycroft Move to libkern.
 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 random.s was added on branch netbsd-1-0 on 1994-08-02 20:22:12 +0000
 1.16 15-Mar-1997  ragge Change the way boot device is figured out; now only using DEC numbers
and done when the device get attached.
 1.15 31-Jan-1997  thorpej Use new machine-independent setroot().
 1.14 13-Oct-1996  christos branches: 1.14.2;
backout previous kprintf change
 1.13 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.12 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.11 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.10 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.9 24-Feb-1996  ragge Make setroot() grok where we boot from even if it is hp disks.
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 28-Jan-1996  ragge Make use of the new disk struct when attaching disks.
Don't rely on UBA's; we do not always want them.
 1.6 12-Apr-1995  ragge Fixes to conf.c
Cleaning of code.
 1.5 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.4 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.3 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 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 rootfil.c was added on branch netbsd-1-0 on 1994-08-02 20:22:13 +0000
 1.14.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.40 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.39 24-Apr-2021  thorpej branches: 1.39.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.38 22-May-2017  ragge branches: 1.38.24;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.37 02-Apr-2011  martin branches: 1.37.14; 1.37.32;
Do not increment a bool var - from Henning Petersen, PR port-vax/44816.
 1.36 14-Dec-2010  matt branches: 1.36.2;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.35 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.34 19-Nov-2008  hans branches: 1.34.6; 1.34.8;
fix build for 11/780-only kernel configs. OK by matt.
 1.33 11-Mar-2008  matt branches: 1.33.4; 1.33.10; 1.33.12; 1.33.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.32 04-Mar-2007  christos branches: 1.32.20; 1.32.36; 1.32.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.31 11-Dec-2005  christos branches: 1.31.26;
merge ktrace-lwp.
 1.30 06-Nov-2003  he branches: 1.30.16;
Pull up the initialization of 'minnex', so that the compiler can know
that it's going to be set before it's used.
 1.29 15-Jul-2003  lukem __KERNEL_RCSID()
 1.28 19-Jan-2003  ragge branches: 1.28.2;
Add some instrumentation and clean up some VAX8600 code.
From Johnny Billquist.
 1.27 01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 1.26 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.25 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.24 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.23 24-Jul-2002  ragge Don't complain about Abuses that don't exist and tell about unsupported CI's.
From Johnny Billquist.
 1.22 04-Jun-2002  ragge Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.21 04-Jun-2000  ragge branches: 1.21.6; 1.21.10; 1.21.18; 1.21.20;
Changes to sbi_attach_args. (and some cleanup)
 1.20 07-Aug-1999  ragge branches: 1.20.2; 1.20.10;
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.19 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.18 13-Apr-1998  ragge Wall cleaning.
 1.17 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.16 12-Jan-1998  thorpej Update for changes to config.
 1.15 02-Nov-1997  ragge Fix clearing of redundant restart flag; CPU specific.
Also clean up a bit.
 1.14 13-Oct-1996  christos backout previous kprintf change
 1.13 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.12 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.11 20-Aug-1996  ragge Support for cmi bus on 11/750.
 1.10 20-Jul-1996  ragge Reflect the changes of CPU determination. Add support for VAXstations.
 1.9 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.8 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.7 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.6 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.5 02-Feb-1996  mycroft Fix #includes.
 1.4 13-Dec-1995  ragge MicroVAX III support added; now runs on VAX 3600/3800/3900 platforms.
 1.3 10-Nov-1995  ragge A couple of CPU specific defines moved away.
 1.2 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.1 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.20.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.20.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.21.20.1 05-Jun-2002  lukem Pull up revision 1.22 (requested by ragge in ticket #157):
Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.21.18.2 31-Aug-2002  gehenna catch up with -current.
 1.21.18.1 15-Jul-2002  gehenna catch up with -current.
 1.21.10.4 03-Jan-2003  thorpej Sync with HEAD.
 1.21.10.3 18-Oct-2002  nathanw Catch up to -current.
 1.21.10.2 01-Aug-2002  nathanw Catch up to -current.
 1.21.10.1 20-Jun-2002  nathanw Catch up to -current.
 1.21.6.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.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.21.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 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.16.2 17-Mar-2008  yamt sync with head.
 1.30.16.1 03-Sep-2007  yamt sync with head.
 1.31.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.32.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.32.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.32.36.1 24-Mar-2008  keiichi sync with head.
 1.32.20.1 23-Mar-2008  matt sync with HEAD
 1.33.14.1 22-Nov-2008  snj Pull up following revision(s) (requested by hans in ticket #102):
sys/arch/vax/vax/sbi.c: revision 1.34
fix build for 11/780-only kernel configs. OK by matt.
 1.33.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.33.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.33.4.2 11-Aug-2010  yamt sync with head.
 1.33.4.1 04-May-2009  yamt sync with head.
 1.34.8.3 21-Apr-2011  rmind sync with head
 1.34.8.2 05-Mar-2011  rmind sync with head
 1.34.8.1 03-Jul-2010  rmind sync with head
 1.34.6.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.36.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.37.32.1 28-Aug-2017  skrll Sync with HEAD
 1.37.14.1 03-Dec-2017  jdolecek update from HEAD
 1.38.24.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.39.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.19 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.18 14-Dec-2010  matt branches: 1.18.18; 1.18.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.17 12-Mar-2006  matt branches: 1.17.90;
Fix various places where assignment happen to casted lvalues.
(t)v = foo; is not legal C.
 1.16 11-Dec-2005  christos branches: 1.16.4; 1.16.6; 1.16.8; 1.16.10;
merge ktrace-lwp.
 1.15 15-Jul-2003  lukem branches: 1.15.16;
__KERNEL_RCSID()
 1.14 04-Jun-2002  ragge branches: 1.14.6;
Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.13 04-Jun-2000  matt branches: 1.13.6; 1.13.10; 1.13.18; 1.13.20;
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.12 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.11 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.10 22-Apr-2000  ragge branches: 1.10.2;
Forgot a protection #define.
Make use of raise-spl.
 1.9 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.8 17-Sep-1999  thorpej branches: 1.8.2;
Centralize the declaration and clearing of `cold'.
 1.7 27-Aug-1999  ragge Use interrupt stack for unexpected interrupts.
 1.6 14-Aug-1999  ragge Support interrupt vector auto-detection on level-trigged devices also.
 1.5 08-Aug-1999  ragge Tell if we get stray interrupts, if cold == 0.
 1.4 26-Mar-1999  ragge Didn't reset interrupt flag after reading. From Christopher Sekiya.
 1.3 13-Mar-1999  ragge 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.2 20-Jan-1999  ragge Forgot copyright notice. Thanx, Jason!
 1.1 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 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.10.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.13.20.1 05-Jun-2002  lukem Pull up revision 1.14 (requested by ragge in ticket #157):
Repair VAX8600 support, which had bit-rotten, probably not used since -98.
 1.13.18.1 15-Jul-2002  gehenna catch up with -current.
 1.13.10.1 20-Jun-2002  nathanw Catch up to -current.
 1.13.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.6.1 03-Aug-2004  skrll Sync with HEAD
 1.15.16.1 21-Jun-2006  yamt sync with head.
 1.16.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.16.8.1 13-Mar-2006  yamt sync with head.
 1.16.6.1 22-Apr-2006  simonb Sync with head.
 1.16.4.1 09-Sep-2006  rpaulo sync with head
 1.17.90.1 05-Mar-2011  rmind sync with head
 1.18.36.1 28-Aug-2017  skrll Sync with HEAD
 1.18.18.1 03-Dec-2017  jdolecek update from HEAD
 1.21 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.20 03-Dec-2023  thorpej Use vmem(9) rather than extent(9) to manage SGMAP space.
 1.19 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.18 05-Jul-2015  matt Hooks needed for QVSS support
 1.17 27-Jan-2012  para branches: 1.17.6; 1.17.24;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.16 14-Dec-2010  matt branches: 1.16.8; 1.16.12;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.15 28-Apr-2008  martin branches: 1.15.22;
Remove clause 3 and 4 from TNF licenses
 1.14 11-Mar-2008  matt branches: 1.14.2; 1.14.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.13 11-Dec-2005  christos branches: 1.13.50; 1.13.70; 1.13.74;
merge ktrace-lwp.
 1.12 27-Jun-2005  ragge branches: 1.12.2;
Update according to cast-qual addition.
 1.11 15-Jul-2003  lukem __KERNEL_RCSID()
 1.10 27-Sep-2002  provos branches: 1.10.6;
remove trailing \n in panic(). approved perry.
 1.9 16-Nov-2000  matt branches: 1.9.4; 1.9.8;
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.8 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.7 23-May-2000  matt branches: 1.7.4;
Add some debug stuff. Disable SCSI on KA49 for now until I can figure out
why it doesn't work.
 1.6 17-May-2000  matt Preliminary support for the VS4000/90 SGMAP. Needed for SCSI. Does not
quite work right yet.
 1.5 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.4 07-Mar-2000  matt remove some unsed variables. make a bit efficeint.
 1.3 08-Jul-1999  thorpej branches: 1.3.2;
Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.2 20-Jun-1999  ragge branches: 1.2.2;
Fix of bug causing allocations of physical pages to get wrong address.
 1.1 06-Jun-1999  ragge sgmap files, copied from the Alpha port and modified for vax.
 1.2.2.3 02-Aug-1999  thorpej Update from trunk.
 1.2.2.2 21-Jun-1999  thorpej Sync w/ -current.
 1.2.2.1 20-Jun-1999  thorpej file sgmap.c was added on branch chs-ubc2 on 1999-06-21 01:03:46 +0000
 1.3.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.3.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.7.4.1 16-Nov-2000  tv Pullup 1.9 [matt]:
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.9.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.9.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.10.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.12.2.1 17-Mar-2008  yamt sync with head.
 1.13.74.2 02-Jun-2008  mjf Sync with HEAD.
 1.13.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.13.70.1 24-Mar-2008  keiichi sync with head.
 1.13.50.1 23-Mar-2008  matt sync with HEAD
 1.14.4.1 16-May-2008  yamt sync with head.
 1.14.2.1 18-May-2008  yamt sync with head.
 1.15.22.1 05-Mar-2011  rmind sync with head
 1.16.12.1 18-Feb-2012  mrg merge to -current.
 1.16.8.1 17-Apr-2012  yamt sync with head
 1.17.24.2 09-Jul-2016  skrll Sync with HEAD
 1.17.24.1 22-Sep-2015  skrll Sync with HEAD
 1.17.6.1 03-Dec-2017  jdolecek update from HEAD
 1.27 17-May-2024  thorpej Implement _UC_SETSTACK / _UC_CLRSTACK.
 1.26 01-Nov-2021  thorpej branches: 1.26.4;
Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name. NFC.
 1.25 27-Oct-2021  thorpej Use the signal trampoline version constants from <sys/signal.h>.
 1.24 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.23 27-Nov-2018  maxv Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.
 1.22 22-May-2017  ragge branches: 1.22.2; 1.22.8; 1.22.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.21 03-Jul-2011  matt branches: 1.21.12; 1.21.28; 1.21.30; 1.21.32; 1.21.40;
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.20 14-Dec-2010  matt Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.19 21-Nov-2009  rmind branches: 1.19.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.18 13-Jan-2009  mjf - 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.17 27-Dec-2008  cegger add stub for sendsig_sigcontext().
I leave this to our vax guys to implement it.
Implementing it is another step to make vax kernels build again.
 1.16 20-Dec-2008  cegger catch up with latest changes: sendsig -> sendsig_siginfo
 1.15 24-Apr-2008  ad branches: 1.15.2; 1.15.4; 1.15.10;
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
 1.14 20-Dec-2007  dsl branches: 1.14.6; 1.14.8;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.13 17-Oct-2007  garbled branches: 1.13.4; 1.13.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.12 08-Jul-2007  pooka branches: 1.12.10;
Initialize the link context in a signal frame to the receiving lwp's
link context instead of NULL. Otherwise, if we got a signal while the
lwp had a link context set, the link context would be set to NULL upon
return from signal delivery.

christos@tech-kern: "I think you are right."
 1.11 04-Mar-2007  christos branches: 1.11.2; 1.11.4; 1.11.10;
Fix caddr_t fallout.
 1.10 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 21-Feb-2007  thorpej Pick up some additional files that were missed before due to conflicts
with newlock2 merge:

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.8 16-Feb-2007  ad branches: 1.8.2;
More MD changes to get vax compiling.
 1.7 09-Feb-2007  ad Merge newlock2 to head.
 1.6 11-Dec-2005  christos branches: 1.6.20;
merge ktrace-lwp.
 1.5 14-Sep-2005  he Another file which needs <compat/sys/signal.h> and <compat/sys/signalvar.h>
for native_sigset_to_sigset13.

Also fix something which must obviously be a typo:
COMAT_ULTRIX -> COMPAT_ULTRIX.
 1.4 11-Dec-2003  matt branches: 1.4.4; 1.4.18;
Copy ksi->ksi_info, not all of ksi, to user stack.
 1.3 30-Sep-2003  matt Rearrange and with COMPAT_* properly
 1.2 29-Sep-2003  matt trap.c: Set ksi.ksi_trap to frame->trap.
sig_machdep.c: Use ksi->ksi_addr in compat code to supply the
'code' argument to the old signal routines.
 1.1 29-Sep-2003  matt Add SA_SIGINFO support for VAX.
 1.4.18.4 21-Jan-2008  yamt sync with head
 1.4.18.3 03-Sep-2007  yamt sync with head.
 1.4.18.2 26-Feb-2007  yamt sync with head.
 1.4.18.1 21-Jun-2006  yamt sync with head.
 1.4.4.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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 11-Dec-2003  skrll file sig_machdep.c was added on branch ktrace-lwp on 2004-08-03 10:42:37 +0000
 1.6.20.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.8.2.3 11-Aug-2012  matt Include compat stuff for IBCS2 as well.
 1.8.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.8.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.11.10.1 03-Oct-2007  garbled Sync with HEAD
 1.11.4.1 11-Jul-2007  mjf Sync with head.
 1.11.2.1 15-Jul-2007  ad Sync with head.
 1.12.10.2 09-Jan-2008  matt sync with HEAD
 1.12.10.1 06-Nov-2007  matt sync with HEAD
 1.13.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.13.4.1 26-Dec-2007  ad Sync with head.
 1.14.8.1 18-May-2008  yamt sync with head.
 1.14.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.14.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.15.4.3 14-May-2008  wrstuden Per discussion with ad at n dot o, revert signal mask handling
changes.

The l_sigstk changes are most likely totally un-needed as SA will
never use a signal stack - we send an upcall (or will as other
diffs are brought in).

The l_sigmask changes were too controvertial. In all honesty, I
think it's probably best to revert them. The main reason they were
there is the fact that in an SA process, we don't mask signals per
kernel thread, we mask them per user thread. In the kernel, we want
them all to get turned into upcalls. Thus the normal state of
l_sigmask in an SA process is for it to always be empty.

While we are in the process of delivering a signal, we want to
temporarily mask a signal (so we don't recursively exhaust our
upcall stacks). However signal delivery is rare (important, but
rare), and delivering back-to-back signals is even rarer. So rather
than cause every user of a signal mask to be prepared for this very
rare case, we will just add a second check later in the signal
delivery code. Said change is not in this diff.

This also un-compensates all of our compatability code for dealing
with SA. SA is a NetBSD-specific thing, so there's no need for
Irix, Linux, Solaris, SVR4 and so on to cope with it.

As previously, everything other than kern_sa.c compiles in i386
GENERIC as of this checkin. I will switch to ALL soon for compile
testing.
 1.15.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.15.4.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.15.2.2 11-Mar-2010  yamt sync with head
 1.15.2.1 04-May-2009  yamt sync with head.
 1.19.4.1 05-Mar-2011  rmind sync with head
 1.21.40.1 30-Jan-2019  martin Pull up following revision(s) (requested by maxv in ticket #1677):

sys/arch/hppa/hppa/sig_machdep.c: revision 1.26
sys/arch/arm/arm/sig_machdep.c: revision 1.51
sys/arch/i386/i386/machdep.c: revision 1.813
sys/arch/alpha/alpha/machdep.c: revision 1.352
sys/arch/m68k/m68k/sig_machdep.c: revision 1.50
sys/arch/usermode/target/i386/cpu_i386.c: revision 1.8
sys/arch/sparc64/sparc64/machdep.c: revision 1.289
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.111
sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.46
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.117
sys/arch/sh3/sh3/sh3_machdep.c: revision 1.106
sys/arch/mips/mips/netbsd32_machdep.c: revision 1.16
sys/arch/mips/mips/sig_machdep.c: revision 1.24
sys/arch/usermode/target/x86_64/cpu_x86_64.c: revision 1.7
sys/arch/vax/vax/sig_machdep.c: revision 1.23

Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.
 1.21.32.1 30-Jan-2019  martin Pull up following revision(s) (requested by maxv in ticket #1677):

sys/arch/hppa/hppa/sig_machdep.c: revision 1.26
sys/arch/arm/arm/sig_machdep.c: revision 1.51
sys/arch/i386/i386/machdep.c: revision 1.813
sys/arch/alpha/alpha/machdep.c: revision 1.352
sys/arch/m68k/m68k/sig_machdep.c: revision 1.50
sys/arch/usermode/target/i386/cpu_i386.c: revision 1.8
sys/arch/sparc64/sparc64/machdep.c: revision 1.289
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.111
sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.46
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.117
sys/arch/sh3/sh3/sh3_machdep.c: revision 1.106
sys/arch/mips/mips/netbsd32_machdep.c: revision 1.16
sys/arch/mips/mips/sig_machdep.c: revision 1.24
sys/arch/usermode/target/x86_64/cpu_x86_64.c: revision 1.7
sys/arch/vax/vax/sig_machdep.c: revision 1.23

Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.
 1.21.30.1 28-Aug-2017  skrll Sync with HEAD
 1.21.28.1 30-Jan-2019  martin Pull up following revision(s) (requested by maxv in ticket #1677):

sys/arch/hppa/hppa/sig_machdep.c: revision 1.26
sys/arch/arm/arm/sig_machdep.c: revision 1.51
sys/arch/i386/i386/machdep.c: revision 1.813
sys/arch/alpha/alpha/machdep.c: revision 1.352
sys/arch/m68k/m68k/sig_machdep.c: revision 1.50
sys/arch/usermode/target/i386/cpu_i386.c: revision 1.8
sys/arch/sparc64/sparc64/machdep.c: revision 1.289
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.111
sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.46
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.117
sys/arch/sh3/sh3/sh3_machdep.c: revision 1.106
sys/arch/mips/mips/netbsd32_machdep.c: revision 1.16
sys/arch/mips/mips/sig_machdep.c: revision 1.24
sys/arch/usermode/target/x86_64/cpu_x86_64.c: revision 1.7
sys/arch/vax/vax/sig_machdep.c: revision 1.23

Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.
 1.21.12.1 03-Dec-2017  jdolecek update from HEAD
 1.22.10.1 10-Jun-2019  christos Sync with HEAD
 1.22.8.2 18-Jan-2019  pgoyette Synch with HEAD
 1.22.8.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.22.2.1 27-Jan-2019  martin Pull up following revision(s) (requested by maxv in ticket #1173):
sys/arch/hppa/hppa/sig_machdep.c: revision 1.26
sys/arch/arm/arm/sig_machdep.c: revision 1.51
sys/arch/i386/i386/machdep.c: revision 1.813
sys/arch/alpha/alpha/machdep.c: revision 1.352
sys/arch/m68k/m68k/sig_machdep.c: revision 1.50
sys/arch/usermode/target/i386/cpu_i386.c: revision 1.8
sys/arch/sparc64/sparc64/machdep.c: revision 1.289
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.111
sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.46
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.117
sys/arch/sh3/sh3/sh3_machdep.c: revision 1.106
sys/arch/mips/mips/netbsd32_machdep.c: revision 1.16
sys/arch/mips/mips/sig_machdep.c: revision 1.24
sys/arch/riscv/riscv/sig_machdep.c: revision 1.2
sys/arch/usermode/target/x86_64/cpu_x86_64.c: revision 1.7
sys/arch/vax/vax/sig_machdep.c: revision 1.23

Fix widespread leak in the sendsig_siginfo() functions. sigframe_siginfo
has padding, so zero it out properly. While here I'm also zeroing out some
other things in several ports, for safety. Same problem in netbsd32, so
fix that too.

I can't compile-test on each architecture, but there should be no
breakage (tm).

Overall this fixes at least 14 info leaks. Prompted by the discovery by
KLEAK of a leak in amd64's sendsig_siginfo.
 1.26.4.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.6 13-Feb-1995  mycroft Clean up deleted files.
 1.5 25-Nov-1994  ragge Lots of fixes and updates.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file skit.c was added on branch netbsd-1-0 on 1994-08-16 23:47:37 +0000
 1.43 18-Dec-2023  kalvisd vax: preserve AST requests raised when handling software interrupts

PR port-vax/55415

On return from a software interrupt, if the software interrupt LWP
raised an AST request, copy the AST level from its PCB to the PCB
of the interrupted LWP.

Reviewed by <ragge>
 1.42 23-Feb-2023  riastradh vax: Note where cpu_switchto needs barriers.

PR kern/57240

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.
 1.41 31-Oct-2022  andvar branches: 1.41.2;
s/interrut/interrupt/ and s/accelelerator/accelerator/ in comments.
 1.40 05-Dec-2021  msaitoh s/implictily/implicitly/ in comment.
 1.39 04-Oct-2021  andvar s/userpsace/userspace/
 1.38 30-Jun-2020  maxv Make copystr() a MI C function, part of libkern and shared on all
architectures.

Notes:

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

Could test on amd64 only, but should be fine.
 1.37 08-Jan-2020  ad Hopefully fix some problems seen with MP support on non-x86, in particular
where curcpu() is defined as curlwp->l_cpu:

- mi_switch(): undo the ~2007ish optimisation to unlock curlwp before
calling cpu_switchto(). It's not safe to let other actors mess with the
LWP (in particular l->l_cpu) while it's still context switching. This
removes l->l_ctxswtch.

- Move the LP_RUNNING flag into l->l_flag and rename to LW_RUNNING since
it's now covered by the LWP's lock.

- Ditch lwp_exit_switchaway() and just call mi_switch() instead. Everything
is in cache anyway so it wasn't buying much by trying to avoid saving old
state. This means cpu_switchto() will never be called with prevlwp ==
NULL.

- Remove some KERNEL_LOCK handling which hasn't been needed for years.
 1.36 06-Apr-2019  thorpej branches: 1.36.4; 1.36.6;
Overhaul the API used to fetch and store individual memory cells in
userspace. The old fetch(9) and store(9) APIs (fubyte(), fuword(),
subyte(), suword(), etc.) are retired and replaced with new ufetch(9)
and ustore(9) APIs that can return proper error codes, etc. and are
implemented consistently across all platforms. The interrupt-safe
variants are no longer supported (and several of the existing attempts
at fuswintr(), etc. were buggy and not actually interrupt-safe).

Also augmement the ucas(9) API, making it consistently available on
all plaforms, supporting uniprocessor and multiprocessor systems, even
those that do not have CAS or LL/SC primitives.

Welcome to NetBSD 8.99.37.
 1.35 29-Dec-2018  maxv Retire compat_ibcs2, as discussed on tech-kern@. FreeBSD did the same
recently.
 1.34 22-May-2017  ragge branches: 1.34.2; 1.34.8; 1.34.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.33 20-Dec-2010  matt branches: 1.33.18; 1.33.36;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.32 12-May-2010  snj Fix gimplish.
 1.31 12-May-2010  matt Make sure the softint lwp runs at IPL_HIGH.
 1.30 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.29 12-Dec-2009  martin branches: 1.29.2; 1.29.4;
Fix register usage in previous proc0paddr->lwp0.l_addr change: do not
overwrite %r1 yet, it is later used to calculate the kernel stack pointer.
As a side effect the right value is stored in $PR_PCBB again.
 1.28 10-Dec-2009  rmind Rename L_ADDR to L_PCB and amend some comments accordingly.
 1.27 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.26 10-Apr-2009  tsutsui Apply patch from mhitch@:
Make copyin(9) and copyout(9) work with 64KB or larger data blocks.
Fixes broken pipe(2) problem mentioned in PR port-vax/41139. Ok'ed by ragge@.

Should be pulled up to netbsd-5.
 1.25 29-Aug-2008  matt branches: 1.25.2; 1.25.4; 1.25.8;
Drop support for compiling a.out kernel. Elves rule!
 1.24 23-Feb-2008  matt branches: 1.24.4; 1.24.6; 1.24.10;
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.23 22-Feb-2008  matt Rethink softint cleanup. instead of post softint, do it before so we always
know it was done right. This fixes KSP invalid panics.
 1.22 21-Feb-2008  matt branches: 1.22.2; 1.22.6;
More softint fixes. We need to restore the softint lwp's pcb to it's initial
state since it may have been blocked or interrupted by another softint.
 1.21 20-Feb-2008  matt Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.20 05-Feb-2008  matt Make sure device interrupts are handled at IPL_VM
 1.19 31-Jan-2008  christos make the kernel link again from Henry Bent
 1.18 17-Oct-2007  garbled branches: 1.18.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.17 17-May-2007  yamt branches: 1.17.10;
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.16 12-Mar-2007  matt branches: 1.16.2; 1.16.8;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.15 04-Mar-2007  ragge branches: 1.15.2;
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.14 09-Feb-2007  ad branches: 1.14.2;
Merge newlock2 to head.
 1.13 11-Dec-2005  christos branches: 1.13.20; 1.13.24;
merge ktrace-lwp.
 1.12 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.11 09-Apr-2005  matt branches: 1.11.2;
Remove upcall trampoline. We don't need it anymore.
 1.10 04-Jan-2004  jdolecek branches: 1.10.8; 1.10.14;
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.9 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.8 29-Sep-2003  matt Add SA_SIGINFO support for VAX.
 1.7 20-Jan-2003  matt branches: 1.7.2;
Fix some SA lossage.
 1.6 19-Jan-2003  ragge Add some instrumentation and clean up some VAX8600 code.
From Johnny Billquist.
 1.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 04-Apr-2002  ragge Fix crash problems reported by mrg and bouyer in separate mails.
 1.3 31-Mar-2002  matt Make ddb symbol loading work for ELF as well a.out.
 1.2 24-Feb-2002  matt branches: 1.2.2; 1.2.8;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.2.8.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.8.1 24-Feb-2002  jdolecek file subr.S was added on branch kqueue on 2002-03-16 16:00:17 +0000
 1.2.2.9 05-Jan-2003  thorpej In cpu_upcall(), build a CALLG frame holding the arguments/count on
the stack, and provide an upcall trampoline that uses it to actually
call the upcall. No need to save regs, etc., since upcalls never
return.
 1.2.2.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.2.2.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.2.2.6 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.2.2.5 22-Jun-2002  nathanw Add a register prefix in cpu_preempt().
 1.2.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.2.2.3 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 24-Feb-2002  nathanw file subr.S was added on branch nathanw_sa on 2002-02-28 04:12:32 +0000
 1.7.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.14.1 23-Apr-2009  snj Pull up following revision(s) (requested by mhitch in ticket #2010):
sys/arch/vax/vax/subr.S: revision 1.26
Apply patch from mhitch@:
Make copyin(9) and copyout(9) work with 64KB or larger data blocks.
Fixes broken pipe(2) problem mentioned in PR port-vax/41139. Ok'ed by ragge@.
Should be pulled up to netbsd-5.
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.11.2.6 27-Feb-2008  yamt sync with head.
 1.11.2.5 11-Feb-2008  yamt sync with head.
 1.11.2.4 04-Feb-2008  yamt sync with head.
 1.11.2.3 03-Sep-2007  yamt sync with head.
 1.11.2.2 26-Feb-2007  yamt sync with head.
 1.11.2.1 21-Jun-2006  yamt sync with head.
 1.13.24.1 30-Apr-2009  bouyer Pull up following revision(s) (requested by mhitch in ticket #1309):
sys/arch/vax/vax/subr.S: revision 1.26
Apply patch from mhitch@:
Make copyin(9) and copyout(9) work with 64KB or larger data blocks.
Fixes broken pipe(2) problem mentioned in PR port-vax/41139. Ok'ed by ragge@.
Should be pulled up to netbsd-5.
 1.13.20.1 30-Jan-2007  ad For now always call sched_unlock_idle/sched_lock_idle. They will be
removed by yamt's cpu_switchto() changes.
 1.14.2.3 07-Apr-2007  matt Save curlwp in cpu_switchto.
 1.14.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.14.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.2.2 27-May-2007  ad Sync with head.
 1.15.2.1 13-Mar-2007  ad Sync with head.
 1.16.8.1 22-May-2007  matt Update to HEAD.
 1.16.2.1 11-Jul-2007  mjf Sync with head.
 1.17.10.2 23-Mar-2008  matt sync with HEAD
 1.17.10.1 06-Nov-2007  matt sync with HEAD
 1.18.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.22.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.22.6.2 03-Apr-2008  mjf Sync with HEAD.
 1.22.6.1 21-Feb-2008  mjf file subr.S was added on branch mjf-devfs2 on 2008-04-03 12:42:29 +0000
 1.22.2.1 24-Mar-2008  keiichi sync with head.
 1.24.10.1 19-Oct-2008  haad Sync with HEAD.
 1.24.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.24.4.3 11-Aug-2010  yamt sync with head.
 1.24.4.2 11-Mar-2010  yamt sync with head
 1.24.4.1 04-May-2009  yamt sync with head.
 1.25.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.4.1 11-Apr-2009  snj Pull up following revision(s) (requested by mhitch in ticket #686):
sys/arch/vax/vax/subr.S: revision 1.26
Apply patch from mhitch@:
Make copyin(9) and copyout(9) work with 64KB or larger data blocks.
Fixes broken pipe(2) problem mentioned in PR port-vax/41139. Ok'ed by ragge@.
 1.25.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.29.4.2 05-Mar-2011  rmind sync with head
 1.29.4.1 30-May-2010  rmind sync with head
 1.29.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.29.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.33.36.1 28-Aug-2017  skrll Sync with HEAD
 1.33.18.1 03-Dec-2017  jdolecek update from HEAD
 1.34.10.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.34.10.1 10-Jun-2019  christos Sync with HEAD
 1.34.8.1 18-Jan-2019  pgoyette Synch with HEAD
 1.34.2.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1859):

sys/arch/ia64/ia64/vm_machdep.c: revision 1.18
sys/arch/powerpc/powerpc/locore_subr.S: revision 1.67
sys/arch/aarch64/aarch64/locore.S: revision 1.91
sys/arch/mips/include/asm.h: revision 1.74
sys/arch/hppa/include/cpu.h: revision 1.13
sys/arch/arm/arm/armv6_start.S: revision 1.38
(applied also to sys/arch/arm/cortex/a9_mpsubr.S,
sys/arch/arm/cortex/a9_mpsubr.S,
sys/arch/arm/cortex/cortex_init.S)
sys/arch/evbmips/ingenic/cpu_startup.S: revision 1.2
sys/arch/mips/mips/locore.S: revision 1.229
sys/arch/alpha/include/asm.h: revision 1.45
(applied to sys/arch/alpha/alpha/multiproc.s)
sys/arch/sparc64/sparc64/locore.s: revision 1.432
sys/arch/vax/vax/subr.S: revision 1.42
sys/arch/mips/mips/locore_mips3.S: revision 1.116
sys/arch/ia64/ia64/machdep.c: revision 1.44
sys/arch/arm/arm32/cpuswitch.S: revision 1.106
sys/arch/sparc/sparc/locore.s: revision 1.284
(all via patch)

aarch64: Add missing barriers in cpu_switchto.
Details in comments.

Note: This is a conservative change that inserts a barrier where
there was a comment saying none is needed, which is probably correct.
The goal of this change is to systematically add barriers to be
confident in correctness; subsequent changes may remove some bariers,
as an optimization, with an explanation of why each barrier is not
needed.

PR kern/57240

alpha: Add missing barriers in cpu_switchto.
Details in comments.

arm32: Add missing barriers in cpu_switchto.
Details in comments.

hppa: Add missing barriers in cpu_switchto.
Not sure hppa has ever had working MULTIPROCESSOR, so maybe no
pullups needed?

ia64: Add missing barriers in cpu_switchto.
(ia64 has never really worked, so no pullups needed, right?)

mips: Add missing barriers in cpu_switchto.
Details in comments.

powerpc: Add missing barriers in cpu_switchto.
Details in comments.

sparc: Add missing barriers in cpu_switchto.

sparc64: Add missing barriers in cpu_switchto.
Details in comments.

vax: Note where cpu_switchto needs barriers.

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.
 1.36.6.1 17-Jan-2020  ad Sync with head.
 1.36.4.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1676):

sys/arch/ia64/ia64/vm_machdep.c: revision 1.18
sys/arch/powerpc/powerpc/locore_subr.S: revision 1.67
sys/arch/aarch64/aarch64/locore.S: revision 1.91
sys/arch/mips/include/asm.h: revision 1.74
sys/arch/hppa/include/cpu.h: revision 1.13
sys/arch/arm/arm/armv6_start.S: revision 1.38
sys/arch/evbmips/ingenic/cpu_startup.S: revision 1.2
sys/arch/mips/mips/locore.S: revision 1.229
sys/arch/aarch64/aarch64/cpuswitch.S: revision 1.40
sys/arch/alpha/include/asm.h: revision 1.45
sys/arch/sparc64/sparc64/locore.s: revision 1.432
sys/arch/vax/vax/subr.S: revision 1.42
sys/arch/mips/mips/locore_mips3.S: revision 1.116
sys/arch/ia64/ia64/machdep.c: revision 1.44
sys/arch/arm/arm32/cpuswitch.S: revision 1.106
sys/arch/sparc/sparc/locore.s: revision 1.284
(all via patch)

aarch64: Add missing barriers in cpu_switchto.
Details in comments.

Note: This is a conservative change that inserts a barrier where
there was a comment saying none is needed, which is probably correct.
The goal of this change is to systematically add barriers to be
confident in correctness; subsequent changes may remove some bariers,
as an optimization, with an explanation of why each barrier is not
needed.

PR kern/57240

alpha: Add missing barriers in cpu_switchto.
Details in comments.

arm32: Add missing barriers in cpu_switchto.
Details in comments.

hppa: Add missing barriers in cpu_switchto.
Not sure hppa has ever had working MULTIPROCESSOR, so maybe no
pullups needed?

ia64: Add missing barriers in cpu_switchto.
(ia64 has never really worked, so no pullups needed, right?)

mips: Add missing barriers in cpu_switchto.
Details in comments.

powerpc: Add missing barriers in cpu_switchto.
Details in comments.

sparc: Add missing barriers in cpu_switchto.

sparc64: Add missing barriers in cpu_switchto.
Details in comments.

vax: Note where cpu_switchto needs barriers.

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.
 1.41.2.2 19-Dec-2023  martin Pull up following revision(s) (requested by kalvisd in ticket #508):

sys/arch/vax/vax/subr.S: revision 1.43

vax: preserve AST requests raised when handling software interrupts

PR port-vax/55415

On return from a software interrupt, if the software interrupt LWP
raised an AST request, copy the AST level from its PCB to the PCB
of the interrupted LWP.

Reviewed by <ragge>
 1.41.2.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #264):

sys/arch/ia64/ia64/vm_machdep.c: revision 1.18
sys/arch/powerpc/powerpc/locore_subr.S: revision 1.67
sys/arch/aarch64/aarch64/locore.S: revision 1.91
sys/arch/mips/include/asm.h: revision 1.74
sys/arch/hppa/include/cpu.h: revision 1.13
sys/arch/arm/arm/armv6_start.S: revision 1.38
sys/arch/evbmips/ingenic/cpu_startup.S: revision 1.2
sys/arch/mips/mips/locore.S: revision 1.229
sys/arch/aarch64/aarch64/cpuswitch.S: revision 1.40
sys/arch/alpha/include/asm.h: revision 1.45
sys/arch/sparc64/sparc64/locore.s: revision 1.432
sys/arch/vax/vax/subr.S: revision 1.42
sys/arch/mips/mips/locore_mips3.S: revision 1.116
sys/arch/riscv/riscv/cpu_switch.S: revision 1.3
sys/arch/ia64/ia64/machdep.c: revision 1.44
sys/arch/arm/arm32/cpuswitch.S: revision 1.106
sys/arch/sparc/sparc/locore.s: revision 1.284

aarch64: Add missing barriers in cpu_switchto.
Details in comments.

Note: This is a conservative change that inserts a barrier where
there was a comment saying none is needed, which is probably correct.
The goal of this change is to systematically add barriers to be
confident in correctness; subsequent changes may remove some bariers,
as an optimization, with an explanation of why each barrier is not
needed.

PR kern/57240

alpha: Add missing barriers in cpu_switchto.
Details in comments.

arm32: Add missing barriers in cpu_switchto.
Details in comments.

hppa: Add missing barriers in cpu_switchto.
Not sure hppa has ever had working MULTIPROCESSOR, so maybe no
pullups needed?

ia64: Add missing barriers in cpu_switchto.
(ia64 has never really worked, so no pullups needed, right?)

mips: Add missing barriers in cpu_switchto.
Details in comments.

powerpc: Add missing barriers in cpu_switchto.
Details in comments.

riscv: Add missing barriers in cpu_switchto.
Details in comments.

sparc: Add missing barriers in cpu_switchto.

sparc64: Add missing barriers in cpu_switchto.
Details in comments.

vax: Note where cpu_switchto needs barriers.

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.
 1.62 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.61 10-Feb-2002  thorpej Remove blkclr() and blkcpy(); similar routines have been added to
libkern.
 1.60 03-Jun-2001  ragge branches: 1.60.2; 1.60.8;
A bunch of fixes:
- Make generic console routines not relying on running on master cpu.
- Add routine to start console transmitter (after IPI).
- Use real IPIs instead of the "console doorbell".
- Add routines cpu_send_ipi()/cpu_handle_ipi().
 1.59 29-May-2001  ragge Change Swtch so that the old process context is stored directly and the
idle loop is on the interrupt stack instead of the last running process'
stack. This is needed to work in a multiprocessor environment.
 1.58 27-May-2001  ragge Compare arguments must have correct order, won't work as expected otherwise.
 1.57 02-May-2001  matt Use the symtab info given by loadfile in the booter instead of assuming
we know where it is. This is a requirement for ELF.
 1.56 02-Dec-2000  ragge branches: 1.56.2;
Add fusword() + a MP change.
 1.55 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.54 26-Aug-2000  matt Fix the idle loop.
 1.53 26-Aug-2000  matt Update to reflect new processor switching conventions w/ LOCKDEBUG
and MULTIPROCESSOR
 1.52 02-Aug-2000  ragge Fix bug that trashed the SPT if any copy* function were used before
the first swtch().
 1.51 19-Jul-2000  matt More ELF changes (a.out still works).
 1.50 17-Jul-2000  matt Changes so that the kernel can be compiled under __ELF__.
 1.49 06-Jul-2000  ragge Add code to support loading of kernel directly via MOP.
This is only intended for development purposes, not production use.
 1.48 10-Jun-2000  ragge branches: 1.48.2;
Code to spin up other CPUs on a VAX 8200 system.
Haven't solved the printf() problem yet, though.
 1.47 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.46 04-Jun-2000  matt use PR_IPL instead of 0x12.
align entries of various symbols.
 1.45 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.44 02-Jun-2000  matt Add IPL_* codes.
Add other codes for struct references.
Add softintr framework for IPL_SOFTNET and IPL_SOFTSERIAL.
General cleanup of .s files replacing hardcoded structure offsets with
symbolic ones.
 1.43 31-May-2000  thorpej In the MULTIPROCESSOR case, initialize p_cpu before a process is
marked SONPROC.
 1.42 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.41 27-May-2000  ragge Remove the pcbtrap global variable, use a per-CPU variable instead.
 1.40 26-May-2000  thorpej branches: 1.40.2;
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.39 26-May-2000  thorpej Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor. Test against SONPROC as appropriate rather than
combinations of SRUN and curproc. Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
 1.38 20-May-2000  ragge Changes to use the RPB for different tasks. Much simpler now to find the
boot device.
 1.37 09-May-2000  ragge Change copy*str() functions. More paranoid checking of legal address space.
Fixes PR#7838.
 1.36 01-May-2000  ragge Call uvm_pageidlezero() in idle loop.
 1.35 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.34 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.33 10-Jan-2000  matt Add ibcs2 signal tramp code.
 1.32 25-Mar-1999  mrg branches: 1.32.8;
remove opt_uvm.h
 1.31 26-Nov-1998  ragge Fix kcopy fault-handler saving.
Get kernel last address from boot instead.
 1.30 05-Nov-1998  ragge EGCS fixes.
 1.29 06-Oct-1998  matt Code references should use movab, not moval. Fix gas-2.9.1 complaints
with intvec.s
 1.28 02-Oct-1998  drochner use old sigmask in sigcontext and old sigreturn syscall in Ultrix
emulation mode
 1.27 30-Sep-1998  ragge Make kernel compile after recent signal changes.
 1.26 09-Sep-1998  thorpej Adjust for the new "reaper" kernel thread: do not free the vmspace and
u-area in machine-dependent code. Instead, call exit2() to schedule
the reaper to free them for us, once it is safe to do so (i.e. we are
no longer running on the dead proc's vmspace and stack).
 1.25 04-Jul-1998  jonathan defopt DDB.
 1.24 03-May-1998  ragge Enable -Wall -Wmissing-prototypes -Wstrict-prototypes.
 1.23 02-Mar-1998  ragge Support for UVM on VAXen.
 1.22 18-Jan-1998  ragge Garbage-collect unnecessary functions. Don't have blkcpy/blkclr
as inline.
 1.21 02-Jan-1998  ragge Fix problem in copy*str() when not emulating locc.
 1.20 04-Nov-1997  ragge Optimized copy/fetch/store routines; rewritten in assembler.
 1.19 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.18 22-Mar-1997  ragge CPU support for MV3100. (KA41)
 1.17 15-Mar-1997  ragge Put in some #ifdef's to compile only for MV2000.
 1.16 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.15 13-Feb-1996  ragge Much faster copyin/copyout subroutines, written by Ken Wellsch.
Improved user-space network I/O (like ftp) with about 1.7 times!
 1.14 02-Feb-1996  mycroft Fix #includes.
 1.13 28-Jan-1996  ragge Save USP when trapping from userspace.
Change register save structs according to this.
Be compatible with the way old init passes flags (in registers).
 1.12 10-Nov-1995  ragge _idsptch added, _physcopypage removed.
 1.11 16-Jun-1995  ragge rudimentary DDB support.
 1.10 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.9 05-May-1995  ragge Removed kernel stack relocation and double-mapping.
Speeded up fork() significantly.
 1.8 12-Apr-1995  ragge Fixes to conf.c
Cleaning of code.
 1.7 10-Apr-1995  mycroft v_cmap --> vmmap
 1.6 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.5 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.4 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.3 25-Nov-1994  ragge Lots of fixes and updates.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.32.8.2 08-Dec-2000  bouyer Sync with HEAD.
 1.32.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.40.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.48.2.1 02-Aug-2000  ragge Pull up revision 1.51-1.52 (requested by ragge):
This fixes a bug where the SPT could be trashed if a copy* routine
were called before the first swtch().
 1.56.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.60.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.60.8.1 03-Jun-2001  nathanw file subr.s was added on branch nathanw_sa on 2002-02-28 04:12:32 +0000
 1.60.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.14 31-Jan-1997  thorpej This file is obsolete; this information is now generated by config(8).
 1.13 13-Oct-1996  christos backout previous kprintf change
 1.12 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.11 20-Jul-1996  ragge Put in rd (ST506 disk), sd and st.
 1.10 01-Jul-1996  ragge Remove old config support code.
 1.9 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.8 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.7 02-Feb-1996  mycroft Fix #includes.
 1.6 28-Jan-1996  ragge Make use of the new disk struct when attaching disks.
Don't rely on UBA's; we do not always want them.
 1.5 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.4 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 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 swapgeneric.c was added on branch netbsd-1-0 on 1994-08-02 20:22:17 +0000
 1.27 05-Oct-2023  ad Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).
 1.26 06-Apr-2019  kamil Centralized shared part of child_return() into MI part

Add a new function md_child_return() for MD specific bits only.

New child_return() is now part of MI and central code that handles
uniformly tracing code (KTR and ptrace(2)).

Synchronize value passed to ktrsysret() among ports to SYS_fork. This is
a traditional value and accessing p_lflag to check for PL_PPWAIT shall
use locking against proc_lock. Returning SYS_fork vs SYS_vfork still isn't
correct enough as there are more entry points to forking code. Instead of
making it too good, just settle with plain SYS_fork for all ports.
 1.25 03-Apr-2019  kamil Rework the fork(2)/vfork(2) event signalling under ptrace(2)

Remove the constraint of SIGTRAP event being maskable by a tracee.

Now all SIGTRAP TRAP_CHLD events are delivered to debugger.

This code touches MD specific logic and the child_return routine.
It's an intermediate step with a room for refactoring in future and
right now the least invasive approach. This allows to assert expected
behavior in already existing ATF tests and make the code prettier
in future keeping the same semantics. Probably there is a need for a MI
wrapper of child_return for shared functionality between ports.
 1.24 22-May-2017  ragge branches: 1.24.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.23 26-Jun-2013  matt branches: 1.23.10;
Use sy_invoke
 1.22 15-Jan-2013  martin Make this compile with TRAPDEBUG enabled.
Pointed out by Holm Tiffe.
 1.21 19-Feb-2012  rmind branches: 1.21.2;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.20 11-Feb-2012  martin Add a posix_spawn syscall, as discussed on tech-kern.
Based on the summer of code project by Charles Zhang, heavily reworked
later by me - all bugs are likely mine.
Ok: core, releng.
 1.19 03-Jul-2011  matt branches: 1.19.2; 1.19.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.18 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.17 21-Nov-2009  rmind branches: 1.17.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.16 02-Jun-2009  pooka Declare extern syscallnames in a header.
 1.15 21-Oct-2008  ad Provide a small inline wrapper for sysent::sy_call() and use it to store
the active syscall description in struct lwp. To be used at some future
point to prevent unloading of modules that provide syscalls, while the
syscalls are in use.
 1.14 15-Oct-2008  wrstuden Merge wrstuden-revivesa into HEAD.
 1.13 10-Oct-2008  hans fix compile with options TRAPDEBUG, ok by matt
 1.12 24-Apr-2008  ad branches: 1.12.2; 1.12.4; 1.12.8;
- Retire SYCALL_MPSAFE. With the exceptions of darwin and irix emulations,
all system calls are now MPSAFE.
- Remove unneeded acquire/release of kernel_lock.
 1.11 24-Feb-2008  matt branches: 1.11.2;
Model this syscall.c on the i386 syscall.c. Don't have separate
syscall_fancy and syscall_plain. Use p->p_trace_enabled.
 1.10 24-Feb-2008  matt Never ever trust the user. Fix bug introduced in version 1.8 of trap.c
by ragge nearly 13 years ago.
 1.9 06-Feb-2008  dsl branches: 1.9.2; 1.9.6;
Remove the 'args' parameter to 'trace_exit()' it is no longer used.
Instead of passing the (un)real system call code and syscall table pointer,
just pass the number of arguments - which is what ktrace really wants.
Ride forthcoming 4.99.53
 1.8 05-Jan-2008  dsl Don't pass 'curlwp' into trace_enter() and trace_exit().
 1.7 17-Oct-2007  garbled branches: 1.7.2; 1.7.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.6 15-Aug-2007  ad branches: 1.6.2;
Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
 1.5 12-Mar-2007  matt branches: 1.5.8; 1.5.12; 1.5.16;
Shrink VAX kmutex from 12 bytes to 8. Fix various LOCKDEBUG/DIAGNOSTIC
problems.
 1.4 16-Feb-2007  ad branches: 1.4.2; 1.4.6;
More MD changes to get vax compiling.
 1.3 09-Feb-2007  ad Merge newlock2 to head.
 1.2 19-Jul-2006  ad branches: 1.2.4; 1.2.6; 1.2.10; 1.2.12; 1.2.16;
- Hold a reference to the process credentials in each struct lwp.
- Update the reference on syscall and user trap if p_cred has changed.
- Collect accounting flags in the LWP, and collate on LWP exit.
 1.1 12-Mar-2006  christos branches: 1.1.2; 1.1.6; 1.1.8; 1.1.14;
welcome to syscall_intern.
 1.1.14.8 27-Feb-2008  yamt sync with head.
 1.1.14.7 11-Feb-2008  yamt sync with head.
 1.1.14.6 21-Jan-2008  yamt sync with head
 1.1.14.5 03-Sep-2007  yamt sync with head.
 1.1.14.4 26-Feb-2007  yamt sync with head.
 1.1.14.3 30-Dec-2006  yamt sync with head.
 1.1.14.2 21-Jun-2006  yamt sync with head.
 1.1.14.1 12-Mar-2006  yamt file syscall.c was added on branch yamt-lazymbuf on 2006-06-21 14:57:34 +0000
 1.1.8.2 22-Apr-2006  simonb Sync with head.
 1.1.8.1 12-Mar-2006  simonb file syscall.c was added on branch simonb-timecounters on 2006-04-22 11:38:08 +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 syscall.c was added on branch elad-kernelauth on 2006-04-19 02:33:57 +0000
 1.1.2.3 11-Aug-2006  yamt sync with head
 1.1.2.2 13-Mar-2006  yamt sync with head.
 1.1.2.1 12-Mar-2006  yamt file syscall.c was added on branch yamt-pdpolicy on 2006-03-13 09:07:03 +0000
 1.2.16.1 24-Feb-2008  bouyer Pull up following revision(s) (requested by matt in ticket #1090):
sys/arch/vax/vax/syscall.c: revision 1.10
Never ever trust the user. Fix bug introduced in version 1.8 of
trap.c
by ragge nearly 13 years ago.
 1.2.12.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.2.10.1 24-Feb-2008  bouyer Pull up following revision(s) (requested by matt in ticket #1090):
sys/arch/vax/vax/syscall.c: revision 1.10
Never ever trust the user. Fix bug introduced in version 1.8 of
trap.c
by ragge nearly 13 years ago.
 1.2.6.2 09-Sep-2006  rpaulo sync with head
 1.2.6.1 19-Jul-2006  rpaulo file syscall.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:44:23 +0000
 1.2.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.4.6.2 20-Aug-2007  ad Sync with HEAD.
 1.4.6.1 13-Mar-2007  ad Sync with head.
 1.4.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.16.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.5.12.1 03-Sep-2007  skrll Sync with HEAD.
 1.5.8.1 03-Oct-2007  garbled Sync with HEAD
 1.6.2.3 23-Mar-2008  matt sync with HEAD
 1.6.2.2 09-Jan-2008  matt sync with HEAD
 1.6.2.1 06-Nov-2007  matt sync with HEAD
 1.7.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.7.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.9.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.9.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.9.2.1 24-Mar-2008  keiichi sync with head.
 1.11.2.1 18-May-2008  yamt sync with head.
 1.12.8.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.12.8.1 19-Oct-2008  haad Sync with HEAD.
 1.12.4.2 14-Oct-2008  wrstuden Add a new vp-private flag, SAVP_FLAG_DELIVERING. This flag indicates
that the vp is in the process of delivering a new-thread upcall.
This is a BLOCKED or NEWPROC upcall. Do NOT generate any BLOCKED
upcalls while this is set. Set it at the end of sa_switchcall()
and clear it at syscall entry. Sadly, I have found no other
way to handle this. The old SA interface has no way for
userland to acknowledge that it got the upcall, so use syscall
entry as the indicator that libpthread got it.

This addresses the issue seen on current-users with firefox
dying with a blockedgen != unbockedgen error. The problem is we
deliver a BLOCKED upcall, but between the end of userret()
and when the CPU indicates that it's running in user mode, we take
a page fault. Said page fault blocks, blocking upcall delivery.
The original block, however, was short-lived, and the UNBLOCK
happens shortly. It happens before libpthread actually notices
the BLOCKED upcall. Boom!

Unfortunately a LOCKDEBUG/DIAGNOSTIC kernel still dies before
firefox opens. However this new issue is with uvm code calling
mtsleep when not holding a correct lock; sa_switch() is exploding
at KASSERT(lwp_locked(l, NULL)); before it's done _anything_.

Also, while here, add sa_system_disabled. This is an integer
that we examine when starting SA for a proc. If it's non-zero,
we error out. Once this is hooked into sysctl, you'll be able to
disable SA w/o recompiling.
 1.12.4.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.12.2.3 11-Mar-2010  yamt sync with head
 1.12.2.2 20-Jun-2009  yamt sync with head
 1.12.2.1 04-May-2009  yamt sync with head.
 1.17.4.1 05-Mar-2011  rmind sync with head
 1.19.6.2 24-Feb-2012  mrg sync to -current.
 1.19.6.1 18-Feb-2012  mrg merge to -current.
 1.19.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.19.2.2 23-Jan-2013  yamt sync with head
 1.19.2.1 17-Apr-2012  yamt sync with head
 1.21.2.3 03-Dec-2017  jdolecek update from HEAD
 1.21.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.2.1 25-Feb-2013  tls resync with head
 1.23.10.1 28-Aug-2017  skrll Sync with HEAD
 1.24.10.1 10-Jun-2019  christos Sync with HEAD
 1.2 10-Jul-1996  ragge Remove tmscp protocol definition file; which was actually the same
as the mscp protocol.
 1.1 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.143 05-Apr-2025  riastradh vax/trap.c: Restore revisions 1.139 and 1.141: zero regs on exec.

I backed these out because the vax releng testbed seemed unhappy.
But the unhappiness of the testbed seems unrelated: backing out the
change didn't resolve it, and the symptoms were already there before
the change, so I think they are unrelated:

(before)

kernel/t_umountstress (125/980): 2 test cases
fileop: [ 5236.4300030] vnd0: no disk label
Traceback (most recent call last):
...
pexpect.exceptions.TIMEOUT: Timeout exceeded.

https://releng.netbsd.org/b5reports/vax/2025/2025.03.04.07.42.19/test.log

(after)

kernel/t_umountstress (125/980): 2 test cases
fileop: [ 5012.1700030] vnd0: no disk label
Traceback (most recent call last):
...
pexpect.exceptions.TIMEOUT: Timeout exceeded.

https://releng.netbsd.org/b5reports/vax/2025/2025.03.22.13.28.35/test.log

(most recent, with the change reverted)

kernel/t_umountstress (126/983): 2 test cases
fileop: [ 5516.6200030] vnd0: no disk label
[ 5517.1500030] ra0: drive 0 hard error datagram: memory addr 0x5000: host buffer access error (non-exist. memory) (code 9, subcode 3)
[ 5517.1500030] ra0: host buffer access error (non-exist. memory) (code 9, subcode 3)
[7.680000s] Failed: atf-check failed; see the output of the test for details
mountlist: [ 5524.4600030] vnd0: no disk label
Traceback (most recent call last):

pexpect.exceptions.TIMEOUT: Timeout exceeded.

https://releng.netbsd.org/b5reports/vax/2025/2025.04.01.03.16.41/test.log
 1.142 29-Mar-2025  riastradh vax/trap.c: Back out revisions 1.139 and 1.141 for now.

These changes served to zero registers on exec in order to avoid
leaking secret register content to the replacement process image.

Unfortunately, I did not adequately test these changes, and the vax
testbed has been unhappy since they went in. It's possible they're
not the culprit -- it's possible that 1.141 (setting PSL_U|PSL_PREVU)
was enough to fix the bug introduced by 1.139 -- but let's just try
backing both out so we can let the releng testbed figure out for me
whether to go chasing other parts of the trapframe to set up
(tf_trap=T_SYSCALL? tf_code=???) or this is a wild goose chase and
it's actually something else broken.

PR kern/59084: exec/spawn leaks register content
 1.141 22-Mar-2025  riastradh vax: Set tf_psl to PSL_U|PSL_PREVU on exec.

This was previously inherited from the caller, which was not clear
from context, and the trapframe is now zeroed which broke exec on
vax.

PR kern/59084: exec/spawn leaks register content
 1.140 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.139 16-Mar-2025  riastradh Clear trapframe on exec.

Do this for all architectures, even if the trapframe is fully
initialized -- makes it easier to audit and be confident it's
correct, and most likely (with the exception of sh3 which has an
intermediate call to ufetch_int in the middle) the compiler can
eliminate redundant stores in these routines.

PR kern/59084: exec/spawn leaks register content
 1.138 05-Oct-2023  ad branches: 1.138.6;
Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).
 1.137 11-Dec-2022  oster branches: 1.137.2;

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

Code written by ragge@ , tested by oster@.
 1.136 21-Nov-2019  ad mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.
 1.135 22-May-2017  ragge branches: 1.135.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.134 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.133 03-Mar-2015  martin Handle EINVAL in the fault path and send SIGBUS on mmap'd access past EOF
 1.132 25-Oct-2013  martin branches: 1.132.6;
Mark a diagnostic-only variable
 1.131 02-Aug-2012  matt branches: 1.131.2; 1.131.4;
Supress print fatal traps if the process is being debugged of it the signal
will be caught by a signal handler.
 1.130 19-Feb-2012  rmind Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.129 02-Feb-2012  matt On a kernel segfault, print the registers from the trapframe.
 1.128 03-Jul-2011  matt branches: 1.128.2; 1.128.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.127 04-Mar-2011  joerg Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.126 20-Dec-2010  matt branches: 1.126.2; 1.126.4;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.125 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.124 23-Apr-2010  rmind Remove lwp_uc_pool, replace it with kmem(9), plus add some consistency.
As discussed, a while ago, with ad@.
 1.123 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.122 05-Jan-2010  mbalmer branches: 1.122.2; 1.122.4;
One semicolon only (;; -> ;)
 1.121 10-Dec-2009  matt 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.120 21-Nov-2009  rmind - Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.119 25-Feb-2009  mhitch The ci_want_resched check and preempt() call had been removed from
userret() which resulted in no process preemption (and probably
contributed to the signal trap loop locking up the machine that was
recently fixed). Put the check and preempt() call in the AST trap
handler to restore process preemption.
 1.118 18-Feb-2009  mhitch On the vax, the trapsignal() call will change frame->sp to point to a
callg on the user's stack that calls the user's signal handler, so do
the skip_opcode() before calling trapsignal(). A floating point
overflow no longer causes a signal loop. This should stop the native
compile hangs trying to compile src/lib/libm/complex/catan.ln.
 1.117 16-Feb-2009  christos - 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.116 15-Oct-2008  wrstuden branches: 1.116.2; 1.116.4; 1.116.8;
Merge wrstuden-revivesa into HEAD.
 1.115 05-Aug-2008  matt For ARITH traps, set the siginfo code appropriately for FP related traps.
 1.114 21-May-2008  ad branches: 1.114.4;
Remove unneeded playing about with kernel_lock.
 1.113 11-Mar-2008  matt branches: 1.113.2; 1.113.4; 1.113.6;
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.112 22-Feb-2008  matt expand some printfs. Don't bother checking for curlwp == NULL; it can't
happen anymore. Convert some variables to bool.
 1.111 20-Feb-2008  matt branches: 1.111.2; 1.111.6;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.110 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.109 15-Aug-2007  ad branches: 1.109.2;
Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
 1.108 04-Mar-2007  christos branches: 1.108.2; 1.108.10; 1.108.14; 1.108.18;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.107 16-Feb-2007  ad branches: 1.107.2;
More MD changes to get vax compiling.
 1.106 09-Feb-2007  ad Merge newlock2 to head.
 1.105 23-Jul-2006  ad branches: 1.105.4;
Use the LWP cached credentials where sane.
 1.104 19-Jul-2006  ad - Hold a reference to the process credentials in each struct lwp.
- Update the reference on syscall and user trap if p_cred has changed.
- Collect accounting flags in the LWP, and collate on LWP exit.
 1.103 15-May-2006  yamt include kauth.h for kauth_cred_geteuid.
 1.102 14-May-2006  elad integrate kauth.
 1.101 15-Mar-2006  drochner branches: 1.101.2;
adapt to uvm_fault() interface cleanup: kill the useless 3rd argument
 1.100 12-Mar-2006  christos welcome to syscall_intern.
 1.99 07-Mar-2006  thorpej branches: 1.99.2;
Clean up fallout proc_is_traced_p() change:
- proc_is_traced_p() -> trace_is_enabled(), to match trace_enter() and
trace_exit().
- trace_is_enabled() becomes a real function.
- Remove unnecessary include files from various files that used to care
about KTRACE and SYSTRACE, but do no more.
 1.98 24-Dec-2005  perry branches: 1.98.4; 1.98.6; 1.98.8;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.97 11-Dec-2005  christos merge ktrace-lwp.
 1.96 01-Jul-2005  christos branches: 1.96.2;
PR/29607: Christian Biere systrace doesn't handle interrupted syscalls properly
Instead of jumping to the default "bad" case, jump to the error handling
switch, so that we can deal with ERESTART/EJUSTRETURN properly.
 1.95 02-Sep-2004  tacha Make this compile again.
 1.94 28-Aug-2004  jdolecek use uvm_grow() to update stack segment size on stack page fault instead
of MD code
 1.93 14-Mar-2004  cl add kernel part of concurrency support for SA on MP systems
- move per VP data into struct sadata_vp referenced from l->l_savp
* VP id
* lock on VP data
* LWP on VP
* recently blocked LWP on VP
* queue of LWPs woken which ran on this VP before sleep
* faultaddr
* LWP cache for upcalls
* upcall queue
- add current concurrency and requested concurrency variables
- make process exit run LWP on all VPs
- make signal delivery consider all VPs
- make timer events consider all VPs
- add sa_newsavp to allocate new sadata_vp structure
- add sa_increaseconcurrency to prepare new VP
- make sys_sa_setconcurrency request new VP or wakeup idle VP
- make sa_yield lower current concurrency
- set sa_cpu = VP id in upcalls
- maintain cached LWPs per VP
 1.92 13-Feb-2004  drochner plug obvious kernel lock leaks
(untested)
 1.91 02-Jan-2004  cl kernel part of no-syscall upcall stack return: libpthread registers
an offset between ss_sp and struct sa_stackinfo_t (located in struct
__pthread_st) when calling sa_register. The kernel increments the
sast_gen counter in struct sastack when an upcall stack is used.
libpthread increments the sasi_stackgen counter in struct
sa_stackinfo_t when an upcall stack is freed. The kernel compares the
two counters to decide if a stack is free or in use.

- add struct sa_stackinfo_t with sasi_stackgen to count stack use in
userland
- add sast_gen to struct sastack to count stack use in kernel
- add SA_FLAG_STACKINFO to enable the stackinfo_offset argument in the
sa_register syscall
- add sa_stackinfo_offset to struct sadata for offset between ss_sp
and struct sa_stackinfo_t
- add ssize_t stackinfo_offset argument to sa_register, initialize
struct sadata's sa_stackinfo_offset from it if SA_FLAG_STACKINFO is
set
- add sa_getstack, sa_getstack0, sa_stackused and sa_setstackfree
functions to find/use/free upcall stacks and use these where
appropriate
- don't record stack for upcall in sa_upcall0
- pass sau to sa_switchcall instead of l2 (l2 = curlwp in sa_switchcall)
- add sa_vp_blocker to struct sadata to pass recently blocked lwp to
sa_switchcall
- delay finding a stack for blocked upcalls to sa_switchcall
- add sa_stacknext to struct sadata pointing to next most likely free
upcall stack; also g/c sa_stackslist in struct sadata and sast_list
in struct sastack
- add L_SA_WOKEN flag: LWP is on sa_woken queue
- add L_SA_RECYCLE flag: LWP should be recycled in sa_setwoken
- replace l_upcallstack with L_SA_WOKEN/L_SA_RECYCLE/L_SA_BLOCKING
flags
- g/c now unused sast_blocker in struct sastack
- make sa_switchcall, sa_upcall0 and sa_upcall_getstate static in
kern_sa.c
- call sa_upcall_userret only once in userret
- split sa_makeupcalls out of sa_upcall_userret and use to process
the sa_upcalls queue
- on process exit: mark LWPs sleeping in saunblock interruptible; also
there are no LWPs sleeping on l->l_upcallstack anymore; also clear
sa_wokenq_head to prevent unblocked upcalls

additional changes:
- cleanup timerupcall sa_vp == curlwp check
- add check in sa_yield if we didn't block on our way here and we
wouldn't any longer be the LWP on the VP
- invalidate sa_vp_ofaultaddr after resolving pagefault
 1.90 06-Nov-2003  he Initialize 'p' to NULL, to work around that the compiler otherwise
can't know that 'p' is initialized before it's being used.

Reviewed by ragge.
 1.89 01-Nov-2003  cl Avoid sneaking past signal delivery in sa_upcall_userret():
generate unblocked upcalls in sa_unblock_userret(), before signal
delivery/p_userret handling in userret().

Also defer getting state for preempted upcalls because on some ports
preemption can happen between sa_unblock_userret() and sa_upcall_userret().
 1.88 31-Oct-2003  simonb Don't pass the (unused) return value args to the
trace_enter()/systrace_enter() functions.
 1.87 18-Oct-2003  ragge Do not try to fetch the current proc if curlwp == NULL. This caused
DDB to fail if no process were running.
 1.86 08-Oct-2003  thorpej * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
result of a trap. Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap. Expands to 0 if the ksiginfo_t was
not the result of a trap. This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern. Reviewed and OK's by Christos.
 1.85 29-Sep-2003  matt trap.c: Set ksi.ksi_trap to frame->trap.
sig_machdep.c: Use ksi->ksi_addr in compat code to supply the
'code' argument to the old signal routines.
 1.84 29-Sep-2003  matt Set ksi_addr to frame->code.
 1.83 29-Sep-2003  matt Add SA_SIGINFO support for VAX.
 1.82 18-Sep-2003  cl add MD part of SA/pthread pagefault handling on vax
 1.81 15-Jul-2003  lukem __KERNEL_RCSID()
 1.80 29-Jun-2003  fvdl branches: 1.80.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.79 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.78 01-Mar-2003  matt Add machdep sysctl support. Support booted_device, consdev, and
printfataltraps.
 1.77 20-Jan-2003  matt Fix some SA lossage.
 1.76 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.75 21-Dec-2002  manu Pass the system call table to trace_enter() and ktrsys() so that it is
possible to use alternate system call tables. This is usefull for
displaying correctly the arguments in Mach binaries traces.

If NULL is given, then the regular systam call table for the process is used.
 1.74 16-Nov-2002  uebayasi branches: 1.74.2;
Fix compilation errors introduced by recent trace_enter()/ktrsyscall() changes.

Provided by FUKAUMI Naoki <naoki at fukaumi dot org> in kern/19070.
 1.73 29-Sep-2002  thorpej Record stack growth, done inline to avoid another function call on
every user page fault.

XXX Should make uvm_grow() an inline.
 1.72 23-Jun-2002  mrg finish previous; it would be nice if people were to use the lovely
cross compiling mechanisms we have when making sweeping changes...
 1.71 17-Jun-2002  christos MD systrace gluons.
 1.70 29-Apr-2002  thorpej branches: 1.70.2; 1.70.4;
Only print console messages about SIGSEGV and SIGILL if the
kernel was built with DEBUG.
 1.69 20-Mar-2002  christos kill remaining PS_STRINGS instances.
 1.68 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.67 14-Feb-2002  chs allow writing to write-only mappings. fixes PR 3493.
 1.66 28-Jun-2001  ragge branches: 1.66.2; 1.66.8;
Panic if page fault on interrupt stack, per request from Jason Thorpe.
 1.65 04-Jun-2001  ragge Move some locks closer to the important point.
 1.64 03-Jun-2001  ragge A bunch of fixes:
- Make generic console routines not relying on running on master cpu.
- Add routine to start console transmitter (after IPI).
- Use real IPIs instead of the "console doorbell".
- Add routines cpu_send_ipi()/cpu_handle_ipi().
 1.63 02-Jun-2001  chs replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.62 29-May-2001  ragge Add a bunch of locking code for MP systems.
 1.61 15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.60 31-Dec-2000  matt branches: 1.60.2;
de-__P. cleanup the whitespace a bit. add a very small optimization.
 1.59 31-Dec-2000  matt Rename arithflt to trap. Change trap label to Xtrap. This is due to that
arithflt is really the trap handler so call it that.
 1.58 24-Nov-2000  matt Make this compile again.
 1.57 17-Jul-2000  matt Changes so that the kernel can be compiled under __ELF__.
 1.56 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.55 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.54 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.53 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.52 27-May-2000  sommerfeld branches: 1.52.2;
Reduce use of curproc in several places:

- Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

- Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

- Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

- ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

- move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

- simplify interface to ktrwrite()
 1.51 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.50 25-May-2000  thorpej Move common return-to-userland goo into userret(), like other ports.
 1.49 24-May-2000  thorpej Use preempt(), not an open-coded equivalent (which won't be
equivalent for long).
 1.48 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.47 21-Aug-1999  matt branches: 1.47.2;
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.46 10-Jul-1999  ragge Rewrite the page table entry routines. Don't take a pte invalid fault for
missing pte's, instead map in pte entries in pmap_enter(). The user ptes
is no more handled by the VM system. All this made swapping start working
on VAX again.
Still to do:
- Keep refcount per pte page, so that those pages get free'd when the
process is swapped out. Right now they are only free'd when the pmap
is destroyed.

Many thanks to Chuck Silvers for all help finding the deadlock problems.
 1.45 20-Jun-1999  ragge Add some small checks to avoid unwanted panic types.
 1.44 24-Mar-1999  mrg branches: 1.44.2; 1.44.4; 1.44.6;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.43 18-Mar-1999  chs if uvm_fault() fails with KERN_RESOURCE_SHORTAGE, send a SIGKILL
and print a message about it. this will be used to recover from
out-of-swap conditions.
 1.42 13-Mar-1999  ragge 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.41 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.40 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.39 29-Nov-1998  ragge Fix (small) segv bug. Recognize in-kernel trace and breakpoint traps.
 1.38 04-Jul-1998  jonathan defopt DDB.
 1.37 25-Jun-1998  thorpej defopt KTRACE
 1.36 08-Jun-1998  ragge Wall fixes.
 1.35 03-May-1998  ragge Wall cleaning + a little better fault checking.
 1.34 02-Mar-1998  ragge Support for UVM on VAXen.
 1.33 03-Jan-1998  thorpej Adjust for the fact that the page {0,1} base and length registers are now
stored in the pmap structure.
 1.32 04-Nov-1997  ragge Optimized copy/fetch/store routines; rewritten in assembler.
 1.31 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.30 19-Oct-1997  ragge Only check for process switch if we are coming in from userspace.
Make ERESTART work for syscalls >63.
While we're here; clean up a little bit.
 1.29 11-Sep-1997  mycroft Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)
 1.28 28-Jul-1997  ragge branches: 1.28.2;
Handle XFC instruction faults.
 1.27 06-Jul-1997  ragge Remove __VM_PMAP_HACK.
 1.26 13-Jun-1997  ragge Bug fixes to page fault handling system. Many thanks to Johnny Billquist
for hunting down this bug(s).
 1.25 12-Jun-1997  ragge cpu_switch() should be mi_switch(). Pointed out by Johnny Billquist.
(bqt@update.uu.se)
 1.24 06-Nov-1996  cgd Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed. Rename remrq() to
remrunqueue().
 1.23 13-Oct-1996  christos backout previous kprintf change
 1.22 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.21 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.20 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.19 17-Mar-1996  ragge Do not have debugging enabled by default.
 1.18 09-Mar-1996  ragge Add support for ktracing syscalls.
 1.17 02-Feb-1996  mycroft #ifdef a call to kdb_trap() on DDB.
 1.16 02-Feb-1996  mycroft Fix #includes.
 1.15 28-Jan-1996  ragge Be able to handle debugger traps from kernel.
 1.14 12-Nov-1995  ragge struct ivec_dsp for interrupt vector allocation added.
 1.13 05-Jul-1995  ragge Null pointer were referenced if signal occurred before first
syscall. Didn't hurt on 4.3 Reno binaries.
 1.12 16-Jun-1995  ragge rudimentary DDB support.
 1.11 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.10 03-May-1995  ragge Changed conf.c to new style. Took away double saving of regs in traps.
Changed boot() to use vfs_shutdown(). Updated setregs.
 1.9 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.8 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.7 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.6 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.5 25-Nov-1994  ragge Lots of fixes and updates.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file trap.c was added on branch netbsd-1-0 on 1994-08-16 23:47:38 +0000
 1.28.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.44.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.44.4.2 02-Aug-1999  thorpej Update from trunk.
 1.44.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.44.2.1 12-Jul-1999  perry pullup 1.44->1.46 (ragge): fix critical paging/swapping problems
 1.47.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.47.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.47.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.47.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.52.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.60.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.60.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.66.8.14 07-Jan-2003  thorpej In the SA universe, the switch-to-this-LWP decision is made at a
different level than where preempt() calls are made, which renders
the "newlwp" argument useless. Replace it with a "more work to do"
boolean argument. Returning to userspace preempt() calls pass 0.
"Voluntary" preemptions in e.g. uiomove() pass 1. This will be used
to indicate to the SA subsystem that the LWP is not yet finished in
the kernel.

Collapse the SA vs. non-SA cases of preempt() together, making the
conditional code block much smaller, and don't call sa_preempt() if
more work is to come.

NOTE: THIS IS NOT A COMPLETE FIX TO THE preempt()-in-uiomove() PROBLEM
THAT CURRENTLY EXISTS FOR SA PROCESSES.
 1.66.8.13 29-Dec-2002  thorpej Sync with HEAD.
 1.66.8.12 11-Dec-2002  thorpej Sync with HEAD.
 1.66.8.11 18-Oct-2002  nathanw Catch up to -current.
 1.66.8.10 05-Oct-2002  gmcgarry LWPify
 1.66.8.9 26-Sep-2002  nathanw Change "if (l->l_flag & L_SA_UPCALL)" to "while (l->l_flag & L_SA_UPCALL)"
in userret() functions or equivalent, to permit delivery of multiple upcalls
in a single kernel entry.

XXX It's getting crowded in here. Collapsing posting signals, upcalls, and
XXX kernel-exit handling into one mechanism would be nice.
 1.66.8.8 01-Aug-2002  nathanw Catch up to -current.
 1.66.8.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.66.8.6 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.66.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.66.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.66.8.3 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.66.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.66.8.1 28-Jun-2001  nathanw file trap.c was added on branch nathanw_sa on 2002-02-28 04:12:32 +0000
 1.66.2.4 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.66.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.66.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.66.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.70.4.1 01-Dec-2002  he Pull up revision 1.73 (requested by thorpej in ticket #878):
Record stack growth, done inline to avoid another function
call on every user page fault.
 1.70.2.2 17-Jul-2002  gehenna catch up with -current.
 1.70.2.1 15-Jul-2002  gehenna catch up with -current.
 1.74.2.1 18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.80.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.80.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.80.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.80.2.3 03-Sep-2004  skrll Sync with HEAD
 1.80.2.2 03-Aug-2004  skrll Sync with HEAD
 1.80.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.96.2.6 17-Mar-2008  yamt sync with head.
 1.96.2.5 27-Feb-2008  yamt sync with head.
 1.96.2.4 03-Sep-2007  yamt sync with head.
 1.96.2.3 26-Feb-2007  yamt sync with head.
 1.96.2.2 30-Dec-2006  yamt sync with head.
 1.96.2.1 21-Jun-2006  yamt sync with head.
 1.98.8.4 11-Aug-2006  yamt sync with head
 1.98.8.3 24-May-2006  yamt sync with head.
 1.98.8.2 01-Apr-2006  yamt sync with head.
 1.98.8.1 13-Mar-2006  yamt sync with head.
 1.98.6.2 01-Jun-2006  kardel Sync with head.
 1.98.6.1 22-Apr-2006  simonb Sync with head.
 1.98.4.1 09-Sep-2006  rpaulo sync with head
 1.99.2.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.99.2.2 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.99.2.1 07-Mar-2006  elad file trap.c was added on branch elad-kernelauth on 2006-03-08 00:43:14 +0000
 1.101.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.105.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.107.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.108.18.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.108.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.108.10.1 03-Oct-2007  garbled Sync with HEAD
 1.108.2.1 20-Aug-2007  ad Sync with HEAD.
 1.109.2.2 23-Mar-2008  matt sync with HEAD
 1.109.2.1 06-Nov-2007  matt sync with HEAD
 1.111.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.111.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.111.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.111.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.111.2.1 24-Mar-2008  keiichi sync with head.
 1.113.6.5 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.113.6.4 24-Jun-2008  wrstuden Hand-merge files that didn't merge right in recent sync w/ current.
 1.113.6.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.113.6.2 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.113.6.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.113.4.3 11-Aug-2010  yamt sync with head.
 1.113.4.2 11-Mar-2010  yamt sync with head
 1.113.4.1 04-May-2009  yamt sync with head.
 1.113.2.1 04-Jun-2008  yamt sync with head
 1.114.4.1 19-Oct-2008  haad Sync with HEAD.
 1.116.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.116.4.3 02-Mar-2009  snj Pull up following revision(s) (requested by mhitch in ticket #527):
sys/arch/vax/vax/trap.c: revision 1.119
The ci_want_resched check and preempt() call had been removed from
userret() which resulted in no process preemption (and probably
contributed to the signal trap loop locking up the machine that was
recently fixed). Put the check and preempt() call in the AST trap
handler to restore process preemption.
 1.116.4.2 24-Feb-2009  snj Pull up following revision(s) (requested by mhitch in ticket #479):
sys/arch/vax/vax/trap.c: revision 1.118
On the vax, the trapsignal() call will change frame->sp to point to a
callg on the user's stack that calls the user's signal handler, so do
the skip_opcode() before calling trapsignal(). A floating point
overflow no longer causes a signal loop. This should stop the native
compile hangs trying to compile src/lib/libm/complex/catan.ln.
 1.116.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.116.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.122.4.2 05-Mar-2011  rmind sync with head
 1.122.4.1 30-May-2010  rmind sync with head
 1.122.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.126.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.126.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.128.6.2 24-Feb-2012  mrg sync to -current.
 1.128.6.1 18-Feb-2012  mrg merge to -current.
 1.128.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.128.2.2 30-Oct-2012  yamt sync with head
 1.128.2.1 17-Apr-2012  yamt sync with head
 1.131.4.1 18-May-2014  rmind sync with head
 1.131.2.2 03-Dec-2017  jdolecek update from HEAD
 1.131.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.132.6.3 28-Aug-2017  skrll Sync with HEAD
 1.132.6.2 09-Jul-2016  skrll Sync with HEAD
 1.132.6.1 06-Apr-2015  skrll Sync with HEAD
 1.135.10.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.137.2.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.138.6.1 02-Aug-2025  perseant Sync with HEAD
 1.8 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.7 24-Apr-2021  thorpej branches: 1.7.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.6 22-May-2017  ragge branches: 1.6.24;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.5 29-Oct-2012  chs branches: 1.5.14;
fix compile problems.
 1.4 05-Jun-2011  matt branches: 1.4.2; 1.4.12;
device_t, cfdata_t, etc.
CFATTACH_DECL -> CFATTACH_DECL_NEW for sizeof(struct device).
 1.3 14-Dec-2010  matt branches: 1.3.2; 1.3.6;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.2 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.1 22-Jan-2009  christos branches: 1.1.4; 1.1.6; 1.1.8; 1.1.10;
Patches from Brad Parker to support vax730.
 1.1.10.3 12-Jun-2011  rmind sync with head
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Jul-2010  rmind sync with head
 1.1.8.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.1.6.3 11-Aug-2010  yamt sync with head.
 1.1.6.2 04-May-2009  yamt sync with head.
 1.1.6.1 22-Jan-2009  yamt file ubi.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:05 +0000
 1.1.4.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.4.1 22-Jan-2009  skrll file ubi.c was added on branch nick-hppapmap on 2009-03-03 18:29:36 +0000
 1.3.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.3.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.12.2 03-Dec-2017  jdolecek update from HEAD
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.2.1 30-Oct-2012  yamt sync with head
 1.5.14.1 28-Aug-2017  skrll Sync with HEAD
 1.6.24.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.7.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 24-Feb-2002  matt Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.1 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.5 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.4 19-Jul-2000  matt branches: 1.4.4; 1.4.8;
More ELF changes (a.out still works).
 1.3 19-Jul-2000  matt ELFify (udiv -> __udiv, urem -> __rem)
 1.2 26-Oct-1994  cgd branches: 1.2.32;
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 udiv.s was added on branch netbsd-1-0 on 1994-08-02 20:22:20 +0000
 1.2.32.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 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.5 16-Apr-2024  kalvisd vax/unimpl_emul.S: Initialise locations storing floating-point values with
a constant of the appropriate format
 1.4 22-May-2017  ragge branches: 1.4.40;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.3 17-Apr-2007  mhitch branches: 1.3.80; 1.3.100;
Fix polyd trapping when running pic and grn during groff tool builds on
vax. From OpenBSD:

Addressing mode work by Jim Uhl:
- fix PC relative byte displacement in getaddr_byte
- add support for word displacement to getaddr_byte

This allows certain libm inverse trig functions to work on systems
that lack a native polyd instruction.
 1.2 24-Feb-2002  matt branches: 1.2.2; 1.2.8; 1.2.36; 1.2.72; 1.2.74; 1.2.78; 1.2.80;
Move .s files to .S files. (and .s.o rules in boot/Makefile.inc)
Put in register prefixes everywhere.
 1.1 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.2.80.1 11-Jul-2007  mjf Sync with head.
 1.2.78.1 27-May-2007  ad Sync with head.
 1.2.74.1 07-May-2007  yamt sync with head.
 1.2.72.1 07-May-2007  snj Pull up following revision(s) (requested by mhitch in ticket #612):
sys/arch/vax/vax/unimpl_emul.S: revision 1.3
Fix polyd trapping when running pic and grn during groff tool builds on
vax. From OpenBSD:
Addressing mode work by Jim Uhl:
- fix PC relative byte displacement in getaddr_byte
- add support for word displacement to getaddr_byte
This allows certain libm inverse trig functions to work on systems
that lack a native polyd instruction.
 1.2.36.1 03-Sep-2007  yamt sync with head.
 1.2.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.8.1 24-Feb-2002  jdolecek file unimpl_emul.S was added on branch kqueue on 2002-03-16 16:00:18 +0000
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 24-Feb-2002  nathanw file unimpl_emul.S was added on branch nathanw_sa on 2002-02-28 04:12:32 +0000
 1.3.100.1 28-Aug-2017  skrll Sync with HEAD
 1.3.80.1 03-Dec-2017  jdolecek update from HEAD
 1.4.40.1 19-Apr-2024  martin Pull up following revision(s) (requested by kalvisd in ticket #670):

sys/arch/vax/vax/unimpl_emul.S: revision 1.5

vax/unimpl_emul.S: Initialise locations storing floating-point values with
a constant of the appropriate format
 1.7 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.6 10-Jun-2001  ragge branches: 1.6.2; 1.6.8;
Revision line #1 broke, fixed.
 1.5 10-Jun-2001  ragge Check in work done by bjc@openbsd.org, OpenBSD revs 1.4 and 1.5 of the
same file. No other changes, OpenBSD log messages below.

> More EMODD work:
> - Using CVTDL and subtracting to seperate integer from fraction does
> not work if the integer is >32 bits long; instead, rearrange the bits
> into a quadword, use ASHQ to truncate, and then subtract.
>
> Also:
> - Set the condition codes properly; this fixes the other problem with
> >32-bit-integer parts in libm by letting modf subtract the fractional
> part (which *is* a double) to get the integral part in a double.

> - move the zero checks earlier in the routine
>
> - instead of 'ret' in zeroexit, use brw goback

> Switch a "BGTR foo" to a "BLSS bar; BRW foo; bar:". In this case, the
> difference between the BGTR and foo: is too large for a byte displacement.
> as should give an error or at least a warning here, but it doesn't;
> instead it merrily outputs a completely bogus displacement.
> This fixes problems with EMODD on numbers with negative exponents.
>
 1.4 08-Jan-2001  ragge branches: 1.4.2;
Fixes from OpenBSD by Brandon Creighton. (bjc@openbsd.org)
Log message from OpenBSD:

> - add EMODD emulation (EMODF) -- this fixes modf() and some libm code
> on systems which don't have native EMODD (i.e., most of them)
>
> - big cleanup of the getval_* stuff - have one routine doing most of the work
> instead of four doing the same thing
>
> - add some miscellaneous routines -- count sig. bits
>
> - add more operand addressing modes (still not all fully implemented)
> both the existing POLYD and EMODD can use them
>
> - add me to copyright
>
 1.3 26-Aug-2000  matt branches: 1.3.2;
Reverse polarity on INSN_EMULATION to NO_INSN_EMULATION. Thus by default
all kernels will have instruction emulation.
 1.2 14-Aug-2000  ragge branches: 1.2.2;
Clear result registers before using them.
Be more informative if unimplemented addressing modes.
 1.1 08-Aug-2000  ragge Write code to handle unimplemented instructions trapped via SCB vector 0x18.
This may happen on machines missing parts of the instruction set (like
some floating point formats).
Only one new instruction added; POLYD, so that the libm assembly files can
be used on architectures missing that instruction.
Also; include emulation code if compile-time option INSN_EMULATE is defined
instead of trying to match on which cputype it is.
N.B. POLYD isn't fully implemented, just enough to make libm happy.
 1.2.2.3 12-Jun-2001  he Pull up revisions 1.3-1.6 (requested by ragge):
Add EMODD emulation, as used in e.g. modf().
 1.2.2.2 14-Aug-2000  ragge Pull up (requested by ragge, approved by thorpej):

sys/arch/vax/conf/GENERIC 1.76-1.77
sys/arch/vax/conf/files.vax 1.74-1.75
sys/arch/vax/vax/intvec.s 1.54-1.55
sys/arch/vax/vax/unimpl_emul.s -1.2

This adds emulation code for the POLYD instruction that some VAX CPUs
are missing. POLYD is used for example in libm.
 1.2.2.1 14-Aug-2000  ragge file unimpl_emul.s was added on branch netbsd-1-5 on 2000-08-14 21:11:02 +0000
 1.3.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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 26-Aug-2000  bouyer file unimpl_emul.s was added on branch thorpej_scsipi on 2000-11-20 20:33:34 +0000
 1.4.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.1 10-Jun-2001  nathanw file unimpl_emul.s was added on branch nathanw_sa on 2002-02-28 04:12:33 +0000
 1.6.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2 24-Feb-2002  matt Upon further reflection, move udiv/urem to libkern and out of vax/vax.
 1.1 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.5 23-Feb-2002  matt Rename VAX kernel assembly source from .s to .S (the NetBSD standard)
 1.4 19-Jul-2000  matt branches: 1.4.4; 1.4.8;
More ELF changes (a.out still works).
 1.3 19-Jul-2000  matt ELFify (udiv -> __udiv, urem -> __rem)
 1.2 26-Oct-1994  cgd branches: 1.2.32;
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 urem.s was added on branch netbsd-1-0 on 1994-08-02 20:22:21 +0000
 1.2.32.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 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.6 21-May-1998  ragge Unused file for now - no more runtime decisions!
 1.5 13-Apr-1998  ragge Wall cleaning.
 1.4 19-Feb-1997  ragge Basic change to cpu-config code. This will make support of new
cpu types much easier.
 1.3 13-Oct-1996  christos branches: 1.3.6;
backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 20-Jul-1996  ragge VAXstation CPU and serial console support.
 1.3.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.11 16-Feb-1997  ragge This file has been obsoleted for ages.
 1.10 13-Oct-1996  christos branches: 1.10.6;
backout previous kprintf change
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.7 07-Mar-1996  ragge Fix of MicroVAX clock chip code, so that time sets right after reboot.
Fix done by Ken Wellsch.
 1.6 02-Feb-1996  mycroft Fix #includes.
 1.5 28-Jan-1996  ragge A 'printf' describing CPU type was forgotten.
 1.4 13-Dec-1995  ragge CPU dependent code moved out of cpu independent modules.
 1.3 10-Nov-1995  ragge Major rewriting of pmap_bootstrap; CPU dependent allocations moved
to related file.
 1.2 18-Apr-1995  ragge Typo.
 1.1 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.10.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.4 18-Apr-1997  ragge Change implementation of TOY clock addressing. Gives us only
one routine for three different HW implementations.
 1.3 13-Oct-1996  christos backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 20-Jul-1996  ragge VAXstation CPU and serial console support.
 1.119 28-Feb-2025  hans vax: explicitly zero AP and FP in the CALLS frame in cpu_lwp_fork()

This prevents a recursive panic when ddb(4) tries to trace the stack
back across cpu_lwp_bootstrap(). The CALLS frame in question is put
in place by cpu_lwp_fork() to make it look as if cpu_lwp_bootstrap()
was called from sret, which is detected by db_dump_stack() but only
if the FP of the frame is also 0.
 1.118 22-May-2017  ragge branches: 1.118.40; 1.118.46;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.117 19-Feb-2012  rmind branches: 1.117.2; 1.117.16;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.116 03-Jul-2011  matt branches: 1.116.2; 1.116.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.115 14-Apr-2011  matt Support LWP_PC
 1.114 10-Feb-2011  pooka Make vmapbuf() return success/error and make physio deal with a
failure.
 1.113 14-Dec-2010  matt branches: 1.113.2; 1.113.4;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.112 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.111 12-Dec-2009  martin branches: 1.111.2; 1.111.4;
Clear new pcb in cpu_lwp_fork, now that this seems to no longer be
guaranteed to be zeroed memory after the uarea swap changes.
XXX shouldn't we zero the new uarea upfront in MI code before calling
uvm_lwp_fork?
 1.110 29-Nov-2009  rmind Replace l_addr with uvm_lwp_getuarea() in various MD code, mostly cpu_lwp_fork().
 1.109 21-Nov-2009  rmind - Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.108 24-Oct-2009  rmind Provide cpu_lwp_free* stubs in vax and powerpc.
Reported by <he>.
 1.107 15-Aug-2009  matt Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for us.
 1.106 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.105 24-Nov-2008  cegger branches: 1.105.4;
build fix: include <sys/buf.h>
 1.104 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.103 22-Oct-2008  hans branches: 1.103.2;
fix userret() and resurrect cpu_setfunc() to make vax build again. ok by matt.
 1.102 11-Mar-2008  matt branches: 1.102.4; 1.102.6; 1.102.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.101 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.100 20-Feb-2008  matt branches: 1.100.2; 1.100.6;
Make NetBSD/vax work again. Add support for __HAVE_FAST_SOFTINTS.
Add a few small optimizations.
 1.99 22-Dec-2007  dsl Fix the remaining sys_sysarch() stub function.
 1.98 17-Oct-2007  garbled branches: 1.98.4; 1.98.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.97 20-May-2007  mhitch branches: 1.97.10;
Fix commant: proc_trampoline() -> cpu_lwp_bootstrap().
 1.96 17-May-2007  yamt 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.95 04-Mar-2007  christos branches: 1.95.2; 1.95.4; 1.95.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.94 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.93 09-Feb-2007  ad branches: 1.93.2;
Merge newlock2 to head.
 1.92 31-Aug-2006  matt branches: 1.92.2;
Make cpu_coredump dependent on COREDUMP
 1.91 30-Mar-2006  chs vmapbuf() does not tolerate failure to get virtual space, use UVM_KMF_WAITVA.
 1.90 24-Dec-2005  christos branches: 1.90.4; 1.90.6; 1.90.8; 1.90.10; 1.90.12;
Add a cast to l_addr to avoid wrapping. From Johnny Billquist.
 1.89 11-Dec-2005  christos merge ktrace-lwp.
 1.88 12-Jun-2005  matt branches: 1.88.2;
Have to cast framep as a trapframe. XXX frampe should not be void *
 1.87 10-Jun-2005  matt Rework the coredump code to have no explicit knownledge of how coredump
i/o is done. Instead, pass an opaque cookie which is then passed to a
new routine, coredump_write, which does the actual i/o. This allows the
method of doing i/o to change without affecting any future MD code.
Also, make netbsd32_core.c [re]use core_netbsd.c (in a similar manner that
core_elf64.c uses core_elf32.c) and eliminate that code duplication.
cpu_coredump{,32} is now called twice, first with a NULL iocookie to fill
the core structure and a second to actually write md parts of the coredump.
All i/o is nolonger random access and is suitable for shipping over a stream.
 1.86 01-Apr-2005  yamt merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.85 17-Sep-2004  skrll branches: 1.85.4; 1.85.6;
There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
 1.84 28-Aug-2004  thorpej Garbage-collect pagemove(); nothing use it anymore (YAY!!!)
 1.83 15-Jul-2003  lukem __KERNEL_RCSID()
 1.82 29-Jun-2003  fvdl branches: 1.82.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.81 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.80 23-Jun-2003  martin Make sure to include opt_foo.h if a defflag option FOO is used.
 1.79 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.78 06-Jan-2003  wiz writable, not writeable.
 1.77 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.76 04-Mar-2002  simonb Don't need to declare phys_map - it is declared in <uvm/uvm_extern.h>.
 1.75 10-Sep-2001  chris branches: 1.75.4;
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.74 19-Aug-2001  chs branches: 1.74.2;
in vunmapbuf(), call pmap_*remove() explicitly since uvm_km_free_wakeup()
will soon no longer do it for us.
 1.73 02-Jun-2001  chs branches: 1.73.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.72 29-May-2001  ragge Call proc_trampoline_mp() after fork in multiprocessor environment.
 1.71 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.70 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.69 01-Apr-2001  ragge Be sure that all kernel stack pages are valid after swapin. Fixes PR#12520.
 1.68 04-Feb-2001  ragge branches: 1.68.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.67 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.66 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.65 12-Jun-2000  ragge Put all cputype definitions in one file instead of separate files.
This was becoming unmaintainable.
 1.64 04-Jun-2000  matt Add a comment
 1.63 28-May-2000  matt fix it so it compiles.
 1.62 28-May-2000  thorpej Rather than starting init and creating kthreads by forking and then
doing a cpu_set_kpc(), just pass the entry point and argument all
the way down the fork path starting with fork1(). In order to
avoid special-casing the normal fork in every cpu_fork(), MI code
passes down child_return() and the child process pointer explicitly.

This fixes a race condition on multiprocessor systems; a CPU could
grab the newly created processes (which has been placed on a run queue)
before cpu_set_kpc() would be performed.
 1.61 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.60 26-May-2000  thorpej branches: 1.60.2;
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.59 26-Mar-2000  kleink Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
make them type-generic, which is necessary i.e. to operate on file offsets
without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
 1.58 08-Mar-2000  matt only have vmapbuf/vunmapbuf do anything on the ka46/48/49.
 1.57 07-Mar-2000  matt add real vmapbuf/vunmapbuf routines. needed for VS4000 SCSI support.
 1.56 20-Jan-2000  sommerfeld Fix PR9240: comment above cpu_fork() out of synch with reality on most ports.
(comment change only, but was wrong for more than just i386).
 1.55 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.54 01-Aug-1999  ragge branches: 1.54.2; 1.54.4; 1.54.6;
Cpu_swapin() only need to set red zone now.
 1.53 10-Jul-1999  ragge After swapin of a process, restore the red zone in kernel stack at the
correct place.
 1.52 08-Jul-1999  thorpej Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.51 26-May-1999  thorpej Generally update the comment above vunmapbuf().
 1.50 26-May-1999  thorpej Generally update the comment above the vmapbuf() implementations.
 1.49 13-May-1999  thorpej Allow the caller to specify a stack for the child process. If NULL,
the child inherits the stack pointer from the parent (traditional
behavior). Like the signal stack, the stack area is secified as
a low address and a size; machine-dependent code accounts for stack
direction.

This is required for clone(2).
 1.48 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.47 26-Mar-1999  mycroft branches: 1.47.2;
Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.46 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.45 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.44 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.43 29-Nov-1998  ragge Remove support to execute reno/ultrix binaries. It doesn't work, and
must be done in another way to work.
 1.42 11-Nov-1998  thorpej Changes to support fork_kthread():
- cpu_set_kpc() now takes void *arg third argument, passed to the
entry point.
- cpu_fork() allows parent to be non-curproc iff parent is proc0.
When forking non-curproc, assume its state has already been saved.
- Adjust various pieces of machine-dependent code to account of all of this.
 1.41 09-Sep-1998  thorpej In cpu_coredump(), use MID_MACHINE rather than MID_* (whatever it expands
to).
 1.40 28-Jul-1998  thorpej Don't cast the null residual pointer passed to vn_rdwr().
 1.39 25-Jun-1998  thorpej defopt COMPAT_ULTRIX
 1.38 02-Mar-1998  ragge Support for UVM on VAXen.
 1.37 03-Jan-1998  thorpej Don't allocate PTEs in cpu_fork(); they were allocated when the new
process's pmap was created. Instead, use pmap_activate() to load the
page {0,1} base and length registers into the PCB for the hardware's use.
 1.36 04-Nov-1997  ragge Optimized copy/fetch/store routines; rewritten in assembler.
 1.35 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.34 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.33 06-Jul-1997  ragge Remove __VM_PMAP_HACK.
 1.32 07-Jun-1997  ragge System statistics fixes. From Johnny Billquist (bqt@update.uu.se).
 1.31 09-Mar-1997  ragge Frob pages before trying to map them, to be sure they exist.
 1.30 11-Jan-1997  ragge branches: 1.30.6;
Update due to prototype changes.
 1.29 06-Nov-1996  cgd Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed. Rename remrq() to
remrunqueue().
 1.28 13-Oct-1996  christos backout previous kprintf change
 1.27 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.26 20-Jul-1996  ragge Add vmapbuf/vunmapbuf for VAXstations that need them.
 1.25 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.24 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.23 02-Mar-1996  ragge Support for VAX 11/780 - 11/785 system types added.
There are no support (yet) for the RX01 console floppy,
even if it is actually needed to create boot floppies.
(The arff utility is also missing, so...)
 1.22 24-Feb-1996  ragge Remove __FORK_BRAINDAMAGE, and the reason to why it was there.
 1.21 11-Feb-1996  ragge Cleanup & convert to KNF.
 1.20 02-Feb-1996  mycroft Fix #includes.
 1.19 28-Jan-1996  ragge Save USP when trapping from userspace.
Change register save structs according to this.
Be compatible with the way old init passes flags (in registers).
 1.18 13-Dec-1995  ragge u_int -> pt_entry_t.
 1.17 10-Nov-1995  ragge sysarch() -> sys_sysarch.
 1.16 02-Oct-1995  ragge branches: 1.16.2;
#include "sys/mount.h" added.
 1.15 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.14 05-Jun-1995  ragge Enabled auto reboot. Fixed bug in conf.c. Started use of rpb.
Detecting kernel stack overflow. Removed local mapping of
sigtramp code. Frob kernel stack pages in cpu_swapin().
Cleaned up some code and changed to KNF.
 1.13 07-May-1995  ragge Changed core dump style to generic netbsd format.
 1.12 05-May-1995  ragge Removed kernel stack relocation and double-mapping.
Speeded up fork() significantly.
 1.11 12-Apr-1995  ragge Fixes to conf.c
Cleaning of code.
 1.10 30-Mar-1995  ragge Speed-up of pmap and trap.
Fixes due to uVAX support.
 1.9 09-Mar-1995  mycroft copy*str() should use size_t.
 1.8 08-Mar-1995  cgd make sysarch() look more like it should
 1.7 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.6 13-Feb-1995  ragge Zillions of bugfixes. Obsolete files taken away. New style config
fixed. Inline assembler commonly used.
 1.5 25-Nov-1994  ragge Lots of fixes and updates.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Oct-1994  ragge Lots of bug fixes; clock and mem files new.
 1.2 16-Aug-1994  ragge branches: 1.2.2;
Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.2.2.2 16-Aug-1994  ragge Lots of bug fixes. Generic console support added. Major changes in machdep.c.
pmap.c now supports user process mapping. Page faults handles correctly.
 1.2.2.1 16-Aug-1994  ragge file vm_machdep.c was added on branch netbsd-1-0 on 1994-08-16 23:47:40 +0000
 1.16.2.1 15-Oct-1995  ragge sysarch() -> sys_sysarch()
 1.30.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.47.2.1 03-May-1999  perry branches: 1.47.2.1.2;
pullup 1.47->1.48 (ragge)
 1.47.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.47.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.54.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.54.4.1 15-Nov-1999  fvdl Sync with -current
 1.54.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.54.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.54.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.60.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.68.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.68.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.73.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.73.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.73.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.74.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.75.4.7 07-Jan-2003  thorpej Sync with HEAD.
 1.75.4.6 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.75.4.5 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.75.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.75.4.3 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.75.4.2 08-Dec-2001  thorpej cpu_fork() -> cpu_lwp_fork(). This logically forks an LWP, not a
complete process. As noted by Gregory McGarry on tech-kern.
 1.75.4.1 10-Sep-2001  thorpej file vm_machdep.c was added on branch nathanw_sa on 2001-12-08 04:22:24 +0000
 1.82.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.82.2.7 01-Apr-2005  skrll Sync with HEAD.
 1.82.2.6 21-Sep-2004  skrll Fix the sync with head I botched.
 1.82.2.5 18-Sep-2004  skrll Sync with HEAD.
 1.82.2.4 03-Sep-2004  skrll Sync with HEAD
 1.82.2.3 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.82.2.2 03-Aug-2004  skrll Sync with HEAD
 1.82.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.85.6.1 12-Feb-2005  yamt use new apis.
 1.85.4.1 29-Apr-2005  kent sync with -current
 1.88.2.7 17-Mar-2008  yamt sync with head.
 1.88.2.6 27-Feb-2008  yamt sync with head.
 1.88.2.5 21-Jan-2008  yamt sync with head
 1.88.2.4 03-Sep-2007  yamt sync with head.
 1.88.2.3 26-Feb-2007  yamt sync with head.
 1.88.2.2 30-Dec-2006  yamt sync with head.
 1.88.2.1 21-Jun-2006  yamt sync with head.
 1.90.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.90.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.90.8.2 03-Sep-2006  yamt sync with head.
 1.90.8.1 01-Apr-2006  yamt sync with head.
 1.90.6.1 22-Apr-2006  simonb Sync with head.
 1.90.4.1 09-Sep-2006  rpaulo sync with head
 1.92.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.93.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.93.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.93.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.95.10.1 22-May-2007  matt Update to HEAD.
 1.95.4.1 11-Jul-2007  mjf Sync with head.
 1.95.2.1 27-May-2007  ad Sync with head.
 1.97.10.3 23-Mar-2008  matt sync with HEAD
 1.97.10.2 09-Jan-2008  matt sync with HEAD
 1.97.10.1 06-Nov-2007  matt sync with HEAD
 1.98.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.98.4.1 26-Dec-2007  ad Sync with head.
 1.100.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.100.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.100.2.1 24-Mar-2008  keiichi sync with head.
 1.102.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.102.6.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.102.6.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.102.4.4 11-Aug-2010  yamt sync with head.
 1.102.4.3 11-Mar-2010  yamt sync with head
 1.102.4.2 19-Aug-2009  yamt sync with head.
 1.102.4.1 04-May-2009  yamt sync with head.
 1.103.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.103.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.105.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.111.4.3 21-Apr-2011  rmind sync with head
 1.111.4.2 05-Mar-2011  rmind sync with head
 1.111.4.1 30-May-2010  rmind sync with head
 1.111.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.113.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.113.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.116.6.1 24-Feb-2012  mrg sync to -current.
 1.116.2.1 17-Apr-2012  yamt sync with head
 1.117.16.1 28-Aug-2017  skrll Sync with HEAD
 1.117.2.1 03-Dec-2017  jdolecek update from HEAD
 1.118.46.1 02-Aug-2025  perseant Sync with HEAD
 1.118.40.1 04-Mar-2025  martin Pull up following revision(s) (requested by hans in ticket #1071):

sys/arch/vax/vax/vm_machdep.c: revision 1.119

vax: explicitly zero AP and FP in the CALLS frame in cpu_lwp_fork()

This prevents a recursive panic when ddb(4) tries to trace the stack
back across cpu_lwp_bootstrap(). The CALLS frame in question is put
in place by cpu_lwp_fork() to make it look as if cpu_lwp_bootstrap()
was called from sret, which is detected by db_dump_stack() but only
if the FP of the frame is also 0.
 1.9 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.8 14-Dec-2010  matt branches: 1.8.18; 1.8.36;
Cleanups includes. Change <machine/XXX.h> to <sys/XXX.h>
Remove unneeded includes.
 1.7 11-Mar-2008  matt branches: 1.7.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.6 11-Dec-2005  christos branches: 1.6.50; 1.6.70; 1.6.74;
merge ktrace-lwp.
 1.5 15-Jul-2003  lukem branches: 1.5.16;
__KERNEL_RCSID()
 1.4 02-Oct-2002  thorpej branches: 1.4.6;
Add trailing ; to CFATTACH_DECL.
 1.3 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.2 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.1 06-Jul-2000  ragge branches: 1.1.2; 1.1.6; 1.1.10;
Framework for the mainbus-XMI block. Not completely finished.
 1.1.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.1.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.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 xmi_mainbus.c was added on branch thorpej_scsipi on 2000-11-20 20:33:36 +0000
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 17-Mar-2008  yamt sync with head.
 1.6.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.70.1 24-Mar-2008  keiichi sync with head.
 1.6.50.1 23-Mar-2008  matt sync with HEAD
 1.7.26.1 05-Mar-2011  rmind sync with head
 1.8.36.1 28-Aug-2017  skrll Sync with HEAD
 1.8.18.1 03-Dec-2017  jdolecek update from HEAD
 1.10 27-Apr-2018  ragge Remove the old unneccessary cksum files.
 1.9 14-Mar-2009  dsl branches: 1.9.62;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.8 24-Dec-2005  perry branches: 1.8.78; 1.8.86; 1.8.92;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 28-Nov-2003  jhawk branches: 1.6.16;
Manually moved from Attic/ in the repository since cvs failed to do so.
 1.5 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 06-Jan-1996  ragge branches: 1.4.10; 1.4.12; 1.4.24; 1.4.30;
Much improved in_cksum, VAX dependency written by Bertram Barth.
 1.3 25-Nov-1994  ragge Lots of fixes and updates.
 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 yyyin_cksum.c was added on branch netbsd-1-0 on 1994-08-02 20:21:56 +0000
 1.4.30.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.30.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.30.1 03-Aug-2004  skrll Sync with HEAD
 1.4.24.1 13-Aug-2002  nathanw Catch up to -current.
 1.4.12.1 01-Oct-2001  fvdl Catch up with -current.
 1.4.10.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.9.62.1 02-May-2018  pgoyette Synch with HEAD
 1.45 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.44 07-Jul-2016  msaitoh branches: 1.44.16; 1.44.18;
KNF. Remove extra spaces. No functional change.
 1.43 27-Oct-2012  chs branches: 1.43.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.42 14-Dec-2010  matt branches: 1.42.8; 1.42.18;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.41 21-Nov-2009  rmind branches: 1.41.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.40 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.39 13-Apr-2008  tsutsui branches: 1.39.2; 1.39.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.38 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.37 07-Mar-2008  christos Allow KA53 to link, from Hans Rosenfeld. clk_page is used only if VAX46, VAX48
or VAX49 are defined.
 1.36 03-Feb-2008  matt branches: 1.36.2; 1.36.6;
Reorganize a bit to be able to support multiple sgmaps.
 1.35 04-Mar-2007  christos branches: 1.35.20; 1.35.26;
Fix caddr_t fallout.
 1.34 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.33 08-Mar-2006  lukem branches: 1.33.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.32 11-Dec-2005  christos branches: 1.32.4; 1.32.6; 1.32.8; 1.32.10;
merge ktrace-lwp.
 1.31 14-Dec-2004  chs branches: 1.31.10;
use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.30 19-Oct-2003  ragge Fetch SCSI controller ID from nvram for VS4k90 also.
 1.29 03-May-2003  wiz branches: 1.29.2;
DMA, not dma nor Dma.
 1.28 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.27 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.26 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.25 13-Sep-2002  chuck increase sc_maxxfer from 63K to 64K. otherwise fsck fails for
file systems with larger block sizes.
 1.24 16-May-2001  matt branches: 1.24.2; 1.24.8; 1.24.18;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.23 25-Apr-2001  bouyer Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.22 04-Feb-2001  ragge branches: 1.22.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.21 16-Nov-2000  matt branches: 1.21.2;
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.20 26-Jul-2000  matt Un __P.
 1.19 19-Jul-2000  matt More ELF changes (a.out still works).
 1.18 18-Jun-2000  matt branches: 1.18.2;
We use opt_cputype.h now.
 1.17 05-Jun-2000  nisimura Have MI ncr53c9x_attach() the 2nd and 3rd arguments for scsipi_adater
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
 1.16 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.15 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.14 23-May-2000  matt branches: 1.14.2;
Add some debug stuff. Disable SCSI on KA49 for now until I can figure out
why it doesn't work.
 1.13 17-May-2000  matt Preliminary support for the VS4000/90 SGMAP. Needed for SCSI. Does not
quite work right yet.
 1.12 24-Apr-2000  matt be a bit more defensive in the probe routines. only allow one attachment.
 1.11 23-Apr-2000  matt Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.10 18-Apr-2000  matt Remove autconf stuff. not needed and wrong.
 1.9 17-Apr-2000  ragge Fetch the SCSI ID out of NVRAM instead, if possible.
 1.8 17-Apr-2000  ragge DEC have the internal SCSI controller as ID6, and CDROM as ID7.
 1.7 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.6 09-Mar-2000  matt disable scsi for ka49 until sgmap is adapted to it.
 1.5 07-Mar-2000  matt Chnage chip freq to 25MHZ. panic if dmaaddr is not in the kernel's
address space. fix some printfs. (reads now work!)
 1.4 05-Mar-2000  matt it is pretty close to working. the scsibus probes now.
 1.3 04-Mar-2000  matt it's closer to working now.
 1.2 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.1 04-Mar-2000  matt First pass at NCR53c9x attachment for VS4000. It doesn't work yet.
But I want to save the work.
 1.14.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.18.2.1 16-Nov-2000  tv Pullup 1.21 [matt]:
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.21.2.5 29-Mar-2001  bouyer Make this compile.
 1.21.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.21.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.21.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.21.2.1 16-Nov-2000  bouyer file asc_vsbus.c was added on branch thorpej_scsipi on 2000-11-20 20:33:37 +0000
 1.22.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.24.18.1 18-Sep-2002  thorpej pullup-1-6 ticket #783, chuck@research.att.com.

1.24 -> 1.25 syssrc/sys/arch/vax/vsa/asc_vsbus.c

Original log message:
increase sc_maxxfer from 63K to 64K. otherwise fsck fails for
file systems with larger block sizes.
 1.24.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.24.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.24.8.1 16-May-2001  nathanw file asc_vsbus.c was added on branch nathanw_sa on 2002-09-17 21:18:37 +0000
 1.24.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.29.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.29.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.29.2.1 03-Aug-2004  skrll Sync with HEAD
 1.31.10.4 17-Mar-2008  yamt sync with head.
 1.31.10.3 04-Feb-2008  yamt sync with head.
 1.31.10.2 03-Sep-2007  yamt sync with head.
 1.31.10.1 21-Jun-2006  yamt sync with head.
 1.32.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.32.8.1 13-Mar-2006  yamt sync with head.
 1.32.6.1 22-Apr-2006  simonb Sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.33.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.35.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.35.20.1 23-Mar-2008  matt sync with HEAD
 1.36.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.36.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.36.2.1 24-Mar-2008  keiichi sync with head.
 1.39.4.2 11-Mar-2010  yamt sync with head
 1.39.4.1 16-May-2008  yamt sync with head.
 1.39.2.1 18-May-2008  yamt sync with head.
 1.41.4.1 05-Mar-2011  rmind sync with head
 1.42.18.2 03-Dec-2017  jdolecek update from HEAD
 1.42.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.42.8.1 30-Oct-2012  yamt sync with head
 1.43.14.1 09-Jul-2016  skrll Sync with HEAD
 1.44.18.1 10-Jun-2019  christos Sync with HEAD
 1.44.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.7 20-Jun-1998  ragge These files have never been used; remove them.
 1.6 22-Mar-1998  jonathan use dev/dec/lk201.h, fold back DELAY() changes from pmax lk201.c rev 1.7.
 1.5 12-Jan-1998  thorpej Update for changes to config.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.2 20-Jun-1998  ragge These files have never been used; remove them.
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.35 15-Mar-2008  matt This is not (has never?) being used.
 1.34 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.33 11-Dec-2005  christos branches: 1.33.50; 1.33.70; 1.33.74;
merge ktrace-lwp.
 1.32 13-Dec-2003  ad branches: 1.32.16;
Add write barriers (a no-op on vax).
 1.31 15-Jul-2003  lukem __KERNEL_RCSID()
 1.30 29-Dec-2002  ad branches: 1.30.2;
Block tty interrupts in getc()/putc().
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 24-Sep-2002  ad On pmax, drop into DDB on break.
 1.25 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.24 25-Feb-2002  ad branches: 1.24.8;
Move the dz driver to dev/dec, since it can be shared with pmax.
 1.23 28-Jan-2001  ragge branches: 1.23.4; 1.23.8;
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.22 30-Dec-2000  matt Make this compile again.
 1.21 02-Dec-2000  ragge Remove lkc, add lkkbd/lkms support.
 1.20 26-Jul-2000  matt Un __P.
 1.19 19-Jul-2000  matt More ELF changes (a.out still works).
 1.18 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.17 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.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 27-Aug-1999  ragge branches: 1.15.2;
Aupport these on 4000/90.
 1.14 06-Aug-1999  ragge Moved from dz_vsbus.c,v
 1.13 06-Jun-1999  ragge Qbus moved in hierarchy.
 1.12 20-May-1999  ragge Don't detect glass tty if the machine is a workstation.
Hint from Thomas Seidmann.
 1.11 27-Mar-1999  ragge branches: 1.11.4;
Change console detection a little bit.
 1.10 26-Mar-1999  ragge Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.9 13-Mar-1999  ragge 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.8 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.7 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.6 10-Aug-1998  ragge Support for VS4000/60.
 1.5 07-Jun-1998  ragge DDB support on glass tty. Also smarter keyboard decoding.
 1.4 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.3 23-May-1998  ragge Fixed bug with lost characters in DDB output.
 1.2 21-May-1998  ragge Support for DDB on DZ console.
 1.1 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.15.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.15.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.15.2.2 08-Dec-2000  bouyer Sync with HEAD.
 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.23.8.4 03-Jan-2003  thorpej Sync with HEAD.
 1.23.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.23.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.23.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.23.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.23.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.24.8.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.30.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.30.2.1 03-Aug-2004  skrll Sync with HEAD
 1.32.16.1 17-Mar-2008  yamt sync with head.
 1.33.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.33.70.1 24-Mar-2008  keiichi sync with head.
 1.33.50.1 23-Mar-2008  matt sync with HEAD
 1.51 04-Mar-2025  hans vax/dz(4): fix NULL pointer dereference in dzgetc()

This fixes an immediate reboot situation when booting with -d on a
framebuffer console that utilizes a dz(4)-attached keyboard.
 1.50 04-Mar-2025  hans vax/dz(4): defer configuring children lkkbd and lkms

At least lkkdb (dzkbd, really) wants to not only send data over dz(4),
it also depends on receiving them asynchronously for the keyboard type
detection to work. So defer configuring dz(4) children until all vsbus
children have attached and vsbus interrupts have been unmasked.

This fixes keyboard type detection when running with serial console,
which on most (all?) VAXstations is on dz(4), too.
 1.49 02-Mar-2025  hans vax/dz(4): restore dz_print() to print line number of children
 1.48 02-Mar-2025  hans vax/dz(4): fix console detection when it's not on line 0
 1.47 12-Dec-2022  jakllsch branches: 1.47.2; 1.47.8;
vsbus vax: sprinkle volatile for register accesses
 1.46 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.45 24-Apr-2021  thorpej branches: 1.45.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.44 22-May-2017  ragge branches: 1.44.24;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.43 28-Jun-2012  abs branches: 1.43.2; 1.43.16;
Define and use VS_REGS_KA49 rather than magic numbers. From OpenBSD.
 1.42 14-Dec-2010  matt branches: 1.42.8;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.41 09-May-2010  hans Make console keyboard work on VAXstation 4000/9x. Seems not to break
anything on other VAXstations (tested on 4000 VLC).
 1.40 15-Mar-2008  matt branches: 1.40.4; 1.40.14; 1.40.24; 1.40.26;
Switch dz driver to PRIVALLOC and device_* accessors.
 1.39 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.38 07-Mar-2008  christos Fix KA53 console. From Hans Rosenfeld.
 1.37 12-Mar-2006  matt branches: 1.37.40; 1.37.60; 1.37.64;
Fix various places where assignment happen to casted lvalues.
(t)v = foo; is not legal C.
 1.36 11-Dec-2005  christos branches: 1.36.4; 1.36.6; 1.36.8; 1.36.10;
merge ktrace-lwp.
 1.35 14-Dec-2004  chs branches: 1.35.10;
use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.34 13-Dec-2003  ad Add write barriers (a no-op on vax).
 1.33 18-Oct-2003  ragge Use the vax confdata to determine whether to use serial console.
Do cn_set_magic() for the VAX DDB escape sequence (ESC-D).
 1.32 15-Jul-2003  lukem __KERNEL_RCSID()
 1.31 01-Jan-2003  thorpej branches: 1.31.2;
Use aprint_normal() for cfprint routines.
 1.30 29-Dec-2002  ad Block tty interrupts in getc()/putc().
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 24-Sep-2002  ad On pmax, drop into DDB on break.
 1.25 18-Sep-2002  ad - The VSXXX is an 8-bit device, not 7.
- Obey ls->dz_line in dzputc(), since dzms uses it.
- Remove an odd "circular" reference that doesn't appear to be useful.
 1.24 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.23 10-Jun-2002  ragge Don't try to connect a keyboard to serial line 0 if the serial console
is on line 0; it may destroy line settings.
 1.22 30-Apr-2002  ragge branches: 1.22.2; 1.22.4;
Don't try to probe for dz11 on 4000/90, may corrupt the flash rom (?).
Suggested by Hugh Graham <hugh@openbsd.org>.
 1.21 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.20 16-May-2001  matt branches: 1.20.2; 1.20.8;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.19 25-Feb-2001  mrg branches: 1.19.2;
re-add.
 1.18 25-Feb-2001  mrg delete (again), then add (again) ?
 1.17 25-Feb-2001  mrg try a `cvs ci -f' to make this appear on the trunk again. no changes.
 1.16 04-Feb-2001  ragge 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 Rename dz_ibus to dz_vsbus.
 1.14 06-Aug-1999  ragge branches: 1.14.2;
Moved to dz_ibus.c,v
 1.13 06-Jun-1999  ragge Qbus moved in hierarchy.
 1.12 20-May-1999  ragge Don't detect glass tty if the machine is a workstation.
Hint from Thomas Seidmann.
 1.11 27-Mar-1999  ragge branches: 1.11.4;
Change console detection a little bit.
 1.10 26-Mar-1999  ragge Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.9 13-Mar-1999  ragge 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.8 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.7 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.6 10-Aug-1998  ragge Support for VS4000/60.
 1.5 07-Jun-1998  ragge DDB support on glass tty. Also smarter keyboard decoding.
 1.4 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.3 23-May-1998  ragge Fixed bug with lost characters in DDB output.
 1.2 21-May-1998  ragge Support for DDB on DZ console.
 1.1 17-May-1998  ragge branches: 1.1.1;
Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.1.1.1 25-Feb-2001  mrg cvs ci -f did not work, try an import.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.14.2.1 11-Feb-2001  bouyer Sync with HEAD.
 1.19.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.20.8.6 03-Jan-2003  thorpej Sync with HEAD.
 1.20.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.20.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.20.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.20.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.20.8.1 16-May-2001  nathanw file dz_vsbus.c was added on branch nathanw_sa on 2002-02-28 04:12:33 +0000
 1.20.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.20.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.22.4.1 11-Jun-2002  lukem Pull up revision 1.23 (requested by ragge in ticket #239):
Don't try to connect a keyboard to serial line 0 if the serial console
is on line 0; it may destroy line settings.
 1.22.2.3 03-Sep-2002  gehenna fix missing brace.
 1.22.2.2 15-Jul-2002  gehenna catch up with -current.
 1.22.2.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.31.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.31.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.31.2.1 03-Aug-2004  skrll Sync with HEAD
 1.35.10.2 17-Mar-2008  yamt sync with head.
 1.35.10.1 21-Jun-2006  yamt sync with head.
 1.36.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.36.8.1 13-Mar-2006  yamt sync with head.
 1.36.6.1 22-Apr-2006  simonb Sync with head.
 1.36.4.1 09-Sep-2006  rpaulo sync with head
 1.37.64.1 03-Apr-2008  mjf Sync with HEAD.
 1.37.60.1 24-Mar-2008  keiichi sync with head.
 1.37.40.1 23-Mar-2008  matt sync with HEAD
 1.40.26.2 05-Mar-2011  rmind sync with head
 1.40.26.1 30-May-2010  rmind sync with head
 1.40.24.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.40.14.1 21-Nov-2010  riz Pull up following revision(s) (requested by hans in ticket #1459):
sys/arch/vax/vsa/dz_vsbus.c: revision 1.41
sys/dev/dec/dz.c: revision 1.39
sys/arch/vax/vsa/spx.c: revision 1.3
Make SPX work as console device on VAXstation 4000/9x.
Make console keyboard work on VAXstation 4000/9x. Seems not to break
anything on other VAXstations (tested on 4000 VLC).
The interrupt handler uses the softc, so it's probably a good idea to
initialize it before causing interrupts. Prevents a panic on VAXstation
4000/9x with SPX console.
 1.40.4.1 11-Aug-2010  yamt sync with head.
 1.42.8.1 30-Oct-2012  yamt sync with head
 1.43.16.1 28-Aug-2017  skrll Sync with HEAD
 1.43.2.1 03-Dec-2017  jdolecek update from HEAD
 1.44.24.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.45.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.47.8.1 02-Aug-2025  perseant Sync with HEAD
 1.47.2.3 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1083):

sys/arch/vax/vsa/dz_vsbus.c: revision 1.51

vax/dz(4): fix NULL pointer dereference in dzgetc()

This fixes an immediate reboot situation when booting with -d on a
framebuffer console that utilizes a dz(4)-attached keyboard.
 1.47.2.2 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1082):

sys/arch/vax/vsa/dz_vsbus.c: revision 1.50

vax/dz(4): defer configuring children lkkbd and lkms

At least lkkdb (dzkbd, really) wants to not only send data over dz(4),
it also depends on receiving them asynchronously for the keyboard type
detection to work. So defer configuring dz(4) children until all vsbus
children have attached and vsbus interrupts have been unmasked.

This fixes keyboard type detection when running with serial console,
which on most (all?) VAXstations is on dz(4), too.
 1.47.2.1 04-Mar-2025  martin Pull up following revision(s) (requested by hans in ticket #1070):

sys/arch/vax/vsa/dz_vsbus.c: revision 1.48

vax/dz(4): fix console detection when it's not on line 0
 1.4 30-Sep-2024  rin vax/gpx: Stop copy{in,out}(9) from/to 0-length buffers

Found by GCC12 -Wmaybe-uninitialized.

Authored by kalvisd@.
 1.3 03-Feb-2024  tsutsui branches: 1.3.2;
Make local variables static.
 1.2 03-Feb-2024  tsutsui Misc cleanup.

- move function declarations after struct declarations and
before global variables
- sort function declarations per actual implementation
- explicitly denote 'static' for static functions
- some KNF

No functional change (though gcc generates different binary).
 1.1 06-Feb-2023  tsutsui branches: 1.1.2;
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.1.2.2 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.1.2.1 06-Feb-2023  martin file gpx.c was added on branch netbsd-10 on 2023-02-12 12:27:26 +0000
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.62 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.61 24-Apr-2021  thorpej branches: 1.61.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.60 03-Jun-2019  msaitoh branches: 1.60.12;
Fix typo in comment(s/similiar/similar/).
 1.59 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.58 22-May-2017  ragge branches: 1.58.8; 1.58.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.57 02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.56 31-Dec-2014  christos declare error
 1.55 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.54 25-Jul-2014  dholland branches: 1.54.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.53 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.52 25-Oct-2013  martin branches: 1.52.2;
Simplify (and remove now unused variable)
 1.51 14-Dec-2010  matt branches: 1.51.8; 1.51.18; 1.51.22;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.50 21-Nov-2009  rmind branches: 1.50.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.49 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.48 18-Mar-2009  cegger bcopy -> memcpy
 1.47 18-Mar-2009  cegger bzero -> memset
 1.46 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.45 13-Jan-2009  yamt branches: 1.45.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.44 15-Mar-2008  matt branches: 1.44.4; 1.44.12;
Switch to PRIVALLOC and device_* accessors
 1.43 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.42 17-Oct-2007  garbled branches: 1.42.12; 1.42.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.41 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.40 29-Jul-2007  ad branches: 1.40.4; 1.40.6; 1.40.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.39 04-Mar-2007  christos branches: 1.39.2; 1.39.10; 1.39.12; 1.39.14;
Fix caddr_t fallout.
 1.38 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 14-May-2006  elad branches: 1.37.14;
integrate kauth.
 1.36 28-Mar-2006  thorpej Use device_unit().
 1.35 23-Feb-2006  thorpej branches: 1.35.2; 1.35.4; 1.35.6;
Use device_parent().
 1.34 24-Dec-2005  perry branches: 1.34.2; 1.34.4; 1.34.6;
bare asm -> __asm
 1.33 11-Dec-2005  christos merge ktrace-lwp.
 1.32 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.31 28-Oct-2004  yamt branches: 1.31.12;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.30 15-Jul-2003  lukem __KERNEL_RCSID()
 1.29 18-Jun-2003  drochner branches: 1.29.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.28 10-May-2003  thorpej Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.27 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.26 02-Apr-2003  he Change SBSIZE -> SBLOCKSIZE, to track changes brought in with UFS2.
 1.25 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.24 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.22 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.21 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.19 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.18 22-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.17 09-Nov-2001  matt branches: 1.17.2; 1.17.10;
Make this compile under ELF.
 1.16 26-Jul-2001  wiz branches: 1.16.2; 1.16.4;
Various typos in comments (neccessary, sceme, choise, ...).
 1.15 12-Apr-2001  thorpej branches: 1.15.2;
splimp -> splbio.
 1.14 04-Feb-2001  ragge branches: 1.14.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.13 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.12 27-Jun-2000  ragge Do 3 retries on a failing sector before giving up.
Clear pending interrupts before starting a DMA transfer. If an interrupt
occurs while the HDC9224 is doing DMA, the transfered data will be
scrambled (without giving any errors, quite bad).
 1.11 27-Jun-2000  mrg remove redundant vm includes.
 1.10 25-Jun-2000  ragge 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.9 13-Apr-1998  ragge branches: 1.9.14; 1.9.24;
Wall cleaning.
 1.8 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.7 12-Jan-1998  thorpej Update for changes to config.
 1.6 15-Mar-1997  ragge Change the way boot device is figured out; now only using DEC numbers
and done when the device get attached.
 1.5 09-Mar-1997  ragge Fixed bug that caused d partition being treated as c.
RAW_PART is 2, not 3.
 1.4 13-Oct-1996  christos branches: 1.4.6;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.4.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.9.24.1 28-Jun-2000  ragge Pull up revision 1.10 + 1.12 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.9.14.3 21-Apr-2001  bouyer Sync with HEAD
 1.9.14.2 11-Feb-2001  bouyer Sync with HEAD.
 1.9.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.14.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.15.2.4 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.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.1 03-Aug-2001  lukem update to -current
 1.16.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.16.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.17.10.2 31-Aug-2002  gehenna catch up with -current.
 1.17.10.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.17.2.6 03-Jan-2003  thorpej Sync with HEAD.
 1.17.2.5 11-Nov-2002  nathanw Catch up to -current
 1.17.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.17.2.3 17-Sep-2002  nathanw Catch up to -current.
 1.17.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.17.2.1 09-Nov-2001  nathanw file hdc9224.c was added on branch nathanw_sa on 2002-08-01 02:44:02 +0000
 1.29.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.29.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.29.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.29.2.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.29.2.1 03-Aug-2004  skrll Sync with HEAD
 1.31.12.4 17-Mar-2008  yamt sync with head.
 1.31.12.3 27-Oct-2007  yamt sync with head.
 1.31.12.2 03-Sep-2007  yamt sync with head.
 1.31.12.1 21-Jun-2006  yamt sync with head.
 1.34.6.1 22-Apr-2006  simonb Sync with head.
 1.34.4.1 09-Sep-2006  rpaulo sync with head
 1.34.2.1 01-Mar-2006  yamt sync with head.
 1.35.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.35.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.35.2.1 01-Apr-2006  yamt sync with head.
 1.37.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.39.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.39.12.1 07-Aug-2007  matt Sync with HEAD.
 1.39.10.2 16-Oct-2007  garbled Sync with HEAD
 1.39.10.1 03-Oct-2007  garbled Sync with HEAD
 1.39.2.2 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.39.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.40.8.1 14-Oct-2007  yamt sync with head.
 1.40.6.2 23-Mar-2008  matt sync with HEAD
 1.40.6.1 06-Nov-2007  matt sync with HEAD
 1.40.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.42.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.42.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.42.12.1 24-Mar-2008  keiichi sync with head.
 1.44.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.44.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.44.4.2 11-Mar-2010  yamt sync with head
 1.44.4.1 04-May-2009  yamt sync with head.
 1.45.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.4.1 05-Mar-2011  rmind sync with head
 1.51.22.1 18-May-2014  rmind sync with head
 1.51.18.3 03-Dec-2017  jdolecek update from HEAD
 1.51.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.18.1 02-Dec-2012  tls Don't pass NULL struct dkdriver to disk_init. That's seriously bogus.
 1.51.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.52.2.1 10-Aug-2014  tls Rebase.
 1.54.4.2 28-Aug-2017  skrll Sync with HEAD
 1.54.4.1 06-Apr-2015  skrll Sync with HEAD
 1.58.10.1 10-Jun-2019  christos Sync with HEAD
 1.58.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.60.12.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.61.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 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 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.4 26-Jul-2001  wiz branches: 1.4.6; 1.4.22;
Various typos in comments (neccessary, sceme, choise, ...).
 1.3 17-Jul-2000  matt branches: 1.3.4;
Changes so that the kernel can be compiled under __ELF__.
 1.2 25-Jun-2000  ragge 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.1 20-Jul-1996  ragge branches: 1.1.28; 1.1.38;
SCSI and ST506 support for the VAXstation architecture.
 1.1.38.2 27-Jul-2000  matt Pullup revision 1.3
needed so 2nd stage bootstap will build
 1.1.38.1 28-Jun-2000  ragge Pull up revision 1.2 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.1.28.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.4.1 03-Aug-2001  lukem update to -current
 1.4.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.22.1 03-Aug-2004  skrll Sync with HEAD
 1.4.6.2 26-Jul-2001  wiz Various typos in comments (neccessary, sceme, choise, ...).
 1.4.6.1 26-Jul-2001  wiz file hdc9224.h was added on branch nathanw_sa on 2001-07-26 15:05:11 +0000
 1.6.142.1 28-Aug-2017  skrll Sync with HEAD
 1.6.122.1 03-Dec-2017  jdolecek update from HEAD
 1.17 05-Mar-2001  ragge This file hasn't been in use for a long time.
 1.16 15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.15 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.14 26-Jul-2000  matt Un __P.
 1.13 18-May-1999  thorpej branches: 1.13.2;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.12 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.11 13-Mar-1999  ragge branches: 1.11.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.10 28-Feb-1999  explorer Update to slightly altered rnd_attach_source() api
 1.9 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.8 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.7 10-Aug-1998  ragge Support for VS4000/60.
 1.6 21-Jul-1998  drochner adapt to LANCE driver split
 1.5 05-Jul-1998  jonathan defopt NS, NSIP.
 1.4 05-Jul-1998  jonathan defopt LLC
 1.3 05-Jul-1998  jonathan defopt CCITT.
 1.2 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.1 17-May-1998  ragge Add vax-hacked lance device driver for vaxstations.
XXX - This is temporary; will go away when the troubles with the
MI driver is fixed.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.13.2.3 12-Mar-2001  bouyer Sync with HEAD.
 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.13 11-Mar-2008  matt This file is no longer used.
 1.12 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.11 11-Dec-2005  christos branches: 1.11.50; 1.11.70; 1.11.74;
merge ktrace-lwp.
 1.10 10-Nov-2003  wiz branches: 1.10.16;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 02-Oct-2002  thorpej branches: 1.8.6;
Add trailing ; to CFATTACH_DECL.
 1.7 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 26-Jul-2000  matt branches: 1.5.4; 1.5.8;
Un __P.
 1.4 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.3 23-Apr-2000  matt branches: 1.3.2;
Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.2 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.1 27-Aug-1999  ragge branches: 1.1.2;
Aupport these on 4000/90.
 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.3.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.5.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.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.1 17-Mar-2008  yamt sync with head.
 1.11.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.70.1 24-Mar-2008  keiichi sync with head.
 1.11.50.1 23-Mar-2008  matt sync with HEAD
 1.13 28-Feb-2025  hans vax/lcg(4): Check vax_siedata in lcg_match() and lcgcnprobe() as well.

LCG only exists on two specific VAXstation models, but not the MicroVAXen
sharing the same board type.

PR port-vax/59109: Booting 10.1 fails on Microvax 3100 model 80
 1.12 27-Feb-2025  riastradh vax/lcg(4): Fix device_t/softc split straggler.

PR port-vax/59109: Booting 10.1 fails on Microvax 3100 model 80

(Probably won't fix the immediate problem but might fix some related
ones.)
 1.11 10-Dec-2022  jakllsch branches: 1.11.2; 1.11.8;
Don't let compiler optimize out the framebuffer probe in lcg_match() by
using keyword volatile.
 1.10 06-Jul-2022  andvar fix various typos in comments.
 1.9 12-Feb-2022  riastradh sys: Omit vestigial struct devices in softcs after device_t split.
 1.8 12-Feb-2022  riastradh sys: Fix various abuse of struct device internals.

Will help to make struct device opaque later.
 1.7 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.6 24-Apr-2021  thorpej branches: 1.6.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.5 21-Nov-2020  thorpej branches: 1.5.2;
malloc(9) -> kmem(9)
 1.4 06-Jun-2018  maya branches: 1.4.14;
Remove duplicate ;
 1.3 08-Feb-2018  dholland branches: 1.3.2;
Typos.
 1.2 18-Dec-2014  jklos branches: 1.2.2; 1.2.18;
Add small fix from Björn Johannessonwhich makes framebuffer woth with X11.
 1.1 16-Dec-2014  jklos Adds VAXstation VLC and 4000/60 framebuffer support. From Blaz Antonic
and updated by BjörnJohannesson.
 1.2.18.2 03-Dec-2017  jdolecek update from HEAD
 1.2.18.1 18-Dec-2014  jdolecek file lcg.c was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.2.2.2 06-Apr-2015  skrll Sync with HEAD
 1.2.2.1 18-Dec-2014  skrll file lcg.c was added on branch nick-nhusb on 2015-04-06 15:18:04 +0000
 1.3.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.14.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.5.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.6.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.11.8.1 02-Aug-2025  perseant Sync with HEAD
 1.11.2.2 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1081):

sys/arch/vax/vsa/lcg.c: revision 1.12

vax/lcg(4): Fix device_t/softc split straggler.

PR port-vax/59109: Booting 10.1 fails on Microvax 3100 model 80
(Probably won't fix the immediate problem but might fix some related
ones.)
 1.11.2.1 04-Mar-2025  martin Pull up following revision(s) (requested by hans in ticket #1069):

sys/arch/vax/vsa/lcg.c: revision 1.13

vax/lcg(4): Check vax_siedata in lcg_match() and lcgcnprobe() as well.

LCG only exists on two specific VAXstation models, but not the MicroVAXen
sharing the same board type.

PR port-vax/59109: Booting 10.1 fails on Microvax 3100 model 80
 1.11 12-Aug-2008  hans Add new accelerated driver for SPX graphics found in some VAXstations,
remove old broken lcspx driver. This is a bugfixed and refactored
version of the spx driver originally developed by Blaz Antonic in 2005.
OK'ed by mhitch.
 1.10 11-Mar-2008  matt branches: 1.10.4; 1.10.6; 1.10.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.9 17-Oct-2007  garbled branches: 1.9.12; 1.9.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.8 09-Jul-2007  ad branches: 1.8.10;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.7 31-Mar-2007  matt branches: 1.7.4;
Don't exceed array bounds (found by gcc 4.3).
XXX not sure if the fix is correct.
 1.6 04-Mar-2007  christos branches: 1.6.2; 1.6.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 12-Apr-2006  jmmv branches: 1.5.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8; 1.4.10; 1.4.12;
merge ktrace-lwp.
 1.3 20-Jul-2005  he Now that the wsfont fonts are made static, we can no longer
reference the fonts directly (which was actually a wrong thing
to try to do). Instead, convert to using the wsfont API to
look for a 8x15 font, and use it if found.

Suggested by thorpej
Reviewed by drochner
 1.2 19-Mar-2004  mhitch branches: 1.2.4; 1.2.18;
Don't map the framebuffer again when attaching the lcspx driver if it was
already mapped in the early console startup.

The software cursor isn't going to blink if we don't start it - set up the
callout when attaching.

Now that the cursor blink routine is actually called, blink the entire cursor
line rather than just the first pixel.

Don't try to clear the current cursor if the pointer to it hasn't been
initialized. This seems to happen when using the display as console, but
not when using a serial console.

On early console startup, use the framebuffer sizes, not the character cell
size to compute how much to clear.

The lcspx display will now initialize when booting with the display console,
but the dz device is not detected and the keyboard will not work yet. I
haven't tracked down why the dz device isn't found (it works fine when
using a serial console).
 1.1 19-Oct-2003  ragge Add console text device driver for the LCSPX framebuffer. Really dump,
cannot change colours, and is really slow; I haven't found how to buffer
writes to the console yet.
 1.2.18.3 17-Mar-2008  yamt sync with head.
 1.2.18.2 03-Sep-2007  yamt sync with head.
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.2.4.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.4.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.4 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.3 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 19-Mar-2004  skrll file lcspx.c was added on branch ktrace-lwp on 2004-08-03 10:42:45 +0000
 1.4.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.4.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.4.8.1 24-May-2006  yamt sync with head.
 1.4.6.1 22-Apr-2006  simonb Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.14.2 15-Apr-2007  yamt sync with head.
 1.5.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.4.1 11-Jul-2007  mjf Sync with head.
 1.6.2.2 15-Jul-2007  ad Sync with head.
 1.6.2.1 10-Apr-2007  ad Sync with head.
 1.7.4.1 03-Oct-2007  garbled Sync with HEAD
 1.8.10.2 23-Mar-2008  matt sync with HEAD
 1.8.10.1 06-Nov-2007  matt sync with HEAD
 1.9.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.9.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.9.12.1 24-Mar-2008  keiichi sync with head.
 1.10.10.1 19-Oct-2008  haad Sync with HEAD.
 1.10.6.1 07-Sep-2008  wrstuden Delete a bunch of things that are now gone in head.
 1.10.4.1 04-May-2009  yamt sync with head.
 1.11 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.10 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.9 14-Dec-2010  matt branches: 1.9.58; 1.9.60;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.8 04-May-2008  jklos branches: 1.8.22;
Fix leds.c to compile.
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 11-Mar-2008  matt branches: 1.6.2; 1.6.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.5 04-Mar-2007  christos branches: 1.5.20; 1.5.36; 1.5.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 11-Dec-2005  christos branches: 1.4.26;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem branches: 1.3.16;
__KERNEL_RCSID()
 1.2 16-May-2001  matt branches: 1.2.8; 1.2.24;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.1 18-Feb-2001  ragge branches: 1.1.2; 1.1.4;
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.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.1.4.1 18-Feb-2001  bouyer file leds.c was added on branch thorpej_scsipi on 2001-03-12 13:29:46 +0000
 1.1.2.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 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.2.8.1 16-May-2001  matt file leds.c was added on branch nathanw_sa on 2001-05-16 05:36:57 +0000
 1.3.16.2 17-Mar-2008  yamt sync with head.
 1.3.16.1 03-Sep-2007  yamt sync with head.
 1.4.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.5.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.5.36.1 24-Mar-2008  keiichi sync with head.
 1.5.20.1 23-Mar-2008  matt sync with HEAD
 1.6.4.1 16-May-2008  yamt sync with head.
 1.6.2.1 18-May-2008  yamt sync with head.
 1.8.22.1 05-Mar-2011  rmind sync with head
 1.9.60.1 10-Jun-2019  christos Sync with HEAD
 1.9.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.6 20-Jun-1998  ragge These files have never been used; remove them.
 1.5 22-Mar-1998  jonathan use dev/dec/lk201.h, fold back DELAY() changes from pmax lk201.c rev 1.7.
 1.4 05-Jan-1998  perry RCSID Police.
 1.3 13-Oct-1996  christos backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.19 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.18 11-Dec-2005  christos branches: 1.18.50; 1.18.70; 1.18.74;
merge ktrace-lwp.
 1.17 15-Jul-2003  lukem branches: 1.17.16;
__KERNEL_RCSID()
 1.16 02-Oct-2002  thorpej branches: 1.16.6;
Add trailing ; to CFATTACH_DECL.
 1.15 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.12 26-Jul-2000  matt branches: 1.12.4; 1.12.8;
Un __P.
 1.11 06-Jun-1999  ragge branches: 1.11.2;
Qbus moved in hierarchy.
 1.10 29-Apr-1999  ragge Make LK201 arrow keys work again.
 1.9 13-Mar-1999  ragge branches: 1.9.2;
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.8 10-Aug-1998  ragge Support for VS4000/60.
 1.7 05-Aug-1998  kleink KNF (only include one of <sys/{param,types}.h>).
 1.6 04-Jul-1998  jonathan defopt DDB.
 1.5 20-Jun-1998  ragge Fast fix to make VS keyboard work again after wscons changes.
XXX - This will be done in a better way in the future.
 1.4 08-Jun-1998  ragge Bugfix: use of uninitialised variable that gcc didn't notice.
 1.3 07-Jun-1998  ragge DDB support on glass tty. Also smarter keyboard decoding.
 1.2 05-Jun-1998  ragge Add virtual console support.
 1.1 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.9.2.1 29-Apr-1999  perry branches: 1.9.2.1.2;
pullup 1.9->1.10 (ragge)
 1.9.2.1.2.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.12.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.12.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.12.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.12.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.16.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.6.1 03-Aug-2004  skrll Sync with HEAD
 1.17.16.1 17-Mar-2008  yamt sync with head.
 1.18.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.18.70.1 24-Mar-2008  keiichi sync with head.
 1.18.50.1 23-Mar-2008  matt sync with HEAD
 1.1 11-Feb-2023  tsutsui branches: 1.1.2;
Port rasops'fied smg(4) framebuffer driver for VS3100 from OpenBSD/vax.

This allows using more fonts other than 8x15 pixels on smg(4).
Tested on my VAXstation 3100/m30.

Note the bitorder of smg(4) VRAM is LSB first (i.e. LSBit is the
most left side pixel) and this requires more complicated changes
to bitmask ops in MI rasops(9) because several LE machines have
VRAMs whose MSBit is connected to the most left side pixel,
but for now I prepared smg(4) specific putchar and cursor ops
based on old luna68k omrasops.
 1.1.2.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #86):

sys/arch/vax/vsa/smg.c: revision 1.64
sys/arch/vax/vsa/maskbits.h: revision 1.1
sys/dev/ic/dc503reg.h: revision 1.1

Port rasops'fied smg(4) framebuffer driver for VS3100 from OpenBSD/vax.

This allows using more fonts other than 8x15 pixels on smg(4).
Tested on my VAXstation 3100/m30.

Note the bitorder of smg(4) VRAM is LSB first (i.e. LSBit is the
most left side pixel) and this requires more complicated changes
to bitmask ops in MI rasops(9) because several LE machines have
VRAMs whose MSBit is connected to the most left side pixel,
but for now I prepared smg(4) specific putchar and cursor ops
based on old luna68k omrasops.
 1.1.2.1 11-Feb-2023  martin file maskbits.h was added on branch netbsd-10 on 2023-02-15 19:14:50 +0000
 1.52 17-Feb-2024  tsutsui Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@. Should be pulled up to netbsd-10 and -9.
 1.51 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.50 22-Mar-2020  ragge branches: 1.50.22;
Do not expect a struct buf to be present if doing DMA to kernel space.
Fixes bug reported by sadness on port-vax.
 1.49 03-Sep-2018  riastradh branches: 1.49.4;
Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.48 14-Dec-2010  matt branches: 1.48.58; 1.48.60;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.47 21-Nov-2009  rmind branches: 1.47.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.46 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.45 04-Apr-2008  tsutsui branches: 1.45.2; 1.45.4;
Split devict_t/softc for ncr5380sbc SCSI, and misc cosmetic changes.
 1.44 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.43 04-Mar-2007  christos branches: 1.43.20; 1.43.36; 1.43.40;
Fix caddr_t fallout.
 1.42 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.41 11-Dec-2005  christos branches: 1.41.26;
merge ktrace-lwp.
 1.40 15-Jul-2003  lukem branches: 1.40.16;
__KERNEL_RCSID()
 1.39 02-Oct-2002  thorpej branches: 1.39.6;
Add trailing ; to CFATTACH_DECL.
 1.38 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.35 25-Apr-2001  bouyer branches: 1.35.2; 1.35.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.34 04-Feb-2001  ragge branches: 1.34.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.33 05-Oct-2000  ragge Fix bug that prevented DMA to work on SCSI chain B. This fixes PR#11124
but in a different way than suggested by the submitter.
 1.32 25-Jun-2000  ragge 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.31 19-Jun-2000  matt branches: 1.31.2;
Rename ncr[5380] device to si to more consistent with other ports.
Add VAX660 to cputype.h. Remove needs-flag from si & asc entries.
 1.30 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.29 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.28 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.27 27-May-2000  ragge branches: 1.27.2;
Growel out the SCSI BUS ID from NVRAM instead of hard-code it.
 1.26 25-Mar-2000  tsutsui Add a "sc_rev" member to ncr5380_softc and handle CXD1180 quirk
in MI ncr5380sbc.
 1.25 18-Mar-2000  mycroft Add a ncr5380_attach() routine which does part of the initialization, attaches
the scsibus, and does the addref/delref dance.
 1.24 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.23 22-Oct-1999  ragge DMA support for the NCR 5380-equipped vs3100's.
 1.22 21-Sep-1999  ragge branches: 1.22.2; 1.22.4; 1.22.6;
Fix minphys() on vax. While here, convert to bus.h.
 1.21 27-Aug-1999  ragge Don't try to search for these devices on 4000/90. badaddr() should
be fixed for this arch also.
 1.20 19-Jun-1999  ragge Don't try to disconnect SCSI disks. From Michael Kukat.
Now DEC disks also works in VAXstations :-)
 1.19 26-Mar-1999  ragge branches: 1.19.2; 1.19.4;
Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.18 13-Mar-1999  ragge 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.17 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.16 06-Dec-1998  ragge Simple hack to get at least PIO functionality out of the VS2000/3100 ncr5380.
Fixed by Jens Arvid Nilsson.
 1.15 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.14 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.13 04-Jul-1998  jonathan defopt DDB.
 1.12 13-Apr-1998  ragge Wall cleaning.
 1.11 12-Jan-1998  thorpej Update for changes to config.
 1.10 19-Oct-1997  ragge Add match code to detect more than one SCSI adapter on 3100.
Provided by Bertram Barth.
 1.9 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.8 26-Feb-1997  gwr branches: 1.8.2; 1.8.4;
Minimal changes to adapt to removal of NCR5380_PERMIT_RESELECT.
This driver should be updated to allow per-target control over
disconnect/reselect, but I will leave that to the port masters.
 1.7 26-Feb-1997  ragge Patches to make VS2000 to work. From Ari Suutari.
 1.6 12-Feb-1997  ragge Add a forgotten #ifdef DDB
 1.5 13-Oct-1996  christos branches: 1.5.6;
backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.2 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.5.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.8.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.19.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.2.1 01-Mar-2000  he Apply patch (requested by toddpw):
Fix bugs in support for VaxStation 2000 and 3100, vax pmap, and
the NCR scsi driver.
 1.22.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.22.4.1 15-Nov-1999  fvdl Sync with -current
 1.22.2.3 29-Mar-2001  bouyer Make this compile.
 1.22.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.22.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.27.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.31.2.2 06-Oct-2000  ragge Pullup of rev. 1.33 (approved by thorpej):
Make SCSI chain B work and fixes PR#11124.
 1.31.2.1 28-Jun-2000  ragge Pull up revision 1.32 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.34.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.35.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.35.8.1 25-Apr-2001  nathanw file ncr.c was added on branch nathanw_sa on 2002-10-18 02:40:38 +0000
 1.35.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.39.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.39.6.1 03-Aug-2004  skrll Sync with HEAD
 1.40.16.2 17-Mar-2008  yamt sync with head.
 1.40.16.1 03-Sep-2007  yamt sync with head.
 1.41.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.43.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.43.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.43.36.1 24-Mar-2008  keiichi sync with head.
 1.43.20.1 23-Mar-2008  matt sync with HEAD
 1.45.4.2 11-Mar-2010  yamt sync with head
 1.45.4.1 16-May-2008  yamt sync with head.
 1.45.2.1 18-May-2008  yamt sync with head.
 1.47.4.1 05-Mar-2011  rmind sync with head
 1.48.60.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.48.60.1 10-Jun-2019  christos Sync with HEAD
 1.48.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.49.4.2 19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1800):

sys/arch/vax/vsa/vsbus.c: revision 1.69 (patch)
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.49.4.1 23-Mar-2020  martin Pull up following revision(s) (requested by ragge in ticket #802):

sys/arch/vax/vsa/ncr.c: revision 1.50

Do not expect a struct buf to be present if doing DMA to kernel space.
Fixes bug reported by sadness on port-vax.
 1.50.22.1 19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #601):

sys/arch/vax/vsa/vsbus.c: revision 1.69
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.2 21-Sep-1999  ragge Nuke unnused file.
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.67 03-Feb-2024  tsutsui Misc cleanup.

- move function declarations after struct declarations and
before global variables
- sort function declarations per actual implementation
- some KNF

No functional change.
 1.66 25-Jan-2024  tsutsui Fix mmap(2) address for smg(4) as other framebuffers.

Now X.org server can render onto framebuffer (but inverted bitorder).
Should be pulled up to netbsd-10 and netbsd-9.
 1.65 26-Mar-2023  andvar s/diplay/display/ and s/DIPPLAY/DISPLAY/ in comments.
 1.64 11-Feb-2023  tsutsui Port rasops'fied smg(4) framebuffer driver for VS3100 from OpenBSD/vax.

This allows using more fonts other than 8x15 pixels on smg(4).
Tested on my VAXstation 3100/m30.

Note the bitorder of smg(4) VRAM is LSB first (i.e. LSBit is the
most left side pixel) and this requires more complicated changes
to bitmask ops in MI rasops(9) because several LE machines have
VRAMs whose MSBit is connected to the most left side pixel,
but for now I prepared smg(4) specific putchar and cursor ops
based on old luna68k omrasops.
 1.63 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.62 13-Jan-2023  tsutsui Make sure to call wsfont_init(9) as other framebuffer drivers.

Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
XXX: still no output on the framebuffer console on my VAXstation 3100/m30
 1.61 07-Aug-2021  thorpej branches: 1.61.6;
Merge thorpej-cfargs2.
 1.60 24-Apr-2021  thorpej branches: 1.60.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.59 21-Nov-2020  thorpej branches: 1.59.2;
malloc(9) -> kmem(9)
 1.58 14-Mar-2019  thorpej branches: 1.58.4; 1.58.12;
Use copyin(), not fusword().
 1.57 22-May-2017  ragge branches: 1.57.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.56 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.55 11-Jan-2012  macallan branches: 1.55.6; 1.55.24;
adjust for wsfont_find() change
 1.54 14-Dec-2010  matt branches: 1.54.8; 1.54.12;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.53 26-Oct-2009  cegger branches: 1.53.4;
kill extra whitespaces
reviewed by tsutsui@
 1.52 19-Mar-2009  he Correct a few more bungled bcopy() -> memcpy() conversions.
 1.51 18-Mar-2009  cegger bcopy -> memcpy
 1.50 18-Mar-2009  cegger bzero -> memset
 1.49 19-Dec-2008  cegger branches: 1.49.2;
use M_ZERO on malloc() and remove subsequent bzero().
 1.48 15-Mar-2008  matt branches: 1.48.4; 1.48.12;
Use a 0 sized softc / switch to PRIVALLOC.
 1.47 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.46 17-Oct-2007  garbled branches: 1.46.12; 1.46.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.45 09-Jul-2007  ad branches: 1.45.10;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.44 31-Mar-2007  matt branches: 1.44.4;
Don't exceed array bounds (found by gcc 4.3).
XXX not sure if the fix is correct.
 1.43 04-Mar-2007  christos branches: 1.43.2; 1.43.4;
Fix caddr_t fallout.
 1.42 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.41 12-Apr-2006  jmmv branches: 1.41.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.40 11-Dec-2005  christos branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10; 1.40.12;
merge ktrace-lwp.
 1.39 20-Jul-2005  he Now that the wsfont fonts are made static, we can no longer
reference the fonts directly (which was actually a wrong thing
to try to do). Instead, convert to using the wsfont API to
look for a 8x15 font, and use it if found.

Suggested by thorpej
Reviewed by drochner
 1.38 27-Jun-2005  ragge branches: 1.38.2;
Shadowed variable fix.
 1.37 15-Jul-2003  lukem __KERNEL_RCSID()
 1.36 29-Dec-2002  ad branches: 1.36.2;
- X pads bitmap rows to a word boundary.
- Handle WSDISPLAYIO_GCURMAX.
 1.35 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.34 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.33 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.32 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.31 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.30 10-Jun-2002  ragge Missed to check all possible non-graphics bits on VS2k, causing the
machine to crash during boot. Reported and debugged with help of
Valeriy E. Ushakov.
 1.29 17-Mar-2002  atatat branches: 1.29.4; 1.29.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.28 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.27 04-Feb-2001  ragge branches: 1.27.4; 1.27.8;
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.26 02-Dec-2000  ragge Use lkkbd. Add hardware cursor support. Use wsfont fonts instead of the
old QDSS fonts (support not finished). KNF cleanup.
 1.25 08-Sep-2000  chs remove extra paren so this compiles again.
 1.24 26-Jul-2000  matt Un __P.
 1.23 26-Jun-2000  simonb 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.22 31-Mar-2000  ragge branches: 1.22.4;
Fix spelling error.
 1.21 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.20 12-Dec-1999  ragge CL* discarding.
 1.19 06-Dec-1999  drochner update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.18 27-Oct-1999  ragge Allocate memory for printouts directly instead of (trying to) use the
yes uninitialized VM system.
 1.17 27-Aug-1999  ragge branches: 1.17.2; 1.17.4; 1.17.6;
Don't try to search for these devices on 4000/90. badaddr() should
be fixed for this arch also.
 1.16 20-May-1999  ragge Don't detect glass tty if the machine is a workstation.
Hint from Thomas Seidmann.
 1.15 13-Mar-1999  ragge branches: 1.15.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.14 09-Mar-1999  ragge unsigned int -> int.
 1.13 12-Feb-1999  drochner change the "mapchar" interface to return a "quality" or "match level"
arguments which allows to find approximations for characters which are
not present in a font
 1.12 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.11 11-Jan-1999  drochner remove dummy "load_font" entries
 1.10 29-Nov-1998  ragge blkclr -> memset.
 1.9 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


XXX XXX XXX
the d_mmap cdev routine should be changed to have a prototype like:
paddr_t (*d_mmap) __P((dev_t, off_t, int));

by someone!
 1.8 10-Aug-1998  ragge Support for VS4000/60.
 1.7 05-Aug-1998  kleink KNF (only include one of <sys/{param,types}.h>).
 1.6 30-Jun-1998  ragge Enable use of reversed and underlined text. The DEC Isolatin character
set now also work correctly. Add blinking cursor.
 1.5 26-Jun-1998  drochner add a dummy "mapchar" function (1:1 mapping, hope the font is isolatin)
 1.4 20-Jun-1998  drochner adapt to wscons changes (character output call)
 1.3 07-Jun-1998  ragge Init some variables to not get trash on the screen.
 1.2 05-Jun-1998  ragge Add virtual console support.
 1.1 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.15.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.4.1 15-Nov-1999  fvdl Sync with -current
 1.17.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.17.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.17.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.22.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.27.8.7 03-Jan-2003  thorpej Sync with HEAD.
 1.27.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.27.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.27.8.4 01-Aug-2002  nathanw Catch up to -current.
 1.27.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.27.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.27.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.27.4.4 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.27.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.27.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.29.6.1 11-Jun-2002  lukem Pull up revision 1.30 (requested by ragge in ticket #237):
Missed to check all possible non-graphics bits on VS2k, causing the
machine to crash during boot. Reported and debugged with help of
Valeriy E. Ushakov.
 1.29.4.3 17-Jul-2002  gehenna catch up with -current.
 1.29.4.2 15-Jul-2002  gehenna catch up with -current.
 1.29.4.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.36.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.36.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.36.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.36.2.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.36.2.1 03-Aug-2004  skrll Sync with HEAD
 1.38.2.3 17-Mar-2008  yamt sync with head.
 1.38.2.2 03-Sep-2007  yamt sync with head.
 1.38.2.1 21-Jun-2006  yamt sync with head.
 1.40.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.40.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.40.8.1 24-May-2006  yamt sync with head.
 1.40.6.1 22-Apr-2006  simonb Sync with head.
 1.40.4.1 09-Sep-2006  rpaulo sync with head
 1.41.14.2 15-Apr-2007  yamt sync with head.
 1.41.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.43.4.1 11-Jul-2007  mjf Sync with head.
 1.43.2.2 15-Jul-2007  ad Sync with head.
 1.43.2.1 10-Apr-2007  ad Sync with head.
 1.44.4.1 03-Oct-2007  garbled Sync with HEAD
 1.45.10.2 23-Mar-2008  matt sync with HEAD
 1.45.10.1 06-Nov-2007  matt sync with HEAD
 1.46.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.46.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.46.12.1 24-Mar-2008  keiichi sync with head.
 1.48.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.48.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.48.4.2 11-Mar-2010  yamt sync with head
 1.48.4.1 04-May-2009  yamt sync with head.
 1.49.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.53.4.1 05-Mar-2011  rmind sync with head
 1.54.12.1 18-Feb-2012  mrg merge to -current.
 1.54.8.1 17-Apr-2012  yamt sync with head
 1.55.24.2 28-Aug-2017  skrll Sync with HEAD
 1.55.24.1 09-Jul-2016  skrll Sync with HEAD
 1.55.6.1 03-Dec-2017  jdolecek update from HEAD
 1.57.10.1 10-Jun-2019  christos Sync with HEAD
 1.58.12.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.58.4.1 06-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1585):

sys/arch/vax/vsa/smg.c: revision 1.62

Make sure to call wsfont_init(9) as other framebuffer drivers.

Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
 1.59.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.60.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.61.6.4 03-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #569):

sys/arch/vax/vsa/smg.c: revision 1.66

Fix mmap(2) address for smg(4) as other framebuffers.

Now X.org server can render onto framebuffer (but inverted bitorder).
 1.61.6.3 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #86):

sys/arch/vax/vsa/smg.c: revision 1.64
sys/arch/vax/vsa/maskbits.h: revision 1.1
sys/dev/ic/dc503reg.h: revision 1.1

Port rasops'fied smg(4) framebuffer driver for VS3100 from OpenBSD/vax.

This allows using more fonts other than 8x15 pixels on smg(4).
Tested on my VAXstation 3100/m30.

Note the bitorder of smg(4) VRAM is LSB first (i.e. LSBit is the
most left side pixel) and this requires more complicated changes
to bitmask ops in MI rasops(9) because several LE machines have
VRAMs whose MSBit is connected to the most left side pixel,
but for now I prepared smg(4) specific putchar and cursor ops
based on old luna68k omrasops.
 1.61.6.2 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.61.6.1 06-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #66):

sys/arch/vax/vsa/smg.c: revision 1.62

Make sure to call wsfont_init(9) as other framebuffer drivers.
Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
 1.13 09-Mar-2025  hans vax/spx(4): fix a few X11-related bugs

- overwriting of saved screen pointer of emulation mode when switching
the framebuffer mode from mapped to dumb or vice-versa
- leaving the cursor on when switching away from emulation mode
- failure to restore the screen when changing back to emulation mode
because the saved screen pointer has been set to NULL
- panic on next VT switch, because now also the current screen pointer
is NULL
 1.12 07-Aug-2021  thorpej branches: 1.12.6; 1.12.12;
Merge thorpej-cfargs2.
 1.11 24-Apr-2021  thorpej branches: 1.11.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.10 21-Nov-2020  thorpej branches: 1.10.2;
malloc(9) -> kmem(9)
 1.9 07-Jul-2016  msaitoh branches: 1.9.30;
KNF. Remove extra spaces. No functional change.
 1.8 28-Mar-2014  ozaki-r branches: 1.8.6;
Use snprintf instead of sprintf
 1.7 24-Oct-2013  martin Mark a potentially unused variable
 1.6 14-May-2012  abs branches: 1.6.2; 1.6.4;
From the "why was this not done before" box:
Implement WSDISPLAYIO_LINEBYTES so xwsfb works
 1.5 11-Jan-2012  macallan branches: 1.5.2;
adjust for wsfont_find() change
 1.4 14-Dec-2010  matt branches: 1.4.8; 1.4.12;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.3 09-May-2010  hans Make SPX work as console device on VAXstation 4000/9x.
 1.2 18-Mar-2009  cegger branches: 1.2.2; 1.2.4; 1.2.6;
bzero -> memset
 1.1 12-Aug-2008  hans branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.10; 1.1.14;
Add new accelerated driver for SPX graphics found in some VAXstations,
remove old broken lcspx driver. This is a bugfixed and refactored
version of the spx driver originally developed by Blaz Antonic in 2005.
OK'ed by mhitch.
 1.1.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.10.1 21-Nov-2010  riz Pull up following revision(s) (requested by hans in ticket #1459):
sys/arch/vax/vsa/dz_vsbus.c: revision 1.41
sys/dev/dec/dz.c: revision 1.39
sys/arch/vax/vsa/spx.c: revision 1.3
Make SPX work as console device on VAXstation 4000/9x.
Make console keyboard work on VAXstation 4000/9x. Seems not to break
anything on other VAXstations (tested on 4000 VLC).
The interrupt handler uses the softc, so it's probably a good idea to
initialize it before causing interrupts. Prevents a panic on VAXstation
4000/9x with SPX console.
 1.1.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.6.1 12-Aug-2008  haad file spx.c was added on branch haad-dm on 2008-10-19 22:16:07 +0000
 1.1.4.2 28-Sep-2008  mjf Sync with HEAD.
 1.1.4.1 12-Aug-2008  mjf file spx.c was added on branch mjf-devfs2 on 2008-09-28 10:40:11 +0000
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 12-Aug-2008  wrstuden file spx.c was added on branch wrstuden-revivesa on 2008-09-18 04:33:36 +0000
 1.2.6.2 05-Mar-2011  rmind sync with head
 1.2.6.1 30-May-2010  rmind sync with head
 1.2.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.2.2.3 11-Aug-2010  yamt sync with head.
 1.2.2.2 04-May-2009  yamt sync with head.
 1.2.2.1 18-Mar-2009  yamt file spx.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:05 +0000
 1.4.12.2 02-Jun-2012  mrg sync to latest -current.
 1.4.12.1 18-Feb-2012  mrg merge to -current.
 1.4.8.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.8.2 23-May-2012  yamt sync with head.
 1.4.8.1 17-Apr-2012  yamt sync with head
 1.5.2.1 11-Jun-2012  riz Pull up following revision(s) (requested by abs in ticket #299):
sys/arch/vax/vsa/spx.c: revision 1.6
From the "why was this not done before" box:
Implement WSDISPLAYIO_LINEBYTES so xwsfb works
 1.6.4.1 18-May-2014  rmind sync with head
 1.6.2.2 03-Dec-2017  jdolecek update from HEAD
 1.6.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.6.1 09-Jul-2016  skrll Sync with HEAD
 1.9.30.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.10.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.11.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.12.12.1 02-Aug-2025  perseant Sync with HEAD
 1.12.6.1 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1087):

sys/arch/vax/vsa/spx.c: revision 1.13

vax/spx(4): fix a few X11-related bugs
- overwriting of saved screen pointer of emulation mode when switching
the framebuffer mode from mapped to dumb or vice-versa
- leaving the cursor on when switching away from emulation mode
- failure to restore the screen when changing back to emulation mode
because the saved screen pointer has been set to NULL
- panic on next VT switch, because now also the current screen pointer
is NULL
 1.10 08-May-2021  rin Catch up with this commit:

http://www.nerv.org/netbsd/?q=id:20210507T165558Z.d4aba9e0e053181f2a98ee4ee43012b50949921b

by which per slot tcs_used flag was obsoleted.

No need to initialize __BIT(0) of sc_slots_used here; it is zero anyway
before calling tcattach().
 1.9 09-Jun-2017  flxd branches: 1.9.22;
whitespace
 1.8 09-Jun-2017  flxd Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
 1.7 05-Jun-2011  christos branches: 1.7.12; 1.7.30; 1.7.46;
assignment to sc_dev is in tcattach, we don't have sc_dev
 1.6 04-Jun-2011  tsutsui Split device_t/softc. pmax is tested on GXemul.
Compile test only for alpha and vax.

XXX: alpha/tc/tcasic.c calls tcattach() via config_found(9), but
XXX: pmax/tc/tcbus.c and vax/vsa/tc_vsbus.c calls tcattach() directly.
XXX: It looks horrible...
 1.5 14-Dec-2010  matt branches: 1.5.2; 1.5.6;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.4 28-Apr-2008  martin branches: 1.4.22;
Remove clause 3 and 4 from TNF licenses
 1.3 15-Mar-2008  matt branches: 1.3.2; 1.3.4; 1.3.6;
Use device_*
 1.2 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.1 03-Feb-2008  matt branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10;
Preliminatry TC support.
 1.1.10.2 02-Jun-2008  mjf Sync with HEAD.
 1.1.10.1 03-Apr-2008  mjf Sync with HEAD.
 1.1.6.1 24-Mar-2008  keiichi sync with head.
 1.1.4.2 18-Feb-2008  mjf Sync with HEAD.
 1.1.4.1 03-Feb-2008  mjf file tc_vsbus.c was added on branch mjf-devfs on 2008-02-18 21:05:16 +0000
 1.1.2.3 17-Mar-2008  yamt sync with head.
 1.1.2.2 04-Feb-2008  yamt sync with head.
 1.1.2.1 03-Feb-2008  yamt file tc_vsbus.c was added on branch yamt-lazymbuf on 2008-02-04 09:22:47 +0000
 1.3.6.1 16-May-2008  yamt sync with head.
 1.3.4.1 18-May-2008  yamt sync with head.
 1.3.2.2 23-Mar-2008  matt sync with HEAD
 1.3.2.1 15-Mar-2008  matt file tc_vsbus.c was added on branch matt-armv6 on 2008-03-23 02:04:27 +0000
 1.4.22.2 12-Jun-2011  rmind sync with head
 1.4.22.1 05-Mar-2011  rmind sync with head
 1.5.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.5.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.46.1 01-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #65):
share/man/man4/tc.4: revision 1.7
sys/arch/alpha/tc/tcasic.c: revision 1.46
sys/arch/pmax/tc/tcbus.c: revision 1.33
sys/arch/vax/conf/files.vax: revision 1.121
sys/arch/vax/vsa/tc_vsbus.c: revision 1.8, 1.9
sys/dev/tc/tc.c: revision 1.55
sys/dev/tc/tcvar.h: revision 1.27
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
--
whitespace
--
Add vax.
 1.7.30.1 28-Aug-2017  skrll Sync with HEAD
 1.7.12.1 03-Dec-2017  jdolecek update from HEAD
 1.9.22.1 13-May-2021  thorpej Sync with HEAD.
 1.7 12-Sep-2020  isaki Improve am7930 family drivers to share more code.
audioamd(4) on sparc, vsaudio(4) on vax, and bba(4) are.
- Remove complex and useless callbacks: onopen, onclose, and
indirect_{read,write}. This makes audioamd and vsaudio almost the same.
- Remove (already disabled) assembly fast interrupt path from audioamd(4).
cf. http://mail-index.netbsd.org/source-changes/2009/12/19/msg004585.html
- Use trigger_* method rather than start_* method. It's more suitable.
vsaudio(4) was tested by naru@, bba(4) was tested by tsutsui@.
 1.6 26-Aug-2020  isaki Fix misuse of device_private(). sc_dev is device_t.
 1.5 08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.4 08-Apr-2019  isaki branches: 1.4.2;
White space -> TAB, fix indent, and add RCS Id.
No functional changes intended.
 1.3 16-Mar-2019  isaki Use C99 style struct initializer to audio_hw_if.
 1.2 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.1 19-Dec-2014  jklos branches: 1.1.2; 1.1.18; 1.1.20; 1.1.22;
Add audio support for VAXstation VLC, 60 and 90 machines. Originally rom
Blaz Antonic and ported from OpenBSD by Björn Johannesso. Tested on VLC
and 4000/60.
 1.1.22.1 10-Jun-2019  christos Sync with HEAD
 1.1.20.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 19-Dec-2014  jdolecek file vsaudio.c was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.1.2.2 06-Apr-2015  skrll Sync with HEAD
 1.1.2.1 19-Dec-2014  skrll file vsaudio.c was added on branch nick-nhusb on 2015-04-06 15:18:04 +0000
 1.4.2.3 08-May-2019  isaki Remove commented out old filters.
 1.4.2.2 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.4.2.1 22-Apr-2019  isaki Adapt am7930 families to audio2.
- Remove {input/output}_conv stuff from am7930_glue.
Filter pipelines for user encoding are not necessary in audio2
so the driver only needs to handle its hardware encoding.
- audioamd/vsaudio use an ordinal linear-mulaw conversion filter
and bba requires special one. dev/audio/mulaw.c supports this
variant just for bba. It might not a good way for bba but it
keeps all other drivers simple.
- Tested on vsaudio(4) by naru@, bba(4) by tsutsui@ (a few months ago).
Thanks!
 1.69 17-Feb-2024  tsutsui Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@. Should be pulled up to netbsd-10 and -9.
 1.68 12-Dec-2022  jakllsch branches: 1.68.2;
vsbus vax: sprinkle volatile for register accesses
 1.67 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.66 24-Apr-2021  thorpej branches: 1.66.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.65 03-Sep-2018  riastradh branches: 1.65.4; 1.65.14;
Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.64 12-Apr-2018  ragge branches: 1.64.2;
Fix bug causing DMA to/from user space fail. Fixes PR#49517.
This bug has been around since 2003.
Thanks to Martin Husemann for providing hardware to debug on!
 1.63 22-May-2017  ragge branches: 1.63.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.62 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.61 31-May-2015  abs Add missing break - from Felix Deichmann in PR port-vax/49935
 1.60 28-Jun-2012  abs branches: 1.60.2; 1.60.14; 1.60.16;
Define and use VS_REGS_KA49 rather than magic numbers. From OpenBSD.
 1.59 14-Dec-2010  matt branches: 1.59.8; 1.59.14;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.58 21-Nov-2009  rmind branches: 1.58.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.57 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.56 19-Mar-2009  he Correct a few more bungled bcopy() -> memcpy() conversions.
 1.55 18-Mar-2009  cegger bcopy -> memcpy
 1.54 11-Mar-2008  matt branches: 1.54.4; 1.54.12; 1.54.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.53 03-Feb-2008  matt branches: 1.53.2; 1.53.6;
Reorganize a bit to be able to support multiple sgmaps.
 1.52 04-Mar-2007  christos branches: 1.52.20; 1.52.26;
Fix caddr_t fallout.
 1.51 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.50 11-Dec-2005  christos branches: 1.50.26;
merge ktrace-lwp.
 1.49 26-Aug-2005  drochner s/locdesc_t/int/g
 1.48 30-Jun-2005  drochner branches: 1.48.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.47 01-Apr-2005  yamt merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.46 14-Dec-2004  chs branches: 1.46.2; 1.46.4;
use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.45 02-May-2004  ragge Fix bug that were introduced together with the merge of nathanw_sa:
SCSI on VS2k/VS3100 stopped working. Spotted and fixed by Anders Hjalmarsson.
This fixes PR#25307.
 1.44 15-Jul-2003  lukem branches: 1.44.2;
__KERNEL_RCSID()
 1.43 18-Jun-2003  drochner branches: 1.43.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.42 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.41 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.40 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.39 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.38 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.35 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.34 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.33 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.32 16-May-2001  matt branches: 1.32.2; 1.32.8; 1.32.16;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.31 04-Feb-2001  ragge branches: 1.31.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.30 21-Nov-2000  chs eliminate TRUNC_PAGE() and ROUND_PAGE() in favor of their
lowercase counterparts. also, a little misc cleanup.
 1.29 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.28 27-Jun-2000  mrg remove redundant vm includes.
 1.27 25-Jun-2000  ragge 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.26 18-Jun-2000  matt branches: 1.26.2;
We use opt_cputype.h now.
 1.25 26-May-2000  ragge branches: 1.25.2;
If we panic before the vsbus is found, don't panic again.
 1.24 23-Apr-2000  matt Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.23 08-Mar-2000  matt don't enable sgmap on ka49 yet.
 1.22 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.21 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.20 22-Oct-1999  ragge Add routines to copy to/from a user process from/to the vsbus DMA area.
 1.19 27-Aug-1999  ragge branches: 1.19.2; 1.19.4; 1.19.6;
Rearrange the interrupt detection code to work on the (slightly
different) VAXstation 4000/90.
 1.18 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.17 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.16 13-Mar-1999  ragge branches: 1.16.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.15 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.14 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.13 06-Dec-1998  ragge Search for NCR controllers, but not on VS4000/60.
 1.12 10-Aug-1998  ragge Support for VS4000/60.
 1.11 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.10 21-May-1998  ragge Rewrite the autoconf code for VS3000's.
XXX - no support for any disks at all yet.
 1.9 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.8 12-Jan-1998  thorpej Update for changes to config.
 1.7 03-Jan-1998  thorpej Grab the PCB directly from the u-area, not by indirecting through VM
structures.
 1.6 22-Mar-1997  ragge Update address struct to recognize KA420 motherboard.
 1.5 15-Mar-1997  ragge Add a forgotten #ifdef. Remove debug printout.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.16.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.4.1 15-Nov-1999  fvdl Sync with -current
 1.19.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.19.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.19.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.25.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.26.2.1 31-Jul-2000  ragge Pull up revision 1.26-1.27 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
(Approved a long time ago, but forgot to check it in :-)
 1.31.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.32.16.1 15-Jul-2002  gehenna catch up with -current.
 1.32.8.5 03-Jan-2003  thorpej Sync with HEAD.
 1.32.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.32.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.32.8.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.32.8.1 16-May-2001  ragge file vsbus.c was added on branch nathanw_sa on 2002-03-29 23:32:16 +0000
 1.32.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.32.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.43.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.43.2.5 01-Apr-2005  skrll Sync with HEAD.
 1.43.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.43.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.43.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.43.2.1 03-Aug-2004  skrll Sync with HEAD
 1.44.2.1 05-May-2004  tron Pull up revision 1.45 (requested by ragge in ticket #245):
Fix bug that were introduced together with the merge of nathanw_sa:
SCSI on VS2k/VS3100 stopped working. Spotted and fixed by Anders Hjalmarsson.
This fixes PR#25307.
 1.46.4.1 12-Feb-2005  yamt use new apis.
 1.46.2.1 29-Apr-2005  kent sync with -current
 1.48.2.4 17-Mar-2008  yamt sync with head.
 1.48.2.3 04-Feb-2008  yamt sync with head.
 1.48.2.2 03-Sep-2007  yamt sync with head.
 1.48.2.1 21-Jun-2006  yamt sync with head.
 1.50.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.52.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.52.20.1 23-Mar-2008  matt sync with HEAD
 1.53.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.53.2.1 24-Mar-2008  keiichi sync with head.
 1.54.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.54.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.54.4.2 11-Mar-2010  yamt sync with head
 1.54.4.1 04-May-2009  yamt sync with head.
 1.58.4.1 05-Mar-2011  rmind sync with head
 1.59.14.1 19-Jun-2015  snj Pull up following revision(s) (requested by abs in ticket #1303):
sys/arch/vax/vsa/vsbus.c: revision 1.61
Add missing break - from Felix Deichmann in PR port-vax/49935
 1.59.8.1 30-Oct-2012  yamt sync with head
 1.60.16.3 28-Aug-2017  skrll Sync with HEAD
 1.60.16.2 09-Jul-2016  skrll Sync with HEAD
 1.60.16.1 06-Jun-2015  skrll Sync with HEAD
 1.60.14.1 02-Jun-2015  sborrill Pull up the following revisions(s) (requested by abs in ticket #817):
sys/arch/vax/vsa/vsbus.c: revision 1.61

Fix VAX46 and VAX48 vsbus attach config. Addresses PR port-vax/49935.
 1.60.2.1 03-Dec-2017  jdolecek update from HEAD
 1.63.8.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.63.8.1 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.64.2.1 10-Jun-2019  christos Sync with HEAD
 1.65.14.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.65.14.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.65.14.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.65.14.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.65.14.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.65.4.1 19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1800):

sys/arch/vax/vsa/vsbus.c: revision 1.69 (patch)
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.66.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.68.2.1 19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #601):

sys/arch/vax/vsa/vsbus.c: revision 1.69
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.18 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.17 12-Dec-2022  jakllsch vsbus vax: sprinkle volatile for register accesses
 1.16 14-Dec-2010  matt Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.15 28-Apr-2008  martin branches: 1.15.22;
Remove clause 3 and 4 from TNF licenses
 1.14 11-Mar-2008  matt branches: 1.14.2; 1.14.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.13 03-Feb-2008  matt branches: 1.13.2; 1.13.6;
Reorganize a bit to be able to support multiple sgmaps.
 1.12 04-Mar-2007  christos branches: 1.12.20; 1.12.26;
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 29-Sep-2003  matt branches: 1.10.16;
Fix GCC3'ism's
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 16-Nov-2000  matt branches: 1.8.2; 1.8.26;
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.7 26-Jul-2000  matt Un __P.
 1.6 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.5 17-May-2000  matt branches: 1.5.4;
Preliminary support for the VS4000/90 SGMAP. Needed for SCSI. Does not
quite work right yet.
 1.4 23-Apr-2000  matt Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.3 07-Mar-2000  matt clear the sgmap that was allocated
 1.2 04-Mar-2000  matt it's a bit cleaner now. it also gets rid of the iomap init in
ka4[689].c
 1.1 03-Mar-2000  matt First pass. need to add hw sgmap allocation via bus_dmamem
 1.5.4.1 16-Nov-2000  tv Pullup 1.8 [matt]:
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.8.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.26.1 03-Aug-2004  skrll Sync with HEAD
 1.8.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.8.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.8.2.1 16-Nov-2000  bouyer file vsbus_dma.c was added on branch thorpej_scsipi on 2000-11-20 20:33:40 +0000
 1.10.16.3 17-Mar-2008  yamt sync with head.
 1.10.16.2 04-Feb-2008  yamt 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.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.12.20.1 23-Mar-2008  matt sync with HEAD
 1.13.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.13.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.13.2.1 24-Mar-2008  keiichi sync with head.
 1.14.4.1 16-May-2008  yamt sync with head.
 1.14.2.1 18-May-2008  yamt sync with head.
 1.15.22.1 05-Mar-2011  rmind sync with head

RSS XML Feed