Home | History | Annotate | only in /src/sys/arch/sgimips
History log of /src/sys/arch/sgimips
RevisionDateAuthorComments
 1.7 25-Nov-2008  he Don't be lazy and let one directory's Makefile install an include
file from another directory, as that only causes problems with
mtree later on when encountering the /.. path component. Instead,
descend into dev/ and use the Makefile there to install dev/crmfbreg.h
in the appropriate directory.
 1.6 25-Oct-2008  apb branches: 1.6.2; 1.6.4;
Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.5 17-Oct-2007  garbled branches: 1.5.16; 1.5.20; 1.5.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.4 04-Aug-2007  dyoung branches: 1.4.2;
Reduce differences between sgimips/Makefile and evbmips/Makefile,
making the sgimips/Makefile 'tags' target work.
 1.3 06-Jan-2003  lukem branches: 1.3.18; 1.3.60; 1.3.68; 1.3.72; 1.3.74; 1.3.78;
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.2 20-Nov-2001  soren Add stand to SUBDIR.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
Initial commit.
 1.1.14.2 07-Jan-2003  thorpej Sync with HEAD.
 1.1.14.1 08-Jan-2002  nathanw Catch up to -current.
 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 14-Jun-2000  bouyer file Makefile was added on branch thorpej_scsipi on 2000-11-20 20:23:40 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file Makefile was added on branch minoura-xpg4dl on 2000-06-22 17:02:54 +0000
 1.3.78.1 04-Aug-2007  jmcneill Sync with HEAD.
 1.3.74.1 15-Aug-2007  skrll Sync with HEAD.
 1.3.72.1 07-Aug-2007  matt Sync with HEAD.
 1.3.68.1 03-Oct-2007  garbled Sync with HEAD
 1.3.60.1 20-Aug-2007  ad Sync with HEAD.
 1.3.18.1 03-Sep-2007  yamt sync with head.
 1.4.2.1 06-Nov-2007  matt sync with HEAD
 1.5.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.5.20.1 04-May-2009  yamt sync with head.
 1.5.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.6.4.1 26-Feb-2009  snj Pull up following revision(s) (requested by macallan in ticket #523):
sys/arch/sgimips/Makefile: revision 1.7
sys/arch/sgimips/dev/Makefile: revision 1.1
sys/arch/sgimips/include/Makefile: revision 1.19
Don't be lazy and let one directory's Makefile install an include
file from another directory, as that only causes problems with
mtree later on when encountering the /.. path component. Instead,
descend into dev/ and use the Makefile there to install dev/crmfbreg.h
in the appropriate directory.
 1.6.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.11 12-Jan-2019  tsutsui Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.10 10-Feb-2009  rumble branches: 1.10.62; 1.10.64;
IP6/IP10 known as 'Eclipse'.
 1.9 22-Dec-2006  rumble branches: 1.9.48; 1.9.56; 1.9.62;
Guiness -> Guinness.
 1.8 22-Dec-2006  rumble Codenames for IP12 and IP20.
 1.7 11-Dec-2005  christos branches: 1.7.20;
merge ktrace-lwp.
 1.6 29-Sep-2004  soren branches: 1.6.12;
Correct the names of a few system types.
 1.5 29-Sep-2004  sekiya Add a table mapping IPxy to ABI and load address.
 1.4 14-May-2002  soren branches: 1.4.10;
Add some codenames.
 1.3 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 16-Jun-2000  soren branches: 1.2.4; 1.2.6; 1.2.10; 1.2.14;
Correct.
 1.1 16-Jun-2000  soren Add table of IP number / model name.
 1.2.14.2 20-Jun-2002  nathanw Catch up to -current.
 1.2.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.10.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.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.2.6.1 16-Jun-2000  bouyer file README.IPn was added on branch thorpej_scsipi on 2000-11-20 20:23:40 +0000
 1.2.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 16-Jun-2000  minoura file README.IPn was added on branch minoura-xpg4dl on 2000-06-22 17:02:54 +0000
 1.4.10.1 19-Oct-2004  skrll Sync with HEAD
 1.6.12.1 30-Dec-2006  yamt sync with head.
 1.7.20.1 12-Jan-2007  ad Sync with head.
 1.9.62.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.56.1 03-Mar-2009  skrll Sync with HEAD.
 1.9.48.1 04-May-2009  yamt sync with head.
 1.10.64.1 10-Jun-2019  christos Sync with HEAD
 1.10.62.1 18-Jan-2019  pgoyette Synch with HEAD
 1.7 12-Jan-2019  tsutsui Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.6 25-Mar-2007  sekiya branches: 1.6.124; 1.6.126;
Update my bits of the TODO list.
 1.5 21-Feb-2007  rumble branches: 1.5.4; 1.5.6; 1.5.8;
Nix a few completed tasks.
 1.4 30-Dec-2006  rumble branches: 1.4.2;
Add some items for myself.
 1.3 01-Mar-2005  sekiya branches: 1.3.4; 1.3.32;
Update TODO list.
 1.2 14-Jun-2000  soren branches: 1.2.4; 1.2.6; 1.2.30; 1.2.38; 1.2.40;
Remember T-shirt.
 1.1 14-Jun-2000  soren Initial commit.
 1.2.40.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.38.1 29-Apr-2005  kent sync with -current
 1.2.30.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.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.2.6.1 14-Jun-2000  bouyer file TODO was added on branch thorpej_scsipi on 2000-11-20 20:23:40 +0000
 1.2.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 14-Jun-2000  minoura file TODO was added on branch minoura-xpg4dl on 2000-06-22 17:02:55 +0000
 1.3.32.1 12-Jan-2007  ad Sync with head.
 1.3.4.3 03-Sep-2007  yamt sync with head.
 1.3.4.2 26-Feb-2007  yamt sync with head.
 1.3.4.1 30-Dec-2006  yamt sync with head.
 1.4.2.2 15-Apr-2007  yamt sync with head.
 1.4.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.5.8.1 29-Mar-2007  reinoud Pullup to -current
 1.5.6.1 11-Jul-2007  mjf Sync with head.
 1.5.4.1 10-Apr-2007  ad Sync with head.
 1.6.126.1 10-Jun-2019  christos Sync with HEAD
 1.6.124.1 18-Jan-2019  pgoyette Synch with HEAD
 1.2 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.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.14;
Dummy.
 1.1.14.1 07-Jan-2003  thorpej Sync with HEAD.
 1.1.6.2 14-Jun-2000  soren Dummy.
 1.1.6.1 14-Jun-2000  soren file .keep_me was added on branch thorpej_scsipi on 2000-06-14 15:51:29 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file .keep_me was added on branch minoura-xpg4dl on 2000-06-22 17:02:55 +0000
 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:14:30 +0000
 1.2 13-May-2002  soren Make the build machinery happy for now.
 1.1 08-May-2002  pooka Make INDY the Indy config file

Add DRAKEN as a model of what to do with the O2 (effectively the same
file as the old INDY)
 1.28 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.27 25-Oct-2003  simonb Add COMPAT_16 where missing.
Remove the unused COMPAT_15.
Comment out/remove COMPAT_* from INSTALL kernels.
 1.26 17-Oct-2003  tsutsui Add vr at pci and dmphy at mii. Tested on my O2.
 1.25 05-Oct-2003  tsutsui Add pcn at pci, tl at pci and tlphy, which I've confirmed working on O2.
 1.24 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.23 28-Sep-2003  tsutsui - Remove (commented out) options COMPAT_ULTRIX, which is not usable on mipseb.
- Fix (commented out) obsolete options MINIROOTSIZE.
- space/TAB cosmetics
 1.22 28-Sep-2003  tsutsui Add options COMPAT_16.
 1.21 25-Sep-2003  lonewolf Support for HAL2 audio controller attached to the HPC ASIC, found on SGI Indy.

The driver is not too heavily tested and only supports audio playback and
master volume setting currently.
 1.20 04-May-2003  gmcgarry branches: 1.20.2;
Add commented-out wsfont (same as wsdisplay). Addresses PR#18388.
 1.19 26-Apr-2003  ragge Add pseudo-device ksyms.
 1.18 10-Apr-2003  christos Bye Bye UCONSOLE
 1.17 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.16 03-Jan-2003  rafal Also remove `options MIPS3_5200' since nothing uses it ATM.
 1.15 03-Jan-2003  rafal The Tigon driver is known to have issues on BE systems, so remove it (I got
the card probed & attached, but had to hack the driver source to even get
it that far and it had issues after that which made me punt on it).
 1.14 26-Dec-2002  pooka Shuffle network interface and phy drivers into alphabetical order and
add comments for them.
 1.13 23-Dec-2002  pooka add some ethernet interfaces

from Chris Sekiya
 1.12 22-Nov-2002  wiz Fix typo (responsiness -> responsiveness).
 1.11 18-Oct-2002  junyoung Add NEW_BUFQ_STRATEGY (disabled by default).
 1.10 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.9 06-Oct-2002  provos add SYSTRACE; approved perry.
 1.8 25-Sep-2002  martti Add one space between "#option" and "<tab>IPFILTER_DEFAULT_BLOCK"
 1.7 20-Sep-2002  martti Added (commented out) IPFILTER_DEFAULT_BLOCK.
 1.6 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.5 17-Jun-2002  lukem branches: 1.5.2; 1.5.4;
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.4 16-Jun-2002  manu Added COMPAT_LINUX and COMPAT_ULTRIX (commented out)
 1.3 16-Jun-2002  manu Commented out COMPAT_IRIX in GENERIC kernels, because it is still
quite experimental.

Added irix_kmem and irix_usema pseudo devices which are used by
IRIX binary compatibility (commented out for now)
 1.2 14-May-2002  pooka branches: 1.2.2; 1.2.4;
a real version of GENERIC
 1.1 13-May-2002  soren Make the build machinery happy for now.
 1.2.4.4 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.2.4.3 01-Aug-2002  lukem Pull up revision 1.5 (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.2.4.2 18-Jun-2002  lukem Pull up revision 1.4 (requested by manu in ticket #293):
Added COMPAT_LINUX and COMPAT_ULTRIX (commented out)
 1.2.4.1 18-Jun-2002  lukem Pull up revision 1.3 (requested by manu in ticket #293):
Commented out COMPAT_IRIX in GENERIC kernels, because it is still
quite experimental.
Added irix_kmem and irix_usema pseudo devices which are used by
IRIX binary compatibility (commented out for now)
 1.2.2.1 15-Jul-2002  gehenna catch up with -current.
 1.5.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.5.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.5.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.4.1 17-Jun-2002  jdolecek file GENERIC was added on branch kqueue on 2002-06-23 17:40:26 +0000
 1.5.2.7 07-Jan-2003  thorpej Sync with HEAD.
 1.5.2.6 29-Dec-2002  thorpej Sync with HEAD.
 1.5.2.5 11-Dec-2002  thorpej Sync with HEAD.
 1.5.2.4 11-Nov-2002  nathanw Catch up to -current
 1.5.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.5.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.5.2.1 17-Jun-2002  nathanw file GENERIC was added on branch nathanw_sa on 2002-06-20 03:40:46 +0000
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.44 29-Jan-2024  christos PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.43 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.42 07-Jun-2022  martin This kernel has no midi, so comment out pseudo-device sequencer
 1.41 21-Aug-2021  andvar fix some more typos in comments/log messages, improve wording as well.
 1.40 21-Jan-2021  nia add a commented out compat_ossaudio wherever there's compat_linux

requested by mrg
 1.39 27-Sep-2020  roy branches: 1.39.2;
vether: Add to kernel configurations

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.38 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.37 19-Jan-2020  thorpej Remove the strip(4) - Starmode Radio IP - pseudo-device driver. It is
long since obsolete.
 1.36 06-May-2019  sevan branches: 1.36.4;
Use filesystems.config to reduce duplication
 1.35 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.34 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.33 23-Jan-2018  sevan branches: 1.33.2; 1.33.4;
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.32 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.31 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.30 28-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 1.
 1.29 08-Aug-2015  maxv branches: 1.29.10;
Remove KMEMSTATS.
 1.28 16-Nov-2014  manu branches: 1.28.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.27 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.26 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.25 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.24 20-Jul-2014  alnsn branches: 1.24.2;
Add commented out bpfjit options to mips kernels.
While here, add 2 missing RCS ids.
 1.23 30-Jun-2013  rmind branches: 1.23.4;
G/C PFIL_HOOKS from the kernel configs.
 1.22 05-Jun-2013  christos branches: 1.22.2;
remove obsolete networking options
 1.21 27-Apr-2013  christos more bogus number removal
 1.20 27-Apr-2013  christos the bogus number police
 1.19 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.18 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.17 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.16 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.15 17-Aug-2012  abs branches: 1.15.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.14 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.13 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.12 22-Nov-2011  tls branches: 1.12.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.11 26-Apr-2011  joerg branches: 1.11.4;
Remove IRIX emulation
 1.10 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.9 05-Mar-2011  joerg Disable COMPAT_IRIX and related code. The usefulness is under discussion
and code that dereferences pointer into userland without proper checking
needs a full audit.
 1.8 23-Nov-2010  hannken branches: 1.8.2; 1.8.4;
Remove unused count from pseudo-device md.
 1.7 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.6 05-Dec-2009  pooka branches: 1.6.2; 1.6.4;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.5 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.4 17-Oct-2007  garbled branches: 1.4.20; 1.4.28; 1.4.34;
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.3 08-Jul-2007  pooka branches: 1.3.10;
RCS Id police
 1.2 03-Jan-2006  rumble branches: 1.2.28; 1.2.30; 1.2.36;
Fix the comment. It is perfectly valid to have a kernel that supports
MIPS1 and MIPS3. However, we need a separate config due to different
start addresses.
 1.1 13-Nov-2004  sekiya branches: 1.1.2; 1.1.14; 1.1.24;
Add INSTALL and GENERIC kernel configuration wrappers for IP12 family.

Note that devices are defined in the IP2x configuration file; the IP12 is
99.5% the same as the IP20/22/24. Indeed, the only reason to have a separate
config file for IP12 is to sort out the MIPS1/MIPS3 locore bits.

To that end, the wrappers include the IP2x GENERIC config, undefine a few
directives, and define the appropriate bits for IP12.
 1.1.24.1 15-Jan-2006  yamt sync with head.
 1.1.14.2 03-Sep-2007  yamt sync with head.
 1.1.14.1 21-Jun-2006  yamt sync with head.
 1.1.2.2 14-Nov-2004  skrll Sync with HEAD.
 1.1.2.1 13-Nov-2004  skrll file GENERIC32_IP12 was added on branch ktrace-lwp on 2004-11-14 08:15:24 +0000
 1.2.36.1 03-Oct-2007  garbled Sync with HEAD
 1.2.30.1 11-Jul-2007  mjf Sync with head.
 1.2.28.1 15-Jul-2007  ad Sync with head.
 1.3.10.1 06-Nov-2007  matt sync with HEAD
 1.4.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.4.20.3 11-Aug-2010  yamt sync with head.
 1.4.20.2 11-Mar-2010  yamt sync with head
 1.4.20.1 04-May-2009  yamt sync with head.
 1.6.4.5 31-May-2011  rmind sync with head
 1.6.4.4 21-Apr-2011  rmind sync with head
 1.6.4.3 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.6.4.2 05-Mar-2011  rmind sync with head
 1.6.4.1 30-May-2010  rmind sync with head
 1.6.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.8.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.8.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.4.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11.4.2 30-Oct-2012  yamt sync with head
 1.11.4.1 17-Apr-2012  yamt sync with head
 1.12.2.2 11-Mar-2012  mrg sync to latest -current
 1.12.2.1 18-Feb-2012  mrg merge to -current.
 1.15.2.4 03-Dec-2017  jdolecek update from HEAD
 1.15.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.2.2 23-Jun-2013  tls resync from head
 1.15.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.22.2.1 28-Aug-2013  rmind sync with head
 1.23.4.1 10-Aug-2014  tls Rebase.
 1.24.2.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.24.2.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.28.2.2 28-Aug-2017  skrll Sync with HEAD
 1.28.2.1 22-Sep-2015  skrll Sync with HEAD
 1.29.10.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.33.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.33.4.1 10-Jun-2019  christos Sync with HEAD
 1.33.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.36.4.1 25-Jan-2020  ad Sync with head.
 1.39.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.125 29-Jan-2024  christos PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.124 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.123 08-Jun-2022  martin This kernel has no midi, so comment out pseudo-device sequencer
 1.122 21-Aug-2021  andvar fix some more typos in comments/log messages, improve wording as well.
 1.121 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.120 16-Aug-2020  jdolecek make COMPAT_LINUX option disabled by default

leave the option enabled only in amd64/i386 ALL kernels to make
sure it continues to be compilable also when included in kernel
 1.119 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.118 19-Jan-2020  thorpej Remove the strip(4) - Starmode Radio IP - pseudo-device driver. It is
long since obsolete.
 1.117 06-May-2019  sevan branches: 1.117.4;
Use filesystems.config to reduce duplication
 1.116 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.115 13-Apr-2019  isaki Add drvctl to kernel which has audio device.
audiocfg(1) requires drvctl(4).
 1.114 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.113 09-Apr-2018  christos branches: 1.113.2;
rename "panel" to "button" to avoid conflict with fdt
 1.112 23-Jan-2018  sevan branches: 1.112.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.111 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.110 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.109 28-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 1.
 1.108 13-Dec-2016  christos branches: 1.108.8;
wildcard speaker attachments, now that we can handle many of them.
 1.107 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.106 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.105 26-Sep-2015  maxv branches: 1.105.2;
Remove KMEMSTATS. Normally it's ok now.
 1.104 16-Nov-2014  manu branches: 1.104.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.103 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.102 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.101 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.100 20-Jul-2014  alnsn branches: 1.100.2;
Add commented out bpfjit options to mips kernels.
While here, add 2 missing RCS ids.
 1.99 30-Jun-2013  rmind branches: 1.99.4;
G/C PFIL_HOOKS from the kernel configs.
 1.98 05-Jun-2013  christos branches: 1.98.2;
remove obsolete networking options
 1.97 27-Apr-2013  christos more bogus number removal
 1.96 27-Apr-2013  christos the bogus number police
 1.95 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.94 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.93 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.92 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.91 17-Aug-2012  abs branches: 1.91.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.90 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.89 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.88 22-Nov-2011  tls branches: 1.88.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.87 26-Apr-2011  joerg branches: 1.87.4;
Remove IRIX emulation
 1.86 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.85 05-Mar-2011  joerg Disable COMPAT_IRIX and related code. The usefulness is under discussion
and code that dereferences pointer into userland without proper checking
needs a full audit.
 1.84 23-Nov-2010  hannken branches: 1.84.2; 1.84.4;
Remove unused count from pseudo-device md.
 1.83 07-Jul-2010  chs enable COMPAT_LINUX.
 1.82 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.81 05-Dec-2009  pooka branches: 1.81.2; 1.81.4;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.80 14-May-2009  macallan add panel driver
 1.79 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.78 24-Jan-2009  mrg branches: 1.78.2;
add COMPAT_50 to all the configs with COMPAT_40.
 1.77 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

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

Proposed on tech-kern@.
 1.75 15-Aug-2008  tsutsui branches: 1.75.2; 1.75.4; 1.75.8;
Add accept filters to GENERIC-like kernels.
 1.74 31-Jul-2008  simonb Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.73 04-Apr-2008  tsutsui branches: 1.73.4; 1.73.6; 1.73.10;
- add options COMPAT_40
- use options<space><tab>
 1.72 07-Mar-2008  tnn tmpfs works on sgimips, so enable it.
 1.71 31-Dec-2007  ad branches: 1.71.2; 1.71.6;
Remove systrace. Ok core@.
 1.70 04-Nov-2007  xtraeme branches: 1.70.2; 1.70.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.69 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.68 06-Aug-2007  adrianp branches: 1.68.2; 1.68.6;
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.67 29-Jun-2007  rumble branches: 1.67.2; 1.67.4; 1.67.8;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.66 06-Jun-2007  martin Add pseudo-device agr to more kernels
 1.65 20-Feb-2007  rumble branches: 1.65.4; 1.65.6; 1.65.12;
Enable GIO32 SCSI adapters to attach at secondary and tertiary HPCs.
 1.64 29-Dec-2006  rumble branches: 1.64.2;
Enable light(4).
 1.63 29-Dec-2006  rumble Rework GIO probing a bit.

Devices present on the GIO bus needn't always provide a Product
Indentification Word, even if their address space is the same as the
address space of a slot. Separate the handling of probing for slot-based
devices and graphics devices, matching the latter first, and precluding
addresses probed for the former when a graphics device is known to exist
in a slot's space.
 1.62 24-Dec-2006  rumble The Set Engineering workaround is now set as a proplib entry in
sgimips/autoconf.c.
 1.61 23-Dec-2006  rumble The Set Engineering board now works, so enabled it with the appropriate
workaround option. Also, add 'tlphy' to keep the dmesg tidy (it's unused).
 1.60 23-Dec-2006  rumble Permit sq(4) to attach to secondary HPCs, enabling support for the E++
GIO adapters and the secondary ethernet on the Challenge S (untested).
 1.59 11-Nov-2006  jmmv branches: 1.59.2; 1.59.4;
Remove tmpfs's experimental status. OK'ed by core@.
 1.58 04-Sep-2006  rumble branches: 1.58.2; 1.58.4;
Check the haltwo hardware present bit in the match function, rather than
in the attach function after we've thwacked several registers and
potentially wedged the machine. This fixes booting on Challenge S systems
and addresses PR 25202.

Consequently, re-enable haltwo in the default kernel configuration.

Many thanks to George Harvey for testing and feedback.
 1.57 01-Sep-2006  rumble Comment out tl(4) and nsphy(4) (used by the Set Engineering board) as it
appears to have an unresolved problem with bulk transmits.
 1.56 30-Aug-2006  rumble Add the giopci device and associated ethernet/mii chipsets for the Phobos
and Set Engineering GIO fast ethernet boards.
 1.55 26-Aug-2006  christos PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.54 26-Aug-2006  tsutsui Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.53 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.52 31-Jul-2006  he branches: 1.52.2;
Also comment out audio* at audiobus? now that no audio device is available.
 1.51 20-Jul-2006  rumble Disable haltwo(4) by default. The driver does not properly determine when
the audio hardware is not present and causes a hang on Challenge-S systems.

Approved by pooka@ and sekiya@.
 1.50 30-Jun-2006  tsutsui Add (commented out) pseudo-device carp.
 1.49 19-Apr-2006  drochner branches: 1.49.4;
adjust comments for the new location of wskbdmap_mfii.c,
addresses PR kern/33290 by henry nelson
 1.48 15-Apr-2006  jmmv Remove the getwschar and putwschar accessops from wsdisplay drivers as
requested by uwe@. These were wrong because they were receiving an
emulcookie yet they were accessops (thus having to receive an accesscookie).
Instead, just handle the WSDISPLAYIO_{GET,PUT}WSCHAR ioctls from the
driver's ioctl accessop.

As this reduces the amount of code needed to handle these operations to
two small functions in each driver, remove the WSDISPLAY_CHARFUNCS kernel
option.

Reviewed by, at least, uwe@ and macallan@. No objections in tech-kern@.
 1.47 28-Mar-2006  pavel 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.46 05-Feb-2006  cube branches: 1.46.2; 1.46.4; 1.46.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.45 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.44 03-Feb-2006  tsutsui branches: 1.44.2;
Add commented out UDF file-system entry in GENERIC-like configurations.
 1.43 28-Dec-2005  kurahone branches: 1.43.2; 1.43.4;
Added support for the IP22 IOC's parallel port (PI1).

Code contributed by Joe Britt.

Reviewed by <sekiya> and <kurahone>.
 1.42 20-Dec-2005  thorpej Remove the tablet line discipline.
 1.41 10-Dec-2005  tsutsui Sync with other ports:
> Add (commented out) Veriexec options and pseudo-device to GENERIC kernels.
 1.40 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.39 06-Oct-2005  tsutsui Add (commented out) file-system TMPFS.
 1.38 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.37 19-Aug-2005  christos 64 bit inode changes.
 1.36 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.35 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.34 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.33 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.32 25-Jun-2005  rpaulo branches: 1.32.2;
Add file-system PTYFS (commented out) so that people know its existence.

Ok'ed by Christos Zoulas and Hubert Feyrer.
 1.31 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.30 18-Feb-2005  dsl branches: 1.30.4;
Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.29 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.28 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.27 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.26 17-Jan-2005  cube branches: 1.26.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.25 01-Jan-2005  rumble branches: 1.25.2;
Add commented out pf and pflog pseudo-devices.
 1.24 13-Nov-2004  sekiya Add INSTALL and GENERIC kernel configuration wrappers for IP12 family.

Note that devices are defined in the IP2x configuration file; the IP12 is
99.5% the same as the IP20/22/24. Indeed, the only reason to have a separate
config file for IP12 is to sort out the MIPS1/MIPS3 locore bits.

To that end, the wrappers include the IP2x GENERIC config, undefine a few
directives, and define the appropriate bits for IP12.
 1.23 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.22 01-Oct-2004  sekiya Move the ECOFF definition from the INSTALL kernel to the GENERIC kernel --
it's possible that someone might want to run an IP20 diskless.

Pointed out by simonb@
 1.21 29-Sep-2004  sekiya Add COMPAT_20
 1.20 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.19 15-Jul-2004  atatat branches: 1.19.2;
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.18 08-Jul-2004  sekiya Add wsmouse* at zsms*
 1.17 08-Jul-2004  sekiya Uncomment keyboard/mouse at zs*
 1.16 08-Jul-2004  sekiya Uncomment grtwo* attachment and its corresponding wsdisplay*
 1.15 07-Jul-2004  rumble Fix a typo in zsms0's parent.
 1.14 06-Jul-2004  sekiya Add commented-out entries for grtwo wscons support (and fix the entries for
serial keyboard/mouse).
 1.13 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.12 26-Jun-2004  abs Add (commented out) ALTQ options to all GENERIC-like files
 1.11 18-Jun-2004  christos ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM
 1.10 16-Jun-2004  christos Add pseudo-device ptm on all the generic flavored kernels.
 1.9 19-Jan-2004  sekiya branches: 1.9.2;
Attach int0 at mainbus (precedent being the ip32 CRIME device, which handled
interrupts and timer calibration yet is also attached at mainbus).

Introduce the INDY_R4600_CACHE config option, which more accurately describes
the code enabled by this option.

This renders #ifdef IPxx completely obsolete, thus we theoretically can unify
the GENERIC files if a workable load address relocation scheme can be found.
 1.8 15-Jan-2004  pooka Replace prehistoric comment "Indy" with something a bit more current
 1.7 02-Jan-2004  sekiya Wire down zsc/zstty mapping and add commented-out entries for
IP20 keyboard/mouse.
 1.6 15-Dec-2003  sekiya Change all IP22 preprocessor conditionals to IP2X preprocessor conditionals.

Part one of two -- part two will be renaming ip22_*() to ip2x_*().
 1.5 15-Dec-2003  sekiya Add ioc driver to IP2x config file, pull in ioc/files.ioc as well. Note that
IP2x now has blinkenlitzen.
 1.4 15-Dec-2003  lonewolf Add pckbc/wscons/newport related attachments.
 1.3 14-Dec-2003  sekiya Uncomment dpclock, remove IP20 option. IP20 now boots as far as the
boot device selection prompt using the GENERIC kernel.
 1.2 22-Nov-2003  sekiya Add (commented out) dpclock for ip22 and blinkenlitzen for ip32.
 1.1 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.9.2.4 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.9.2.3 15-Jul-2004  he branches: 1.9.2.3.2; 1.9.2.3.4;
Pull up revision 1.19 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.9.2.2 02-Jul-2004  he Pull up revision 1.13 (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.9.2.1 30-Jun-2004  jdc Pull up revision 1.12 (requested by abs in ticket #567).

Add (commented out) ALTQ options to all GENERIC-like files
 1.9.2.3.4.1 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.9.2.3.2.1 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.19.2.13 11-Dec-2005  christos Sync with head.
 1.19.2.12 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.2.11 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.19.2.10 15-Feb-2005  skrll Sync with HEAD.
 1.19.2.9 04-Feb-2005  skrll Sync with HEAD.
 1.19.2.8 24-Jan-2005  skrll Sync with HEAD.
 1.19.2.7 17-Jan-2005  skrll Sync with HEAD.
 1.19.2.6 14-Nov-2004  skrll Sync with HEAD.
 1.19.2.5 19-Oct-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 15-Jul-2004  skrll file GENERIC32_IP2x was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.25.2.1 29-Apr-2005  kent sync with -current
 1.26.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.26.2.1 12-Feb-2005  yamt sync with head.
 1.30.4.3 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net&#64;
Ok'ed by core&#64;
 1.30.4.2 14-Aug-2005  riz branches: 1.30.4.2.2; 1.30.4.2.4;
Pull up revision 1.34 (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.30.4.1 18-Jul-2005  riz Pull up revision 1.33 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.30.4.2.4.1 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.30.4.2.2.1 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.32.2.7 17-Mar-2008  yamt sync with head.
 1.32.2.6 21-Jan-2008  yamt sync with head
 1.32.2.5 15-Nov-2007  yamt sync with head.
 1.32.2.4 03-Sep-2007  yamt sync with head.
 1.32.2.3 26-Feb-2007  yamt sync with head.
 1.32.2.2 30-Dec-2006  yamt sync with head.
 1.32.2.1 21-Jun-2006  yamt sync with head.
 1.43.4.1 09-Sep-2006  rpaulo sync with head
 1.43.2.1 18-Feb-2006  yamt sync with head.
 1.44.2.1 22-Apr-2006  simonb Sync with head.
 1.46.6.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.46.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.46.4.2 11-May-2006  elad sync with head
 1.46.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.46.2.5 14-Sep-2006  yamt sync with head.
 1.46.2.4 03-Sep-2006  yamt sync with head.
 1.46.2.3 11-Aug-2006  yamt sync with head
 1.46.2.2 24-May-2006  yamt sync with head.
 1.46.2.1 01-Apr-2006  yamt sync with head.
 1.49.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.52.2.5 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.52.2.4 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.57
Comment out tl(4) and nsphy(4) (used by the Set Engineering board) as it
appears to have an unresolved problem with bulk transmits.
 1.52.2.3 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.56
Add the giopci device and associated ethernet/mii chipsets for the Phobos
and Set Engineering GIO fast ethernet boards.
 1.52.2.2 08-Sep-2006  riz Pull up following revision(s) (requested by rumble in ticket #120):
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.58 via patch
sys/arch/sgimips/hpc/haltwo.c: revision 1.10
Check the haltwo hardware present bit in the match function, rather than
in the attach function after we've thwacked several registers and
potentially wedged the machine. This fixes booting on Challenge S systems
and addresses PR 25202.
Consequently, re-enable haltwo in the default kernel configuration.
Many thanks to George Harvey for testing and feedback.
 1.52.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.58.4.1 10-Dec-2006  yamt sync with head.
 1.58.2.2 12-Jan-2007  ad Sync with head.
 1.58.2.1 18-Nov-2006  ad Sync with head.
 1.59.4.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.59.2.2 25-Aug-2007  liamjfoy Pull up following revision(s) (requested by adrianp in ticket #820):
sys/arch/hp300/conf/GENERIC: revision 1.141
sys/arch/alpha/conf/GENERIC: revision 1.315
sys/arch/amd64/conf/GENERIC: revision 1.154
sys/arch/cats/conf/GENERIC: revision 1.116
sys/arch/arc/conf/GENERIC: revision 1.148
sys/arch/acorn32/conf/GENERIC: revision 1.80
sys/arch/sparc/conf/GENERIC: revision 1.200
sys/arch/sparc64/conf/GENERIC: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.68
sys/arch/amiga/conf/GENERIC: revision 1.248
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66
sys/arch/i386/conf/GENERIC: revision 1.840
sys/arch/amiga/conf/GENERIC.in: revision 1.61
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68
sys/arch/mac68k/conf/GENERIC: revision 1.182
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.59.2.1 06-Jun-2007  bouyer pullup the following revisions (requested my martin in ticket #699):
sys/arch/acorn26/conf/GENERIC 1.50
sys/arch/acorn32/conf/GENERIC 1.79
sys/arch/alpha/conf/GENERIC 1.313
sys/arch/amd64/conf/GENERIC 1.148
sys/arch/amiga/conf/GENERIC 1.245
sys/arch/arc/conf/GENERIC 1.146
sys/arch/bebox/conf/GENERIC 1.105
sys/arch/cats/conf/GENERIC 1.115
sys/arch/cobalt/conf/GENERIC 1.108
sys/arch/dreamcast/conf/GENERIC 1.78
sys/arch/ews4800mips/conf/GENERIC 1.18
sys/arch/hp300/conf/GENERIC 1.139
sys/arch/hp700/conf/GENERIC 1.74
sys/arch/hpcmips/conf/GENERIC 1.196
sys/arch/i386/conf/GENERIC 1.831
sys/arch/iyonix/conf/GENERIC 1.38 via patch
sys/arch/landisk/conf/GENERIC 1.8 via patch
sys/arch/luna68k/conf/GENERIC 1.78
sys/arch/mac68k/conf/GENERIC 1.181
sys/arch/macppc/conf/GENERIC 1.256 via patch
sys/arch/mipsco/conf/GENERIC 1.65
sys/arch/mmeye/conf/GENERIC 1.88
sys/arch/mvme68k/conf/GENERIC 1.71
sys/arch/news68k/conf/GENERIC 1.88
sys/arch/newsmips/conf/GENERIC 1.98
sys/arch/next68k/conf/GENERIC 1.108
sys/arch/ofppc/conf/GENERIC 1.98
sys/arch/pc532/conf/GENERIC 1.70
sys/arch/pmax/conf/GENERIC 1.152
sys/arch/prep/conf/GENERIC 1.135
sys/arch/sbmips/conf/GENERIC 1.61
sys/arch/sparc/conf/GENERIC 1.199
sys/arch/sparc64/conf/GENERIC 1.85
sys/arch/sun3/conf/GENERIC 1.138
sys/arch/vax/conf/GENERIC 1.157
sys/arch/x68k/conf/GENERIC 1.134
sys/arch/amiga/conf/GENERIC.in 1.59
sys/arch/sgimips/conf/GENERIC32_IP2x 1.66
sys/arch/sgimips/conf/GENERIC32_IP3x 1.63
sys/arch/sun3/conf/GENERIC3X 1.95
sys/arch/atari/conf/GENERIC.in 1.66

Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.64.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.65.12.2 03-Oct-2007  garbled Sync with HEAD
 1.65.12.1 26-Jun-2007  garbled Sync with HEAD.
 1.65.6.1 11-Jul-2007  mjf Sync with head.
 1.65.4.4 03-Dec-2007  ad Sync with HEAD.
 1.65.4.3 20-Aug-2007  ad Sync with HEAD.
 1.65.4.2 15-Jul-2007  ad Sync with head.
 1.65.4.1 09-Jun-2007  ad Sync with head.
 1.67.8.2 04-Nov-2007  jmcneill Sync with HEAD.
 1.67.8.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.67.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.67.2.1 07-Aug-2007  matt Sync with HEAD.
 1.68.6.1 13-Nov-2007  bouyer Sync with HEAD
 1.68.2.3 23-Mar-2008  matt sync with HEAD
 1.68.2.2 09-Jan-2008  matt sync with HEAD
 1.68.2.1 06-Nov-2007  matt sync with HEAD
 1.70.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.70.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.71.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.71.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.71.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.71.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.71.2.1 24-Mar-2008  keiichi sync with head.
 1.73.10.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.73.10.1 19-Oct-2008  haad Sync with HEAD.
 1.73.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.73.4.4 11-Aug-2010  yamt sync with head.
 1.73.4.3 11-Mar-2010  yamt sync with head
 1.73.4.2 16-May-2009  yamt sync with head
 1.73.4.1 04-May-2009  yamt sync with head.
 1.75.8.1 29-Dec-2010  matt Merge changes from netbsd-5.
 1.75.4.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #987):
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.80
add panel driver
 1.75.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.75.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.78.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.81.4.5 31-May-2011  rmind sync with head
 1.81.4.4 21-Apr-2011  rmind sync with head
 1.81.4.3 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.81.4.2 05-Mar-2011  rmind sync with head
 1.81.4.1 30-May-2010  rmind sync with head
 1.81.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.81.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.84.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.84.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.87.4.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.87.4.2 30-Oct-2012  yamt sync with head
 1.87.4.1 17-Apr-2012  yamt sync with head
 1.88.2.2 11-Mar-2012  mrg sync to latest -current
 1.88.2.1 18-Feb-2012  mrg merge to -current.
 1.91.2.4 03-Dec-2017  jdolecek update from HEAD
 1.91.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.91.2.2 23-Jun-2013  tls resync from head
 1.91.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.98.2.1 28-Aug-2013  rmind sync with head
 1.99.4.1 10-Aug-2014  tls Rebase.
 1.100.2.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.100.2.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.104.2.3 28-Aug-2017  skrll Sync with HEAD
 1.104.2.2 05-Feb-2017  skrll Sync with HEAD
 1.104.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.105.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.108.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.112.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.112.2.1 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.113.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.113.2.1 10-Jun-2019  christos Sync with HEAD
 1.117.4.1 25-Jan-2020  ad Sync with head.
 1.136 29-Jan-2024  christos PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.135 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.134 21-Aug-2021  andvar fix some more typos in comments/log messages, improve wording as well.
 1.133 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.132 16-Aug-2020  jdolecek make COMPAT_LINUX option disabled by default

leave the option enabled only in amd64/i386 ALL kernels to make
sure it continues to be compilable also when included in kernel
 1.131 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.130 25-Jan-2020  thorpej Retire "le* at pci?" from the shipped kernel configs:
- If the config had both an le@pci and a pcn, simply remove le@pci
(pcn would match at a higher priority anyway).
- If the config had le@pci enabled, but no pcn, change le@pci to pcn.
- If the config had le@pci commented out, but no pcn, change le@pci
to pcn and leave it commented out.

The pcn driver supports more chips than le@pci and does DMA directly
to/from mbufs rather than memory copies.
 1.129 20-Jan-2020  thorpej Remove FDDI support.
 1.128 19-Jan-2020  thorpej Remove HIPPI support and the esh(4) driver that uses it. There have not
been any users of HIPPI for some time, and it is unlikely to be resurrected.
 1.127 19-Jan-2020  thorpej Remove the strip(4) - Starmode Radio IP - pseudo-device driver. It is
long since obsolete.
 1.126 06-May-2019  sevan branches: 1.126.4;
Use filesystems.config to reduce duplication
 1.125 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.124 23-Mar-2019  sevan Enable Bluetooth support.
usbdevices.config includes support for USB Bluetooth.
Tested on an o2 with a PCI USB adapter and Broadcom BCM20702A0 dongle.
 1.123 23-Mar-2019  sevan Reduce duplication by switching to using dev/usb/usbdevices.config
 1.122 06-Feb-2019  rin Add ure(4) to kernel config files. Also add PHY drivers where necessary.
 1.121 12-Dec-2018  maxv Remove references to "lmc" in the kernel configurations.
 1.120 23-Oct-2018  jdolecek remove the 'wd* at umass?' for the non-standardized and rare (extinct?)
In-System Design ATA protocol over Bulk-Only devices from most kernels,
leave only in i386/amd64 ALL; it's unmaintained and likely currently broken,
lack of test hardware makes it impossible to support
 1.119 06-Sep-2018  maxv Retire the 'midway' driver. Discussed on tech-net@ recently and also three
years ago, part of removing the network ATM code.
 1.118 25-Aug-2018  rin Add (commented out) mue(4) to where appropriate.
Also add MII/PHY drivers for USB NICs if missing.
 1.117 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.116 18-Mar-2018  jmcneill branches: 1.116.2;
Enable BUFQ_PRIOCSCAN
 1.115 23-Jan-2018  sevan branches: 1.115.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.114 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.113 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.112 28-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 1.
 1.111 13-Dec-2016  christos branches: 1.111.8;
wildcard speaker attachments, now that we can handle many of them.
 1.110 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.109 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.108 19-Mar-2016  gdt branches: 1.108.2;
Disable uscanner in all kernel configs

As discussed on current-users@, SANE uses ugen via libusb and not
uscanner, so users are not well served by having uscanner. Consensus
is that addressing how to adjust permissions for scanners should not
block restoring basic functionionality.

(Compile-tested only, but there are multiple reports of this being the
right approach.)
 1.107 26-Sep-2015  maxv Remove KMEMSTATS. Normally it's ok now.
 1.106 16-Nov-2014  manu branches: 1.106.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.105 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.104 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.103 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.102 20-Jul-2014  alnsn branches: 1.102.2;
Add commented out bpfjit options to mips kernels.
While here, add 2 missing RCS ids.
 1.101 30-Jun-2013  rmind branches: 1.101.4;
G/C PFIL_HOOKS from the kernel configs.
 1.100 05-Jun-2013  christos branches: 1.100.2;
remove obsolete networking options
 1.99 27-Apr-2013  christos more bogus number removal
 1.98 27-Apr-2013  christos the bogus number police
 1.97 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.96 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.95 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.94 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.93 17-Aug-2012  abs branches: 1.93.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.92 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.91 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.90 22-Nov-2011  tls branches: 1.90.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.89 26-Apr-2011  joerg branches: 1.89.4;
Remove IRIX emulation
 1.88 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.87 05-Mar-2011  joerg Disable COMPAT_IRIX and related code. The usefulness is under discussion
and code that dereferences pointer into userland without proper checking
needs a full audit.
 1.86 23-Nov-2010  hannken branches: 1.86.2; 1.86.4;
Remove unused count from pseudo-device md.
 1.85 07-Jul-2010  chs enable COMPAT_LINUX.
 1.84 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.83 07-Mar-2010  plunky branches: 1.83.2;
add uhso(4) device where appropriate
- follow the lead of other USB driver declarations wrt commented out
- (cross-)build tested all these kernels
 1.82 14-Dec-2009  matt branches: 1.82.2;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.81 05-Dec-2009  pooka Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.80 24-Jan-2009  mrg add COMPAT_50 to all the configs with COMPAT_40.
 1.79 23-Dec-2008  jmcneill add pseudo-device drvctl
 1.78 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

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

Proposed on tech-kern@.
 1.76 23-Aug-2008  tsutsui branches: 1.76.2; 1.76.4;
Specify CPUFLAGS="-march=mips3 -mabi=32 -mtune=vr5000" for IP32 kernel.
This improves ttcp(1) results on mec(4) ~7%.

No objection on port-sgimips.
 1.75 15-Aug-2008  tsutsui Add accept filters to GENERIC-like kernels.
 1.74 07-Aug-2008  tsutsui Comment out options MACE_NEEDS_DELAYS.
Fixed mec(4) driver will (hopefully) work without it.
 1.73 31-Jul-2008  simonb Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.72 04-Apr-2008  tsutsui branches: 1.72.4; 1.72.6; 1.72.10;
- add options COMPAT_40
- use options<space><tab>
 1.71 07-Mar-2008  tnn tmpfs works on sgimips, so enable it.
 1.70 02-Feb-2008  sekiya branches: 1.70.2; 1.70.6;
Uncomment firewire devices. Verified working on my IP32 with a combo
USB2.0/IEEE1394 card:

fwohci0 at pci0 dev 3 function 3: VIA Technologies VT6306 IEEE 1394 Host Controller (rev. 0x46)
fwohci0: interrupting at crime interrupt 10
fwohci0: OHCI version 1.0 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 00:40:26:01:08:01:57:07
fwohci0: Phy 1394a available S400, 3 ports.
fwohci0: Link S400, max_rec 2048 bytes.
ieee1394if0 at fwohci0: IEEE1394 bus
fwip0 at ieee1394if0: IP over IEEE1394
fwohci0: Initiate bus reset
fwohci0: BUS reset
fwohci0: node_id=0xc800ffc0, gen=1, CYCLEMASTER mode
ieee1394if0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
ieee1394if0: bus manager 0 (me)

... and:

ieee1394if0: 2 nodes, maxhop <= 1, cable IRM = 1 (me)
ieee1394if0: bus manager 1 (me)
ieee1394if0: New S400 device ID:0001a35000317061
sbp0 at ieee1394if0: SBP-2/SCSI over IEEE1394
scsibus2 at sbp0: 1 target, 0 luns per target
sd1 at scsibus2 target 0 lun 0: <AL-COMBO, , > disk fixed
sd1: fabricating a geometry
sd1: 38154 MB, 38154 cyl, 64 head, 32 sec, 512 bytes/sect x 78140160 sectors
sd1: fabricating a geometry
sd1: no disk label

There are a few "mace: overrun at ff2001" errors during access, but they
appear harmless.
 1.69 31-Dec-2007  ad Remove systrace. Ok core@.
 1.68 04-Nov-2007  xtraeme branches: 1.68.2; 1.68.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.67 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.66 06-Aug-2007  adrianp branches: 1.66.2; 1.66.6;
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.65 17-Jul-2007  macallan branches: 1.65.2; 1.65.4; 1.65.8;
add options MACE_NEEDS_DELAYS since many machines need those delays in
bus_space*() operations on macs
 1.64 29-Jun-2007  rumble Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.63 06-Jun-2007  martin Add pseudo-device agr to more kernels
 1.62 13-Apr-2007  jmcneill branches: 1.62.2;
Enable mavb audio device.
 1.61 12-Apr-2007  jmcneill Replace pckbc with macekbc.
Enable crmfb
Enable wsfont, wsmux
 1.60 14-Mar-2007  drochner It doesn't make sense to specify "configuration" and "interface"
locators for uhub because a hub can't have sub-devices.
This might be sanity-checked eventually.
Same for ubt now after the change to device attachment.
 1.59 11-Nov-2006  jmmv branches: 1.59.2; 1.59.4; 1.59.8; 1.59.10; 1.59.12;
Remove tmpfs's experimental status. OK'ed by core@.
 1.58 21-Oct-2006  bouyer Add support for the Intel 80003 Gigabit Ethernet controller (found e.g. in
newer server chipsets) to wm(4), from the FreeBSD em(4) driver.
While there, add a few other Intel Ethernet controller that should work as
is.
Properly update the RX error and TX collision counters.
Add ikphy(4), a driver for the Intel i82563 Kumeran 10/100/1000 Ethernet PHYs
 1.57 20-Oct-2006  tsutsui Add re at pci and rgephy at mii.
 1.56 26-Aug-2006  christos branches: 1.56.2; 1.56.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.55 26-Aug-2006  tsutsui Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.54 14-Aug-2006  skrll s/adpater/adapter/

Prompted by PR/34195
 1.53 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.52 30-Jun-2006  tsutsui branches: 1.52.2;
Add (commented out) pseudo-device carp.
 1.51 23-May-2006  pavel branches: 1.51.2;
Enable the gsip driver. Worked when I (lightly) tested it.
No objections on port-sgipips@.
 1.50 17-Apr-2006  tsutsui branches: 1.50.2;
Switch macepci to use MI pci_configure_bus(9) rather than its own fixup code.
Tested on my O2 with several devices, and ok'ed by sekiya.
 1.49 17-Apr-2006  tsutsui Add adv at pci. Tested on my O2.
 1.48 28-Mar-2006  pavel 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.47 05-Feb-2006  cube branches: 1.47.2; 1.47.4; 1.47.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.46 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.45 03-Feb-2006  tsutsui branches: 1.45.2;
Add commented out UDF file-system entry in GENERIC-like configurations.
 1.44 20-Dec-2005  thorpej branches: 1.44.2; 1.44.4;
Remove the tablet line discipline.
 1.43 10-Dec-2005  tsutsui Sync with other ports:
> Add (commented out) Veriexec options and pseudo-device to GENERIC kernels.
 1.42 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.41 25-Nov-2005  thorpej swcr -> swcrypto
 1.40 25-Nov-2005  thorpej "pseudo-device crypto" really refers to the /dev/crypto API to the
opencrypto framework, not the framework itself. Update the comment
accordingly.
 1.39 25-Nov-2005  thorpej Add "pseudo-device swcr" (commented out if "pseudo-device crypto" is also
commented out).
 1.38 23-Nov-2005  tsutsui Add njs* at pci, which works fine on my O2.
 1.37 06-Nov-2005  tsutsui branches: 1.37.2;
Add pcscp (aka DC-390) at pci, which is confirmed working.
 1.36 06-Oct-2005  tsutsui Add (commented out) file-system TMPFS.
 1.35 12-Sep-2005  tsutsui Add esiop at pci, which just works.
 1.34 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.33 19-Aug-2005  christos 64 bit inode changes.
 1.32 05-Aug-2005  skrll Add (commented out) ucycom to various kernel configs.
 1.31 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.30 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.29 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.28 11-Jul-2005  kiyohara ieee1394 import from FreeBSD.
 1.27 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.26 25-Jun-2005  rpaulo branches: 1.26.2;
Add file-system PTYFS (commented out) so that people know its existence.

Ok'ed by Christos Zoulas and Hubert Feyrer.
 1.25 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.24 15-Apr-2005  itohy Add ukyopon(4).
 1.23 18-Feb-2005  dsl branches: 1.23.4;
Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.22 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.21 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.20 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.19 17-Jan-2005  cube branches: 1.19.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.18 01-Jan-2005  rumble branches: 1.18.2;
Add commented out pf and pflog pseudo-devices.
 1.17 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.16 23-Oct-2004  augustss s/uax/axe/
 1.15 29-Sep-2004  sekiya Add COMPAT_20
 1.14 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.13 15-Jul-2004  atatat branches: 1.13.2;
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.12 12-Jul-2004  tsutsui Reenable lpt at mace since shared interrupt code was fixed in mace.c rev 1.2.
 1.11 12-Jul-2004  tsutsui Enable mec Ethernet at mace.
 1.10 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.9 26-Jun-2004  abs Add (commented out) ALTQ options to all GENERIC-like files
 1.8 18-Jun-2004  christos ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM
 1.7 16-Jun-2004  christos Add pseudo-device ptm on all the generic flavored kernels.
 1.6 25-Mar-2004  sekiya branches: 1.6.2;
The lpt driver doesn't play nicely with the serial ports -- they share the
same interrupt, and something isn't quite right with the mace interrupt
dispatcher. Disable for now.

Pointed out by Tillman Hodgson and confirmed by ozone on port-sgimips.
 1.5 19-Jan-2004  sekiya Completely remove IP2X and IP32, which renders opt_machtype.h obsolete.
 1.4 15-Jan-2004  pooka Remove historic remnant that treated the O2 load address as the
sgimips standard. Define it in the respective config file.
 1.3 15-Jan-2004  pooka The O2 has a PCI slot, add opencrypto.

Brush up some comments a bit while in here.
 1.2 22-Nov-2003  sekiya Add (commented out) dpclock for ip22 and blinkenlitzen for ip32.
 1.1 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.6.2.5 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.6.2.4 15-Jul-2004  he branches: 1.6.2.4.2;
Pull up revision 1.13 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.6.2.3 15-Jul-2004  tron Pull up revision 1.11 (requested by tsutsui in ticket #652):
Enable mec Ethernet at mace.
 1.6.2.2 02-Jul-2004  he Pull up revision 1.10 (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.6.2.1 30-Jun-2004  jdc Pull up revision 1.9 (requested by abs in ticket #567).

Add (commented out) ALTQ options to all GENERIC-like files
 1.6.2.4.2.2 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.6.2.4.2.1 21-Jul-2005  riz branches: 1.6.2.4.2.1.2;
Pull up revision 1.24 (requested by itohy in ticket #1430):
Add ukyopon(4).
 1.6.2.4.2.1.2.1 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.13.2.14 11-Dec-2005  christos Sync with head.
 1.13.2.13 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.2.12 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.13.2.11 15-Feb-2005  skrll Sync with HEAD.
 1.13.2.10 04-Feb-2005  skrll Sync with HEAD.
 1.13.2.9 24-Jan-2005  skrll Sync with HEAD.
 1.13.2.8 17-Jan-2005  skrll Sync with HEAD.
 1.13.2.7 14-Nov-2004  skrll Sync with HEAD.
 1.13.2.6 02-Nov-2004  skrll Sync with HEAD.
 1.13.2.5 19-Oct-2004  skrll Sync with HEAD
 1.13.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.2 03-Aug-2004  skrll Sync with HEAD
 1.13.2.1 15-Jul-2004  skrll file GENERIC32_IP3x was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.18.2.1 29-Apr-2005  kent sync with -current
 1.19.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.2.1 12-Feb-2005  yamt sync with head.
 1.23.4.4 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net&#64;
Ok'ed by core&#64;
 1.23.4.3 14-Aug-2005  riz branches: 1.23.4.3.2; 1.23.4.3.4;
Pull up revision 1.29 (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.23.4.2 18-Jul-2005  riz Pull up revision 1.27 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.23.4.1 17-Apr-2005  tron Pull up revision 1.24 (requested by itohy in ticket #160):
Add ukyopon(4).
 1.23.4.3.4.1 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.23.4.3.2.1 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.26.2.7 17-Mar-2008  yamt sync with head.
 1.26.2.6 04-Feb-2008  yamt sync with head.
 1.26.2.5 21-Jan-2008  yamt sync with head
 1.26.2.4 15-Nov-2007  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.37.2.1 29-Nov-2005  yamt sync with head.
 1.44.4.1 09-Sep-2006  rpaulo sync with head
 1.44.2.1 18-Feb-2006  yamt sync with head.
 1.45.2.2 01-Jun-2006  kardel Sync with head.
 1.45.2.1 22-Apr-2006  simonb Sync with head.
 1.47.6.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.47.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.47.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.47.2.4 03-Sep-2006  yamt sync with head.
 1.47.2.3 11-Aug-2006  yamt sync with head
 1.47.2.2 24-May-2006  yamt sync with head.
 1.47.2.1 01-Apr-2006  yamt sync with head.
 1.50.2.1 19-Jun-2006  chap Sync with head.
 1.51.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.52.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.52.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.56.4.2 10-Dec-2006  yamt sync with head.
 1.56.4.1 22-Oct-2006  yamt sync with head
 1.56.2.1 18-Nov-2006  ad Sync with head.
 1.59.12.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.59.10.1 11-Jul-2007  mjf Sync with head.
 1.59.8.6 03-Dec-2007  ad Sync with HEAD.
 1.59.8.5 20-Aug-2007  ad Sync with HEAD.
 1.59.8.4 15-Jul-2007  ad Sync with head.
 1.59.8.3 09-Jun-2007  ad Sync with head.
 1.59.8.2 27-May-2007  ad Sync with head.
 1.59.8.1 10-Apr-2007  ad Sync with head.
 1.59.4.2 15-Apr-2007  yamt sync with head.
 1.59.4.1 24-Mar-2007  yamt sync with head.
 1.59.2.2 25-Aug-2007  liamjfoy Pull up following revision(s) (requested by adrianp in ticket #820):
sys/arch/hp300/conf/GENERIC: revision 1.141
sys/arch/alpha/conf/GENERIC: revision 1.315
sys/arch/amd64/conf/GENERIC: revision 1.154
sys/arch/cats/conf/GENERIC: revision 1.116
sys/arch/arc/conf/GENERIC: revision 1.148
sys/arch/acorn32/conf/GENERIC: revision 1.80
sys/arch/sparc/conf/GENERIC: revision 1.200
sys/arch/sparc64/conf/GENERIC: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.68
sys/arch/amiga/conf/GENERIC: revision 1.248
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66
sys/arch/i386/conf/GENERIC: revision 1.840
sys/arch/amiga/conf/GENERIC.in: revision 1.61
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68
sys/arch/mac68k/conf/GENERIC: revision 1.182
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.59.2.1 06-Jun-2007  bouyer pullup the following revisions (requested my martin in ticket #699):
sys/arch/acorn26/conf/GENERIC 1.50
sys/arch/acorn32/conf/GENERIC 1.79
sys/arch/alpha/conf/GENERIC 1.313
sys/arch/amd64/conf/GENERIC 1.148
sys/arch/amiga/conf/GENERIC 1.245
sys/arch/arc/conf/GENERIC 1.146
sys/arch/bebox/conf/GENERIC 1.105
sys/arch/cats/conf/GENERIC 1.115
sys/arch/cobalt/conf/GENERIC 1.108
sys/arch/dreamcast/conf/GENERIC 1.78
sys/arch/ews4800mips/conf/GENERIC 1.18
sys/arch/hp300/conf/GENERIC 1.139
sys/arch/hp700/conf/GENERIC 1.74
sys/arch/hpcmips/conf/GENERIC 1.196
sys/arch/i386/conf/GENERIC 1.831
sys/arch/iyonix/conf/GENERIC 1.38 via patch
sys/arch/landisk/conf/GENERIC 1.8 via patch
sys/arch/luna68k/conf/GENERIC 1.78
sys/arch/mac68k/conf/GENERIC 1.181
sys/arch/macppc/conf/GENERIC 1.256 via patch
sys/arch/mipsco/conf/GENERIC 1.65
sys/arch/mmeye/conf/GENERIC 1.88
sys/arch/mvme68k/conf/GENERIC 1.71
sys/arch/news68k/conf/GENERIC 1.88
sys/arch/newsmips/conf/GENERIC 1.98
sys/arch/next68k/conf/GENERIC 1.108
sys/arch/ofppc/conf/GENERIC 1.98
sys/arch/pc532/conf/GENERIC 1.70
sys/arch/pmax/conf/GENERIC 1.152
sys/arch/prep/conf/GENERIC 1.135
sys/arch/sbmips/conf/GENERIC 1.61
sys/arch/sparc/conf/GENERIC 1.199
sys/arch/sparc64/conf/GENERIC 1.85
sys/arch/sun3/conf/GENERIC 1.138
sys/arch/vax/conf/GENERIC 1.157
sys/arch/x68k/conf/GENERIC 1.134
sys/arch/amiga/conf/GENERIC.in 1.59
sys/arch/sgimips/conf/GENERIC32_IP2x 1.66
sys/arch/sgimips/conf/GENERIC32_IP3x 1.63
sys/arch/sun3/conf/GENERIC3X 1.95
sys/arch/atari/conf/GENERIC.in 1.66

Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.62.2.2 03-Oct-2007  garbled Sync with HEAD
 1.62.2.1 26-Jun-2007  garbled Sync with HEAD.
 1.65.8.2 04-Nov-2007  jmcneill Sync with HEAD.
 1.65.8.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.65.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.65.2.1 07-Aug-2007  matt Sync with HEAD.
 1.66.6.1 13-Nov-2007  bouyer Sync with HEAD
 1.66.2.3 23-Mar-2008  matt sync with HEAD
 1.66.2.2 09-Jan-2008  matt sync with HEAD
 1.66.2.1 06-Nov-2007  matt sync with HEAD
 1.68.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.68.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.70.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.70.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.70.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.70.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.70.2.1 24-Mar-2008  keiichi sync with head.
 1.72.10.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.72.10.1 19-Oct-2008  haad Sync with HEAD.
 1.72.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.72.4.3 11-Aug-2010  yamt sync with head.
 1.72.4.2 11-Mar-2010  yamt sync with head
 1.72.4.1 04-May-2009  yamt sync with head.
 1.76.4.1 27-Dec-2008  snj branches: 1.76.4.1.4;
Pull up following revision(s) (requested by jmcneill in ticket #205):
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.79
add pseudo-device drvctl
 1.76.4.1.4.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.76.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.76.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.82.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.82.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.83.2.5 31-May-2011  rmind sync with head
 1.83.2.4 21-Apr-2011  rmind sync with head
 1.83.2.3 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.83.2.2 05-Mar-2011  rmind sync with head
 1.83.2.1 30-May-2010  rmind sync with head
 1.86.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.86.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.89.4.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.89.4.2 30-Oct-2012  yamt sync with head
 1.89.4.1 17-Apr-2012  yamt sync with head
 1.90.2.2 11-Mar-2012  mrg sync to latest -current
 1.90.2.1 18-Feb-2012  mrg merge to -current.
 1.93.2.4 03-Dec-2017  jdolecek update from HEAD
 1.93.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.93.2.2 23-Jun-2013  tls resync from head
 1.93.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.100.2.1 28-Aug-2013  rmind sync with head
 1.101.4.1 10-Aug-2014  tls Rebase.
 1.102.2.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.102.2.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.106.2.4 28-Aug-2017  skrll Sync with HEAD
 1.106.2.3 05-Feb-2017  skrll Sync with HEAD
 1.106.2.2 22-Apr-2016  skrll Sync with HEAD
 1.106.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.108.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.111.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.115.2.5 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.115.2.4 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.115.2.3 30-Sep-2018  pgoyette Ssync with HEAD
 1.115.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.115.2.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.116.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.116.2.1 10-Jun-2019  christos Sync with HEAD
 1.126.4.1 25-Jan-2020  ad Sync with head.
 1.3 18-Feb-2015  macallan cleanup compat options, disable COMPAT_LINUX for N32 kernels
 1.2 23-Aug-2014  dholland branches: 1.2.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.1 04-Jun-2014  macallan branches: 1.1.2; 1.1.6;
n32 kernel for IP2x
 1.1.6.3 03-Dec-2017  jdolecek update from HEAD
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 04-Jun-2014  tls file GENERIC64_32_IP2x was added on branch tls-maxphys on 2014-08-20 00:03:22 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 04-Jun-2014  tls file GENERIC64_32_IP2x was added on branch tls-earlyentropy on 2014-08-10 06:54:07 +0000
 1.2.2.1 06-Apr-2015  skrll Sync with HEAD
 1.3 18-Feb-2015  macallan cleanup compat options, disable COMPAT_LINUX for N32 kernels
 1.2 23-Aug-2014  dholland branches: 1.2.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.1 21-May-2014  macallan branches: 1.1.2; 1.1.6;
config goop for building 32bit sgimips64 kernels
works fine on my O2
( now to make the actual LP64 kernels work... )
 1.1.6.3 03-Dec-2017  jdolecek update from HEAD
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 21-May-2014  tls file GENERIC64_32_IP3x was added on branch tls-maxphys on 2014-08-20 00:03:22 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 21-May-2014  tls file GENERIC64_32_IP3x was added on branch tls-earlyentropy on 2014-08-10 06:54:07 +0000
 1.2.2.1 06-Apr-2015  skrll Sync with HEAD
 1.7 21-Jan-2021  nia add a commented out compat_ossaudio wherever there's compat_linux

requested by mrg
 1.6 14-Sep-2017  mrg branches: 1.6.16;
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.5 28-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 1.
 1.4 23-Aug-2014  dholland branches: 1.4.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.3 26-Apr-2011  joerg branches: 1.3.14;
Remove IRIX emulation
 1.2 14-Dec-2009  matt branches: 1.2.4; 1.2.6; 1.2.8;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.1 10-Sep-2009  matt branches: 1.1.2;
file GENERIC64_IP2x was initially added on branch matt-nb5-mips64.
 1.1.2.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.2.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 31-May-2011  rmind sync with head
 1.2.4.2 11-Mar-2010  yamt sync with head
 1.2.4.1 14-Dec-2009  yamt file GENERIC64_IP2x was added on branch yamt-nfs-mp on 2010-03-11 15:02:54 +0000
 1.3.14.1 03-Dec-2017  jdolecek update from HEAD
 1.4.2.1 28-Aug-2017  skrll Sync with HEAD
 1.6.16.1 03-Apr-2021  thorpej Sync with HEAD.
 1.7 21-Jan-2021  nia add a commented out compat_ossaudio wherever there's compat_linux

requested by mrg
 1.6 14-Sep-2017  mrg branches: 1.6.16;
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.5 28-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 1.
 1.4 23-Aug-2014  dholland branches: 1.4.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.3 26-Apr-2011  joerg branches: 1.3.14;
Remove IRIX emulation
 1.2 14-Dec-2009  matt branches: 1.2.4; 1.2.6; 1.2.8;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.1 10-Sep-2009  matt branches: 1.1.2;
file GENERIC64_IP3x was initially added on branch matt-nb5-mips64.
 1.1.2.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.2.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 31-May-2011  rmind sync with head
 1.2.4.2 11-Mar-2010  yamt sync with head
 1.2.4.1 14-Dec-2009  yamt file GENERIC64_IP3x was added on branch yamt-nfs-mp on 2010-03-11 15:02:54 +0000
 1.3.14.1 03-Dec-2017  jdolecek update from HEAD
 1.4.2.1 28-Aug-2017  skrll Sync with HEAD
 1.6.16.1 03-Apr-2021  thorpej Sync with HEAD.
 1.7 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.6 14-May-2002  pooka branches: 1.6.10;
include GENERIC, set TEXTADDR right
 1.5 13-May-2002  soren Make the build machinery happy for now.
 1.4 22-Nov-2001  soren branches: 1.4.2; 1.4.4;
Change the kernel load address offset from 512K to 420K, the Irix
convention for debugging kernels.
 1.3 22-Nov-2001  thorpej Move the kernel forward in memory, starting it 512K in from the
bottom of RAM. The bootloader is now loaded 2K in from the bottom
of RAM, so we need to make space for it.
 1.2 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.1 19-Nov-2001  soren Remove netbsd.high Ind* load address hack and use a separate
distribution GENERIC instead.
 1.4.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.4.1 22-Nov-2001  thorpej file GENERIC_INDY was added on branch kqueue on 2002-01-10 19:48:22 +0000
 1.4.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.4.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.2.1 22-Nov-2001  nathanw file GENERIC_INDY was added on branch nathanw_sa on 2002-01-08 00:27:25 +0000
 1.6.10.1 03-Aug-2004  skrll Sync with HEAD
 1.19 13-May-2002  soren Make the build machinery happy for now.
 1.18 08-May-2002  pooka Make INDY the Indy config file

Add DRAKEN as a model of what to do with the O2 (effectively the same
file as the old INDY)
 1.17 04-May-2002  pooka add mcclock
 1.16 25-Apr-2002  atatat 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.15 16-Apr-2002  wiz Remove last(?) traces of pmsi.
 1.14 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.13 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.12 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.11 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.10 22-Nov-2001  soren Change the kernel load address offset from 512K to 420K, the Irix
convention for debugging kernels.
 1.9 22-Nov-2001  thorpej Move the kernel forward in memory, starting it 512K in from the
bottom of RAM. The bootloader is now loaded 2K in from the bottom
of RAM, so we need to make space for it.
 1.8 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.7 14-May-2001  matt branches: 1.7.2; 1.7.8;
Add IP32
 1.6 14-Feb-2001  itojun branches: 1.6.2;
have rnd(4).
 1.5 15-Nov-2000  matt branches: 1.5.2;
Add MFS and vnd.
 1.4 04-Oct-2000  cgd the generic MIPS code doesn't even play at doing anything useful
with a MIPS4 option at this point -- all the code except for one single
spot is conditionalized with MIPS3. So, don't even pretend about
MIPS4 for now, until it all gets cleaned up.
 1.3 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.2 14-Jun-2000  soren branches: 1.2.4;
No real need for explicit stride on Mace ISA extension.
 1.1 14-Jun-2000  soren Initial commit.
 1.2.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 14-Jun-2000  minoura file INDY was added on branch minoura-xpg4dl on 2000-06-22 17:02:56 +0000
 1.5.2.4 12-Mar-2001  bouyer Sync with HEAD.
 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 15-Nov-2000  bouyer file INDY was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.6.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.8.6 20-Jun-2002  nathanw Catch up to -current.
 1.7.8.5 17-Apr-2002  nathanw Catch up to -current.
 1.7.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.7.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.8.1 14-May-2001  nathanw file INDY was added on branch nathanw_sa on 2002-01-08 00:27:25 +0000
 1.7.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.7.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2 13-Nov-2004  sekiya Due to space limitations, we can't embed a three-meg ramdisk installation image
into an IP12 kernel.

Remove; installation procedure will have to be GENERIC kernel using sysinst
from a NFS filesystem.
 1.1 13-Nov-2004  sekiya Add INSTALL and GENERIC kernel configuration wrappers for IP12 family.

Note that devices are defined in the IP2x configuration file; the IP12 is
99.5% the same as the IP20/22/24. Indeed, the only reason to have a separate
config file for IP12 is to sort out the MIPS1/MIPS3 locore bits.

To that end, the wrappers include the IP2x GENERIC config, undefine a few
directives, and define the appropriate bits for IP12.
 1.15 17-Apr-2025  christos bump
 1.14 27-Sep-2020  roy branches: 1.14.26;
vether: Add to kernel configurations

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.13 16-Aug-2020  jdolecek make COMPAT_LINUX option disabled by default

leave the option enabled only in amd64/i386 ALL kernels to make
sure it continues to be compilable also when included in kernel
 1.12 15-Jun-2020  tsutsui Follow ipfilter -> npf changes.
 1.11 07-Feb-2019  mrg bump ramdisk sizes to cope with GCC 7 bloat.
 1.10 02-Sep-2018  tsutsui Disable misc options to shrink an INSTALL kernel for IP2x.

The ARC BIOS on Indy seems to have ~8MB limit.
Fixes PR port-sgimips/53378 from Naruaki Etomi.

Should be pulled up to netbsd-7 and netbsd-8.
 1.9 04-Feb-2012  he branches: 1.9.22; 1.9.40; 1.9.46; 1.9.48;
Bump the install image size so that this builds again.
 1.8 06-Feb-2009  jym branches: 1.8.14; 1.8.18;
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.7 06-Feb-2009  jym Fix some whitespace and indentation. No functional change.
 1.6 01-Oct-2004  sekiya branches: 1.6.100; 1.6.108;
Move the ECOFF definition from the INSTALL kernel to the GENERIC kernel --
it's possible that someone might want to run an IP20 diskless.

Pointed out by simonb@
 1.5 01-Oct-2004  sekiya Create an ecoff kernel only if WANT_ECOFF="yes".

ECOFF kernels are really only useful for netbooting; our disk bootloader handles
ELF. Therefore, define WANT_ECOFF for INSTALL32_IP2x only.
 1.4 20-Nov-2003  sekiya branches: 1.4.4;
ip2x can't handle four-meg ramdisks; use a three-meg ramdisk instead and
compile the kernel with -Os.
 1.3 13-Nov-2003  sekiya typo in include directive.
 1.2 13-Nov-2003  sekiya Include proper GENERIC32 templates (mechanical edit).
 1.1 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.4.4.2 03-Aug-2004  skrll Sync with HEAD
 1.4.4.1 20-Nov-2003  skrll file INSTALL32_IP2x was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.6.108.1 03-Mar-2009  skrll Sync with HEAD.
 1.6.100.1 04-May-2009  yamt sync with head.
 1.8.18.1 18-Feb-2012  mrg merge to -current.
 1.8.14.1 17-Apr-2012  yamt sync with head
 1.9.48.1 10-Jun-2019  christos Sync with HEAD
 1.9.46.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.9.40.1 10-Sep-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #1017):

sys/arch/sgimips/conf/INSTALL32_IP2x: revision 1.10
sys/arch/sgimips/stand/boot/Makefile: revision 1.20
sys/arch/sgimips/sgimips/machdep.c: revision 1.146
sys/arch/sgimips/hpc/wdsc.c: revision 1.35
distrib/sgimips/instkernel/Makefile: revision 1.13

Disable misc options to shrink an INSTALL kernel for IP2x.

The ARC BIOS on Indy seems to have ~8MB limit.

Fixes PR port-sgimips/53378 from Naruaki Etomi.
Should be pulled up to netbsd-7 and netbsd-8.

-

Fix build failure without options DDB and with pseudo-device ksyms.
There is a typo for ksyms (NKSYMS vs NKSYM).

Also use consistent "#if NKSYMS" rather than "#if NKSYMS > 0" etc.
and add comments after corresponding #endif for readability.

Fixes PR port-sgimips/53521 from Naruaki Etomi.
Should be pulled up to (at least) netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generat ecoff for old machines.
objcopy(1) was used instead of elf2ecoff(1) since Makefile rev 1.9:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sgimips/stand/boot/Makefile#rev1.9
but it looks ELF binaries generated by recent binutils are too complicated
to convert them to ecoff for old machines by objcopy(1).

Reported by Naruaki Etomi in PR port-sgimips/53519.
Should be pulled up to at least netbsd-8.

-

Fix wdsc(4) probe failure on HPC1.5 machines (Indigo R3k/R4k, IP6/IP10/IP12).

The alignment adjustment code was removed in rev 1.36 for common
mips bus_space changes, but the code was not bus_space related
but used for uint32_t register acccess during probe.

Reported and tested by Naruaki Etomi in PR port-sgimips/53522.
Should be pulled up to netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generate ecoff kernel.

Reported by Naruaki Etomi in PR port-sgimips/53518.

Should be pulled up to netbsd-7 and netbsd-8.
 1.9.22.1 30-Oct-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #1637):

sys/arch/sgimips/conf/INSTALL32_IP2x: revision 1.10
sys/arch/sgimips/stand/boot/Makefile: revision 1.20
distrib/sgimips/instkernel/Makefile: revision 1.13

Disable misc options to shrink an INSTALL kernel for IP2x.

The ARC BIOS on Indy seems to have ~8MB limit.

Fixes PR port-sgimips/53378 from Naruaki Etomi.
Should be pulled up to netbsd-7 and netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generat ecoff for old machines.
objcopy(1) was used instead of elf2ecoff(1) since Makefile rev 1.9:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sgimips/stand/boot/Makefile#rev1.9

but it looks ELF binaries generated by recent binutils are too complicated
to convert them to ecoff for old machines by objcopy(1).

Reported by Naruaki Etomi in PR port-sgimips/53519.

Should be pulled up to at least netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generate ecoff kernel.

Reported by Naruaki Etomi in PR port-sgimips/53518.
Should be pulled up to netbsd-7 and netbsd-8.
 1.14.26.1 02-Aug-2025  perseant Sync with HEAD
 1.7 27-Apr-2019  sevan Skip CARP & Veriexec support to reduce size
 1.6 06-Feb-2009  jym branches: 1.6.66;
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.5 06-Feb-2009  jym Fix some whitespace and indentation. No functional change.
 1.4 15-Jan-2004  pooka branches: 1.4.4; 1.4.108; 1.4.116;
Remove historic remnant that treated the O2 load address as the
sgimips standard. Define it in the respective config file.
 1.3 13-Nov-2003  sekiya typo in include directive.
 1.2 13-Nov-2003  sekiya Include proper GENERIC32 templates (mechanical edit).
 1.1 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.4.116.1 03-Mar-2009  skrll Sync with HEAD.
 1.4.108.1 04-May-2009  yamt sync with head.
 1.4.4.2 03-Aug-2004  skrll Sync with HEAD
 1.4.4.1 15-Jan-2004  skrll file INSTALL32_IP3x was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.6.66.1 10-Jun-2019  christos Sync with HEAD
 1.4 07-Feb-2019  mrg bump ramdisk sizes to cope with GCC 7 bloat.
 1.3 09-Jun-2017  skrll branches: 1.3.6;
Align MEMORY_ROOT_DISK_SIZE with INSTALL32_IP2x
 1.2 14-Dec-2009  matt branches: 1.2.4; 1.2.24; 1.2.42; 1.2.58;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.1 10-Sep-2009  matt branches: 1.1.2;
file INSTALL64_IP2x was initially added on branch matt-nb5-mips64.
 1.1.2.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.2.58.1 10-Jun-2017  snj Pull up following revision(s) (requested by skrll in ticket #23):
sys/arch/sgimips/conf/INSTALL64_IP2x: revision 1.3
Align MEMORY_ROOT_DISK_SIZE with INSTALL32_IP2x
 1.2.42.1 28-Aug-2017  skrll Sync with HEAD
 1.2.24.1 03-Dec-2017  jdolecek update from HEAD
 1.2.4.2 11-Mar-2010  yamt sync with head
 1.2.4.1 14-Dec-2009  yamt file INSTALL64_IP2x was added on branch yamt-nfs-mp on 2010-03-11 15:02:54 +0000
 1.3.6.1 10-Jun-2019  christos Sync with HEAD
 1.2 14-Dec-2009  matt branches: 1.2.4;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.1 10-Sep-2009  matt branches: 1.1.2;
file INSTALL64_IP3x was initially added on branch matt-nb5-mips64.
 1.1.2.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.2.4.2 11-Mar-2010  yamt sync with head
 1.2.4.1 14-Dec-2009  yamt file INSTALL64_IP3x was added on branch yamt-nfs-mp on 2010-03-11 15:02:54 +0000
 1.4 03-Dec-2000  matt Start using a Makefile.mips. Use a combination of makeoptions and
Makefile.sgimips.inc which has sgimips specific stuff.
 1.3 02-Dec-2000  matt Need to add -EB for ASFLAGS as well. Don't use -EB in LINKFLAGS but add
-EB to LD so that libkern/libcompat get it as well.
 1.2 02-Dec-2000  matt Add -EB to make building kernel on LE systems easier.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 1.1.6.3 08-Dec-2000  bouyer 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 14-Jun-2000  bouyer file Makefile.sgimips was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file Makefile.sgimips was added on branch minoura-xpg4dl on 2000-06-22 17:02:56 +0000
 1.13 01-Jan-2019  christos ELF2ECOFF -> MIPS_ELF2ECOFF
 1.12 20-Feb-2011  matt branches: 1.12.54; 1.12.56;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.11 22-Dec-2006  rumble branches: 1.11.70; 1.11.76; 1.11.78;
Revert the change to using objcopy in 1.9. Our present objcopy solution
results in unbootable ecoff kernels ("malloc_type_attach: bad magic"
panic). Maybe this could be fixed with appropriate flags, but elf2ecoff
produces working ecoff kernels and ecoff bootloaders, which was the reason
for the switch in the first place.
 1.10 11-Dec-2005  christos branches: 1.10.20;
merge ktrace-lwp.
 1.9 28-Feb-2005  sekiya branches: 1.9.4;
Use objcopy instead of (broken) elf2ecoff to create ECOFF kernel. Suggested
by tsutsui@ on port-mips.
 1.8 01-Oct-2004  sekiya branches: 1.8.4; 1.8.6;
Create an ecoff kernel only if WANT_ECOFF="yes".

ECOFF kernels are really only useful for netbooting; our disk bootloader handles
ELF. Therefore, define WANT_ECOFF for INSTALL32_IP2x only.
 1.7 21-May-2002  rafal branches: 1.7.8; 1.7.12;
Turn kernels into ecoff as well by default.
 1.6 09-Dec-2001  atatat branches: 1.6.8;
Roll the rest of the ports over to the new MI kernel build machinery.
Any problems reported by testers have been fixed, and massive
cross-compiling of kernels has shown that any problems that remain
with actually building kernels are not related to this.
 1.5 19-Nov-2001  soren Remove netbsd.high Ind* load address hack and use a separate
distribution GENERIC instead.
 1.4 08-Oct-2001  simonb branches: 1.4.4;
Use ${KERNLDSCRIPT} instead of hard-coded ld script name.
 1.3 05-Oct-2001  pooka use kern.ldscript instead of kern.ldscript.be per new scheme
 1.2 07-Jun-2001  thorpej branches: 1.2.2; 1.2.4;
Pass -N to the linker, so that it will generate a single PT_LOAD
section (a'la OMAGIC).
 1.1 03-Dec-2000  matt branches: 1.1.2; 1.1.4;
Start using a Makefile.mips. Use a combination of makeoptions and
Makefile.sgimips.inc which has sgimips specific stuff.
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.1.2.1 03-Dec-2000  bouyer file Makefile.sgimips.inc was added on branch thorpej_scsipi on 2000-12-08 09:30:25 +0000
 1.2.4.1 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.2.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.4.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.4.1 08-Oct-2001  nathanw file Makefile.sgimips.inc was added on branch nathanw_sa on 2002-01-08 00:27:25 +0000
 1.6.8.1 30-May-2002  gehenna Catch up with -current.
 1.7.12.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.7.8.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.8.1 19-Oct-2004  skrll Sync with HEAD
 1.8.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.4.1 29-Apr-2005  kent sync with -current
 1.9.4.1 30-Dec-2006  yamt sync with head.
 1.10.20.1 12-Jan-2007  ad Sync with head.
 1.11.78.1 05-Mar-2011  bouyer Sync with HEAD
 1.11.76.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.70.1 05-Mar-2011  rmind sync with head
 1.12.56.1 10-Jun-2019  christos Sync with HEAD
 1.12.54.1 18-Jan-2019  pgoyette Synch with HEAD
 1.2 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.1 21-May-2002  rafal branches: 1.1.4; 1.1.6; 1.1.8; 1.1.14;
Add RAMDISK kernels for installation.
 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-May-2002  jdolecek file RAMDISK was added on branch kqueue on 2002-06-23 17:40:27 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 21-May-2002  nathanw file RAMDISK was added on branch nathanw_sa on 2002-06-20 03:40:46 +0000
 1.1.4.2 30-May-2002  gehenna Catch up with -current.
 1.1.4.1 21-May-2002  gehenna file RAMDISK was added on branch gehenna-devsw on 2002-05-30 15:35:38 +0000
 1.2 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.1 21-May-2002  rafal branches: 1.1.4; 1.1.6; 1.1.8; 1.1.14;
Add RAMDISK kernels for installation.
 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-May-2002  jdolecek file RAMDISK_INDY was added on branch kqueue on 2002-06-23 17:40:27 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 21-May-2002  nathanw file RAMDISK_INDY was added on branch nathanw_sa on 2002-06-20 03:40:46 +0000
 1.1.4.2 30-May-2002  gehenna Catch up with -current.
 1.1.4.1 21-May-2002  gehenna file RAMDISK_INDY was added on branch gehenna-devsw on 2002-05-30 15:35:40 +0000
 1.11 13-May-2002  soren Make the build machinery happy for now.
 1.10 25-Apr-2002  atatat 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.9 22-Nov-2001  soren Change the kernel load address offset from 512K to 420K, the Irix
convention for debugging kernels.
 1.8 22-Nov-2001  thorpej Move the kernel forward in memory, starting it 512K in from the
bottom of RAM. The bootloader is now loaded 2K in from the bottom
of RAM, so we need to make space for it.
 1.7 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.6 20-Nov-2001  lukem - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
 1.5 18-Nov-2001  thorpej Tweak for HPC autoconfig changes.
 1.4 14-Nov-2001  hubertf branches: 1.4.2;
add pseudo-device rnd - it's needed by sshd
 1.3 19-Aug-2001  wdk Add support for WD33C93 controller and assosiated SCSI devices, and enable
by default.
 1.2 07-Jul-2001  wdk branches: 1.2.2;
Add typical KGDB settings, and leave commented out.
 1.1 11-May-2001  thorpej branches: 1.1.2;
Rafal's Indigo2 kernel configuration.
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.4.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.4.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.2.1 14-Nov-2001  nathanw file TEAL was added on branch nathanw_sa on 2002-01-08 00:27:25 +0000
 1.54 23-Mar-2019  sevan Enable Bluetooth support.
usbdevices.config includes support for USB Bluetooth.
Tested on an o2 with a PCI USB adapter and Broadcom BCM20702A0 dongle.
 1.53 18-Feb-2015  macallan branches: 1.53.18;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.52 20-Jul-2014  alnsn branches: 1.52.4;
Include sljit files.
 1.51 02-Oct-2012  christos branches: 1.51.10;
move common/bus_dma/ -> dev/bus_dma/
 1.50 20-Feb-2011  matt branches: 1.50.4; 1.50.14;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.49 21-Aug-2009  thorpej branches: 1.49.4; 1.49.6; 1.49.8;
Use bus_dmamem_common.
 1.48 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.47 20-Feb-2008  drochner branches: 1.47.10; 1.47.18; 1.47.24;
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.46 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.45 17-Oct-2007  garbled branches: 1.45.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.44 15-Jul-2007  macallan branches: 1.44.8; 1.44.10;
make the delay()s and spl*()s in bus_space*() functions optional
( enable with options MACE_NEEDS_DELAYS )
mec apparently was the only device that really needed them and that's no
longer the case, at least on my O2.
 1.43 14-Apr-2007  macallan branches: 1.43.2;
also include files.rasops
 1.42 10-Apr-2007  macallan include files.wsfb
 1.41 16-Sep-2006  gdamore branches: 1.41.4; 1.41.6; 1.41.10; 1.41.12;
sgimips converted to timecounters. Systems that can do them get mips_cp0
based logic. We also use the common mips3_clock functions for those systems,
removing some port-specific code.

Tested by martin@.
 1.40 11-Dec-2005  christos branches: 1.40.20;
merge ktrace-lwp.
 1.39 11-Jul-2005  kiyohara ieee1394 import from FreeBSD.
 1.38 10-Apr-2004  pooka branches: 1.38.12;
build arcemu
 1.37 13-Mar-2004  bjh21 branches: 1.37.2;
Abstract the interface between pckbc(4), and the pckbd(4) and pms(4)
drivers that attach to it. This allows for other host interface chips
that use the same keyboards and mice, such as the ones in the ARM
IOMD20, ARM7500, and SA-1111. The PC-compatible driver is still
called pckbc(4), and the new abstraction layer is "pckbport", so the
child devices have moved from sys/dev/pckbc to sys/dev/pckbport, which
also contains some code shared between all host controllers. To avoid
incompatibility, pckbdreg.h is still installed in
/usr/include/dev/pckbc.

In theory, this shouldn't cause any behavioural changes in the drivers
concerned. Thy just use rather more function pointers than before. Tested
on i386 and (with a new host driver) acorn32. Compiled on several other
affected architectures.
 1.36 19-Jan-2004  sekiya Completely remove IP2X and IP32, which renders opt_machtype.h obsolete.
 1.35 19-Jan-2004  sekiya Attach int0 at mainbus (precedent being the ip32 CRIME device, which handled
interrupts and timer calibration yet is also attached at mainbus).

Introduce the INDY_R4600_CACHE config option, which more accurately describes
the code enabled by this option.

This renders #ifdef IPxx completely obsolete, thus we theoretically can unify
the GENERIC files if a workable load address relocation scheme can be found.
 1.34 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.33 18-Jan-2004  sekiya ip2x.c and ip32.c are no more.
 1.32 12-Jan-2004  sekiya Add pic attached at mainbus (for IP12).
 1.31 15-Dec-2003  sekiya Part two in the Great Renaming. ip22.c becomes ip2x.c, and all generic ip2x
routines become ip2x_*.
 1.30 15-Dec-2003  sekiya Change all IP22 preprocessor conditionals to IP2X preprocessor conditionals.

Part one of two -- part two will be renaming ip22_*() to ip2x_*().
 1.29 15-Dec-2003  sekiya Add ioc driver to IP2x config file, pull in ioc/files.ioc as well. Note that
IP2x now has blinkenlitzen.
 1.28 14-Dec-2003  sekiya Compile sgimips/ip[23]2.c iff the corresponding IP[23] is defined in the
config file.
 1.27 22-Nov-2003  sekiya Add ip20.c
 1.26 13-Nov-2003  sekiya Rationalize config file scheme. Discussed at length with rafal@, pooka@, soren@.
 1.25 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.24 15-Sep-2003  simonb Use common mips generic software interrupt routines.

Changes from Izumi Tsutsui, tested by Havard Eidnes.
 1.23 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.22 26-Oct-2002  jdolecek branches: 1.22.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.21 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.20 16-Apr-2002  thorpej branches: 1.20.2;
* Move the mii_bitbang attribute into dev/mii/files.mii
* Pull in dev/mii/files.mii from conf/files, rather than playing
the magic "files include order" dance in N machine-dependent
configuration definitions.
 1.19 13-Mar-2002  simonb All the mips ports had an identical procfs_machdep.c, so use a common
file under arch/mips/mips.
 1.18 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.17 25-Nov-2001  soren O2 RTC attachment, based on code from Antti Kantee.
 1.16 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.15 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.14 18-Nov-2001  thorpej zsc does not needs-count
 1.13 14-Nov-2001  thorpej branches: 1.13.2;
Merge the thorpej-mips-cache branch onto the trunk. This is an
overhaul of how caches are handled for NetBSD's MIPS ports.
 1.12 23-Sep-2001  manu branches: 1.12.2;
Moved COMPAT_LINUX config stuff from arch/sgimips to arch/mips, so that it's
available on all Mips ports.
 1.11 22-Sep-2001  manu config stuff for COMPAT_LINUX
 1.10 08-Jul-2001  thorpej branches: 1.10.2; 1.10.4;
Use sys/dev/arcbios.
 1.9 11-May-2001  thorpej Autoconfiguration glue changes for Indigo2/Indy support.
 1.8 17-Jan-2001  fvdl branches: 1.8.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.7 26-Nov-2000  ad lsu -> ld, by popular request.
 1.6 21-Nov-2000  soren Use dev/md_root.c.
 1.5 14-Nov-2000  pooka branches: 1.5.2;
add I2O to make config work again
 1.4 23-Oct-2000  ad Add `major' for lsu.
 1.3 29-Jun-2000  soren zs can be used on several busses, so define it here.
 1.2 29-Jun-2000  soren Uncomment HPC inclusion for now.
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file files.sgimips was added on branch minoura-xpg4dl on 2000-06-22 17:02:57 +0000
 1.5.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.5.2.4 08-Dec-2000  bouyer Sync with HEAD.
 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 14-Nov-2000  bouyer file files.sgimips was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.8.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.10.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.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.12.2.1 14-Nov-2001  thorpej Shuffle around the code that frobs the IP-22 L2 SysAD cache,
and add code (untested and not enabled yet) to actually enable
and flush this cache.

The code is really just a placeholder -- I need to find someone
that has a machine equipped with such a cache.
 1.13.2.6 11-Nov-2002  nathanw Catch up to -current
 1.13.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.13.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.13.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.13.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.13.2.1 14-Nov-2001  nathanw file files.sgimips was added on branch nathanw_sa on 2002-01-08 00:27:26 +0000
 1.20.2.2 17-May-2002  gehenna Remove old block majors list.
 1.20.2.1 16-May-2002  gehenna Include the list of block/character major numbers.
 1.22.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.22.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.6.1 03-Aug-2004  skrll Sync with HEAD
 1.37.2.1 23-Jul-2004  tron Pull up revision 1.38 (requested by rumble in ticket #682):
build arcemu
 1.38.12.5 27-Feb-2008  yamt sync with head.
 1.38.12.4 07-Dec-2007  yamt sync with head
 1.38.12.3 03-Sep-2007  yamt sync with head.
 1.38.12.2 30-Dec-2006  yamt sync with head.
 1.38.12.1 21-Jun-2006  yamt sync with head.
 1.40.20.1 18-Nov-2006  ad Sync with head.
 1.41.12.1 11-Jul-2007  mjf Sync with head.
 1.41.10.4 03-Dec-2007  ad Sync with HEAD.
 1.41.10.3 20-Aug-2007  ad Sync with HEAD.
 1.41.10.2 27-May-2007  ad Sync with head.
 1.41.10.1 10-Apr-2007  ad Sync with head.
 1.41.6.1 15-Apr-2007  yamt sync with head.
 1.41.4.1 05-Nov-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #1221):
sys/arch/sgimips/conf/files.sgimips: revision 1.44
sys/arch/sgimips/sgimips/bus.c: revision 1.50
make the delay()s and spl*()s in bus_space*() functions optional
( enable with options MACE_NEEDS_DELAYS )
mec apparently was the only device that really needed them and that's no
longer the case, at least on my O2.
 1.43.2.1 03-Oct-2007  garbled Sync with HEAD
 1.44.10.3 23-Mar-2008  matt sync with HEAD
 1.44.10.2 09-Jan-2008  matt sync with HEAD
 1.44.10.1 06-Nov-2007  matt sync with HEAD
 1.44.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.45.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.47.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.47.18.1 03-Mar-2009  skrll Sync with HEAD.
 1.47.10.2 16-Sep-2009  yamt sync with head
 1.47.10.1 04-May-2009  yamt sync with head.
 1.49.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.49.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.49.4.1 05-Mar-2011  rmind sync with head
 1.50.14.3 03-Dec-2017  jdolecek update from HEAD
 1.50.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.50.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.50.4.1 30-Oct-2012  yamt sync with head
 1.51.10.1 10-Aug-2014  tls Rebase.
 1.52.4.1 06-Apr-2015  skrll Sync with HEAD
 1.53.18.1 10-Jun-2019  christos Sync with HEAD
 1.34 29-Jun-2021  nia Remove uscanner(4) driver

This exists for compatibility with a Linux interface which was apparently
deprecated in Linux 2.6. There are various mailing list threads going
back to 2004 where the usefulness of this driver is discussed, but
the conclusion is that scanner software has all moved to using ugen(4)
instead, and enabling this driver will not help you scan things.
 1.33 04-Apr-2020  jdolecek branches: 1.33.8;
mark nsmb major obsolete
 1.32 29-Jan-2020  maya remove urio(4), a driver for the Rio500 MP3 player.

At this point it is highly unlikely this 1999 device still has users,
but it still comes up in the context of maxv's USB-fuzzing (and any device
could pretend to be a urio(4)), so it's best to get rid of it.

Renamed all major entries to obsolete, as was done in previous removals.

This still requires an update to sanitizers, but they're located in
"external", perhaps it should be first committed upstream?

Proposed on tech-kern a month ago.
 1.31 28-Jan-2019  dholland branches: 1.31.6;
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.30 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.29 23-Sep-2018  maxv Remove ISDN from the kernel. It has remained unmaintained for a long time,
is of poor quality, and is now an obstacle to MP-ification. It was removed
ten years ago from FreeBSD for the same reason.

This retires a big user of the mbuf API, and will ease maintenance of the
kernel.
 1.28 23-Apr-2015  pgoyette branches: 1.28.16; 1.28.18;
Update device dependency information - the sysmon major device now depends on the sysmon module itself, not on the individual components.
 1.27 30-Jun-2011  wiz branches: 1.27.12; 1.27.30;
dependant -> dependent
 1.26 26-Apr-2011  joerg Remove IRIX emulation
 1.25 06-Mar-2010  plunky branches: 1.25.2; 1.25.4;
use a MI major number for uhso(4) driver
(requested by mrg)
 1.24 06-Mar-2010  plunky add major device for usho(4) driver
 1.23 14-May-2009  macallan add major number for sysmon
 1.22 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.21 12-Nov-2008  ad branches: 1.21.4;
Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.20 31-Dec-2007  ad branches: 1.20.6; 1.20.10; 1.20.16; 1.20.18; 1.20.20; 1.20.24;
Remove systrace. Ok core@.
 1.19 24-Nov-2006  wiz branches: 1.19.28; 1.19.34; 1.19.42;
s/independant/independent/, from Zafer.
 1.18 11-Dec-2005  christos branches: 1.18.20; 1.18.22;
merge ktrace-lwp.
 1.17 17-Sep-2005  yamt make VMSWAP optional again.
 1.16 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.15 30-Jul-2005  yamt defflag VMSWAP.
 1.14 10-May-2005  jdolecek branches: 1.14.2;
assign major for nsmb(4)
 1.13 14-Jul-2004  tsutsui Add device-major for lpt.
 1.12 10-Dec-2003  jmc Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
 1.11 24-Oct-2003  jdolecek add major for 'ses' for archs which have the other scsi devices
 1.10 10-Oct-2003  jdolecek reassing majors for crypto and pf to use the newly defined MI major
range
 1.9 10-Oct-2003  jdolecek update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
 1.8 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.7 22-Aug-2003  itojun create /dev/crypto
 1.6 27-Jul-2003  itojun reserve cdev major # for PF. ok'ed by technical-exec
 1.5 25-Apr-2003  ragge branches: 1.5.2;
Add ksyms device major.
 1.4 19-Jan-2003  rafal Add pci/usb/audio devices; from Chris Sekiya.
 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.sgimips 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.sgimips was added on branch nathanw_sa on 2002-09-17 21:17:19 +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.sgimips was added on branch kqueue on 2002-10-10 18:35:36 +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.14.2.3 21-Jan-2008  yamt sync with head
 1.14.2.2 30-Dec-2006  yamt sync with head.
 1.14.2.1 21-Jun-2006  yamt sync with head.
 1.18.22.1 10-Dec-2006  yamt sync with head.
 1.18.20.1 12-Jan-2007  ad Sync with head.
 1.19.42.1 02-Jan-2008  bouyer Sync with HEAD
 1.19.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.19.28.1 09-Jan-2008  matt sync with HEAD
 1.20.24.1 29-Dec-2010  matt Merge changes from netbsd-5.
 1.20.20.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #973):
sys/arch/sgimips/conf/majors.sgimips: revision 1.23
add major number for sysmon
 1.20.18.2 03-Mar-2009  skrll Sync with HEAD.
 1.20.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.20.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.20.10.2 16-May-2009  yamt sync with head
 1.20.10.1 04-May-2009  yamt sync with head.
 1.20.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.21.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.25.2.1 31-May-2011  rmind sync with head
 1.27.30.1 06-Jun-2015  skrll Sync with HEAD
 1.27.12.1 03-Dec-2017  jdolecek update from HEAD
 1.28.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.28.18.1 10-Jun-2019  christos Sync with HEAD
 1.28.16.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.28.16.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.31.6.1 29-Feb-2020  ad Sync with head.
 1.33.8.1 01-Aug-2021  thorpej Sync with HEAD.
 1.18 20-Feb-2009  sekiya Pull in Atheros HAL.
 1.17 11-Dec-2005  christos branches: 1.17.78; 1.17.86; 1.17.92;
merge ktrace-lwp.
 1.16 17-Sep-2005  yamt include "conf/std".
 1.15 15-Jan-2004  pooka branches: 1.15.16;
Remove historic remnant that treated the O2 load address as the
sgimips standard. Define it in the respective config file.
 1.14 30-Aug-2003  chs add "makeoptions MACHINE_ARCH=..." in std.* for mips ports
where it is constant (to ease cross-building).
 1.13 09-Dec-2002  simonb branches: 1.13.6;
Remove the explicit `makeoptions MACHINE_ARCH="mipse{b,l}"' for kernel
builds and use the endianness of the toolchain being used to determine
the endianness of the kernel.
 1.12 22-Nov-2001  soren Change the kernel load address offset from 512K to 420K, the Irix
convention for debugging kernels.
 1.11 22-Nov-2001  thorpej Move the kernel forward in memory, starting it 512K in from the
bottom of RAM. The bootloader is now loaded 2K in from the bottom
of RAM, so we need to make space for it.
 1.10 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.9 19-Nov-2001  soren Remove driver options that don't belong in std.sgimips.
 1.8 23-Oct-2001  thorpej branches: 1.8.4;
For MIPS kernel Makefiles, don't set ENDIAN in std.${MACHINE}. Instead,
explicitly set MACHINE_ARCH to the appropriate thing. Makefile.mips will
then set all of the internal variables it needs to accordingly.
 1.7 11-May-2001  thorpej branches: 1.7.2;
Delete __NO_SOFT_SERIAL_INTERRUPT.
 1.6 03-Dec-2000  matt branches: 1.6.2;
Revert back to a machinearch (really cputype) of mips. Put ENDIAN back.
 1.5 03-Dec-2000  matt Change arch from mips to mipsel/mipseb as appropriate. Nuke the ENDIAN
makeoption. Key off MACHINE_ARCH for adding -EB/-EL to CFLAGS/AFLAGS/LD/
LINKFLAGS.
 1.4 03-Dec-2000  matt Start using a Makefile.mips. Use a combination of makeoptions and
Makefile.sgimips.inc which has sgimips specific stuff.
 1.3 08-Aug-2000  soren branches: 1.3.2;
Update for counter interrupt PSL change.
 1.2 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.1 14-Jun-2000  soren branches: 1.1.2; 1.1.4;
Initial commit.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file std.sgimips was added on branch minoura-xpg4dl on 2000-06-22 17:02:57 +0000
 1.1.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.3.2.3 08-Dec-2000  bouyer Sync 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 08-Aug-2000  bouyer file std.sgimips was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.6.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.4.3 11-Dec-2002  thorpej Sync with HEAD.
 1.8.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.4.1 23-Oct-2001  nathanw file std.sgimips was added on branch nathanw_sa on 2002-01-08 00:27:26 +0000
 1.13.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.6.1 03-Aug-2004  skrll Sync with HEAD
 1.15.16.1 21-Jun-2006  yamt sync with head.
 1.17.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.17.78.1 04-May-2009  yamt sync with head.
 1.3 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.2 14-Dec-2009  matt branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.1 10-Sep-2009  matt branches: 1.1.2;
file std.sgimips64 was initially added on branch matt-nb5-mips64.
 1.1.2.2 12-Sep-2009  matt Add COMPAT_NETBSD32 support.
 1.1.2.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.2.10.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 05-Mar-2011  rmind sync with head
 1.2.4.2 11-Mar-2010  yamt sync with head
 1.2.4.1 14-Dec-2009  yamt file std.sgimips64 was added on branch yamt-nfs-mp on 2010-03-11 15:02:54 +0000
 1.5 16-Aug-2020  jdolecek make COMPAT_LINUX option disabled by default

leave the option enabled only in amd64/i386 ALL kernels to make
sure it continues to be compilable also when included in kernel
 1.4 18-Feb-2015  macallan cleanup compat options, disable COMPAT_LINUX for N32 kernels
 1.3 04-Jun-2014  macallan branches: 1.3.2; 1.3.6; 1.3.8;
fix comments
 1.2 31-May-2014  macallan we don't need or want COMPAT_NETBSD32 in a 32bit kernel
should cure pkgsrc MACHINE_ARCH mismatches
 1.1 21-May-2014  macallan config goop for building 32bit sgimips64 kernels
works fine on my O2
( now to make the actual LP64 kernels work... )
 1.3.8.1 06-Apr-2015  skrll Sync with HEAD
 1.3.6.3 03-Dec-2017  jdolecek update from HEAD
 1.3.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 04-Jun-2014  tls file std.sgimips64_32 was added on branch tls-maxphys on 2014-08-20 00:03:22 +0000
 1.3.2.2 10-Aug-2014  tls Rebase.
 1.3.2.1 04-Jun-2014  tls file std.sgimips64_32 was added on branch tls-earlyentropy on 2014-08-10 06:54:07 +0000
 1.1 25-Nov-2008  he branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12; 1.1.14;
Don't be lazy and let one directory's Makefile install an include
file from another directory, as that only causes problems with
mtree later on when encountering the /.. path component. Instead,
descend into dev/ and use the Makefile there to install dev/crmfbreg.h
in the appropriate directory.
 1.1.14.2 04-May-2009  yamt sync with head.
 1.1.14.1 25-Nov-2008  yamt file Makefile was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.12.2 26-Feb-2009  snj Pull up following revision(s) (requested by macallan in ticket #523):
sys/arch/sgimips/Makefile: revision 1.7
sys/arch/sgimips/dev/Makefile: revision 1.1
sys/arch/sgimips/include/Makefile: revision 1.19
Don't be lazy and let one directory's Makefile install an include
file from another directory, as that only causes problems with
mtree later on when encountering the /.. path component. Instead,
descend into dev/ and use the Makefile there to install dev/crmfbreg.h
in the appropriate directory.
 1.1.12.1 25-Nov-2008  snj file Makefile was added on branch netbsd-5 on 2009-02-26 07:31:58 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 25-Nov-2008  skrll file Makefile was added on branch nick-hppapmap on 2009-01-19 13:16:42 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 25-Nov-2008  mjf file Makefile was added on branch mjf-devfs2 on 2009-01-17 13:28:28 +0000
 1.1.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1 25-Nov-2008  haad file Makefile was added on branch haad-dm on 2008-12-13 01:13:25 +0000
 1.12 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.11 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.10 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 06-Jan-2003  rafal branches: 1.8.2;
Improve the interrupt code somewhat by having callers of xxx_intr_establish
pass in an interrupt handle (which is currently to the CRIME interrupt the
device is attached to) so the interrupt handlers know which device was the
one looking for attention.

While here, fix up PCI interrupt routing for both the on-board devices and
the PCI slots -- even though there is only one PCI slot in the chasis, the
hardware can accomodate up to three and provides an interrupt mapping for
all the PCI interrupt pins for both the internal SCSI & PCI slot and the
two "extra" slots.
 1.7 03-Jan-2003  rafal Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 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 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 08-Oct-2001  pooka branches: 1.2.4;
read dbaud from ARCS and use that for com rate, not hardcoded 38400
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8; 1.1.10;
A start at O2 support..
 1.1.10.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.10.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 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 14-Jun-2000  bouyer file com_mace.c was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file com_mace.c was added on branch minoura-xpg4dl on 2000-06-22 17:02:57 +0000
 1.2.4.4 07-Jan-2003  thorpej Sync with HEAD.
 1.2.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.1 08-Oct-2001  nathanw file com_mace.c was added on branch nathanw_sa on 2002-04-01 07:42:17 +0000
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.39 26-Apr-2021  mrg if ddb is enabled set cpu_reset_address to crime_reboot.
'mach reset' works from ddb now.
 1.38 18-Feb-2015  macallan branches: 1.38.34;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.37 17-May-2014  mrg branches: 1.37.4;
split crime_bus_reset() into crime_{cpu,mem}_reset() and only reset
the cpu or the memory upon either error, not both.

seems to make my O2 slightly less likely to hang, and matches what
the linux crime driver does.
 1.36 18-Aug-2011  macallan branches: 1.36.12; 1.36.16; 1.36.26;
device_t-ify
 1.35 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.34 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.33 08-Aug-2008  tsutsui branches: 1.33.12; 1.33.16; 1.33.22; 1.33.24;
Misc cosmetics:
- some KNF and ANSIfy
- use uintNN_t types
- remove a redundant declaration
- use __func__ to print a function name
- use PRIu64 to print uint64_t
- wrap long lines
 1.32 07-Aug-2008  tsutsui In crime_attach(), call crime_watchdog_disable() rather than
writing zero to the CRIME registers implicitly.
 1.31 07-Aug-2008  tsutsui Fix a typo so that the crimedog is actually shut up.
 1.30 03-Aug-2008  tsutsui - replace some mysterious magic numbers in CPU clock measurement code
with some more meaningful expressions
- compare counter values in 100ms rather than 2ms
- check CPU_MIPS_DOUBLE_COUNT in mips_cpu_flags explicitly
 1.29 26-May-2008  tsutsui branches: 1.29.4;
Remove all initialization of obsolete ci_divisor_recip in
mips struct cpu_info and related macroes.
The member was prepared for a hack in MD microtime(9) implementation
but it has been superseded by MI timecounter(9).
 1.28 09-Jan-2008  wiz branches: 1.28.6; 1.28.8; 1.28.10; 1.28.12;
Fix typo in macro name and comments.
 1.27 17-Oct-2007  garbled branches: 1.27.2; 1.27.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.26 26-Sep-2007  macallan add crime_reboot()
 1.25 17-May-2007  yamt branches: 1.25.8; 1.25.10; 1.25.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.24 16-Apr-2007  jmcneill branches: 1.24.2;
Fix crime_intr so intr handlers registers w/ crime_intr_establish actually
get called. "seems more right to me" mrg@
 1.23 15-Apr-2007  jmcneill Disable the CRIME watchdog for now; looks like we can't keep up with it
under load. With this patch, my O2 is finally running stable.
 1.22 10-Dec-2005  tsutsui branches: 1.22.26; 1.22.30; 1.22.32;
Reset and disable watchdog explicitly in crime_attach().
 1.21 18-Oct-2005  tsutsui TAB/space cleanup.
 1.20 03-Jun-2005  martin branches: 1.20.2;
Avoid shadow warnings
 1.19 06-Sep-2004  sekiya Use the mace interrupt handler for PCI interrupts.

From KIYOHARA Takashi
 1.18 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.17 18-Jan-2004  sekiya Finish moving code between ip2x.c and ip3x.c to imc.c and crime.c.
 1.16 13-Jan-2004  sekiya Assign memory controller-dependent watchdog reset functions to
platform.watchdog_reset.
 1.15 12-Jan-2004  sekiya CRIME revision 1.1 has a bug that affects PIO operations to/from the MACE.
The recommended workaround is a 5-10ms delay before and after accesses.
Therefore, move the affected bus_space_* operations from bus.h to bus.c
and special-case MACE accesses.

CRIME accesses are not affected, so introduce SGIMIPS_BUS_SPACE_CRIME and
use it as the CRIME tag.

My ip32 seems a little bit happier with this change, and my ip22 didn't
notice the change.
 1.14 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.13 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 10-Jan-2003  rafal branches: 1.11.2;
Simplify CRIME rev. calculation (we don't appear to need the low nibble).
 1.10 06-Jan-2003  rafal Improve the interrupt code somewhat by having callers of xxx_intr_establish
pass in an interrupt handle (which is currently to the CRIME interrupt the
device is attached to) so the interrupt handlers know which device was the
one looking for attention.

While here, fix up PCI interrupt routing for both the on-board devices and
the PCI slots -- even though there is only one PCI slot in the chasis, the
hardware can accomodate up to three and provides an interrupt mapping for
all the PCI interrupt pins for both the internal SCSI & PCI slot and the
two "extra" slots.
 1.9 03-Jan-2003  rafal Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 1.8 02-Oct-2002  thorpej 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 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.4 08-Jul-2001  thorpej branches: 1.4.2; 1.4.8;
- Use the identifier strings that are fetched by the MI ARC BIOS
code.
- Garbage-collect some non-useful stuff from the mainbus_attach_args.
 1.3 11-May-2001  thorpej Get the major number of the CRIME properly.

From Rafal K. Boni.
 1.2 29-Jun-2000  soren branches: 1.2.2; 1.2.4;
Move a few things from ip32.c.
 1.1 14-Jun-2000  soren branches: 1.1.4;
A start at O2 support..
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file crime.c was added on branch minoura-xpg4dl on 2000-06-22 17:02:58 +0000
 1.2.4.1 21-Jun-2001  nathanw Catch up 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 29-Jun-2000  bouyer file crime.c was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.4.8.5 15-Jan-2003  thorpej Sync with HEAD.
 1.4.8.4 07-Jan-2003  thorpej Sync with HEAD.
 1.4.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.4.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.8.1 08-Jul-2001  nathanw file crime.c was added on branch nathanw_sa on 2002-04-01 07:42:17 +0000
 1.4.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.4.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.11.2.5 11-Dec-2005  christos Sync with head.
 1.11.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.20.2.4 21-Jan-2008  yamt sync with head
 1.20.2.3 27-Oct-2007  yamt sync with head.
 1.20.2.2 03-Sep-2007  yamt sync with head.
 1.20.2.1 21-Jun-2006  yamt sync with head.
 1.22.32.1 11-Jul-2007  mjf Sync with head.
 1.22.30.2 09-Oct-2007  ad Sync with head.
 1.22.30.1 27-May-2007  ad Sync with head.
 1.22.26.3 07-May-2007  yamt sync with head.
 1.22.26.2 19-Apr-2007  ad Compile fixes.
 1.22.26.1 15-Apr-2007  yamt sync with head.
 1.24.2.2 03-Oct-2007  garbled Sync with HEAD
 1.24.2.1 22-May-2007  matt Update to HEAD.
 1.25.12.1 06-Oct-2007  yamt sync with head.
 1.25.10.2 23-Mar-2008  matt sync with HEAD
 1.25.10.1 06-Nov-2007  matt sync with HEAD
 1.25.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.27.8.1 10-Jan-2008  bouyer Sync with HEAD
 1.27.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.28.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.28.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.28.10.1 04-May-2009  yamt sync with head.
 1.28.8.1 04-Jun-2008  yamt sync with head
 1.28.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.28.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.29.4.1 19-Oct-2008  haad Sync with HEAD.
 1.33.24.1 05-Mar-2011  bouyer Sync with HEAD
 1.33.22.1 06-Jun-2011  jruoho Sync with HEAD.
 1.33.16.1 05-Mar-2011  rmind sync with head
 1.33.12.2 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.33.12.1 20-Jan-2010  matt Adjust things to the new world order.
 1.36.26.1 10-Aug-2014  tls Rebase.
 1.36.16.1 18-May-2014  rmind sync with head
 1.36.12.2 03-Dec-2017  jdolecek update from HEAD
 1.36.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.37.4.1 06-Apr-2015  skrll Sync with HEAD
 1.38.34.1 13-May-2021  thorpej Sync with HEAD.
 1.11 10-Nov-2021  msaitoh s/endianess/endianness/
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.8 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.7 04-Oct-2003  tsutsui TAB/space cleanup.
 1.6 10-Jan-2003  rafal branches: 1.6.2;
Simplify CRIME rev. calculation (we don't appear to need the low nibble).
 1.5 28-Dec-2002  pooka add timer calibration

from Chris Sekiya
 1.4 23-Dec-2002  pooka CRIME register definitions

from Chris Sekiya
 1.3 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 18-Nov-2000  soren branches: 1.2.2; 1.2.6; 1.2.10;
Some CRIME definitions.
 1.1 14-Jun-2000  soren branches: 1.1.4;
A start at O2 support..
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file crimereg.h was added on branch minoura-xpg4dl on 2000-06-22 17:02:58 +0000
 1.2.10.3 15-Jan-2003  thorpej Sync with HEAD.
 1.2.10.2 29-Dec-2002  thorpej Sync with HEAD.
 1.2.10.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.6.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.3 22-Nov-2000  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 18-Nov-2000  bouyer file crimereg.h was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9 18-Aug-2011  macallan device_t-ify
 1.8 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.7 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.6 26-Sep-2007  macallan add crime_reboot()
 1.5 11-Dec-2005  christos branches: 1.5.30; 1.5.38; 1.5.48; 1.5.50; 1.5.52;
merge ktrace-lwp.
 1.4 06-Sep-2004  sekiya branches: 1.4.12;
Use the mace interrupt handler for PCI interrupts.

From KIYOHARA Takashi
 1.3 18-Jan-2004  sekiya branches: 1.3.4;
Finish moving code between ip2x.c and ip3x.c to imc.c and crime.c.
 1.2 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.1 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 18-Jan-2004  skrll file crimevar.h was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.4.12.1 27-Oct-2007  yamt sync with head.
 1.5.52.1 06-Oct-2007  yamt sync with head.
 1.5.50.1 06-Nov-2007  matt sync with HEAD
 1.5.48.1 02-Oct-2007  joerg Sync with HEAD.
 1.5.38.1 03-Oct-2007  garbled Sync with HEAD
 1.5.30.1 09-Oct-2007  ad Sync with head.
 1.50 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.49 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.48 24-Apr-2021  thorpej branches: 1.48.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.47 27-Dec-2019  msaitoh branches: 1.47.10;
s/suport/support/
 1.46 22-Dec-2019  thorpej Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().
 1.45 17-Mar-2018  jmcneill branches: 1.45.2;
Add support for overriding the video mode by setting an ARCS environment
variable.

If the "crmfb_mode" environment variable is set, treat it as a mode
string in the form WIDTHxHEIGHT[@REFRESH] and generate monitor timings
using the VESA GTF formula. If set, this overrides the EDID preferred
mode.
 1.44 19-May-2017  macallan branches: 1.44.2; 1.44.8;
enable font loading / screen resizing
 1.43 14-Feb-2016  dholland Remove extra stray break missed by Christos when committing PR 50783.
 1.42 08-Feb-2016  christos PR/50783: David Binderman: Indent switch properly, add missing break.
 1.41 23-Sep-2015  macallan no need to set RI_CLEAR - we do our own clearing and rasops assumes a linear
framebuffer anyway. Now we can get away with leaving ri_bits at NULL where it
belongs on this hardware.
 1.40 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.39 20-Jan-2015  macallan - remove scratch area, it's been unused since we're drawing characters by
hardware
- don't sync the rendering engine unless we have to, watch FIFO levels
instead
- support anti-aliased fonts and let the drawing engine do all the work
 1.38 02-Sep-2014  macallan branches: 1.38.2;
support ioctl() WSDISPLAYIO_SVIDEO, _GVIDEO and _GET_EDID
now xf86-video-crime can actually turn the monitor off
 1.37 16-Dec-2013  mrg - remove unused variables
- use (void) when we don't care about the return value
 1.36 11-Jan-2012  macallan branches: 1.36.6; 1.36.10;
use rasops_init(0,0)
 1.35 01-Jul-2011  dyoung branches: 1.35.2; 1.35.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.34 17-May-2011  macallan add support for running the console in more than 8 bit
Now modes like 1680x1050 work. The hardware requires a stride of a multiple
of 32 bytes, with 1680 this requires 16bit colour.
 1.33 13-Apr-2011  plunky use PRIx64 for printing 64-bit values
 1.32 07-Apr-2011  macallan add mode setting support
If we find a monitor via DDC we switch to its preferred mode if it reports one,
otherwise stick with whatever the firmware set up.
 1.31 04-Apr-2011  macallan remove some old debug code
 1.30 31-Mar-2011  macallan add DDC2 support. Not too useful yet.
 1.29 30-Mar-2011  macallan device_t-ify, use aprint_*_dev() where appropriate
 1.28 01-Mar-2011  macallan use hardware to draw characters, while there use vcons_replay_msgbuf()
 1.27 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.26 30-Jul-2008  tsutsui branches: 1.26.16; 1.26.22; 1.26.24;
Add a BUS_DMASYNC_PREWRITE call against tile's DMA address descriptors.
Fixes mangled screen on recent kernels.
Tested on my R5K IP32 and on R10K IP32 by Jorge Acereda Macia on port-sgimips.
 1.25 08-May-2008  jmcneill branches: 1.25.2; 1.25.4;
Use 2-clause license.
 1.24 18-Mar-2008  jmcneill branches: 1.24.2; 1.24.4; 1.24.6;
Remove debug printf: ``so we need 10 x 8 tiles -> 00500000''
 1.23 15-Mar-2008  jmcneill Swap red and blue for 8bpp paletted mode.
 1.22 02-Mar-2008  macallan allow userland to map all video memory, not just the visible part
 1.21 01-Mar-2008  macallan allocate a linear buffer, don't smoke crack when setting up the engine's TLBs
 1.20 18-Feb-2008  macallan branches: 1.20.2; 1.20.6;
correct accidentially committed garbage (what the hell... )
 1.19 18-Feb-2008  macallan correct typo
 1.18 18-Feb-2008  macallan avoid unnecessary writes to the MTE's direction registers
 1.17 17-Feb-2008  macallan use MTE for rectangle filling as well
TODO: figure out why the MTE freaks out when used for character drawing
 1.16 17-Feb-2008  macallan adjust some register names, also use MTE for scrolling down
 1.15 17-Feb-2008  macallan use the memory transfer engine for scrolling when possible
currently that's only for scrolling upwards but the speedup should be very
noticeable
TODO: use MTE for erase rasops, figure out how to control the MTEs direction
 1.14 10-Feb-2008  macallan bunch of minor fixes:
- use default colour when clearing the screen on attach
- sprinkle some break; so we no longer panic in 32bit colour
- allow userland to mmap() engine registers but not TLBs
- get rid of a delay() in crmfb_wait_idle()
- use aprint_*()
 1.13 06-Feb-2008  macallan get rid of some leftover debugging cruft
 1.12 05-Feb-2008  macallan update (c) sections
 1.11 05-Feb-2008  macallan add hardware acceleration for scrolling and clearing.
The framebuffer is now run in tiled mode so we can use the rendering engine
which means X is broken for now.
This needs more testing.
 1.10 02-Feb-2008  sekiya Allow sync-on-green to be controlled by ARCS environment variable "SyncOnGreen".

Set to anything starting with the letter 'n' to disable sync-on-green, set to
anything else or leave undefined to keep default behavior.
 1.9 02-Dec-2007  jmcneill CRMFB_VT_VCMAP and CRMFB_VT_HCMAP register definitions were transposed.
From jsing@openbsd in private mail.
 1.8 17-Oct-2007  garbled branches: 1.8.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.7 26-Jul-2007  macallan branches: 1.7.4; 1.7.6; 1.7.8;
- move register definitions to crmfbreg.h
- identify as WSDISPLAY_TYPE_CRIME
- always claim we're 32bit
- switch to 32bit colour in WSDISPLAYIO_MODE_MAPPED, switch back to 8bit
in WSDISPLAYIO_MODE_EMUL
- restore palette, turn off the cursor when switching back to console mode
- add a few delay()s, hopefully that will deal with occasional messed up
video timings *fingers crossed*
 1.6 15-Jul-2007  macallan branches: 1.6.2; 1.6.4;
add hardware cursor support
 1.5 15-Apr-2007  jmcneill branches: 1.5.2; 1.5.4; 1.5.6;
We don't support WSDISPLAYIO_[SG]VIDEO, so don't try to hide it.
 1.4 14-Apr-2007  martin branches: 1.4.2;
Avoid crashing if booting via serial console
 1.3 13-Apr-2007  jmcneill Add shadow framebuffer support; scrolling the screen still isn't great,
but it's noticeably better now than it was before.
 1.2 12-Apr-2007  jmcneill Don't claim to be the console if we're supposed to be using a serial
console. While we're here, save a few MB of RAM by properly calculating
the framebuffer size based on the selected video mode.
 1.1 12-Apr-2007  jmcneill Add crmfb, a framebuffer console driver for the onboard O2 video (SGI-CRM)
 1.4.2.3 07-May-2007  yamt sync with head.
 1.4.2.2 15-Apr-2007  yamt sync with head.
 1.4.2.1 14-Apr-2007  yamt file crmfb.c was added on branch yamt-idlelwp on 2007-04-15 16:02:54 +0000
 1.5.6.2 11-Jul-2007  mjf Sync with head.
 1.5.6.1 15-Apr-2007  mjf file crmfb.c was added on branch mjf-ufs-trans on 2007-07-11 20:01:40 +0000
 1.5.4.4 03-Dec-2007  ad Sync with HEAD.
 1.5.4.3 20-Aug-2007  ad Sync with HEAD.
 1.5.4.2 09-Jun-2007  ad Sync with head.
 1.5.4.1 15-Apr-2007  ad file crmfb.c was added on branch vmlocking on 2007-06-09 21:37:00 +0000
 1.5.2.1 03-Oct-2007  garbled Sync with HEAD
 1.6.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.6.2.1 07-Aug-2007  matt Sync with HEAD.
 1.7.8.8 24-Mar-2008  yamt sync with head.
 1.7.8.7 17-Mar-2008  yamt sync with head.
 1.7.8.6 27-Feb-2008  yamt sync with head.
 1.7.8.5 11-Feb-2008  yamt sync with head.
 1.7.8.4 04-Feb-2008  yamt sync with head.
 1.7.8.3 07-Dec-2007  yamt sync with head
 1.7.8.2 03-Sep-2007  yamt sync with head.
 1.7.8.1 26-Jul-2007  yamt file crmfb.c was added on branch yamt-lazymbuf on 2007-09-03 14:29:14 +0000
 1.7.6.3 23-Mar-2008  matt sync with HEAD
 1.7.6.2 09-Jan-2008  matt sync with HEAD
 1.7.6.1 06-Nov-2007  matt sync with HEAD
 1.7.4.1 03-Dec-2007  joerg Sync with HEAD.
 1.8.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.8.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.20.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.20.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.20.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.20.2.1 24-Mar-2008  keiichi sync with head.
 1.24.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.24.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.24.4.2 04-May-2009  yamt sync with head.
 1.24.4.1 16-May-2008  yamt sync with head.
 1.24.2.1 18-May-2008  yamt sync with head.
 1.25.4.1 19-Oct-2008  haad Sync with HEAD.
 1.25.2.1 31-Jul-2008  simonb Sync with head.
 1.26.24.1 05-Mar-2011  bouyer Sync with HEAD
 1.26.22.1 06-Jun-2011  jruoho Sync with HEAD.
 1.26.16.3 31-May-2011  rmind sync with head
 1.26.16.2 21-Apr-2011  rmind sync with head
 1.26.16.1 05-Mar-2011  rmind sync with head
 1.35.6.1 18-Feb-2012  mrg merge to -current.
 1.35.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.35.2.1 17-Apr-2012  yamt sync with head
 1.36.10.1 18-May-2014  rmind sync with head
 1.36.6.2 03-Dec-2017  jdolecek update from HEAD
 1.36.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.38.2.4 28-Aug-2017  skrll Sync with HEAD
 1.38.2.3 19-Mar-2016  skrll Sync with HEAD
 1.38.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.38.2.1 06-Apr-2015  skrll Sync with HEAD
 1.44.8.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.44.2.1 18-Mar-2018  martin Pull up following revision(s) (requested by jmcneill in ticket #642):
sys/arch/sgimips/dev/crmfb.c: revision 1.45
Add support for overriding the video mode by setting an ARCS environment
variable.
If the "crmfb_mode" environment variable is set, treat it as a mode
string in the form WIDTHxHEIGHT[@REFRESH] and generate monitor timings
using the VESA GTF formula. If set, this overrides the EDID preferred
mode.
 1.45.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.47.10.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.48.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.16 20-Jan-2015  macallan - remove scratch area, it's been unused since we're drawing characters by
hardware
- don't sync the rendering engine unless we have to, watch FIFO levels
instead
- support anti-aliased fonts and let the drawing engine do all the work
 1.15 17-May-2011  macallan branches: 1.15.14; 1.15.32;
add some constants, clarify some hw limitations
 1.14 07-Apr-2011  macallan add mode setting support
If we find a monitor via DDC we switch to its preferred mode if it reports one,
otherwise stick with whatever the firmware set up.
 1.13 31-Mar-2011  macallan add DDC2 support. Not too useful yet.
 1.12 30-Mar-2011  macallan add a bunch of GBE registers, no functional change (yet)
 1.11 01-Mar-2011  macallan use hardware to draw characters, while there use vcons_replay_msgbuf()
 1.10 26-Mar-2009  macallan branches: 1.10.4; 1.10.6; 1.10.8;
add a few more register definitions, needed by the latest crime_drv.
 1.9 06-Nov-2008  macallan branches: 1.9.4;
add a couple more registers
 1.8 08-May-2008  jmcneill branches: 1.8.4; 1.8.6; 1.8.8;
Use 2-clause license.
 1.7 17-Feb-2008  macallan branches: 1.7.6; 1.7.8; 1.7.10; 1.7.12;
adjust some register names, also use MTE for scrolling down
 1.6 17-Feb-2008  macallan use the memory transfer engine for scrolling when possible
currently that's only for scrolling upwards but the speedup should be very
noticeable
TODO: use MTE for erase rasops, figure out how to control the MTEs direction
 1.5 05-Feb-2008  macallan update (c) sections
 1.4 05-Feb-2008  macallan add hardware acceleration for scrolling and clearing.
The framebuffer is now run in tiled mode so we can use the rendering engine
which means X is broken for now.
This needs more testing.
 1.3 02-Feb-2008  sekiya Define relevent register data so that we can turn off sync-on-green when needed.
 1.2 02-Dec-2007  jmcneill CRMFB_VT_VCMAP and CRMFB_VT_HCMAP register definitions were transposed.
From jsing@openbsd in private mail.
 1.1 26-Jul-2007  macallan branches: 1.1.4; 1.1.6; 1.1.8; 1.1.10; 1.1.12; 1.1.14; 1.1.20;
- move register definitions to crmfbreg.h
- identify as WSDISPLAY_TYPE_CRIME
- always claim we're 32bit
- switch to 32bit colour in WSDISPLAYIO_MODE_MAPPED, switch back to 8bit
in WSDISPLAYIO_MODE_EMUL
- restore palette, turn off the cursor when switching back to console mode
- add a few delay()s, hopefully that will deal with occasional messed up
video timings *fingers crossed*
 1.1.20.2 18-Feb-2008  mjf Sync with HEAD.
 1.1.20.1 08-Dec-2007  mjf Sync with HEAD.
 1.1.14.6 27-Feb-2008  yamt sync with head.
 1.1.14.5 11-Feb-2008  yamt sync with head.
 1.1.14.4 04-Feb-2008  yamt sync with head.
 1.1.14.3 07-Dec-2007  yamt sync with head
 1.1.14.2 03-Sep-2007  yamt sync with head.
 1.1.14.1 26-Jul-2007  yamt file crmfbreg.h was added on branch yamt-lazymbuf on 2007-09-03 14:29:14 +0000
 1.1.12.2 23-Mar-2008  matt sync with HEAD
 1.1.12.1 09-Jan-2008  matt sync with HEAD
 1.1.10.3 03-Dec-2007  ad Sync with HEAD.
 1.1.10.2 20-Aug-2007  ad Sync with HEAD.
 1.1.10.1 26-Jul-2007  ad file crmfbreg.h was added on branch vmlocking on 2007-08-20 22:07:00 +0000
 1.1.8.2 15-Aug-2007  skrll Sync with HEAD.
 1.1.8.1 26-Jul-2007  skrll file crmfbreg.h was added on branch nick-csl-alignment on 2007-08-15 13:47:37 +0000
 1.1.6.2 07-Aug-2007  matt Sync with HEAD.
 1.1.6.1 26-Jul-2007  matt file crmfbreg.h was added on branch matt-mips64 on 2007-08-07 18:05:38 +0000
 1.1.4.1 03-Dec-2007  joerg Sync with HEAD.
 1.7.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.7.10.2 04-May-2009  yamt sync with head.
 1.7.10.1 16-May-2008  yamt sync with head.
 1.7.8.1 18-May-2008  yamt sync with head.
 1.7.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.7.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.8.2 01-Apr-2009  snj Pull up following revision(s) (requested by macallan in ticket #625):
sys/arch/sgimips/dev/crmfbreg.h: revision 1.10
add a few more register definitions, needed by the latest crime_drv.
 1.8.8.1 25-Feb-2009  snj Pull up following revision(s) (requested by macallan in ticket #507):
sys/arch/sgimips/dev/crmfbreg.h: revision 1.9
add a couple more registers
 1.8.6.2 28-Apr-2009  skrll Sync with HEAD.
 1.8.6.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.4.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.9.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.10.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.4.3 31-May-2011  rmind sync with head
 1.10.4.2 21-Apr-2011  rmind sync with head
 1.10.4.1 05-Mar-2011  rmind sync with head
 1.15.32.1 06-Apr-2015  skrll Sync with HEAD
 1.15.14.1 03-Dec-2017  jdolecek update from HEAD
 1.4 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.3 01-Jul-2011  dyoung branches: 1.3.12; 1.3.30;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10; 1.1.12; 1.1.14;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.14.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.12.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.10.1 05-Mar-2011  rmind sync with head
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file ctl.c was added on branch jym-xensuspend on 2009-05-13 17:18:17 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file ctl.c was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file ctl.c was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.3.30.1 06-Apr-2015  skrll Sync with HEAD
 1.3.12.1 03-Dec-2017  jdolecek update from HEAD
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file ctlreg.h was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file ctlreg.h was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file ctlreg.h was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.3 05-Dec-2021  msaitoh Fix typo again... s/Comparision/Comparison/
 1.2 05-Dec-2021  msaitoh s/comparsion/comparision/ in comment.
 1.1 12-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 12-Feb-2009  jym file dp8573areg.h was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 12-Feb-2009  yamt file dp8573areg.h was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 12-Feb-2009  skrll file dp8573areg.h was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.9 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.8 07-Sep-2025  thorpej Remove unnecessary NULL-initialization of TODR handle fields.
 1.7 02-Jan-2020  thorpej Use todr_gettime_ymdhms / todr_settime_ymdhms.
 1.6 18-Feb-2015  macallan branches: 1.6.18;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.5 20-Nov-2014  christos branches: 1.5.2;
use the inline bcdtobin and bintobcd directly instead through a macro.
 1.4 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.3 01-Jul-2011  dyoung branches: 1.3.2; 1.3.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 12-Dec-2009  tsutsui 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.1 12-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 12-Feb-2009  jym file dpclock.c was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.1.4.3 11-Mar-2010  yamt sync with head
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 12-Feb-2009  yamt file dpclock.c was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 12-Feb-2009  skrll file dpclock.c was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.3.12.2 03-Dec-2017  jdolecek update from HEAD
 1.3.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.5.2.1 06-Apr-2015  skrll Sync with HEAD
 1.6.18.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.9 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.8 07-Sep-2025  thorpej Remove unnecessary NULL-initialization of TODR handle fields.
 1.7 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.6 20-Nov-2014  christos branches: 1.6.2;
use the inline bcdtobin and bintobcd directly instead through a macro.
 1.5 01-Jul-2011  dyoung branches: 1.5.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 12-Jan-2010  tsutsui Split device_t/softc, some KNF.
 1.3 12-Jan-2010  tsutsui Switch to using todr_[gs]ettime_ymdhms() format
which doesn't require struct timeval details.
 1.2 12-Dec-2009  tsutsui 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.1 12-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 12-Feb-2009  jym file dsclock.c was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.1.4.3 11-Mar-2010  yamt sync with head
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 12-Feb-2009  yamt file dsclock.c was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 12-Feb-2009  skrll file dsclock.c was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.5.12.1 03-Dec-2017  jdolecek update from HEAD
 1.6.2.1 06-Apr-2015  skrll Sync with HEAD
 1.14 06-Oct-2011  he The crmfb device does not depend on iic; i2cbus and i2c_bitbang is
sufficient, says jmcneill@
Fixes a build problem for (at least) the GENERIC32_IP3x kernel.
 1.13 22-May-2011  macallan crmfb may run in more than 8 bit now so we need the other rasops* as well
 1.12 07-Apr-2011  macallan defflag CRMFB_DEBUG
 1.11 04-Apr-2011  macallan crmfb needs edid and friends now
 1.10 12-Feb-2009  rumble branches: 1.10.4; 1.10.6;
Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.9 17-Oct-2007  garbled branches: 1.9.20; 1.9.28; 1.9.34;
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 26-Sep-2007  macallan crime needs-flag
 1.7 12-Apr-2007  jmcneill branches: 1.7.2; 1.7.10; 1.7.12; 1.7.14;
Add crmfb, a framebuffer console driver for the onboard O2 video (SGI-CRM)
 1.6 30-Aug-2006  rumble branches: 1.6.8; 1.6.12; 1.6.14;
Add pic and imc-specific functions to alter the GIO bus arbiter
configuration. These are to be used exclusively by a higher interface in
gio/gio.c.

Also add functions to enable, disable and query the state of SysAd bus
parity detection since certain gio(4) cards need to be able to disable
it in order to work around their own buggy implementations.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8; 1.5.18;
merge ktrace-lwp.
 1.4 18-Oct-2005  tsutsui TAB/space cleanup.
 1.3 08-Jul-2004  sekiya branches: 1.3.2; 1.3.14;
Add support for keyboard and mouse attachments at zs*, used on IP12 and IP20.
Code written by Steve Rumble; committed with his blessing.

Using a glass TTY as a console on IP20 (IP12 untested) should now be possible.
 1.2 19-Jan-2004  sekiya Attach int0 at mainbus (precedent being the ip32 CRIME device, which handled
interrupts and timer calibration yet is also attached at mainbus).

Introduce the INDY_R4600_CACHE config option, which more accurately describes
the code enabled by this option.

This renders #ifdef IPxx completely obsolete, thus we theoretically can unify
the GENERIC files if a workable load address relocation scheme can be found.
 1.1 18-Jan-2004  sekiya Add files.dev and files.mace
 1.3.14.4 27-Oct-2007  yamt sync with head.
 1.3.14.3 03-Sep-2007  yamt sync with head.
 1.3.14.2 30-Dec-2006  yamt sync with head.
 1.3.14.1 21-Jun-2006  yamt sync with head.
 1.3.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.2 03-Aug-2004  skrll Sync with HEAD
 1.3.2.1 08-Jul-2004  skrll file files.dev was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.5.18.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/dev/imc.c: revision 1.26
sys/arch/sgimips/dev/files.dev: revision 1.6
sys/arch/sgimips/dev/pic.c: revision 1.11
sys/arch/sgimips/dev/imcvar.h: revision 1.1
Add pic and imc-specific functions to alter the GIO bus arbiter
configuration. These are to be used exclusively by a higher interface in
gio/gio.c.
Also add functions to enable, disable and query the state of SysAd bus
parity detection since certain gio(4) cards need to be able to disable
it in order to work around their own buggy implementations.
 1.5.8.1 03-Sep-2006  yamt sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.14.1 11-Jul-2007  mjf Sync with head.
 1.6.12.2 09-Oct-2007  ad Sync with head.
 1.6.12.1 27-May-2007  ad Sync with head.
 1.6.8.1 15-Apr-2007  yamt sync with head.
 1.7.14.1 06-Oct-2007  yamt sync with head.
 1.7.12.1 06-Nov-2007  matt sync with HEAD
 1.7.10.1 02-Oct-2007  joerg Sync with HEAD.
 1.7.2.1 03-Oct-2007  garbled Sync with HEAD
 1.9.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.9.20.1 04-May-2009  yamt sync with head.
 1.10.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.4.2 31-May-2011  rmind sync with head
 1.10.4.1 21-Apr-2011  rmind sync with head
 1.14 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.13 11-Jan-2004  sekiya Checkpoint if_mec work (just in case I get hit by a bus). This driver is still
not operational. The MII code mostly works, DMA data structures are defined
and allocated, but tx/rx logic is missing.
 1.12 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.11 15-Jul-2003  lukem __KERNEL_RCSID()
 1.10 26-Dec-2002  pooka branches: 1.10.2;
sync with mecreg change, ie. make this compile
 1.9 02-Oct-2002  thorpej 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 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.5 18-Nov-2000  soren branches: 1.5.2; 1.5.6; 1.5.10;
Use ETHER_ADDR_LEN.
 1.4 15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.3 03-Jul-2000  soren A few tweaks. Still not a real driver.
 1.2 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.1 14-Jun-2000  soren branches: 1.1.4;
A start at O2 support..
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file if_mec.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:01 +0000
 1.5.10.3 29-Dec-2002  thorpej Sync with HEAD.
 1.5.10.2 18-Oct-2002  nathanw Catch up to -current.
 1.5.10.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 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 16-Mar-2002  jdolecek Catch up with -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 18-Nov-2000  bouyer file if_mec.c was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.5 11-Jan-2004  sekiya Checkpoint if_mec work (just in case I get hit by a bus). This driver is still
not operational. The MII code mostly works, DMA data structures are defined
and allocated, but tx/rx logic is missing.
 1.4 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.3 26-Dec-2002  pooka branches: 1.3.2;
brush up situation with mec register definitions

from Chris Sekiya
 1.2 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
A start at O2 support..
 1.1.14.2 29-Dec-2002  thorpej Sync with HEAD.
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.1 16-Mar-2002  jdolecek Catch up 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 14-Jun-2000  bouyer file if_mecreg.h was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file if_mecreg.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:01 +0000
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.38 19-Oct-2025  thorpej Use {,e}isabus_attach().
 1.37 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.36 24-Apr-2021  thorpej branches: 1.36.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.35 26-Apr-2019  macallan branches: 1.35.12;
fix misleading error message
 1.34 18-Feb-2015  macallan branches: 1.34.18;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.33 27-Oct-2012  chs branches: 1.33.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.32 01-Jul-2011  dyoung branches: 1.32.2; 1.32.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.31 30-Jun-2011  wiz dependant -> dependent
 1.30 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.29 23-Aug-2008  tsutsui branches: 1.29.12; 1.29.16; 1.29.22; 1.29.24;
KNF and misc cosmetics.
 1.28 19-Feb-2007  rumble branches: 1.28.42; 1.28.46; 1.28.48; 1.28.52;
Support the sq(4) interface on the Challenge S's IOPLUS mezzanine. This
requires us to configure the IOPLUS to use the appropriate DMA channel,
depending on what other expansion cards may be installed. Further, we need
to do a bit more configuration of the sq(4) DMA engine, which apparently
was formerly being configured properly by the PROM. Use the same values,
which appear to work fine.

Also, extend the gio_arb_config interface as needed.

NB: We're currently setting the IOPLUS board to long burst, but it may be
better to use realtime. This will require some experimentation.
 1.27 22-Dec-2006  rumble branches: 1.27.2;
Guiness -> Guinness.
 1.26 30-Aug-2006  rumble branches: 1.26.2;
Add pic and imc-specific functions to alter the GIO bus arbiter
configuration. These are to be used exclusively by a higher interface in
gio/gio.c.

Also add functions to enable, disable and query the state of SysAd bus
parity detection since certain gio(4) cards need to be able to disable
it in order to work around their own buggy implementations.
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.8; 1.25.18;
merge ktrace-lwp.
 1.24 18-Oct-2005  tsutsui TAB/space cleanup.
 1.23 29-Sep-2004  sekiya branches: 1.23.12;
Various fixes:

* clean up EISA detection logic,
* really fix config_found_ia() usage (from drochner@),
* sprinkle a bit of KNF.
 1.22 05-Sep-2004  sekiya Oooops, iaa.iaa_name must be initialized.
 1.21 05-Sep-2004  sekiya Use config_found_ia() rather than config_found().
 1.20 17-Aug-2004  rumble Implement several changes that get my E++ (HPC1.5 GIO ethernet
adapter) to work on IP24:
o Force HPC and GIO slot endianness.
o Allow slots one and two to be masters and configure for
realtime mode.

Also, while we're here move IP22 invariants into the IP22 case.

I suspect that IP20 will work as well since it exhibited the same
broken DMA that IP24 did before I flipped the master bit.
 1.19 25-Jul-2004  sekiya Properly detect the EISA bus for IP22-class machines.
 1.18 13-Jun-2004  rumble sekiya-san's platform abstraction allows us to keep these
functions static.
 1.17 03-Apr-2004  sekiya Hook the IMC bus error handler into the ISR, otherwise bus error conditions
won't be properly dealt with.
 1.16 18-Jan-2004  sekiya branches: 1.16.2;
Keep chip revision and EISA information on same line as attach information.
 1.15 18-Jan-2004  sekiya Properly disable watchdog timer.
 1.14 18-Jan-2004  sekiya Finish moving code between ip2x.c and ip3x.c to imc.c and crime.c.
 1.13 13-Jan-2004  sekiya Assign memory controller-dependent watchdog reset functions to
platform.watchdog_reset.
 1.12 13-Jan-2004  sekiya As the platform-specific bus reset routine varies based on the memory
controller used, set it in the memory controller driver rather than the
platform init code.
 1.11 10-Jan-2004  sekiya Add watchdog and bus error handling functions (these features live in
IMC space, thus should be handled here rather than in ip2x.c)
 1.10 14-Dec-2003  sekiya Bus-space'ify the memory controller driver, and add IP20-specific bits.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 01-Jan-2003  thorpej branches: 1.8.2;
Use aprint_normal() for cfprint routines.
 1.7 02-Oct-2002  thorpej 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 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 10-Sep-2001  rafal branches: 1.3.4;
Use the newly committed imcreg.h to get rid of the magic numbers polluting
this file; while I'm here, rework the GIO arbitrator parameter setup to
match more closely what is done by lunix on the same hardware... Finally,
on a tip from Wilbern Cobb, preserve the graphics-related bits of the
GIO arbitrator parameter register from the PROM-initialized settings so
ARCS console on the graphics display works (tested on both my Indy with
Newport and my Indigo2 with XL gfx).
 1.2 08-Jul-2001  thorpej branches: 1.2.2; 1.2.4;
- Use the identifier strings that are fetched by the MI ARC BIOS
code.
- Garbage-collect some non-useful stuff from the mainbus_attach_args.
 1.1 11-May-2001  thorpej branches: 1.1.2;
Support for the Indigo2/Indy IMC (this is that to which all other
devices are attached).
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.2.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.2.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.3.4.4 03-Jan-2003  thorpej Sync with HEAD.
 1.3.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.1 10-Sep-2001  nathanw file imc.c was added on branch nathanw_sa on 2002-04-01 07:42:18 +0000
 1.8.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.5 19-Oct-2004  skrll Sync with HEAD
 1.8.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.2 25-Aug-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.2.1 11-May-2004  tron Pull up revision 1.17 (requested by sekiya in ticket #285):
Hook the IMC bus error handler into the ISR, otherwise bus error conditions
won't be properly dealt with.
 1.23.12.3 26-Feb-2007  yamt sync with head.
 1.23.12.2 30-Dec-2006  yamt sync with head.
 1.23.12.1 21-Jun-2006  yamt sync with head.
 1.25.18.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/dev/imc.c: revision 1.26
sys/arch/sgimips/dev/files.dev: revision 1.6
sys/arch/sgimips/dev/pic.c: revision 1.11
sys/arch/sgimips/dev/imcvar.h: revision 1.1
Add pic and imc-specific functions to alter the GIO bus arbiter
configuration. These are to be used exclusively by a higher interface in
gio/gio.c.
Also add functions to enable, disable and query the state of SysAd bus
parity detection since certain gio(4) cards need to be able to disable
it in order to work around their own buggy implementations.
 1.25.8.1 03-Sep-2006  yamt sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.26.2.1 12-Jan-2007  ad Sync with head.
 1.27.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.28.52.1 19-Oct-2008  haad Sync with HEAD.
 1.28.48.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.28.46.1 04-May-2009  yamt sync with head.
 1.28.42.1 28-Sep-2008  mjf Sync with HEAD.
 1.29.24.1 05-Mar-2011  bouyer Sync with HEAD
 1.29.22.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.16.1 05-Mar-2011  rmind sync with head
 1.29.12.1 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.32.12.2 03-Dec-2017  jdolecek update from HEAD
 1.32.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.32.2.1 30-Oct-2012  yamt sync with head
 1.33.14.1 06-Apr-2015  skrll Sync with HEAD
 1.34.18.1 10-Jun-2019  christos Sync with HEAD
 1.35.12.1 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.36.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 11-Jul-2015  kamil Improve spelling: regsiter -> register

This change is non-functional.

Approved by <riastradh>, <pgoyette>
 1.4 11-Dec-2005  christos branches: 1.4.122; 1.4.142;
merge ktrace-lwp.
 1.3 14-Dec-2003  sekiya Bus-space'ify the memory controller driver, and add IP20-specific bits.
 1.2 13-Mar-2002  simonb branches: 1.2.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 10-Sep-2001  rafal branches: 1.1.2; 1.1.4; 1.1.8;
Register defines for the SGI MC memory controller. Not 100% complete, but
has enough register/bit definitions to get rid of all the magic numbers that
currently pollute imc.c
 1.1.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.8.1 10-Sep-2001  nathanw file imcreg.h was added on branch nathanw_sa on 2002-04-01 07:42:18 +0000
 1.1.4.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.4.1 10-Sep-2001  fvdl file imcreg.h was added on branch thorpej-devvp on 2001-10-01 12:41:48 +0000
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.2.1 10-Sep-2001  thorpej file imcreg.h was added on branch kqueue on 2001-09-13 01:14:30 +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.4.142.1 22-Sep-2015  skrll Sync with HEAD
 1.4.122.1 03-Dec-2017  jdolecek update from HEAD
 1.1 30-Aug-2006  rumble branches: 1.1.2; 1.1.6; 1.1.8; 1.1.14;
Add pic and imc-specific functions to alter the GIO bus arbiter
configuration. These are to be used exclusively by a higher interface in
gio/gio.c.

Also add functions to enable, disable and query the state of SysAd bus
parity detection since certain gio(4) cards need to be able to disable
it in order to work around their own buggy implementations.
 1.1.14.2 30-Dec-2006  yamt sync with head.
 1.1.14.1 30-Aug-2006  yamt file imcvar.h was added on branch yamt-lazymbuf on 2006-12-30 20:46:52 +0000
 1.1.8.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/dev/imc.c: revision 1.26
sys/arch/sgimips/dev/files.dev: revision 1.6
sys/arch/sgimips/dev/pic.c: revision 1.11
sys/arch/sgimips/dev/imcvar.h: revision 1.1
Add pic and imc-specific functions to alter the GIO bus arbiter
configuration. These are to be used exclusively by a higher interface in
gio/gio.c.
Also add functions to enable, disable and query the state of SysAd bus
parity detection since certain gio(4) cards need to be able to disable
it in order to work around their own buggy implementations.
 1.1.6.2 09-Sep-2006  rpaulo sync with head
 1.1.6.1 30-Aug-2006  rpaulo file imcvar.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:42:52 +0000
 1.1.2.2 03-Sep-2006  yamt sync with head.
 1.1.2.1 30-Aug-2006  yamt file imcvar.h was added on branch yamt-pdpolicy on 2006-09-03 15:23:27 +0000
 1.32 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.31 29-May-2020  rin branches: 1.31.2;
For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.30 10-Nov-2019  chs 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.29 27-Sep-2018  macallan add event counters for int0 at mainbus
 1.28 18-Feb-2015  macallan branches: 1.28.16; 1.28.18;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.27 03-Jun-2014  macallan branches: 1.27.4;
actually get rid of actually unused variables, still works on my Indy
thanks mrg
 1.26 02-Jun-2014  macallan sprinkle __unused()
 1.25 27-Oct-2012  chs branches: 1.25.10;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.24 01-Jul-2011  dyoung branches: 1.24.2; 1.24.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.23 10-Mar-2011  tsutsui Set correct struct clockframe .intr value for hardclock(9).
 1.22 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.21 14-Dec-2009  matt branches: 1.21.4; 1.21.6; 1.21.8;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.20 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.19 23-Aug-2008  tsutsui branches: 1.19.2; 1.19.8; 1.19.12;
KNF and misc cosmetics.
 1.18 26-May-2008  tsutsui branches: 1.18.4;
Remove all initialization of obsolete ci_divisor_recip in
mips struct cpu_info and related macroes.
The member was prepared for a hack in MD microtime(9) implementation
but it has been superseded by MI timecounter(9).
 1.17 09-Jan-2008  wiz branches: 1.17.6; 1.17.8; 1.17.10; 1.17.12;
Fix typo in macro name and comments.
 1.16 29-Dec-2006  rumble branches: 1.16.24; 1.16.30; 1.16.36;
Change printing such that our 'timecounter:' message gets its own line on
IP12.
 1.15 29-Dec-2006  rumble Move the mips1_clock_intr handling into int.c where it belongs.
 1.14 29-Dec-2006  rumble Add i8254 timecounter support for use on IP12.

Now pings aren't 0.000 ms anymore.
 1.13 28-Dec-2006  rumble Sprinkle static.
 1.12 01-Sep-2006  rumble branches: 1.12.2;
Remove the 'FIFO Full' hack for interrupt vector 0.

It is unclear that this interrupt fails to latch as int2_wait_fifo()
depends on it doing so and appears to work. Furthermore, we were previously
unconditionally unmasking the interrupt 0 vector, which led to more
'unexpected interrupt' messages on the console, rather than avoiding them.

Approved by sekiya@.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.8; 1.11.18;
merge ktrace-lwp.
 1.10 18-Oct-2005  tsutsui TAB/space cleanup.
 1.9 08-Jul-2004  sekiya branches: 1.9.2; 1.9.12; 1.9.14;
Fake a FIFO interrupt iff the FIFO interrupt is unmasked. Should eliminate
the "spurious interrupt" messages on machines without grtwo displays.
 1.8 06-Jul-2004  sekiya Add the following to the int driver:

* if the driver hasn't been properly initialized, spin for a bit in wait_fifo()
rather than try to access the local0 status register.
* allow interrupt sharing (from Steve Rumble; necessary for IP20 glass TTY
support).
 1.7 11-Apr-2004  pooka Fix base address for i8254 calibration code. This has the effect of
us writing to the correct addresses and the thing actually working.
 1.6 25-Mar-2004  pooka branches: 1.6.2;
KNF
 1.5 25-Mar-2004  pooka replace terms ip1x and ip2x in comment
 1.4 25-Mar-2004  pooka Sprinkle some #ifdef MIPS3 to be able to compile the port without
including MIPS3 code.

for upcoming IP12
 1.3 09-Mar-2004  sekiya Add int2_wait_fifo(), which will idle while awaiting a flag in the interrupt
controller to deassert. Needed for the more interesting features of various
SGI framebuffers.
 1.2 19-Jan-2004  sekiya opt_machtype.h no longer exists.
 1.1 19-Jan-2004  sekiya Attach int0 at mainbus (precedent being the ip32 CRIME device, which handled
interrupts and timer calibration yet is also attached at mainbus).

Introduce the INDY_R4600_CACHE config option, which more accurately describes
the code enabled by this option.

This renders #ifdef IPxx completely obsolete, thus we theoretically can unify
the GENERIC files if a workable load address relocation scheme can be found.
 1.6.2.1 23-Jul-2004  tron Pull up revision 1.7 (requested by rumble in ticket #682):
Fix base address for i8254 calibration code. This has the effect of
us writing to the correct addresses and the thing actually working.
 1.9.14.3 21-Jan-2008  yamt sync with head
 1.9.14.2 30-Dec-2006  yamt sync with head.
 1.9.14.1 21-Jun-2006  yamt sync with head.
 1.9.12.1 16-Sep-2006  ghen Pull up following revision(s) (requested by rumble in ticket #1496):
sys/arch/sgimips/dev/int.c: revision 1.12
Remove the 'FIFO Full' hack for interrupt vector 0.
It is unclear that this interrupt fails to latch as int2_wait_fifo()
depends on it doing so and appears to work. Furthermore, we were previously
unconditionally unmasking the interrupt 0 vector, which led to more
'unexpected interrupt' messages on the console, rather than avoiding them.
Approved by sekiya@.
 1.9.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.2 03-Aug-2004  skrll Sync with HEAD
 1.9.2.1 08-Jul-2004  skrll file int.c was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.11.18.1 06-Sep-2006  riz Pull up following revision(s) (requested by rumble in ticket #110):
sys/arch/sgimips/dev/int.c: revision 1.12
Remove the 'FIFO Full' hack for interrupt vector 0.
It is unclear that this interrupt fails to latch as int2_wait_fifo()
depends on it doing so and appears to work. Furthermore, we were previously
unconditionally unmasking the interrupt 0 vector, which led to more
'unexpected interrupt' messages on the console, rather than avoiding them.
Approved by sekiya@.
 1.11.8.1 03-Sep-2006  yamt sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.2.1 12-Jan-2007  ad Sync with head.
 1.16.36.1 10-Jan-2008  bouyer Sync with HEAD
 1.16.30.1 18-Feb-2008  mjf Sync with HEAD.
 1.16.24.1 23-Mar-2008  matt sync with HEAD
 1.17.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.17.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.17.10.2 11-Mar-2010  yamt sync with head
 1.17.10.1 04-May-2009  yamt sync with head.
 1.17.8.1 04-Jun-2008  yamt sync with head
 1.17.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.17.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.4.1 19-Oct-2008  haad Sync with HEAD.
 1.19.12.2 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.19.12.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.19.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.21.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.21.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.21.4.2 21-Apr-2011  rmind sync with head
 1.21.4.1 05-Mar-2011  rmind sync with head
 1.24.12.3 03-Dec-2017  jdolecek update from HEAD
 1.24.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.2.1 30-Oct-2012  yamt sync with head
 1.25.10.1 10-Aug-2014  tls Rebase.
 1.27.4.1 06-Apr-2015  skrll Sync with HEAD
 1.28.18.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.28.18.1 10-Jun-2019  christos Sync with HEAD
 1.28.16.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.31.2.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.2 12-Feb-2009  rumble branches: 1.2.2; 1.2.4; 1.2.6;
Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.1 10-Feb-2009  rumble Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.2.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.6.1 12-Feb-2009  jym file int1reg.h was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.2.4.2 04-May-2009  yamt sync with head.
 1.2.4.1 12-Feb-2009  yamt file int1reg.h was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.2.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.2.2.1 12-Feb-2009  skrll file int1reg.h was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.5 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.4 11-Dec-2005  christos branches: 1.4.78; 1.4.86; 1.4.92;
merge ktrace-lwp.
 1.3 06-Jul-2004  sekiya branches: 1.3.2;
Add the following to the int driver:

* if the driver hasn't been properly initialized, spin for a bit in wait_fifo()
rather than try to access the local0 status register.
* allow interrupt sharing (from Steve Rumble; necessary for IP20 glass TTY
support).
 1.2 18-Jan-2004  sekiya Finish moving code between ip2x.c and ip3x.c to imc.c and crime.c.
 1.1 10-Jan-2004  sekiya Add register definitions for INT2 interrupt controller.
 1.3.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.2 03-Aug-2004  skrll Sync with HEAD
 1.3.2.1 06-Jul-2004  skrll file int2reg.h was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.4.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.3 23-Aug-2008  tsutsui KNF and misc cosmetics.
 1.2 11-Dec-2005  christos branches: 1.2.74; 1.2.78; 1.2.80; 1.2.84;
merge ktrace-lwp.
 1.1 09-Mar-2004  sekiya branches: 1.1.4;
Add int2_wait_fifo(), which will idle while awaiting a flag in the interrupt
controller to deassert. Needed for the more interesting features of various
SGI framebuffers.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 09-Mar-2004  skrll file int2var.h was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.2.84.1 19-Oct-2008  haad Sync with HEAD.
 1.2.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.78.1 04-May-2009  yamt sync with head.
 1.2.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.9 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.8 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.7 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 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 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
A start at O2 support..
 1.1.14.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.10.1 16-Mar-2002  jdolecek Catch up 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 14-Jun-2000  bouyer file lpt_mace.c was added on branch thorpej_scsipi on 2000-11-20 20:23:41 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file lpt_mace.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:02 +0000
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.4 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.3 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.2 13-Mar-2002  simonb branches: 1.2.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
A start at O2 support..
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.1 16-Mar-2002  jdolecek Catch up 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 14-Jun-2000  bouyer file macaureg.h was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file macaureg.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:03 +0000
 1.2.12.1 03-Aug-2004  skrll Sync with HEAD
 1.16 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.15 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.14 25-Oct-2003  chs NULL -> 0
 1.13 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 06-Jan-2003  rafal branches: 1.11.2;
Improve the interrupt code somewhat by having callers of xxx_intr_establish
pass in an interrupt handle (which is currently to the CRIME interrupt the
device is attached to) so the interrupt handlers know which device was the
one looking for attention.

While here, fix up PCI interrupt routing for both the on-board devices and
the PCI slots -- even though there is only one PCI slot in the chasis, the
hardware can accomodate up to three and provides an interrupt mapping for
all the PCI interrupt pins for both the internal SCSI & PCI slot and the
two "extra" slots.
 1.10 03-Jan-2003  rafal Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 1.9 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.8 02-Oct-2002  thorpej 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 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.4 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 11-Oct-2001  pooka branches: 1.3.4;
* fix thinko in mace_print() to prevent intr with value MACECF_INTR_DEFAULT
from getting printed
* fetch device name from dv_xname instead of using hardcoded value
 1.2 08-Jul-2001  thorpej branches: 1.2.2;
- Use the identifier strings that are fetched by the MI ARC BIOS
code.
- Garbage-collect some non-useful stuff from the mainbus_attach_args.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
A start at O2 support..
 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 14-Jun-2000  bouyer file mace.c was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file mace.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:04 +0000
 1.2.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.2.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.5 07-Jan-2003  thorpej Sync with HEAD.
 1.3.4.4 03-Jan-2003  thorpej Sync with HEAD.
 1.3.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.1 11-Oct-2001  nathanw file mace.c was added on branch nathanw_sa on 2002-04-01 07:42:20 +0000
 1.11.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.6 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.5 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.4 04-Oct-2003  tsutsui TAB/space cleanup.
 1.3 23-Dec-2002  pooka branches: 1.3.2;
MACE register definitions

from Chris Sekiya
 1.2 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
A start at O2 support..
 1.1.14.2 29-Dec-2002  thorpej Sync with HEAD.
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.1 16-Mar-2002  jdolecek Catch up 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 14-Jun-2000  bouyer file macereg.h was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file macereg.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:04 +0000
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.5 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.4 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.3 03-Jan-2003  rafal branches: 1.3.2;
Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 1.2 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
A start at O2 support..
 1.1.14.2 07-Jan-2003  thorpej Sync with HEAD.
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.1 16-Mar-2002  jdolecek Catch up 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 14-Jun-2000  bouyer file macevar.h was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file macevar.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:05 +0000
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.12 25-Oct-2003  chs NULL -> 0
 1.11 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.10 04-Oct-2003  tsutsui TAB/space cleanup.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 19-Jan-2003  rafal branches: 1.8.2;
Update to use the full DS1687 register set, therefore allowing the clock to
store absolute year rather than an offset -- this means the clock is now
consitent across the ARCS PROM, IRIX and NetBSD.

XXX: This attachment is now a mismoner, since it's a Dallas Semi RTC, not
a Motorola RTC. Should be renamed.
 1.7 02-Oct-2002  thorpej 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 14-Jan-2002  pooka slight last-minute typo here
 1.3 14-Jan-2002  pooka make RTC year IRIX semantics adjustments a macro
 1.2 25-Nov-2001  soren branches: 1.2.2; 1.2.4;
Forgot pooka's license header.
 1.1 25-Nov-2001  soren O2 RTC attachment, based on code from Antti Kantee.
 1.2.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.2.4.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 25-Nov-2001  thorpej file mcclock_mace.c was added on branch kqueue on 2002-01-10 19:48:25 +0000
 1.2.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 25-Nov-2001  nathanw file mcclock_mace.c was added on branch nathanw_sa on 2002-01-08 00:27:26 +0000
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.9 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.8 17-Oct-2003  sekiya Mouse port offset was incorrect.
 1.7 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 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 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 29-Jun-2000  soren branches: 1.1.2; 1.1.6; 1.1.10;
Just a stub. Needs different register accesses than other 8-bit MACE
deviecs..
 1.1.10.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.10.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.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.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 29-Jun-2000  bouyer file pckbc_mace.c was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.19 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.18 24-Apr-2021  thorpej branches: 1.18.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.17 18-Feb-2015  macallan branches: 1.17.32;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.16 27-Oct-2012  chs branches: 1.16.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.15 01-Jul-2011  dyoung branches: 1.15.2; 1.15.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.13 23-Aug-2008  tsutsui branches: 1.13.12; 1.13.16; 1.13.22; 1.13.24;
KNF and misc cosmetics.
 1.12 27-Dec-2006  rumble branches: 1.12.44; 1.12.48; 1.12.50; 1.12.54;
Catch and report bus errors.
 1.11 30-Aug-2006  rumble branches: 1.11.2;
Add pic and imc-specific functions to alter the GIO bus arbiter
configuration. These are to be used exclusively by a higher interface in
gio/gio.c.

Also add functions to enable, disable and query the state of SysAd bus
parity detection since certain gio(4) cards need to be able to disable
it in order to work around their own buggy implementations.
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.8; 1.10.18;
merge ktrace-lwp.
 1.9 12-Nov-2004  sekiya branches: 1.9.12;
Print board identification, same as we do on the IP2x machines.
 1.8 13-Jun-2004  rumble branches: 1.8.2;
General cleanup to improve style consistency and KNF adherence.
Updated comments and removed superfluous code. No functional
change intended.

ok'd by pooka and sekiya
 1.7 11-Apr-2004  pooka RCS Id police
 1.6 10-Apr-2004  pooka and finally, the big moment you've all been waiting for:
make it actually compile
 1.5 10-Apr-2004  pooka fix off-by-one in revision print
 1.4 10-Apr-2004  pooka add watchdog enable and disable

from Steve Rumble
 1.3 13-Jan-2004  sekiya branches: 1.3.2;
Assign memory controller-dependent watchdog reset functions to
platform.watchdog_reset.
 1.2 13-Jan-2004  sekiya As the platform-specific bus reset routine varies based on the memory
controller used, set it in the memory controller driver rather than the
platform init code.
 1.1 12-Jan-2004  sekiya Add pic (memory controller for IP12) driver. Originally written by
Steve Rumble, with mostly stylistic changes by myself.
 1.3.2.4 23-Jul-2004  tron Pull up revision 1.7 (requested by rumble in ticket #682):
RCS Id police
 1.3.2.3 23-Jul-2004  tron Pull up revision 1.6 (requested by rumble in ticket #682):
and finally, the big moment you've all been waiting for:
make it actually compile
 1.3.2.2 23-Jul-2004  tron Pull up revision 1.5 (requested by rumble in ticket #682):
fix off-by-one in revision print
 1.3.2.1 23-Jul-2004  tron Pull up revision 1.4 (requested by rumble in ticket #682):
add watchdog enable and disable
from Steve Rumble
 1.8.2.5 14-Nov-2004  skrll Sync with HEAD.
 1.8.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.2 03-Aug-2004  skrll Sync with HEAD
 1.8.2.1 13-Jun-2004  skrll file pic.c was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.9.12.1 30-Dec-2006  yamt sync with head.
 1.10.18.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/dev/imc.c: revision 1.26
sys/arch/sgimips/dev/files.dev: revision 1.6
sys/arch/sgimips/dev/pic.c: revision 1.11
sys/arch/sgimips/dev/imcvar.h: revision 1.1
Add pic and imc-specific functions to alter the GIO bus arbiter
configuration. These are to be used exclusively by a higher interface in
gio/gio.c.
Also add functions to enable, disable and query the state of SysAd bus
parity detection since certain gio(4) cards need to be able to disable
it in order to work around their own buggy implementations.
 1.10.8.1 03-Sep-2006  yamt sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.11.2.1 12-Jan-2007  ad Sync with head.
 1.12.54.1 19-Oct-2008  haad Sync with HEAD.
 1.12.50.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.12.48.1 04-May-2009  yamt sync with head.
 1.12.44.1 28-Sep-2008  mjf Sync with HEAD.
 1.13.24.1 05-Mar-2011  bouyer Sync with HEAD
 1.13.22.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.16.1 05-Mar-2011  rmind sync with head
 1.13.12.1 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.15.12.2 03-Dec-2017  jdolecek update from HEAD
 1.15.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.15.2.1 30-Oct-2012  yamt sync with head
 1.16.14.1 06-Apr-2015  skrll Sync with HEAD
 1.17.32.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.18.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 08-Mar-2006  lukem Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8; 1.4.10;
merge ktrace-lwp.
 1.3 18-Oct-2005  tsutsui TAB/space cleanup.
 1.2 10-Apr-2004  pooka branches: 1.2.2; 1.2.14;
Add physical offsets for memory configuration registers to be used
outside bus_space.
 1.1 12-Jan-2004  sekiya branches: 1.1.2;
Add pic (memory controller for IP12) driver. Originally written by
Steve Rumble, with mostly stylistic changes by myself.
 1.1.2.1 23-Jul-2004  tron Pull up revision 1.2 (requested by rumble in ticket #682):
Add physical offsets for memory configuration registers to be used
outside bus_space.
 1.2.14.1 21-Jun-2006  yamt sync with head.
 1.2.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.2 03-Aug-2004  skrll Sync with HEAD
 1.2.2.1 10-Apr-2004  skrll file picreg.h was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.4.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.4.8.1 13-Mar-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.11 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.10 26-Oct-2022  riastradh sgimips/scn(4): Convert to ttylock/ttyunlock.
 1.9 04-Oct-2022  rin Remove unused extern declaration of constty.
 1.8 04-Apr-2015  macallan don't malloc a tiny, fixed size buffer to scribble into, then not use it
and never free it either

found by Brainy
 1.7 25-Jul-2014  dholland branches: 1.7.2; 1.7.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.6 24-Mar-2014  christos branches: 1.6.2;
- use cpu_{g,s}etmodel
- fix unused
 1.5 16-Mar-2014  dholland 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.4 27-Oct-2012  chs branches: 1.4.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.3 24-Apr-2011  rmind branches: 1.3.4; 1.3.14;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.2 21-Nov-2009  rmind branches: 1.2.4; 1.2.6;
Use lwp_getpcb() on mips, powerpc and sh3, clean from struct user usage.
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file scn.c was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.1.4.3 11-Mar-2010  yamt sync with head
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file scn.c was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file scn.c was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.2.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.4.1 31-May-2011  rmind sync with head
 1.3.14.3 03-Dec-2017  jdolecek update from HEAD
 1.3.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.4.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.4.1 30-Oct-2012  yamt sync with head
 1.4.2.1 18-May-2014  rmind sync with head
 1.6.2.1 10-Aug-2014  tls Rebase.
 1.7.4.1 06-Apr-2015  skrll Sync with HEAD
 1.7.2.1 16-May-2015  snj Pull up following revision(s) (requested by maxv in ticket #761):
sys/arch/sgimips/dev/scn.c: revision 1.8
sys/arch/sgimips/mace/macekbc.c: revision 1.8
sys/dev/hpc/hpcfb.c: revision 1.59
sys/dev/i2c/i2c.c: revision 1.47
sys/dev/ic/mfi.c: revision 1.57
sys/dev/if_ndis/if_ndis_pci.c: revision 1.21
sys/dev/sysmon/sysmon_power.c: revisions 1.50-1.52
sys/dev/usb/umass_isdata.c: revision 1.31
fix double free, found by Brainy.
--
Free cmd on error if we allocated it.
Found by Brainy, reported by maxv@.
--
don't leak rl (but there are other leaks), found by Brainy.
--
Free ped if we can't hand it to the power daemon.
Found by Brainy, reported by maxv@.
--
don't forget to free the dictionary.
--
another missing free dict.
--
fix leak, found by Brainy.
--
don't malloc a tiny, fixed size buffer to scribble into, then not use it
and never free it either
found by Brainy
--
malloc() -> kmem_alloc() for private data, also kmem_free() them if we
don't finish attaching for whatever reason
found by Brainy
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file scnreg.h was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file scnreg.h was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file scnreg.h was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.2 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6; 1.1.18; 1.1.28;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.28.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.18.1 30-Oct-2012  yamt sync with head
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file scnvar.h was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file scnvar.h was added on branch yamt-nfs-mp on 2009-05-04 08:11:49 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file scnvar.h was added on branch nick-hppapmap on 2009-03-03 18:29:13 +0000
 1.5 26-Dec-2006  rumble Make backspace and control keys work.

XXX: Why does KS_BackSpace not do what we want? We're copying pckbd now...
 1.4 11-Dec-2005  christos branches: 1.4.20;
merge ktrace-lwp.
 1.3 18-Oct-2005  tsutsui TAB/space cleanup.
 1.2 29-Sep-2004  sekiya branches: 1.2.12;
Use C-style comments.
 1.1 08-Jul-2004  sekiya branches: 1.1.2;
Add support for keyboard and mouse attachments at zs*, used on IP12 and IP20.
Code written by Steve Rumble; committed with his blessing.

Using a glass TTY as a console on IP20 (IP12 untested) should now be possible.
 1.1.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.2.5 19-Oct-2004  skrll Sync with HEAD
 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-Jul-2004  skrll file wskbdmap_sgi.c was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.2.12.2 30-Dec-2006  yamt sync with head.
 1.2.12.1 21-Jun-2006  yamt sync with head.
 1.4.20.1 12-Jan-2007  ad Sync with head.
 1.43 24-Oct-2023  andvar declare zskgdb() in zs.c, if KGBD option is enabled.

Fixes compilation issue with the KGBD option enabled for sgimips.
 1.42 11-Sep-2021  andvar Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
 1.41 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.40 24-Apr-2021  thorpej branches: 1.40.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.39 18-Feb-2015  macallan branches: 1.39.32;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.38 24-Mar-2014  christos branches: 1.38.6;
- use cpu_{g,s}etmodel
- fix unused
 1.37 20-Feb-2011  matt branches: 1.37.4; 1.37.14; 1.37.18;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.36 12-Feb-2009  rumble branches: 1.36.4; 1.36.6; 1.36.8;
Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.35 13-Jun-2008  cegger branches: 1.35.4; 1.35.10;
use device_lookup_private to get softc
 1.34 28-Apr-2008  martin branches: 1.34.2; 1.34.4;
Remove clause 3 and 4 from TNF licenses
 1.33 29-Mar-2008  tsutsui branches: 1.33.2; 1.33.4;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.32 20-Nov-2007  ad branches: 1.32.14;
Use the softint API.
 1.31 09-Nov-2007  ad Call zs_lock_init() to set up the chanstate's lock.
 1.30 14-May-2006  elad branches: 1.30.18; 1.30.36; 1.30.38; 1.30.42; 1.30.44;
integrate kauth.
 1.29 28-Mar-2006  thorpej Use device_unit().
 1.28 11-Dec-2005  christos branches: 1.28.4; 1.28.6; 1.28.8; 1.28.10; 1.28.12;
merge ktrace-lwp.
 1.27 18-Oct-2005  tsutsui TAB/space cleanup.
 1.26 03-Jun-2005  martin branches: 1.26.2;
Constify
 1.25 29-Sep-2004  sekiya Use ANSI function declarations.
 1.24 08-Jul-2004  sekiya Add support for keyboard and mouse attachments at zs*, used on IP12 and IP20.
Code written by Steve Rumble; committed with his blessing.

Using a glass TTY as a console on IP20 (IP12 untested) should now be possible.
 1.23 10-Apr-2004  pooka At least my IP12 works better without the port-flipping glue,
so un-glueify IP12 for the time being.
 1.22 18-Jan-2004  sekiya branches: 1.22.2;
ANSIfy, de-__P(), add a little glue for IP12.
 1.21 14-Dec-2003  sekiya The serial controller on IP20 lives in a different place. Modify
zs_get_chan_addr() to reflect this.

XXX hardcoded addresses are quite distasteful. This should be passed in
through consinit() -- to avoid conflicts with Ilpo's soon-to-be-committed
framebuffer driver, I'll hold off until his code hits the tree.
 1.20 04-Oct-2003  tsutsui TAB/space cleanup.
 1.19 15-Jul-2003  lukem __KERNEL_RCSID()
 1.18 28-Jan-2003  pk branches: 1.18.2;
Provide locking required by the interrupt handlers running at IPL_SERIAL.
 1.17 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.16 02-Oct-2002  thorpej 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 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.12 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.11 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.10 02-May-2002  rafal branches: 1.10.2;
If we handle multiple events from the zs chip in one interrupt, don't count
that as multiple interrupts.
 1.9 17-Apr-2002  rafal Add event counter for zs interrupts and attach and use it; also, get the
zs major number out of the cdevsw table rather than hardcoding it in zs.c.
 1.8 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.7 20-Nov-2001  lukem - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
 1.6 18-Nov-2001  thorpej * Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct
config. Use machine type/subtype to determine which devices are
present.
* Add support for the second SCSI controller on the Indigo2.
 1.5 08-Jul-2001  thorpej branches: 1.5.2; 1.5.8;
bcopy -> memcpy, bzero -> memset
 1.4 08-Jul-2001  thorpej Use sys/dev/arcbios.
 1.3 07-Jul-2001  wdk - Finish off KGDB kernel debugger support for sgimips
 1.2 07-Jun-2001  thorpej branches: 1.2.2;
Don't use PCLK as the baud rate generator, as the Indy doens't
like that, and it has no effect on the Indigo2.
From Christopher SEKIYA <wileyc@rezrov.net>.

Also, query the "ConsoleOut" ARCS variable (i.e. "what the console
really is") rather than "console" ("what the console is configured
as").
 1.1 11-May-2001  thorpej Support for the SCC serial ports on Indigo2/Indy.

From Rafal K. Boni.
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.8.7 03-Jan-2003  thorpej Sync with HEAD.
 1.5.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.5.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.5.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.5.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.5.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.8.1 08-Jul-2001  nathanw file zs.c was added on branch nathanw_sa on 2002-01-08 00:27:26 +0000
 1.5.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.5.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 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.10.2.2 08-Jun-2002  gehenna remove cdev_decl.
 1.10.2.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.18.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.2.4 19-Oct-2004  skrll Sync with HEAD
 1.18.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.2.1 03-Aug-2004  skrll Sync with HEAD
 1.22.2.1 23-Jul-2004  tron Pull up revision 1.23 (requested by rumble in ticket #682):
At least my IP12 works better without the port-flipping glue,
so un-glueify IP12 for the time being.
 1.26.2.3 07-Dec-2007  yamt sync with head
 1.26.2.2 15-Nov-2007  yamt sync with head.
 1.26.2.1 21-Jun-2006  yamt sync with head.
 1.28.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.28.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.28.8.1 01-Apr-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.30.44.2 08-Dec-2007  mjf Sync with HEAD.
 1.30.44.1 19-Nov-2007  mjf Sync with HEAD.
 1.30.42.2 21-Nov-2007  bouyer Sync with HEAD
 1.30.42.1 13-Nov-2007  bouyer Sync with HEAD
 1.30.38.1 09-Jan-2008  matt sync with HEAD
 1.30.36.2 21-Nov-2007  joerg Sync with HEAD.
 1.30.36.1 11-Nov-2007  joerg Sync with HEAD.
 1.30.18.1 03-Dec-2007  ad Sync with HEAD.
 1.32.14.3 29-Jun-2008  mjf Sync with HEAD.
 1.32.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.32.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.33.4.2 04-May-2009  yamt sync with head.
 1.33.4.1 16-May-2008  yamt sync with head.
 1.33.2.2 17-Jun-2008  yamt sync with head.
 1.33.2.1 18-May-2008  yamt sync with head.
 1.34.4.1 18-Jun-2008  simonb Sync with head.
 1.34.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.35.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.35.4.1 03-Mar-2009  skrll Sync with HEAD.
 1.36.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.36.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.36.4.1 05-Mar-2011  rmind sync with head
 1.37.18.1 18-May-2014  rmind sync with head
 1.37.14.2 03-Dec-2017  jdolecek update from HEAD
 1.37.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.37.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.38.6.1 06-Apr-2015  skrll Sync with HEAD
 1.39.32.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.40.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.14 18-Sep-2021  tsutsui Remove unnecessary (and unimplemented) WSKBD_*BELL ioctls in kbd drivers.

It looks the only ioctl(4) to be implemented for WSKBDIO_*BELL in
the backend keyboard driver is WSKBDIO_COMPLEXBELL.
All other BELL ioctls (WSKBDIO_BELL, WSKBDIO_SETBELL, WSKBDIO_GETBELL,
WSKBDIO_SETDEFAULTBELL, and WSKBDIO_GETDEFAULTBELL) are handled in the
MI wskbd driver (in wskbd_displayioctl() in src/sys/dev/wscons/wskbd.c).
 1.13 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.12 24-Apr-2021  thorpej branches: 1.12.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.11 21-Nov-2020  thorpej branches: 1.11.2;
malloc(9) -> kmem(9)
 1.10 29-Oct-2012  chs branches: 1.10.50;
fix device/softc split errors.
 1.9 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.8 29-Mar-2008  tsutsui branches: 1.8.38; 1.8.48;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.7 04-Mar-2007  christos branches: 1.7.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 11-Dec-2005  christos branches: 1.6.26;
merge ktrace-lwp.
 1.5 18-Oct-2005  tsutsui TAB/space cleanup.
 1.4 20-Jul-2004  rumble branches: 1.4.2; 1.4.14;
KNF and consistency
 1.3 20-Jul-2004  rumble Allow for console attachment by statically allocating a softc
extension. Tweak cs_softreq when appending the transmit queue.
Finally, add a bit of debugging.
 1.2 20-Jul-2004  rumble Properly initialise the tx and rx queue head and tail positions.
 1.1 08-Jul-2004  sekiya Add support for keyboard and mouse attachments at zs*, used on IP12 and IP20.
Code written by Steve Rumble; committed with his blessing.

Using a glass TTY as a console on IP20 (IP12 untested) should now be possible.
 1.4.14.2 03-Sep-2007  yamt sync with head.
 1.4.14.1 21-Jun-2006  yamt sync with head.
 1.4.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.5 13-Jan-2005  skrll Adapt to branch
 1.4.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.2 03-Aug-2004  skrll Sync with HEAD
 1.4.2.1 20-Jul-2004  skrll file zs_kbd.c was added on branch ktrace-lwp on 2004-08-03 10:40:00 +0000
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.48.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.38.1 30-Oct-2012  yamt sync with head
 1.10.50.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.11.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.12.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.17 24-Oct-2023  andvar cast kgdb_dev to int as sun3, sgimips and sgimips64 have different types,
same %lld format specifier doesn't work for both.
 1.16 24-Oct-2023  andvar apply similar changes between different archs/machines for zs_kgdb.c:
1) adjust zs_kgdb_init tty attachment message for kgdb_dev type change.
(one arch uses cast to int instead, but kept one approach for consistency)
2) remove unused rr0 declaration and assignment in zs_kgdb_txint()
3) adjust kgdb_dev format specifier to %llx/d if needed.
4) add const for zs_kgdb_devname declaration (macppc only).
should fix zs_kgdb.c build for all these ports.
 1.15 18-Mar-2009  cegger branches: 1.15.44; 1.15.54;
Ansify function definitions w/o arguments. Generated with sed.
 1.14 28-Apr-2008  martin branches: 1.14.8; 1.14.14;
Remove clause 3 and 4 from TNF licenses
 1.13 06-Jan-2008  dsieger branches: 1.13.6; 1.13.8; 1.13.10;
Fix a typo: s/Kgdb_dev/kgdb_dev/
 1.12 17-Oct-2007  garbled branches: 1.12.2; 1.12.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.11 23-Jun-2007  hauke branches: 1.11.10;
Fix a warning from gcc 4 about stripping the volatile qualifier by a cast
by doing the proper __UNVOLATILE() dance.
 1.10 11-Dec-2005  christos branches: 1.10.30; 1.10.32; 1.10.38;
merge ktrace-lwp.
 1.9 29-Sep-2004  sekiya branches: 1.9.12;
Use ANSI function declarations.
 1.8 08-Jul-2004  sekiya Add support for keyboard and mouse attachments at zs*, used on IP12 and IP20.
Code written by Steve Rumble; committed with his blessing.

Using a glass TTY as a console on IP20 (IP12 untested) should now be possible.
 1.7 08-Feb-2004  sekiya de-__P.
 1.6 15-Jul-2003  lukem __KERNEL_RCSID()
 1.5 06-Sep-2002  gehenna branches: 1.5.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.4 13-Mar-2002  simonb branches: 1.4.4;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 08-Jul-2001  thorpej branches: 1.3.2; 1.3.8;
bcopy -> memcpy, bzero -> memset
 1.2 07-Jul-2001  wdk - Finish off KGDB kernel debugger support for sgimips
 1.1 11-May-2001  thorpej branches: 1.1.2;
Support for the SCC serial ports on Indigo2/Indy.

From Rafal K. Boni.
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.8.3 17-Sep-2002  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 08-Jul-2001  nathanw file zs_kgdb.c was added on branch nathanw_sa on 2002-04-01 07:42:20 +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 16-Mar-2002  jdolecek Catch up with -current.
 1.4.4.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.5.6.4 19-Oct-2004  skrll Sync with HEAD
 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.9.12.2 21-Jan-2008  yamt sync with head
 1.9.12.1 03-Sep-2007  yamt sync with head.
 1.10.38.1 26-Jun-2007  garbled Sync with HEAD.
 1.10.32.1 11-Jul-2007  mjf Sync with head.
 1.10.30.1 15-Jul-2007  ad Sync with head.
 1.11.10.2 09-Jan-2008  matt sync with HEAD
 1.11.10.1 06-Nov-2007  matt sync with HEAD
 1.12.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.12.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.13.10.2 04-May-2009  yamt sync with head.
 1.13.10.1 16-May-2008  yamt sync with head.
 1.13.8.1 18-May-2008  yamt sync with head.
 1.13.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.14.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.15.54.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.15.44.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.10 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.9 24-Apr-2021  thorpej branches: 1.9.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.8 27-Oct-2012  chs branches: 1.8.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.7 29-Mar-2008  tsutsui branches: 1.7.38; 1.7.48;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.6 04-Mar-2007  christos branches: 1.6.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 12-Nov-2006  plunky branches: 1.5.4;
Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
 1.4 11-Dec-2005  christos branches: 1.4.20; 1.4.22;
merge ktrace-lwp.
 1.3 18-Oct-2005  tsutsui TAB/space cleanup.
 1.2 18-Oct-2005  tsutsui Pass proper values to MI wsmouse_input(9):
http://mail-index.netbsd.org/port-sgimips/2005/10/18/0000.html

Ok'ed by Steve Rumble.
 1.1 08-Jul-2004  sekiya branches: 1.1.2; 1.1.14;
Add support for keyboard and mouse attachments at zs*, used on IP12 and IP20.
Code written by Steve Rumble; committed with his blessing.

Using a glass TTY as a console on IP20 (IP12 untested) should now be possible.
 1.1.14.3 03-Sep-2007  yamt sync with head.
 1.1.14.2 30-Dec-2006  yamt sync with head.
 1.1.14.1 21-Jun-2006  yamt sync with head.
 1.1.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.2.5 13-Jan-2005  skrll Adapt to branch
 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-Jul-2004  skrll file zs_ms.c was added on branch ktrace-lwp on 2004-08-03 10:40:01 +0000
 1.4.22.1 10-Dec-2006  yamt sync with head.
 1.4.20.1 18-Nov-2006  ad Sync with head.
 1.5.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.7.48.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.38.1 30-Oct-2012  yamt sync with head
 1.8.52.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.9.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.8 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.7 01-Jul-2011  dyoung branches: 1.7.2; 1.7.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 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 28-Apr-2008  martin branches: 1.4.8; 1.4.14;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.76; 1.3.78;
merge ktrace-lwp.
 1.2 15-Jul-2003  lukem __KERNEL_RCSID()
 1.1 11-May-2001  thorpej branches: 1.1.8; 1.1.24;
Basic EISA support for the Indigo2. From Rafal K. Boni.
 1.1.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.24.1 03-Aug-2004  skrll Sync with HEAD
 1.1.8.2 11-May-2001  thorpej Basic EISA support for the Indigo2. From Rafal K. Boni.
 1.1.8.1 11-May-2001  thorpej file eisa_machdep.c was added on branch nathanw_sa on 2001-05-11 04:36:16 +0000
 1.3.78.2 04-May-2009  yamt sync with head.
 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.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.2.1 30-Oct-2012  yamt sync with head
 1.6 10-Jan-2014  christos include bsd.own.mk
 1.5 19-Oct-2008  apb branches: 1.5.28; 1.5.38; 1.5.44;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.78; 1.4.84;
merge ktrace-lwp.
 1.3 11-Jan-2004  sekiya Reinstate symbolic device names -- I completely forgot about their use.
Reminder courtesy soren@
 1.2 10-Jan-2004  sekiya Add framework for gio card identification based on product ID. devlist2h.awk
was borrowed from sys/dev/pcmcia.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.30;
Simple GIO glue.
 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 14-Jun-2000  bouyer file Makefile.giodevs was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file Makefile.giodevs was added on branch minoura-xpg4dl on 2000-06-22 17:03:06 +0000
 1.4.84.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.4.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.44.1 18-May-2014  rmind sync with head
 1.5.38.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.28.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 03-Jun-2017  christos remove my copyright
 1.5 02-May-2008  martin branches: 1.5.44; 1.5.64;
Move TNF licenses to 2 clause form
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.76; 1.4.78;
merge ktrace-lwp.
 1.3 03-Jun-2005  martin Make the output proper constified.
 1.2 11-Jan-2004  sekiya branches: 1.2.4;
Reinstate symbolic device names -- I completely forgot about their use.
Reminder courtesy soren@
 1.1 10-Jan-2004  sekiya Add framework for gio card identification based on product ID. devlist2h.awk
was borrowed from sys/dev/pcmcia.
 1.2.4.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 11-Jan-2004  skrll file devlist2h.awk was added on branch ktrace-lwp on 2004-08-03 10:40:05 +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.5.64.1 28-Aug-2017  skrll Sync with HEAD
 1.5.44.1 03-Dec-2017  jdolecek update from HEAD
 1.11 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.10 12-Feb-2009  macallan Become a good vcons citizen.
Also, don't use the cursor sprite as text cursor - it's not worth the pain and
the sprite doesn't have an invert-background plane either so the cursor wasn't
transparent.
Instead blit the cursor using the appropriate ROPs. This way we get rid of the
cursor misplacement problem as well.
While there also use device_t.
TODO: arbitrary font sizes, cleanup, support for mapping all blitter registers
so we can use them from X.
 1.9 29-Dec-2006  rumble branches: 1.9.48; 1.9.56; 1.9.58; 1.9.62; 1.9.66;
Enable light(4).
 1.8 30-Aug-2006  rumble branches: 1.8.2;
Provide a pseudo-pci bus for the following PCI ethernet boards, which live
behind custom PCI<->GIO bridges:
- Set Engineering GIO Fast Ethernet (TI ThunderLAN)
- Phobos G100 (DEC 21140?)
- Phobos G130 (DEC 21143)
- Phobos G160 (DEC 21143)

All boards present the chipsets' pci configuration registers at some
defined offset in their slots' address space as well as device registers.
We simply allow the MI pci subsystem to attach the devices.

This has been tested with a G130 board (DEC 21143) and works well on IP20
and IP24. The Set Engineering board attaches, works fine when receiving and
lightly transmitting, but chokes for unknown reasons on heavy transmits.
The tl(4) driver may need some fixing.
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.8; 1.7.18;
merge ktrace-lwp.
 1.6 06-Jul-2004  sekiya branches: 1.6.12;
Many fixes to the grtwo wscons driver:

* fills seem to be broken. Avoid filling large vertical regions; instead,
attempt to break it up into managable chunks. This doesn't work perfectly
either, so clear the screen row-by-row (which does work).
* Characters are now right-side-up
* the driver now uses screen coordinates properly.

With the exception of column erases (which fall prey to the fill issue), the
driver is now usable.
 1.5 18-Mar-2004  sekiya Add GR2.
 1.4 15-Dec-2003  lonewolf Support for SGI NG1 ("newport") graphics controller.
 1.3 13-Mar-2002  simonb branches: 1.3.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 11-May-2001  thorpej branches: 1.2.2; 1.2.8;
Autoconfiguration glue changes for Indigo2/Indy support.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8;
Simple GIO glue.
 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 14-Jun-2000  bouyer file files.gio was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file files.gio was added on branch minoura-xpg4dl on 2000-06-22 17:03:06 +0000
 1.2.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.8.1 11-May-2001  nathanw file files.gio was added on branch nathanw_sa on 2002-04-01 07:42:21 +0000
 1.2.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.3.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.12.1 03-Aug-2004  skrll Sync with HEAD
 1.6.12.1 30-Dec-2006  yamt sync with head.
 1.7.18.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/gio/pci_gio.c: revision 1.1
sys/arch/sgimips/gio/files.gio: revision 1.8
Provide a pseudo-pci bus for the following PCI ethernet boards, which live
behind custom PCI<->GIO bridges:
- Set Engineering GIO Fast Ethernet (TI ThunderLAN)
- Phobos G100 (DEC 21140?)
- Phobos G130 (DEC 21143)
- Phobos G160 (DEC 21143)
All boards present the chipsets' pci configuration registers at some
defined offset in their slots' address space as well as device registers.
We simply allow the MI pci subsystem to attach the devices.
This has been tested with a G130 board (DEC 21143) and works well on IP20
and IP24. The Set Engineering board attaches, works fine when receiving and
lightly transmitting, but chokes for unknown reasons on heavy transmits.
The tl(4) driver may need some fixing.
 1.7.8.1 03-Sep-2006  yamt sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.2.1 12-Jan-2007  ad Sync with head.
 1.9.66.1 29-Dec-2010  matt Merge changes from netbsd-5.
 1.9.62.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.58.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #981):
sys/arch/sgimips/gio/files.gio: revision 1.10
sys/arch/sgimips/gio/newport.c: revision 1.12
Become a good vcons citizen.
Also, don't use the cursor sprite as text cursor - it's not worth the
pain and the sprite doesn't have an invert-background plane either so
the cursor wasn't transparent.
Instead blit the cursor using the appropriate ROPs. This way we get
rid of the cursor misplacement problem as well.
While there also use device_t.
TODO: arbitrary font sizes, cleanup, support for mapping all blitter
registers so we can use them from X.
 1.9.56.1 03-Mar-2009  skrll Sync with HEAD.
 1.9.48.1 04-May-2009  yamt sync with head.
 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-2019  macallan branches: 1.36.10;
ga_iot = 0 -> normal_memt
now a Challenge S should work again
from George Harvey
 1.35 20-Jul-2016  macallan branches: 1.35.16;
use bus_space_map() instead of fudging our own bus_space_handle_t
 1.34 18-Feb-2015  macallan branches: 1.34.2;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.33 27-Oct-2012  chs branches: 1.33.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.32 01-Jul-2011  dyoung branches: 1.32.2; 1.32.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.31 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.30 10-Feb-2009  rumble Be selective on match, since it makes sense to combine an IP12 and IP6
kernel and IP6 has no GIO bus.
 1.29 22-Feb-2007  thorpej branches: 1.29.46; 1.29.54; 1.29.60;
TRUE -> true, FALSE -> false
 1.28 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.27 19-Feb-2007  rumble Support the sq(4) interface on the Challenge S's IOPLUS mezzanine. This
requires us to configure the IOPLUS to use the appropriate DMA channel,
depending on what other expansion cards may be installed. Further, we need
to do a bit more configuration of the sq(4) DMA engine, which apparently
was formerly being configured properly by the PROM. Use the same values,
which appear to work fine.

Also, extend the gio_arb_config interface as needed.

NB: We're currently setting the IOPLUS board to long burst, but it may be
better to use realtime. This will require some experimentation.
 1.26 29-Dec-2006  rumble branches: 1.26.2;
IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.25 29-Dec-2006  rumble Enable light(4).
 1.24 29-Dec-2006  rumble Rework GIO probing a bit.

Devices present on the GIO bus needn't always provide a Product
Indentification Word, even if their address space is the same as the
address space of a slot. Separate the handling of probing for slot-based
devices and graphics devices, matching the latter first, and precluding
addresses probed for the former when a graphics device is known to exist
in a slot's space.
 1.23 22-Dec-2006  rumble Indigo and Indigo2 machines have only one shared interrupt for the two
GIO slots. This differs from Indy, which has an interrupt per slot, neither
of which is the same as on the other two machines.

This lets my Phobos G160 run in both slots in my Indigo2 and my E++ adapter
works in both slots in my Indigo.
 1.22 30-Aug-2006  rumble branches: 1.22.2;
Implement the gio_arb_config() interface for changing the machine-specific
gio bus arbiter parameters via imc(4) or pic(4).

Slots are identified by name: GIO_SLOT_GFX, GIO_SLOT_EXP1, GIO_SLOT_EXP2.

Provide some helper functions for establishing interrupts associated with
each slot and obtaining product descriptions.
 1.21 11-Dec-2005  christos branches: 1.21.4; 1.21.8; 1.21.18;
merge ktrace-lwp.
 1.20 26-Aug-2005  drochner s/locdesc_t/int/g
 1.19 30-Jun-2005  drochner branches: 1.19.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.18 28-Jun-2005  drochner convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)
 1.17 29-Sep-2004  sekiya Use ANSI function declarations.
 1.16 06-Jul-2004  sekiya Many fixes to the grtwo wscons driver:

* fills seem to be broken. Avoid filling large vertical regions; instead,
attempt to break it up into managable chunks. This doesn't work perfectly
either, so clear the screen row-by-row (which does work).
* Characters are now right-side-up
* the driver now uses screen coordinates properly.

With the exception of column erases (which fall prey to the fill issue), the
driver is now usable.
 1.15 18-Mar-2004  sekiya Add console attach glue for GR2.
 1.14 11-Jan-2004  sekiya Reinstate symbolic device names -- I completely forgot about their use.
Reminder courtesy soren@
 1.13 10-Jan-2004  sekiya Add framework for gio card identification based on product ID. devlist2h.awk
was borrowed from sys/dev/pcmcia.
 1.12 15-Dec-2003  lonewolf Implement direct configuration for GIO devices.

XXX Still needs a way to handle Indigo2 spurious "productid 0x04 revision 0x00"
XXX phantom devices.
 1.11 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.10 15-Jul-2003  lukem __KERNEL_RCSID()
 1.9 01-Jan-2003  thorpej branches: 1.9.2;
Use aprint_normal() for cfprint routines.
 1.8 09-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.7 02-Oct-2002  thorpej 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 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.3 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.2 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
Simple GIO glue.
 1.1.14.4 03-Jan-2003  thorpej Sync with HEAD.
 1.1.14.3 11-Nov-2002  nathanw Catch up to -current
 1.1.14.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.10.1 16-Mar-2002  jdolecek Catch up 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 14-Jun-2000  bouyer file gio.c was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file gio.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:06 +0000
 1.9.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.4 19-Oct-2004  skrll Sync with HEAD
 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.19.2.3 26-Feb-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.18.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/gio/gio.c: revision 1.22
sys/arch/sgimips/gio/giovar.h: revision 1.7
Implement the gio_arb_config() interface for changing the machine-specific
gio bus arbiter parameters via imc(4) or pic(4).
Slots are identified by name: GIO_SLOT_GFX, GIO_SLOT_EXP1, GIO_SLOT_EXP2.
Provide some helper functions for establishing interrupts associated with
each slot and obtaining product descriptions.
 1.21.8.1 03-Sep-2006  yamt sync with head.
 1.21.4.1 09-Sep-2006  rpaulo sync with head
 1.22.2.1 12-Jan-2007  ad Sync with head.
 1.26.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.29.60.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.29.54.2 28-Apr-2009  skrll Sync with HEAD.
 1.29.54.1 03-Mar-2009  skrll Sync with HEAD.
 1.29.46.1 04-May-2009  yamt sync with head.
 1.32.12.2 03-Dec-2017  jdolecek update from HEAD
 1.32.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.32.2.1 30-Oct-2012  yamt sync with head
 1.33.14.2 05-Oct-2016  skrll Sync with HEAD
 1.33.14.1 06-Apr-2015  skrll Sync with HEAD
 1.34.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.35.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.36.10.8 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.36.10.7 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.36.10.6 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.36.10.5 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.36.10.4 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.36.10.3 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.36.10.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.36.10.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.8 19-Feb-2007  rumble PHOBOS_G100 is 100Mbit only - don't lie. Also, make it clear that
SETENG_GFE is 10/100.
 1.7 20-Jul-2006  rumble branches: 1.7.10;
Beautify.
 1.6 20-Jul-2006  rumble Add entries for the Phobos G100, G130 and Set Engineering GIO Fast Ethernet
cards.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8;
merge ktrace-lwp.
 1.4 17-Apr-2005  rumble branches: 1.4.2;
Add the $NetBSD$ tag and some whitespace. When we previously
started the device list on the first line the awk script would
skip the first entry.
 1.3 11-Jan-2004  sekiya branches: 1.3.8;
Reinstate symbolic device names -- I completely forgot about their use.
Reminder courtesy soren@
 1.2 10-Jan-2004  sekiya Add framework for gio card identification based on product ID. devlist2h.awk
was borrowed from sys/dev/pcmcia.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.30;
Simple GIO glue.
 1.1.30.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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 14-Jun-2000  bouyer file giodevs was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file giodevs was added on branch minoura-xpg4dl on 2000-06-22 17:03:07 +0000
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.2.2 26-Feb-2007  yamt sync with head.
 1.4.2.1 30-Dec-2006  yamt sync with head.
 1.5.8.1 11-Aug-2006  yamt sync with head
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.7.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.7 19-Feb-2007  rumble regen.
 1.6 20-Jul-2006  rumble branches: 1.6.10;
Regen.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8;
merge ktrace-lwp.
 1.4 03-Jun-2005  martin branches: 1.4.2;
Regen (with proper consts)
 1.3 17-Apr-2005  rumble regen
 1.2 11-Jan-2004  sekiya branches: 1.2.4; 1.2.10;
Reinstate symbolic device names -- I completely forgot about their use.
Reminder courtesy soren@
 1.1 10-Jan-2004  sekiya Add framework for gio card identification based on product ID. devlist2h.awk
was borrowed from sys/dev/pcmcia.
 1.2.10.1 29-Apr-2005  kent sync with -current
 1.2.4.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 11-Jan-2004  skrll file giodevs.h was added on branch ktrace-lwp on 2004-08-03 10:40:05 +0000
 1.4.2.2 26-Feb-2007  yamt sync with head.
 1.4.2.1 30-Dec-2006  yamt sync with head.
 1.5.8.1 11-Aug-2006  yamt sync with head
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.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.6 19-Feb-2007  rumble regen.
 1.5 20-Jul-2006  rumble branches: 1.5.10;
Regen.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 03-Jun-2005  martin branches: 1.3.2;
Regen (with proper consts)
 1.2 17-Apr-2005  rumble regen
 1.1 11-Jan-2004  sekiya branches: 1.1.4; 1.1.10;
Reinstate symbolic device names -- I completely forgot about their use.
Reminder courtesy soren@
 1.1.10.1 29-Apr-2005  kent sync with -current
 1.1.4.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 11-Jan-2004  skrll file giodevs_data.h was added on branch ktrace-lwp on 2004-08-03 10:40:05 +0000
 1.3.2.2 26-Feb-2007  yamt sync with head.
 1.3.2.1 30-Dec-2006  yamt sync with head.
 1.4.8.1 11-Aug-2006  yamt sync with head
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.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.4 31-Aug-2006  rumble Describe the GIO Product Identification Word and add a few macros to
extract other fields.
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.8;
merge ktrace-lwp.
 1.2 15-Dec-2003  lonewolf branches: 1.2.16;
Implement direct configuration for GIO devices.

XXX Still needs a way to handle Indigo2 spurious "productid 0x04 revision 0x00"
XXX phantom devices.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.30;
Simple GIO glue.
 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 14-Jun-2000  bouyer file gioreg.h was added on branch thorpej_scsipi on 2000-11-20 20:23:43 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file gioreg.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:08 +0000
 1.2.16.1 30-Dec-2006  yamt sync with head.
 1.3.8.1 03-Sep-2006  yamt sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.10 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.9 19-Feb-2007  rumble Support the sq(4) interface on the Challenge S's IOPLUS mezzanine. This
requires us to configure the IOPLUS to use the appropriate DMA channel,
depending on what other expansion cards may be installed. Further, we need
to do a bit more configuration of the sq(4) DMA engine, which apparently
was formerly being configured properly by the PROM. Use the same values,
which appear to work fine.

Also, extend the gio_arb_config interface as needed.

NB: We're currently setting the IOPLUS board to long burst, but it may be
better to use realtime. This will require some experimentation.
 1.8 29-Dec-2006  rumble branches: 1.8.2;
Rework GIO probing a bit.

Devices present on the GIO bus needn't always provide a Product
Indentification Word, even if their address space is the same as the
address space of a slot. Separate the handling of probing for slot-based
devices and graphics devices, matching the latter first, and precluding
addresses probed for the former when a graphics device is known to exist
in a slot's space.
 1.7 30-Aug-2006  rumble branches: 1.7.2;
Implement the gio_arb_config() interface for changing the machine-specific
gio bus arbiter parameters via imc(4) or pic(4).

Slots are identified by name: GIO_SLOT_GFX, GIO_SLOT_EXP1, GIO_SLOT_EXP2.

Provide some helper functions for establishing interrupts associated with
each slot and obtaining product descriptions.
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8; 1.6.18;
merge ktrace-lwp.
 1.5 29-Sep-2004  sekiya branches: 1.5.12;
Use ANSI function declarations.
 1.4 15-Dec-2003  lonewolf Implement direct configuration for GIO devices.

XXX Still needs a way to handle Indigo2 spurious "productid 0x04 revision 0x00"
XXX phantom devices.
 1.3 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.2 13-Mar-2002  simonb branches: 1.2.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
Simple GIO glue.
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.1 16-Mar-2002  jdolecek Catch up 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 14-Jun-2000  bouyer file giovar.h was added on branch thorpej_scsipi on 2000-11-20 20:23:43 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file giovar.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:08 +0000
 1.2.12.4 19-Oct-2004  skrll Sync with HEAD
 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.5.12.2 26-Feb-2007  yamt sync with head.
 1.5.12.1 30-Dec-2006  yamt sync with head.
 1.6.18.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/gio/gio.c: revision 1.22
sys/arch/sgimips/gio/giovar.h: revision 1.7
Implement the gio_arb_config() interface for changing the machine-specific
gio bus arbiter parameters via imc(4) or pic(4).
Slots are identified by name: GIO_SLOT_GFX, GIO_SLOT_EXP1, GIO_SLOT_EXP2.
Provide some helper functions for establishing interrupts associated with
each slot and obtaining product descriptions.
 1.6.8.1 03-Sep-2006  yamt sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.2.1 12-Jan-2007  ad 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.19 13-Dec-2023  andvar Add (intptr_t) casts to fix "cast to pointer from integer of different size",
mainly for GENERIC64_32_* configs.
Also change segp->ds_len format specifier to %lld, which fixes DMA_DEBUG build.
 1.18 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.17 24-Apr-2021  thorpej branches: 1.17.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.16 21-Nov-2020  thorpej branches: 1.16.2;
malloc(9) -> kmem(9)
 1.15 03-Sep-2018  riastradh branches: 1.15.12;
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.14 04-Mar-2018  mrg branches: 1.14.2; 1.14.4;
#if 0 grtwo_cursor_data[] to match the #if 0'd code that uses it.
 1.13 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.12 11-Jan-2012  macallan branches: 1.12.6;
adjust for wsfont_find() change
 1.11 22-Nov-2009  mbalmer branches: 1.11.12; 1.11.16;
more s/the the/the/
 1.10 04-Mar-2007  christos branches: 1.10.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 29-Dec-2006  rumble branches: 1.9.2;
IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.8 28-Dec-2006  rumble Only probe on known supported base addresses.
 1.7 12-Apr-2006  jmmv branches: 1.7.8;
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.6 11-Dec-2005  christos branches: 1.6.4; 1.6.6; 1.6.8; 1.6.10; 1.6.12;
merge ktrace-lwp.
 1.5 29-Sep-2004  sekiya branches: 1.5.12;
Abbreviate identification message to fit in 80 columns.
 1.4 08-Jul-2004  sekiya branches: 1.4.2;
Remove unnecessary variables from grtwo_cnattach().
 1.3 07-Jul-2004  sekiya Oops. Remove reference to phantom variable.
 1.2 06-Jul-2004  sekiya Many fixes to the grtwo wscons driver:

* fills seem to be broken. Avoid filling large vertical regions; instead,
attempt to break it up into managable chunks. This doesn't work perfectly
either, so clear the screen row-by-row (which does work).
* Characters are now right-side-up
* the driver now uses screen coordinates properly.

With the exception of column erases (which fall prey to the fill issue), the
driver is now usable.
 1.1 18-Mar-2004  sekiya Checkpoint the GR2 wscons driver. Heavily derived from lonewolf@'s newport
driver. Still some issues:

* framebuffer setup seems incomplete. Some drawing primitives work 100%
of the time, while others fail one in ten tries. Perhaps my board is
slightly broken, as the exact model as probed by ARCS seems to shift
between Elan and XS24 from time to time.
* characters are drawn bottom-up rather than top-down (as the wsfont
definitions expect).
 1.4.2.6 13-Jan-2005  skrll Adapt to branch
 1.4.2.5 19-Oct-2004  skrll Sync with HEAD
 1.4.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.2 03-Aug-2004  skrll Sync with HEAD
 1.4.2.1 08-Jul-2004  skrll file grtwo.c was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.5.12.3 03-Sep-2007  yamt sync with head.
 1.5.12.2 30-Dec-2006  yamt sync with head.
 1.5.12.1 21-Jun-2006  yamt sync with head.
 1.6.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.6.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.6.8.1 24-May-2006  yamt sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.8.1 12-Jan-2007  ad Sync with head.
 1.9.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.44.1 11-Mar-2010  yamt sync with head
 1.11.16.1 18-Feb-2012  mrg merge to -current.
 1.11.12.2 30-Oct-2012  yamt sync with head
 1.11.12.1 17-Apr-2012  yamt sync with head
 1.12.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.4.1 10-Jun-2019  christos Sync with HEAD
 1.14.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.15.12.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.16.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.17.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 18-Mar-2004  sekiya branches: 1.1.4;
Add register definitions and console prototype header for the SGI GR2 family
of framebuffers.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 18-Mar-2004  skrll file grtworeg.h was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.3 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 18-Mar-2004  sekiya branches: 1.1.4;
Add register definitions and console prototype header for the SGI GR2 family
of framebuffers.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 18-Mar-2004  skrll file grtwovar.h was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.8 10-Dec-2003  lonewolf Garbage collect unused file.
 1.7 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 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 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
Simple GIO glue.
 1.1.14.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.10.1 16-Mar-2002  jdolecek Catch up 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 14-Jun-2000  bouyer file hpc.c was added on branch thorpej_scsipi on 2000-11-20 20:23:43 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file hpc.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:09 +0000
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11 13-Dec-2023  andvar Add (intptr_t) casts to fix "cast to pointer from integer of different size",
mainly for GENERIC64_32_* configs.
Also change segp->ds_len format specifier to %lld, which fixes DMA_DEBUG build.
 1.10 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.9 24-Apr-2021  thorpej branches: 1.9.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.8 21-Nov-2020  thorpej branches: 1.8.2;
malloc(9) -> kmem(9)
 1.7 27-Oct-2012  chs branches: 1.7.50;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.6 11-Jan-2012  macallan branches: 1.6.6;
adjust for wsfont_find() change
 1.5 04-Mar-2007  christos branches: 1.5.78; 1.5.82;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 29-Dec-2006  rumble branches: 1.4.2; 1.4.4; 1.4.6;
IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.3 29-Dec-2006  rumble Actually probe for the device when matching.
 1.2 28-Dec-2006  rumble Permit mmap, improve register definitions, disable the hardware cursor, and
other minor nits.
 1.1 26-Dec-2006  rumble Bring in support for the SGI Light/Entry/Starter LG1/LG2 framebuffers
found in Indigo systems.
 1.4.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.4.4.2 12-Jan-2007  ad Sync with head.
 1.4.4.1 29-Dec-2006  ad file light.c was added on branch newlock2 on 2007-01-12 01:00:57 +0000
 1.4.2.3 03-Sep-2007  yamt sync with head.
 1.4.2.2 30-Dec-2006  yamt sync with head.
 1.4.2.1 29-Dec-2006  yamt file light.c was added on branch yamt-lazymbuf on 2006-12-30 20:46:53 +0000
 1.5.82.1 18-Feb-2012  mrg merge to -current.
 1.5.78.2 30-Oct-2012  yamt sync with head
 1.5.78.1 17-Apr-2012  yamt sync with head
 1.6.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.50.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.8.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.9.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.3 29-Dec-2006  rumble branches: 1.3.2; 1.3.4;
Actually probe for the device when matching.
 1.2 28-Dec-2006  rumble Permit mmap, improve register definitions, disable the hardware cursor, and
other minor nits.
 1.1 26-Dec-2006  rumble Bring in support for the SGI Light/Entry/Starter LG1/LG2 framebuffers
found in Indigo systems.
 1.3.4.2 12-Jan-2007  ad Sync with head.
 1.3.4.1 29-Dec-2006  ad file lightreg.h was added on branch newlock2 on 2007-01-12 01:00:57 +0000
 1.3.2.2 30-Dec-2006  yamt sync with head.
 1.3.2.1 29-Dec-2006  yamt file lightreg.h was added on branch yamt-lazymbuf on 2006-12-30 20:46:53 +0000
 1.2 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.1 26-Dec-2006  rumble branches: 1.1.2; 1.1.4;
Bring in support for the SGI Light/Entry/Starter LG1/LG2 framebuffers
found in Indigo systems.
 1.1.4.2 12-Jan-2007  ad Sync with head.
 1.1.4.1 26-Dec-2006  ad file lightvar.h was added on branch newlock2 on 2007-01-12 01:00:57 +0000
 1.1.2.2 30-Dec-2006  yamt sync with head.
 1.1.2.1 26-Dec-2006  yamt file lightvar.h was added on branch yamt-lazymbuf on 2006-12-30 20:46:53 +0000
 1.23 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.22 24-Apr-2021  thorpej branches: 1.22.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.21 21-Nov-2020  thorpej branches: 1.21.2;
malloc(9) -> kmem(9)
 1.20 10-May-2019  macallan branches: 1.20.10;
general overhaul, in no particular order:
- use MIPS_PHYS_TO_KSEG1()
- get rid of duplicated rasops_allocattr() and _mapchar() methods
- use rasops_init()
- support fonts that aren't 8x16
- use fastclear mode for rectangle fills
- don't mess with XMAP9's config register
- initialize all 32 XMAP9 mode registers, just in case
- make newport_fill_rectangle() use x, y, wi, he like everyone else
- use R3G3B2 palette in preparation for alpha font support
 1.19 25-Aug-2015  macallan branches: 1.19.18;
- pass the right address to bus_space_mmap() so this works on N32 kernels
- don't mess with XMAP9 when switching to graphics mode
 1.18 02-Jun-2014  macallan branches: 1.18.4;
more __unused()
 1.17 11-Jan-2012  macallan branches: 1.17.6; 1.17.20;
adjust for wsfont_find() change
 1.16 11-Jan-2012  macallan use rasops_init(0,0)
 1.15 12-May-2009  macallan branches: 1.15.12; 1.15.16;
remove leftover debug code
 1.14 04-Mar-2009  macallan No need to have two pre-defined screen types - just adapt to whatever video
mode we find. Also, redraw screen when X exits.
TODO: find out why characters are drawn upside down, for some bizarre reason
this happens right after exiting X but the last line is normal.
 1.13 13-Feb-2009  macallan Don't bother drawing a cursor until wsdisplay attaches. This works around
the deadlock I've seen with the previous version.
While there do some KNF policing.
 1.12 12-Feb-2009  macallan Become a good vcons citizen.
Also, don't use the cursor sprite as text cursor - it's not worth the pain and
the sprite doesn't have an invert-background plane either so the cursor wasn't
transparent.
Instead blit the cursor using the appropriate ROPs. This way we get rid of the
cursor misplacement problem as well.
While there also use device_t.
TODO: arbitrary font sizes, cleanup, support for mapping all blitter registers
so we can use them from X.
 1.11 10-Feb-2009  macallan A bunch of bugfixes:
- set blitter direction appropriately so scrolling downwards works now
- remove a bunch of false +1 so we only copy/erase what we really need to
- slightly change the logic for the cursor sprite offset so it works on this
Indy ( I think what matters is VC2 revision 0 )
TODO: virtual consoles, fonts wider than 8 pixels
 1.10 04-Mar-2007  christos branches: 1.10.44; 1.10.52; 1.10.54; 1.10.58; 1.10.62;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 29-Dec-2006  rumble branches: 1.9.2;
IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.8 28-Dec-2006  rumble Do not rely on the Product ID Word to be 0x04 since there is no such
thing for graphics options. Since we're removing this, ensure that we can
read the probe registers before proceeding.
 1.7 12-Apr-2006  jmmv branches: 1.7.8;
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.6 11-Dec-2005  christos branches: 1.6.4; 1.6.6; 1.6.8; 1.6.10; 1.6.12;
merge ktrace-lwp.
 1.5 07-Feb-2004  sekiya branches: 1.5.4; 1.5.18;
More newport driver tweaks:

* detect and store vc2 revision. This is (likely) the important factor in
determining the proper cursor offset, so add a bit of logic that does the
right thing on my revision 0 vc2. This will have to be determined
empirically, revision by revision.
* take a stab at detecting framebuffer depth. SGI does it quite differently,
but their algorithm doesn't work, so we'll do it along the same lines as
linux.
* implement newport_mmap() for use by X. The necessary xsrc commits have been
made (with the notable exception of the config/cf changes, which probably
shouldn't go in until 4.4.0 has been imported).
 1.4 26-Jan-2004  lonewolf Remove unused dc_screens from the softc, the driver does not support multiple
screens.
 1.3 26-Jan-2004  sekiya Slight modifications to newport driver:

* Add resolution and depth variables to softc (for use in X driver, although
depth detection is currently problematic),
* Store more information about various chip revisions,
* Implement ioctls to help the X driver detect device presence and geometry.
 1.2 22-Jan-2004  lonewolf Correctly read the board revision.
 1.1 15-Dec-2003  lonewolf Support for SGI NG1 ("newport") graphics controller.
 1.5.18.3 03-Sep-2007  yamt sync with head.
 1.5.18.2 30-Dec-2006  yamt sync with head.
 1.5.18.1 21-Jun-2006  yamt sync with head.
 1.5.4.5 13-Jan-2005  skrll Adapt to branch
 1.5.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.5.4.2 03-Aug-2004  skrll Sync with HEAD
 1.5.4.1 07-Feb-2004  skrll file newport.c was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.6.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.6.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.6.8.1 24-May-2006  yamt sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.8.1 12-Jan-2007  ad Sync with head.
 1.9.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.62.1 29-Dec-2010  matt Merge changes from netbsd-5.
 1.10.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.54.5 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #977):
sys/arch/sgimips/gio/newport.c: revision 1.15
remove leftover debug code
 1.10.54.4 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #1009):
sys/arch/sgimips/gio/newport.c: revision 1.14
No need to have two pre-defined screen types - just adapt to whatever
video mode we find. Also, redraw screen when X exits.
TODO: find out why characters are drawn upside down, for some bizarre
reason this happens right after exiting X but the last line is normal.
 1.10.54.3 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #974):
sys/arch/sgimips/gio/newport.c: revision 1.13
Don't bother drawing a cursor until wsdisplay attaches. This works
around the deadlock I've seen with the previous version.
While there do some KNF policing.
 1.10.54.2 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #981):
sys/arch/sgimips/gio/files.gio: revision 1.10
sys/arch/sgimips/gio/newport.c: revision 1.12
Become a good vcons citizen.
Also, don't use the cursor sprite as text cursor - it's not worth the
pain and the sprite doesn't have an invert-background plane either so
the cursor wasn't transparent.
Instead blit the cursor using the appropriate ROPs. This way we get
rid of the cursor misplacement problem as well.
While there also use device_t.
TODO: arbitrary font sizes, cleanup, support for mapping all blitter
registers so we can use them from X.
 1.10.54.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #963):
sys/arch/sgimips/gio/newport.c: revision 1.11
A bunch of bugfixes:
- set blitter direction appropriately so scrolling downwards works now
- remove a bunch of false +1 so we only copy/erase what we really need
to
- slightly change the logic for the cursor sprite offset so it works
on this Indy ( I think what matters is VC2 revision 0 )
TODO: virtual consoles, fonts wider than 8 pixels
 1.10.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.10.52.1 03-Mar-2009  skrll Sync with HEAD.
 1.10.44.2 16-May-2009  yamt sync with head
 1.10.44.1 04-May-2009  yamt sync with head.
 1.15.16.1 18-Feb-2012  mrg merge to -current.
 1.15.12.1 17-Apr-2012  yamt sync with head
 1.17.20.1 10-Aug-2014  tls Rebase.
 1.17.6.2 03-Dec-2017  jdolecek update from HEAD
 1.17.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.4.1 22-Sep-2015  skrll Sync with HEAD
 1.19.18.1 10-Jun-2019  christos Sync with HEAD
 1.20.10.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.21.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.22.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.9 16-May-2019  macallan Even more registers!
 1.8 10-May-2019  macallan move the CIDMATCH bits where they belong, now FASTCLEAR mode can actually work
 1.7 04-May-2019  macallan moar registers
to the right branch this time (hopefully)
 1.6 11-Jan-2012  macallan branches: 1.6.48; 1.6.50;
add some register definitions
 1.5 20-Feb-2011  matt branches: 1.5.4; 1.5.8;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.4 10-Feb-2009  macallan branches: 1.4.4; 1.4.6; 1.4.8;
add a few more register definitions
 1.3 11-Dec-2005  christos branches: 1.3.78; 1.3.86; 1.3.88; 1.3.92; 1.3.96;
merge ktrace-lwp.
 1.2 07-Feb-2004  sekiya branches: 1.2.4;
More newport driver tweaks:

* detect and store vc2 revision. This is (likely) the important factor in
determining the proper cursor offset, so add a bit of logic that does the
right thing on my revision 0 vc2. This will have to be determined
empirically, revision by revision.
* take a stab at detecting framebuffer depth. SGI does it quite differently,
but their algorithm doesn't work, so we'll do it along the same lines as
linux.
* implement newport_mmap() for use by X. The necessary xsrc commits have been
made (with the notable exception of the config/cf changes, which probably
shouldn't go in until 4.4.0 has been imported).
 1.1 15-Dec-2003  lonewolf Support for SGI NG1 ("newport") graphics controller.
 1.2.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 07-Feb-2004  skrll file newportreg.h was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.3.96.1 29-Dec-2010  matt Merge changes from netbsd-5.
 1.3.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.88.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #982):
sys/arch/sgimips/gio/newportreg.h: revision 1.4
add a few more register definitions
 1.3.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.4.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.4.1 05-Mar-2011  rmind sync with head
 1.5.8.1 18-Feb-2012  mrg merge to -current.
 1.5.4.1 17-Apr-2012  yamt sync with head
 1.6.50.1 04-May-2019  macallan moar registers
( so I don't forget to commit this along with the actual newport changes... )
 1.6.48.1 10-Jun-2019  christos Sync with HEAD
 1.3 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 15-Dec-2003  lonewolf branches: 1.1.4;
Support for SGI NG1 ("newport") graphics controller.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 15-Dec-2003  skrll file newportvar.h was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.20 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.19 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.18 24-Apr-2021  thorpej branches: 1.18.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.17 07-Jul-2020  thorpej branches: 1.17.4;
Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
Provide a new resource provider API:

==> pciconf_resource_init() -- Initialize a PCI configuration resources
container.
==> pciconf_resource_add() -- Add a PCI configuration resource to the
container (I/O, MEM, or prefetchable MEM). Multiple resources of
each type may be added.
==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
container once the bus has been configured.

This is much easier to use than the previous method of providing an
extent map for each kind of resource, and works better for e.g. ACPI
platforms that provide potentially multiple PCI resources in tables
provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
rather than extent maps.
 1.16 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.15 02-Oct-2015  msaitoh PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.14 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.13 02-Apr-2014  ozaki-r branches: 1.13.6;
Get rid of a wrong comma
 1.12 29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.11 27-Oct-2012  chs branches: 1.11.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.10 27-Jan-2012  para branches: 1.10.6;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.9 01-Jul-2011  dyoung branches: 1.9.2; 1.9.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.8 17-May-2011  dyoung PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name. Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
 1.7 11-May-2011  dyoung Now that GENERIC32_IPX3x builds again, fix some pci_attach_args
constification that I'd missed.
 1.6 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.5 19-Feb-2007  rumble branches: 1.5.64; 1.5.68; 1.5.74; 1.5.76;
Update a comment: G100 has now been tested.
 1.4 29-Dec-2006  rumble branches: 1.4.2; 1.4.4;
Update a comment and note the SetEng workaround.
 1.3 22-Dec-2006  rumble s/Challenge-S/Challenge S/ and fix an incorrect comment.
 1.2 07-Sep-2006  rumble branches: 1.2.2; 1.2.4;
Do not permit accesses to unmapped pci registers.
 1.1 30-Aug-2006  rumble branches: 1.1.2; 1.1.4;
Provide a pseudo-pci bus for the following PCI ethernet boards, which live
behind custom PCI<->GIO bridges:
- Set Engineering GIO Fast Ethernet (TI ThunderLAN)
- Phobos G100 (DEC 21140?)
- Phobos G130 (DEC 21143)
- Phobos G160 (DEC 21143)

All boards present the chipsets' pci configuration registers at some
defined offset in their slots' address space as well as device registers.
We simply allow the MI pci subsystem to attach the devices.

This has been tested with a G130 board (DEC 21143) and works well on IP20
and IP24. The Set Engineering board attaches, works fine when receiving and
lightly transmitting, but chokes for unknown reasons on heavy transmits.
The tl(4) driver may need some fixing.
 1.1.4.2 12-Jan-2007  ad Sync with head.
 1.1.4.1 18-Nov-2006  ad Sync with head.
 1.1.2.3 14-Sep-2006  yamt sync with head.
 1.1.2.2 03-Sep-2006  yamt sync with head.
 1.1.2.1 30-Aug-2006  yamt file pci_gio.c was added on branch yamt-pdpolicy on 2006-09-03 15:23:31 +0000
 1.2.4.2 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/gio/pci_gio.c: revision 1.2
Do not permit accesses to unmapped pci registers.
 1.2.4.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/gio/pci_gio.c: revision 1.1
sys/arch/sgimips/gio/files.gio: revision 1.8
Provide a pseudo-pci bus for the following PCI ethernet boards, which live
behind custom PCI<->GIO bridges:
- Set Engineering GIO Fast Ethernet (TI ThunderLAN)
- Phobos G100 (DEC 21140?)
- Phobos G130 (DEC 21143)
- Phobos G160 (DEC 21143)
All boards present the chipsets' pci configuration registers at some
defined offset in their slots' address space as well as device registers.
We simply allow the MI pci subsystem to attach the devices.
This has been tested with a G130 board (DEC 21143) and works well on IP20
and IP24. The Set Engineering board attaches, works fine when receiving and
lightly transmitting, but chokes for unknown reasons on heavy transmits.
The tl(4) driver may need some fixing.
 1.2.2.2 09-Sep-2006  rpaulo sync with head
 1.2.2.1 07-Sep-2006  rpaulo file pci_gio.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:42:52 +0000
 1.4.4.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.4.2.3 26-Feb-2007  yamt sync with head.
 1.4.2.2 30-Dec-2006  yamt sync with head.
 1.4.2.1 29-Dec-2006  yamt file pci_gio.c was added on branch yamt-lazymbuf on 2006-12-30 20:46:53 +0000
 1.5.76.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.74.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.68.2 31-May-2011  rmind sync with head
 1.5.68.1 05-Mar-2011  rmind sync with head
 1.5.64.1 20-Jan-2010  matt Adjust things to the new world order.
 1.9.6.1 18-Feb-2012  mrg merge to -current.
 1.9.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.9.2.2 30-Oct-2012  yamt sync with head
 1.9.2.1 17-Apr-2012  yamt sync with head
 1.10.6.3 03-Dec-2017  jdolecek update from HEAD
 1.10.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.11.2.1 18-May-2014  rmind sync with head
 1.13.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.13.6.1 06-Apr-2015  skrll Sync with HEAD
 1.17.4.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.18.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 09-Apr-2018  christos branches: 1.1.2;
rename panel to button.
 1.1.2.2 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.1.2.1 09-Apr-2018  pgoyette file button.c was added on branch pgoyette-compat on 2018-04-16 01:59:55 +0000
 1.3 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.2 11-Dec-2005  christos branches: 1.2.78; 1.2.86; 1.2.92;
merge ktrace-lwp.
 1.1 22-Nov-2003  sekiya branches: 1.1.4;
Register definitions for National Semiconductor DP8573A RTC. Code originally
from Steve Rumble, with modifications by myself.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 22-Nov-2003  skrll file dp8573areg.h was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.2.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.2.78.1 04-May-2009  yamt sync with head.
 1.4 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.3 05-Sep-2006  rumble branches: 1.3.60; 1.3.68; 1.3.74;
Switch sgimips to MI todr.
 1.2 11-Dec-2005  christos branches: 1.2.4; 1.2.8;
merge ktrace-lwp.
 1.1 22-Nov-2003  sekiya branches: 1.1.4; 1.1.18;
Add dpclock driver (and minimal hpc1 goo) for ip20. Code originally
from Steve Rumble, with modifications by myself.
 1.1.18.1 30-Dec-2006  yamt sync with head.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 22-Nov-2003  skrll file dpclock_hpc.c was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.2.8.1 14-Sep-2006  yamt sync with head.
 1.2.4.1 09-Sep-2006  rpaulo sync with head
 1.3.74.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.68.1 03-Mar-2009  skrll Sync with HEAD.
 1.3.60.1 04-May-2009  yamt sync with head.
 1.3 25-Nov-2001  soren O2 RTC attachment, based on code from Antti Kantee.
 1.2 18-Nov-2001  thorpej * Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct
config. Use machine type/subtype to determine which devices are
present.
* Add support for the second SCSI controller on the Indigo2.
 1.1 11-May-2001  thorpej branches: 1.1.2; 1.1.8;
Support for the Dallas 1286 clock found on the Indigo2 and Indy.
 1.1.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.8.1 11-May-2001  nathanw file ds1286.c was added on branch nathanw_sa on 2002-02-28 04:11:35 +0000
 1.1.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.10 05-Sep-2006  rumble branches: 1.10.60; 1.10.68; 1.10.74;
Switch sgimips to MI todr.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.8;
merge ktrace-lwp.
 1.8 15-Jul-2003  lukem branches: 1.8.16;
__KERNEL_RCSID()
 1.7 19-Jan-2003  rafal branches: 1.7.2;
Change DS1286 definitions to start with DS1286_ rather than DS_ so these and
DS1687 definitions are easier to distinguish.
 1.6 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 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.3 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 14-Jan-2002  pooka make RTC year IRIX semantics adjustments a macro
 1.1 25-Nov-2001  soren branches: 1.1.2; 1.1.4;
O2 RTC attachment, based on code from Antti Kantee.
 1.1.4.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.1.4.4 16-Mar-2002  jdolecek Catch up with -current.
 1.1.4.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 25-Nov-2001  thorpej file dsclock_hpc.c was added on branch kqueue on 2002-01-10 19:48:25 +0000
 1.1.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 25-Nov-2001  nathanw file dsclock_hpc.c was added on branch nathanw_sa on 2002-01-08 00:27:27 +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.1 30-Dec-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.74.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.68.1 03-Mar-2009  skrll Sync with HEAD.
 1.10.60.1 04-May-2009  yamt sync with head.
 1.17 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.16 09-Apr-2018  christos branches: 1.16.2; 1.16.4;
rename panel to button.
 1.15 09-Apr-2018  christos rename "panel" to "button" to avoid conflict with fdt
 1.14 14-May-2009  macallan branches: 1.14.62;
add a driver for the Indy's front panel buttons.
- power button presses are reported to sysmon
- volume control buttons are reported to PMF
TODO: add better key repeat code. The hardware keeps firing interrupts at us
whenever a button is down and not on - say - status change. If we don't clear
the interrupt we'll be fired on until someone clears it. We should probably
disable the entire interrupt and occasionally poll for button release.
 1.13 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.12 27-Aug-2006  bjh21 branches: 1.12.60; 1.12.68; 1.12.70; 1.12.74; 1.12.78;
Remove obsolete "sbic" define.
 1.11 26-Aug-2006  bjh21 Move the sgimips "sbic" driver from arch/sgimips/hpc/sbic.c to
dev/ic/wd33c93.c. This may not be the best WD33C93 driver we've
got, but it's the most recently worked on and probably the most
portable, so it seems like a good basis for further work (and in
particular an acorn26 driver for the Acorn SCSI card). There's
no functional change in this commit, and sgimips kernels still
compile.
 1.10 28-Dec-2005  kurahone branches: 1.10.4; 1.10.8;
Added support for the IP22 IOC's parallel port (PI1).

Code contributed by Joe Britt.

Reviewed by <sekiya> and <kurahone>.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 22-Nov-2003  sekiya branches: 1.8.16;
Add dpclock driver (and minimal hpc1 goo) for ip20.
 1.7 17-Oct-2003  sekiya Compile dsclock_hpc.c only if dsclock is present in config file.
 1.6 27-Sep-2003  he Allow kernels without the haltwo driver configured to build, i.e.
make the driver optional by adding the haltwo attribute.
 1.5 25-Sep-2003  lonewolf Support for HAL2 audio controller attached to the HPC ASIC, found on SGI Indy.

The driver is not too heavily tested and only supports audio playback and
master volume setting currently.
 1.4 13-Mar-2002  simonb branches: 1.4.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 25-Nov-2001  soren Adjust for dsclock name change.
 1.2 19-Aug-2001  wdk branches: 1.2.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1 11-May-2001  thorpej branches: 1.1.2;
Autoconfiguration glue for HPC devices.

From Rafal K. Boni.
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.2.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.6.1 19-Aug-2001  nathanw file files.hpc was added on branch nathanw_sa on 2002-01-08 00:27:27 +0000
 1.4.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.12.1 03-Aug-2004  skrll 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.10.8.1 03-Sep-2006  yamt sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.12.78.1 29-Dec-2010  matt Merge changes from netbsd-5.
 1.12.74.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.70.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #976):
sys/arch/sgimips/hpc/files.hpc: revision 1.14
sys/arch/sgimips/hpc/hpc.c: revision 1.62
sys/arch/sgimips/hpc/panel.c: revision 1.1
add a driver for the Indy's front panel buttons.
- power button presses are reported to sysmon
- volume control buttons are reported to PMF
TODO: add better key repeat code. The hardware keeps firing interrupts
at us whenever a button is down and not on - say - status change. If we
don't clear the interrupt we'll be fired on until someone clears it. We
should probably disable the entire interrupt and occasionally poll for
button release.
 1.12.68.1 03-Mar-2009  skrll Sync with HEAD.
 1.12.60.2 16-May-2009  yamt sync with head
 1.12.60.1 04-May-2009  yamt sync with head.
 1.14.62.1 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.16.4.1 05-May-2019  isaki Remove obsoleted au{,rate,vol}conv and mulaw attributes.
audio provides the equivalent of them inseparably.
 1.16.2.1 10-Jun-2019  christos Sync with HEAD
 1.26 25-May-2019  isaki Make it compilable even with debug option.
 1.25 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.24 16-Mar-2019  isaki branches: 1.24.2;
Use C99 style struct initializer to audio_hw_if.
 1.23 01-Jun-2017  chs branches: 1.23.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.22 24-Nov-2011  mrg branches: 1.22.8; 1.22.26;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.
 1.21 23-Nov-2011  jmcneill Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.20 01-Jul-2011  dyoung branches: 1.20.2; 1.20.4;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.19 25-Jan-2011  tsutsui Split device_t/softc. Tested on Indy.
 1.18 25-Jan-2011  tsutsui u_intNN_t -> uintNN_t
 1.17 24-Sep-2009  tsutsui branches: 1.17.4; 1.17.6; 1.17.8;
Replace shutdownhook_establish(9) (which was added by me)
with pmf_device_register1(9).
 1.16 14-May-2009  macallan set delta value for the mixer's master channel
 1.15 24-Aug-2008  tsutsui branches: 1.15.4; 1.15.12;
Pacify haltwo audio on shutdown hook to avoid noise on poweroff.
 1.14 17-Oct-2007  garbled branches: 1.14.16; 1.14.20; 1.14.22; 1.14.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.13 23-Jul-2007  he branches: 1.13.6;
After move to 64-bit paddr_t, cast via vaddr_t before casting to void*.
OK'ed by macallan@.
 1.12 04-Mar-2007  christos branches: 1.12.2; 1.12.10; 1.12.12; 1.12.14;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 29-Dec-2006  rumble branches: 1.11.2;
IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.10 04-Sep-2006  rumble branches: 1.10.2;
Check the haltwo hardware present bit in the match function, rather than
in the attach function after we've thwacked several registers and
potentially wedged the machine. This fixes booting on Challenge S systems
and addresses PR 25202.

Consequently, re-enable haltwo in the default kernel configuration.

Many thanks to George Harvey for testing and feedback.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.8; 1.9.18;
merge ktrace-lwp.
 1.8 28-Feb-2005  sekiya branches: 1.8.2; 1.8.4;
Attempt to verify presence of haltwo hardware, rather than just blithely
believing that all hpc3 have a haltwo. This should help Challenge-S owners.
 1.7 15-Jan-2005  kent branches: 1.7.2; 1.7.4;
ansify and KNF
 1.6 10-Jan-2005  kent merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes
 1.5 30-Dec-2004  rumble Prepend HPC3 macros universally with "HPC3_" to distinctly recognise
the corresponding revision and maintain consistency with HPC1.

No functional change intended.
 1.4 29-Oct-2004  yamt branches: 1.4.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.3 29-Dec-2003  sekiya branches: 1.3.4;
Fixes to HPC abstraction layer from Steve Rumble:

- hpc1_hdd_{ctl,bufptr} and hpc3_hdd_{ctl,bufptr} are
established in hpcreg.h. All references to these fields
are updated with the exception of if_sq: (haltwo,
hpcdma). This makes reading the code and spotting bugs
easier.
- hpcdma.c was applying EOCHAIN to the wrong descriptor
word for the hpc1 case.
- I added scsi_max_xfer to the abstraction layer, and it
allows some crusty #defines in wdsc.c to be removed.
hpc1 now doesn't waste descriptors as it once did.
- hpcreg.h was updated to reflect the lack of XMITDONE
bit in hpc1. HPC1_REV15 added for a test in hpc.c
- hpc.c now verifies HPC1 revisions (1.0 vs 1.5) and
prints the output a little prettier ;)
- power interrupts shouldn't establish on non-IP22
platforms.
 1.2 04-Oct-2003  tsutsui TAB/space cleanup.
 1.1 25-Sep-2003  lonewolf Support for HAL2 audio controller attached to the HPC ASIC, found on SGI Indy.

The driver is not too heavily tested and only supports audio playback and
master volume setting currently.
 1.3.4.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.4.6 17-Jan-2005  skrll Sync with HEAD.
 1.3.4.5 02-Nov-2004  skrll Sync with HEAD.
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 29-Dec-2003  skrll file haltwo.c was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.4.2.2 09-Jan-2005  kent audio_hw_if change
* make open() and close() optional
* add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
 1.4.2.1 03-Jan-2005  kent adopt the filter pipeline framework
 1.7.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.2.1 29-Apr-2005  kent sync with -current
 1.8.4.2 03-Sep-2007  yamt sync with head.
 1.8.4.1 30-Dec-2006  yamt sync with head.
 1.8.2.1 16-Sep-2006  ghen Pull up following revision(s) (requested by rumble in ticket #1497):
sys/arch/sgimips/hpc/haltwo.c: revision 1.10
Check the haltwo hardware present bit in the match function, rather than
in the attach function after we've thwacked several registers and
potentially wedged the machine. This fixes booting on Challenge S systems
and addresses PR 25202.
Many thanks to George Harvey for testing and feedback.
 1.9.18.1 08-Sep-2006  riz Pull up following revision(s) (requested by rumble in ticket #120):
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.58 via patch
sys/arch/sgimips/hpc/haltwo.c: revision 1.10
Check the haltwo hardware present bit in the match function, rather than
in the attach function after we've thwacked several registers and
potentially wedged the machine. This fixes booting on Challenge S systems
and addresses PR 25202.
Consequently, re-enable haltwo in the default kernel configuration.
Many thanks to George Harvey for testing and feedback.
 1.9.8.1 14-Sep-2006  yamt sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.2.1 12-Jan-2007  ad Sync with head.
 1.11.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.12.12.1 07-Aug-2007  matt Sync with HEAD.
 1.12.10.1 03-Oct-2007  garbled Sync with HEAD
 1.12.2.1 20-Aug-2007  ad Sync with HEAD.
 1.13.6.1 06-Nov-2007  matt sync with HEAD
 1.14.26.1 19-Oct-2008  haad Sync with HEAD.
 1.14.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.14.20.3 11-Mar-2010  yamt sync with head
 1.14.20.2 16-May-2009  yamt sync with head
 1.14.20.1 04-May-2009  yamt sync with head.
 1.14.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.15.12.1 29-Dec-2010  matt Merge changes from netbsd-5.
 1.15.4.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #964):
sys/arch/sgimips/hpc/haltwo.c: revision 1.16
set delta value for the mixer's master channel
 1.17.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.17.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.4.1 05-Mar-2011  rmind sync with head
 1.20.4.2 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.20.4.1 20-Nov-2011  jmcneill adapt to audiomp api changes
 1.20.2.1 17-Apr-2012  yamt sync with head
 1.22.26.1 28-Aug-2017  skrll Sync with HEAD
 1.22.8.1 03-Dec-2017  jdolecek update from HEAD
 1.23.10.1 10-Jun-2019  christos Sync with HEAD
 1.24.2.3 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.24.2.2 28-Apr-2019  isaki Correct debug message in previous commit.
 1.24.2.1 21-Apr-2019  isaki Adapt to audio2.
- The driver doesn't seem to support recording.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 25-Sep-2003  lonewolf branches: 1.1.4;
Support for HAL2 audio controller attached to the HPC ASIC, found on SGI Indy.

The driver is not too heavily tested and only supports audio playback and
master volume setting currently.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 25-Sep-2003  skrll file haltworeg.h was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.8 23-Nov-2011  jmcneill Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.7 25-Jan-2011  tsutsui branches: 1.7.4; 1.7.6;
Split device_t/softc. Tested on Indy.
 1.6 24-Sep-2009  tsutsui branches: 1.6.4; 1.6.6; 1.6.8;
Replace shutdownhook_establish(9) (which was added by me)
with pmf_device_register1(9).
 1.5 24-Aug-2008  tsutsui Pacify haltwo audio on shutdown hook to avoid noise on poweroff.
 1.4 04-Mar-2007  christos branches: 1.4.40; 1.4.44; 1.4.46; 1.4.50;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.3 11-Dec-2005  christos branches: 1.3.26;
merge ktrace-lwp.
 1.2 15-Jan-2005  kent branches: 1.2.10;
ansify and KNF
 1.1 25-Sep-2003  lonewolf branches: 1.1.4;
Support for HAL2 audio controller attached to the HPC ASIC, found on SGI Indy.

The driver is not too heavily tested and only supports audio playback and
master volume setting currently.
 1.1.4.5 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 25-Sep-2003  skrll file haltwovar.h was added on branch ktrace-lwp on 2004-08-03 10:40:06 +0000
 1.2.10.1 03-Sep-2007  yamt sync with head.
 1.3.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.4.50.1 19-Oct-2008  haad Sync with HEAD.
 1.4.46.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 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 28-Sep-2008  mjf Sync with HEAD.
 1.6.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.6.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.4.1 05-Mar-2011  rmind sync with head
 1.7.6.1 20-Nov-2011  jmcneill adapt to audiomp api changes
 1.7.4.1 17-Apr-2012  yamt sync with head
 1.73 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.72 24-Apr-2021  thorpej branches: 1.72.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.71 15-Sep-2018  macallan branches: 1.71.14;
remove long unused power button handler
 1.70 15-Sep-2018  macallan one more s/panel/button, now this actually works again.
 1.69 24-Jul-2016  macallan branches: 1.69.14; 1.69.16;
use bus_space_map()
 1.68 18-Feb-2015  macallan branches: 1.68.2;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.67 27-Oct-2012  chs branches: 1.67.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.66 01-Jul-2011  dyoung branches: 1.66.2; 1.66.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.65 25-Jan-2011  tsutsui Split device_t/softc. Tested on Indy.
 1.64 25-Jan-2011  tsutsui u_intNN_t -> uintNN_t
 1.63 14-Dec-2009  matt branches: 1.63.4; 1.63.6; 1.63.8;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.62 14-May-2009  macallan add a driver for the Indy's front panel buttons.
- power button presses are reported to sysmon
- volume control buttons are reported to PMF
TODO: add better key repeat code. The hardware keeps firing interrupts at us
whenever a button is down and not on - say - status change. If we don't clear
the interrupt we'll be fired on until someone clears it. We should probably
disable the entire interrupt and occasionally poll for button release.
 1.61 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.60 17-Oct-2007  garbled branches: 1.60.20; 1.60.28; 1.60.30; 1.60.34; 1.60.38;
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.59 23-Jul-2007  he branches: 1.59.6;
After move to 64-bit paddr_t, cast via vaddr_t before casting to void*.
OK'ed by macallan@.
 1.58 09-Jul-2007  ad branches: 1.58.2; 1.58.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.57 22-Feb-2007  rumble branches: 1.57.4; 1.57.6; 1.57.12;
Make this compile again.
 1.56 21-Feb-2007  rumble Disable handling of the power interrupt. We aren't handling it properly and
hitting any of the buttons results in infinite such interrupts.
 1.55 20-Feb-2007  rumble Add a reasonably disgusting hack to not complain about a non-configured
"sq" or "wdsc" device in the GIO32 SCSI and E++ adapter cases,
respectively.

This file is getting nasty, but we've just about covered all the bases now.
 1.54 20-Feb-2007  rumble Add wdsc devices for the GIO32 SCSI adapter.
 1.53 20-Feb-2007  rumble Only read the eeprom once per hpc.
 1.52 19-Feb-2007  rumble Support the sq(4) interface on the Challenge S's IOPLUS mezzanine. This
requires us to configure the IOPLUS to use the appropriate DMA channel,
depending on what other expansion cards may be installed. Further, we need
to do a bit more configuration of the sq(4) DMA engine, which apparently
was formerly being configured properly by the PROM. Use the same values,
which appear to work fine.

Also, extend the gio_arb_config interface as needed.

NB: We're currently setting the IOPLUS board to long burst, but it may be
better to use realtime. This will require some experimentation.
 1.51 29-Dec-2006  rumble branches: 1.51.2;
Tweak comments.
 1.50 29-Dec-2006  rumble IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.49 22-Dec-2006  rumble Prefix 'dma_data{in,out}_cmd' with 'scsi_', since that's what they're used
for. Also, remove the 'clk_freq' variable, since this value differs on a
per-platform (IP12 is 20MHz, others are 10MHz) basis.

NB: I have no idea what frequency the GIO SCSI cards use. We'll have to
re-investigate this if we ever come across one.
 1.48 22-Dec-2006  rumble Remove errnoneous register definitions and rename some to be more specific.
Also, remove unused/invalid fields in our hpc revision abstraction and
be sure to zero entries when they do not apply to a specific revision.
 1.47 22-Dec-2006  rumble Use SGIMIPS_BUS_SPACE_HPC, rather than hard-coding it.
 1.46 22-Dec-2006  rumble Determine if we've an onboard HPC. If not, we must set up the bus arbiter
appropriately. We may need to do further work to get the IOPLUS mezzanine
devices working as well.
 1.45 22-Dec-2006  rumble Break our list of HPC devices into HPC1 and HPC3 variants. This cleans up
the list a bit and avoids Challenge S from using the HPC1 offets for its
HPC3-based secondary ethernet on the IOPLUS mezzanine board.
 1.44 22-Dec-2006  rumble Indigo and Indigo2 machines have only one shared interrupt for the two
GIO slots. This differs from Indy, which has an interrupt per slot, neither
of which is the same as on the other two machines.

This lets my Phobos G160 run in both slots in my Indigo2 and my E++ adapter
works in both slots in my Indigo.
 1.43 22-Dec-2006  rumble EEPROM and LED controls occupy the same byte. Unify them again.
 1.42 22-Dec-2006  rumble Provide attaching hpc devices with the eeprom contents, should a chip be
connected to the HPC. The only real reason for doing this is to get the
mac addresses off of E++ ethernet boards and the Challenge S IOPLUS board.
If no eeprom is present, we read in invalid data and take some default
action (query ARCBIOS).
 1.41 22-Dec-2006  rumble Sprinkle static.
 1.40 22-Dec-2006  rumble Rework detecting the HPC revision. In most cases we can presume what it is
based on mach_type (or at least know the major revision). The only case we
really need to concern ourselves with is differentiating between HPC1
and HPC3 on IP22. Specifically, between a HPC3 on the Challenge S IOPLUS
board and a HPC1.5-based adapter in an Indy.
 1.39 22-Dec-2006  rumble Fix previous by including the necessary header.
 1.38 22-Dec-2006  rumble Remove superfluous extern declarations; they're already in the headers.
 1.37 01-Sep-2006  sekiya branches: 1.37.2;
Add missing equal sign.
 1.36 29-Mar-2006  thorpej Use device_cfdata().
 1.35 28-Dec-2005  kurahone branches: 1.35.4; 1.35.6; 1.35.8; 1.35.10; 1.35.12;
Added support for the IP22 IOC's parallel port (PI1).

Code contributed by Joe Britt.

Reviewed by <sekiya> and <kurahone>.
 1.34 11-Dec-2005  christos merge ktrace-lwp.
 1.33 26-Aug-2005  drochner s/locdesc_t/int/g
 1.32 28-Jun-2005  drochner branches: 1.32.2;
convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)
 1.31 30-Dec-2004  rumble Prepend HPC3 macros universally with "HPC3_" to distinctly recognise
the corresponding revision and maintain consistency with HPC1.

No functional change intended.
 1.30 30-Dec-2004  rumble Remove a few HPC1 register definitions for ones that don't exist.

Also, HPC1_ENET_INTDELAYVAL isn't a magic number. It turns the
interrupt delay off (by being the timer trigger bit), so name it
more appropriately.
 1.29 17-Aug-2004  rumble Add some infrastructure to support HPC-based ethernet adapters
(E++):
o The static configuration table now identifies by HPC offset.
o Added sq(4) entries for IP12, IP20, and IP24.
o Accomodated HPC revision forcing based on kernel config flags.
 1.28 11-Apr-2004  pooka Make das blinkenlights, well, blink on IP12 also.
 1.27 10-Apr-2004  pooka * The HPC endianness register isn't mapped on my IP12, so don't try to
unconditionally read it
* IP12 glue from Steve Rumble
 1.26 28-Feb-2004  sekiya branches: 1.26.2;
Blinkenlitzen for IP20 (Indigo).
 1.25 02-Jan-2004  sekiya IP20 has two z8530 chips -- one at 0xd00 for keyboard/mouse, one at 0xd10
for serial ports. Attach the former as zs1 to keep serial console goo as
simple as possible.
 1.24 30-Dec-2003  sekiya Force little-endian mode on hpc1, and attach zs on IP20.
 1.23 29-Dec-2003  sekiya Fixes to HPC abstraction layer from Steve Rumble:

- hpc1_hdd_{ctl,bufptr} and hpc3_hdd_{ctl,bufptr} are
established in hpcreg.h. All references to these fields
are updated with the exception of if_sq: (haltwo,
hpcdma). This makes reading the code and spotting bugs
easier.
- hpcdma.c was applying EOCHAIN to the wrong descriptor
word for the hpc1 case.
- I added scsi_max_xfer to the abstraction layer, and it
allows some crusty #defines in wdsc.c to be removed.
hpc1 now doesn't waste descriptors as it once did.
- hpcreg.h was updated to reflect the lack of XMITDONE
bit in hpc1. HPC1_REV15 added for a test in hpc.c
- hpc.c now verifies HPC1 revisions (1.0 vs 1.5) and
prints the output a little prettier ;)
- power interrupts shouldn't establish on non-IP22
platforms.
 1.22 16-Dec-2003  sekiya Introduce abstraction layer for HPC registers and values, which addresses the
divergence between HPC revision 1.5 and revision 3.

The wdsc driver has been updated to reflect this layer (and may now work on
IP20). The sq driver needs a bit more work before it can be committed.
 1.21 16-Dec-2003  sekiya A slighly more descriptive iocreg.h now lives in ../ioc.
 1.20 14-Dec-2003  sekiya Allow hpc to attach on IP20.
 1.19 04-Dec-2003  lonewolf Replace some magic numbers by symbolic constants.
 1.18 22-Nov-2003  sekiya Add dpclock driver (and minimal hpc1 goo) for ip20.
 1.17 20-Nov-2003  sekiya Add pckbc to device list.
 1.16 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.15 26-Sep-2003  lonewolf Attach haltwo on Indigo2 machines also, it reportedly works on them.
 1.14 25-Sep-2003  lonewolf Support for HAL2 audio controller attached to the HPC ASIC, found on SGI Indy.

The driver is not too heavily tested and only supports audio playback and
master volume setting currently.
 1.13 15-Jul-2003  lukem __KERNEL_RCSID()
 1.12 09-Nov-2002  thorpej branches: 1.12.6;
Fix signed/unsigned comparison warnings.
 1.11 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.10 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.9 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.8 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.7 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.6 25-Jan-2002  rafal Less odious hack for powerfail interrupt; even thought it's still odious,
at least now we only attempt to install the handler once.
 1.5 20-Nov-2001  rafal Stylistic fix to last.
 1.4 20-Nov-2001  rafal Fix up Jason's last cleanup (thanks for that, btw!!)... Don't attach
hpc child devices that don't match our systype. Attempting to attach
a wdsc1 on my Challenge S locks the box hard.
 1.3 18-Nov-2001  thorpej * Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct
config. Use machine type/subtype to determine which devices are
present.
* Add support for the second SCSI controller on the Indigo2.
 1.2 19-Aug-2001  wdk branches: 1.2.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1 11-May-2001  thorpej branches: 1.1.2;
Support for the HPC I/O peripheral ASIC. There is where SCSI, Ethernet,
etc. live on the Indigo2 and Indy.

From Rafal K. Boni.
 1.1.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.1.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.2.6.6 11-Nov-2002  nathanw Catch up to -current
 1.2.6.5 18-Oct-2002  nathanw Catch up to -current.
 1.2.6.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.6.1 19-Aug-2001  nathanw file hpc.c was added on branch nathanw_sa on 2002-01-08 00:27:27 +0000
 1.12.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.6.5 17-Jan-2005  skrll Sync with HEAD.
 1.12.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.12.6.2 25-Aug-2004  skrll Sync with HEAD.
 1.12.6.1 03-Aug-2004  skrll Sync with HEAD
 1.26.2.2 23-Jul-2004  tron Pull up revision 1.28 (requested by rumble in ticket #682):
Make das blinkenlights, well, blink on IP12 also.
 1.26.2.1 23-Jul-2004  tron Pull up revision 1.27 (requested by rumble in ticket #682):
* The HPC endianness register isn't mapped on my IP12, so don't try to
unconditionally read it
* IP12 glue from Steve Rumble
 1.32.2.4 03-Sep-2007  yamt sync with head.
 1.32.2.3 26-Feb-2007  yamt sync with head.
 1.32.2.2 30-Dec-2006  yamt sync with head.
 1.32.2.1 21-Jun-2006  yamt sync with head.
 1.35.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.35.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.35.8.2 03-Sep-2006  yamt sync with head.
 1.35.8.1 01-Apr-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.37.2.1 12-Jan-2007  ad Sync with head.
 1.51.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.57.12.1 03-Oct-2007  garbled Sync with HEAD
 1.57.6.1 11-Jul-2007  mjf Sync with head.
 1.57.4.2 20-Aug-2007  ad Sync with HEAD.
 1.57.4.1 15-Jul-2007  ad Sync with head.
 1.58.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.58.2.1 07-Aug-2007  matt Sync with HEAD.
 1.59.6.1 06-Nov-2007  matt sync with HEAD
 1.60.38.2 29-Dec-2010  matt Merge changes from netbsd-5.
 1.60.38.1 26-Aug-2009  matt Fixup (all but mipsco) to deal the new realities in mipsland.
 1.60.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.60.30.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #976):
sys/arch/sgimips/hpc/files.hpc: revision 1.14
sys/arch/sgimips/hpc/hpc.c: revision 1.62
sys/arch/sgimips/hpc/panel.c: revision 1.1
add a driver for the Indy's front panel buttons.
- power button presses are reported to sysmon
- volume control buttons are reported to PMF
TODO: add better key repeat code. The hardware keeps firing interrupts
at us whenever a button is down and not on - say - status change. If we
don't clear the interrupt we'll be fired on until someone clears it. We
should probably disable the entire interrupt and occasionally poll for
button release.
 1.60.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.60.20.3 11-Mar-2010  yamt sync with head
 1.60.20.2 16-May-2009  yamt sync with head
 1.60.20.1 04-May-2009  yamt sync with head.
 1.63.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.63.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.63.4.1 05-Mar-2011  rmind sync with head
 1.66.12.2 03-Dec-2017  jdolecek update from HEAD
 1.66.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.66.2.1 30-Oct-2012  yamt sync with head
 1.67.14.2 05-Oct-2016  skrll Sync with HEAD
 1.67.14.1 06-Apr-2015  skrll Sync with HEAD
 1.68.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.69.16.1 10-Jun-2019  christos Sync with HEAD
 1.69.14.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.71.14.2 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.71.14.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.72.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.22 13-Dec-2023  andvar Add (intptr_t) casts to fix "cast to pointer from integer of different size",
mainly for GENERIC64_32_* configs.
Also change segp->ds_len format specifier to %lld, which fixes DMA_DEBUG build.
 1.21 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.20 25-Jan-2011  tsutsui Some KNF and cosmetics.
 1.19 25-Jan-2011  tsutsui u_intNN_t -> uintNN_t
 1.18 25-Jan-2011  tsutsui Small bus_dma(9) tweaks:
- call bus_dmamap_create(9) after bus_dmamem_alloc(9) and bus_dmamem_map(9)
return successfully
- no need to use PAGE_SIZE for size of descriptor dmamap
- use bus_addr_t to store DMA address
- BUS_DMASYNC_PREWRITE is enough for host-to-device only descriptors

Tested on R5000 Indy.
 1.17 14-Dec-2009  matt branches: 1.17.4; 1.17.6; 1.17.8;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.16 10-May-2008  martin branches: 1.16.16;
Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.15 28-Apr-2008  martin branches: 1.15.2;
Remove clause 3 and 4 from TNF licenses
 1.14 17-Oct-2007  garbled branches: 1.14.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.13 23-Jul-2007  he branches: 1.13.6;
After move to 64-bit paddr_t, cast via vaddr_t before casting to void*.
OK'ed by macallan@.
 1.12 04-Mar-2007  christos branches: 1.12.2; 1.12.10; 1.12.12; 1.12.14;
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 30-Dec-2004  rumble branches: 1.10.10;
Prepend HPC3 macros universally with "HPC3_" to distinctly recognise
the corresponding revision and maintain consistency with HPC1.

No functional change intended.
 1.9 29-Dec-2003  sekiya Fixes to HPC abstraction layer from Steve Rumble:

- hpc1_hdd_{ctl,bufptr} and hpc3_hdd_{ctl,bufptr} are
established in hpcreg.h. All references to these fields
are updated with the exception of if_sq: (haltwo,
hpcdma). This makes reading the code and spotting bugs
easier.
- hpcdma.c was applying EOCHAIN to the wrong descriptor
word for the hpc1 case.
- I added scsi_max_xfer to the abstraction layer, and it
allows some crusty #defines in wdsc.c to be removed.
hpc1 now doesn't waste descriptors as it once did.
- hpcreg.h was updated to reflect the lack of XMITDONE
bit in hpc1. HPC1_REV15 added for a test in hpc.c
- hpc.c now verifies HPC1 revisions (1.0 vs 1.5) and
prints the output a little prettier ;)
- power interrupts shouldn't establish on non-IP22
platforms.
 1.8 16-Dec-2003  sekiya Introduce abstraction layer for HPC registers and values, which addresses the
divergence between HPC revision 1.5 and revision 3.

The wdsc driver has been updated to reflect this layer (and may now work on
IP20). The sq driver needs a bit more work before it can be committed.
 1.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 02-Apr-2003  thorpej branches: 1.6.2;
Use PAGE_SIZE rather than NBPG.
 1.5 09-Nov-2002  thorpej Avoid a strict-aliasing warning from GCC 3.3.
 1.4 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 18-Nov-2001  thorpej * Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct
config. Use machine type/subtype to determine which devices are
present.
* Add support for the second SCSI controller on the Indigo2.
 1.2 18-Nov-2001  thorpej * Add a callback to the front-end for the 33c93 driver to reset
the controller/SCSI bus.
* Implement controller/SCSI bus reset on SGI HPC3 SCSI using the
"channel reset" bit in the SCSI DMA channel control register.
 1.1 19-Aug-2001  wdk branches: 1.1.2; 1.1.8;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1.8.4 11-Nov-2002  nathanw Catch up to -current
 1.1.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.8.1 19-Aug-2001  nathanw file hpcdma.c was added on branch nathanw_sa on 2002-01-08 00:27:27 +0000
 1.1.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.2.1 19-Aug-2001  thorpej file hpcdma.c was added on branch kqueue on 2001-08-25 06:15:49 +0000
 1.6.2.4 17-Jan-2005  skrll Sync with HEAD.
 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.10.10.1 03-Sep-2007  yamt sync with head.
 1.11.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.12.12.1 07-Aug-2007  matt Sync with HEAD.
 1.12.10.1 03-Oct-2007  garbled Sync with HEAD
 1.12.2.1 20-Aug-2007  ad Sync with HEAD.
 1.13.6.1 06-Nov-2007  matt sync with HEAD
 1.14.20.1 11-Mar-2010  yamt sync with head
 1.15.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.16.16.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.17.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.17.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.4.1 05-Mar-2011  rmind sync with head
 1.12 27-Dec-2019  msaitoh s/transfered/transferred/
 1.11 01-Jul-2011  dyoung branches: 1.11.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.10 25-Jan-2011  tsutsui u_intNN_t -> uintNN_t
 1.9 25-Jan-2011  tsutsui Small bus_dma(9) tweaks:
- call bus_dmamap_create(9) after bus_dmamem_alloc(9) and bus_dmamem_map(9)
return successfully
- no need to use PAGE_SIZE for size of descriptor dmamap
- use bus_addr_t to store DMA address
- BUS_DMASYNC_PREWRITE is enough for host-to-device only descriptors

Tested on R5000 Indy.
 1.8 10-May-2008  martin branches: 1.8.20; 1.8.26; 1.8.28;
Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.7 28-Apr-2008  martin branches: 1.7.2;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 16-Dec-2003  sekiya Introduce abstraction layer for HPC registers and values, which addresses the
divergence between HPC revision 1.5 and revision 3.

The wdsc driver has been updated to reflect this layer (and may now work on
IP20). The sq driver needs a bit more work before it can be committed.
 1.4 13-Mar-2002  simonb branches: 1.4.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 18-Nov-2001  thorpej * Add a callback to the front-end for the 33c93 driver to reset
the controller/SCSI bus.
* Implement controller/SCSI bus reset on SGI HPC3 SCSI using the
"channel reset" bit in the SCSI DMA channel control register.
 1.2 10-Nov-2001  wdk branches: 1.2.2;
Complete overhaul of WD33c93 SCSI driver

- Full support for SCSI-2 Tagged commands (enabled by default)
- Implement save and restore datapointer messages
- Formalize interface between MI and MD drivers.
- decouple interface between MD driver and DMA routines
- Use scsipi layer where appropriate (Tags, Sync Negotiations etc)
- control blocks stored using kernel pool(9) functions
- evcnt(9) compliant counters
- Enable advanced features on later WD33c93 chips.
(Identify message out phase is hardware assisted)
- Improved timeout support (one per active control block)
- Improved MESG_IN and MESG_OUT handling
- Start to tidy up debugging output
- Numerous bug fixes and cleanups throughout

Changes are based largely on the NCR53c9x MI driver for ideas on
how to DTRT.
 1.1 19-Aug-2001  wdk branches: 1.1.2; 1.1.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.2.1 19-Aug-2001  thorpej file hpcdma.h was added on branch kqueue on 2001-08-25 06:15:49 +0000
 1.2.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 10-Nov-2001  nathanw file hpcdma.h was added on branch nathanw_sa on 2002-01-08 00:27:28 +0000
 1.4.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.12.1 03-Aug-2004  skrll Sync with HEAD
 1.7.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.8.28.1 08-Feb-2011  bouyer Sync with HEAD
 1.8.26.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.20.1 05-Mar-2011  rmind sync with head
 1.11.54.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.21 23-Feb-2025  andvar s/configururation/configuration/ in comments.
 1.20 25-Jan-2011  tsutsui branches: 1.20.92;
u_intNN_t -> uintNN_t
 1.19 19-Feb-2007  rumble branches: 1.19.68; 1.19.74; 1.19.76;
Support the sq(4) interface on the Challenge S's IOPLUS mezzanine. This
requires us to configure the IOPLUS to use the appropriate DMA channel,
depending on what other expansion cards may be installed. Further, we need
to do a bit more configuration of the sq(4) DMA engine, which apparently
was formerly being configured properly by the PROM. Use the same values,
which appear to work fine.

Also, extend the gio_arb_config interface as needed.

NB: We're currently setting the IOPLUS board to long burst, but it may be
better to use realtime. This will require some experimentation.
 1.18 22-Dec-2006  rumble branches: 1.18.2;
Remove errnoneous register definitions and rename some to be more specific.
Also, remove unused/invalid fields in our hpc revision abstraction and
be sure to zero entries when they do not apply to a specific revision.
 1.17 22-Dec-2006  rumble EEPROM and LED controls occupy the same byte. Unify them again.
 1.16 22-Dec-2006  rumble Provide attaching hpc devices with the eeprom contents, should a chip be
connected to the HPC. The only real reason for doing this is to get the
mac addresses off of E++ ethernet boards and the Challenge S IOPLUS board.
If no eeprom is present, we read in invalid data and take some default
action (query ARCBIOS).
 1.15 22-Dec-2006  rumble Rework detecting the HPC revision. In most cases we can presume what it is
based on mach_type (or at least know the major revision). The only case we
really need to concern ourselves with is differentiating between HPC1
and HPC3 on IP22. Specifically, between a HPC3 on the Challenge S IOPLUS
board and a HPC1.5-based adapter in an Indy.
 1.14 11-Dec-2005  christos branches: 1.14.20;
merge ktrace-lwp.
 1.13 30-Dec-2004  rumble branches: 1.13.10;
Prepend HPC3 macros universally with "HPC3_" to distinctly recognise
the corresponding revision and maintain consistency with HPC1.

No functional change intended.
 1.12 30-Dec-2004  rumble Remove a few HPC1 register definitions for ones that don't exist.

Also, HPC1_ENET_INTDELAYVAL isn't a magic number. It turns the
interrupt delay off (by being the timer trigger bit), so name it
more appropriately.
 1.11 17-Aug-2004  rumble Add defines for the four possible HPC GIO bus addresses.
 1.10 29-Dec-2003  sekiya Fixes to HPC abstraction layer from Steve Rumble:

- hpc1_hdd_{ctl,bufptr} and hpc3_hdd_{ctl,bufptr} are
established in hpcreg.h. All references to these fields
are updated with the exception of if_sq: (haltwo,
hpcdma). This makes reading the code and spotting bugs
easier.
- hpcdma.c was applying EOCHAIN to the wrong descriptor
word for the hpc1 case.
- I added scsi_max_xfer to the abstraction layer, and it
allows some crusty #defines in wdsc.c to be removed.
hpc1 now doesn't waste descriptors as it once did.
- hpcreg.h was updated to reflect the lack of XMITDONE
bit in hpc1. HPC1_REV15 added for a test in hpc.c
- hpc.c now verifies HPC1 revisions (1.0 vs 1.5) and
prints the output a little prettier ;)
- power interrupts shouldn't establish on non-IP22
platforms.
 1.9 16-Dec-2003  sekiya Introduce abstraction layer for HPC registers and values, which addresses the
divergence between HPC revision 1.5 and revision 3.

The wdsc driver has been updated to reflect this layer (and may now work on
IP20). The sq driver needs a bit more work before it can be committed.
 1.8 22-Nov-2003  sekiya Add dpclock driver (and minimal hpc1 goo) for ip20.
 1.7 18-Sep-2003  lonewolf Fix mistake in previous.
 1.6 18-Sep-2003  lonewolf Correct offsets for HPC_PBUS_CHx_{BP,DP} and add HPC_PBUS_DMACTL_* definitions.
 1.5 13-Mar-2002  simonb branches: 1.5.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.4 18-Nov-2001  thorpej * Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct
config. Use machine type/subtype to determine which devices are
present.
* Add support for the second SCSI controller on the Indigo2.
 1.3 19-Aug-2001  wdk branches: 1.3.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.2 07-Jun-2001  rafal branches: 1.2.2;
Add a bunch of defines for bits withing the ethernet-related registers so
the Seeq driver can use them instead of hardcoded constants.
 1.1 11-May-2001  thorpej Support for the HPC I/O peripheral ASIC. There is where SCSI, Ethernet,
etc. live on the Indigo2 and Indy.

From Rafal K. Boni.
 1.2.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.3.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.6.1 19-Aug-2001  nathanw file hpcreg.h was added on branch nathanw_sa on 2002-01-08 00:27:28 +0000
 1.5.12.5 17-Jan-2005  skrll Sync with HEAD.
 1.5.12.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.12.3 18-Sep-2004  skrll Sync with HEAD.
 1.5.12.2 25-Aug-2004  skrll Sync with HEAD.
 1.5.12.1 03-Aug-2004  skrll Sync with HEAD
 1.13.10.2 26-Feb-2007  yamt sync with head.
 1.13.10.1 30-Dec-2006  yamt sync with head.
 1.14.20.1 12-Jan-2007  ad Sync with head.
 1.18.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.19.76.1 08-Feb-2011  bouyer Sync with HEAD
 1.19.74.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.68.1 05-Mar-2011  rmind sync with head
 1.20.92.1 02-Aug-2025  perseant Sync with HEAD
 1.12 25-Jan-2011  tsutsui u_intNN_t -> uintNN_t
 1.11 22-Dec-2006  rumble branches: 1.11.70; 1.11.76; 1.11.78;
Prefix 'dma_data{in,out}_cmd' with 'scsi_', since that's what they're used
for. Also, remove the 'clk_freq' variable, since this value differs on a
per-platform (IP12 is 20MHz, others are 10MHz) basis.

NB: I have no idea what frequency the GIO SCSI cards use. We'll have to
re-investigate this if we ever come across one.
 1.10 22-Dec-2006  rumble Remove errnoneous register definitions and rename some to be more specific.
Also, remove unused/invalid fields in our hpc revision abstraction and
be sure to zero entries when they do not apply to a specific revision.
 1.9 22-Dec-2006  rumble Provide attaching hpc devices with the eeprom contents, should a chip be
connected to the HPC. The only real reason for doing this is to get the
mac addresses off of E++ ethernet boards and the Challenge S IOPLUS board.
If no eeprom is present, we read in invalid data and take some default
action (query ARCBIOS).
 1.8 11-Dec-2005  christos branches: 1.8.20;
merge ktrace-lwp.
 1.7 29-Dec-2003  sekiya branches: 1.7.16;
Fixes to HPC abstraction layer from Steve Rumble:

- hpc1_hdd_{ctl,bufptr} and hpc3_hdd_{ctl,bufptr} are
established in hpcreg.h. All references to these fields
are updated with the exception of if_sq: (haltwo,
hpcdma). This makes reading the code and spotting bugs
easier.
- hpcdma.c was applying EOCHAIN to the wrong descriptor
word for the hpc1 case.
- I added scsi_max_xfer to the abstraction layer, and it
allows some crusty #defines in wdsc.c to be removed.
hpc1 now doesn't waste descriptors as it once did.
- hpcreg.h was updated to reflect the lack of XMITDONE
bit in hpc1. HPC1_REV15 added for a test in hpc.c
- hpc.c now verifies HPC1 revisions (1.0 vs 1.5) and
prints the output a little prettier ;)
- power interrupts shouldn't establish on non-IP22
platforms.
 1.6 16-Dec-2003  sekiya Introduce abstraction layer for HPC registers and values, which addresses the
divergence between HPC revision 1.5 and revision 3.

The wdsc driver has been updated to reflect this layer (and may now work on
IP20). The sq driver needs a bit more work before it can be committed.
 1.5 22-Nov-2003  sekiya Add dpclock driver (and minimal hpc1 goo) for ip20.
 1.4 13-Mar-2002  simonb branches: 1.4.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 18-Nov-2001  thorpej * Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct
config. Use machine type/subtype to determine which devices are
present.
* Add support for the second SCSI controller on the Indigo2.
 1.2 19-Aug-2001  wdk branches: 1.2.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1 11-May-2001  thorpej branches: 1.1.2;
Support for the HPC I/O peripheral ASIC. There is where SCSI, Ethernet,
etc. live on the Indigo2 and Indy.

From Rafal K. Boni.
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.2.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.6.1 19-Aug-2001  nathanw file hpcvar.h was added on branch nathanw_sa on 2002-01-08 00:27:28 +0000
 1.4.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.12.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 30-Dec-2006  yamt sync with head.
 1.8.20.1 12-Jan-2007  ad Sync with head.
 1.11.78.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.76.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.70.1 05-Mar-2011  rmind sync with head
 1.60 05-Jul-2024  rin sys: Drop redundant NULL check before m_freem(9)

m_freem(9) safely has accepted NULL argument at least since 4.2BSD:
https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c

Compile-tested on amd64/ALL.

Suggested by knakahara@
 1.59 29-Jun-2024  riastradh branches: 1.59.2;
if_stats(9): Add ifp argument to if_stat..._ref.

This will enable us to pass the ifp through to a dtrace probe inside.

No functional change intended in this change, but this is an API
change visible to modules so it shouldn't be pulled up.

PR kern/58377
 1.58 10-Feb-2024  andvar s/alloted/allotted/ in comments.
 1.57 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.56 05-Dec-2023  andvar add explicit braces around SQ_DPRINTF() to fix dangling else compiler error.

fixes build with SQ_DEBUG option enabled for sgimips.
 1.55 18-Sep-2022  thorpej Eliminate use of IFF_OACTIVE.
 1.54 30-Jan-2020  martin Fix typo
 1.53 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.52 23-May-2019  msaitoh branches: 1.52.4;
Whitespace fix (mainly tabify).
 1.51 23-May-2019  msaitoh -No functional change:
- KNF
- u_int*_t -> uint*_t.
 1.50 05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.49 26-Jun-2018  msaitoh branches: 1.49.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.48 15-Dec-2016  ozaki-r branches: 1.48.14;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.47 08-Dec-2016  ozaki-r Apply deferred if_start framework

if_schedule_deferred_start checks if the if_snd queue contains packets,
so drivers don't need to check it by themselves.
 1.46 10-Jun-2016  ozaki-r branches: 1.46.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.45 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.44 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.43 02-Feb-2012  tls branches: 1.43.6; 1.43.24;
Entropy-pool implementation move and cleanup.

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

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

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

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

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

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.42 01-Jul-2011  dyoung branches: 1.42.2; 1.42.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.41 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.40 25-Jan-2011  tsutsui KNF and misc cosmetics.
 1.39 25-Jan-2011  tsutsui Split device_t/softc. Tested on Indy.
 1.38 25-Jan-2011  tsutsui u_intNN_t -> uintNN_t
 1.37 10-Jan-2011  tsutsui branches: 1.37.2; 1.37.4;
Use ether_aton_r() in sys/net/if_ethersubr.c instead of home grown copies.
Hint from ryo@. Tested on IP32 mec(4).
 1.36 05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.35 19-Jan-2010  pooka branches: 1.35.2; 1.35.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.34 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.33 04-Mar-2007  christos branches: 1.33.44; 1.33.62;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.32 20-Feb-2007  rumble Add a real probe so that we don't attach sq(4) on GIO32 SCSI adapters.
 1.31 19-Feb-2007  rumble Support the sq(4) interface on the Challenge S's IOPLUS mezzanine. This
requires us to configure the IOPLUS to use the appropriate DMA channel,
depending on what other expansion cards may be installed. Further, we need
to do a bit more configuration of the sq(4) DMA engine, which apparently
was formerly being configured properly by the PROM. Use the same values,
which appear to work fine.

Also, extend the gio_arb_config interface as needed.

NB: We're currently setting the IOPLUS board to long burst, but it may be
better to use realtime. This will require some experimentation.
 1.30 22-Dec-2006  rumble branches: 1.30.2;
Provide attaching hpc devices with the eeprom contents, should a chip be
connected to the HPC. The only real reason for doing this is to get the
mac addresses off of E++ ethernet boards and the Challenge S IOPLUS board.
If no eeprom is present, we read in invalid data and take some default
action (query ARCBIOS).
 1.29 11-Dec-2005  christos branches: 1.29.20;
merge ktrace-lwp.
 1.28 03-Jun-2005  martin branches: 1.28.2;
Constify
 1.27 31-Dec-2004  rumble Do not report unexpected interrupts when not debugging. These
seem to occur fairly often under normal operation with HPC1.5.
Also, do not return if the interrupt is unexpected, but see if
there is anything to handle regardless, which appears to always
be the case with HPC1.5.
 1.26 30-Dec-2004  rumble Prepend HPC3 macros universally with "HPC3_" to distinctly recognise
the corresponding revision and maintain consistency with HPC1.

No functional change intended.
 1.25 30-Dec-2004  rumble Remove a few HPC1 register definitions for ones that don't exist.

Also, HPC1_ENET_INTDELAYVAL isn't a magic number. It turns the
interrupt delay off (by being the timer trigger bit), so name it
more appropriately.
 1.24 30-Dec-2004  rumble Wrap seeq and hpc register reads and writes in macros for
readability. While here, engage in some KNF and 80-column policing.
No functional changes intended.
 1.23 29-Dec-2004  rumble Fix the HPC1 transmit logic, which was previously very broken.

HPC1 does not mark transmitted descriptors like HPC3. We must
query the HPC1 chip to determine what it expects the next
descriptor to be, reclaim used ones, and restart if necessary. Each
revision's corresponding logic now lives in its own
sq_txring_hpc{1,3} function.

HPC1's transmit interrupt conditions also differ from HPC3, so
remove the INTR bits from descriptors when tagging new packets on
to the end of the chain in order to avoid unwanted interrupts.

Also, be extra careful when restarting the transmit ring. Since
transmit interrupts seem to be relatively slow on HPC1, sq_start
may be called while the DMA engine is quiescent, and before a
transmit interrupt is asserted. We cannot behave like HPC3, which
begins transmission from the first packet pulled from IFQ if the
DMA engine is quiescent as this would skip enqueued packets. It
appears that sq_start is never called before HPC3 asserts an
interrupt, which restarts the transmit queue at the appropriate
place. However, this often happens with HPC1 and we cannot assume
that if DMA is inactive in sq_start, then all previously queued
packets have fled the coop.
XXX Is there a similar race possible with HPC3?

HPC3 logic should remain functionally unchanged, and HPC1 should
finally work properly.
 1.22 29-Dec-2004  rumble Remove the static sq_trace array and make it per-device as
multiple seeq interfaces may exist. While here, add a few trace
actions, move the related macros into sqvar.h, and enhance the
sq_trace_dump output a bit.
 1.21 30-Oct-2004  thorpej When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.20 30-Dec-2003  sekiya branches: 1.20.2; 1.20.4;
Adapt if_sq to HPC abstraction layer. It took both Steve Rumble and myself
to untangle the unhappiness that arises from the design differences between
HPC1 and HPC3.
 1.19 30-Oct-2003  matt Fix another lasttx uninitialized variable
 1.18 04-Oct-2003  tsutsui TAB/space cleanup.
 1.17 15-Jul-2003  lukem __KERNEL_RCSID()
 1.16 13-Jan-2003  bouyer branches: 1.16.2;
When padding frames smaller than ethernet minimum size, make sure we supply
a buffer long enouth, with the padding bytes initialised.
Also pad to ETHER_MIN_LEN - ETHER_CRC_LEN, not ETHER_MIN_LEN (padded frames
were 4 bytes too long).
 1.15 09-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.14 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 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.11 02-May-2002  rafal branches: 1.11.4;
Add interrupt counter for Seeq interrupts; also, make sure to reset back to
"recieve only my frames & broadcasts" and clear the ALLMULTI flag if we have
no multicast addresses in our list.
 1.10 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.9 20-Nov-2001  rafal Post Jason's autoconfig cleanup, the DMA tags are actually passed in from
the parent, so we don't need to look at the innards of bus_dma anymore.
Also, remove the Todo item pertaining to autoconfig cleanup from the list
in the comments.
 1.8 18-Nov-2001  thorpej * Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct
config. Use machine type/subtype to determine which devices are
present.
* Add support for the second SCSI controller on the Indigo2.
 1.7 08-Jul-2001  thorpej branches: 1.7.2; 1.7.8;
bcopy -> memcpy, bzero -> memset
 1.6 08-Jul-2001  thorpej - If the multicast address list changes, make sure to kick the chip.
- Remove unnecessary includes.
- Slight cosmetic change in sq_start().
 1.5 08-Jul-2001  thorpej Use sys/dev/arcbios.
 1.4 08-Jun-2001  thorpej Make sure to always re-sync the rx buffer dmamap if recycling the
rx buffer.
 1.3 07-Jun-2001  thorpej - Differentiate beteen the 8003 and 80c03 (the 80c03 has some additional
features).
- Implement crude multicast support -- enable reception of all multicast
frames if we have any addresses on the multicast list. TODO: use the
64-bit hash table on the 80c03.
- Implement promiscuous mode.

IPv6 doesn't quite work yet -- DAD finds a duplicate for the
link-local. The 8003 hears its own transmissions, but IFF_SIMPLEX
is not set, so I'm a little confused.
 1.2 07-Jun-2001  rafal Fix a deadlock in the tx code -- the code checked the DMA status before
sync'ing the descriptor, leading to a race where the packet could complete
after the DMA check but before the sync of the descriptor, sending the code
into unknown territory and the DMA engine into space. Also, fix a bug with
spurious watchdog resets going off due to the if_timer not always being set
on transmit.

Finally, clean up use of hardcoded magic numbers, get them from hpcreg.h
when possible.
 1.1 11-May-2001  thorpej Support for the Seeq 8003 Ethernet attached to the HPC ASIC,
found on Indigo2 and Indy.

From Rafal K. Boni.
 1.7.8.7 15-Jan-2003  thorpej Sync with HEAD.
 1.7.8.6 11-Nov-2002  nathanw Catch up to -current
 1.7.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.7.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.7.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.8.1 08-Jul-2001  nathanw file if_sq.c was added on branch nathanw_sa on 2002-01-08 00:27:28 +0000
 1.7.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.7.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.4.1 27-Jan-2003  jmc Pullup revisions 1.15-1.16 via hand patch (requested by bouyer in ticket #1097)
When padding frames smaller than ethernet minimum size, make sure
we supply a buffer long enouth, with the padding bytes initialised.
Also pad to ETHER_MIN_LEN - ETHER_CRC_LEN, not ETHER_MIN_LEN
(padded frames were 4 bytes too long).
 1.16.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.16.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.16.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.16.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.4.2 06-Apr-2005  he Pull up revisions 1.22-1.23 (requested by rumble in ticket #1054):
Fix the HPC1 transmit logic, which was previously very broken.
 1.20.4.1 24-Jan-2005  he Pull up revision 1.21 (requested by thorpej in ticket #939):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#27678.
 1.20.2.2 06-Apr-2005  he Pull up revisions 1.22-1.23 (requested by rumble in ticket #1054):
Fix the HPC1 transmit logic, which was previously very broken.
 1.20.2.1 06-Apr-2005  he Pull up revision 1.21 (requested by thorpej in ticket #939):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#27678.
Dragged along for the benefit of ticket #1054 which will be committed shortly.
 1.28.2.3 03-Sep-2007  yamt sync with head.
 1.28.2.2 26-Feb-2007  yamt sync with head.
 1.28.2.1 30-Dec-2006  yamt sync with head.
 1.29.20.1 12-Jan-2007  ad Sync with head.
 1.30.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.30.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.33.62.2 12-Sep-2009  matt Don't cast a paddr if you don't have to.
 1.33.62.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.33.44.2 11-Aug-2010  yamt sync with head.
 1.33.44.1 11-Mar-2010  yamt sync with head
 1.35.4.2 05-Mar-2011  rmind sync with head
 1.35.4.1 30-May-2010  rmind sync with head
 1.35.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.37.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.37.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.37.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.42.6.1 18-Feb-2012  mrg merge to -current.
 1.42.2.1 17-Apr-2012  yamt sync with head
 1.43.24.4 05-Feb-2017  skrll Sync with HEAD
 1.43.24.3 09-Jul-2016  skrll Sync with HEAD
 1.43.24.2 19-Mar-2016  skrll Sync with HEAD
 1.43.24.1 06-Apr-2015  skrll Sync with HEAD
 1.43.6.1 03-Dec-2017  jdolecek update from HEAD
 1.46.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.48.14.1 28-Jul-2018  pgoyette Sync with HEAD
 1.49.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.49.2.1 10-Jun-2019  christos Sync with HEAD
 1.52.4.1 29-Feb-2020  ad Sync with head.
 1.59.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 16-Dec-2003  sekiya A slighly more descriptive iocreg.h now lives in ../ioc.
 1.2 13-Mar-2002  simonb branches: 1.2.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 11-May-2001  thorpej branches: 1.1.2; 1.1.8;
IOC1/2 memory map.

From Rafal K. Boni.
 1.1.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.8.1 11-May-2001  nathanw file iocreg.h was added on branch nathanw_sa on 2002-04-01 07:42:23 +0000
 1.1.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.12.1 03-Aug-2004  skrll Sync with HEAD
 1.4 09-Apr-2018  christos rename panel to button.
 1.3 18-Feb-2015  macallan branches: 1.3.16;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.2 16-Feb-2011  jmcneill branches: 1.2.14; 1.2.32;
validate cf_name in driver match method
 1.1 14-May-2009  macallan branches: 1.1.2; 1.1.4; 1.1.8; 1.1.10; 1.1.12; 1.1.14;
add a driver for the Indy's front panel buttons.
- power button presses are reported to sysmon
- volume control buttons are reported to PMF
TODO: add better key repeat code. The hardware keeps firing interrupts at us
whenever a button is down and not on - say - status change. If we don't clear
the interrupt we'll be fired on until someone clears it. We should probably
disable the entire interrupt and occasionally poll for button release.
 1.1.14.1 17-Feb-2011  bouyer Sync with HEAD
 1.1.12.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.10.2 29-Dec-2010  matt Merge changes from netbsd-5.
 1.1.10.1 14-May-2009  matt file panel.c was added on branch matt-nb5-mips64 on 2010-12-29 07:19:28 +0000
 1.1.8.1 05-Mar-2011  rmind sync with head
 1.1.4.2 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #976):
sys/arch/sgimips/hpc/files.hpc: revision 1.14
sys/arch/sgimips/hpc/hpc.c: revision 1.62
sys/arch/sgimips/hpc/panel.c: revision 1.1
add a driver for the Indy's front panel buttons.
- power button presses are reported to sysmon
- volume control buttons are reported to PMF
TODO: add better key repeat code. The hardware keeps firing interrupts
at us whenever a button is down and not on - say - status change. If we
don't clear the interrupt we'll be fired on until someone clears it. We
should probably disable the entire interrupt and occasionally poll for
button release.
 1.1.4.1 14-May-2009  snj file panel.c was added on branch netbsd-5 on 2009-09-26 18:03:06 +0000
 1.1.2.2 16-May-2009  yamt sync with head
 1.1.2.1 14-May-2009  yamt file panel.c was added on branch yamt-nfs-mp on 2009-05-16 10:41:16 +0000
 1.2.32.1 06-Apr-2015  skrll Sync with HEAD
 1.2.14.1 03-Dec-2017  jdolecek update from HEAD
 1.3.16.1 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.11 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.10 18-Feb-2015  macallan branches: 1.10.30;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.9 15-Mar-2008  cube branches: 1.9.48; 1.9.68;
Split device_t and softc for pckbc(4) and its attachments.
 1.8 05-Jan-2008  ad branches: 1.8.2; 1.8.6;
Fix includes.
 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 09-Jul-2007  ad branches: 1.6.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.5 11-Dec-2005  christos branches: 1.5.30; 1.5.32; 1.5.38;
merge ktrace-lwp.
 1.4 19-Feb-2004  bjh21 branches: 1.4.4; 1.4.18;
Remove pckbc_machdep_cnattach() -- it's no longer needed.
 1.3 10-Dec-2003  lonewolf Make this compile and apparently work (it generates interrupts properly, at
least).
XXX The is_console test is horribly ugly but necessary for the pckbc_cnattach
XXX coming soon.
 1.2 04-Dec-2003  keihan netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.1 20-Nov-2003  sekiya Add driver for pckbc at hpc. There's an interrupt issue that still needs
to be resolved.
 1.4.18.3 17-Mar-2008  yamt sync with head.
 1.4.18.2 21-Jan-2008  yamt sync with head
 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 19-Feb-2004  skrll file pckbc_hpc.c was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.5.38.1 03-Oct-2007  garbled Sync with HEAD
 1.5.32.1 11-Jul-2007  mjf Sync with head.
 1.5.30.1 15-Jul-2007  ad Sync with head.
 1.6.10.3 23-Mar-2008  matt sync with HEAD
 1.6.10.2 09-Jan-2008  matt sync with HEAD
 1.6.10.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.8.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.2.1 24-Mar-2008  keiichi sync with head.
 1.9.68.1 06-Apr-2015  skrll Sync with HEAD
 1.9.48.1 03-Dec-2017  jdolecek update from HEAD
 1.10.30.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.17 01-Nov-2022  andvar s/varaible/variable/ and s/varible/variable/ in comments.
 1.16 03-Dec-2021  andvar fix various typos in comments, log messages and documentation.
 1.15 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.14 24-Apr-2021  thorpej branches: 1.14.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.13 27-Dec-2019  msaitoh branches: 1.13.10;
s/transfered/transferred/
 1.12 13-Jul-2014  dholland branches: 1.12.28;
"peripheral", not "peripherial".
 1.11 01-Jul-2011  dyoung branches: 1.11.12; 1.11.26;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.10 09-Jun-2011  rmind Convert simple_lock/ltsleep to mutex/condvar and malloc to kmem.
 1.9 16-Feb-2011  jmcneill branches: 1.9.2;
validate cf_name in driver match method
 1.8 25-Jan-2011  tsutsui u_intNN_t -> uintNN_t
 1.7 16-Dec-2008  christos branches: 1.7.6; 1.7.8; 1.7.10;
replace bitmask_snprintf(9) with snprintb(3)
 1.6 22-Apr-2008  cegger branches: 1.6.2; 1.6.10;
Make this build again. From Hans Rosenfeld.
 1.5 18-Apr-2008  cegger branches: 1.5.2;
Fix panics at boot and some other misc bugs. From Hans Rosenfeld.
 1.4 16-Apr-2008  cegger device_t / softc split. From Hans Rosenfeld.
 1.3 16-Apr-2008  cegger ppbus device_t / softc splitting. From Hans Rosenfeld.
 1.2 04-Mar-2007  christos branches: 1.2.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.1 28-Dec-2005  kurahone branches: 1.1.18; 1.1.28;
Added support for the IP22 IOC's parallel port (PI1).

Code contributed by Joe Britt.

Reviewed by <sekiya> and <kurahone>.
 1.1.28.1 12-Mar-2007  rmind Sync with HEAD.
 1.1.18.3 03-Sep-2007  yamt sync with head.
 1.1.18.2 21-Jun-2006  yamt sync with head.
 1.1.18.1 28-Dec-2005  yamt file pi1ppc.c was added on branch yamt-lazymbuf on 2006-06-21 14:55:29 +0000
 1.2.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.2.1 18-May-2008  yamt sync with head.
 1.6.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.6.2.1 04-May-2009  yamt sync with head.
 1.7.10.2 17-Feb-2011  bouyer Sync with HEAD
 1.7.10.1 08-Feb-2011  bouyer Sync with HEAD
 1.7.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.6.2 12-Jun-2011  rmind sync with head
 1.7.6.1 05-Mar-2011  rmind sync with head
 1.9.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.11.26.1 10-Aug-2014  tls Rebase.
 1.11.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.28.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.13.10.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.14.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 05-Mar-2009  msaitoh Fix typo(s/interupt/interrupt/)
 1.1 28-Dec-2005  kurahone branches: 1.1.18; 1.1.80; 1.1.88; 1.1.94;
Added support for the IP22 IOC's parallel port (PI1).

Code contributed by Joe Britt.

Reviewed by <sekiya> and <kurahone>.
 1.1.94.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.88.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.80.1 04-May-2009  yamt sync with head.
 1.1.18.2 21-Jun-2006  yamt sync with head.
 1.1.18.1 28-Dec-2005  yamt file pi1ppcreg.h was added on branch yamt-lazymbuf on 2006-06-21 14:55:30 +0000
 1.8 13-Aug-2024  andvar s/Thresold/Threshold/ in comments.
 1.7 03-Dec-2021  andvar branches: 1.7.10;
fix various typos in comments, log messages and documentation.
 1.6 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.5 09-Jun-2011  rmind Convert simple_lock/ltsleep to mutex/condvar and malloc to kmem.
 1.4 25-Jan-2011  tsutsui branches: 1.4.2;
u_intNN_t -> uintNN_t
 1.3 16-Apr-2008  cegger branches: 1.3.26; 1.3.32; 1.3.34;
ppbus device_t / softc splitting. From Hans Rosenfeld.
 1.2 04-Mar-2007  christos branches: 1.2.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.1 28-Dec-2005  kurahone branches: 1.1.18; 1.1.28;
Added support for the IP22 IOC's parallel port (PI1).

Code contributed by Joe Britt.

Reviewed by <sekiya> and <kurahone>.
 1.1.28.1 12-Mar-2007  rmind Sync with HEAD.
 1.1.18.3 03-Sep-2007  yamt sync with head.
 1.1.18.2 21-Jun-2006  yamt sync with head.
 1.1.18.1 28-Dec-2005  yamt file pi1ppcvar.h was added on branch yamt-lazymbuf on 2006-06-21 14:55:30 +0000
 1.2.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.34.1 08-Feb-2011  bouyer Sync with HEAD
 1.3.32.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.26.2 12-Jun-2011  rmind sync with head
 1.3.26.1 05-Mar-2011  rmind sync with head
 1.4.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.7.10.1 02-Aug-2025  perseant Sync with HEAD
 1.22 26-Aug-2006  bjh21 Move the sgimips "sbic" driver from arch/sgimips/hpc/sbic.c to
dev/ic/wd33c93.c. This may not be the best WD33C93 driver we've
got, but it's the most recently worked on and probably the most
portable, so it seems like a good basis for further work (and in
particular an acorn26 driver for the Acorn SCSI card). There's
no functional change in this commit, and sgimips kernels still
compile.
 1.21 29-Mar-2006  thorpej Use device_cfdata().
 1.20 08-Mar-2006  lukem branches: 1.20.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.19 11-Dec-2005  christos branches: 1.19.4; 1.19.6; 1.19.8; 1.19.10;
merge ktrace-lwp.
 1.18 03-Jun-2005  martin branches: 1.18.2;
Constify
 1.17 10-Jan-2004  sekiya de-__P, sprinkle some KNF.
 1.16 04-Oct-2003  tsutsui TAB/space cleanup.
 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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.13 18-Jun-2003  drochner branches: 1.13.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.12 03-May-2003  wiz DMA, not dma nor Dma.
 1.11 09-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.10 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.9 05-Apr-2002  bouyer Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.
 1.8 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.7 08-Mar-2002  thorpej Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map). Try to deal with this:

* Group all information about the backend allocator for a pool in a
separate structure. The pool references this structure, rather than
the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
to become available, but will still fail if it cannot callocate KVA
space for the pages. If this happens, carefully drain all pools using
the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
some pages, and use that information to make draining easier and more
efficient.
* Get rid of PR_URGENT. There was only one use of it, and it could be
dealt with by the caller.

From art@openbsd.org.
 1.6 11-Feb-2002  wiz s/seperate/separate/
 1.5 21-Nov-2001  thorpej sbic -> wd33c93, in preparation for the core driver going into
sys/dev/ic.
 1.4 18-Nov-2001  thorpej * Add a callback to the front-end for the 33c93 driver to reset
the controller/SCSI bus.
* Implement controller/SCSI bus reset on SGI HPC3 SCSI using the
"channel reset" bit in the SCSI DMA channel control register.
 1.3 10-Nov-2001  wdk branches: 1.3.2;
Tidy up debug logic

Fix compile errors when DIAGNOSTIC or DEBUG options disabled.
 1.2 10-Nov-2001  wdk Complete overhaul of WD33c93 SCSI driver

- Full support for SCSI-2 Tagged commands (enabled by default)
- Implement save and restore datapointer messages
- Formalize interface between MI and MD drivers.
- decouple interface between MD driver and DMA routines
- Use scsipi layer where appropriate (Tags, Sync Negotiations etc)
- control blocks stored using kernel pool(9) functions
- evcnt(9) compliant counters
- Enable advanced features on later WD33c93 chips.
(Identify message out phase is hardware assisted)
- Improved timeout support (one per active control block)
- Improved MESG_IN and MESG_OUT handling
- Start to tidy up debugging output
- Numerous bug fixes and cleanups throughout

Changes are based largely on the NCR53c9x MI driver for ideas on
how to DTRT.
 1.1 19-Aug-2001  wdk branches: 1.1.2; 1.1.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.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.1.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.2.1 19-Aug-2001  thorpej file sbic.c was added on branch kqueue on 2001-08-25 06:15:50 +0000
 1.3.2.7 11-Nov-2002  nathanw Catch up to -current
 1.3.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.5 17-Apr-2002  nathanw Catch up to -current.
 1.3.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.3.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.2.1 10-Nov-2001  nathanw file sbic.c was added on branch nathanw_sa on 2002-01-08 00:27:28 +0000
 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.18.2.2 30-Dec-2006  yamt sync with head.
 1.18.2.1 21-Jun-2006  yamt sync with head.
 1.19.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.19.8.3 03-Sep-2006  yamt sync with head.
 1.19.8.2 01-Apr-2006  yamt sync with head.
 1.19.8.1 13-Mar-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.20.2.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.8 26-Aug-2006  bjh21 Move the sgimips "sbic" driver from arch/sgimips/hpc/sbic.c to
dev/ic/wd33c93.c. This may not be the best WD33C93 driver we've
got, but it's the most recently worked on and probably the most
portable, so it seems like a good basis for further work (and in
particular an acorn26 driver for the Acorn SCSI card). There's
no functional change in this commit, and sgimips kernels still
compile.
 1.7 08-Mar-2006  lukem Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.6; 1.6.8; 1.6.10;
merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 13-Mar-2002  simonb branches: 1.4.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 21-Nov-2001  thorpej sbic -> wd33c93, in preparation for the core driver going into
sys/dev/ic.
 1.2 10-Nov-2001  wdk branches: 1.2.2;
Complete overhaul of WD33c93 SCSI driver

- Full support for SCSI-2 Tagged commands (enabled by default)
- Implement save and restore datapointer messages
- Formalize interface between MI and MD drivers.
- decouple interface between MD driver and DMA routines
- Use scsipi layer where appropriate (Tags, Sync Negotiations etc)
- control blocks stored using kernel pool(9) functions
- evcnt(9) compliant counters
- Enable advanced features on later WD33c93 chips.
(Identify message out phase is hardware assisted)
- Improved timeout support (one per active control block)
- Improved MESG_IN and MESG_OUT handling
- Start to tidy up debugging output
- Numerous bug fixes and cleanups throughout

Changes are based largely on the NCR53c9x MI driver for ideas on
how to DTRT.
 1.1 19-Aug-2001  wdk branches: 1.1.2; 1.1.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.2.1 19-Aug-2001  thorpej file sbicreg.h was added on branch kqueue on 2001-08-25 06:15:50 +0000
 1.2.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 10-Nov-2001  nathanw file sbicreg.h was added on branch nathanw_sa on 2002-01-08 00:27:29 +0000
 1.4.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.12.1 03-Aug-2004  skrll 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.6.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.6.8.2 03-Sep-2006  yamt sync with head.
 1.6.8.1 13-Mar-2006  yamt sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.12 26-Aug-2006  bjh21 Move the sgimips "sbic" driver from arch/sgimips/hpc/sbic.c to
dev/ic/wd33c93.c. This may not be the best WD33C93 driver we've
got, but it's the most recently worked on and probably the most
portable, so it seems like a good basis for further work (and in
particular an acorn26 driver for the Acorn SCSI card). There's
no functional change in this commit, and sgimips kernels still
compile.
 1.11 08-Mar-2006  lukem Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10;
merge ktrace-lwp.
 1.9 07-Dec-2004  thorpej branches: 1.9.10;
Use "struct scsipi_command" in internal command structures so that
we have enough space for 16-byte CDBs.
 1.8 24-Feb-2004  wiz occured -> occurred. From Peter Postma.
 1.7 10-Jan-2004  sekiya de-__P, sprinkle some KNF.
 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 13-Mar-2002  simonb branches: 1.5.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.4 21-Nov-2001  thorpej sbic -> wd33c93, in preparation for the core driver going into
sys/dev/ic.
 1.3 18-Nov-2001  thorpej * Add a callback to the front-end for the 33c93 driver to reset
the controller/SCSI bus.
* Implement controller/SCSI bus reset on SGI HPC3 SCSI using the
"channel reset" bit in the SCSI DMA channel control register.
 1.2 10-Nov-2001  wdk branches: 1.2.2;
Complete overhaul of WD33c93 SCSI driver

- Full support for SCSI-2 Tagged commands (enabled by default)
- Implement save and restore datapointer messages
- Formalize interface between MI and MD drivers.
- decouple interface between MD driver and DMA routines
- Use scsipi layer where appropriate (Tags, Sync Negotiations etc)
- control blocks stored using kernel pool(9) functions
- evcnt(9) compliant counters
- Enable advanced features on later WD33c93 chips.
(Identify message out phase is hardware assisted)
- Improved timeout support (one per active control block)
- Improved MESG_IN and MESG_OUT handling
- Start to tidy up debugging output
- Numerous bug fixes and cleanups throughout

Changes are based largely on the NCR53c9x MI driver for ideas on
how to DTRT.
 1.1 19-Aug-2001  wdk branches: 1.1.2; 1.1.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.2.1 19-Aug-2001  thorpej file sbicvar.h was added on branch kqueue on 2001-08-25 06:15:50 +0000
 1.2.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 10-Nov-2001  nathanw file sbicvar.h was added on branch nathanw_sa on 2002-01-08 00:27:29 +0000
 1.5.12.4 18-Dec-2004  skrll Sync with HEAD.
 1.5.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.12.1 03-Aug-2004  skrll Sync with HEAD
 1.9.10.2 30-Dec-2006  yamt sync with head.
 1.9.10.1 21-Jun-2006  yamt sync with head.
 1.10.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.10.8.2 03-Sep-2006  yamt sync with head.
 1.10.8.1 13-Mar-2006  yamt sync with head.
 1.10.6.1 22-Apr-2006  simonb Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.15 13-Apr-2015  riastradh MD rnd.h cleanups. Please let me know if I broke anything!
 1.14 02-Feb-2012  tls branches: 1.14.6; 1.14.24;
Entropy-pool implementation move and cleanup.

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

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

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

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

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

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.13 19-Nov-2011  tls branches: 1.13.2;
First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

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

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

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

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

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

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

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

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

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

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

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

Manual pages for the new kernel interfaces are forthcoming.
 1.12 25-Jan-2011  tsutsui branches: 1.12.4;
KNF and misc cosmetics.
 1.11 25-Jan-2011  tsutsui Split device_t/softc. Tested on Indy.
 1.10 25-Jan-2011  tsutsui u_intNN_t -> uintNN_t
 1.9 11-Dec-2005  christos branches: 1.9.100; 1.9.106; 1.9.108;
merge ktrace-lwp.
 1.8 30-Dec-2004  rumble Prepend HPC3 macros universally with "HPC3_" to distinctly recognise
the corresponding revision and maintain consistency with HPC1.

No functional change intended.
 1.7 29-Dec-2004  rumble HPC1 seems to benefit from larger rings. This should be especially
true on the transmit side, which appears to be significantly slower at
interrupting than HPC3.

XXX I used to be able to occasionally wedge the chip with
SQ_NTXDESC == 32, but have not yet been able to reproduce that
behaviour this evening with a larger value.
 1.6 29-Dec-2004  rumble Remove the static sq_trace array and make it per-device as
multiple seeq interfaces may exist. While here, add a few trace
actions, move the related macros into sqvar.h, and enhance the
sq_trace_dump output a bit.
 1.5 30-Dec-2003  sekiya branches: 1.5.2; 1.5.6;
Adapt if_sq to HPC abstraction layer. It took both Steve Rumble and myself
to untangle the unhappiness that arises from the design differences between
HPC1 and HPC3.
 1.4 02-May-2002  rafal branches: 1.4.10;
Add interrupt counter for Seeq interrupts; also, make sure to reset back to
"recieve only my frames & broadcasts" and clear the ALLMULTI flag if we have
no multicast addresses in our list.
 1.3 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 07-Jun-2001  thorpej branches: 1.2.2; 1.2.8;
- Differentiate beteen the 8003 and 80c03 (the 80c03 has some additional
features).
- Implement crude multicast support -- enable reception of all multicast
frames if we have any addresses on the multicast list. TODO: use the
64-bit hash table on the 80c03.
- Implement promiscuous mode.

IPv6 doesn't quite work yet -- DAD finds a duplicate for the
link-local. The 8003 hears its own transmissions, but IFF_SIMPLEX
is not set, so I'm a little confused.
 1.1 11-May-2001  thorpej Support for the Seeq 8003 Ethernet attached to the HPC ASIC,
found on Indigo2 and Indy.

From Rafal K. Boni.
 1.2.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.2.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.8.1 07-Jun-2001  nathanw file sqvar.h was added on branch nathanw_sa on 2002-04-01 07:42:25 +0000
 1.2.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.4.10.4 17-Jan-2005  skrll Sync with HEAD.
 1.4.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.10.1 03-Aug-2004  skrll Sync with HEAD
 1.5.6.1 06-Apr-2005  he Pull up revisions 1.6-1.7 (requested by rumble in ticket #1054):
Fix the HPC1 transmit logic, which was previously very broken.
 1.5.2.1 06-Apr-2005  he Pull up revisions 1.6-1.7 (requested by rumble in ticket #1054):
Fix the HPC1 transmit logic, which was previously very broken.
 1.9.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.9.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.100.1 05-Mar-2011  rmind sync with head
 1.12.4.1 17-Apr-2012  yamt sync with head
 1.13.2.1 18-Feb-2012  mrg merge to -current.
 1.14.24.1 06-Jun-2015  skrll Sync with HEAD
 1.14.6.1 03-Dec-2017  jdolecek update from HEAD
 1.35 02-Sep-2018  tsutsui Fix wdsc(4) probe failure on HPC1.5 machines (Indigo R3k/R4k, IP6/IP10/IP12).

The alignment adjustment code was removed in rev 1.36 for common
mips bus_space changes, but the code was not bus_space related
but used for uint32_t register acccess during probe.

Reported and tested by Naruaki Etomi in PR port-sgimips/53522.
Should be pulled up to netbsd-8.
 1.34 18-Feb-2015  macallan branches: 1.34.10; 1.34.16; 1.34.18;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.33 27-Oct-2012  chs branches: 1.33.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.32 01-Jul-2011  dyoung branches: 1.32.2; 1.32.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.31 25-Jan-2011  tsutsui Some KNF and cosmetics.
 1.30 25-Jan-2011  tsutsui - MAXPHYS is enough for DMA xfer size (hpc->scsi_max_xfer seems too large)
- switch BUS_DMASYNC_*READ and BUS_DMASYNC_*WRITE properly in
bus_dmamap_sync(9) ops per each xfer dir

Tested on R5000 Indy.
 1.29 14-Dec-2009  matt branches: 1.29.4; 1.29.6; 1.29.8;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.28 12-Feb-2009  rumble WD33C93 has only two registers, which often times aren't mapped to adjacent
bus space locations. Map them individually, instead.
 1.27 27-Jan-2009  tsutsui branches: 1.27.2;
- use device_t and cfdata_t
- rename variables for readability after device_t/softc split
- use proper pointer types

No binary changes.
 1.26 25-Jan-2009  bjh21 Split device_t from wd33c93_softc. Reviewed by cube; tested on sgimips
by tsutsui.
 1.25 10-May-2008  martin branches: 1.25.6; 1.25.14;
Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.24 28-Apr-2008  martin branches: 1.24.2;
Remove clause 3 and 4 from TNF licenses
 1.23 17-Oct-2007  garbled branches: 1.23.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.22 06-May-2007  rumble branches: 1.22.10;
Use burst dma for all systems, since it's supported by all HPCs and runs
with about 25% higher throughput on my Indy and ST32430N.
 1.21 30-Mar-2007  rumble branches: 1.21.4;
The wd33c93 chip appears to be clocked at 20MHz for all systems with a HPC.
 1.20 04-Mar-2007  christos branches: 1.20.2; 1.20.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 20-Feb-2007  rumble Add probe for wdsc so that we do not falsely attach wdsc(4) devices to E++
ethernet adapters.

By resetting the chip we also allow the wd33c93 attach routines to succeed.
Otherwise, device register accesses would result in a bus error.
 1.18 22-Dec-2006  rumble branches: 1.18.2;
Prefix 'dma_data{in,out}_cmd' with 'scsi_', since that's what they're used
for. Also, remove the 'clk_freq' variable, since this value differs on a
per-platform (IP12 is 20MHz, others are 10MHz) basis.

NB: I have no idea what frequency the GIO SCSI cards use. We'll have to
re-investigate this if we ever come across one.
 1.17 01-Oct-2006  bjh21 Allow wd33c93 attachments to choose what DMA mode it should use, and arrange
to use burst mode on sec(4), which makes it slightly but significantly faster.
 1.16 26-Aug-2006  bjh21 branches: 1.16.2; 1.16.4;
Move the sgimips "sbic" driver from arch/sgimips/hpc/sbic.c to
dev/ic/wd33c93.c. This may not be the best WD33C93 driver we've
got, but it's the most recently worked on and probably the most
portable, so it seems like a good basis for further work (and in
particular an acorn26 driver for the Acorn SCSI card). There's
no functional change in this commit, and sgimips kernels still
compile.
 1.15 11-Dec-2005  christos branches: 1.15.4; 1.15.8;
merge ktrace-lwp.
 1.14 10-Jan-2004  sekiya branches: 1.14.16;
de-__P, sprinkle some KNF.
 1.13 29-Dec-2003  sekiya Fixes to HPC abstraction layer from Steve Rumble:

- hpc1_hdd_{ctl,bufptr} and hpc3_hdd_{ctl,bufptr} are
established in hpcreg.h. All references to these fields
are updated with the exception of if_sq: (haltwo,
hpcdma). This makes reading the code and spotting bugs
easier.
- hpcdma.c was applying EOCHAIN to the wrong descriptor
word for the hpc1 case.
- I added scsi_max_xfer to the abstraction layer, and it
allows some crusty #defines in wdsc.c to be removed.
hpc1 now doesn't waste descriptors as it once did.
- hpcreg.h was updated to reflect the lack of XMITDONE
bit in hpc1. HPC1_REV15 added for a test in hpc.c
- hpc.c now verifies HPC1 revisions (1.0 vs 1.5) and
prints the output a little prettier ;)
- power interrupts shouldn't establish on non-IP22
platforms.
 1.12 16-Dec-2003  sekiya Introduce abstraction layer for HPC registers and values, which addresses the
divergence between HPC revision 1.5 and revision 3.

The wdsc driver has been updated to reflect this layer (and may now work on
IP20). The sq driver needs a bit more work before it can be committed.
 1.11 15-Jul-2003  lukem __KERNEL_RCSID()
 1.10 02-Oct-2002  thorpej branches: 1.10.6;
Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 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.7 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.6 21-Nov-2001  thorpej sbic -> wd33c93, in preparation for the core driver going into
sys/dev/ic.
 1.5 20-Nov-2001  thorpej The 2nd SCSI controller is now supported; remove it from the TODO list.
 1.4 18-Nov-2001  thorpej * Clean up HPC autoconfiguration a little. Pass device register and
DMA register offsets, as well as IRQ, to children. Use direct
config. Use machine type/subtype to determine which devices are
present.
* Add support for the second SCSI controller on the Indigo2.
 1.3 18-Nov-2001  thorpej * Add a callback to the front-end for the 33c93 driver to reset
the controller/SCSI bus.
* Implement controller/SCSI bus reset on SGI HPC3 SCSI using the
"channel reset" bit in the SCSI DMA channel control register.
 1.2 10-Nov-2001  wdk branches: 1.2.2;
Complete overhaul of WD33c93 SCSI driver

- Full support for SCSI-2 Tagged commands (enabled by default)
- Implement save and restore datapointer messages
- Formalize interface between MI and MD drivers.
- decouple interface between MD driver and DMA routines
- Use scsipi layer where appropriate (Tags, Sync Negotiations etc)
- control blocks stored using kernel pool(9) functions
- evcnt(9) compliant counters
- Enable advanced features on later WD33c93 chips.
(Identify message out phase is hardware assisted)
- Improved timeout support (one per active control block)
- Improved MESG_IN and MESG_OUT handling
- Start to tidy up debugging output
- Numerous bug fixes and cleanups throughout

Changes are based largely on the NCR53c9x MI driver for ideas on
how to DTRT.
 1.1 19-Aug-2001  wdk branches: 1.1.2; 1.1.6;
Initial implementation of WD33C9x SCSI driver for SGI IP22 platforms.

Based on mvme68k and Atari drivers for the same chipset with the
addition of bus_space support. Attempts have been made to seperate out the
machine dependent dma components and more work is required in this area.

Tested on SGI R4K Indy, but has little testing on other platforms.
 1.1.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.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.1.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.2.1 19-Aug-2001  thorpej file wdsc.c was added on branch kqueue on 2001-08-25 06:15:50 +0000
 1.2.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 10-Nov-2001  nathanw file wdsc.c was added on branch nathanw_sa on 2002-01-08 00:27:29 +0000
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14.16.3 03-Sep-2007  yamt sync with head.
 1.14.16.2 26-Feb-2007  yamt sync with head.
 1.14.16.1 30-Dec-2006  yamt sync with head.
 1.15.8.1 03-Sep-2006  yamt sync with head.
 1.15.4.1 09-Sep-2006  rpaulo sync with head
 1.16.4.1 22-Oct-2006  yamt sync with head
 1.16.2.2 12-Jan-2007  ad Sync with head.
 1.16.2.1 18-Nov-2006  ad Sync with head.
 1.18.2.4 07-May-2007  yamt sync with head.
 1.18.2.3 15-Apr-2007  yamt sync with head.
 1.18.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.18.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.20.4.1 11-Jul-2007  mjf Sync with head.
 1.20.2.2 27-May-2007  ad Sync with head.
 1.20.2.1 10-Apr-2007  ad Sync with head.
 1.21.4.1 22-May-2007  matt Update to HEAD.
 1.22.10.1 06-Nov-2007  matt sync with HEAD
 1.23.20.2 11-Mar-2010  yamt sync with head
 1.23.20.1 04-May-2009  yamt sync with head.
 1.24.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.25.14.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.25.6.1 03-Mar-2009  skrll 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.29.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.29.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.4.1 05-Mar-2011  rmind sync with head
 1.32.12.2 03-Dec-2017  jdolecek update from HEAD
 1.32.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.32.2.1 30-Oct-2012  yamt sync with head
 1.33.14.1 06-Apr-2015  skrll Sync with HEAD
 1.34.18.1 10-Jun-2019  christos Sync with HEAD
 1.34.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.34.10.1 10-Sep-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #1017):

sys/arch/sgimips/conf/INSTALL32_IP2x: revision 1.10
sys/arch/sgimips/stand/boot/Makefile: revision 1.20
sys/arch/sgimips/sgimips/machdep.c: revision 1.146
sys/arch/sgimips/hpc/wdsc.c: revision 1.35
distrib/sgimips/instkernel/Makefile: revision 1.13

Disable misc options to shrink an INSTALL kernel for IP2x.

The ARC BIOS on Indy seems to have ~8MB limit.

Fixes PR port-sgimips/53378 from Naruaki Etomi.
Should be pulled up to netbsd-7 and netbsd-8.

-

Fix build failure without options DDB and with pseudo-device ksyms.
There is a typo for ksyms (NKSYMS vs NKSYM).

Also use consistent "#if NKSYMS" rather than "#if NKSYMS > 0" etc.
and add comments after corresponding #endif for readability.

Fixes PR port-sgimips/53521 from Naruaki Etomi.
Should be pulled up to (at least) netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generat ecoff for old machines.
objcopy(1) was used instead of elf2ecoff(1) since Makefile rev 1.9:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sgimips/stand/boot/Makefile#rev1.9
but it looks ELF binaries generated by recent binutils are too complicated
to convert them to ecoff for old machines by objcopy(1).

Reported by Naruaki Etomi in PR port-sgimips/53519.
Should be pulled up to at least netbsd-8.

-

Fix wdsc(4) probe failure on HPC1.5 machines (Indigo R3k/R4k, IP6/IP10/IP12).

The alignment adjustment code was removed in rev 1.36 for common
mips bus_space changes, but the code was not bus_space related
but used for uint32_t register acccess during probe.

Reported and tested by Naruaki Etomi in PR port-sgimips/53522.
Should be pulled up to netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generate ecoff kernel.

Reported by Naruaki Etomi in PR port-sgimips/53518.

Should be pulled up to netbsd-7 and netbsd-8.
 1.26 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.25 12-Jul-2018  maxv branches: 1.25.36;
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.24 21-Dec-2015  christos branches: 1.24.16; 1.24.18;
Add mips fenv.h (From FreeBSD)
 1.23 23-Jul-2014  alnsn branches: 1.23.4;
Rename sljitarch.h to sljit_machdep.h.
 1.22 25-Nov-2012  alnsn branches: 1.22.10;
Add sljitarch.h to all mips machines.
 1.21 17-Jul-2011  joerg branches: 1.21.2; 1.21.12;
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.20 12-Aug-2009  matt Nuke a.out support for MIPS.
 1.19 25-Nov-2008  he Don't be lazy and let one directory's Makefile install an include
file from another directory, as that only causes problems with
mtree later on when encountering the /.. path component. Instead,
descend into dev/ and use the Makefile there to install dev/crmfbreg.h
in the appropriate directory.
 1.18 06-Nov-2008  macallan install crmfbreg.h
 1.17 18-Feb-2007  ad branches: 1.17.42; 1.17.46; 1.17.52; 1.17.54; 1.17.56;
+ mutex.h, rwlock.h
 1.16 26-Jul-2006  drochner branches: 1.16.10;
don't install <machine/db_machdep.h>, this is kernel only
 1.15 11-Dec-2005  christos branches: 1.15.4; 1.15.8;
merge ktrace-lwp.
 1.14 08-May-2004  kleink branches: 1.14.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.13 18-Jan-2003  thorpej branches: 1.13.2;
Merge the nathanw_sa branch.
 1.12 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.11 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.10 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.9 28-Nov-2001  manu branches: 1.9.8;
Back out the copy of theses files to userland
 1.8 28-Nov-2001  manu We need to copy new SVR4 header files to /usr/include/sys...
 1.7 08-Jul-2001  thorpej branches: 1.7.2; 1.7.8;
Use sys/dev/arcbios.
 1.6 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.5 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.4 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
 1.3 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.2 26-Jun-2000  kleink branches: 1.2.2; 1.2.4;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file Makefile was added on branch minoura-xpg4dl on 2000-06-22 17:03:09 +0000
 1.2.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.3 21-Apr-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 26-Jun-2000  bouyer file Makefile was added on branch thorpej_scsipi on 2000-11-20 20:23:43 +0000
 1.7.8.6 11-Dec-2002  thorpej Sync with HEAD.
 1.7.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.7.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.7.8.3 08-Jan-2002  nathanw Catch up to -current.
 1.7.8.2 17-Nov-2001  wdk mcontext support for MIPS based ports.
 1.7.8.1 08-Jul-2001  wdk file Makefile was added on branch nathanw_sa on 2001-11-17 23:12:13 +0000
 1.7.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.7.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.8.2 31-Aug-2002  gehenna catch up with -current.
 1.9.8.1 19-May-2002  gehenna Remove port-dependent conf.h.
 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.14.12.2 26-Feb-2007  yamt sync with head.
 1.14.12.1 30-Dec-2006  yamt sync with head.
 1.15.8.1 11-Aug-2006  yamt sync with head
 1.15.4.1 09-Sep-2006  rpaulo sync with head
 1.16.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.17.56.2 26-Feb-2009  snj Pull up following revision(s) (requested by macallan in ticket #523):
sys/arch/sgimips/Makefile: revision 1.7
sys/arch/sgimips/dev/Makefile: revision 1.1
sys/arch/sgimips/include/Makefile: revision 1.19
Don't be lazy and let one directory's Makefile install an include
file from another directory, as that only causes problems with
mtree later on when encountering the /.. path component. Instead,
descend into dev/ and use the Makefile there to install dev/crmfbreg.h
in the appropriate directory.
 1.17.56.1 25-Feb-2009  snj Pull up following revision(s) (requested by macallan in ticket #510):
sys/arch/sgimips/include/Makefile: revision 1.18
install crmfbreg.h
 1.17.54.1 19-Jan-2009  skrll Sync with HEAD.
 1.17.52.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.17.46.2 19-Aug-2009  yamt sync with head.
 1.17.46.1 04-May-2009  yamt sync with head.
 1.17.42.1 17-Jan-2009  mjf Sync with HEAD.
 1.21.12.3 03-Dec-2017  jdolecek update from HEAD
 1.21.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.12.1 25-Feb-2013  tls resync with head
 1.21.2.1 16-Jan-2013  yamt sync with (a bit old) head
 1.22.10.1 10-Aug-2014  tls Rebase.
 1.23.4.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.24.18.1 10-Jun-2019  christos Sync with HEAD
 1.24.16.1 28-Jul-2018  pgoyette Sync with HEAD
 1.25.36.1 02-Aug-2025  perseant Sync with HEAD
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file ansi.h was added on branch thorpej_scsipi on 2000-11-20 20:23:43 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file ansi.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:10 +0000
 1.2 12-Aug-2009  matt Nuke a.out support for MIPS.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.136; 1.1.150;
Initial commit.
 1.1.150.1 24-Oct-2010  jym Sync with HEAD
 1.1.136.1 19-Aug-2009  yamt 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 14-Jun-2000  bouyer file aout_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:23:43 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file aout_machdep.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:10 +0000
 1.2 08-Jul-2001  thorpej Use sys/dev/arcbios.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file arcs.h was added on branch thorpej_scsipi on 2000-11-20 20:23:43 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file arcs.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:11 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file asm.h was added on branch thorpej_scsipi on 2000-11-20 20:23:43 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file asm.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:11 +0000
 1.11 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.10 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.9 11-May-2007  rumble branches: 1.9.10;
Update a prototype corresponding to rev. 1.36 of sgimips/autoconf.c.
 1.8 11-Dec-2005  christos branches: 1.8.26; 1.8.30; 1.8.32; 1.8.38;
merge ktrace-lwp.
 1.7 28-Feb-2005  sekiya branches: 1.7.4;
De-__P()
 1.6 17-Nov-2003  keihan branches: 1.6.8; 1.6.10;
www.netbsd.org -> www.NetBSD.org
 1.5 13-Mar-2002  simonb branches: 1.5.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.4 18-Oct-2001  mhitch branches: 1.4.4;
Initial boot device determination code: makebootdev() to parse boot command
line parameters, and device_register() to try to match the boot device. Works
on a Challenge S (and similar machines), but will need more work for other
SCSI adapters.
 1.3 09-Jul-2001  thorpej branches: 1.3.2;
Count and display the number of CPUs present on the system.
 1.2 08-Jul-2001  thorpej - Use the identifier strings that are fetched by the MI ARC BIOS
code.
- Garbage-collect some non-useful stuff from the mainbus_attach_args.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file autoconf.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file autoconf.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:12 +0000
 1.3.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.3.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.1 18-Oct-2001  nathanw file autoconf.h was added on branch nathanw_sa on 2002-04-01 07:42:25 +0000
 1.5.12.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.12.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.7.4.1 03-Sep-2007  yamt sync with head.
 1.8.38.1 22-May-2007  matt Update to HEAD.
 1.8.32.1 11-Jul-2007  mjf Sync with head.
 1.8.30.1 27-May-2007  ad Sync with head.
 1.8.26.1 17-May-2007  yamt sync with head.
 1.9.10.1 06-Nov-2007  matt sync with HEAD
 1.6 08-Aug-2008  tsutsui Bump BOOTINFO_MAGIC to prevent old kernels (including netbsd-4) crashing
when bootinfo data is passed from newer bootloaders.

Note old bootloaders can still load newer kernels.
 1.5 26-Jan-2008  tsutsui branches: 1.5.6; 1.5.10; 1.5.12; 1.5.16;
Replace bootinfo stuff on sgimips (which has been disabled in bootloader)
with ones used on arc (which has been working for a year) and
enable it in bootloader. Tested on IP32.
 1.4 11-Dec-2005  christos branches: 1.4.50; 1.4.56;
merge ktrace-lwp.
 1.3 24-Mar-2004  drochner branches: 1.3.16;
remove license clauses 3 and 4 from my cpoyright notices
 1.2 21-Nov-2001  thorpej branches: 1.2.2; 1.2.4; 1.2.20;
Change symtab info to unsigned longs.
 1.1 21-Nov-2001  thorpej Add bootinfo stuff for NetBSD/sgimips. Changes to kernel and bootloader
forthcoming.
 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.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 21-Nov-2001  thorpej file bootinfo.h was added on branch kqueue on 2002-01-10 19:48:28 +0000
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 21-Nov-2001  nathanw file bootinfo.h was added on branch nathanw_sa on 2002-01-08 00:27:30 +0000
 1.3.16.1 04-Feb-2008  yamt sync with head.
 1.4.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.50.1 23-Mar-2008  matt sync with HEAD
 1.5.16.1 19-Oct-2008  haad Sync with HEAD.
 1.5.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.10.1 04-May-2009  yamt sync with head.
 1.5.6.1 28-Sep-2008  mjf Sync with HEAD.
 1.2 12-Aug-2009  matt Nuke a.out support for MIPS.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.136; 1.1.150;
Initial commit.
 1.1.150.1 24-Oct-2010  jym Sync with HEAD
 1.1.136.1 19-Aug-2009  yamt 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 14-Jun-2000  bouyer file bsd-aout.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file bsd-aout.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:12 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file bswap.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file bswap.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:13 +0000
 1.29 17-Jul-2011  dyoung Switch MIPS and MIPS-ish architectures to new-style <sys/bus.h>. This
involves moving some inline bus_space(9) implementation into .c files.
 1.28 10-Feb-2009  rumble Ready these for IP6.
 1.27 28-Apr-2008  martin branches: 1.27.8; 1.27.14;
Remove clause 3 and 4 from TNF licenses
 1.26 13-Feb-2008  macallan branches: 1.26.6; 1.26.8; 1.26.10;
add bus_space_mmap()
 1.25 17-Oct-2007  garbled branches: 1.25.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.24 17-Jul-2007  macallan branches: 1.24.10;
use 64bit paddr_t and bus_addr_t so we can mmap DMA buffers uncached
 1.23 04-Mar-2007  christos branches: 1.23.2; 1.23.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 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.21 08-Jun-2006  martin branches: 1.21.12;
Implement bus_space_*_stream_* methods for sgimips - so that we can use the
atheros wlan driver. Thanks to Izumi Tsutsui for lots of input. All errors,
as usualy, are mine though.
 1.20 26-May-2006  tsutsui Tweak bus_space_barrier(9) macro to appease
"left-hand operand of comma expression has no effect"
warnings by gcc4.
 1.19 16-Apr-2006  tsutsui branches: 1.19.2;
_ds_vaddr member in struct sgimips_bus_dma_segment is a virtual address,
so it should be vaddr_t rather than bus_addr_t.
 1.18 01-Mar-2006  yamt branches: 1.18.2; 1.18.4; 1.18.6;
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.17 16-Feb-2006  perry 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.16 24-Dec-2005  perry branches: 1.16.2; 1.16.4; 1.16.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.15 11-Dec-2005  christos merge ktrace-lwp.
 1.14 09-Mar-2005  matt branches: 1.14.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.13 13-Jan-2004  sekiya branches: 1.13.8; 1.13.10;
Call sgimips_bus_dma_init() in mach_init to set up the proper MIPS1/MIPS3
bus_dma_sync() routine.
 1.12 13-Jan-2004  sekiya Implement bus routines for MIPS1 processors. Originally from Steve Rumble,
massaged by pooka@.
 1.11 12-Jan-2004  sekiya CRIME revision 1.1 has a bug that affects PIO operations to/from the MACE.
The recommended workaround is a 5-10ms delay before and after accesses.
Therefore, move the affected bus_space_* operations from bus.h to bus.c
and special-case MACE accesses.

CRIME accesses are not affected, so introduce SGIMIPS_BUS_SPACE_CRIME and
use it as the CRIME tag.

My ip32 seems a little bit happier with this change, and my ip22 didn't
notice the change.
 1.10 07-Oct-2003  tsutsui Use proper mips_dcache_{wb,inv,wbinv}_range() ops in dmamap sync function
if possible. Tested on my O2 (with r5ksc patch).

XXX should we apply similar changes to mips/bus_dma.c and use it?
 1.9 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.8 15-Jun-2003  fvdl branches: 1.8.2;
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.7 28-Jan-2003  kent Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it.
 1.6 23-Dec-2002  pooka add bus_space_vaddr()

from rafal
 1.5 17-Mar-2002  simonb Make sure that private DMA flags don't overlap with standard DMA flags;
start these at 0x10000 to leave room for an increase in the latter.
 1.4 19-Jul-2001  thorpej branches: 1.4.6;
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.3 07-Mar-2001  thorpej branches: 1.3.2;
Add the BUS_DMA_STREAMING flag.
 1.2 26-Jun-2000  simonb branches: 1.2.2; 1.2.4;
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.1 14-Jun-2000  soren branches: 1.1.2; 1.1.4;
Initial commit.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file bus.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:13 +0000
 1.1.2.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.2.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.2.2.3 12-Mar-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 26-Jun-2000  bouyer file bus.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.3.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.1 03-Aug-2001  lukem update to -current
 1.4.6.3 29-Dec-2002  thorpej Sync with HEAD.
 1.4.6.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.6.1 19-Jul-2001  nathanw file bus.h was added on branch nathanw_sa on 2002-04-01 07:42:25 +0000
 1.8.2.4 01-Apr-2005  skrll Sync with HEAD.
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.13.8.1 29-Apr-2005  kent sync with -current
 1.14.4.4 27-Feb-2008  yamt sync with head.
 1.14.4.3 03-Sep-2007  yamt sync with head.
 1.14.4.2 26-Feb-2007  yamt sync with head.
 1.14.4.1 21-Jun-2006  yamt sync with head.
 1.16.6.2 01-Jun-2006  kardel 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.16.2.2 18-Feb-2006  yamt keep vmspace rather than proc in sgimips_bus_dmamap.
 1.16.2.1 18-Feb-2006  yamt sync with head.
 1.18.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.18.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.18.2.2 26-Jun-2006  yamt sync with head.
 1.18.2.1 24-May-2006  yamt sync with head.
 1.19.2.1 19-Jun-2006  chap Sync with head.
 1.21.12.2 12-Mar-2007  rmind Sync with HEAD.
 1.21.12.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.23.10.1 03-Oct-2007  garbled Sync with HEAD
 1.23.2.1 20-Aug-2007  ad Sync with HEAD.
 1.24.10.2 23-Mar-2008  matt sync with HEAD
 1.24.10.1 06-Nov-2007  matt sync with HEAD
 1.25.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.26.10.2 04-May-2009  yamt sync with head.
 1.26.10.1 16-May-2008  yamt sync with head.
 1.26.8.1 18-May-2008  yamt sync with head.
 1.26.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.27.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.8.1 03-Mar-2009  skrll Sync with HEAD.
 1.3 16-Apr-2022  andvar fix various typos in comments and log messages.
 1.2 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.1 01-Jul-2011  dyoung branches: 1.1.12; 1.1.30;
Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet. Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
 1.1.30.1 06-Apr-2015  skrll Sync with HEAD
 1.1.12.1 03-Dec-2017  jdolecek update from HEAD
 1.2 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.1 01-Jul-2011  dyoung branches: 1.1.12; 1.1.30;
Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet. Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
 1.1.30.1 06-Apr-2015  skrll Sync with HEAD
 1.1.12.1 03-Dec-2017  jdolecek update from HEAD
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file cdefs.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file cdefs.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:13 +0000
 1.4 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.3 27-Feb-2002  christos branches: 1.3.8;
- define other DEV_ constants that the local port uses.
- delete cdev_decl(mm) since <sys/conf.h> does it.
 1.2 08-Jul-2001  thorpej branches: 1.2.2; 1.2.8;
Use sys/dev/arcbios.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file conf.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file conf.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:13 +0000
 1.2.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.2.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 08-Jul-2001  nathanw file conf.h was added on branch nathanw_sa on 2002-02-28 04:11:36 +0000
 1.2.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.2.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.3.8.1 19-May-2002  gehenna Remove port-dependent conf.h.
 1.4 04-Sep-2001  simonb branches: 1.4.6;
May as well include <mips/cpuregs.h> in <mips/cpu.h> once rather than
in every MIPS port's <machine/cpu.h>.
 1.3 04-Sep-2001  simonb Centralise struct cpu_info declaration and related info to <mips/cpu.h>.
 1.2 30-May-2001  mrg branches: 1.2.2;
use _KERNEL_OPT
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8;
Initial commit.
 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 14-Jun-2000  bouyer file cpu.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file cpu.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:14 +0000
 1.2.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.6.2 04-Sep-2001  simonb May as well include <mips/cpuregs.h> in <mips/cpu.h> once rather than
in every MIPS port's <machine/cpu.h>.
 1.4.6.1 04-Sep-2001  simonb file cpu.h was added on branch nathanw_sa on 2001-09-04 06:23:18 +0000
 1.1 05-Feb-2003  nakayama Replace machine/rnd.h with more appropriate name to share it
with cycle counter based microtime in kern/kern_microtime.c.
 1.3 09-Jul-2011  matt Default to DB_ELF_SYMBOLS and DB_ELFSIZE 32
 1.2 04-Sep-2001  simonb branches: 1.2.6;
Standardise the format of MIPS' <machine/db_machdep.h>.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10;
Initial commit.
 1.1.10.1 13-Sep-2001  thorpej Update the kqueue branch to 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 14-Jun-2000  bouyer file db_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file db_machdep.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:15 +0000
 1.2.6.2 04-Sep-2001  simonb Standardise the format of MIPS' <machine/db_machdep.h>.
 1.2.6.1 04-Sep-2001  simonb file db_machdep.h was added on branch nathanw_sa on 2001-09-04 07:43:32 +0000
 1.10 30-Aug-2011  bouyer 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.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 12-Jun-2005  dyoung Make disklabel(8) and fdisk(8) into "host tools " last step: build
and install ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-disklabel,
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk by "reaching over" to
the sources in ${NETBSDSRCDIR}/sbin/{disklabel fdisk}/.

To avoid clashes with a build-host's header files, especially on
*BSD, the host-tools versions of fdisk and disklabel search for
#includes such as disklabel.h, disklabel_acorn.h, disklabel_gpt.h,
and bootinfo.h in a new #includes namespace, nbinclude/. That is,
they #include <nbinclude/sys/disklabel.h>, <nbinclude/machine/disklabel.h>,
<nbinclude/sparc64/disklabel.h>, instead of <sys/disklabel.h> and
such. I have also updated the system headers to #include from
nbinclude/-space when HAVE_NBTOOL_CONFIG_H is #defined.
 1.7 24-Nov-2004  jmc Pull host/arch native label information into bootblock.h. Therefore pieces of
this are accessible from host tools.
 1.6 17-Nov-2003  keihan branches: 1.6.4;
www.netbsd.org -> www.NetBSD.org
 1.5 13-Mar-2002  simonb branches: 1.5.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.4 28-Jan-2002  lukem cosmetic reorder of #defines to match other ports
 1.3 19-Nov-2001  soren Remove obsolete comment.
 1.2 10-Nov-2001  wdk branches: 1.2.2;
NetBSD Disklabel and SGI Volume header support. Based on NetBSD/mipsco
due to its similarities.

Patch has been tested by many people on the sgimips list for some time with
no complaints.

Contributed by: Christopher SEKIYA <wileyc@rezrov.net>
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.12;
Initial commit.
 1.1.12.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.10.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.10.2 11-Feb-2002  jdolecek Sync w/ -current.
 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 14-Jun-2000  bouyer file disklabel.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file disklabel.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:15 +0000
 1.2.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 10-Nov-2001  nathanw file disklabel.h was added on branch nathanw_sa on 2002-01-08 00:27:30 +0000
 1.5.12.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.12.4 29-Nov-2004  skrll Sync with HEAD.
 1.5.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.12.1 03-Aug-2004  skrll Sync with HEAD
 1.6.4.1 06-Apr-2005  tron Pull up revision 1.7 (requested by jmc in ticket #1028):
Pull host/arch native label information into bootblock.h. Therefore pieces of
this are accessible from host tools.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file ecoff_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file ecoff_machdep.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:15 +0000
 1.3 29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.2 27-Oct-2012  chs branches: 1.2.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.1 11-May-2001  thorpej branches: 1.1.2; 1.1.10; 1.1.166; 1.1.176;
Basic EISA support for the Indigo2. From Rafal K. Boni.
 1.1.176.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.176.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.166.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.166.1 30-Oct-2012  yamt sync with head
 1.1.10.2 11-May-2001  thorpej Basic EISA support for the Indigo2. From Rafal K. Boni.
 1.1.10.1 11-May-2001  thorpej file eisa_machdep.h was added on branch nathanw_sa on 2001-05-11 04:36:16 +0000
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.1 18-May-2014  rmind sync with head
 1.2 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.136; 1.1.154;
Initial commit.
 1.1.154.1 22-Aug-2009  matt Move ELF{32,64}_MACHDEP_ENDIANNESS to <mips/elf_machdep.h>
 1.1.136.1 11-Mar-2010  yamt 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 14-Jun-2000  bouyer file elf_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file elf_machdep.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:16 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file endian.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file endian.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:16 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file endian_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:23:44 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file endian_machdep.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:16 +0000
 1.1 21-Dec-2015  christos branches: 1.1.2; 1.1.18;
Add mips fenv.h (From FreeBSD)
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 21-Dec-2015  jdolecek file fenv.h was added on branch tls-maxphys on 2017-12-03 11:36:41 +0000
 1.1.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.1.2.1 21-Dec-2015  skrll file fenv.h was added on branch nick-nhusb on 2015-12-27 12:09:42 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file float.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file float.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:16 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file ieee.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file ieee.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:17 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file ieeefp.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file ieeefp.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:17 +0000
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 integer constant macros.
 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:43 +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:36 +0000
 1.1 15-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.2 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.1.12.1 15-Apr-2001  kleink file int_fmtio.h was added on branch nathanw_sa on 2001-04-15 17:13:18 +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 15-Apr-2001  bouyer file int_fmtio.h was added on branch thorpej_scsipi on 2001-04-21 17:54:36 +0000
 1.1 15-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 specified-width integer type limits.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.2 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.1.12.1 15-Apr-2001  kleink file int_limits.h was added on branch nathanw_sa on 2001-04-15 15:29:12 +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 15-Apr-2001  bouyer file int_limits.h was added on branch thorpej_scsipi on 2001-04-21 17:54:36 +0000
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
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.12.2 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.1.12.1 14-Apr-2001  kleink file int_mwgwtypes.h was added on branch nathanw_sa on 2001-04-14 12:20:02 +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_mwgwtypes.h was added on branch thorpej_scsipi on 2001-04-21 17:54:36 +0000
 1.1 26-Jun-2000  kleink branches: 1.1.2;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 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-Jun-2000  bouyer file int_types.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.29 27-Sep-2018  macallan add event counters for int0 at mainbus
 1.28 26-Jun-2015  matt branches: 1.28.16; 1.28.18;
Cleanup includes
 1.27 20-Feb-2011  matt branches: 1.27.14; 1.27.32;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.26 03-Apr-2009  uebayasi branches: 1.26.4; 1.26.6; 1.26.8;
Include sys/evcnt.h for struct evcnt, not sys/device.h.
 1.25 03-Dec-2007  ad branches: 1.25.18; 1.25.26; 1.25.32; 1.25.36;
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 17-Oct-2007  garbled branches: 1.24.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.23 26-Jun-2007  tsutsui branches: 1.23.8; 1.23.10;
Fix swapped SI_QUEUENAMES to match SI_SOFT* numbers.
 1.22 17-Jun-2007  tsutsui Move declaretions of _spl*() and _{clr,set}softintr() functions
(which are in mips/locore.S) into <mips/locore.h>
from various MD files.
 1.21 16-Feb-2007  ad branches: 1.21.6; 1.21.8; 1.21.14;
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.20 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.19 11-Dec-2005  christos branches: 1.19.20; 1.19.22;
merge ktrace-lwp.
 1.18 03-Jun-2005  martin branches: 1.18.2;
Avoid a global name "netmask" - it causes lots of shadow warnings all over
the place. Collect all interrupt masks into a single array instead.
Constify a bit and fix a bogus argument to config_rootfound().
 1.17 07-Jul-2004  sekiya Add ih_next to the data structure. Part of Steve Rumble's interrupt-sharing
scheme.
 1.16 08-Feb-2004  sekiya de-__P.
 1.15 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.14 15-Sep-2003  simonb Use common mips generic software interrupt routines.

Changes from Izumi Tsutsui, tested by Havard Eidnes.
 1.13 03-May-2002  rafal branches: 1.13.10;
Cosmetic change.
 1.12 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.11 14-Jan-2002  soren Remove __HAVE_GENERIC_SOFT_INTERRUPTS #ifdef.
 1.10 19-Nov-2001  soren s/sgi/sgimips/
Remove __NO_SOFT_SERIAL_INTERRUPT.
 1.9 08-Jun-2001  rafal branches: 1.9.2; 1.9.8;
All soft interrupts are currently handled by soft interrupt 1, so make
all splsoftxxx() calls block soft interrupt 1 and make spllowersoftclock()
re-enable soft interrupt 1.

XXX: This needs to be reworked so that spllowersoftclock() only turns on
softclock interrupts, not all soft interrupt. That change is coming soon.
 1.8 14-May-2001  matt Define splserial to be the same as spltty().
 1.7 11-May-2001  thorpej Generic software interrupt implementation, derived from mipsco
implementation.

From Rafal K. Boni.
 1.6 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.5 14-Jan-2001  thorpej branches: 1.5.2;
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.4 22-Aug-2000  thorpej branches: 1.4.2;
Add spllock(). See spl(9) for details.
 1.3 21-Aug-2000  thorpej Make sure we provide splsched() as described in spl(9).
 1.2 29-Jun-2000  soren Add spllpt. More interrupt changes needed..
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file intr.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:18 +0000
 1.4.2.4 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.4.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.4.2.1 22-Aug-2000  bouyer file intr.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.5.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.9.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.9.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.9.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.9.8.1 08-Jun-2001  nathanw file intr.h was added on branch nathanw_sa on 2002-01-08 00:27:30 +0000
 1.9.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.9.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.10.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.10.1 03-Aug-2004  skrll Sync with HEAD
 1.18.2.4 07-Dec-2007  yamt sync with head
 1.18.2.3 03-Sep-2007  yamt sync with head.
 1.18.2.2 26-Feb-2007  yamt sync with head.
 1.18.2.1 30-Dec-2006  yamt sync with head.
 1.19.22.2 23-Oct-2006  yamt add splsoftserial.
 1.19.22.1 09-Oct-2006  yamt implement splraiseipl/makeiplcookie for sgimips.
 1.19.20.1 12-Jan-2007  ad Sync with head.
 1.21.14.1 26-Jun-2007  garbled Sync with HEAD.
 1.21.8.1 11-Jul-2007  mjf Sync with head.
 1.21.6.2 03-Dec-2007  ad Sync with HEAD.
 1.21.6.1 15-Jul-2007  ad Sync with head.
 1.23.10.2 09-Jan-2008  matt sync with HEAD
 1.23.10.1 06-Nov-2007  matt sync with HEAD
 1.23.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.24.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.25.36.2 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.25.36.1 06-Feb-2010  matt <mips/softintr.h> is no longer needed.
 1.25.32.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.26.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.18.1 04-May-2009  yamt sync with head.
 1.26.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.26.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.26.4.1 05-Mar-2011  rmind sync with head
 1.27.32.1 22-Sep-2015  skrll Sync with HEAD
 1.27.14.1 03-Dec-2017  jdolecek update from HEAD
 1.28.18.1 10-Jun-2019  christos Sync with HEAD
 1.28.16.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.2 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.1 22-May-2002  manu branches: 1.1.2; 1.1.4; 1.1.6;
Added an irix_machdep.h (in the future, COMPAT_IRIX will be available on
several MIPS architectures)
 1.1.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.1.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.1 22-May-2002  jdolecek file irix_machdep.h was added on branch kqueue on 2002-06-23 17:40:30 +0000
 1.1.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.1.4.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.4.1 22-May-2002  nathanw file irix_machdep.h was added on branch nathanw_sa on 2002-06-20 03:40:49 +0000
 1.1.2.3 31-May-2002  gehenna Remove hard-coded major.
 1.1.2.2 30-May-2002  gehenna Catch up with -current.
 1.1.2.1 22-May-2002  gehenna file irix_machdep.h was added on branch gehenna-devsw on 2002-05-30 15:35:41 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file kcore.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file kcore.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:18 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file kdbparam.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file kdbparam.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:19 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file limits.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file limits.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:20 +0000
 1.9 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.8 14-Dec-2009  matt branches: 1.8.22; 1.8.36;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.7 23-Aug-2009  he Remove BOOT_AOUT here as well, mips no longer deals with a.out.
 1.6 28-Apr-2008  martin branches: 1.6.18;
Remove clause 3 and 4 from TNF licenses
 1.5 17-Oct-2007  garbled branches: 1.5.16; 1.5.18; 1.5.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.4 23-Jul-2007  macallan branches: 1.4.6;
sprinkle (vaddr_t) to deal with sizeof(paddr_t) != sizeof(void *)
Now the loader should build again.
 1.3 25-Jan-2006  christos branches: 1.3.28; 1.3.36; 1.3.40; 1.3.42;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.2 31-Oct-2001  thorpej branches: 1.2.2; 1.2.4; 1.2.36; 1.2.48;
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.1 15-Oct-2001  mhitch branches: 1.1.2;
Machine-dependent loadfile() support for booting.
 1.1.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.48.1 01-Feb-2006  yamt sync with head.
 1.2.36.2 03-Sep-2007  yamt sync with head.
 1.2.36.1 21-Jun-2006  yamt sync with head.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 31-Oct-2001  thorpej file loadfile_machdep.h was added on branch kqueue on 2002-01-10 19:48:29 +0000
 1.2.2.2 31-Oct-2001  thorpej 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.2.1 31-Oct-2001  thorpej file loadfile_machdep.h was added on branch nathanw_sa on 2001-10-31 17:20:50 +0000
 1.3.42.1 15-Aug-2007  skrll Sync with HEAD.
 1.3.40.1 07-Aug-2007  matt Sync with HEAD.
 1.3.36.1 03-Oct-2007  garbled Sync with HEAD
 1.3.28.1 20-Aug-2007  ad Sync with HEAD.
 1.4.6.1 06-Nov-2007  matt sync with HEAD
 1.5.20.3 11-Mar-2010  yamt sync with head
 1.5.20.2 16-Sep-2009  yamt sync with head
 1.5.20.1 16-May-2008  yamt sync with head.
 1.5.18.1 18-May-2008  yamt sync with head.
 1.5.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.18.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.8.36.1 10-Aug-2014  tls Rebase.
 1.8.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 31-Aug-2001  simonb branches: 1.2.6;
Remove an unneeded comment; ``sync'' with other "just include <mips/foo.h>"
files.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10;
Initial commit.
 1.1.10.1 13-Sep-2001  thorpej Update the kqueue branch to 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 14-Jun-2000  bouyer file lock.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file lock.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:21 +0000
 1.2.6.2 31-Aug-2001  simonb Remove an unneeded comment; ``sync'' with other "just include <mips/foo.h>"
files.
 1.2.6.1 31-Aug-2001  simonb file lock.h was added on branch nathanw_sa on 2001-08-31 03:53:25 +0000
 1.2 05-Jun-2002  simonb Simplify include files that just include <mips/locore.h>.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14; 1.1.22;
Initial commit.
 1.1.22.1 15-Jul-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 14-Jun-2000  bouyer file locore.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file locore.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:21 +0000
 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:07 +0000
 1.7 10-Feb-2009  rumble Ready these for IP6.
 1.6 22-Dec-2006  rumble branches: 1.6.48; 1.6.56; 1.6.62;
Guiness -> Guinness.
 1.5 11-Dec-2005  christos branches: 1.5.20;
merge ktrace-lwp.
 1.4 13-Jan-2004  sekiya branches: 1.4.16;
Add IP12 subtypes. From Steve Rumble.
 1.3 13-Mar-2002  simonb branches: 1.3.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 14-Jun-2001  rafal branches: 1.2.2; 1.2.4; 1.2.10;
Add externs for struct platform and the machine type definitions (mach_type,
mach_subtype, mach_boardrev).
 1.1 11-May-2001  thorpej SGI machine types and subtypes. From Rafal K. Boni.
 1.2.10.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.10.1 14-Jun-2001  nathanw file machtype.h was added on branch nathanw_sa on 2002-04-01 07:42:26 +0000
 1.2.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.12.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 30-Dec-2006  yamt sync with head.
 1.5.20.1 12-Jan-2007  ad Sync with head.
 1.6.62.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.56.1 03-Mar-2009  skrll Sync with HEAD.
 1.6.48.1 04-May-2009  yamt sync with head.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file math.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file math.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:22 +0000
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 17-Nov-2001  wdk branches: 1.1.2;
file mcontext.h was initially added on branch nathanw_sa.
 1.1.2.1 17-Nov-2001  wdk mcontext support for MIPS based ports.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file mips_opcode.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file mips_opcode.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:22 +0000
 1.2 09-Feb-2007  ad branches: 1.2.4;
Merge newlock2 to head.
 1.1 22-Dec-2006  ad branches: 1.1.2;
file mutex.h was initially added on branch newlock2.
 1.1.2.1 22-Dec-2006  ad Pull in CPU specific stubs.
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file mutex.h was added on branch yamt-lazymbuf on 2007-02-26 09:08:04 +0000
 1.2 14-Dec-2009  matt branches: 1.2.4;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.1 12-Sep-2009  matt branches: 1.1.2;
file netbsd32_machdep.h was initially added on branch matt-nb5-mips64.
 1.1.2.1 12-Sep-2009  matt Add COMPAT_NETBSD32 support.
 1.2.4.2 11-Mar-2010  yamt sync with head
 1.2.4.1 14-Dec-2009  yamt file netbsd32_machdep.h was added on branch yamt-nfs-mp on 2010-03-11 15:02:54 +0000
 1.18 31-May-2021  simonb Include "opt_param.h" (ifdef _KERNEL_OPT) everywhere that MSGBUFSIZE is
referenced since some sources include <machine/param.h>.
 1.17 07-Jan-2019  jdolecek branches: 1.17.16;
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.16 04-Jul-2011  mrg branches: 1.16.52; 1.16.54;
don't mark delay as extern inline. it's defined normally in machdep.c.
 1.15 18-Mar-2011  tsutsui Include <mips/mips_param.h> after MACHINE is defined.
 1.14 06-Mar-2011  he Now that MACHINE is defined in user-land in either
mips/include/mips_param.h or powerpc/include/param.h, stop
trying to re-define it in the port-specific param.h files
when _KERNEL isn't defined.
 1.13 08-Feb-2011  rmind 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.12 14-Dec-2009  matt branches: 1.12.4; 1.12.6; 1.12.8;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.11 13-Aug-2009  matt Move MID_MACHINE to <mips/mips_param.h> and use local values so we don't
need to include exec_aout.h
 1.10 21-Feb-2008  sekiya branches: 1.10.10; 1.10.28;
Increase MSGBUFSIZE so that we don't truncate dmesg before syslog
starts.
 1.9 26-Sep-2006  tsutsui branches: 1.9.28;
Protect from multiple inclusion.
 1.8 16-Feb-2006  perry branches: 1.8.14; 1.8.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.7 24-Dec-2005  perry branches: 1.7.2; 1.7.4; 1.7.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 26-Feb-2002  simonb branches: 1.4.16;
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.3 30-May-2001  mrg branches: 1.3.2; 1.3.8;
use _KERNEL_OPT
 1.2 30-Jun-2000  itojun branches: 1.2.2; 1.2.4;
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 14-Jun-2000  soren branches: 1.1.2; 1.1.4;
Initial commit.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file param.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:22 +0000
 1.1.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.2.4.1 21-Jun-2001  nathanw Catch up 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 30-Jun-2000  bouyer file param.h was added on branch thorpej_scsipi on 2000-11-20 20:23:45 +0000
 1.3.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.8.1 30-May-2001  nathanw file param.h was added on branch nathanw_sa on 2002-02-28 04:11:36 +0000
 1.3.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.4.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.16.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.2 27-Feb-2008  yamt sync with head.
 1.5.16.1 30-Dec-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.7.2.1 18-Feb-2006  yamt sync with head.
 1.8.16.1 22-Oct-2006  yamt sync with head
 1.8.14.1 18-Nov-2006  ad Sync with head.
 1.9.28.1 23-Mar-2008  matt sync with HEAD
 1.10.28.1 22-Aug-2009  matt Move MACHINE_ARCH definition to <mips/mips_param.h>
Move mbuf related defines to <mips/mips_param.h>
 1.10.10.2 11-Mar-2010  yamt sync with head
 1.10.10.1 19-Aug-2009  yamt sync with head.
 1.12.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.12.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.4.2 21-Apr-2011  rmind sync with head
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.16.54.1 10-Jun-2019  christos Sync with HEAD
 1.16.52.1 18-Jan-2019  pgoyette Synch with HEAD
 1.17.16.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file pcb.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file pcb.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:23 +0000
 1.15 07-Jul-2020  thorpej Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
Provide a new resource provider API:

==> pciconf_resource_init() -- Initialize a PCI configuration resources
container.
==> pciconf_resource_add() -- Add a PCI configuration resource to the
container (I/O, MEM, or prefetchable MEM). Multiple resources of
each type may be added.
==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
container once the bus has been configured.

This is much easier to use than the previous method of providing an
extent map for each kind of resource, and works better for e.g. ACPI
platforms that provide potentially multiple PCI resources in tables
provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
rather than extent maps.
 1.14 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.13 01-Apr-2014  ozaki-r branches: 1.13.6;
Add a missing comma
 1.12 29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.11 27-Oct-2012  chs branches: 1.11.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.10 11-May-2011  dyoung branches: 1.10.4; 1.10.14;
Now that GENERIC32_IPX3x builds again, fix some pci_attach_args
constification that I'd missed.
 1.9 30-Aug-2006  rumble branches: 1.9.82; 1.9.88;
Generalise pci/pci_machdep.c further and move all mace-specific code into
mace/pci_mace.c in preparation for pci devices on the gio(4) bus.
 1.8 17-Apr-2006  tsutsui branches: 1.8.6;
Switch macepci to use MI pci_configure_bus(9) rather than its own fixup code.
Tested on my O2 with several devices, and ok'ed by sekiya.
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
merge ktrace-lwp.
 1.6 06-Sep-2004  sekiya branches: 1.6.12;
Use the mace interrupt handler for PCI interrupts.

From KIYOHARA Takashi
 1.5 29-Jul-2004  drochner remove now unnecessary "pci_enumerate_bus" definitions
 1.4 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.3 15-May-2002  thorpej branches: 1.3.10;
Let machine-dependent code specify how to enumerate the bus.
Currently, everyone uses pci_enumerate_bus_generic().
 1.2 28-Dec-2000  sommerfeld branches: 1.2.4; 1.2.8;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 1.1.6.3 05-Jan-2001  bouyer 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 14-Jun-2000  bouyer file pci_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file pci_machdep.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:23 +0000
 1.2.8.1 20-Jun-2002  nathanw Catch up to -current.
 1.2.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.10.1 03-Aug-2004  skrll Sync with HEAD
 1.6.12.2 30-Dec-2006  yamt sync with head.
 1.6.12.1 21-Jun-2006  yamt sync with head.
 1.7.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.7.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.8.2 03-Sep-2006  yamt sync with head.
 1.7.8.1 24-May-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.8.6.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/include/pci_machdep.h: revision 1.9
sys/arch/sgimips/pci/pci_machdep.c: revision 1.19
sys/arch/sgimips/mace/pci_mace.c: revision 1.8
Generalise pci/pci_machdep.c further and move all mace-specific code into
mace/pci_mace.c in preparation for pci devices on the gio(4) bus.
 1.9.88.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.82.1 31-May-2011  rmind sync with head
 1.10.14.3 03-Dec-2017  jdolecek update from HEAD
 1.10.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10.4.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.4.1 30-Oct-2012  yamt sync with head
 1.11.2.1 18-May-2014  rmind sync with head
 1.13.6.1 06-Apr-2015  skrll Sync with HEAD
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file pmap.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file pmap.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:24 +0000
 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:39:44 +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 13:45:52 +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:18:49 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file proc.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file proc.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:24 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file profile.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file profile.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:25 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file psl.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file psl.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:25 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file pte.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file pte.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:25 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file ptrace.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file ptrace.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:26 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file reg.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file reg.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:27 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file regdef.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file regdef.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:27 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file regnum.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file regnum.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:28 +0000
 1.2 09-Sep-2001  simonb branches: 1.2.4;
Clean up and standardise across MIPS ports.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8; 1.1.10;
Initial commit.
 1.1.10.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.8.1 01-Oct-2001  fvdl Catch up 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 14-Jun-2000  bouyer file reloc.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file reloc.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:28 +0000
 1.2.4.2 09-Sep-2001  simonb Clean up and standardise across MIPS ports.
 1.2.4.1 09-Sep-2001  simonb file reloc.h was added on branch nathanw_sa on 2001-09-09 04:20:31 +0000
 1.2 05-Feb-2003  nakayama Replace machine/rnd.h with more appropriate name to share it
with cycle counter based microtime in kern/kern_microtime.c.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file rnd.h was added on branch thorpej_scsipi on 2000-11-20 20:23:46 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file rnd.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:28 +0000
 1.2 09-Feb-2007  ad branches: 1.2.4;
Merge newlock2 to head.
 1.1 22-Dec-2006  ad branches: 1.1.2;
file rwlock.h was initially added on branch newlock2.
 1.1.2.1 22-Dec-2006  ad Pull in CPU specific stubs.
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file rwlock.h was added on branch yamt-lazymbuf on 2007-02-26 09:08:04 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file setjmp.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file setjmp.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:28 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file signal.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file signal.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:28 +0000
 1.1 23-Jul-2014  alnsn branches: 1.1.2; 1.1.6;
Rename sljitarch.h to sljit_machdep.h.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 23-Jul-2014  tls file sljit_machdep.h was added on branch tls-maxphys on 2014-08-20 00:03:22 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 23-Jul-2014  tls file sljit_machdep.h was added on branch tls-earlyentropy on 2014-08-10 06:54:07 +0000
 1.2 23-Jul-2014  alnsn Rename sljitarch.h to sljit_machdep.h.
 1.1 25-Nov-2012  alnsn branches: 1.1.2; 1.1.6; 1.1.14;
Add sljitarch.h to all mips machines.
 1.1.14.1 10-Aug-2014  tls Rebase.
 1.1.6.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.2 25-Feb-2013  tls resync with head
 1.1.6.1 25-Nov-2012  tls file sljitarch.h was added on branch tls-maxphys on 2013-02-25 00:28:56 +0000
 1.1.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.1 25-Nov-2012  yamt file sljitarch.h was added on branch yamt-pagecache on 2013-01-16 05:33:03 +0000
 1.2 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.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file stdarg.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file stdarg.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:30 +0000
 1.3 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.2 13-Mar-2002  simonb branches: 1.2.202; 1.2.204;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 28-Nov-2001  manu branches: 1.1.2; 1.1.4;
Add support for COMPAT_IRIX
 1.1.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 28-Nov-2001  thorpej file svr4_machdep.h was added on branch kqueue on 2002-01-10 19:48:29 +0000
 1.1.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 28-Nov-2001  nathanw file svr4_machdep.h was added on branch nathanw_sa on 2002-01-08 00:27:31 +0000
 1.2.204.1 10-Jun-2019  christos Sync with HEAD
 1.2.202.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.8 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.7 29-Dec-2006  rumble branches: 1.7.66; 1.7.70; 1.7.76; 1.7.78;
IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.6 11-Dec-2005  christos branches: 1.6.20;
merge ktrace-lwp.
 1.5 18-Jan-2004  sekiya branches: 1.5.16;
Add more platform hooks in platform struct.
 1.4 13-Jan-2004  sekiya The watchdog timer is a function of the memory controller on all SGI platforms.
Add to the machine struct.
 1.3 11-Nov-2001  rafal branches: 1.3.2; 1.3.18;
Make microtime(9) do interpolation to get better-than-hz resolution, if
the platform supplies a clkread function that does something other than
return 0 (which is the default unless overridden by the platorm code).
Supply such a function for the IP22; even if it isn't perfect, it goes
a long way to making ntp usable.

While I'm at it, move the ticks-per-hz variable out of the struct platform
since it's really private to the per-platform interrupt/clock code.

XXX: No clkread function supplied for IP32, since it has other problems --
like a hardcoded ticks-per-hz, but the same code as on the IP22 could be
used.
 1.2 14-Jun-2001  rafal branches: 1.2.2; 1.2.4; 1.2.8;
Add externs for struct platform and the machine type definitions (mach_type,
mach_subtype, mach_boardrev).
 1.1 11-May-2001  thorpej Dynamic system configuration support, derived from pmax port.

From Rafal K. Boni.
 1.2.8.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.18.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.2 11-Nov-2001  rafal Make microtime(9) do interpolation to get better-than-hz resolution, if
the platform supplies a clkread function that does something other than
return 0 (which is the default unless overridden by the platorm code).
Supply such a function for the IP22; even if it isn't perfect, it goes
a long way to making ntp usable.

While I'm at it, move the ticks-per-hz variable out of the struct platform
since it's really private to the per-platform interrupt/clock code.

XXX: No clkread function supplied for IP32, since it has other problems --
like a hardcoded ticks-per-hz, but the same code as on the IP22 could be
used.
 1.3.2.1 11-Nov-2001  rafal file sysconf.h was added on branch nathanw_sa on 2001-11-11 17:21:41 +0000
 1.5.16.1 30-Dec-2006  yamt sync with head.
 1.6.20.1 12-Jan-2007  ad Sync with head.
 1.7.78.1 05-Mar-2011  bouyer Sync with HEAD
 1.7.76.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.70.1 05-Mar-2011  rmind sync with head
 1.7.66.1 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file trap.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file trap.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:31 +0000
 1.18 01-Apr-2021  simonb Whitespace: #define<tab>
 1.17 26-Jan-2017  christos branches: 1.17.26; 1.17.28;
provide __HAVE_COMPAT_NETBSD32 and fix multiple include protection consistently.
 1.16 17-Jul-2011  dyoung branches: 1.16.12; 1.16.30; 1.16.34; 1.16.38;
Switch MIPS and MIPS-ish architectures to new-style <sys/bus.h>. This
involves moving some inline bus_space(9) implementation into .c files.
 1.15 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.14 17-Oct-2007  garbled branches: 1.14.2; 1.14.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.13 17-Jul-2007  macallan branches: 1.13.10;
use 64bit paddr_t and bus_addr_t so we can mmap DMA buffers uncached
 1.12 14-Jul-2007  ad Generic soft interrupts are mandatory.
 1.11 16-Sep-2006  gdamore branches: 1.11.10; 1.11.18;
sgimips converted to timecounters. Systems that can do them get mips_cp0
based logic. We also use the common mips3_clock functions for those systems,
removing some port-specific code.

Tested by martin@.
 1.10 05-Sep-2006  rumble branches: 1.10.2;
Switch sgimips to MI todr.
 1.9 03-Sep-2006  bjh21 Nothing in the kernel now tests __HAVE_NWSCONS, so stop defining it everywhere.
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.8;
merge ktrace-lwp.
 1.7 10-Dec-2003  lonewolf branches: 1.7.16;
sgimips lives in the new-style wscons land.
 1.6 03-Jan-2003  rafal branches: 1.6.2;
Cosmetic fix -- move __HAVE_MIPS_MACHDEP_CACHE_CONFIG to "MIPS specific
options" section.
 1.5 03-Jan-2003  rafal Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 1.4 05-Aug-2002  simonb Use a __HAVE_BOOTINFO_H define to check for bootinfo support instead of
speading port names in arch-dependant code.
 1.3 18-Oct-2001  mhitch branches: 1.3.4; 1.3.12;
We have device_register().
 1.2 11-May-2001  thorpej branches: 1.2.2;
We now have generic soft interrupts.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8;
Initial commit.
 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 14-Jun-2000  bouyer file types.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file types.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:31 +0000
 1.2.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.12.1 31-Aug-2002  gehenna catch up with -current.
 1.3.4.3 07-Jan-2003  thorpej Sync with HEAD.
 1.3.4.2 13-Aug-2002  nathanw Catch up to -current.
 1.3.4.1 18-Oct-2001  nathanw file types.h was added on branch nathanw_sa on 2002-08-13 02:18:49 +0000
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.3 21-Jan-2008  yamt sync with head
 1.7.16.2 03-Sep-2007  yamt sync with head.
 1.7.16.1 30-Dec-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 18-Nov-2006  ad Sync with head.
 1.11.18.1 03-Oct-2007  garbled Sync with HEAD
 1.11.10.2 20-Aug-2007  ad Sync with HEAD.
 1.11.10.1 15-Jul-2007  ad Sync with head.
 1.13.10.2 23-Mar-2008  matt sync with HEAD
 1.13.10.1 06-Nov-2007  matt sync with HEAD
 1.14.8.1 23-Jan-2008  bouyer Sync with HEAD.
 1.14.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.16.38.1 21-Apr-2017  bouyer Sync with HEAD
 1.16.34.1 20-Mar-2017  pgoyette Sync with HEAD
 1.16.30.1 05-Feb-2017  skrll Sync with HEAD
 1.16.12.1 03-Dec-2017  jdolecek update from HEAD
 1.17.28.1 03-Apr-2021  thorpej Sync with HEAD.
 1.17.26.1 03-Apr-2021  thorpej Sync with HEAD.
 1.2 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.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file varargs.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file varargs.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:31 +0000
 1.2 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.136; 1.1.154;
Initial commit.
 1.1.154.1 11-Dec-2009  matt Use the default set of VM_FREELISTs in <mips/vmparam.h> but allow them to
be overridden (for pmax).
 1.1.136.1 11-Mar-2010  yamt 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 14-Jun-2000  bouyer file vmparam.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file vmparam.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:32 +0000
 1.2 11-Dec-2005  christos 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:40:07 +0000
 1.2 11-Dec-2005  christos branches: 1.2.18;
merge ktrace-lwp.
 1.1 05-Nov-2005  tsutsui branches: 1.1.2;
Add empty <machine/wired_map.h> for the MI mips/wired_map.c.
 1.1.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.2.1 05-Nov-2005  skrll file wired_map.h was added on branch ktrace-lwp on 2005-11-10 13:58:37 +0000
 1.2.18.2 21-Jun-2006  yamt sync with head.
 1.2.18.1 11-Dec-2005  yamt file wired_map.h was added on branch yamt-lazymbuf on 2006-06-21 14:55:30 +0000
 1.10 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.9 29-Mar-2008  tsutsui Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.8 07-Nov-2007  ad branches: 1.8.14;
Merge tty changes from the vmlocking branch.
 1.7 11-Dec-2005  christos branches: 1.7.30; 1.7.48; 1.7.50; 1.7.54; 1.7.56;
merge ktrace-lwp.
 1.6 08-Feb-2004  sekiya branches: 1.6.16;
de-__P.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 17-Apr-2002  rafal branches: 1.4.10;
Add event counter for zs interrupts and attach and use it; also, get the
zs major number out of the cdevsw table rather than hardcoding it in zs.c.
 1.3 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 11-May-2001  thorpej branches: 1.2.2; 1.2.8;
New data structures for the new SCC driver.

From Rafal K. Boni.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8;
Initial commit.
 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 14-Jun-2000  bouyer file z8530var.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file z8530var.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:32 +0000
 1.2.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.2.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.8.1 11-May-2001  nathanw file z8530var.h was added on branch nathanw_sa on 2002-04-01 07:42:26 +0000
 1.2.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.4.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.10.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 15-Nov-2007  yamt sync with head.
 1.7.56.1 19-Nov-2007  mjf Sync with HEAD.
 1.7.54.1 13-Nov-2007  bouyer Sync with HEAD
 1.7.50.1 08-Nov-2007  matt sync with -HEAD
 1.7.48.1 11-Nov-2007  joerg Sync with HEAD.
 1.7.30.1 03-Dec-2007  ad Sync with HEAD.
 1.8.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.4 13-Feb-2009  he The attribute for if_le_oioc.c should apparently be le24, not le,
so that this file is not pulled into the GENERIC32_IP3x kernel,
where am7990.c isn't built.
 1.3 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.2 11-Dec-2005  christos branches: 1.2.78; 1.2.86; 1.2.92;
merge ktrace-lwp.
 1.1 15-Dec-2003  sekiya branches: 1.1.4;
Add dedicated IOC (I/O Controller) driver. pckbc, zstty, and lpt will each
receive *_ioc.c attachments; machines without IOC (i.e., IP20) will use *_hpc.c
stubs.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 15-Dec-2003  skrll file files.ioc was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.2.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.2.78.1 04-May-2009  yamt sync with head.
 1.6 12-Feb-2022  riastradh sys: Fix various abuse of struct device internals.

Will help to make struct device opaque later.
 1.5 11-Jun-2015  matt Add struct pmap_limits and pm_{min,max}addr from uvm/pmap/map.h and use it to
store avail_start, avail_end, virtual_start, and virtual_end.
Remove iospace and let emips just bump pmap_limits.virtual_start to get the
VA space it needs.
pmap_segtab.c is almost identical to uvm/pmap/pmap_segtab.c now. It won't
be long until we switch to the uvm/pmap one.
 1.4 20-Feb-2011  matt branches: 1.4.14; 1.4.32;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.3 10-Jan-2011  tsutsui branches: 1.3.2; 1.3.4;
Use ether_aton_r() in sys/net/if_ethersubr.c instead of home grown copies.
Hint from ryo@. Tested on IP32 mec(4).
 1.2 19-Jan-2010  pooka branches: 1.2.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.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file if_le_oioc.c was added on branch jym-xensuspend on 2009-05-13 17:18:18 +0000
 1.1.4.3 11-Mar-2010  yamt sync with head
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file if_le_oioc.c was added on branch yamt-nfs-mp on 2009-05-04 08:11:50 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file if_le_oioc.c was added on branch nick-hppapmap on 2009-03-03 18:29:14 +0000
 1.2.4.1 05-Mar-2011  rmind sync with head
 1.3.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.32.1 22-Sep-2015  skrll Sync with HEAD
 1.4.14.1 03-Dec-2017  jdolecek update from HEAD
 1.14 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.13 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.12 24-Apr-2021  thorpej branches: 1.12.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.11 18-Feb-2015  macallan branches: 1.11.32;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.10 27-Oct-2012  chs branches: 1.10.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.9 01-Jul-2011  dyoung branches: 1.9.2; 1.9.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.8 03-Mar-2009  macallan Comment out some register initialization which the firmware should have taken
care of anyway. Apparently doing this here disrupts newport's blitter
operations and causes a deadlock.
 1.7 17-Oct-2007  garbled branches: 1.7.20; 1.7.28; 1.7.30; 1.7.34; 1.7.38;
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 09-Jul-2007  ad branches: 1.6.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.5 22-Dec-2006  rumble branches: 1.5.6; 1.5.8; 1.5.14;
Guiness -> Guinness.
 1.4 11-Dec-2005  christos branches: 1.4.20;
merge ktrace-lwp.
 1.3 26-Aug-2005  drochner s/locdesc_t/int/g
 1.2 30-Jun-2005  drochner branches: 1.2.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.1 15-Dec-2003  sekiya branches: 1.1.4;
Add dedicated IOC (I/O Controller) driver. pckbc, zstty, and lpt will each
receive *_ioc.c attachments; machines without IOC (i.e., IP20) will use *_hpc.c
stubs.
 1.1.4.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 15-Dec-2003  skrll file ioc.c was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.2.2.3 03-Sep-2007  yamt sync with head.
 1.2.2.2 30-Dec-2006  yamt sync with head.
 1.2.2.1 21-Jun-2006  yamt sync with head.
 1.4.20.1 12-Jan-2007  ad Sync with head.
 1.5.14.1 03-Oct-2007  garbled Sync with HEAD
 1.5.8.1 11-Jul-2007  mjf Sync with head.
 1.5.6.1 15-Jul-2007  ad Sync with head.
 1.6.10.1 06-Nov-2007  matt sync with HEAD
 1.7.38.1 29-Dec-2010  matt Merge changes from netbsd-5.
 1.7.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.30.1 26-Sep-2009  snj Pull up following revision(s) (requested by macallan in ticket #975):
sys/arch/sgimips/ioc/ioc.c: revision 1.8
Comment out some register initialization which the firmware should
have taken care of anyway. Apparently doing this here disrupts
newport's blitter operations and causes a deadlock.
 1.7.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.20.1 04-May-2009  yamt sync with head.
 1.9.12.2 03-Dec-2017  jdolecek update from HEAD
 1.9.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.2.1 30-Oct-2012  yamt sync with head
 1.10.14.1 06-Apr-2015  skrll Sync with HEAD
 1.11.32.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.11.32.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.11.32.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.11.32.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.11.32.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.11.32.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.12.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 15-Dec-2003  sekiya branches: 1.1.4;
Add dedicated IOC (I/O Controller) driver. pckbc, zstty, and lpt will each
receive *_ioc.c attachments; machines without IOC (i.e., IP20) will use *_hpc.c
stubs.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 15-Dec-2003  skrll file iocreg.h was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 15-Dec-2003  sekiya branches: 1.1.4;
Add dedicated IOC (I/O Controller) driver. pckbc, zstty, and lpt will each
receive *_ioc.c attachments; machines without IOC (i.e., IP20) will use *_hpc.c
stubs.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 15-Dec-2003  skrll file iocvar.h was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.6 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.5 24-Apr-2021  thorpej branches: 1.5.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.4 18-Feb-2015  macallan branches: 1.4.32;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.3 27-Oct-2012  chs branches: 1.3.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.2 01-Jul-2011  dyoung branches: 1.2.2; 1.2.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file oioc.c was added on branch jym-xensuspend on 2009-05-13 17:18:19 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file oioc.c was added on branch yamt-nfs-mp on 2009-05-04 08:11:50 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file oioc.c was added on branch nick-hppapmap on 2009-03-03 18:29:14 +0000
 1.2.12.2 03-Dec-2017  jdolecek update from HEAD
 1.2.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.2.1 30-Oct-2012  yamt sync with head
 1.3.14.1 06-Apr-2015  skrll Sync with HEAD
 1.4.32.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.5.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file oiocreg.h was added on branch jym-xensuspend on 2009-05-13 17:18:19 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file oiocreg.h was added on branch yamt-nfs-mp on 2009-05-04 08:11:50 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file oiocreg.h was added on branch nick-hppapmap on 2009-03-03 18:29:14 +0000
 1.4 27-Dec-2019  msaitoh s/transfered/transferred/
 1.3 07-Jul-2016  msaitoh branches: 1.3.18;
KNF. Remove extra spaces. No functional change.
 1.2 01-Jul-2011  dyoung branches: 1.2.12; 1.2.30;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file oiocsc.c was added on branch jym-xensuspend on 2009-05-13 17:18:19 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file oiocsc.c was added on branch yamt-nfs-mp on 2009-05-04 08:11:50 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file oiocsc.c was added on branch nick-hppapmap on 2009-03-03 18:29:14 +0000
 1.2.30.1 09-Jul-2016  skrll Sync with HEAD
 1.2.12.1 03-Dec-2017  jdolecek update from HEAD
 1.3.18.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.1 10-Feb-2009  rumble branches: 1.1.2; 1.1.4; 1.1.6;
Check in work in progress of Personal IRIS 4D/20 and 4D/25 support (IP6
and IP10, respectively).
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 10-Feb-2009  jym file oiocvar.h was added on branch jym-xensuspend on 2009-05-13 17:18:19 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 10-Feb-2009  yamt file oiocvar.h was added on branch yamt-nfs-mp on 2009-05-04 08:11:50 +0000
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 10-Feb-2009  skrll file oiocvar.h was added on branch nick-hppapmap on 2009-03-03 18:29:14 +0000
 1.12 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.11 30-Sep-2015  macallan branches: 1.11.16; 1.11.18;
pass the port's hardware address in COM_INIT_REGS() so the com driver can
figure out wether this is the console or not
 1.10 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.9 01-Jul-2011  dyoung branches: 1.9.12; 1.9.30;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.8 21-Nov-2009  rmind Use lwp_getpcb() on mips, powerpc and sh3, clean from struct user usage.
 1.7 14-Mar-2008  cube branches: 1.7.4;
Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.6 13-Jul-2006  gdamore branches: 1.6.34; 1.6.54; 1.6.58;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8; 1.5.16;
merge ktrace-lwp.
 1.4 29-Sep-2004  sekiya branches: 1.4.12;
Use ANSI function declarations.
 1.3 19-Jan-2004  sekiya branches: 1.3.4;
Checking for IP32 in each driver is redundant -- they're attached as children
of mace, so it is sufficient to perform the check in mace_match(). Pointed
out by soren@.
 1.2 19-Jan-2004  sekiya Attach the com and mcclock devices only if the machine is an IP32.
 1.1 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.3.4.5 19-Oct-2004  skrll Sync with HEAD
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 19-Jan-2004  skrll file com_mace.c was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.4.12.2 17-Mar-2008  yamt sync with head.
 1.4.12.1 30-Dec-2006  yamt sync with head.
 1.5.16.1 15-Jun-2006  gdamore MACE com(4) driver attachment rewhack. GENERIC_IP3x compiles. No real
test though, as I lack SGI hardware.
 1.5.8.1 11-Aug-2006  yamt sync with head
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.58.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.54.1 24-Mar-2008  keiichi sync with head.
 1.6.34.1 23-Mar-2008  matt sync with HEAD
 1.7.4.1 11-Mar-2010  yamt sync with head
 1.9.30.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.9.30.1 06-Apr-2015  skrll Sync with HEAD
 1.9.12.1 03-Dec-2017  jdolecek update from HEAD
 1.11.18.1 10-Jun-2019  christos Sync with HEAD
 1.11.16.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.11 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.10 17-Oct-2007  garbled branches: 1.10.108; 1.10.110;
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.9 26-Sep-2007  macallan add mcclock_poweroff()
 1.8 13-Apr-2007  jmcneill branches: 1.8.2; 1.8.10; 1.8.12; 1.8.14;
Remove traces of macau, it never existed in the first place apart for
a handful of register definitions.
 1.7 13-Apr-2007  jmcneill Add SGI O2 MACE audio driver, from OpenBSD.
 1.6 12-Apr-2007  jmcneill Remove pckbc_mace, it has never worked and has been replaced by macekbc
 1.5 10-Apr-2007  jmcneill Add SGI MACE ps2 keyboard/aux controller driver. ok rumble@

XXX can someone confirm that we can remove pckbc_mace?
 1.4 11-Dec-2005  christos branches: 1.4.26; 1.4.30; 1.4.32;
merge ktrace-lwp.
 1.3 23-Sep-2004  tsutsui branches: 1.3.12;
Rename if_mec_mace.c -> if_mec.c.
This file contains not only an attachment but whole driver functions.
 1.2 20-Jan-2004  jdolecek branches: 1.2.4;
cleanup old lpt(4) attachment, and glue ppbus in so that they can coexist:
* lpt device is defined in MI place (dev/ppbus/files.ppbus), dev/ic/lpt.c
is included there too; dev/ic/lpt.c is not included if ppbus is
configured or if there is alternative platform lpt (like for pc532)
* g/c MD lpt definitions and custom puc/upc attachments,
glue moved to conf/files and dev/pci/files.pci respectively; remove
device lpt definition from dev/isa/files.isa
* add ppbus parport attribute, atppc device attachments, adjust plip and lpt
glue
 1.1 18-Jan-2004  sekiya Add files.dev and files.mace
 1.2.4.5 24-Sep-2004  skrll Sync with HEAD.
 1.2.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 20-Jan-2004  skrll file files.mace was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.3.12.2 27-Oct-2007  yamt sync with head.
 1.3.12.1 03-Sep-2007  yamt sync with head.
 1.4.32.1 11-Jul-2007  mjf Sync with head.
 1.4.30.2 09-Oct-2007  ad Sync with head.
 1.4.30.1 27-May-2007  ad Sync with head.
 1.4.26.1 15-Apr-2007  yamt sync with head.
 1.8.14.1 06-Oct-2007  yamt sync with head.
 1.8.12.1 06-Nov-2007  matt sync with HEAD
 1.8.10.1 02-Oct-2007  joerg Sync with HEAD.
 1.8.2.1 03-Oct-2007  garbled Sync with HEAD
 1.10.110.1 05-May-2019  isaki Remove obsoleted au{,rate,vol}conv and mulaw attributes.
audio provides the equivalent of them inseparably.
 1.10.108.1 10-Jun-2019  christos Sync with HEAD
 1.65 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.64 18-Sep-2022  thorpej Eliminate use of IFF_OACTIVE.
 1.63 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.62 26-Dec-2019  msaitoh branches: 1.62.2;
s/lenght/length/
 1.61 30-May-2019  msaitoh Simplify MII structure initialization and reference. No functional change.
 1.60 28-May-2019  msaitoh Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.59 23-May-2019  msaitoh -No functional change:
- KNF
- u_int*_t -> uint*_t.
 1.58 22-Jan-2019  msaitoh Change MII PHY read/write API from:

int (*mii_readreg_t)(device_t, int, int);
void (*mii_writereg_t)(device_t, int, int, int);
to:

int (*mii_readreg_t)(device_t, int, int, uint16_t *);
int (*mii_writereg_t)(device_t, int, int, uint16_t);

Now we can test if a read/write operation failed or not by the return value.

In 802.3 spec says that the PHY shall not respond to read/write transaction
to the unimplemented register(22.2.4.3). Detecting timeout can be used to
check whether a register is implemented or not (if the register conforms to
the spec). ukphy(4) can be used this for MII_MMDACR and MII_MMDAADR.

Note that I noticed that the following code do infinite loop in the
read/wirte function. If it accesses unimplemented PHY register, it will hang.
It should be fixed:

arm/at91/at91emac.c
arm/ep93xx/epe.c
arm/omap/omapl1x_emac.c
mips/ralink/ralink_eth.c
arch/powerpc/booke/dev/pq3etsec.c(read)
dev/cadence/if_cemac.c <- hkenken
dev/ic/lan9118.c


Tested with the following device:

axe+ukphy
axe+rgephy
axen+rgephy (tested by Andrius V)
wm+atphy
wm+ukphy
wm+igphy
wm+ihphy
wm+makphy
sk+makphy
sk+brgphy
sk+gentbi
msk+makphy
sip+icsphy
sip+ukphy
re+rgephy
bge+brgphy
bnx+brgphy
gsip+gphyter
rtk+rlphy
fxp+inphy (tested by Andrius V)
tlp+acphy
ex+exphy
epic+qsphy
vge+ciphy (tested by Andrius V)
vr+ukphy (tested by Andrius V)
vte+ukphy (tested by Andrius V)

Not tested (MAC):
arm:at91emac
arm:cemac
arm:epe
arm:geminigmac
arm:enet
arm:cpsw
arm:emac(omac)
arm:emac(sunxi)
arm:npe
evbppc:temac
macppc:bm
macppc:gm
mips:aumac
mips:ae
mips:cnmac
mips:reth
mips:sbmac
playstation2:smap
powerpc:tsec
powerpc:emac(ibm4xx)
sgimips:mec
sparc:be
sf
ne(ax88190, dl10019)
awge
ep
gem
hme
smsh
mtd
sm
age
alc
ale
bce
cas
et
jme
lii
nfe
pcn
ste
stge
tl
xi
aue
mue
smsc
udav
url

Not tested (PHY):
amhphy
bmtphy
dmphy
etphy
glxtphy
ikphy
iophy
lxtphy
nsphyter
pnaphy
rdcphy
sqphy
tlphy
tqphy
urlphy
 1.57 26-Jun-2018  msaitoh branches: 1.57.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.56 23-Mar-2018  jmcneill No need to print interrupt status for RX underflow as this status bit is handled already
 1.55 15-Dec-2016  ozaki-r branches: 1.55.14;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.54 08-Dec-2016  ozaki-r Apply deferred if_start framework

if_schedule_deferred_start checks if the if_snd queue contains packets,
so drivers don't need to check it by themselves.
 1.53 10-Jun-2016  ozaki-r branches: 1.53.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.52 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.51 13-Apr-2015  riastradh Missed a spot: rnd.h -> rndsource.h.
 1.50 10-Aug-2014  tls branches: 1.50.4;
Merge tls-earlyentropy branch into HEAD.
 1.49 22-Jul-2012  matt branches: 1.49.2; 1.49.12;
Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
 1.48 02-Feb-2012  tls Entropy-pool implementation move and cleanup.

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

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

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

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

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

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.47 19-Nov-2011  tls branches: 1.47.2;
First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

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

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

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

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

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

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

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

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

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

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

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

Manual pages for the new kernel interfaces are forthcoming.
 1.46 01-Jul-2011  dyoung branches: 1.46.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.45 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.44 10-Jan-2011  tsutsui branches: 1.44.2; 1.44.4;
Use ether_aton_r() in sys/net/if_ethersubr.c instead of home grown copies.
Hint from ryo@. Tested on IP32 mec(4).
 1.43 05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.42 19-Jan-2010  pooka branches: 1.42.2; 1.42.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.41 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.40 27-Nov-2009  tsutsui Fix typo in comment.
 1.39 02-Sep-2009  tsutsui Use a proper local variable.
 1.38 02-Sep-2009  tsutsui Invert logic around nested pmf(9) registrations for readability.
 1.37 01-Sep-2009  tsutsui Check a return value of pmf_device_register1(9) and also call
pmf_class_network_register(9).
 1.36 01-Sep-2009  tsutsui Replace shutdownhook_establish(9) with pmf_device_register1(9).
 1.35 09-May-2009  tsutsui Use __func__ to print function names.
 1.34 16-Mar-2009  tsutsui Add a dumb RX hardware TCPv4/UDPv4 checksum support.
 1.33 23-Aug-2008  tsutsui branches: 1.33.2; 1.33.8; 1.33.12;
If 802.1Q VLAN MTU is enabled, ignore the bad packet errror on RX.
 1.32 23-Aug-2008  tsutsui Enable ETHERCAP_VLAN_MTU.
 1.31 23-Aug-2008  tsutsui Improve mec(4)'s TX routine by reducing possible unnecessary mbuf copies
as much as possible before TX DMA.
With this new TX DMA buffer allocation strategy, most of TX packets are
sent without allocating new mbufs and copying data into them.

See the following mail for details:
http://mail-index.netbsd.org/port-sgimips/2008/08/15/msg000352.html

No objection on port-sgimips.
 1.30 14-Aug-2008  tsutsui Make sure to free an allocated mbuf on failure path.
 1.29 14-Aug-2008  tsutsui Set MEC_TXCMD_TXINT every MEC_NTXDESC_INTR packets
if more than half txdescs have been queued because
TX_EMPTY interrupts will rarely happen if TX queue is so stacked.
 1.28 12-Aug-2008  tsutsui Fix a critical botch (inverted test) I put in rev 1.21.
 1.27 10-Aug-2008  tsutsui Don't forget to unload TX dmamap on failure (in !MEC_TXSTAT_SUCCESS case).
 1.26 10-Aug-2008  tsutsui In mec_intr() call mec_init() on errors for workaround.
 1.25 10-Aug-2008  tsutsui - no need to set the TXCMD_TXINT bit against the last enqueued TX packet
because TX_EMPTY interrupt is enough to serve it on TX completion
- start TX right after each TX packet has been prepared

A quick ttcp(1) test shows ~5% improvements.
 1.24 10-Aug-2008  tsutsui Use while(cond){} instead of for(;;){if(!cond)break;}.
 1.23 10-Aug-2008  tsutsui The last txdesc is now preserved, so also set IFF_OACTIVE properly.
 1.22 10-Aug-2008  tsutsui Specify PAGE_SIZE boundary for TX dmamaps.
mec(4) hardware may have the restriction.
 1.21 07-Aug-2008  tsutsui - check TX_RING pointer in MEC_INT_STATUS in mec_rxintr() (from OpenBSD)
- preserve the last TX descriptor to avoid wraparound (as per Linux driver)
- check IFQ_IS_EMPTY() on calling mec_start() in mec_intr()
- clear IFF_OACTIVE only if a number of descriptors are freed in mec_txintr()

Seems to fix mec(4) hangup problem (and silent reboot by crime watchdog)
on heavy load. Tested by martin@ and Jorge Acereda Macia on port-sgimips.
(though Jorge still has some problem, but this should have fixed one issue)
 1.20 14-May-2008  tsutsui branches: 1.20.4;
Normalize my licenses.
 1.19 29-Apr-2008  tsutsui branches: 1.19.2;
- split softc/device_t with related changes
- always make local functions static since mips/conf/Makefile.mips
has been changed to preserve local symbols for debug
 1.18 25-Feb-2008  martin branches: 1.18.2; 1.18.4;
Add a hack to deal with hardware that misses the machine's serial number
for whatever reason - just generate a MAC address from another environemt
variable, so that the admin can adjust it.
 1.17 26-Jan-2008  tsutsui branches: 1.17.2; 1.17.6;
- call mec_reset() to make sure DMA stopped (inspired by OpenBSD)
- also stop DMA in mec_reset() before resetting chip
- set MAC address to MAC_STATION reg in mec_attach(), not in mec_reset()

Possibly fixes occasional interrupt storm from mec(4) (i.e. hangup) at boot.
 1.16 20-Jan-2008  he Remove two now-unused local variables.
 1.15 19-Jan-2008  dyoung Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange(). Check for
a non-ENXIO error return from mii_mediachg(). (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines. There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run. I have compiled macppc, sparc64, i386. I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
 1.14 29-Dec-2007  tsutsui Fix typo in comments. Mostly from OpenBSD.
 1.13 17-Oct-2007  garbled branches: 1.13.2; 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 15-Jul-2007  macallan branches: 1.12.10;
sprinkle delay() and mec_mii_wait() in MII access functions
with this I no longer get spontaneous reboots during network traffic
 1.11 09-Jul-2007  ad Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.10 04-Mar-2007  christos branches: 1.10.2; 1.10.4; 1.10.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 04-Feb-2007  tsutsui branches: 1.9.2;
Accept RX packets which are larger than ETHER_MAX_LEN but can be stored
into RX mbufs.

(BTW, is there any way to allocate RX mbufs aligned at PAGE_SIZE?)
 1.8 02-Apr-2006  tsutsui branches: 1.8.8; 1.8.12;
Add some delay() on asserting MEC_MAC_CORE_RESET.
 1.7 10-Dec-2005  tsutsui branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
Use 64bit access ops for MEC_PHY_* registers (for consistency).
 1.6 03-Jun-2005  martin branches: 1.6.2;
Constify
 1.5 18-May-2005  tsutsui Fix a typo. (from OpenBSD)
 1.4 30-Jan-2005  thorpej Eliminate use of M_HASFCS.
 1.3 24-Nov-2004  tsutsui branches: 1.3.4; 1.3.6;
Fix comment.
 1.2 30-Oct-2004  thorpej When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.1 23-Sep-2004  tsutsui branches: 1.1.2;
Rename if_mec_mace.c -> if_mec.c.
This file contains not only an attachment but whole driver functions.
 1.1.2.7 11-Dec-2005  christos Sync with head.
 1.1.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.2.5 04-Feb-2005  skrll Sync with HEAD.
 1.1.2.4 29-Nov-2004  skrll Sync with HEAD.
 1.1.2.3 02-Nov-2004  skrll Sync with HEAD.
 1.1.2.2 24-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 23-Sep-2004  skrll file if_mec.c was added on branch ktrace-lwp on 2004-09-24 10:53:17 +0000
 1.3.6.1 12-Feb-2005  yamt sync with head.
 1.3.4.1 29-Apr-2005  kent sync with -current
 1.6.2.6 27-Feb-2008  yamt sync with head.
 1.6.2.5 04-Feb-2008  yamt sync with head.
 1.6.2.4 21-Jan-2008  yamt sync with head
 1.6.2.3 03-Sep-2007  yamt sync with head.
 1.6.2.2 26-Feb-2007  yamt sync with head.
 1.6.2.1 21-Jun-2006  yamt sync with head.
 1.7.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.7.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.8.1 11-Apr-2006  yamt sync with head
 1.7.6.1 22-Apr-2006  simonb Sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.12.1 05-Nov-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #1221):
sys/arch/sgimips/mace/if_mec.c: revision 1.9
sys/arch/sgimips/mace/if_mec.c: revision 1.12
sys/arch/sgimips/mace/if_mec.c: revision 1.14
sys/arch/sgimips/mace/if_mec.c: revision 1.17
sys/arch/sgimips/mace/if_mec.c: revision 1.18
sys/arch/sgimips/mace/if_mec.c: revision 1.20
sys/arch/sgimips/mace/if_mec.c: revision 1.21 via patch
sys/arch/sgimips/mace/if_mec.c: revision 1.22
sys/arch/sgimips/mace/if_mec.c: revision 1.23
sys/arch/sgimips/mace/if_mec.c: revision 1.24
sys/arch/sgimips/mace/if_mec.c: revision 1.25
sys/arch/sgimips/mace/if_mec.c: revision 1.26 via patch
sys/arch/sgimips/mace/if_mec.c: revision 1.27 via patch
sys/arch/sgimips/mace/if_mec.c: revision 1.28
sys/arch/sgimips/mace/if_mec.c: revision 1.29
sys/arch/sgimips/mace/if_mec.c: revision 1.30 via patch
sys/arch/sgimips/mace/if_mecreg.h: revision 1.4
Accept RX packets which are larger than ETHER_MAX_LEN but can be stored
into RX mbufs.
(BTW, is there any way to allocate RX mbufs aligned at PAGE_SIZE?)
sprinkle delay() and mec_mii_wait() in MII access functions
with this I no longer get spontaneous reboots during network traffic
Fix typo in comments. Mostly from OpenBSD.
- call mec_reset() to make sure DMA stopped (inspired by OpenBSD)
- also stop DMA in mec_reset() before resetting chip
- set MAC address to MAC_STATION reg in mec_attach(), not in mec_reset()
Possibly fixes occasional interrupt storm from mec(4) (i.e. hangup) at boot.
Add a hack to deal with hardware that misses the machine's serial number
for whatever reason - just generate a MAC address from another environemt
variable, so that the admin can adjust it.
Normalize my licenses.
- check TX_RING pointer in MEC_INT_STATUS in mec_rxintr() (from OpenBSD)
- preserve the last TX descriptor to avoid wraparound (as per Linux driver)
- check IFQ_IS_EMPTY() on calling mec_start() in mec_intr()
- clear IFF_OACTIVE only if a number of descriptors are freed in mec_txintr()
Seems to fix mec(4) hangup problem (and silent reboot by crime watchdog)
on heavy load. Tested by martin@ and Jorge Acereda Macia on port-sgimips.
(though Jorge still has some problem, but this should have fixed one issue)
Specify PAGE_SIZE boundary for TX dmamaps.
mec(4) hardware may have the restriction.
The last txdesc is now preserved, so also set IFF_OACTIVE properly.
Use while(cond){} instead of for(;;){if(!cond)break;}.
- no need to set the TXCMD_TXINT bit against the last enqueued TX packet
because TX_EMPTY interrupt is enough to serve it on TX completion
- start TX right after each TX packet has been prepared
A quick ttcp(1) test shows ~5% improvements.
In mec_intr() call mec_init() on errors for workaround.
Don't forget to unload TX dmamap on failure (in !MEC_TXSTAT_SUCCESS case).
Fix a critical botch (inverted test) I put in rev 1.20.
Set MEC_TXCMD_TXINT every MEC_NTXDESC_INTR packets
if more than half txdescs have been queued because
TX_EMPTY interrupts will rarely happen if TX queue is so stacked.
Make sure to free an allocated mbuf on failure path.
 1.8.8.1 09-Feb-2007  ad Sync with HEAD.
 1.9.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.10.1 03-Oct-2007  garbled Sync with HEAD
 1.10.4.1 11-Jul-2007  mjf Sync with head.
 1.10.2.2 20-Aug-2007  ad Sync with HEAD.
 1.10.2.1 15-Jul-2007  ad Sync with head.
 1.12.10.3 23-Mar-2008  matt 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.2 20-Jan-2008  bouyer Sync with HEAD
 1.13.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.13.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.17.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.17.6.2 02-Jun-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.6 11-Aug-2010  yamt sync with head.
 1.18.4.5 11-Mar-2010  yamt sync with head
 1.18.4.4 16-Sep-2009  yamt sync with head
 1.18.4.3 16-May-2009  yamt sync with head
 1.18.4.2 04-May-2009  yamt sync with head.
 1.18.4.1 16-May-2008  yamt sync with head.
 1.18.2.1 18-May-2008  yamt sync with head.
 1.19.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.19.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.20.4.1 19-Oct-2008  haad Sync with HEAD.
 1.33.12.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.33.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.33.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.42.4.2 05-Mar-2011  rmind sync with head
 1.42.4.1 30-May-2010  rmind sync with head
 1.42.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.44.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.44.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.46.2.2 30-Oct-2012  yamt sync with head
 1.46.2.1 17-Apr-2012  yamt sync with head
 1.47.2.1 18-Feb-2012  mrg merge to -current.
 1.49.12.1 07-Apr-2014  tls Be a little more clear and consistent about harvesting entropy from devices:

1) deprecate RND_FLAG_NO_ESTIMATE

2) define RND_FLAG_COLLECT_TIME, RND_FLAG_COLLECT_VALUE

3) define RND_FLAG_ESTIMATE_TIME, RND_FLAG_ESTIMATE_VALUE

4) define RND_FLAG_DEFAULT: RND_FLAG_COLLECT_TIME|
RND_FLAG_COLLECT_VALUE|RND_FLAG_ESTIMATE_TIME

5) Make entropy harvesting from environmental sensors a little more generic
and remove it from individual sensor drivers.

6) Remove individual open-coded delta-estimators for values from a few
places in the tree (uvm, environmental drivers).

7) 0 -> RND_FLAG_DEFAULT, actually gather entropy from various drivers
that had stubbed out code, other minor cleanups.
 1.49.2.2 03-Dec-2017  jdolecek update from HEAD
 1.49.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.50.4.4 05-Feb-2017  skrll Sync with HEAD
 1.50.4.3 09-Jul-2016  skrll Sync with HEAD
 1.50.4.2 19-Mar-2016  skrll Sync with HEAD
 1.50.4.1 06-Jun-2015  skrll Sync with HEAD
 1.53.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.55.14.3 26-Jan-2019  pgoyette Sync with HEAD
 1.55.14.2 28-Jul-2018  pgoyette Sync with HEAD
 1.55.14.1 30-Mar-2018  pgoyette Resolve conflicts between branch and HEAD
 1.57.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.57.2.1 10-Jun-2019  christos Sync with HEAD
 1.62.2.1 29-Feb-2020  ad Sync with head.
 1.7 23-Sep-2004  tsutsui Rename if_mec_mace.c -> if_mec.c.
This file contains not only an attachment but whole driver functions.
 1.6 18-Aug-2004  tsutsui Remove bogus TABs. (from OpenBSD)
 1.5 01-Aug-2004  tsutsui branches: 1.5.2;
- It turns out alignment restriction for TX descs is 8kbytes, not 64kbytes.
- Use MEC_TX_ALIAS register to set/clear TX interrupt enable bit.
 1.4 14-Jul-2004  tsutsui Now multicast on mec0 is confirmed working, so remove XXX comment
in mec_setfilter() function.

Thanks to Gerald Heinig for providing multicast test programs.
 1.3 11-Jul-2004  tsutsui Add a working driver for O2 (IP32) on-board MACE MAC-110 Ethernet.

Note:
- I don't have any hardware docments for this device, so this driver might
have some odd descriptions guessed by results of try-and-errors.
(the only info I have is the Linux driver, but I think it doesn't describe
the hardware specifications very well anyway)
- All RX packets and most TX packets are copied from/to buffers in the driver
due to hardware restriction, so performance is not so good for now.
Maybe RX packets can be directly DMA'ed to mbufs by the same method used
of fxp(4), but the hardware seems to require 4kbyte aligned RX buffers.
- Multicast filter setup function is not tested yet (no info).
- Currently only tested on R5000 O2 with disabled L2 cache, so needs
more tests on other CPU (i.e. RM5200/R10000/R12000) models.
- Currently BUS_DMA_COHERENT is not used for the device control data DMA
to avoid performance issue on memcpy() against RX buffers, but it might be
problematic when L2 cache is enabled or on R10000 models.
 1.2 19-Jan-2004  sekiya branches: 1.2.2;
Checking for IP32 in each driver is redundant -- they're attached as children
of mace, so it is sufficient to perform the check in mace_match(). Pointed
out by soren@.
 1.1 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.2.2.3 12-Aug-2004  jmc Pullup rev 1.5 (requested by tsutsui in ticket #746)

- It turns out alignment restriction for TX descs is 8kbytes, not 64kbytes.
- Use MEC_TX_ALIAS register to set/clear TX interrupt enable bit.
 1.2.2.2 15-Jul-2004  tron Pull up revision 1.4 (requested by tsutsui in ticket #652):
Now multicast on mec0 is confirmed working, so remove XXX comment
in mec_setfilter() function.
Thanks to Gerald Heinig for providing multicast test programs.
 1.2.2.1 15-Jul-2004  tron Pull up revision 1.3 (requested by tsutsui in ticket #652):
Add a working driver for O2 (IP32) on-board MACE MAC-110 Ethernet.
Note:
- I don't have any hardware docments for this device, so this driver might
have some odd descriptions guessed by results of try-and-errors.
(the only info I have is the Linux driver, but I think it doesn't describe
the hardware specifications very well anyway)
- All RX packets and most TX packets are copied from/to buffers in the driver
due to hardware restriction, so performance is not so good for now.
Maybe RX packets can be directly DMA'ed to mbufs by the same method used
of fxp(4), but the hardware seems to require 4kbyte aligned RX buffers.
- Multicast filter setup function is not tested yet (no info).
- Currently only tested on R5000 O2 with disabled L2 cache, so needs
more tests on other CPU (i.e. RM5200/R10000/R12000) models.
- Currently BUS_DMA_COHERENT is not used for the device control data DMA
to avoid performance issue on memcpy() against RX buffers, but it might be
problematic when L2 cache is enabled or on R10000 models.
 1.5.2.6 19-Oct-2004  skrll Sync with HEAD
 1.5.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.3 25-Aug-2004  skrll Sync with HEAD.
 1.5.2.2 03-Aug-2004  skrll Sync with HEAD
 1.5.2.1 01-Aug-2004  skrll file if_mec_mace.c was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.4 07-Aug-2008  tsutsui - check TX_RING pointer in MEC_INT_STATUS in mec_rxintr() (from OpenBSD)
- preserve the last TX descriptor to avoid wraparound (as per Linux driver)
- check IFQ_IS_EMPTY() on calling mec_start() in mec_intr()
- clear IFF_OACTIVE only if a number of descriptors are freed in mec_txintr()

Seems to fix mec(4) hangup problem (and silent reboot by crime watchdog)
on heavy load. Tested by martin@ and Jorge Acereda Macia on port-sgimips.
(though Jorge still has some problem, but this should have fixed one issue)
 1.3 10-Dec-2005  tsutsui branches: 1.3.24; 1.3.74; 1.3.78; 1.3.80; 1.3.84;
Use 64bit access ops for MEC_PHY_* registers (for consistency).
 1.2 11-Jul-2004  tsutsui branches: 1.2.2; 1.2.14;
Add a working driver for O2 (IP32) on-board MACE MAC-110 Ethernet.

Note:
- I don't have any hardware docments for this device, so this driver might
have some odd descriptions guessed by results of try-and-errors.
(the only info I have is the Linux driver, but I think it doesn't describe
the hardware specifications very well anyway)
- All RX packets and most TX packets are copied from/to buffers in the driver
due to hardware restriction, so performance is not so good for now.
Maybe RX packets can be directly DMA'ed to mbufs by the same method used
of fxp(4), but the hardware seems to require 4kbyte aligned RX buffers.
- Multicast filter setup function is not tested yet (no info).
- Currently only tested on R5000 O2 with disabled L2 cache, so needs
more tests on other CPU (i.e. RM5200/R10000/R12000) models.
- Currently BUS_DMA_COHERENT is not used for the device control data DMA
to avoid performance issue on memcpy() against RX buffers, but it might be
problematic when L2 cache is enabled or on R10000 models.
 1.1 18-Jan-2004  sekiya branches: 1.1.2;
Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.1.2.1 15-Jul-2004  tron Pull up revision 1.2 (requested by tsutsui in ticket #652):
Add a working driver for O2 (IP32) on-board MACE MAC-110 Ethernet.
Note:
- I don't have any hardware docments for this device, so this driver might
have some odd descriptions guessed by results of try-and-errors.
(the only info I have is the Linux driver, but I think it doesn't describe
the hardware specifications very well anyway)
- All RX packets and most TX packets are copied from/to buffers in the driver
due to hardware restriction, so performance is not so good for now.
Maybe RX packets can be directly DMA'ed to mbufs by the same method used
of fxp(4), but the hardware seems to require 4kbyte aligned RX buffers.
- Multicast filter setup function is not tested yet (no info).
- Currently only tested on R5000 O2 with disabled L2 cache, so needs
more tests on other CPU (i.e. RM5200/R10000/R12000) models.
- Currently BUS_DMA_COHERENT is not used for the device control data DMA
to avoid performance issue on memcpy() against RX buffers, but it might be
problematic when L2 cache is enabled or on R10000 models.
 1.2.14.1 21-Jun-2006  yamt sync with head.
 1.2.2.5 11-Dec-2005  christos Sync with head.
 1.2.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.2 03-Aug-2004  skrll Sync with HEAD
 1.2.2.1 11-Jul-2004  skrll file if_mecreg.h was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.3.84.1 19-Oct-2008  haad Sync with HEAD.
 1.3.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.3.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.3.24.1 05-Nov-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #1221):
sys/arch/sgimips/mace/if_mec.c: revision 1.9
sys/arch/sgimips/mace/if_mec.c: revision 1.12
sys/arch/sgimips/mace/if_mec.c: revision 1.14
sys/arch/sgimips/mace/if_mec.c: revision 1.17
sys/arch/sgimips/mace/if_mec.c: revision 1.18
sys/arch/sgimips/mace/if_mec.c: revision 1.20
sys/arch/sgimips/mace/if_mec.c: revision 1.21 via patch
sys/arch/sgimips/mace/if_mec.c: revision 1.22
sys/arch/sgimips/mace/if_mec.c: revision 1.23
sys/arch/sgimips/mace/if_mec.c: revision 1.24
sys/arch/sgimips/mace/if_mec.c: revision 1.25
sys/arch/sgimips/mace/if_mec.c: revision 1.26 via patch
sys/arch/sgimips/mace/if_mec.c: revision 1.27 via patch
sys/arch/sgimips/mace/if_mec.c: revision 1.28
sys/arch/sgimips/mace/if_mec.c: revision 1.29
sys/arch/sgimips/mace/if_mec.c: revision 1.30 via patch
sys/arch/sgimips/mace/if_mecreg.h: revision 1.4
Accept RX packets which are larger than ETHER_MAX_LEN but can be stored
into RX mbufs.
(BTW, is there any way to allocate RX mbufs aligned at PAGE_SIZE?)
sprinkle delay() and mec_mii_wait() in MII access functions
with this I no longer get spontaneous reboots during network traffic
Fix typo in comments. Mostly from OpenBSD.
- call mec_reset() to make sure DMA stopped (inspired by OpenBSD)
- also stop DMA in mec_reset() before resetting chip
- set MAC address to MAC_STATION reg in mec_attach(), not in mec_reset()
Possibly fixes occasional interrupt storm from mec(4) (i.e. hangup) at boot.
Add a hack to deal with hardware that misses the machine's serial number
for whatever reason - just generate a MAC address from another environemt
variable, so that the admin can adjust it.
Normalize my licenses.
- check TX_RING pointer in MEC_INT_STATUS in mec_rxintr() (from OpenBSD)
- preserve the last TX descriptor to avoid wraparound (as per Linux driver)
- check IFQ_IS_EMPTY() on calling mec_start() in mec_intr()
- clear IFF_OACTIVE only if a number of descriptors are freed in mec_txintr()
Seems to fix mec(4) hangup problem (and silent reboot by crime watchdog)
on heavy load. Tested by martin@ and Jorge Acereda Macia on port-sgimips.
(though Jorge still has some problem, but this should have fixed one issue)
Specify PAGE_SIZE boundary for TX dmamaps.
mec(4) hardware may have the restriction.
The last txdesc is now preserved, so also set IFF_OACTIVE properly.
Use while(cond){} instead of for(;;){if(!cond)break;}.
- no need to set the TXCMD_TXINT bit against the last enqueued TX packet
because TX_EMPTY interrupt is enough to serve it on TX completion
- start TX right after each TX packet has been prepared
A quick ttcp(1) test shows ~5% improvements.
In mec_intr() call mec_init() on errors for workaround.
Don't forget to unload TX dmamap on failure (in !MEC_TXSTAT_SUCCESS case).
Fix a critical botch (inverted test) I put in rev 1.20.
Set MEC_TXCMD_TXINT every MEC_NTXDESC_INTR packets
if more than half txdescs have been queued because
TX_EMPTY interrupts will rarely happen if TX queue is so stacked.
Make sure to free an allocated mbuf on failure path.
 1.9 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.8 21-Nov-2009  rmind Use lwp_getpcb() on mips, powerpc and sh3, clean from struct user usage.
 1.7 07-Mar-2008  cube branches: 1.7.4;
Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
 1.6 11-Dec-2005  christos branches: 1.6.50; 1.6.70; 1.6.74;
merge ktrace-lwp.
 1.5 29-Sep-2004  sekiya branches: 1.5.12;
Use ANSI function declarations.
 1.4 12-Jul-2004  tsutsui branches: 1.4.2;
Reenable lpt at mace since shared interrupt code was fixed in mace.c rev 1.2.
 1.3 25-Mar-2004  sekiya The lpt driver doesn't play nicely with the serial ports -- they share the
same interrupt, and something isn't quite right with the mace interrupt
dispatcher. Disable for now.

Pointed out by Tillman Hodgson and confirmed by ozone on port-sgimips.
 1.2 19-Jan-2004  sekiya Checking for IP32 in each driver is redundant -- they're attached as children
of mace, so it is sufficient to perform the check in mace_match(). Pointed
out by soren@.
 1.1 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.4.2.5 19-Oct-2004  skrll Sync with HEAD
 1.4.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.2 03-Aug-2004  skrll Sync with HEAD
 1.4.2.1 12-Jul-2004  skrll file lpt_mace.c was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.5.12.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.4.1 11-Mar-2010  yamt sync with head
 1.2 13-Apr-2007  jmcneill Remove traces of macau, it never existed in the first place apart for
a handful of register definitions.
 1.1 18-Jan-2004  sekiya branches: 1.1.4; 1.1.18; 1.1.56; 1.1.60; 1.1.62;
Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.1.62.1 11-Jul-2007  mjf Sync with head.
 1.1.60.2 15-Jul-2007  ad Sync with head.
 1.1.60.1 27-May-2007  ad Sync with head.
 1.1.56.1 15-Apr-2007  yamt sync with head.
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 18-Jan-2004  skrll file macaureg.h was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.27 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.26 03-Aug-2023  mrg check a pointer's value not the address of a pointer.

found by GCC 12.
 1.25 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.24 24-Apr-2021  thorpej branches: 1.24.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.23 13-Jul-2016  macallan branches: 1.23.32;
appease gcc by removing now unnecessary cast
 1.22 30-Jun-2015  macallan shorten the interrupt name so the level field is actually readable in systat
 1.21 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.20 16-Dec-2013  mrg branches: 1.20.6;
- remove unused variables
- use (void) when we don't care about the return value
 1.19 27-Oct-2012  chs branches: 1.19.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.18 18-Aug-2011  macallan branches: 1.18.2; 1.18.12;
device_t-ify
 1.17 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.16 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.15 23-Aug-2008  tsutsui branches: 1.15.12;
KNF and misc cosmetics.
 1.14 02-Feb-2008  sekiya branches: 1.14.6; 1.14.10; 1.14.12; 1.14.16;
Garbage-collect my old broken attempt at creating a ringbuffer for the audio
chip. Fix grammar in a comment while I'm here.
 1.13 17-Oct-2007  garbled branches: 1.13.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.12 09-Jul-2007  ad branches: 1.12.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.11 14-Apr-2007  jmcneill branches: 1.11.2;
We don't use the RTC interrupt (yet), so mask it as well.
 1.10 14-Apr-2007  jmcneill Disable count/compare timer interrupts, as NetBSD does not use these.
 1.9 04-Mar-2007  christos branches: 1.9.2; 1.9.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 26-Nov-2005  tsutsui branches: 1.8.26;
Use aprint_debug() instead of aprint_normal() for messages
of establishing/disestablishing mace interrupt.
 1.7 26-Aug-2005  drochner branches: 1.7.6;
s/locdesc_t/int/g
 1.6 30-Jun-2005  drochner branches: 1.6.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.5 06-Sep-2004  sekiya Use the mace interrupt handler for PCI interrupts.

From KIYOHARA Takashi
 1.4 10-Jul-2004  tsutsui branches: 1.4.2;
Count mace interrupts by evcnt(9).
 1.3 10-Jul-2004  tsutsui Remove a debug printf.
 1.2 10-Jul-2004  tsutsui Make sure shared interrupts properly handled.
 1.1 18-Jan-2004  sekiya branches: 1.1.2;
Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.1.2.1 15-Jul-2004  he Pull up revisions 1.2-1.3 (requested by tsutsui in ticket #657):
Make sure shared interrupts are properly handled. Makes
com0/com1/lpt0 on mace work if more than one is configured.
 1.4.2.6 11-Dec-2005  christos Sync with head.
 1.4.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.2 03-Aug-2004  skrll Sync with HEAD
 1.4.2.1 10-Jul-2004  skrll file mace.c was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.6.2.3 04-Feb-2008  yamt sync with head.
 1.6.2.2 03-Sep-2007  yamt sync with head.
 1.6.2.1 21-Jun-2006  yamt sync with head.
 1.7.6.1 29-Nov-2005  yamt sync with head.
 1.8.26.2 15-Apr-2007  yamt sync with head.
 1.8.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.4.1 11-Jul-2007  mjf Sync with head.
 1.9.2.2 15-Jul-2007  ad Sync with head.
 1.9.2.1 27-May-2007  ad Sync with head.
 1.11.2.1 03-Oct-2007  garbled Sync with HEAD
 1.12.10.2 23-Mar-2008  matt sync with HEAD
 1.12.10.1 06-Nov-2007  matt sync with HEAD
 1.13.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.14.16.1 19-Oct-2008  haad Sync with HEAD.
 1.14.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.14.10.2 11-Mar-2010  yamt sync with head
 1.14.10.1 04-May-2009  yamt sync with head.
 1.14.6.1 28-Sep-2008  mjf Sync with HEAD.
 1.15.12.2 23-Nov-2009  matt mips3_ld/mips3_sd need to be passed a volatile uint64_t *
 1.15.12.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.18.12.3 03-Dec-2017  jdolecek update from HEAD
 1.18.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.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.18.2.1 30-Oct-2012  yamt sync with head
 1.19.2.1 18-May-2014  rmind sync with head
 1.20.6.3 05-Oct-2016  skrll Sync with HEAD
 1.20.6.2 22-Sep-2015  skrll Sync with HEAD
 1.20.6.1 06-Apr-2015  skrll Sync with HEAD
 1.23.32.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.23.32.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.23.32.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.23.32.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.23.32.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.23.32.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.24.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.9 01-Oct-2019  chs in many device attach paths, allocate memory with KM_SLEEP instead of KM_NOSLEEP
and remove code to handle failures that can no longer happen.
 1.8 04-Apr-2015  macallan branches: 1.8.18;
malloc() -> kmem_alloc() for private data, also kmem_free() them if we
don't finish attaching for whatever reason

found by Brainy
 1.7 27-Oct-2012  chs branches: 1.7.12; 1.7.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.6 01-Jul-2011  dyoung branches: 1.6.2; 1.6.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.5 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.4 05-May-2008  jmcneill branches: 1.4.22; 1.4.28; 1.4.30;
Use 2-clause license.
 1.3 08-Mar-2008  tnn branches: 1.3.2; 1.3.4;
- Attach the keyboard controller even if we're on serial console.
- If arcbios is using graphics console, then attach the keyboard as the
console keyboard. Makes ddb work on the framebuffer console.
 1.2 14-Apr-2007  jmcneill branches: 1.2.2; 1.2.6; 1.2.8; 1.2.18; 1.2.20; 1.2.36; 1.2.40;
Don't bother attaching if the keyboard is not the console. Reduce the
amount of time that macekbc_wait takes before timing out, and don't
bother checking the status of unattached ports in the interrupt handler.
 1.1 10-Apr-2007  jmcneill Add SGI MACE ps2 keyboard/aux controller driver. ok rumble@

XXX can someone confirm that we can remove pckbc_mace?
 1.2.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.2.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.2.36.1 24-Mar-2008  keiichi sync with head.
 1.2.20.3 17-Mar-2008  yamt sync with head.
 1.2.20.2 03-Sep-2007  yamt sync with head.
 1.2.20.1 14-Apr-2007  yamt file macekbc.c was added on branch yamt-lazymbuf on 2007-09-03 14:29:20 +0000
 1.2.18.1 23-Mar-2008  matt sync with HEAD
 1.2.8.2 11-Jul-2007  mjf Sync with head.
 1.2.8.1 14-Apr-2007  mjf file macekbc.c was added on branch mjf-ufs-trans on 2007-07-11 20:01:44 +0000
 1.2.6.2 09-Jun-2007  ad Sync with head.
 1.2.6.1 14-Apr-2007  ad file macekbc.c was added on branch vmlocking on 2007-06-09 21:37:01 +0000
 1.2.2.2 15-Apr-2007  yamt sync with head.
 1.2.2.1 14-Apr-2007  yamt file macekbc.c was added on branch yamt-idlelwp on 2007-04-15 16:02:54 +0000
 1.3.4.1 16-May-2008  yamt sync with head.
 1.3.2.1 18-May-2008  yamt sync with head.
 1.4.30.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.22.1 05-Mar-2011  rmind sync with head
 1.6.12.2 03-Dec-2017  jdolecek update from HEAD
 1.6.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.2.1 30-Oct-2012  yamt sync with head
 1.7.14.1 06-Apr-2015  skrll Sync with HEAD
 1.7.12.1 16-May-2015  snj Pull up following revision(s) (requested by maxv in ticket #761):
sys/arch/sgimips/dev/scn.c: revision 1.8
sys/arch/sgimips/mace/macekbc.c: revision 1.8
sys/dev/hpc/hpcfb.c: revision 1.59
sys/dev/i2c/i2c.c: revision 1.47
sys/dev/ic/mfi.c: revision 1.57
sys/dev/if_ndis/if_ndis_pci.c: revision 1.21
sys/dev/sysmon/sysmon_power.c: revisions 1.50-1.52
sys/dev/usb/umass_isdata.c: revision 1.31
fix double free, found by Brainy.
--
Free cmd on error if we allocated it.
Found by Brainy, reported by maxv@.
--
don't leak rl (but there are other leaks), found by Brainy.
--
Free ped if we can't hand it to the power daemon.
Found by Brainy, reported by maxv@.
--
don't forget to free the dictionary.
--
another missing free dict.
--
fix leak, found by Brainy.
--
don't malloc a tiny, fixed size buffer to scribble into, then not use it
and never free it either
found by Brainy
--
malloc() -> kmem_alloc() for private data, also kmem_free() them if we
don't finish attaching for whatever reason
found by Brainy
 1.8.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 13-Apr-2007  jmcneill Add some MACE audio bit definitions, from OpenBSD.
 1.2 11-Dec-2005  christos branches: 1.2.26; 1.2.30; 1.2.32;
merge ktrace-lwp.
 1.1 18-Jan-2004  sekiya branches: 1.1.4; 1.1.18;
Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 18-Jan-2004  skrll file macereg.h was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.2.32.1 11-Jul-2007  mjf Sync with head.
 1.2.30.1 27-May-2007  ad Sync with head.
 1.2.26.1 15-Apr-2007  yamt sync with head.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 06-Sep-2004  sekiya Use the mace interrupt handler for PCI interrupts.

From KIYOHARA Takashi
 1.1 18-Jan-2004  sekiya branches: 1.1.4;
Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 18-Jan-2004  skrll file macevar.h was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.14 07-Jun-2019  isaki mavb supports only playback for now, so drop FULLDUPLEX and INDEPENDENT
property. These properies are valid only for bidirectional device.
 1.13 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.12 16-Mar-2019  isaki branches: 1.12.2;
Use C99 style struct initializer to audio_hw_if.
 1.11 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.10 17-Feb-2015  macallan branches: 1.10.16; 1.10.18;
move DAC1 output channel to master so things like OSS and kmix work
as expected
 1.9 27-Oct-2012  chs branches: 1.9.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.8 23-Nov-2011  jmcneill branches: 1.8.8;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.7 01-Jul-2011  dyoung branches: 1.7.2; 1.7.4;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.6 23-Aug-2008  tsutsui KNF and misc cosmetics.
 1.5 26-Jan-2008  jmcneill branches: 1.5.6; 1.5.10; 1.5.12; 1.5.16;
Use auconv to create our encoding list for us.
 1.4 17-Oct-2007  garbled branches: 1.4.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.3 09-Jul-2007  ad branches: 1.3.2; 1.3.12; 1.3.14;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.2 13-Apr-2007  jmcneill branches: 1.2.2; 1.2.4; 1.2.6;
GC a few commented out lines of code, no functional change.
 1.1 13-Apr-2007  jmcneill Add SGI O2 MACE audio driver, from OpenBSD.
 1.2.6.3 15-Jul-2007  ad Sync with head.
 1.2.6.2 09-Jun-2007  ad Sync with head.
 1.2.6.1 13-Apr-2007  ad file mavb.c was added on branch vmlocking on 2007-06-09 21:37:02 +0000
 1.2.4.1 03-Oct-2007  garbled Sync with HEAD
 1.2.2.2 15-Apr-2007  yamt sync with head.
 1.2.2.1 13-Apr-2007  yamt file mavb.c was added on branch yamt-idlelwp on 2007-04-15 16:02:55 +0000
 1.3.14.3 04-Feb-2008  yamt sync with head.
 1.3.14.2 03-Sep-2007  yamt sync with head.
 1.3.14.1 09-Jul-2007  yamt file mavb.c was added on branch yamt-lazymbuf on 2007-09-03 14:29:20 +0000
 1.3.12.2 23-Mar-2008  matt sync with HEAD
 1.3.12.1 06-Nov-2007  matt sync with HEAD
 1.3.2.2 11-Jul-2007  mjf Sync with head.
 1.3.2.1 09-Jul-2007  mjf file mavb.c was added on branch mjf-ufs-trans on 2007-07-11 20:01:45 +0000
 1.4.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.5.16.1 19-Oct-2008  haad Sync with HEAD.
 1.5.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.10.1 04-May-2009  yamt sync with head.
 1.5.6.1 28-Sep-2008  mjf Sync with HEAD.
 1.7.4.4 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.7.4.3 20-Nov-2011  jmcneill no need to enter intr_lock from trigger_output, it's already held
 1.7.4.2 20-Nov-2011  jmcneill fix size passed to kmem_free in stream filter dtor
 1.7.4.1 20-Nov-2011  jmcneill adapt to audiomp api changes
 1.7.2.2 30-Oct-2012  yamt sync with head
 1.7.2.1 17-Apr-2012  yamt sync with head
 1.8.8.2 03-Dec-2017  jdolecek update from HEAD
 1.8.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.14.1 06-Apr-2015  skrll Sync with HEAD
 1.10.18.1 10-Jun-2019  christos Sync with HEAD
 1.10.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.12.2.4 04-May-2019  isaki Correct precision.
Tested by naru@. Thanks.
 1.12.2.3 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.12.2.2 21-Apr-2019  isaki Adapt to audio2.
- The driver does not support recording so drop CAPTURE property.
 1.12.2.1 21-Apr-2019  isaki Use C99 style struct initializer to audio_format.
 1.1 13-Apr-2007  jmcneill branches: 1.1.2; 1.1.6; 1.1.8; 1.1.20;
Add SGI O2 MACE audio driver, from OpenBSD.
 1.1.20.2 03-Sep-2007  yamt sync with head.
 1.1.20.1 13-Apr-2007  yamt file mavbreg.h was added on branch yamt-lazymbuf on 2007-09-03 14:29:21 +0000
 1.1.8.2 11-Jul-2007  mjf Sync with head.
 1.1.8.1 13-Apr-2007  mjf file mavbreg.h was added on branch mjf-ufs-trans on 2007-07-11 20:01:46 +0000
 1.1.6.2 09-Jun-2007  ad Sync with head.
 1.1.6.1 13-Apr-2007  ad file mavbreg.h was added on branch vmlocking on 2007-06-09 21:37:02 +0000
 1.1.2.2 15-Apr-2007  yamt sync with head.
 1.1.2.1 13-Apr-2007  yamt file mavbreg.h was added on branch yamt-idlelwp on 2007-04-15 16:02:55 +0000
 1.19 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.18 07-Sep-2025  thorpej Remove unnecessary NULL-initialization of TODR handle fields.
 1.17 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.16 20-Nov-2014  christos branches: 1.16.2;
use the inline bcdtobin and bintobcd directly instead through a macro.
 1.15 16-Dec-2013  mrg - remove unused variables
- use (void) when we don't care about the return value
 1.14 01-Jul-2011  dyoung branches: 1.14.2; 1.14.12; 1.14.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.13 13-Dec-2009  tsutsui Split device_t/softc, some KNF.
 1.12 13-Dec-2009  tsutsui Use todr_[gs]ettime_ymdhms() format.
 1.11 12-Dec-2009  tsutsui 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.10 03-Apr-2009  uebayasi Include sys/device.h. Fix build.
 1.9 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.8 17-Oct-2007  garbled branches: 1.8.20; 1.8.28; 1.8.34;
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 26-Sep-2007  macallan add mcclock_poweroff()
 1.6 24-Jul-2007  pooka branches: 1.6.4; 1.6.6; 1.6.8;
remove TNF advertising clause from file copyrighted to me
 1.5 05-Sep-2006  rumble branches: 1.5.12; 1.5.20; 1.5.24; 1.5.26;
Switch sgimips to MI todr.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 19-Jan-2004  sekiya branches: 1.3.4; 1.3.18;
Checking for IP32 in each driver is redundant -- they're attached as children
of mace, so it is sufficient to perform the check in mace_match(). Pointed
out by soren@.
 1.2 19-Jan-2004  sekiya Attach the com and mcclock devices only if the machine is an IP32.
 1.1 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.3.18.3 27-Oct-2007  yamt sync with head.
 1.3.18.2 03-Sep-2007  yamt sync with head.
 1.3.18.1 30-Dec-2006  yamt sync with head.
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 19-Jan-2004  skrll file mcclock_mace.c was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.4.8.1 14-Sep-2006  yamt sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.26.1 15-Aug-2007  skrll Sync with HEAD.
 1.5.24.1 07-Aug-2007  matt Sync with HEAD.
 1.5.20.1 03-Oct-2007  garbled Sync with HEAD
 1.5.12.2 09-Oct-2007  ad Sync with head.
 1.5.12.1 20-Aug-2007  ad Sync with HEAD.
 1.6.8.1 06-Oct-2007  yamt sync with head.
 1.6.6.1 06-Nov-2007  matt sync with HEAD
 1.6.4.1 02-Oct-2007  joerg Sync with HEAD.
 1.8.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.20.2 11-Mar-2010  yamt sync with head
 1.8.20.1 04-May-2009  yamt sync with head.
 1.14.16.1 18-May-2014  rmind sync with head
 1.14.12.2 03-Dec-2017  jdolecek update from HEAD
 1.14.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.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.16.2.1 06-Apr-2015  skrll Sync with HEAD
 1.26 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.25 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.24 24-Apr-2021  thorpej branches: 1.24.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.23 07-Jul-2020  thorpej branches: 1.23.4;
Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
Provide a new resource provider API:

==> pciconf_resource_init() -- Initialize a PCI configuration resources
container.
==> pciconf_resource_add() -- Add a PCI configuration resource to the
container (I/O, MEM, or prefetchable MEM). Multiple resources of
each type may be added.
==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
container once the bus has been configured.

This is much easier to use than the previous method of providing an
extent map for each kind of resource, and works better for e.g. ACPI
platforms that provide potentially multiple PCI resources in tables
provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
rather than extent maps.
 1.22 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.21 05-Aug-2016  macallan simplify macepci_intr():
- use uint32_t
- always clear all error bits
- avoid a compiler bug(?) which caused the test for MACE_PERR_MASTER_ABORT
to fail on n32
now my O2 no longer hangs when leaving cold
 1.20 02-Oct-2015  msaitoh branches: 1.20.2;
PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.19 24-Sep-2015  macallan on mips64 we can use the whole PCI space, not just the two 32MB windows
accessible via KSEG*
 1.18 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.17 29-Mar-2014  christos branches: 1.17.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.16 26-Mar-2014  christos kill sprintf.
 1.15 27-Oct-2012  chs branches: 1.15.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.14 27-Jan-2012  para branches: 1.14.6;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.13 01-Jul-2011  dyoung branches: 1.13.2; 1.13.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.12 17-May-2011  dyoung PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name. Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
 1.11 11-May-2011  dyoung Now that GENERIC32_IPX3x builds again, fix some pci_attach_args
constification that I'd missed.
 1.10 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.9 17-Apr-2007  sekiya branches: 1.9.54; 1.9.58; 1.9.64; 1.9.66;
Nuke homegrown PCI configuration routines. #ifdef'd out by tsutsui@ a long
time ago; this is just garbage collection.
 1.8 30-Aug-2006  rumble branches: 1.8.8; 1.8.12; 1.8.14;
Generalise pci/pci_machdep.c further and move all mace-specific code into
mace/pci_mace.c in preparation for pci devices on the gio(4) bus.
 1.7 17-Apr-2006  tsutsui branches: 1.7.6;
Switch macepci to use MI pci_configure_bus(9) rather than its own fixup code.
Tested on my O2 with several devices, and ok'ed by sekiya.
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.6; 1.6.8; 1.6.10; 1.6.12;
merge ktrace-lwp.
 1.5 29-Sep-2004  sekiya branches: 1.5.12;
Use ANSI function declarations.
 1.4 06-Sep-2004  sekiya Use the mace interrupt handler for PCI interrupts.

From KIYOHARA Takashi
 1.3 30-Aug-2004  drochner Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.2 19-Jan-2004  sekiya branches: 1.2.4;
Checking for IP32 in each driver is redundant -- they're attached as children
of mace, so it is sufficient to perform the check in mace_match(). Pointed
out by soren@.
 1.1 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.2.4.6 19-Oct-2004  skrll Sync with HEAD
 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 03-Sep-2004  skrll Sync with HEAD
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 19-Jan-2004  skrll file pci_mace.c was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.5.12.3 03-Sep-2007  yamt sync with head.
 1.5.12.2 30-Dec-2006  yamt sync with head.
 1.5.12.1 21-Jun-2006  yamt sync with head.
 1.6.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.6.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.6.8.2 03-Sep-2006  yamt sync with head.
 1.6.8.1 24-May-2006  yamt sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.6.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/include/pci_machdep.h: revision 1.9
sys/arch/sgimips/pci/pci_machdep.c: revision 1.19
sys/arch/sgimips/mace/pci_mace.c: revision 1.8
Generalise pci/pci_machdep.c further and move all mace-specific code into
mace/pci_mace.c in preparation for pci devices on the gio(4) bus.
 1.8.14.1 11-Jul-2007  mjf Sync with head.
 1.8.12.1 27-May-2007  ad Sync with head.
 1.8.8.1 07-May-2007  yamt sync with head.
 1.9.66.1 05-Mar-2011  bouyer Sync with HEAD
 1.9.64.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.58.2 31-May-2011  rmind sync with head
 1.9.58.1 05-Mar-2011  rmind sync with head
 1.9.54.1 20-Jan-2010  matt Adjust things to the new world order.
 1.13.6.1 18-Feb-2012  mrg merge to -current.
 1.13.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.13.2.2 30-Oct-2012  yamt sync with head
 1.13.2.1 17-Apr-2012  yamt sync with head
 1.14.6.3 03-Dec-2017  jdolecek update from HEAD
 1.14.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.15.2.1 18-May-2014  rmind sync with head
 1.17.6.3 05-Oct-2016  skrll Sync with HEAD
 1.17.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.17.6.1 06-Apr-2015  skrll Sync with HEAD
 1.20.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.23.4.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.24.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.3 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.2 11-Dec-2005  christos branches: 1.2.122; 1.2.142;
merge ktrace-lwp.
 1.1 18-Jan-2004  sekiya branches: 1.1.4;
Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 18-Jan-2004  skrll file pcireg_mace.h was added on branch ktrace-lwp on 2004-08-03 10:40:07 +0000
 1.2.142.1 06-Apr-2015  skrll Sync with HEAD
 1.2.122.1 03-Dec-2017  jdolecek update from HEAD
 1.6 12-Apr-2007  jmcneill Remove pckbc_mace, it has never worked and has been replaced by macekbc
 1.5 11-Dec-2005  christos branches: 1.5.26; 1.5.30; 1.5.32;
merge ktrace-lwp.
 1.4 29-Sep-2004  sekiya branches: 1.4.12;
Use ANSI function declarations.
 1.3 14-Feb-2004  bjh21 branches: 1.3.4;
Add a new MI attribute, pckbc_machdep_cnattach, and change pckbc_cnattach()
to only call pckbc_machdep_cnattach() if this is present. This allows
pckbc_machdep_cnattach() to be omitted entirely on most ports, where it only
returns ENXIO anyway.

The devices with this attribute at the moment are pc(4) on i386 and bebox, and
pckbc on sparc, where pckbc_machdep_cnattach() mysteriously returns 0 rather
than ENXIO.
 1.2 19-Jan-2004  sekiya Checking for IP32 in each driver is redundant -- they're attached as children
of mace, so it is sufficient to perform the check in mace_match(). Pointed
out by soren@.
 1.1 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.3.4.5 19-Oct-2004  skrll Sync with HEAD
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 14-Feb-2004  skrll file pckbc_mace.c was added on branch ktrace-lwp on 2004-08-03 10:40:08 +0000
 1.4.12.1 03-Sep-2007  yamt sync with head.
 1.5.32.1 11-Jul-2007  mjf Sync with head.
 1.5.30.1 27-May-2007  ad Sync with head.
 1.5.26.1 15-Apr-2007  yamt sync with head.
 1.18 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.17 18-Jan-2004  sekiya Do not directly reference crime_*() routines, go through the platform
struct pointers instead.
 1.16 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.15 25-Oct-2003  chs NULL -> 0
 1.14 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.13 04-Oct-2003  tsutsui TAB/space cleanup.
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 15-Jun-2003  fvdl branches: 1.11.2;
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.10 19-Jan-2003  rafal Fix a bug that would cause the PCI fixup to assign addresses beyond the range
of KSEG0/1 mappable PCI window (the MEG_ALIGN macro was aligning to *16* MB
instead of *1* MB due to an extra 0 in the round-to constant). Also, allow
the PCI code to fix up all functions of a multifunction device; both from
Chris Sekiya, with a bit of massaging by me.
 1.9 06-Jan-2003  rafal PCI fixup code for the O2. Tested with a range of 32 and 64-bit network
cards, but not much else. Seems to work fairly well, though.
 1.8 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.7 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 16-May-2002  thorpej branches: 1.5.2;
* Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses. For busses behind a bridge, it points to
a persistent copy of the bridge's pcitag_t. This can be very useful
for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
uses OFW device nodes to enumerate the bus. When a PCI bus that is
behind a bridge is attached, pci_attach_hook() allocates a new PCI
chipset tag for the new bus and sets it's "curnode" to the OFW node
of the bridge. This is used as a starting point when enumerating
that bus. Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
 1.4 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 14-Jun-2000  soren branches: 1.3.4; 1.3.6; 1.3.10; 1.3.14;
Use more constants and clean up a bit.
 1.2 14-Jun-2000  soren Include registers.
 1.1 14-Jun-2000  soren Initial commit.
 1.3.14.5 07-Jan-2003  thorpej Sync with HEAD.
 1.3.14.4 03-Jan-2003  thorpej Sync with HEAD.
 1.3.14.3 18-Oct-2002  nathanw Catch up to -current.
 1.3.14.2 20-Jun-2002  nathanw Catch up to -current.
 1.3.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.10.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.3.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.10.1 16-Mar-2002  jdolecek Catch up with -current.
 1.3.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.3.6.1 14-Jun-2000  bouyer file macepci.c was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.3.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.4.1 14-Jun-2000  minoura file macepci.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:35 +0000
 1.5.2.2 16-May-2002  thorpej * Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses. For busses behind a bridge, it points to
a persistent copy of the bridge's pcitag_t. This can be very useful
for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
uses OFW device nodes to enumerate the bus. When a PCI bus that is
behind a bridge is attached, pci_attach_hook() allocates a new PCI
chipset tag for the new bus and sets it's "curnode" to the OFW node
of the bridge. This is used as a starting point when enumerating
that bus. Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
 1.5.2.1 16-May-2002  thorpej file macepci.c was added on branch gehenna-devsw on 2002-05-16 01:01:41 +0000
 1.11.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.4 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.3 13-Mar-2002  simonb branches: 1.3.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 14-Jun-2000  soren branches: 1.2.4; 1.2.6; 1.2.10; 1.2.14;
Use more constants and clean up a bit.
 1.1 14-Jun-2000  soren Initial commit.
 1.2.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.10.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.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.2.6.1 14-Jun-2000  bouyer file macepcireg.h was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.2.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 14-Jun-2000  minoura file macepcireg.h was added on branch minoura-xpg4dl on 2000-06-22 17:03:36 +0000
 1.3.12.1 03-Aug-2004  skrll Sync with HEAD
 1.4 17-Apr-2007  sekiya g/c unused file.
 1.3 11-Dec-2005  christos branches: 1.3.26; 1.3.30; 1.3.32;
merge ktrace-lwp.
 1.2 08-Feb-2004  sekiya branches: 1.2.16;
de-__P.
 1.1 06-Jan-2003  rafal branches: 1.1.2; 1.1.4;
PCI fixup code for the O2. Tested with a range of 32 and 64-bit network
cards, but not much else. Seems to work fairly well, though.
 1.1.4.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 07-Jan-2003  thorpej Sync with HEAD.
 1.1.2.1 06-Jan-2003  thorpej file pci_addr_fixup.h was added on branch nathanw_sa on 2003-01-07 21:14:33 +0000
 1.2.16.1 03-Sep-2007  yamt sync with head.
 1.3.32.1 11-Jul-2007  mjf Sync with head.
 1.3.30.2 15-Jul-2007  ad Sync with head.
 1.3.30.1 27-May-2007  ad Sync with head.
 1.3.26.1 07-May-2007  yamt sync with head.
 1.25 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.24 29-Mar-2014  christos branches: 1.24.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.23 27-Oct-2012  chs branches: 1.23.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.22 01-Jul-2011  dyoung branches: 1.22.2; 1.22.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.21 11-May-2011  dyoung Now that GENERIC32_IPX3x builds again, fix some pci_attach_args
constification that I'd missed.
 1.20 30-May-2008  ad branches: 1.20.20; 1.20.26;
pci_intr_setattr(), allows PCI interrupts to be marked MPSAFE on x86, and
other platforms if the code is added.

pci_intr_map(...)
pci_intr_setattr(pc, ih, PCI_INTR_MPSAFE, 1);
pci_intr_establish(...)
 1.19 30-Aug-2006  rumble branches: 1.19.56; 1.19.58; 1.19.60; 1.19.62;
Generalise pci/pci_machdep.c further and move all mace-specific code into
mace/pci_mace.c in preparation for pci devices on the gio(4) bus.
 1.18 14-May-2006  elad branches: 1.18.6;
integrate kauth.
 1.17 17-Apr-2006  tsutsui Switch macepci to use MI pci_configure_bus(9) rather than its own fixup code.
Tested on my O2 with several devices, and ok'ed by sekiya.
 1.16 11-Dec-2005  christos branches: 1.16.4; 1.16.6; 1.16.8; 1.16.10; 1.16.12;
merge ktrace-lwp.
 1.15 29-Sep-2004  sekiya branches: 1.15.12;
Use ANSI function declarations.
 1.14 06-Sep-2004  sekiya Use the mace interrupt handler for PCI interrupts.

From KIYOHARA Takashi
 1.13 18-Jan-2004  sekiya Do not directly reference crime_*() routines, go through the platform
struct pointers instead.
 1.12 13-Jan-2004  sekiya Switch DMA sync function initializer to _bus_dmamap_sync_mips3 to keep things
aligned with previous MIPS1/MIPS3 differentiation.
 1.11 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.10 30-Oct-2003  matt Fix uninitialized variable warning.
 1.9 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.8 04-Oct-2003  tsutsui TAB/space cleanup.
 1.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 06-Jan-2003  rafal branches: 1.6.2;
Improve the interrupt code somewhat by having callers of xxx_intr_establish
pass in an interrupt handle (which is currently to the CRIME interrupt the
device is attached to) so the interrupt handlers know which device was the
one looking for attention.

While here, fix up PCI interrupt routing for both the on-board devices and
the PCI slots -- even though there is only one PCI slot in the chasis, the
hardware can accomodate up to three and provides an interrupt mapping for
all the PCI interrupt pins for both the internal SCSI & PCI slot and the
two "extra" slots.
 1.5 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.4 28-Dec-2000  sommerfeld branches: 1.4.4; 1.4.8;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
 1.3 29-Jun-2000  mrg branches: 1.3.2;
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 14-Jun-2000  soren branches: 1.1.4;
Initial commit.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file pci_machdep.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:37 +0000
 1.3.2.3 05-Jan-2001  bouyer Sync 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 29-Jun-2000  bouyer file pci_machdep.c was added on branch thorpej_scsipi on 2000-11-20 20:23:47 +0000
 1.4.8.2 07-Jan-2003  thorpej Sync with HEAD.
 1.4.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.4 19-Oct-2004  skrll Sync with HEAD
 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.12.2 30-Dec-2006  yamt sync with head.
 1.15.12.1 21-Jun-2006  yamt sync with head.
 1.16.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.16.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.16.8.2 03-Sep-2006  yamt sync with head.
 1.16.8.1 24-May-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.18.6.1 10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/include/pci_machdep.h: revision 1.9
sys/arch/sgimips/pci/pci_machdep.c: revision 1.19
sys/arch/sgimips/mace/pci_mace.c: revision 1.8
Generalise pci/pci_machdep.c further and move all mace-specific code into
mace/pci_mace.c in preparation for pci devices on the gio(4) bus.
 1.19.62.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.19.60.1 04-May-2009  yamt sync with head.
 1.19.58.1 04-Jun-2008  yamt sync with head
 1.19.56.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.26.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.20.1 31-May-2011  rmind sync with head
 1.22.12.3 03-Dec-2017  jdolecek update from HEAD
 1.22.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.22.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.22.2.1 30-Oct-2012  yamt sync with head
 1.23.2.1 18-May-2014  rmind sync with head
 1.24.6.1 06-Apr-2015  skrll Sync with HEAD
 1.2 08-Jun-2001  simonb For ports that wire up pciide in compatibility mode, have
them define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
in pci_machdep.h and pciide_map_compat_intr() only calls
pciide_machdep_compat_intr_establish() if that preprocessor
define exists.

Ports that don't need to do this no longer need to supply a
dummy function.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit.
 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 14-Jun-2000  bouyer file pciide_machdep.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file pciide_machdep.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:38 +0000
 1.24 08-Nov-2018  msaitoh "s/ an an / an /" in comment. No functional change.
 1.23 08-Feb-2018  dholland branches: 1.23.2; 1.23.4;
Typos.
 1.22 26-Mar-2014  christos kill sprintf.
 1.21 01-Jul-2011  dyoung branches: 1.21.2; 1.21.12; 1.21.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.20 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.19 18-Mar-2009  cegger branches: 1.19.4; 1.19.6; 1.19.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.18 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.17 17-Oct-2007  garbled branches: 1.17.20; 1.17.28; 1.17.34;
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.16 10-May-2007  rumble branches: 1.16.10;
A few changes to allow booting to multi-user with IP12 kernels squished
into oversized volume headers:

Query ARCBIOS for OSLoadFilename and OSLoadOptions first, rather than only
using the environment variables passed since we want to go through arcemu.

Add an ugly hack to arcemu that munges the nvram 'bootfile' variable. We
need this because bootfile will point to the volume header, which then
translates into a bogus root device of 'sd0i', or similar.
 1.15 10-May-2007  rumble Sanity check the environment variable first.
 1.14 10-May-2007  rumble Clean up extracting environment variables passed by the prom. No functional
change.
 1.13 21-Feb-2007  rumble branches: 1.13.4; 1.13.6; 1.13.12;
Since IP12 doesn't use ARCS, we could read the console setting from the
nvram, but it may not be valid. For example, if the console is set to
graphics, but no keyboard is attached, we should not attempt to use a
graphical console.

To fix this, we extend arcemu to parse the prom's environment array, which
is the third argument to the kernel. If the console mode is graphics, but
no keyboard is found, the 'gfx' environment variable will contain 'dead'.

Note that since IP12 has no bootloader, we assume that the third parameter
is the environment table, not bootinfo.
 1.12 11-Dec-2005  christos branches: 1.12.26;
merge ktrace-lwp.
 1.11 03-Jun-2005  martin branches: 1.11.2;
Constify
 1.10 18-Apr-2005  tsutsui Revert part of rev 1.7. In arcemu_ip12_eeprom_read(), a variable reg is
read via (u_int32_t *) cast, so it shouldn't be paddr_t.
 1.9 07-Apr-2005  rumble Don't maintain an unimplemented vector for each arcbios vector.
Rather, cast our single vector. We weren't reporting which vector
when panicking, and if somebody uses a vector that isn't
implemented it should be easy enough to trap down anyways.
 1.8 12-Nov-2004  sekiya branches: 1.8.4;
Use 8-bit SEEPROM addressing mode on the 4D/3x models. 6-bit might be used
on IP6, but we don't support them (and probably never will).
 1.7 02-Oct-2004  sekiya s,uint32_t,paddr_t,g. Noticed by tsutsui@
 1.6 08-Jun-2004  rumble branches: 1.6.2; 1.6.4;
Use global static prom vectors within the module instead of
creating them on the fly. Simplify arcemu_ip12_putc() since the
printf vector behaves as expected.
 1.5 14-Apr-2004  pooka Return "video()" instead of "graphics(0)" for a graphics console,
since that's what even our code expects.

suggested by Steve Rumble
 1.4 11-Apr-2004  pooka Don't report page 0 as free memory, it makes bad things happen.
 1.3 11-Apr-2004  pooka RCS Id police
 1.2 10-Apr-2004  pooka Don't unconditionally initialize seeprom chip type after we've
conditionally initialized it to the correct type.

spotted by Steve Rumble
 1.1 10-Apr-2004  pooka ARCBIOS emulation code to be used on machines without ARCBIOS

Currently supports only IP12, but can be made to support others.

includes effort from Steve Rumble and myself
 1.6.4.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.4.6 14-Nov-2004  skrll Sync with HEAD.
 1.6.4.5 19-Oct-2004  skrll Sync with HEAD
 1.6.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.6.4.2 03-Aug-2004  skrll Sync with HEAD
 1.6.4.1 08-Jun-2004  skrll file arcemu.c was added on branch ktrace-lwp on 2004-08-03 10:40:08 +0000
 1.6.2.6 23-Jul-2004  tron Pull up revision 1.5 (requested by rumble in ticket #682):
Return "video()" instead of "graphics(0)" for a graphics console,
since that's what even our code expects.
suggested by Steve Rumble
 1.6.2.5 23-Jul-2004  tron Pull up revision 1.4 (requested by rumble in ticket #682):
Don't report page 0 as free memory, it makes bad things happen.
 1.6.2.4 23-Jul-2004  tron Pull up revision 1.3 (requested by rumble in ticket #682):
RCS Id police
 1.6.2.3 23-Jul-2004  tron Pull up revision 1.2 (requested by rumble in ticket #682):
Don't unconditionally initialize seeprom chip type after we've
conditionally initialized it to the correct type.
spotted by Steve Rumble
 1.6.2.2 23-Jul-2004  tron Pull up revision 1.1 (requested by rumble in ticket #682):
ARCBIOS emulation code to be used on machines without ARCBIOS
Currently supports only IP12, but can be made to support others.
includes effort from Steve Rumble and myself
 1.6.2.1 08-Jun-2004  tron file arcemu.c was added on branch netbsd-2-0 on 2004-07-23 06:58:14 +0000
 1.8.4.1 29-Apr-2005  kent sync with -current
 1.11.2.2 03-Sep-2007  yamt sync with head.
 1.11.2.1 26-Feb-2007  yamt sync with head.
 1.12.26.2 17-May-2007  yamt sync with head.
 1.12.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.13.12.1 22-May-2007  matt Update to HEAD.
 1.13.6.1 11-Jul-2007  mjf Sync with head.
 1.13.4.1 27-May-2007  ad Sync with head.
 1.16.10.1 06-Nov-2007  matt sync with HEAD
 1.17.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.28.2 28-Apr-2009  skrll Sync with HEAD.
 1.17.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.17.20.1 04-May-2009  yamt sync with head.
 1.19.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.19.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.4.1 05-Mar-2011  rmind sync with head
 1.21.16.1 18-May-2014  rmind sync with head
 1.21.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.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.23.4.1 10-Jun-2019  christos Sync with HEAD
 1.23.2.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.14 24-Jun-2023  msaitoh Fix typo in comment.
 1.13 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.12 20-Feb-2011  matt branches: 1.12.14; 1.12.32;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.11 12-Feb-2009  rumble branches: 1.11.4; 1.11.6; 1.11.8;
Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.10 17-Oct-2007  garbled branches: 1.10.20; 1.10.28; 1.10.34;
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.9 10-May-2007  rumble branches: 1.9.10;
Sanity check the environment variable first.
 1.8 10-May-2007  rumble Clean up extracting environment variables passed by the prom. No functional
change.
 1.7 21-Feb-2007  rumble branches: 1.7.4; 1.7.6; 1.7.12;
Since IP12 doesn't use ARCS, we could read the console setting from the
nvram, but it may not be valid. For example, if the console is set to
graphics, but no keyboard is attached, we should not attempt to use a
graphical console.

To fix this, we extend arcemu to parse the prom's environment array, which
is the third argument to the kernel. If the console mode is graphics, but
no keyboard is found, the 'gfx' environment variable will contain 'dead'.

Note that since IP12 has no bootloader, we assume that the third parameter
is the environment table, not bootinfo.
 1.6 11-Dec-2005  christos branches: 1.6.26;
merge ktrace-lwp.
 1.5 03-Jun-2005  martin branches: 1.5.2;
Constify
 1.4 07-Apr-2005  rumble Don't maintain an unimplemented vector for each arcbios vector.
Rather, cast our single vector. We weren't reporting which vector
when panicking, and if somebody uses a vector that isn't
implemented it should be easy enough to trap down anyways.
 1.3 02-Oct-2004  sekiya branches: 1.3.4;
s,uint32_t,paddr_t,g. Noticed by tsutsui@
 1.2 08-Jun-2004  rumble branches: 1.2.2; 1.2.4;
Use global static prom vectors within the module instead of
creating them on the fly. Simplify arcemu_ip12_putc() since the
printf vector behaves as expected.
 1.1 10-Apr-2004  pooka ARCBIOS emulation code to be used on machines without ARCBIOS

Currently supports only IP12, but can be made to support others.

includes effort from Steve Rumble and myself
 1.2.4.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.4.5 19-Oct-2004  skrll Sync with HEAD
 1.2.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 08-Jun-2004  skrll file arcemu.h was added on branch ktrace-lwp on 2004-08-03 10:40:08 +0000
 1.2.2.2 23-Jul-2004  tron Pull up revision 1.1 (requested by rumble in ticket #682):
ARCBIOS emulation code to be used on machines without ARCBIOS
Currently supports only IP12, but can be made to support others.
includes effort from Steve Rumble and myself
 1.2.2.1 08-Jun-2004  tron file arcemu.h was added on branch netbsd-2-0 on 2004-07-23 06:58:14 +0000
 1.3.4.1 29-Apr-2005  kent sync with -current
 1.5.2.2 03-Sep-2007  yamt sync with head.
 1.5.2.1 26-Feb-2007  yamt sync with head.
 1.6.26.2 17-May-2007  yamt sync with head.
 1.6.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.7.12.1 22-May-2007  matt Update to HEAD.
 1.7.6.1 11-Jul-2007  mjf Sync with head.
 1.7.4.1 27-May-2007  ad Sync with head.
 1.9.10.1 06-Nov-2007  matt sync with HEAD
 1.10.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.10.20.1 04-May-2009  yamt sync with head.
 1.11.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.11.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.4.1 05-Mar-2011  rmind sync with head
 1.12.32.1 09-Jul-2016  skrll Sync with HEAD
 1.12.14.1 03-Dec-2017  jdolecek update from HEAD
 1.3 08-Jul-2001  thorpej Use sys/dev/arcbios.
 1.2 07-Jul-2001  wdk - Finish off KGDB kernel debugger support for sgimips
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit. Needs work.
 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 14-Jun-2000  bouyer file arcs.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file arcs.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:38 +0000
 1.46 03-Oct-2025  thorpej Use device_{get,set}prop_bool() for "aic7xxx-use-target-defaults" and
"aic7xxx-override-ultra".
 1.45 16-Dec-2013  mrg - remove unused variables
- use (void) when we don't care about the return value
 1.44 27-Oct-2012  chs branches: 1.44.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.43 29-Jul-2012  mlelstv branches: 1.43.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.42 18-Mar-2009  cegger branches: 1.42.12; 1.42.18;
Ansify function definitions w/o arguments. Generated with sed.
 1.41 15-Dec-2007  tsutsui branches: 1.41.10; 1.41.18; 1.41.24;
Rename a device property name: "override_ultra" -> "aic7xxx-override-ultra"
 1.40 03-Dec-2007  ad branches: 1.40.2; 1.40.6;
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.39 27-Nov-2007  tsutsui - use prop_dictionary_set_bool() to set "aic7xxx-use-target-defaults" property
- set "override_ultra" property against not all but only built-in ahc
 1.38 17-Oct-2007  garbled branches: 1.38.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.37 26-Sep-2007  macallan set 'override_ultra' property for ahc so we can get 40MB/s
 1.36 10-May-2007  rumble branches: 1.36.8; 1.36.10; 1.36.12;
A few changes to allow booting to multi-user with IP12 kernels squished
into oversized volume headers:

Query ARCBIOS for OSLoadFilename and OSLoadOptions first, rather than only
using the environment variables passed since we want to go through arcemu.

Add an ugly hack to arcemu that munges the nvram 'bootfile' variable. We
need this because bootfile will point to the volume header, which then
translates into a bogus root device of 'sd0i', or similar.
 1.35 22-Feb-2007  thorpej branches: 1.35.4; 1.35.6; 1.35.12;
TRUE -> true, FALSE -> false
 1.34 24-Dec-2006  rumble branches: 1.34.2;
Set the DMA page boundary property for the Set Engineering GIO Fast
Ethernet board.
 1.33 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.32 17-Nov-2006  tsutsui Defer _spl0() or _splnone() calls (which enable hardware interrupts)
from cpu_configure(9) to cpu_initclocks(9) on mips ports which use
mips3_clockintr.c:mips3_clockintr() (i.e. CPU INT5 clock) to avoid
hardclock(9) before softclock interrupt is initialized in initclocks().
This should be harmless because initclocks() is a part of configure()
in these days and there is no MI function which expects hardware
interrupts between cpu_configure(9) and cpu_initclocks(9).

Disccussed on tech-kern and port-mips.
 1.31 10-Jul-2006  thorpej branches: 1.31.4; 1.31.6;
Put appropriate prefixes on property names to reduce chances of name
collisions.
 1.30 05-May-2006  thorpej branches: 1.30.4;
Remove the devprop API and switch everthing over to the new proplib. Add
a new device_properties() accessor for device_t that returns the device's
property dictionary.
 1.29 15-Apr-2006  tsutsui Add AHC_USETARGETDEFAULTS to ahc_flag, which enables to
use default target (but not for host) device settings on
ahc(4) interface without its SEEPROM (mostly on-board one).

This flag could be useful if host's BIOS (firmware) initializes
ahc(4) chip with some conservative (async, no tagged queuing etc.)
target settings for minimum support to load its primary loader etc.,
and it will be enabled in each attachment according to MD device
properties(9). Currently this property is set only on sgimips for
O2 on-board aic7880 adapters.

No objection on tech-kern (and netbsd-bugs), and closes PR kern/23276.
 1.28 28-Mar-2006  thorpej Use device_unit().
 1.27 26-Feb-2006  thorpej branches: 1.27.2; 1.27.4; 1.27.6;
Use device_is_a()
 1.26 23-Feb-2006  thorpej Use device_parent().
 1.25 11-Dec-2005  christos branches: 1.25.2; 1.25.4; 1.25.6;
merge ktrace-lwp.
 1.24 03-Jun-2005  martin branches: 1.24.2;
Avoid a global name "netmask" - it causes lots of shadow warnings all over
the place. Collect all interrupt masks into a single array instead.
Constify a bit and fix a bogus argument to config_rootfound().
 1.23 18-Dec-2004  sekiya Recognize mec as a valid netboot device. Add IP12 to the wdsc comment.
 1.22 23-Oct-2004  thorpej Centralize the declaration of booted_device and booted_partition.
 1.21 29-Sep-2004  sekiya Use ANSI function declarations.
 1.20 19-Jan-2004  sekiya Completely remove IP2X and IP32, which renders opt_machtype.h obsolete.
 1.19 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.18 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.17 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.16 15-Jul-2003  lukem __KERNEL_RCSID()
 1.15 04-Apr-2003  rafal branches: 1.15.2;
If booted device starts with pci(N), strip it off; also, compare strncmp()
result to 0, not NULL. This gets the O2 figure out what device it's been
booted off correctly mow.
 1.14 19-Jan-2003  rafal Turn on more of the PCI interrupts; from Chris Sekiya.
 1.13 03-Jan-2003  rafal Mark the CRIME/MACE register twiddling done after autoconfig with an XXX so
it gets cleaned out when the interrupt registration code is capable of doing
the interrupt mask setup itself.
 1.12 02-Jan-2003  pooka * tweak CRIME and MACE interrupt masks for IP32 and add some verbosity
* recognize ahc scsi as a boot device

once again thanks to Chris Sekiya
 1.11 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.10 26-Sep-2002  thorpej Get the pointer to the driver name early, rather than constantly
deferencing the cfdriver pointer.
 1.9 15-Jul-2002  rafal Fix boot device detection in the face of multiple SCSI controllers. This
isn't perfect (the NetBSD device units must match ARCS device numbers), but
it's better than randomly matching one of the devices. Fixes PR 16584 from
Scott G. Taylor.
 1.8 13-Mar-2002  simonb branches: 1.8.4; 1.8.6;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.7 22-Nov-2001  rafal If we already have a boot device set, don't reset the slot/unit/partition.
Now my Challenge S boots multiuser with the new bootloader without stopping
to ask for boot/root devices.
 1.6 20-Nov-2001  soren Correct previous, pointed out by mhitch:
makebootdev() sets not booted_device but booted_protocol, so test for that.
 1.5 19-Nov-2001  soren Since we can get boot device information from both the boot loader
and the firmware, we allow it to be set only once, so the boot
loader is given highest priority.
 1.4 18-Oct-2001  mhitch branches: 1.4.4;
Initial boot device determination code: makebootdev() to parse boot command
line parameters, and device_register() to try to match the boot device. Works
on a Challenge S (and similar machines), but will need more work for other
SCSI adapters.
 1.3 08-Aug-2001  wdk If the boot device cannot be determined don't return an un-initialized
pointer.
Prevents garbage when asking for root device at startup.
 1.2 11-May-2001  thorpej branches: 1.2.2;
Adjustments for dynamic system configuration. From Rafal K. Boni.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8;
Initial commit. Needs work.
 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 14-Jun-2000  bouyer file autoconf.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file autoconf.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:39 +0000
 1.2.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.2.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.4.4.7 07-Jan-2003  thorpej Sync with HEAD.
 1.4.4.6 03-Jan-2003  thorpej Sync with HEAD.
 1.4.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.4.4.4 01-Aug-2002  nathanw Catch up to -current.
 1.4.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.4.1 18-Oct-2001  nathanw file autoconf.c was added on branch nathanw_sa on 2002-01-08 00:27:31 +0000
 1.8.6.1 15-Jul-2002  thorpej pullup-1-6 ticket #507 (rafal).

Fix boot device detection in the face of multiple SCSI controllers. This
isn't perfect (the NetBSD device units must match ARCS device numbers), but
it's better than randomly matching one of the devices. Fixes PR 16584 from
Scott G. Taylor.
 1.8.4.1 21-Jul-2002  gehenna catch up with -current.
 1.15.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.6 18-Dec-2004  skrll Sync with HEAD.
 1.15.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.15.2.4 19-Oct-2004  skrll Sync with HEAD
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.24.2.7 21-Jan-2008  yamt sync with head
 1.24.2.6 07-Dec-2007  yamt sync with head
 1.24.2.5 27-Oct-2007  yamt sync with head.
 1.24.2.4 03-Sep-2007  yamt sync with head.
 1.24.2.3 26-Feb-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.25.6.2 01-Jun-2006  kardel 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 01-Mar-2006  yamt sync with head.
 1.27.6.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.27.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.27.4.2 11-May-2006  elad sync with head
 1.27.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.27.2.3 11-Aug-2006  yamt sync with head
 1.27.2.2 24-May-2006  yamt sync with head.
 1.27.2.1 01-Apr-2006  yamt sync with head.
 1.30.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.31.6.2 10-Dec-2006  yamt sync with head.
 1.31.6.1 09-Oct-2006  yamt implement splraiseipl/makeiplcookie for sgimips.
 1.31.4.1 12-Jan-2007  ad Sync with head.
 1.34.2.2 17-May-2007  yamt sync with head.
 1.34.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.35.12.2 03-Oct-2007  garbled Sync with HEAD
 1.35.12.1 22-May-2007  matt Update to HEAD.
 1.35.6.1 11-Jul-2007  mjf Sync with head.
 1.35.4.3 03-Dec-2007  ad Sync with HEAD.
 1.35.4.2 09-Oct-2007  ad Sync with head.
 1.35.4.1 27-May-2007  ad Sync with head.
 1.36.12.1 06-Oct-2007  yamt sync with head.
 1.36.10.2 09-Jan-2008  matt sync with HEAD
 1.36.10.1 06-Nov-2007  matt sync with HEAD
 1.36.8.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.36.8.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.36.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.38.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.38.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.40.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.40.2.1 26-Dec-2007  ad Sync with head.
 1.41.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.41.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.41.10.1 04-May-2009  yamt sync with head.
 1.42.18.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.42.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.42.12.1 30-Oct-2012  yamt sync with head
 1.43.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.43.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.2.1 18-May-2014  rmind sync with head
 1.70 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.69 16-Nov-2016  macallan reenable mips1-specific dmamem_sync method
clean up a bit while there
 1.68 14-Jul-2016  skrll branches: 1.68.2;
Wrap long line
 1.67 13-Jul-2016  skrll Fix compile
 1.66 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.65 02-Oct-2012  christos branches: 1.65.14;
move common/bus_dma/ -> dev/bus_dma/
 1.64 12-Feb-2012  matt branches: 1.64.6;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.63 17-Jul-2011  dyoung branches: 1.63.2; 1.63.6;
Switch MIPS and MIPS-ish architectures to new-style <sys/bus.h>. This
involves moving some inline bus_space(9) implementation into .c files.
 1.62 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.61 10-Feb-2011  macallan PMAP_NOCACHE -> PGC_NOCACHE where appropriate
 1.60 06-Jul-2010  cegger branches: 1.60.2; 1.60.4;
Turn PMAP_NOCACHE into MI flag.
Add MI flags PMAP_WRITE_COMBINE, PMAP_WRITE_BACK, PMAP_NOCACHE_OVR.
Update pmap(9) manpage.

hppa: Remove MD PMAP_NOCACHE flag as it exists as MI flag
mips: Rename MD PMAP_NOCACHE to PGC_NOCACHE.

x86: Implement new MI flags using Page-Attribute Tables.
x86: Implement BUS_SPACE_MAP_PREFETCHABLE.

Patch presented on tech-kern@:
http://mail-index.netbsd.org/tech-kern/2010/06/30/msg008458.html

No comments on this last version.
 1.59 17-Dec-2009  macallan branches: 1.59.2; 1.59.4;
make this compile again by sprinkling PRIxWHATEVER
 1.58 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.57 21-Aug-2009  thorpej Use bus_dmamem_common.
 1.56 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.55 04-Jun-2008  ad branches: 1.55.6; 1.55.12; 1.55.16;
vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.
 1.54 28-Apr-2008  martin branches: 1.54.2;
Remove clause 3 and 4 from TNF licenses
 1.53 13-Feb-2008  macallan branches: 1.53.6; 1.53.8; 1.53.10;
add bus_space_mmap()
 1.52 17-Oct-2007  garbled branches: 1.52.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.51 17-Jul-2007  macallan branches: 1.51.10;
use 64bit paddr_t and bus_addr_t so we can mmap DMA buffers uncached
 1.50 15-Jul-2007  macallan make the delay()s and spl*()s in bus_space*() functions optional
( enable with options MACE_NEEDS_DELAYS )
mec apparently was the only device that really needed them and that's no
longer the case, at least on my O2.
 1.49 16-Apr-2007  jmcneill branches: 1.49.2;
Flush the write buffer as appropriate in the MACE case as we do in the
non-MACE cases. From sekiya@
 1.48 06-Mar-2007  tsutsui branches: 1.48.2; 1.48.4;
Use (char *) to appease -Wpointer-arith.
 1.47 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.46 08-Jun-2006  martin branches: 1.46.10; 1.46.12;
Implement bus_space_*_stream_* methods for sgimips - so that we can use the
atheros wlan driver. Thanks to Izumi Tsutsui for lots of input. All errors,
as usualy, are mine though.
 1.45 16-Apr-2006  tsutsui branches: 1.45.2;
Mising -> Mixing
 1.44 16-Apr-2006  tsutsui Fix function names in panic messages.
 1.43 16-Apr-2006  tsutsui _ds_vaddr member in struct sgimips_bus_dma_segment is a virtual address,
so it should be vaddr_t rather than bus_addr_t.
 1.42 01-Mar-2006  yamt branches: 1.42.2; 1.42.4; 1.42.6;
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.41 11-Dec-2005  christos branches: 1.41.2; 1.41.4; 1.41.6;
merge ktrace-lwp.
 1.40 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.39 01-Apr-2005  yamt branches: 1.39.2; 1.39.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.38 11-Mar-2005  matt Adapt to new dm_maxsegsz semantics.
 1.37 17-Dec-2004  sekiya branches: 1.37.2; 1.37.4;
Nuke MIPS64; we'll use MIPS3 to indicate the presence of MIPS3 instructions
and _LP64 to indicate that 64-bit is desired.

Pointed out by simonb@
 1.36 13-Dec-2004  sekiya Remove gratuitous use of MIPS1/MIPS3.
 1.35 28-Nov-2004  thorpej bus_dmamap_load_mbuf(): Skip zero-length mbufs.
kern/24811
 1.34 02-Oct-2004  sekiya Use the mips3 bus functions on IP30. Recognize the IP30 as a supported* SGI
platform.

* For extremely small values of "supported". arch/mips/* needs a lot of work
yet for MIPS64.
 1.33 01-Oct-2004  sekiya s,#ifdef MIPS3,#if defined(MIPS3) || defined(MIPS64),g
 1.32 29-Sep-2004  sekiya Use ANSI function declarations.
 1.31 16-Sep-2004  rumble Correct a few comment typos that have propagated through the
tree.
 1.30 13-Apr-2004  sekiya Back out portions of previous commit -- the mips/bus_dma.c code is less
correct than the sgimips-specific code.
 1.29 12-Apr-2004  sekiya Merge fixes from arch/mips/mips/bus_dma.c -- a curproc->lwp fix, and streamline
the cache magic for BUS_DMASYNC_PREREAD in _bus_dmamap_sync_mips3().

(Note to self: investigate feasibility of replacing MD bus.c with MI bus_dma.c)
 1.28 25-Mar-2004  pooka Sprinkle some #ifdef MIPS3 to be able to compile the port without
including MIPS3 code.

for upcoming IP12
 1.27 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.26 18-Jan-2004  sekiya Large rototill of the lowlevel code:

* move all device-specific bitbanging to the device drivers in question --
i.e., the ip32 init code doesn't access the CRIME registers directly but
instead trusts the CRIME driver to DTRT. machdep.c is cleaner thereby.
* introduce int.c, which handles the interrupt-controller goo formerly
in ip2x.c.
* unify the CPU interrupt handler, with CRIME, INT2, and the various timer
handlers hooked in via pointers in the platform struct.
* eliminate ip2x.c and ip32.c. After the interrupt handler cleanup, the
actual platform-dependent code was so minimal (rev identification, mask level
initialization) that it made sense to move it into machdep.c
* "#ifdef DEBUG printf("foo"); #endif" becomes aprint_debug.

Tested on my ip22 and ip32. Discussed with pooka@, rafal@.
 1.25 13-Jan-2004  sekiya Implement bus routines for MIPS1 processors. Originally from Steve Rumble,
massaged by pooka@.
 1.24 12-Jan-2004  sekiya mips3_* functions aren't available when MIPS3 is not defined, so provide
MIPS1 workalikes (which, for the _8 routines, discard the top 32 bits).
 1.23 12-Jan-2004  sekiya CRIME revision 1.1 has a bug that affects PIO operations to/from the MACE.
The recommended workaround is a 5-10ms delay before and after accesses.
Therefore, move the affected bus_space_* operations from bus.h to bus.c
and special-case MACE accesses.

CRIME accesses are not affected, so introduce SGIMIPS_BUS_SPACE_CRIME and
use it as the CRIME tag.

My ip32 seems a little bit happier with this change, and my ip22 didn't
notice the change.
 1.22 07-Oct-2003  tsutsui Use proper mips_dcache_{wb,inv,wbinv}_range() ops in dmamap sync function
if possible. Tested on my O2 (with r5ksc patch).

XXX should we apply similar changes to mips/bus_dma.c and use it?
 1.21 07-Oct-2003  tsutsui Use proper macros.
 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 02-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.16 23-Dec-2002  pooka add bus_space_vaddr()

from rafal
 1.15 10-Oct-2002  rafal Memory and I/O space accesses to MACE PCI address ranges are passed through
in the correct byte order, so there's no reason to byteswap them.
 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 13-Mar-2002  simonb branches: 1.13.4;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.12 27-Feb-2002  rafal In _bus_dmamap_sync, only invalidate as much data as there is in the current
segment rather than invalidating the total map length for each segment.
 1.11 14-Nov-2001  thorpej branches: 1.11.2;
Merge the thorpej-mips-cache branch onto the trunk. This is an
overhaul of how caches are handled for NetBSD's MIPS ports.
 1.10 10-Sep-2001  chris branches: 1.10.2;
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.9 08-Jul-2001  thorpej branches: 1.9.2; 1.9.4;
bcopy -> memcpy, bzero -> memset
 1.8 26-May-2001  chs replace vm_page_t with struct vm_page *.
 1.7 11-May-2001  thorpej Use hit-flush ops in bus_dmamap_sync(). From Rafal K. Boni.
 1.6 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.5 21-Mar-2001  soren s/vm_page_alloc_memory/uvm_pglistalloc/ in panic message.
 1.4 29-Jun-2000  mrg branches: 1.4.2; 1.4.4;
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 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.1 14-Jun-2000  soren branches: 1.1.2; 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file bus.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:39 +0000
 1.1.2.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.4.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.4.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.4.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.4.2.1 29-Jun-2000  bouyer file bus.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.9.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.10.2.1 12-Nov-2001  shin compilation fix.
s/mips3_HitFlushDCache/mips_dcache_wbinv_range/
 1.11.2.6 29-Dec-2002  thorpej Sync with HEAD.
 1.11.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.11.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.11.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.11.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.11.2.1 14-Nov-2001  nathanw file bus.c was added on branch nathanw_sa on 2002-02-28 04:11:36 +0000
 1.13.4.1 15-Jul-2002  gehenna catch up with -current.
 1.19.2.9 11-Dec-2005  christos Sync with head.
 1.19.2.8 01-Apr-2005  skrll Sync with HEAD.
 1.19.2.7 19-Feb-2005  skrll Don't deref a NULL struct lwp *. This shouldn't happen, but...
 1.19.2.6 18-Dec-2004  skrll Sync with HEAD.
 1.19.2.5 19-Oct-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.37.4.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.37.4.1 13-Feb-2005  yamt use new apis.
 1.37.2.1 29-Apr-2005  kent sync with -current
 1.39.8.1 29-Nov-2005  yamt sync with head.
 1.39.2.3 27-Feb-2008  yamt sync with head.
 1.39.2.2 03-Sep-2007  yamt sync with head.
 1.39.2.1 21-Jun-2006  yamt sync with head.
 1.41.6.1 22-Apr-2006  simonb Sync with head.
 1.41.4.1 09-Sep-2006  rpaulo sync with head
 1.41.2.2 18-Feb-2006  yamt keep vmspace rather than proc in sgimips_bus_dmamap.
 1.41.2.1 18-Feb-2006  yamt adapt the rest of MD code.
 1.42.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.42.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.42.2.2 26-Jun-2006  yamt sync with head.
 1.42.2.1 24-May-2006  yamt sync with head.
 1.45.2.1 19-Jun-2006  chap Sync with head.
 1.46.12.2 07-May-2007  yamt sync with head.
 1.46.12.1 12-Mar-2007  rmind Sync with HEAD.
 1.46.10.1 05-Nov-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #1221):
sys/arch/sgimips/conf/files.sgimips: revision 1.44
sys/arch/sgimips/sgimips/bus.c: revision 1.50
make the delay()s and spl*()s in bus_space*() functions optional
( enable with options MACE_NEEDS_DELAYS )
mec apparently was the only device that really needed them and that's no
longer the case, at least on my O2.
 1.48.4.1 11-Jul-2007  mjf Sync with head.
 1.48.2.2 20-Aug-2007  ad Sync with HEAD.
 1.48.2.1 27-May-2007  ad Sync with head.
 1.49.2.1 03-Oct-2007  garbled Sync with HEAD
 1.51.10.2 23-Mar-2008  matt sync with HEAD
 1.51.10.1 06-Nov-2007  matt sync with HEAD
 1.52.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.53.10.5 11-Aug-2010  yamt sync with head.
 1.53.10.4 11-Mar-2010  yamt sync with head
 1.53.10.3 16-Sep-2009  yamt sync with head
 1.53.10.2 04-May-2009  yamt sync with head.
 1.53.10.1 16-May-2008  yamt sync with head.
 1.53.8.2 17-Jun-2008  yamt sync with head.
 1.53.8.1 18-May-2008  yamt sync with head.
 1.53.6.2 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.53.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.54.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.55.16.4 20-Jan-2010  matt Adjust things to the new world order.
 1.55.16.3 14-Jan-2010  matt Deal with various changes with avail_end and avail_start, etc.
 1.55.16.2 23-Nov-2009  matt mips3_ld/mips3_sd need to be passed a volatile uint64_t *
 1.55.16.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.55.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.55.6.1 03-Mar-2009  skrll Sync with HEAD.
 1.59.4.1 05-Mar-2011  rmind sync with head
 1.59.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.60.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.60.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.60.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.63.6.1 18-Feb-2012  mrg merge to -current.
 1.63.2.2 30-Oct-2012  yamt sync with head
 1.63.2.1 17-Apr-2012  yamt sync with head
 1.64.6.2 03-Dec-2017  jdolecek update from HEAD
 1.64.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.65.14.3 05-Dec-2016  skrll Sync with HEAD
 1.65.14.2 05-Oct-2016  skrll Sync with HEAD
 1.65.14.1 06-Apr-2015  skrll Sync with HEAD
 1.68.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.24 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.23 08-Feb-2011  rmind 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.22 18-Mar-2009  cegger branches: 1.22.4; 1.22.6; 1.22.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.21 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.20 29-Dec-2006  rumble branches: 1.20.48; 1.20.56; 1.20.62; 1.20.66;
Move the mips1_clock_intr handling into int.c where it belongs.
 1.19 17-Nov-2006  tsutsui Defer _spl0() or _splnone() calls (which enable hardware interrupts)
from cpu_configure(9) to cpu_initclocks(9) on mips ports which use
mips3_clockintr.c:mips3_clockintr() (i.e. CPU INT5 clock) to avoid
hardclock(9) before softclock interrupt is initialized in initclocks().
This should be harmless because initclocks() is a part of configure()
in these days and there is no MI function which expects hardware
interrupts between cpu_configure(9) and cpu_initclocks(9).

Disccussed on tech-kern and port-mips.
 1.18 16-Sep-2006  gdamore branches: 1.18.2;
sgimips converted to timecounters. Systems that can do them get mips_cp0
based logic. We also use the common mips3_clock functions for those systems,
removing some port-specific code.

Tested by martin@.
 1.17 05-Sep-2006  rumble branches: 1.17.2;
Switch sgimips to MI todr.
 1.16 11-Dec-2005  christos branches: 1.16.4; 1.16.8;
merge ktrace-lwp.
 1.15 17-Dec-2004  sekiya branches: 1.15.10;
Nuke MIPS64; we'll use MIPS3 to indicate the presence of MIPS3 instructions
and _LP64 to indicate that 64-bit is desired.

Pointed out by simonb@
 1.14 01-Oct-2004  sekiya s,#ifdef MIPS3,#if defined(MIPS3) || defined(MIPS64),g
 1.13 10-Apr-2004  pooka Clock interrupt routine for mips1 (ip12) from Steve Rumble.
 1.12 25-Mar-2004  pooka branches: 1.12.2;
Sprinkle some #ifdef MIPS3 to be able to compile the port without
including MIPS3 code.

for upcoming IP12
 1.11 19-Jan-2004  sekiya Completely remove IP2X and IP32, which renders opt_machtype.h obsolete.
 1.10 18-Jan-2004  sekiya Large rototill of the lowlevel code:

* move all device-specific bitbanging to the device drivers in question --
i.e., the ip32 init code doesn't access the CRIME registers directly but
instead trusts the CRIME driver to DTRT. machdep.c is cleaner thereby.
* introduce int.c, which handles the interrupt-controller goo formerly
in ip2x.c.
* unify the CPU interrupt handler, with CRIME, INT2, and the various timer
handlers hooked in via pointers in the platform struct.
* eliminate ip2x.c and ip32.c. After the interrupt handler cleanup, the
actual platform-dependent code was so minimal (rev identification, mask level
initialization) that it made sense to move it into machdep.c
* "#ifdef DEBUG printf("foo"); #endif" becomes aprint_debug.

Tested on my ip22 and ip32. Discussed with pooka@, rafal@.
 1.9 04-Oct-2003  tsutsui TAB/space cleanup.
 1.8 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.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 23-Dec-2002  pooka branches: 1.6.2;
add debug printf

from Rafal
 1.5 03-May-2002  rafal Fix up clock interrupt accounting for the sgimips port -- make sure
to schedule clock interrupts at a fixed interval, rather scheduling
the next one based on the time of the arrival/servicing of the previous
clock interrupt. Also, pick up a trick from the sbmips port to convert
a division in ip22_clkread to a multiplication, since those are much
cheaper -- the details of that are described in Simon's commit (see
Message-Id: <20020306073437.1D2A8B004@cvs.netbsd.org>). Thanks to
Jason Thorpe and Dominic Sweetman's "See MIPS Run" (where I found
mention of this very subject while looking for something totally un-
related! 8-) for the clue about the source of the timekeeping problems.

For the IP32, where we have no clock-calibration code yet, use the CPU
frequency provided by ARCS instead; it beats a hard-coded value!

As an added bonus, most of the CPU-clock related stuff is now collected
together in cpu_info_store, rather than as a collection of unorganized
global variables.
 1.4 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 10-Oct-2001  pooka branches: 1.3.4;
panic in cpu_initclocks() if clock device is not attached
 1.2 11-May-2001  thorpej branches: 1.2.2;
New clock functions, based on the newsmips versions. These
actually do something, by calling into the hardware clock
routines set up during autoconfiguration.

From Rafal K. Boni.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8;
Initial commit. Needs work.
 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 14-Jun-2000  bouyer file clock.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file clock.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:40 +0000
 1.2.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.4 29-Dec-2002  thorpej Sync with HEAD.
 1.3.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.3.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.1 10-Oct-2001  nathanw file clock.c was added on branch nathanw_sa on 2002-04-01 07:42:28 +0000
 1.6.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.6.2.4 19-Oct-2004  skrll Sync with HEAD
 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.12.2.1 23-Jul-2004  tron Pull up revision 1.13 (requested by rumble in ticket #682):
Clock interrupt routine for mips1 (ip12) from Steve Rumble.
 1.15.10.1 30-Dec-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.2.2 12-Jan-2007  ad Sync with head.
 1.17.2.1 18-Nov-2006  ad Sync with head.
 1.18.2.1 10-Dec-2006  yamt sync with head.
 1.20.66.1 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.20.62.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.56.2 28-Apr-2009  skrll Sync with HEAD.
 1.20.56.1 03-Mar-2009  skrll Sync with HEAD.
 1.20.48.1 04-May-2009  yamt sync with head.
 1.22.8.2 05-Mar-2011  bouyer Sync with HEAD
 1.22.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.22.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.22.4.1 05-Mar-2011  rmind sync with head
 1.4 05-Sep-2006  rumble Switch sgimips to MI todr.
 1.3 14-Jan-2002  pooka branches: 1.3.32; 1.3.46; 1.3.50;
make RTC year IRIX semantics adjustments a macro
 1.2 25-Nov-2001  soren O2 RTC attachment, based on code from Antti Kantee.
 1.1 11-May-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.10;
New clock functions, based on the newsmips versions. These
actually do something, by calling into the hardware clock
routines set up during autoconfiguration.

From Rafal K. Boni.
 1.1.10.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.10.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.10.1 11-May-2001  nathanw file clockvar.h was added on branch nathanw_sa on 2002-01-08 00:27:31 +0000
 1.1.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.50.1 14-Sep-2006  yamt sync with head.
 1.3.46.1 09-Sep-2006  rpaulo sync with head
 1.3.32.1 30-Dec-2006  yamt sync with head.
 1.21 26-Oct-2002  jdolecek 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.20 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.19 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.18 17-Jun-2002  christos MD systrace gluons.
 1.17 21-May-2002  manu Filling tables for device 62 (irix_usema) where it was missing
 1.16 23-Apr-2002  manu branches: 1.16.2;
Added IRIX /dev/usema and dev/usemaclone (void driver for now, will be
filled later)
 1.15 16-Mar-2002  martin Rename ISDN devices, per discussion on tech-kern. The network devices
become ippp (ISDN ppp) and irip (ISDN raw IP). The character device now
are called: /dev/isdn (isdnd <-> kernel communication), /dev/isdnctl (dialing
and other control), /dev/isdntrc* (tracing), /dev/isdnbchan* (raw B channel
access, i.e. for user land PPP) and /dev/isdntel* (telephone devices, i.e.
for answering machines).
 1.14 15-Mar-2002  manu Added IRIX /dev/kmem emulation pseudodevice and SVR4 net pseudodevice
 1.13 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.12 12-Jan-2002  manu Added clockctl
 1.11 22-Nov-2001  soren Add wscons devices.
 1.10 11-Nov-2001  soren branches: 1.10.2;
Fix vnd pastoes.
 1.9 17-Sep-2001  wdk branches: 1.9.2;
Fix obvious typos: swapdev set to incorrect major number preventing
kernel from accessing swap device.
 1.8 08-Jul-2001  thorpej branches: 1.8.2; 1.8.4;
Use sys/dev/arcbios.
 1.7 21-Mar-2001  lukem move duplicate definitions for:
pc, lpt, joy, ocis, apm, satlink, i4bctl, i4brbch, i4btel, i4btrc, i4b
from the port-specific arch/*/*/conf.c files into sys/conf.h
 1.6 14-Jan-2001  martin branches: 1.6.2;
The i4b raw b-channel devices actually do have an ioctl routine,
so better add this to the cdevsw entry.
Noted by Bruno Achauer.
 1.5 09-Jan-2001  martin When adding isdn devices I forgot to check chrtoblktbl.
Fix this know for the affected archs.
 1.4 08-Jan-2001  martin Add isdn devices to all archs that seem to support at least one of the
necessary busses. Sync comments with reality for archs that already had
the devices.
 1.3 26-Nov-2000  ad lsu -> ld, by popular request.
 1.2 20-Oct-2000  ad branches: 1.2.2;
ca -> lsu
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file conf.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:40 +0000
 1.2.2.5 27-Mar-2001  bouyer Sync with HEAD.
 1.2.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.2.2.3 08-Dec-2000  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 20-Oct-2000  bouyer file conf.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.6.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.8.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.8.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.8.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.8.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.8.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.8.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.10.2.8 11-Nov-2002  nathanw Catch up to -current
 1.10.2.7 17-Sep-2002  nathanw Catch up to -current.
 1.10.2.6 01-Aug-2002  nathanw Catch up to -current.
 1.10.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.10.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.10.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.10.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.10.2.1 11-Nov-2001  nathanw file conf.c was added on branch nathanw_sa on 2002-01-08 00:27:31 +0000
 1.16.2.3 21-Jul-2002  gehenna catch up with -current.
 1.16.2.2 15-Jul-2002  gehenna catch up with -current.
 1.16.2.1 16-May-2002  gehenna Bye block/character device swicth tables.
 1.45 30-Sep-2015  macallan don't MIPS_PHYS_TO_KSEG1() the hardware address for O2's serial ports
now serial console works again
 1.44 18-Feb-2015  macallan switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.43 13-Oct-2012  jdc branches: 1.43.14;
Adapt to the changed signature of pckbc_cnattach().
 1.42 01-Jul-2011  dyoung branches: 1.42.2; 1.42.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.41 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.40 03-Apr-2009  uebayasi branches: 1.40.4; 1.40.6; 1.40.8;
Include sys/device.h. Fix build.
 1.39 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.38 25-Feb-2009  sekiya Un-hardcode IP32 serial console bus tags. Fixes regression introduced in revision 1.28.
 1.37 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.36 12-Apr-2007  jmcneill branches: 1.36.36; 1.36.44; 1.36.50;
Enable O2 onboard framebuffer driver.
 1.35 28-Dec-2006  rumble branches: 1.35.2; 1.35.6; 1.35.8;
Check the return value of gio_cnattach as it can fail despite what the
PROM says we should do.
 1.34 26-Dec-2006  rumble zskbd is unit 0, not 1.
 1.33 24-Dec-2006  rumble Add zskbd console attachment.
 1.32 11-Dec-2005  christos branches: 1.32.20;
merge ktrace-lwp.
 1.31 03-Jun-2005  martin branches: 1.31.2;
Constify
 1.30 30-Dec-2004  rumble Prepend HPC3 macros universally with "HPC3_" to distinctly recognise
the corresponding revision and maintain consistency with HPC1.

No functional change intended.
 1.29 30-Dec-2004  rumble Replace the hpc0 base address with the definition from
hpc/hpcregs.h.
 1.28 08-Jul-2004  sekiya Call gio_video_init() for IP12 and IP20. Neither model uses the same keyboard
glue as the IP22, so add conditionals in the keyboard connection logic.
 1.27 09-Jun-2004  rumble Refactor consinit() for readability by pulling out mach_type
specific code into their own functions. No functional change is
intended.

ok'd by pooka and sekiya
 1.26 10-Apr-2004  pooka don't attempt to init pckbd console on IP20
 1.25 10-Apr-2004  pooka Rework conditional statement a bit to print bit about using ARCS for
console I/O if nothing really attached, not if we just called consinit()
with an invalid IPxy mach_type.

inpired by Steve Rumble
 1.24 10-Apr-2004  pooka attach zs console on IP12

from Steve Rumble
 1.23 08-Apr-2004  pooka apply wide-angle KNFication beam
 1.22 19-Jan-2004  sekiya branches: 1.22.2;
Completely remove IP2X and IP32, which renders opt_machtype.h obsolete.
 1.21 18-Jan-2004  sekiya Following the example of the hpc/, gio/, and ioc/ directories, move the
mace devices to their own mace/ directory. Alter conf/files.sgimips to
reflect this change in a sane manner (i.e., pull in dev/files.dev and
mace/files.mace when appropriate).

At the same time, allow crime_intr_establish() to fall through to
mace_intr_establish(). mace devices now call cpu_intr_establish().
 1.20 18-Jan-2004  sekiya Nuke two more instances of #ifdef IP32.
 1.19 18-Jan-2004  sekiya Large rototill of the lowlevel code:

* move all device-specific bitbanging to the device drivers in question --
i.e., the ip32 init code doesn't access the CRIME registers directly but
instead trusts the CRIME driver to DTRT. machdep.c is cleaner thereby.
* introduce int.c, which handles the interrupt-controller goo formerly
in ip2x.c.
* unify the CPU interrupt handler, with CRIME, INT2, and the various timer
handlers hooked in via pointers in the platform struct.
* eliminate ip2x.c and ip32.c. After the interrupt handler cleanup, the
actual platform-dependent code was so minimal (rev identification, mask level
initialization) that it made sense to move it into machdep.c
* "#ifdef DEBUG printf("foo"); #endif" becomes aprint_debug.

Tested on my ip22 and ip32. Discussed with pooka@, rafal@.
 1.18 10-Jan-2004  sekiya Clean up console device selection logic.
 1.17 01-Jan-2004  sekiya It's important to use good quality cables when working with SGI serial ports.
Enable zs console for IP20.
 1.16 30-Dec-2003  sekiya Force ARCS console for IP20 until the console-on-zs crashing problem is
fixed. Store the board revision for future use, while we're at it.
 1.15 16-Dec-2003  sekiya iocreg.h has moved.
 1.14 15-Dec-2003  sekiya Change all IP22 preprocessor conditionals to IP2X preprocessor conditionals.

Part one of two -- part two will be renaming ip22_*() to ip2x_*().
 1.13 15-Dec-2003  lonewolf Add support for attaching newport/pckbc as console on IP22 (Indy).

XXX Does this work on Indigo2 too?
XXX Ugly hardcoded bus_space_tags and stuff.
XXX This whole file is one damn ugly mess.
 1.12 17-Oct-2003  tsutsui Add some delay before calling comcnattach() to wait
previous console output to complete.
 1.11 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.10 15-Jul-2003  lukem __KERNEL_RCSID()
 1.9 14-Jun-2003  thorpej branches: 1.9.2;
Also pass a type argument to comcnattach() and com_kgdb_attach().
comspeed() (and thus cominit()) may need this information.
 1.8 03-Jan-2003  rafal Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 1.7 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.6 08-Jul-2001  thorpej branches: 1.6.2; 1.6.8;
Use sys/dev/arcbios.
 1.5 07-Jun-2001  thorpej Don't use PCLK as the baud rate generator, as the Indy doens't
like that, and it has no effect on the Indigo2.
From Christopher SEKIYA <wileyc@rezrov.net>.

Also, query the "ConsoleOut" ARCS variable (i.e. "what the console
really is") rather than "console" ("what the console is configured
as").
 1.4 11-May-2001  thorpej Support for configuring an SCC console. From Rafal K. Boni.
 1.3 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.2 02-Nov-2000  eeh branches: 1.2.2; 1.2.4;
Adapt to new line discipline scheme.
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file console.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:41 +0000
 1.2.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.3 22-Nov-2000  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 02-Nov-2000  bouyer file console.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.6.8.3 07-Jan-2003  thorpej Sync with HEAD.
 1.6.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.8.1 08-Jul-2001  nathanw file console.c was added on branch nathanw_sa on 2002-04-01 07:42:28 +0000
 1.6.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.4 17-Jan-2005  skrll Sync with HEAD.
 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.22.2.4 23-Jul-2004  tron Pull up revision 1.26 (requested by rumble in ticket #682):
don't attempt to init pckbd console on IP20
 1.22.2.3 23-Jul-2004  tron Pull up revision 1.25 (requested by rumble in ticket #682):
Rework conditional statement a bit to print bit about using ARCS for
console I/O if nothing really attached, not if we just called consinit()
with an invalid IPxy mach_type.
inpired by Steve Rumble
 1.22.2.2 23-Jul-2004  tron Pull up revision 1.24 (requested by rumble in ticket #682):
attach zs console on IP12
from Steve Rumble
 1.22.2.1 23-Jul-2004  tron Pull up revision 1.23 (requested by rumble in ticket #682):
apply wide-angle KNFication beam
 1.31.2.2 03-Sep-2007  yamt sync with head.
 1.31.2.1 30-Dec-2006  yamt sync with head.
 1.32.20.1 12-Jan-2007  ad Sync with head.
 1.35.8.1 11-Jul-2007  mjf Sync with head.
 1.35.6.1 27-May-2007  ad Sync with head.
 1.35.2.1 15-Apr-2007  yamt sync with head.
 1.36.50.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.44.2 28-Apr-2009  skrll Sync with HEAD.
 1.36.44.1 03-Mar-2009  skrll Sync with HEAD.
 1.36.36.1 04-May-2009  yamt sync with head.
 1.40.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.40.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.40.4.1 05-Mar-2011  rmind sync with head
 1.42.12.2 03-Dec-2017  jdolecek update from HEAD
 1.42.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.42.2.1 30-Oct-2012  yamt sync with head
 1.43.14.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.43.14.1 06-Apr-2015  skrll Sync with HEAD
 1.28 03-Mar-2022  riastradh mips: Use device_set_private for cpuN on older ports.

Specifically, for those that don't use cpu_attach_common of
mips_subr.c.
 1.27 17-Nov-2016  macallan KASSERT that MIPS_SR_KX is set when entering interrupt handler in !o32
 1.26 20-Feb-2011  matt branches: 1.26.14; 1.26.32; 1.26.36;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.25 28-Jan-2011  tsutsui Use CFATTACH_DECL_NEW() (no softc).
 1.24 20-Dec-2010  matt branches: 1.24.2; 1.24.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.23 15-Dec-2009  mrg branches: 1.23.4;
convert all mips cpu_intr() to have the standard
(uint32_t, uint32_t, vaddr_t, uint32_t) signature.
 1.22 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.21 03-Dec-2007  ad branches: 1.21.18; 1.21.36;
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.20 28-Dec-2006  rumble branches: 1.20.6; 1.20.22; 1.20.24; 1.20.30;
Handle fpu interrupts (MIPS interrupt 0) on IP12.
 1.19 11-Dec-2005  christos branches: 1.19.20;
merge ktrace-lwp.
 1.18 19-Jan-2004  sekiya branches: 1.18.16;
Completely remove IP2X and IP32, which renders opt_machtype.h obsolete.
 1.17 18-Jan-2004  sekiya Large rototill of the lowlevel code:

* move all device-specific bitbanging to the device drivers in question --
i.e., the ip32 init code doesn't access the CRIME registers directly but
instead trusts the CRIME driver to DTRT. machdep.c is cleaner thereby.
* introduce int.c, which handles the interrupt-controller goo formerly
in ip2x.c.
* unify the CPU interrupt handler, with CRIME, INT2, and the various timer
handlers hooked in via pointers in the platform struct.
* eliminate ip2x.c and ip32.c. After the interrupt handler cleanup, the
actual platform-dependent code was so minimal (rev identification, mask level
initialization) that it made sense to move it into machdep.c
* "#ifdef DEBUG printf("foo"); #endif" becomes aprint_debug.

Tested on my ip22 and ip32. Discussed with pooka@, rafal@.
 1.16 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.15 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.14 15-Jul-2003  lukem __KERNEL_RCSID()
 1.13 03-Jan-2003  rafal branches: 1.13.2;
Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 1.12 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.11 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.10 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.9 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.8 19-Nov-2001  soren Get L2 cache line size from ARCS.
Remove hack to disable (standard) L2 caches.
 1.7 17-Nov-2001  thorpej branches: 1.7.2;
Walk the ARCS device tree to find the L2 cache size.
 1.6 14-Nov-2001  thorpej Merge the thorpej-mips-cache branch onto the trunk. This is an
overhaul of how caches are handled for NetBSD's MIPS ports.
 1.5 08-Jul-2001  thorpej branches: 1.5.2; 1.5.6;
- Use the identifier strings that are fetched by the MI ARC BIOS
code.
- Garbage-collect some non-useful stuff from the mainbus_attach_args.
 1.4 11-May-2001  thorpej Adjustments for dynamic system configuration. From Rafal K. Boni.
 1.3 05-Oct-2000  cgd branches: 1.3.2; 1.3.4;
clean up and consistency for CP0 Count, Compare, Wired, and Config
access function names and prototypes.
 1.2 29-Jun-2000  soren Hack: disable R5K L2 cache for now, pending (working) changed cache ops.
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file cpu.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:41 +0000
 1.3.4.1 21-Jun-2001  nathanw Catch up to -current.
 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 05-Oct-2000  bouyer file cpu.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.5.6.2 14-Nov-2001  thorpej Shuffle around the code that frobs the IP-22 L2 SysAD cache,
and add code (untested and not enabled yet) to actually enable
and flush this cache.

The code is really just a placeholder -- I need to find someone
that has a machine equipped with such a cache.
 1.5.6.1 12-Nov-2001  shin compilation fix.
s/mips_L2CacheSize/mips_sdcache_size/
 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.7.2.5 07-Jan-2003  thorpej Sync with HEAD.
 1.7.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.7.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.2.1 17-Nov-2001  nathanw file cpu.c was added on branch nathanw_sa on 2002-01-08 00:27:32 +0000
 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.18.16.2 07-Dec-2007  yamt sync with head
 1.18.16.1 30-Dec-2006  yamt sync with head.
 1.19.20.1 12-Jan-2007  ad Sync with head.
 1.20.30.1 08-Dec-2007  mjf Sync with HEAD.
 1.20.24.1 09-Jan-2008  matt sync with HEAD
 1.20.22.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.20.6.1 03-Dec-2007  ad Sync with HEAD.
 1.21.36.5 23-Dec-2011  matt Change usage to cpu_identify(self, NULL);
 1.21.36.4 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.21.36.3 05-Feb-2010  matt Change to deal with new method of invoking softints. Remove mips/softintr.c
from config files. Fix SYMTAB_SPACE for WGT62V43
 1.21.36.2 01-Feb-2010  matt fix fallout from frame/trapframe merger.
 1.21.36.1 13-Jan-2010  matt Deal with new cpu_identity()
 1.21.18.1 11-Mar-2010  yamt sync with head
 1.23.4.1 05-Mar-2011  rmind sync with head
 1.24.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.24.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.24.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.26.36.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.26.32.1 05-Dec-2016  skrll Sync with HEAD
 1.26.14.1 03-Dec-2017  jdolecek update from HEAD
 1.24 03-Apr-2019  christos centralize setdisklabel(9)
 1.23 02-Jan-2008  ad branches: 1.23.98;
Merge vmlocking2 to head.
 1.22 24-Dec-2007  ad b_un.b_addr -> b_data
 1.21 17-Oct-2007  garbled branches: 1.21.2; 1.21.4; 1.21.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.20 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.19 06-Mar-2007  tsutsui branches: 1.19.2; 1.19.6; 1.19.10; 1.19.18; 1.19.20; 1.19.22;
Use (char *) to appease -Wpointer-arith.
 1.18 25-Nov-2006  scw branches: 1.18.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.17 11-Dec-2005  christos branches: 1.17.20; 1.17.22;
merge ktrace-lwp.
 1.16 04-Oct-2005  tsutsui On converting sgimips disklabel into BSD disklabel, don't take
dp_secbytes in the SGI volume header because the ARCS firmware ignores it.
Instead, leave the hardware default value set by each driver and
adjust offset values in the SGI volhdr according to the real sector size.

Fixes "resource shortage" messages on mounting a bootable CD-ROM image
which has the SGI volhdr. See posts on port-sgimips for details:
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0000.html
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0001.html
http://mail-index.netbsd.org/port-sgimips/2005/09/14/0000.html
 1.15 03-Jun-2005  martin branches: 1.15.2;
Constify
 1.14 24-Nov-2004  jmc branches: 1.14.10;
Pull host/arch native label information into bootblock.h. Therefore pieces of
this are accessible from host tools.
 1.13 17-Nov-2003  keihan branches: 1.13.4;
www.netbsd.org -> www.NetBSD.org
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 10-May-2003  thorpej branches: 1.11.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.10 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.9 08-Apr-2003  he Track the SBSIZE -> SBLOCKSIZE rename after the UFS2 merge.
 1.8 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.7 05-Mar-2002  simonb Don't cast argument to ffs() to long.
Per discussion on port-alpha, noticed by Robert Elz.
 1.6 19-Feb-2002  wiz strategy should have an 'r'. Inspired by similar change in OpenBSD.
 1.5 10-Jan-2002  wdk We now need ufs/ufs/dinode.h for ufs/ffs/fs.h
XXX: All this work for BBSIZE and SBSIZE. Sigh.

Add missing $NetBSD$ Header to file
 1.4 10-Nov-2001  wdk branches: 1.4.2;
NetBSD Disklabel and SGI Volume header support. Based on NetBSD/mipsco
due to its similarities.

Patch has been tested by many people on the sgimips list for some time with
no complaints.

Contributed by: Christopher SEKIYA <wileyc@rezrov.net>
 1.3 27-Nov-2000  soren branches: 1.3.2; 1.3.4; 1.3.6;
Forgot to commit bounds_check_with_label().
 1.2 20-Nov-2000  chs branches: 1.2.2;
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.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file disksubr.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:42 +0000
 1.2.2.4 08-Dec-2000  bouyer Sync with HEAD.
 1.2.2.3 22-Nov-2000  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 20-Nov-2000  bouyer file disksubr.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 1.3.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.3.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.4.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.4.2.2 11-Jan-2002  nathanw More catchup.
 1.4.2.1 10-Nov-2001  nathanw file disksubr.c was added on branch nathanw_sa on 2002-01-11 23:38:44 +0000
 1.11.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.4 29-Nov-2004  skrll Sync with HEAD.
 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.13.4.1 06-Apr-2005  tron Pull up revision 1.14 (requested by jmc in ticket #1028):
Pull host/arch native label information into bootblock.h. Therefore pieces of
this are accessible from host tools.
 1.14.10.1 06-Oct-2005  tron Pull up following revision(s) (requested by tsutsui in ticket #864):
sys/arch/sgimips/sgimips/disksubr.c: revision 1.16
On converting sgimips disklabel into BSD disklabel, don't take
dp_secbytes in the SGI volume header because the ARCS firmware ignores it.
Instead, leave the hardware default value set by each driver and
adjust offset values in the SGI volhdr according to the real sector size.
Fixes "resource shortage" messages on mounting a bootable CD-ROM image
which has the SGI volhdr. See posts on port-sgimips for details:
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0000.html
http://mail-index.netbsd.org/port-sgimips/2005/09/12/0001.html
http://mail-index.netbsd.org/port-sgimips/2005/09/14/0000.html
 1.15.2.5 21-Jan-2008  yamt sync with head
 1.15.2.4 27-Oct-2007  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.22.1 10-Dec-2006  yamt sync with head.
 1.17.20.1 12-Jan-2007  ad Sync with head.
 1.18.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.22.1 14-Oct-2007  yamt sync with head.
 1.19.20.2 09-Jan-2008  matt sync with HEAD
 1.19.20.1 06-Nov-2007  matt sync with HEAD
 1.19.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.19.10.1 16-Oct-2007  garbled Sync with HEAD
 1.19.6.1 19-Mar-2007  reinoud Remove direct references to buf->b_un.b_addr instead of using buf->b_data.
This allows UVM- or other structures to be used eventually.
 1.19.2.1 09-Oct-2007  ad Sync with head.
 1.21.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.21.4.2 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.21.4.1 26-Dec-2007  ad Sync with head.
 1.21.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.23.98.1 10-Jun-2019  christos Sync with HEAD
 1.2 19-Jan-2004  sekiya Attach int0 at mainbus (precedent being the ip32 CRIME device, which handled
interrupts and timer calibration yet is also attached at mainbus).

Introduce the INDY_R4600_CACHE config option, which more accurately describes
the code enabled by this option.

This renders #ifdef IPxx completely obsolete, thus we theoretically can unify
the GENERIC files if a workable load address relocation scheme can be found.
 1.1 18-Jan-2004  sekiya Large rototill of the lowlevel code:

* move all device-specific bitbanging to the device drivers in question --
i.e., the ip32 init code doesn't access the CRIME registers directly but
instead trusts the CRIME driver to DTRT. machdep.c is cleaner thereby.
* introduce int.c, which handles the interrupt-controller goo formerly
in ip2x.c.
* unify the CPU interrupt handler, with CRIME, INT2, and the various timer
handlers hooked in via pointers in the platform struct.
* eliminate ip2x.c and ip32.c. After the interrupt handler cleanup, the
actual platform-dependent code was so minimal (rev identification, mask level
initialization) that it made sense to move it into machdep.c
* "#ifdef DEBUG printf("foo"); #endif" becomes aprint_debug.

Tested on my ip22 and ip32. Discussed with pooka@, rafal@.
 1.2 15-Dec-2003  sekiya IP20 belongs to the IP2x family, thus this should no longer exist.
 1.1 22-Nov-2003  sekiya Add initial ip20 (Indigo) support. hpc1 code to follow. Code originally
from Steve Rumble, with modifications by myself.
 1.22 15-Dec-2003  sekiya Part two in the Great Renaming. ip22.c becomes ip2x.c, and all generic ip2x
routines become ip2x_*.
 1.21 15-Dec-2003  sekiya Move IOC-specific initialization code from sgimips/ip22.c to ioc/ioc.c.
 1.20 14-Dec-2003  sekiya Move IOC (integrated peripheral controller) init code into the IP22-specific
routine, as IP20 does not possess an IOC. This will eventually be moved into
a dedicated IOC driver that attaches its peripherals as children, but the
changes involved are too intrusive right now.
 1.19 14-Dec-2003  sekiya Compile sgimips/ip[23]2.c iff the corresponding IP[23] is defined in the
config file.
 1.18 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.17 04-Oct-2003  tsutsui - some KNF
- hz -> Hz in printf
 1.16 04-Oct-2003  tsutsui TAB/space cleanup.
 1.15 15-Jul-2003  lukem __KERNEL_RCSID()
 1.14 09-Nov-2002  thorpej branches: 1.14.6;
Fix signed/unsigned comparison warnings.
 1.13 04-Jun-2002  simonb 3 ports are now using the reciprocal count divisor code now, move it
to <mips/cpu.h>, and add MIPS_SET_CI_RECIPRICAL and MIPS_COUNT_TO_MHZ
macros to use it.
 1.12 03-May-2002  rafal branches: 1.12.2;
Update copyright dates.
 1.11 03-May-2002  rafal Fix up clock interrupt accounting for the sgimips port -- make sure
to schedule clock interrupts at a fixed interval, rather scheduling
the next one based on the time of the arrival/servicing of the previous
clock interrupt. Also, pick up a trick from the sbmips port to convert
a division in ip22_clkread to a multiplication, since those are much
cheaper -- the details of that are described in Simon's commit (see
Message-Id: <20020306073437.1D2A8B004@cvs.netbsd.org>). Thanks to
Jason Thorpe and Dominic Sweetman's "See MIPS Run" (where I found
mention of this very subject while looking for something totally un-
related! 8-) for the clue about the source of the timekeeping problems.

For the IP32, where we have no clock-calibration code yet, use the CPU
frequency provided by ARCS instead; it beats a hard-coded value!

As an added bonus, most of the CPU-clock related stuff is now collected
together in cpu_info_store, rather than as a collection of unorganized
global variables.
 1.10 02-May-2002  rafal Since we don't have code to drive the L2 cache on R4600/R5k processors,
disable the L2 cache so at least things work (albeit more slowly) on
the SC versions of those chips. Tested on a R4600 Indy and a R4400
Challenge S.
 1.9 29-Apr-2002  rafal Fix nasty crashes on IP22 machines with console running at 38.4kbps (which
generally translates to "high interrupt load") -- the old code re-enabled
interrupts in the machine-specific hardware interrupt handler causing the
handler to be re-entered, possible multiple times. Could lead to kernel
stack overflows, and all sorts of mysterious crashes/hangs as a result.

While here, fix up the IP32 interrupt handler code to also not re-enable
interrupts.

Thanks for ideas/comments go to Chuq and Stephen Ma.
 1.8 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.7 14-Nov-2001  thorpej branches: 1.7.2;
Merge the thorpej-mips-cache branch onto the trunk. This is an
overhaul of how caches are handled for NetBSD's MIPS ports.
 1.6 11-Nov-2001  rafal Make microtime(9) do interpolation to get better-than-hz resolution, if
the platform supplies a clkread function that does something other than
return 0 (which is the default unless overridden by the platorm code).
Supply such a function for the IP22; even if it isn't perfect, it goes
a long way to making ntp usable.

While I'm at it, move the ticks-per-hz variable out of the struct platform
since it's really private to the per-platform interrupt/clock code.

XXX: No clkread function supplied for IP32, since it has other problems --
like a hardcoded ticks-per-hz, but the same code as on the IP22 could be
used.
 1.5 14-Jun-2001  rafal branches: 1.5.2; 1.5.4; 1.5.8;
Remove externs moved to headers, fix interrupt masks to be zeroes at startup,
add MIPS clock interrupt (int5) event counter and clean up some more debug
goo.
 1.4 08-Jun-2001  rafal Fix initial interrupt mask settings for `hard' interupts to mask out soft
interrupts as well. The system is quite stable now that soft interrupts
don't pop up at random places where they're unexpected 8-)

Also, while here, fix CPU clock speed calculation for the Indy.
 1.3 11-May-2001  thorpej Support for the IP22 (Indigo2, Indy, Challenge S). From Rafal K. Boni.
 1.2 29-Jun-2000  soren Changed my mind about these..
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file ip22.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:42 +0000
 1.5.8.2 14-Nov-2001  thorpej Shuffle around the code that frobs the IP-22 L2 SysAD cache,
and add code (untested and not enabled yet) to actually enable
and flush this cache.

The code is really just a placeholder -- I need to find someone
that has a machine equipped with such a cache.
 1.5.8.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.5.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.2.4 11-Nov-2002  nathanw Catch up to -current
 1.7.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.7.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.2.1 14-Nov-2001  nathanw file ip22.c was added on branch nathanw_sa on 2002-04-01 07:42:28 +0000
 1.12.2.1 15-Jul-2002  gehenna catch up with -current.
 1.14.6.1 03-Aug-2004  skrll Sync with HEAD
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 22-Feb-2004  sekiya Correct descriptive comment (these routines are not used for r5ksc).
 1.3 13-Mar-2002  simonb branches: 1.3.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 14-Nov-2001  thorpej branches: 1.2.2; 1.2.4;
Merge the thorpej-mips-cache branch onto the trunk. This is an
overhaul of how caches are handled for NetBSD's MIPS ports.
 1.1 14-Nov-2001  thorpej branches: 1.1.2;
file ip22_cache.S was initially added on branch thorpej-mips-cache.
 1.1.2.1 14-Nov-2001  thorpej Shuffle around the code that frobs the IP-22 L2 SysAD cache,
and add code (untested and not enabled yet) to actually enable
and flush this cache.

The code is really just a placeholder -- I need to find someone
that has a machine equipped with such a cache.
 1.2.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 14-Nov-2001  thorpej file ip22_cache.S was added on branch kqueue on 2002-01-10 19:48:31 +0000
 1.2.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.1 14-Nov-2001  nathanw file ip22_cache.S was added on branch nathanw_sa on 2002-04-01 07:42:29 +0000
 1.3.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.12.1 03-Aug-2004  skrll Sync with HEAD
 1.2 29-Jun-2000  soren Changed my mind about these..
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file ip27.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:43 +0000
 1.9 18-Jan-2004  sekiya Large rototill of the lowlevel code:

* move all device-specific bitbanging to the device drivers in question --
i.e., the ip32 init code doesn't access the CRIME registers directly but
instead trusts the CRIME driver to DTRT. machdep.c is cleaner thereby.
* introduce int.c, which handles the interrupt-controller goo formerly
in ip2x.c.
* unify the CPU interrupt handler, with CRIME, INT2, and the various timer
handlers hooked in via pointers in the platform struct.
* eliminate ip2x.c and ip32.c. After the interrupt handler cleanup, the
actual platform-dependent code was so minimal (rev identification, mask level
initialization) that it made sense to move it into machdep.c
* "#ifdef DEBUG printf("foo"); #endif" becomes aprint_debug.

Tested on my ip22 and ip32. Discussed with pooka@, rafal@.
 1.8 12-Jan-2004  sekiya Back out hasty previous commit -- bitwise arithmetic does not always match
integer arithmetic, as demonstrated in this case.
 1.7 12-Jan-2004  sekiya Completely commit to bitwise operations. Instigated by simonb@
 1.6 12-Jan-2004  sekiya Change one more multiplication to a bit shift. Pointed out by pooka@.
 1.5 12-Jan-2004  sekiya ANSIfy, and change a multiplication operation to a bit-shift.
 1.4 10-Jan-2004  sekiya Bus-spacify ip2x core logic. Eliminate magic numbers.
co
 1.3 01-Jan-2004  sekiya Don't panic when attempting to share interrupts on ip2x -- just print an
informative message and gracefully return.
 1.2 30-Dec-2003  sekiya Force ARCS console for IP20 until the console-on-zs crashing problem is
fixed. Store the board revision for future use, while we're at it.
 1.1 15-Dec-2003  sekiya Part two in the Great Renaming. ip22.c becomes ip2x.c, and all generic ip2x
routines become ip2x_*.
 1.24 18-Jan-2004  sekiya Large rototill of the lowlevel code:

* move all device-specific bitbanging to the device drivers in question --
i.e., the ip32 init code doesn't access the CRIME registers directly but
instead trusts the CRIME driver to DTRT. machdep.c is cleaner thereby.
* introduce int.c, which handles the interrupt-controller goo formerly
in ip2x.c.
* unify the CPU interrupt handler, with CRIME, INT2, and the various timer
handlers hooked in via pointers in the platform struct.
* eliminate ip2x.c and ip32.c. After the interrupt handler cleanup, the
actual platform-dependent code was so minimal (rev identification, mask level
initialization) that it made sense to move it into machdep.c
* "#ifdef DEBUG printf("foo"); #endif" becomes aprint_debug.

Tested on my ip22 and ip32. Discussed with pooka@, rafal@.
 1.23 12-Jan-2004  sekiya CRIME revision 1.1 has a bug that affects PIO operations to/from the MACE.
The recommended workaround is a 5-10ms delay before and after accesses.
Therefore, move the affected bus_space_* operations from bus.h to bus.c
and special-case MACE accesses.

CRIME accesses are not affected, so introduce SGIMIPS_BUS_SPACE_CRIME and
use it as the CRIME tag.

My ip32 seems a little bit happier with this change, and my ip22 didn't
notice the change.
 1.22 14-Dec-2003  sekiya Compile sgimips/ip[23]2.c iff the corresponding IP[23] is defined in the
config file.
 1.21 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.20 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.19 04-Oct-2003  tsutsui - some KNF
- hz -> Hz in printf
 1.18 04-Oct-2003  tsutsui TAB/space cleanup.
 1.17 15-Jul-2003  lukem __KERNEL_RCSID()
 1.16 06-Jan-2003  rafal branches: 1.16.2;
Don't shift the pending interrupt bitmask passed to crime_intr() so it can
associate pending interrupts with the proper sources. Add some comments to
the vestigal ip32_intr_establish() on what it really *should* do.
 1.15 03-Jan-2003  rafal Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 1.14 28-Dec-2002  pooka on second thought... make this also compile
 1.13 28-Dec-2002  pooka add timer calibration

from Chris Sekiya
 1.12 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.11 04-Jun-2002  simonb 3 ports are now using the reciprocal count divisor code now, move it
to <mips/cpu.h>, and add MIPS_SET_CI_RECIPRICAL and MIPS_COUNT_TO_MHZ
macros to use it.
 1.10 03-May-2002  rafal branches: 1.10.2;
Update copyright dates.
 1.9 03-May-2002  rafal Fix up clock interrupt accounting for the sgimips port -- make sure
to schedule clock interrupts at a fixed interval, rather scheduling
the next one based on the time of the arrival/servicing of the previous
clock interrupt. Also, pick up a trick from the sbmips port to convert
a division in ip22_clkread to a multiplication, since those are much
cheaper -- the details of that are described in Simon's commit (see
Message-Id: <20020306073437.1D2A8B004@cvs.netbsd.org>). Thanks to
Jason Thorpe and Dominic Sweetman's "See MIPS Run" (where I found
mention of this very subject while looking for something totally un-
related! 8-) for the clue about the source of the timekeeping problems.

For the IP32, where we have no clock-calibration code yet, use the CPU
frequency provided by ARCS instead; it beats a hard-coded value!

As an added bonus, most of the CPU-clock related stuff is now collected
together in cpu_info_store, rather than as a collection of unorganized
global variables.
 1.8 29-Apr-2002  rafal Fix nasty crashes on IP22 machines with console running at 38.4kbps (which
generally translates to "high interrupt load") -- the old code re-enabled
interrupts in the machine-specific hardware interrupt handler causing the
handler to be re-entered, possible multiple times. Could lead to kernel
stack overflows, and all sorts of mysterious crashes/hangs as a result.

While here, fix up the IP32 interrupt handler code to also not re-enable
interrupts.

Thanks for ideas/comments go to Chuq and Stephen Ma.
 1.7 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.6 11-Nov-2001  rafal branches: 1.6.2;
Make microtime(9) do interpolation to get better-than-hz resolution, if
the platform supplies a clkread function that does something other than
return 0 (which is the default unless overridden by the platorm code).
Supply such a function for the IP22; even if it isn't perfect, it goes
a long way to making ntp usable.

While I'm at it, move the ticks-per-hz variable out of the struct platform
since it's really private to the per-platform interrupt/clock code.

XXX: No clkread function supplied for IP32, since it has other problems --
like a hardcoded ticks-per-hz, but the same code as on the IP22 could be
used.
 1.5 14-Jun-2001  rafal branches: 1.5.2; 1.5.4; 1.5.8;
Get rid of externs moved to header files, add event counter for the clock
interrupt, use platform.ticks_per_hz instead of hardcoded constant for the
counter increment (XX: not that the ticks_per_hz is calculated for the IP32
yet).
 1.4 14-May-2001  matt Add null ip32_bus_reset. Add cpu_intr_establish which calls
crime_intr_establish. XXX cpu_intr_establish needs to have the
"normal" intr_establish arguments.
 1.3 11-May-2001  thorpej Move IP32 (O2) support into its own file.

From Rafal K. Boni.
 1.2 29-Jun-2000  soren Changed my mind about these..
 1.1 14-Jun-2000  soren branches: 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file ip32.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:43 +0000
 1.5.8.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.5.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.5.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.2.6 07-Jan-2003  thorpej Sync with HEAD.
 1.6.2.5 29-Dec-2002  thorpej Sync with HEAD.
 1.6.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.6.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.6.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.2.1 11-Nov-2001  nathanw file ip32.c was added on branch nathanw_sa on 2002-04-01 07:42:29 +0000
 1.10.2.1 15-Jul-2002  gehenna catch up with -current.
 1.16.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5 28-Apr-2006  simonb sgimips uses event counters for interrupts, don't need intrcnt/intrnames
any more.
 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 17-Nov-2003  keihan branches: 1.3.16;
www.netbsd.org -> www.NetBSD.org
 1.2 13-Mar-2002  simonb branches: 1.2.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 29-Jun-2000  soren branches: 1.1.2; 1.1.6; 1.1.10;
Minimal locore_machdep.S.
 1.1.10.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 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 29-Jun-2000  bouyer file locore_machdep.S was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +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.3.16.1 21-Jun-2006  yamt sync with head.
 1.4.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.4.10.1 11-May-2006  elad sync with head
 1.4.8.1 24-May-2006  yamt sync with head.
 1.4.6.1 01-Jun-2006  kardel Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.156 23-May-2024  skrll Trailing whitespace.
 1.155 23-May-2024  skrll sgimips: call mips_vector_init earlier to fix boot.

PR port-sgimips/58269
 1.154 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.153 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.152 12-Aug-2021  andvar branches: 1.152.4;
fix typos in "environment" word.
 1.151 24-Jul-2021  andvar 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.150 11-Jun-2020  ad branches: 1.150.6;
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.149 31-Dec-2019  ad Rename uvm_free() -> uvm_availmem().
 1.148 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.147 08-Sep-2018  tsutsui Initialize ci_divisor_delay by temporary cpufreq for early delay(9) calls.

This is actually required for Indigo R3k.
Reported by Naruaki Etomi in PR port-sgimips/53520.
 1.146 02-Sep-2018  tsutsui Fix build failure without options DDB and with pseudo-device ksyms.

There is a typo for ksyms (NKSYMS vs NKSYM).
Also use consistent "#if NKSYMS" rather than "#if NKSYMS > 0" etc.
and add comments after corresponding #endif for readability.

Fixes PR port-sgimips/53521 from Naruaki Etomi.
Should be pulled up to (at least) netbsd-8.
 1.145 06-Nov-2017  christos branches: 1.145.2; 1.145.4;
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.144 10-Feb-2017  christos branches: 1.144.6;
kill variable stack allocation
 1.143 22-Dec-2016  cherry branches: 1.143.2;
switch all ports to use uvm_init.c:uvm_md_init()

uvm_setpagesize() is now subsumed within this funciton.
 1.142 03-Nov-2016  kamil Prefer modern simple past tense and past participle of catch

The "catched" form is obsolete and nonstandard, prefer "caught".
 1.141 26-Jun-2015  matt branches: 1.141.2;
Cleanup includes
 1.140 24-Mar-2014  christos branches: 1.140.6;
- use cpu_{g,s}etmodel
- fix unused
 1.139 16-Dec-2013  mrg - remove unused variables
- use (void) when we don't care about the return value
 1.138 27-Oct-2012  chs branches: 1.138.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.137 28-Jul-2012  matt branches: 1.137.2;
Fix -fno-common fallout.
 1.136 28-Jul-2011  uebayasi branches: 1.136.2;
Fix DEBUG build.
 1.135 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.134 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.133 08-Feb-2010  joerg branches: 1.133.2; 1.133.4; 1.133.6;
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.132 16-Dec-2009  matt branches: 1.132.2;
Fix various build with the 32bit mips ports after the mips64 merge.
 1.131 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.130 27-Nov-2009  rmind - 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.129 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.128 11-Aug-2009  matt Remove all declarations of physmem from sys/arch. Add an include of
<sys/systm.h> to the one file that did not already contain it.
This now means that physmem can be changed by updating systm.h and uvm_page.c
(excluding fixing printfs)
 1.127 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.126 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.125 12-Feb-2009  rumble Enable Personal IRIS 4D/20 and 4D/25 support:
- Adapt int(4) to handle the INT1 chip
- Move generic rtc clocks out of hpc/ and into dev/
- Handle the very strangely wired eeprom and other bits in arcemu
- Sprinkle MACH_SGI_IP6 as necessary
- Enable IP6/IP10 devices in GENERIC32_IP12. Yes, the naming is poor but
there's no winning with kernel/hw compatibility on sgimips...

Tested on my 4D/25. Doesn't (appear to) break macallan@'s IP22.
 1.124 30-Nov-2008  martin branches: 1.124.4;
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.123 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.122 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.121 03-Aug-2008  tsutsui branches: 1.121.2; 1.121.8;
Two fixes to make -current kernel be loadable by 4.0 bootloader:
- if bootinfo is not passed from bootloader, check argv[1] first
which might be the loaded kernel path specified for bootloader
- when using argv[0] as the kernel path (loaded directly by the PROM)
assume boot partition is 0 (partition a) since the kernel might be
in an SGI volume header partition and it can't be a root partition

Ok'ed by rumble@, and tested on IP22 and IP32.
 1.120 02-Jul-2008  ad branches: 1.120.2;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.119 28-Mar-2008  tsutsui branches: 1.119.4; 1.119.6; 1.119.8;
Adjust boot device detection code to make netboot work properly:
- make a bootloader pass bootpath which includes device path on ARC BIOS
via BTINFO_BOOTPATH
- make a kernel use BTINFO_BOOTPATH in bootinfo to see boot device first,
then check argv[0] passed from ARC BIOS if there is no valid bootinfo
- check OSLoadPartition variables in the ARCBIOS environment and whole
argv[] arguments for IP12
- initialize mach_type before it's referred
- bump boot version

Tested on IP32 with various kernel/bootloader combinations.
 1.118 26-Jan-2008  tsutsui branches: 1.118.6;
Replace bootinfo stuff on sgimips (which has been disabled in bootloader)
with ones used on arc (which has been working for a year) and
enable it in bootloader. Tested on IP32.
 1.117 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.116 17-Oct-2007  garbled branches: 1.116.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.115 26-Sep-2007  macallan use crime_reboot() and mcclock_poweroff() when appropriate.
With this my O2 resets and powers down again even when using crmfb,
apparently it freaks out the ARCS firmware - with crmfb the machine would
just sit there blinking instead of rebooting.
 1.114 17-May-2007  yamt branches: 1.114.8; 1.114.10; 1.114.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.113 11-May-2007  rumble IP12's PROM passes us a '-a' flag in argv when booting directly from the
disk volume header. On NetBSD this means RB_ASKNAME, however in SGI terms
it appears to mean 'autoboot'.

Add an appropriate kludge to keep us from doing the wrong thing.

XXX - This whole argv/env/prom parameter mess needs to be cleaned up.
 1.112 10-May-2007  rumble A few changes to allow booting to multi-user with IP12 kernels squished
into oversized volume headers:

Query ARCBIOS for OSLoadFilename and OSLoadOptions first, rather than only
using the environment variables passed since we want to go through arcemu.

Add an ugly hack to arcemu that munges the nvram 'bootfile' variable. We
need this because bootfile will point to the volume header, which then
translates into a bogus root device of 'sd0i', or similar.
 1.111 10-May-2007  rumble Clean up extracting environment variables passed by the prom. No functional
change.
 1.110 06-Mar-2007  tsutsui branches: 1.110.2; 1.110.4; 1.110.10;
Use (char *) to appease -Wpointer-arith.
 1.109 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.108 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.107 21-Feb-2007  rumble Since IP12 doesn't use ARCS, we could read the console setting from the
nvram, but it may not be valid. For example, if the console is set to
graphics, but no keyboard is attached, we should not attempt to use a
graphical console.

To fix this, we extend arcemu to parse the prom's environment array, which
is the third argument to the kernel. If the console mode is graphics, but
no keyboard is found, the 'gfx' environment variable will contain 'dead'.

Note that since IP12 has no bootloader, we assume that the third parameter
is the environment table, not bootinfo.
 1.106 09-Feb-2007  ad branches: 1.106.2;
Merge newlock2 to head.
 1.105 30-Dec-2006  rumble Fix typo in comment.
 1.104 29-Dec-2006  rumble Move the mips1_clock_intr handling into int.c where it belongs.
 1.103 29-Dec-2006  rumble IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.102 28-Dec-2006  rumble Handle fpu interrupts (MIPS interrupt 0) on IP12.
 1.101 27-Dec-2006  rumble Specify the member names of struct platform for clarity.
 1.100 22-Dec-2006  rumble Guiness -> Guinness.
 1.99 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.98 16-Sep-2006  gdamore branches: 1.98.2;
sgimips converted to timecounters. Systems that can do them get mips_cp0
based logic. We also use the common mips3_clock functions for those systems,
removing some port-specific code.

Tested by martin@.
 1.97 01-Sep-2006  sekiya branches: 1.97.2;
Fix delay() so that gcc4 does not optimize it into a noop. Lifted from the
newsmips implementation by tsutsui@
 1.96 09-Apr-2006  tsutsui Remove declarations for cpu_model[] since it's in <sys/systm.h>.
 1.95 11-Dec-2005  christos branches: 1.95.4; 1.95.6; 1.95.8; 1.95.10; 1.95.12;
merge ktrace-lwp.
 1.94 18-Oct-2005  sekiya Restore missing call to r5k_enable_sdcache(). Its' removal was a thinko
on my part -- the COP0 SC presence test fails on r5k IP22, but
r5k_enable_sdcache() will DTRT regardless.

Pointed out by tsutsui@
 1.93 03-Jun-2005  martin branches: 1.93.2;
Avoid a global name "netmask" - it causes lots of shadow warnings all over
the place. Collect all interrupt masks into a single array instead.
Constify a bit and fix a bogus argument to config_rootfound().
 1.92 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.91 26-Mar-2005  tsutsui mips_sdcache_forceinv has been removed.

XXX Should we check MIPS3_CONFIG_SE in mips3_cp0_config_read() and
XXX call r5k_enable_sdcache() accordingly here?
 1.90 01-Mar-2005  sekiya branches: 1.90.2;
Set mips_sdcache_forceinv to 1 for r5k processors.

We now support secondary cache operation on r5ksc out-of-the-box.
 1.89 17-Dec-2004  sekiya branches: 1.89.2; 1.89.4;
Nuke MIPS64; we'll use MIPS3 to indicate the presence of MIPS3 instructions
and _LP64 to indicate that 64-bit is desired.

Pointed out by simonb@
 1.88 13-Dec-2004  sekiya MIPS3_CONFIG_SC is an unreliable indicator for SC presence; r5k_enable_sdcache()
will gracefully exit if there is no secondary cache. Rework #ifdef'd out
r5k cache code to take this into account, and remove pointless r10k case.
 1.87 02-Oct-2004  sekiya Use the mips3 bus functions on IP30. Recognize the IP30 as a supported* SGI
platform.

* For extremely small values of "supported". arch/mips/* needs a lot of work
yet for MIPS64.
 1.86 01-Oct-2004  sekiya s,#ifdef MIPS3,#if defined(MIPS3) || defined(MIPS64),g
 1.85 11-Apr-2004  pooka KNF some and make printf output a bit nicer.
 1.84 11-Apr-2004  pooka Add IP12 stuff. Most bits included are from Steve Rumble.

After this change it is possible to run IP12.
 1.83 09-Apr-2004  pooka If argv[1] doesn't exist, don't try to use it.
 1.82 05-Apr-2004  tsutsui Tidy up total/avail memory message as well as other ports.
As per discussion on port-sgimips.
 1.81 25-Mar-2004  pooka branches: 1.81.2;
Sprinkle some #ifdef MIPS3 to be able to compile the port without
including MIPS3 code.

for upcoming IP12
 1.80 06-Mar-2004  sekiya Print an informative message when unimpl_intr() is invoked, rather than panic().
 1.79 19-Jan-2004  sekiya Completely remove IP2X and IP32, which renders opt_machtype.h obsolete.
 1.78 19-Jan-2004  sekiya g/c obsolete function.
 1.77 19-Jan-2004  sekiya Attach int0 at mainbus (precedent being the ip32 CRIME device, which handled
interrupts and timer calibration yet is also attached at mainbus).

Introduce the INDY_R4600_CACHE config option, which more accurately describes
the code enabled by this option.

This renders #ifdef IPxx completely obsolete, thus we theoretically can unify
the GENERIC files if a workable load address relocation scheme can be found.
 1.76 18-Jan-2004  sekiya Remove another #ifdef IP32
 1.75 18-Jan-2004  sekiya Large rototill of the lowlevel code:

* move all device-specific bitbanging to the device drivers in question --
i.e., the ip32 init code doesn't access the CRIME registers directly but
instead trusts the CRIME driver to DTRT. machdep.c is cleaner thereby.
* introduce int.c, which handles the interrupt-controller goo formerly
in ip2x.c.
* unify the CPU interrupt handler, with CRIME, INT2, and the various timer
handlers hooked in via pointers in the platform struct.
* eliminate ip2x.c and ip32.c. After the interrupt handler cleanup, the
actual platform-dependent code was so minimal (rev identification, mask level
initialization) that it made sense to move it into machdep.c
* "#ifdef DEBUG printf("foo"); #endif" becomes aprint_debug.

Tested on my ip22 and ip32. Discussed with pooka@, rafal@.
 1.74 13-Jan-2004  sekiya Call sgimips_bus_dma_init() in mach_init to set up the proper MIPS1/MIPS3
bus_dma_sync() routine.
 1.73 13-Jan-2004  sekiya Add a call to ip1x_init().
 1.72 12-Jan-2004  sekiya Wrap more mips3_ operations in MIPS3 defines.
 1.71 03-Jan-2004  sekiya Streamline bootinfo logic.
 1.70 03-Jan-2004  lonewolf Rework the memory detection routine to handle cases where kernel doesn't
fit inside one memory chunk.
Leave 1 page before kernel untouched as that's where our initial kernel
stack before we switch to proc0 stack is (fixes boot problems on my Indy
with small kernels).
 1.69 02-Jan-2004  sekiya Add trailing newline. Noticed by Steve Rumble.
 1.68 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.67 29-Dec-2003  sekiya Fix typo ("ARCBIOS_MEM_ExecptionBlock"). From Steve Rumble.
 1.66 15-Dec-2003  sekiya Part two in the Great Renaming. ip22.c becomes ip2x.c, and all generic ip2x
routines become ip2x_*.
 1.65 15-Dec-2003  sekiya Change all IP22 preprocessor conditionals to IP2X preprocessor conditionals.

Part one of two -- part two will be renaming ip22_*() to ip2x_*().
 1.64 14-Dec-2003  sekiya IP20 should handle the watchdog timer in the same manner as for IP22.
 1.63 14-Dec-2003  sekiya For the purposes of machdep.c, consider IP20 to be a variant of IP22. ip20.c
and #ifdef IP20 will go away (short-term), ip22_* will be renamed to ip2x_*
(slighly longer-term).
 1.62 14-Dec-2003  sekiya The ARCBIOS->FlushAllCaches() vector is NULL on at least one SGI platform
(ip20) and has no actual operational effect, thus it should not be invoked here.
 1.61 10-Dec-2003  lonewolf Remove the extra call to consinit().
 1.60 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.59 05-Oct-2003  tsutsui Apply a bunch of patches written by Christopher SEKIYA
(with several cosmetic changes by me) which fixes O2 (IP32) support.

Now my R5000 O2 works fine in multiuser with on-board AIC7880 SCSIs
and several PCI network cards (but only on serial console yet).
L2 cache on R5000/Rm5200 is still disabled for now, but it will be
fixed later, hopefully.

See recent discussion on port-sgimips for details.
 1.58 04-Oct-2003  tsutsui TAB/space cleanup.
 1.57 28-Sep-2003  tsutsui Cast through (void *) to appease gcc3.
 1.56 15-Sep-2003  simonb Use common mips generic software interrupt routines.

Changes from Izumi Tsutsui, tested by Havard Eidnes.
 1.55 15-Jul-2003  lukem __KERNEL_RCSID()
 1.54 26-Apr-2003  ragge branches: 1.54.2;
Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.53 02-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.52 31-Mar-2003  rafal Oops, make sure to re-enable the IP32 watchdog correctly, else we end up
getting random reboots after returning from DDB.
 1.51 19-Jan-2003  rafal Parse out flags passed to the kernel on boot; from Scott Taylor, tweaked to
use the MI boot_flags.h interface by me.
 1.50 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.49 10-Jan-2003  rafal Get rid of some extraneous declarations/comments.
 1.48 10-Jan-2003  rafal Add the MIPS3_CONFIG_SE (name taken from Rm52xx manual) bit, which is the
external cache enable bit -- this allows software to enable or disable the
(external) L2 cache on the R5k and Rm527x and the (external) L3 cache on
the Rm7k. If the (external) cache is disabled, treat it as if there were
no cache for the purposes of the cache setup code.

Also, update sgimips code to use the new name.
 1.47 06-Jan-2003  rafal There's no cache_r5k.h yet, so don't try to include it.
 1.46 06-Jan-2003  rafal Postpone DDB/KGDB init until we know the machine type, so the debugger can
be attached to the right place, twiddle the right watchdog registers, etc.
 1.45 03-Jan-2003  rafal Checkpoint of O2 work by Chris Sekiya and myself. This is the sgimips bit;
still needs some arch/mips support code before it will fully work.
 1.44 03-Jan-2003  rafal Move console setup after we've determined machine type so the console init
code can guess where to find a console depending on machine type.
 1.43 23-Dec-2002  pooka Use crimereg.h definitions for the crime dog. Also, move watchdog
disable down the very last possible place in cpu_reboot.

from Chris Sekiya
 1.42 09-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.41 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.40 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.39 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.38 04-Aug-2002  gmcgarry Merge cpu_sysctl() for all mips ports, based on powerpc and m68k precedent.

For now, only pmax implements CPU_BOOTED_KERNEL. Need to revisit.
 1.37 03-May-2002  rafal branches: 1.37.2;
Update copyright dates.
 1.36 03-May-2002  rafal Fix up clock interrupt accounting for the sgimips port -- make sure
to schedule clock interrupts at a fixed interval, rather scheduling
the next one based on the time of the arrival/servicing of the previous
clock interrupt. Also, pick up a trick from the sbmips port to convert
a division in ip22_clkread to a multiplication, since those are much
cheaper -- the details of that are described in Simon's commit (see
Message-Id: <20020306073437.1D2A8B004@cvs.netbsd.org>). Thanks to
Jason Thorpe and Dominic Sweetman's "See MIPS Run" (where I found
mention of this very subject while looking for something totally un-
related! 8-) for the clue about the source of the timekeeping problems.

For the IP32, where we have no clock-calibration code yet, use the CPU
frequency provided by ARCS instead; it beats a hard-coded value!

As an added bonus, most of the CPU-clock related stuff is now collected
together in cpu_info_store, rather than as a collection of unorganized
global variables.
 1.35 29-Apr-2002  rafal Fix nasty crashes on IP22 machines with console running at 38.4kbps (which
generally translates to "high interrupt load") -- the old code re-enabled
interrupts in the machine-specific hardware interrupt handler causing the
handler to be re-entered, possible multiple times. Could lead to kernel
stack overflows, and all sorts of mysterious crashes/hangs as a result.

While here, fix up the IP32 interrupt handler code to also not re-enable
interrupts.

Thanks for ideas/comments go to Chuq and Stephen Ma.
 1.34 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.33 22-Nov-2001  soren Respect OSLoadPartition even if it doesn't come before SystemPartition in argv.
Add a few comments about the above.
 1.32 21-Nov-2001  thorpej - Check for provided bootinfo from the bootloader. If we find it,
save off DDB symbol table information.
- Make loading of memory work reliably with the bootloader; for each
candidate memory type from ARCS (which now includes LoadedProgram),
check to see if the kernel is within that chunk, and load the pages
around it if it is.
 1.31 19-Nov-2001  soren Also check SystemPartition when finding boot device. Especially
when netbooting, it is practical to load the kernel directly.
 1.30 14-Nov-2001  mhitch branches: 1.30.2;
When loadfile() leaves the ELF header at the end of the kernel, it enables
erroneous code that tries to compute the end of the symbol table. Disable
that for now so that kernels don't hang when booted from the disk.
 1.29 11-Nov-2001  rafal Make microtime(9) do interpolation to get better-than-hz resolution, if
the platform supplies a clkread function that does something other than
return 0 (which is the default unless overridden by the platorm code).
Supply such a function for the IP22; even if it isn't perfect, it goes
a long way to making ntp usable.

While I'm at it, move the ticks-per-hz variable out of the struct platform
since it's really private to the per-platform interrupt/clock code.

XXX: No clkread function supplied for IP32, since it has other problems --
like a hardcoded ticks-per-hz, but the same code as on the IP22 could be
used.
 1.28 18-Oct-2001  mhitch branches: 1.28.2;
Use boot arguments to try to determine the boot device. The OSLoadPartition
string, if present, will override the second argument (which may be the
path/kernel being loaded). This will provide a way to netboot the kernel
and allow the root device be set to a disk partition.
 1.27 24-Sep-2001  mhitch Run vfs_shutdown() if NOSYNC is *not* set, rather than set.
 1.26 22-Sep-2001  rafal If OSLoadOptions is set to auto, boot straight to multi-user. Requested
one too many times and it seems to do no harm, so enable it.
 1.25 18-Sep-2001  rafal Obey the RB_POWERDOWN flag passed to cpu_reboot; make it work on the Indy
by enabling the FPU before jumping back to ARCS (gross, but necessary!).
 1.24 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.23 09-Jul-2001  thorpej branches: 1.23.2; 1.23.4;
Count and display the number of CPUs present on the system.
 1.22 09-Jul-2001  thorpej Fill in cpu_model[]
 1.21 08-Jul-2001  thorpej - Use the identifier strings that are fetched by the MI ARC BIOS
code.
- Garbage-collect some non-useful stuff from the mainbus_attach_args.
 1.20 08-Jul-2001  thorpej bcopy -> memcpy, bzero -> memset
 1.19 08-Jul-2001  thorpej Use sys/dev/arcbios.
 1.18 07-Jul-2001  wdk - Finish off KGDB kernel debugger support for sgimips
 1.17 13-Jun-2001  rafal Implement a db_trap_callback which turns off the watchdog on entry to DDB
and turns it back on on exit. Hook the callback in early in the boot, so
it's there as soon as DDB is available.
 1.16 02-Jun-2001  chs replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.15 11-May-2001  thorpej Adjustments for dynamic system configuration. From Rafal K. Boni.
 1.14 24-Apr-2001  thorpej Do the first allocsys() pass (the pass that computes sizes) before
calling pmap_bootstrap(); pmap_bootstrap() needs some of the size
information computed by allocsys().
 1.13 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.12 23-Apr-2001  thorpej Call pmap_bootstrap() before calling uvm_pageboot_alloc(), so that
the kernel virtual address space bounds will be set up.
 1.11 22-Apr-2001  thorpej Use uvm_pageboot_alloc() for early memory allocation, rather than
calling pmap_steal_memory() directly. On these platforms, since
uvm_pageboot_alloc() is a wrapper around pmap_steal_memory(), there
is no functional change. This is merely for API consistency.
 1.10 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.9 22-Jan-2001  jdolecek branches: 1.9.2;
Require the machine-dependant DDB commands to be in db_machine_command_table[]
and link it directly to db_command_table[] so that it's not necessary
to do this at runtime. Make db_machine_command_table[] const on all ports.
g/c now unneded stuff, like db_machine_commands_install(), db_machine_init()

Patch written by enami.
 1.8 15-Jan-2001  thorpej Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.7 27-Nov-2000  soren Consistently use pmap_steal_memory() to allocate USPACE.
 1.6 05-Oct-2000  cgd branches: 1.6.2;
clean up and consistency for CP0 Count, Compare, Wired, and Config
access function names and prototypes.
 1.5 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.4 14-Jul-2000  jeffs Use cpu_intr() definition from mips/cpu.h instead of local one.
 1.3 29-Jun-2000  mrg 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 14-Jun-2000  soren branches: 1.1.2; 1.1.4;
Initial commit. Needs work.
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file machdep.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:43 +0000
 1.1.2.1 19-Jul-2000  jeffs Pull up cpu_intr() prototype + platform dependent machdeps.
(approved by thorepj).
 1.6.2.7 23-Apr-2001  bouyer Sync with HEAD.
 1.6.2.6 27-Mar-2001  bouyer Sync with HEAD.
 1.6.2.5 11-Feb-2001  bouyer Sync with HEAD.
 1.6.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.6.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.6.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.6.2.1 05-Oct-2000  bouyer file machdep.c was added on branch thorpej_scsipi on 2000-11-20 20:23:48 +0000
 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.23.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.23.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.23.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.23.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.23.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.23.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.23.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.28.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.30.2.14 15-Jan-2003  thorpej Sync with HEAD.
 1.30.2.13 07-Jan-2003  thorpej Sync with HEAD.
 1.30.2.12 29-Dec-2002  thorpej Sync with HEAD.
 1.30.2.11 11-Nov-2002  nathanw Catch up to -current
 1.30.2.10 18-Oct-2002  nathanw Catch up to -current.
 1.30.2.9 27-Aug-2002  nathanw Catch up to -current.
 1.30.2.8 13-Aug-2002  nathanw Catch up to -current.
 1.30.2.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.30.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.30.2.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.30.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.30.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.30.2.2 18-Nov-2001  wdk Seperate proc0 and lwp0 references for SA support
 1.30.2.1 14-Nov-2001  wdk file machdep.c was added on branch nathanw_sa on 2001-11-18 01:28:32 +0000
 1.37.2.1 31-Aug-2002  gehenna catch up with -current.
 1.54.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.54.2.7 01-Apr-2005  skrll Sync with HEAD.
 1.54.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.54.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.54.2.4 19-Oct-2004  skrll Sync with HEAD
 1.54.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.54.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.54.2.1 03-Aug-2004  skrll Sync with HEAD
 1.81.2.4 23-Jul-2004  tron Pull up revision 1.85 (requested by rumble in ticket #682):
KNF some and make printf output a bit nicer.
 1.81.2.3 23-Jul-2004  tron Pull up revision 1.84 (requested by rumble in ticket #682):
Add IP12 stuff. Most bits included are from Steve Rumble.
After this change it is possible to run IP12.
 1.81.2.2 23-Jul-2004  tron Pull up revision 1.83 (requested by rumble in ticket #682):
If argv[1] doesn't exist, don't try to use it.
 1.81.2.1 11-Apr-2004  jmc Pullup rev 1.82 (requested by tsutsui in ticket #122)

Tidy up total/avail memory message as well as other ports.
 1.89.4.2 26-Mar-2005  yamt sync with head.
 1.89.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.89.2.1 29-Apr-2005  kent sync with -current
 1.90.2.2 21-Nov-2005  tron Pull up following revision(s) (requested by tsutsui in ticket #970):
sys/arch/sgimips/sgimips/machdep.c: revision 1.94
Restore missing call to r5k_enable_sdcache(). Its' removal was a thinko
on my part -- the COP0 SC presence test fails on r5k IP22, but
r5k_enable_sdcache() will DTRT regardless.
Pointed out by tsutsui@
 1.90.2.1 21-Nov-2005  tron Pull up following revision(s) (requested by tsutsui in ticket #961):
sys/arch/sgimips/sgimips/machdep.c: revision 1.91
mips_sdcache_forceinv has been removed.
XXX Should we check MIPS3_CONFIG_SE in mips3_cp0_config_read() and
XXX call r5k_enable_sdcache() accordingly here?
 1.93.2.7 04-Feb-2008  yamt sync with head.
 1.93.2.6 07-Dec-2007  yamt sync with head
 1.93.2.5 27-Oct-2007  yamt sync with head.
 1.93.2.4 03-Sep-2007  yamt sync with head.
 1.93.2.3 26-Feb-2007  yamt sync with head.
 1.93.2.2 30-Dec-2006  yamt sync with head.
 1.93.2.1 21-Jun-2006  yamt sync with head.
 1.95.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.95.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.95.8.2 03-Sep-2006  yamt sync with head.
 1.95.8.1 11-Apr-2006  yamt sync with head
 1.95.6.1 22-Apr-2006  simonb Sync with head.
 1.95.4.1 09-Sep-2006  rpaulo sync with head
 1.97.2.3 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.97.2.2 12-Jan-2007  ad Sync with head.
 1.97.2.1 18-Nov-2006  ad Sync with head.
 1.98.2.1 09-Oct-2006  yamt implement splraiseipl/makeiplcookie for sgimips.
 1.106.2.4 17-May-2007  yamt sync with head.
 1.106.2.3 18-Apr-2007  ad - Further adaptations to MIPS for the yamt-idlelwp branch.
- Make curlwp a register variable on MIPS.
 1.106.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.106.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.110.10.2 03-Oct-2007  garbled Sync with HEAD
 1.110.10.1 22-May-2007  matt Update to HEAD.
 1.110.4.1 11-Jul-2007  mjf Sync with head.
 1.110.2.3 03-Dec-2007  ad Sync with HEAD.
 1.110.2.2 09-Oct-2007  ad Sync with head.
 1.110.2.1 27-May-2007  ad Sync with head.
 1.114.12.1 06-Oct-2007  yamt sync with head.
 1.114.10.3 23-Mar-2008  matt sync with HEAD
 1.114.10.2 09-Jan-2008  matt sync with HEAD
 1.114.10.1 06-Nov-2007  matt sync with HEAD
 1.114.8.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.114.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.116.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.116.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.118.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.118.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.118.6.2 02-Jul-2008  mjf Sync with HEAD.
 1.118.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.119.8.1 03-Jul-2008  simonb Sync with head.
 1.119.6.3 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.119.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.119.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.119.4.3 11-Mar-2010  yamt sync with head
 1.119.4.2 19-Aug-2009  yamt sync with head.
 1.119.4.1 04-May-2009  yamt sync with head.
 1.120.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.120.2.1 19-Oct-2008  haad Sync with HEAD.
 1.121.8.7 14-Feb-2012  matt mem_cluster_cnt on mips is now a u_int.
 1.121.8.6 29-Dec-2010  matt Adapt sgimips to the interrupt framework.
 1.121.8.5 21-Mar-2010  cliff mips_vector_init now takes an argument to specify splsw.
NULL specifies use the default 'std_splsw'
 1.121.8.4 01-Feb-2010  matt fix fallout from frame/trapframe merger.
 1.121.8.3 20-Jan-2010  matt Adjust things to the new world order.
 1.121.8.2 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.121.8.1 07-Sep-2009  matt Deal with pcb_context being a label_t
 1.121.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.121.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.121.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.124.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.132.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.133.6.1 05-Mar-2011  bouyer Sync with HEAD
 1.133.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.133.2.1 05-Mar-2011  rmind sync with head
 1.136.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.136.2.1 30-Oct-2012  yamt sync with head
 1.137.2.3 03-Dec-2017  jdolecek update from HEAD
 1.137.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.137.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.138.2.1 18-May-2014  rmind sync with head
 1.140.6.4 28-Aug-2017  skrll Sync with HEAD
 1.140.6.3 05-Feb-2017  skrll Sync with HEAD
 1.140.6.2 05-Dec-2016  skrll Sync with HEAD
 1.140.6.1 22-Sep-2015  skrll Sync with HEAD
 1.141.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.141.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.141.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.143.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.144.6.1 10-Sep-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #1017):

sys/arch/sgimips/conf/INSTALL32_IP2x: revision 1.10
sys/arch/sgimips/stand/boot/Makefile: revision 1.20
sys/arch/sgimips/sgimips/machdep.c: revision 1.146
sys/arch/sgimips/hpc/wdsc.c: revision 1.35
distrib/sgimips/instkernel/Makefile: revision 1.13

Disable misc options to shrink an INSTALL kernel for IP2x.

The ARC BIOS on Indy seems to have ~8MB limit.

Fixes PR port-sgimips/53378 from Naruaki Etomi.
Should be pulled up to netbsd-7 and netbsd-8.

-

Fix build failure without options DDB and with pseudo-device ksyms.
There is a typo for ksyms (NKSYMS vs NKSYM).

Also use consistent "#if NKSYMS" rather than "#if NKSYMS > 0" etc.
and add comments after corresponding #endif for readability.

Fixes PR port-sgimips/53521 from Naruaki Etomi.
Should be pulled up to (at least) netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generat ecoff for old machines.
objcopy(1) was used instead of elf2ecoff(1) since Makefile rev 1.9:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sgimips/stand/boot/Makefile#rev1.9
but it looks ELF binaries generated by recent binutils are too complicated
to convert them to ecoff for old machines by objcopy(1).

Reported by Naruaki Etomi in PR port-sgimips/53519.
Should be pulled up to at least netbsd-8.

-

Fix wdsc(4) probe failure on HPC1.5 machines (Indigo R3k/R4k, IP6/IP10/IP12).

The alignment adjustment code was removed in rev 1.36 for common
mips bus_space changes, but the code was not bus_space related
but used for uint32_t register acccess during probe.

Reported and tested by Naruaki Etomi in PR port-sgimips/53522.
Should be pulled up to netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generate ecoff kernel.

Reported by Naruaki Etomi in PR port-sgimips/53518.

Should be pulled up to netbsd-7 and netbsd-8.
 1.145.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.145.4.1 10-Jun-2019  christos Sync with HEAD
 1.145.2.2 30-Sep-2018  pgoyette Ssync with HEAD
 1.145.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.150.6.1 01-Aug-2021  thorpej Sync with HEAD.
 1.152.4.1 17-Jun-2024  martin Pull up following revision(s) (requested by skrll in ticket #695):

sys/arch/sgimips/sgimips/machdep.c: revision 1.155

sgimips: call mips_vector_init earlier to fix boot.

PR port-sgimips/58269
 1.22 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.21 24-Apr-2021  thorpej branches: 1.21.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.20 20-Feb-2011  matt branches: 1.20.70;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.19 28-Jan-2011  tsutsui Use CFATTACH_DECL_NEW() (no softc).
 1.18 11-Dec-2005  christos branches: 1.18.96; 1.18.100; 1.18.106; 1.18.108;
merge ktrace-lwp.
 1.17 26-Aug-2005  drochner s/locdesc_t/int/g
 1.16 30-Jun-2005  drochner branches: 1.16.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.15 29-Sep-2004  sekiya Use ANSI function declarations.
 1.14 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.13 15-Jul-2003  lukem __KERNEL_RCSID()
 1.12 01-Jan-2003  thorpej branches: 1.12.2;
Use aprint_normal() for cfprint routines.
 1.11 09-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 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 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.6 13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.5 09-Jul-2001  thorpej branches: 1.5.2; 1.5.8;
Count and display the number of CPUs present on the system.
 1.4 08-Jul-2001  thorpej - Use the identifier strings that are fetched by the MI ARC BIOS
code.
- Garbage-collect some non-useful stuff from the mainbus_attach_args.
 1.3 08-Jul-2001  thorpej Use sys/dev/arcbios.
 1.2 11-May-2001  thorpej Expose atoi(). From Rafal K. Boni.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.8;
Initial commit. Needs work.
 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 14-Jun-2000  bouyer file mainbus.c was added on branch thorpej_scsipi on 2000-11-20 20:23:49 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file mainbus.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:44 +0000
 1.5.8.5 03-Jan-2003  thorpej Sync with HEAD.
 1.5.8.4 11-Nov-2002  nathanw Catch up to -current
 1.5.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.5.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.5.8.1 09-Jul-2001  nathanw file mainbus.c was added on branch nathanw_sa on 2002-04-01 07:42:29 +0000
 1.5.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.5.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.12.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.2.4 19-Oct-2004  skrll Sync with HEAD
 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.16.2.1 21-Jun-2006  yamt sync with head.
 1.18.108.2 05-Mar-2011  bouyer Sync with HEAD
 1.18.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.18.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.18.100.1 05-Mar-2011  rmind sync with head
 1.18.96.1 14-Jan-2010  matt device_t, CFATTACH_DECL_NEW, ansify, ...
 1.20.70.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.20.70.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.20.70.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.20.70.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.20.70.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.20.70.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.21.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 21-Nov-2000  soren Same as sys/dev/md_root.c.
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
Initial commit. Needs work.
 1.1.6.3 22-Nov-2000  bouyer 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 14-Jun-2000  bouyer file md_root.c was added on branch thorpej_scsipi on 2000-11-20 20:23:49 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file md_root.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:44 +0000
 1.3 13-Mar-2002  simonb All the mips ports had an identical procfs_machdep.c, so use a common
file under arch/mips/mips.
 1.2 18-Jan-2001  tv branches: 1.2.4; 1.2.8;
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:22:59 +0000
 1.2.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.5 15-Sep-2003  simonb Use common mips generic software interrupt routines.

Changes from Izumi Tsutsui, tested by Havard Eidnes.
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 13-Mar-2002  simonb branches: 1.3.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 19-Nov-2001  soren s/sgi/sgimips/
 1.1 11-May-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.10;
Generic software interrupt implementation, derived from mipsco
implementation.

From Rafal K. Boni.
 1.1.10.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.10.1 11-May-2001  nathanw file softintr.c was added on branch nathanw_sa on 2002-01-08 00:27:32 +0000
 1.1.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.12.1 03-Aug-2004  skrll Sync with HEAD
 1.6 12-Jan-2019  tsutsui Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.5 11-Dec-2005  christos branches: 1.5.164; 1.5.166;
merge ktrace-lwp.
 1.4 29-Sep-2004  sekiya Compile the 64-bit bootloader.
 1.3 13-Mar-2002  simonb branches: 1.3.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.2 21-Nov-2001  thorpej branches: 1.2.2;
Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.1 20-Nov-2001  soren stand Makefile.
 1.2.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 21-Nov-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:48:32 +0000
 1.3.12.1 19-Oct-2004  skrll Sync with HEAD
 1.5.166.1 10-Jun-2019  christos Sync with HEAD
 1.5.164.1 18-Jan-2019  pgoyette Synch with HEAD
 1.25 12-Jan-2019  tsutsui Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.24 08-Apr-2017  christos branches: 1.24.12; 1.24.14;
centralize vers.c building for standalone programs.
 1.23 08-Sep-2016  christos branches: 1.23.2;
Avoid the PIE
 1.22 12-Jan-2014  tsutsui branches: 1.22.6; 1.22.10;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.21 26-Feb-2011  matt branches: 1.21.4; 1.21.14; 1.21.18;
Make sure that sgimips64 can build the O32 bootloaders
 1.20 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.19 24-Jan-2011  joerg Define NOMAN earlier
 1.18 22-Jan-2011  joerg 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.17 14-Dec-2009  matt branches: 1.17.4; 1.17.6; 1.17.8;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.16 15-Mar-2009  tsutsui - use <bsd.klinks.mk> to create MD include dir symlinks
- make sure to remove lib subdirs on clean and distclean target
 1.15 28-Mar-2008  tsutsui branches: 1.15.4; 1.15.12; 1.15.18; 1.15.22;
Enable warning options.
 1.14 23-Feb-2008  tsutsui - use bootprog_name[] generated by sys/conf/newvers_stand.sh
- constify, KNF
- fix bootloader names in comment
 1.13 11-Dec-2005  christos branches: 1.13.50; 1.13.70; 1.13.74;
merge ktrace-lwp.
 1.12 17-Nov-2003  sekiya branches: 1.12.16;
Rationalize the machine-links creation mechanism.
 1.11 11-Nov-2003  sekiya Rework the boot loader:
* remove dead code,
* streamline kernel selection logic,
* various small bugfixes.
 1.10 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.9 08-Oct-2003  simonb Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
 1.8 23-Dec-2002  pooka branches: 1.8.2;
also create boot.ip32 with the entry point set to the IP32 load address

from Chris Sekiya
 1.7 10-Nov-2002  thorpej Add "-mno-abicalls" to AFLAGS. Add "-ffreestanding -msoft-float" to
CFLAGS.
 1.6 20-Dec-2001  thorpej branches: 1.6.2;
Add -Dsgimips to CPPFLAGS.
 1.5 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.4 22-Nov-2001  soren Nuke cleandir target override.
 1.3 22-Nov-2001  soren Note kernel load adress change.
 1.2 22-Nov-2001  thorpej - Clean up the bootloader Makefiles somewhat.
- Build an ECOFF version of the bootloader as "boot". As a temporary
measure (due to a bug in libbfd which has not yet been fixed, but
for which a work-around exists as a patch), install and ELF version
of the bootload as well as "boot.elf". "boot.elf" will go away once
the toolchain issue is resolved.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 20-Dec-2001  thorpej file Makefile.booters was added on branch kqueue on 2002-01-10 19:48:33 +0000
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.16.1 27-Feb-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.15.22.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.15.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.15.4.2 11-Mar-2010  yamt sync with head
 1.15.4.1 04-May-2009  yamt sync with head.
 1.17.8.2 05-Mar-2011  bouyer Sync with HEAD
 1.17.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.17.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.4.1 05-Mar-2011  rmind sync with head
 1.21.18.1 18-May-2014  rmind sync with head
 1.21.14.2 03-Dec-2017  jdolecek update from HEAD
 1.21.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.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.22.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.22.6.2 28-Aug-2017  skrll Sync with HEAD
 1.22.6.1 05-Oct-2016  skrll Sync with HEAD
 1.23.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.24.14.1 10-Jun-2019  christos Sync with HEAD
 1.24.12.1 18-Jan-2019  pgoyette Synch with HEAD
 1.4 15-Apr-2021  mrg more -fcommon for boot programs.
 1.3 02-Jan-2019  tsutsui branches: 1.3.14;
Allow build in boot64 without installed DESTDIR.
 1.2 08-Sep-2016  christos branches: 1.2.14; 1.2.16;
Avoid the PIE
 1.1 21-Nov-2001  soren branches: 1.1.2; 1.1.168; 1.1.188;
Install loader in /usr/mdec.
 1.1.188.1 05-Oct-2016  skrll Sync with HEAD
 1.1.168.1 03-Dec-2017  jdolecek update from HEAD
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Nov-2001  thorpej file Makefile.inc was added on branch kqueue on 2002-01-10 19:48:33 +0000
 1.2.16.1 10-Jun-2019  christos Sync with HEAD
 1.2.14.1 18-Jan-2019  pgoyette Synch with HEAD
 1.3.14.1 17-Apr-2021  thorpej Sync with HEAD.
 1.22 29-Jun-2024  rin sgimips: stand: Switch to libsa/getopt, NFCI
 1.21 01-Jan-2019  christos ELF2ECOFF -> MIPS_ELF2ECOFF
 1.20 02-Sep-2018  tsutsui Use elf2ecoff(1) rather than objcopy(1) to generat ecoff for old machines.

objcopy(1) was used instead of elf2ecoff(1) since Makefile rev 1.9:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sgimips/stand/boot/Makefile#rev1.9
but it looks ELF binaries generated by recent binutils are too complicated
to convert them to ecoff for old machines by objcopy(1).

Reported by Naruaki Etomi in PR port-sgimips/53519.
Should be pulled up to at least netbsd-8.
 1.19 26-Feb-2011  matt branches: 1.19.30; 1.19.48; 1.19.54; 1.19.56;
Make sure that sgimips64 can build the O32 bootloaders
 1.18 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.17 27-May-2010  dholland branches: 1.17.2; 1.17.4;
Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.
 1.16 16-Dec-2009  matt branches: 1.16.2; 1.16.4;
Fix typo (missing -)
 1.15 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.14 15-Mar-2009  tsutsui - use <bsd.klinks.mk> to create MD include dir symlinks
- make sure to remove lib subdirs on clean and distclean target
 1.13 23-Feb-2008  tsutsui branches: 1.13.4; 1.13.12; 1.13.18; 1.13.22;
- preserver non-stripped boot binaries
- use ${.TARGET}
 1.12 11-Dec-2005  christos branches: 1.12.50; 1.12.70; 1.12.74;
merge ktrace-lwp.
 1.11 09-Sep-2005  tsutsui Link ip2xboot as OMAGIC by -N option for ld(1) as well as ip3xboot.
Tested by sekiya.
 1.10 23-Apr-2005  tsutsui branches: 1.10.2;
Link ip3xboot as OMAGIC by -N option for ld(1) so that the firmware on O2
can load it again.
 1.9 01-Mar-2005  sekiya branches: 1.9.2;
Replace elf2ecoff with objcopy for ECOFF bootloader creation. Fix a comment
typo while we're here.
 1.8 13-Nov-2003  sekiya branches: 1.8.8; 1.8.10;
bootloader targets have changed, which confused the install rules.
 1.7 13-Nov-2003  sekiya More bootloader changes:

* if loading from cdrom, assume we're performing an install and
fix up bootpath/kernel to load the proper install kernel.
* maximum filename length in volume header is eight characters.
Change boot.elf to ip2xboot, boot.ip32 to ip3xboot, and boot
to aoutboot (which matches kernel naming scheme as well).
 1.6 11-Nov-2003  sekiya Add getopt.c
 1.5 23-Dec-2002  pooka branches: 1.5.2;
also create boot.ip32 with the entry point set to the IP32 load address

from Chris Sekiya
 1.4 12-Jul-2002  rafal Fix PR port-sgimips/17568: the PROM on early Indigo2 machines did not like
the ECOFF version of boot produced by `objcopy'. Using elf2ecoff make it
work, so use that instead. Also, don't bother stripping the bootblocks on
install (as that confuses strip, at least for the ECOFF one, and since the
build already strips them).
 1.3 22-Nov-2001  thorpej branches: 1.3.2; 1.3.10; 1.3.12;
- Clean up the bootloader Makefiles somewhat.
- Build an ECOFF version of the bootloader as "boot". As a temporary
measure (due to a bug in libbfd which has not yet been fixed, but
for which a work-around exists as a patch), install and ELF version
of the bootload as well as "boot.elf". "boot.elf" will go away once
the toolchain issue is resolved.
 1.2 21-Nov-2001  thorpej - Adjust bootinfo to work sanely in an ARCS world, and pass some
info along to the kernel (currently just the symbol table info).
- Don't bother with the startprog dance; we don't need to do anything
special, here, so just call the entry point directly.
- A bunch of random cleanup.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.3.12.1 15-Jul-2002  thorpej pullup-1-6 ticket #494 (rafal).

Original log message:
Fix PR port-sgimips/17568: the PROM on early Indigo2 machines did not like
the ECOFF version of boot produced by `objcopy'. Using elf2ecoff make it
work, so use that instead. Also, don't bother stripping the bootblocks on
install (as that confuses strip, at least for the ECOFF one, and since the
build already strips them).
 1.3.10.1 17-Jul-2002  gehenna catch up with -current.
 1.3.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 22-Nov-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:48:33 +0000
 1.5.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 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.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.8.1 29-Apr-2005  kent sync with -current
 1.9.2.2 13-Sep-2005  tron Pull up following revision(s) (requested by tsutsui in ticket #762):
sys/arch/sgimips/stand/boot/Makefile: revision 1.11
Link ip2xboot as OMAGIC by -N option for ld(1) as well as ip3xboot.
Tested by sekiya.
 1.9.2.1 13-Sep-2005  tron Pull up following revision(s) (requested by tsutsui in ticket #762):
sys/arch/sgimips/stand/boot/Makefile: revision 1.10
Link ip3xboot as OMAGIC by -N option for ld(1) so that the firmware on O2
can load it again.
 1.10.2.2 27-Feb-2008  yamt sync with head.
 1.10.2.1 21-Jun-2006  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.13.22.1 10-Sep-2009  matt Add preliminary LP64 support for sgimips
 1.13.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.13.4.3 11-Aug-2010  yamt sync with head.
 1.13.4.2 11-Mar-2010  yamt sync with head
 1.13.4.1 04-May-2009  yamt sync with head.
 1.16.4.2 05-Mar-2011  rmind sync with head
 1.16.4.1 30-May-2010  rmind sync with head
 1.16.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.17.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.17.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.56.1 10-Jun-2019  christos Sync with HEAD
 1.19.54.2 18-Jan-2019  pgoyette Synch with HEAD
 1.19.54.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.19.48.1 10-Sep-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #1017):

sys/arch/sgimips/conf/INSTALL32_IP2x: revision 1.10
sys/arch/sgimips/stand/boot/Makefile: revision 1.20
sys/arch/sgimips/sgimips/machdep.c: revision 1.146
sys/arch/sgimips/hpc/wdsc.c: revision 1.35
distrib/sgimips/instkernel/Makefile: revision 1.13

Disable misc options to shrink an INSTALL kernel for IP2x.

The ARC BIOS on Indy seems to have ~8MB limit.

Fixes PR port-sgimips/53378 from Naruaki Etomi.
Should be pulled up to netbsd-7 and netbsd-8.

-

Fix build failure without options DDB and with pseudo-device ksyms.
There is a typo for ksyms (NKSYMS vs NKSYM).

Also use consistent "#if NKSYMS" rather than "#if NKSYMS > 0" etc.
and add comments after corresponding #endif for readability.

Fixes PR port-sgimips/53521 from Naruaki Etomi.
Should be pulled up to (at least) netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generat ecoff for old machines.
objcopy(1) was used instead of elf2ecoff(1) since Makefile rev 1.9:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sgimips/stand/boot/Makefile#rev1.9
but it looks ELF binaries generated by recent binutils are too complicated
to convert them to ecoff for old machines by objcopy(1).

Reported by Naruaki Etomi in PR port-sgimips/53519.
Should be pulled up to at least netbsd-8.

-

Fix wdsc(4) probe failure on HPC1.5 machines (Indigo R3k/R4k, IP6/IP10/IP12).

The alignment adjustment code was removed in rev 1.36 for common
mips bus_space changes, but the code was not bus_space related
but used for uint32_t register acccess during probe.

Reported and tested by Naruaki Etomi in PR port-sgimips/53522.
Should be pulled up to netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generate ecoff kernel.

Reported by Naruaki Etomi in PR port-sgimips/53518.

Should be pulled up to netbsd-7 and netbsd-8.
 1.19.30.1 30-Oct-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #1637):

sys/arch/sgimips/conf/INSTALL32_IP2x: revision 1.10
sys/arch/sgimips/stand/boot/Makefile: revision 1.20
distrib/sgimips/instkernel/Makefile: revision 1.13

Disable misc options to shrink an INSTALL kernel for IP2x.

The ARC BIOS on Indy seems to have ~8MB limit.

Fixes PR port-sgimips/53378 from Naruaki Etomi.
Should be pulled up to netbsd-7 and netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generat ecoff for old machines.
objcopy(1) was used instead of elf2ecoff(1) since Makefile rev 1.9:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sgimips/stand/boot/Makefile#rev1.9

but it looks ELF binaries generated by recent binutils are too complicated
to convert them to ecoff for old machines by objcopy(1).

Reported by Naruaki Etomi in PR port-sgimips/53519.

Should be pulled up to at least netbsd-8.

-

Use elf2ecoff(1) rather than objcopy(1) to generate ecoff kernel.

Reported by Naruaki Etomi in PR port-sgimips/53518.
Should be pulled up to netbsd-7 and netbsd-8.
 1.6 08-Aug-2008  tsutsui Bump BOOTINFO_MAGIC to prevent old kernels (including netbsd-4) crashing
when bootinfo data is passed from newer bootloaders.

Note old bootloaders can still load newer kernels.
 1.5 28-Mar-2008  tsutsui branches: 1.5.4; 1.5.6; 1.5.10;
Adjust boot device detection code to make netboot work properly:
- make a bootloader pass bootpath which includes device path on ARC BIOS
via BTINFO_BOOTPATH
- make a kernel use BTINFO_BOOTPATH in bootinfo to see boot device first,
then check argv[0] passed from ARC BIOS if there is no valid bootinfo
- check OSLoadPartition variables in the ARCBIOS environment and whole
argv[] arguments for IP12
- initialize mach_type before it's referred
- bump boot version

Tested on IP32 with various kernel/bootloader combinations.
 1.4 23-Feb-2008  tsutsui Bump version for working bootinfo support.
 1.3 17-Mar-2003  rafal branches: 1.3.18; 1.3.80; 1.3.100; 1.3.104;
Update for devopen() change.
 1.2 21-Nov-2001  thorpej branches: 1.2.2;
- Adjust bootinfo to work sanely in an ARCS world, and pass some
info along to the kernel (currently just the symbol table info).
- Don't bother with the startprog dance; we don't need to do anything
special, here, so just call the entry point directly.
- A bunch of random cleanup.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 21-Nov-2001  thorpej file version was added on branch kqueue on 2002-01-10 19:48:33 +0000
 1.3.104.2 28-Sep-2008  mjf Sync with HEAD.
 1.3.104.1 03-Apr-2008  mjf Sync with HEAD.
 1.3.100.1 24-Mar-2008  keiichi sync with head.
 1.3.80.1 23-Mar-2008  matt sync with HEAD
 1.3.18.1 27-Feb-2008  yamt sync with head.
 1.5.10.1 19-Oct-2008  haad Sync with HEAD.
 1.5.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.4.1 04-May-2009  yamt sync with head.
 1.15 29-Jun-2024  rin sgimips: stand: Switch to libsa/getopt, NFCI
 1.14 08-Apr-2017  christos centralize vers.c building for standalone programs.
 1.13 08-Sep-2016  christos branches: 1.13.2;
Avoid the PIE
 1.12 16-Jan-2014  christos branches: 1.12.6; 1.12.10;
eliminate use of bsd.sys.mk from Makefiles
 1.11 25-Feb-2011  matt branches: 1.11.4; 1.11.14; 1.11.18;
Don't rely on having a mips64eb toolchain.
 1.10 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.9 23-Jan-2011  joerg Define NOMAN earlier.
 1.8 22-Jan-2011  joerg 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.7 27-May-2010  dholland branches: 1.7.2; 1.7.4;
Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.
 1.6 15-Mar-2009  tsutsui branches: 1.6.2; 1.6.4;
- use <bsd.klinks.mk> to create MD include dir symlinks
- make sure to remove lib subdirs on clean and distclean target
 1.5 23-Feb-2008  tsutsui branches: 1.5.4; 1.5.12; 1.5.18;
- use bootprog_name[] generated by sys/conf/newvers_stand.sh
- constify, KNF
- fix bootloader names in comment
 1.4 23-Feb-2008  tsutsui Use ${.TARGET}.
 1.3 11-Dec-2005  christos branches: 1.3.50; 1.3.70; 1.3.74;
merge ktrace-lwp.
 1.2 14-Jan-2005  skrll branches: 1.2.10;
Update the emulation names after recent binutils changes.
 1.1 11-Aug-2004  sekiya branches: 1.1.2;
Add 64-bit ABI bootloader (for IP30). Needs a slightly modified toolchain
and a 64-bit-clean libkern.a; once those bits are committed, this should be
100% good to go.
 1.1.2.5 17-Jan-2005  skrll Sync with HEAD.
 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 12-Aug-2004  skrll Sync with HEAD.
 1.1.2.1 11-Aug-2004  skrll file Makefile was added on branch ktrace-lwp on 2004-08-12 11:41:14 +0000
 1.2.10.1 27-Feb-2008  yamt sync with head.
 1.3.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.3.70.1 24-Mar-2008  keiichi sync with head.
 1.3.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.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.4.2 11-Aug-2010  yamt sync with head.
 1.5.4.1 04-May-2009  yamt sync with head.
 1.6.4.2 05-Mar-2011  rmind sync with head
 1.6.4.1 30-May-2010  rmind sync with head
 1.6.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.7.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.7.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.7.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.18.1 18-May-2014  rmind sync with head
 1.11.14.2 03-Dec-2017  jdolecek update from HEAD
 1.11.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.12.6.2 28-Aug-2017  skrll Sync with HEAD
 1.12.6.1 05-Oct-2016  skrll Sync with HEAD
 1.13.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 11-Aug-2004  sekiya branches: 1.1.2;
Add 64-bit ABI bootloader (for IP30). Needs a slightly modified toolchain
and a 64-bit-clean libkern.a; once those bits are committed, this should be
100% good to go.
 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 12-Aug-2004  skrll Sync with HEAD.
 1.1.2.1 11-Aug-2004  skrll file version was added on branch ktrace-lwp on 2004-08-12 11:41:14 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file Makefile was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file Makefile was added on branch pgoyette-compat on 2019-01-18 08:50:22 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file version was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file version was added on branch pgoyette-compat on 2019-01-18 08:50:22 +0000
 1.20 26-Mar-2014  christos kill sprintf.
 1.19 20-Feb-2011  matt branches: 1.19.4; 1.19.14; 1.19.18;
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.18 22-Jan-2011  joerg 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.17 28-Apr-2008  martin branches: 1.17.22; 1.17.28; 1.17.30;
Remove clause 3 and 4 from TNF licenses
 1.16 28-Mar-2008  tsutsui branches: 1.16.2; 1.16.4;
Adjust boot device detection code to make netboot work properly:
- make a bootloader pass bootpath which includes device path on ARC BIOS
via BTINFO_BOOTPATH
- make a kernel use BTINFO_BOOTPATH in bootinfo to see boot device first,
then check argv[0] passed from ARC BIOS if there is no valid bootinfo
- check OSLoadPartition variables in the ARCBIOS environment and whole
argv[] arguments for IP12
- initialize mach_type before it's referred
- bump boot version

Tested on IP32 with various kernel/bootloader combinations.
 1.15 23-Feb-2008  tsutsui - use bootprog_name[] generated by sys/conf/newvers_stand.sh
- constify, KNF
- fix bootloader names in comment
 1.14 23-Feb-2008  tsutsui Fix NULL pointer dereference on CD boot.
Reported by Martin Husemann on port-sgimips.
 1.13 26-Jan-2008  tsutsui branches: 1.13.2; 1.13.6;
Replace bootinfo stuff on sgimips (which has been disabled in bootloader)
with ones used on arc (which has been working for a year) and
enable it in bootloader. Tested on IP32.
 1.12 11-Dec-2005  christos branches: 1.12.50; 1.12.56;
merge ktrace-lwp.
 1.11 03-Jun-2005  martin branches: 1.11.2;
Constify
 1.10 03-Jan-2004  sekiya bootinfo is problematic on ip2x under certain circumstances. Disable for now.
 1.9 30-Dec-2003  sekiya Don't flush caches here. Fixes crash on IP20 (which apparently occurs only
with beta Blackjack boards that incorporate ARCS V1).
 1.8 13-Nov-2003  sekiya libsa's iso9660 routines don't handle rockridge. Alter installation kernel
fixup routines accordingly -- we'll use "ip2x" and "ip3x" for install kernel
names rather than "netbsd-INSTALL32_IPxy".
 1.7 13-Nov-2003  sekiya loadfile truth check should be >=0, not >= 1.
 1.6 13-Nov-2003  sekiya More bootloader changes:

* if loading from cdrom, assume we're performing an install and
fix up bootpath/kernel to load the proper install kernel.
* maximum filename length in volume header is eight characters.
Change boot.elf to ip2xboot, boot.ip32 to ip3xboot, and boot
to aoutboot (which matches kernel naming scheme as well).
 1.5 11-Nov-2003  sekiya Rework the boot loader:
* remove dead code,
* streamline kernel selection logic,
* various small bugfixes.
 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 21-Nov-2001  thorpej branches: 1.3.2; 1.3.18;
- Adjust bootinfo to work sanely in an ARCS world, and pass some
info along to the kernel (currently just the symbol table info).
- Don't bother with the startprog dance; we don't need to do anything
special, here, so just call the entry point directly.
- A bunch of random cleanup.
 1.2 21-Nov-2001  soren s/pmax/sgimips/ in comments.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.3.18.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.18.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 21-Nov-2001  thorpej file boot.c was added on branch kqueue on 2002-01-10 19:48:34 +0000
 1.11.2.2 27-Feb-2008  yamt sync with head.
 1.11.2.1 04-Feb-2008  yamt sync with head.
 1.12.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.12.50.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.16.4.1 16-May-2008  yamt sync with head.
 1.16.2.1 18-May-2008  yamt sync with head.
 1.17.30.2 05-Mar-2011  bouyer Sync with HEAD
 1.17.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.17.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.22.1 05-Mar-2011  rmind sync with head
 1.19.18.1 18-May-2014  rmind sync with head
 1.19.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 26-Jan-2008  tsutsui branches: 1.3.6; 1.3.8; 1.3.10;
Replace bootinfo stuff on sgimips (which has been disabled in bootloader)
with ones used on arc (which has been working for a year) and
enable it in bootloader. Tested on IP32.
 1.2 21-Nov-2001  thorpej branches: 1.2.2; 1.2.34; 1.2.96; 1.2.102;
- Adjust bootinfo to work sanely in an ARCS world, and pass some
info along to the kernel (currently just the symbol table info).
- Don't bother with the startprog dance; we don't need to do anything
special, here, so just call the entry point directly.
- A bunch of random cleanup.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.2.102.1 18-Feb-2008  mjf Sync with HEAD.
 1.2.96.1 23-Mar-2008  matt sync with HEAD
 1.2.34.1 04-Feb-2008  yamt sync with head.
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 21-Nov-2001  thorpej file bootinfo.c was added on branch kqueue on 2002-01-10 19:48:34 +0000
 1.3.10.1 16-May-2008  yamt sync with head.
 1.3.8.1 18-May-2008  yamt sync with head.
 1.3.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 26-Jan-2008  tsutsui branches: 1.3.6; 1.3.8; 1.3.10;
Replace bootinfo stuff on sgimips (which has been disabled in bootloader)
with ones used on arc (which has been working for a year) and
enable it in bootloader. Tested on IP32.
 1.2 21-Nov-2001  thorpej branches: 1.2.2; 1.2.34; 1.2.96; 1.2.102;
- Adjust bootinfo to work sanely in an ARCS world, and pass some
info along to the kernel (currently just the symbol table info).
- Don't bother with the startprog dance; we don't need to do anything
special, here, so just call the entry point directly.
- A bunch of random cleanup.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.2.102.1 18-Feb-2008  mjf Sync with HEAD.
 1.2.96.1 23-Mar-2008  matt sync with HEAD
 1.2.34.1 04-Feb-2008  yamt sync with head.
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 21-Nov-2001  thorpej file bootinfo.h was added on branch kqueue on 2002-01-10 19:48:34 +0000
 1.3.10.1 16-May-2008  yamt sync with head.
 1.3.8.1 18-May-2008  yamt sync with head.
 1.3.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 22-Jan-2011  joerg 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.4 28-Apr-2008  martin branches: 1.4.22; 1.4.28; 1.4.30;
Remove clause 3 and 4 from TNF licenses
 1.3 23-Feb-2008  tsutsui branches: 1.3.2; 1.3.4;
- use bootprog_name[] generated by sys/conf/newvers_stand.sh
- constify, KNF
- fix bootloader names in comment
 1.2 21-Nov-2001  thorpej branches: 1.2.2; 1.2.34; 1.2.96; 1.2.116; 1.2.120;
- Adjust bootinfo to work sanely in an ARCS world, and pass some
info along to the kernel (currently just the symbol table info).
- Don't bother with the startprog dance; we don't need to do anything
special, here, so just call the entry point directly.
- A bunch of random cleanup.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.2.120.2 02-Jun-2008  mjf Sync with HEAD.
 1.2.120.1 03-Apr-2008  mjf Sync with HEAD.
 1.2.116.1 24-Mar-2008  keiichi sync with head.
 1.2.96.1 23-Mar-2008  matt sync with HEAD
 1.2.34.1 27-Feb-2008  yamt sync with head.
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 21-Nov-2001  thorpej file common.h was added on branch kqueue on 2002-01-10 19:48:34 +0000
 1.3.4.1 16-May-2008  yamt sync with head.
 1.3.2.1 18-May-2008  yamt sync with head.
 1.4.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.4.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.22.1 05-Mar-2011  rmind sync with head
 1.6 15-Dec-2007  tsutsui - enable both ffsv1 and ffsv2
- use __arraycount()
 1.5 11-Dec-2005  christos branches: 1.5.50; 1.5.60; 1.5.64;
merge ktrace-lwp.
 1.4 23-Jun-2005  junyoung branches: 1.4.2;
Use FS_OPS() macro.
 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 23-Feb-2003  simonb branches: 1.2.2;
Update for LFSv2 support. Ports that have "bootxx_lfs"-style
bootblocks currently only support LFSv2, but the second level
"boot" program supports both LFS versions.
 1.1 21-Nov-2001  thorpej branches: 1.1.2;
Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Nov-2001  thorpej file conf.c was added on branch kqueue on 2002-01-10 19:48:35 +0000
 1.2.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.2.1 21-Jan-2008  yamt sync with head
 1.5.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.5.60.1 26-Dec-2007  ad Sync with head.
 1.5.50.1 09-Jan-2008  matt sync with HEAD
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 21-Apr-2005  tsutsui Cosmetic changes to reduce diffs from arc.
 1.4 28-Sep-2003  tsutsui branches: 1.4.8;
Fix typo. From Christopher SEKIYA.
 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 17-Mar-2003  rafal branches: 1.2.2;
If the boot device starts with a PCI bus spec, skip over that when looking
for a boot device type; this gets the boot.ip32 booting a kernel off disk.

While here remove some unrolled string compares in favor of strncmp() to
make code more readable.
 1.1 21-Nov-2001  thorpej branches: 1.1.2;
Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Nov-2001  thorpej file devopen.c was added on branch kqueue on 2002-01-10 19:48:35 +0000
 1.2.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.8.1 29-Apr-2005  kent sync with -current
 1.12 14-Feb-2016  dholland Add missing va_list, from David Binderman in PR 50796.

XXX: this file and arch/arc/stand/boot/disk.c are cutpaste clones.
 1.11 17-Jul-2011  joerg branches: 1.11.12; 1.11.30;
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.10 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.9 25-Jan-2006  christos branches: 1.9.98; 1.9.104; 1.9.106;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.8 11-Dec-2005  christos branches: 1.8.2;
merge ktrace-lwp.
 1.7 21-Apr-2005  tsutsui branches: 1.7.2;
Cosmetic changes to reduce diffs from arc.
 1.6 18-Apr-2005  tsutsui - Use u_long or long rather than paddr_t for ARCBIOS function prototypes
as per the ARC specification. They are actually 64bit on MIPS64 based
machines and our paddr_t is not equal to pointer size.
(arc is ILP32 but has 64bit paddr_t)
- While here, change some unsigned long to u_long for consistency.
 1.5 04-Oct-2004  he branches: 1.5.4;
Track the change of int -> paddr_t for the arguments to the ARCBIOS
routines.
 1.4 11-Nov-2003  sekiya Remove unused variables.
 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 21-Nov-2001  thorpej branches: 1.2.2; 1.2.18;
- Adjust bootinfo to work sanely in an ARCS world, and pass some
info along to the kernel (currently just the symbol table info).
- Don't bother with the startprog dance; we don't need to do anything
special, here, so just call the entry point directly.
- A bunch of random cleanup.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.2.18.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.18.4 19-Oct-2004  skrll Sync with HEAD
 1.2.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.18.1 03-Aug-2004  skrll Sync with HEAD
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 21-Nov-2001  thorpej file disk.c was added on branch kqueue on 2002-01-10 19:48:35 +0000
 1.5.4.1 29-Apr-2005  kent sync with -current
 1.7.2.1 21-Jun-2006  yamt sync with head.
 1.8.2.1 01-Feb-2006  yamt sync with head.
 1.9.106.1 05-Mar-2011  bouyer Sync with HEAD
 1.9.104.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.98.1 05-Mar-2011  rmind sync with head
 1.11.30.1 19-Mar-2016  skrll Sync with HEAD
 1.11.12.1 03-Dec-2017  jdolecek update from HEAD
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 21-Apr-2005  tsutsui Cosmetic changes to reduce diffs from arc.
 1.2 08-Feb-2004  sekiya branches: 1.2.8;
de-__P.
 1.1 21-Nov-2001  thorpej branches: 1.1.2; 1.1.18;
Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.1.18.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.18.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Nov-2001  thorpej file disk.h was added on branch kqueue on 2002-01-10 19:48:35 +0000
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.8 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.7 28-Apr-2008  martin branches: 1.7.22; 1.7.28; 1.7.30;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.74; 1.6.76; 1.6.78;
merge ktrace-lwp.
 1.5 21-Apr-2005  tsutsui Cosmetic changes to reduce diffs from arc.
 1.4 18-Apr-2005  tsutsui - Use u_long or long rather than paddr_t for ARCBIOS function prototypes
as per the ARC specification. They are actually 64bit on MIPS64 based
machines and our paddr_t is not equal to pointer size.
(arc is ILP32 but has 64bit paddr_t)
- While here, change some unsigned long to u_long for consistency.
 1.3 04-Oct-2004  he branches: 1.3.4;
Track the change of int -> paddr_t for the arguments to the ARCBIOS
routines.
 1.2 21-May-2002  rafal branches: 1.2.8;
Make sure to read from stdin, not stdout. From Scott Taylor.
 1.1 21-Nov-2001  thorpej branches: 1.1.2; 1.1.10;
Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.1.10.1 30-May-2002  gehenna Catch up with -current.
 1.1.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Nov-2001  thorpej file getchar.c was added on branch kqueue on 2002-01-10 19:48:35 +0000
 1.2.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.8.1 19-Oct-2004  skrll Sync with HEAD
 1.3.4.1 29-Apr-2005  kent sync with -current
 1.6.78.1 16-May-2008  yamt sync with head.
 1.6.76.1 18-May-2008  yamt sync with head.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.30.1 05-Mar-2011  bouyer Sync with HEAD
 1.7.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.22.1 05-Mar-2011  rmind sync with head
 1.4 29-Jun-2024  rin sgimips: stand: Switch to libsa/getopt, NFCI
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 21-Apr-2005  tsutsui Cosmetic changes to reduce diffs from arc.
 1.1 11-Nov-2003  sekiya branches: 1.1.4; 1.1.10;
Add getopt.c
 1.1.10.1 29-Apr-2005  kent sync with -current
 1.1.4.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 11-Nov-2003  skrll file getopt.c was added on branch ktrace-lwp on 2004-08-03 10:40:15 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_autoconf.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_autoconf.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_boot.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_boot.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_conf.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_conf.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_cons.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_cons.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_cons.h was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_cons.h was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_devopen.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_devopen.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_disk.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_disk.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_machdep.h was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_machdep.h was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_parse.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_parse.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_prf.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_prf.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.2 09-Feb-2024  andvar fix spelling mistakes, mainly in comments and log messages.
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_scsi.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_scsi.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_scsicmd.h was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_scsicmd.h was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_scsictl.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_scsictl.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_scsireg.h was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_scsireg.h was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_scsivar.h was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_scsivar.h was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_start.S was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_start.S was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.2 03-May-2024  andvar s/inerttupts/interrupts/ in comments.
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_zs.c was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_zs.c was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.1 12-Jan-2019  tsutsui branches: 1.1.2; 1.1.6;
Import irisboot, yet another bootloader for pre-ARC sgimips machines.

This bootloader adds support for Personal IRIS 4D/25 (IP6),
Personal IRIS 4D/35 (IP12), and Indigo R3000 (IP12) etc. and
optionally supports R4000 Indy and Indigo R4000 (ARCS machine)
using standalone WD33C93 SCSI driver.

Submitted by Naruaki Etomi via PR port-sgimips/53539,
and reviewed by tsutsui@. See also port-sgimips@ ML thread:
https://mail-index.netbsd.org/port-sgimips/2018/09/16/msg000778.html
 1.1.6.2 10-Jun-2019  christos Sync with HEAD
 1.1.6.1 12-Jan-2019  christos file iris_zs.h was added on branch phil-wifi on 2019-06-10 22:06:44 +0000
 1.1.2.2 18-Jan-2019  pgoyette Synch with HEAD
 1.1.2.1 12-Jan-2019  pgoyette file iris_zs.h was added on branch pgoyette-compat on 2019-01-18 08:50:23 +0000
 1.8 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.7 28-Apr-2008  martin branches: 1.7.22; 1.7.28; 1.7.30;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.74; 1.6.76; 1.6.78;
merge ktrace-lwp.
 1.5 21-Apr-2005  tsutsui Cosmetic changes to reduce diffs from arc.
 1.4 18-Apr-2005  tsutsui - Use u_long or long rather than paddr_t for ARCBIOS function prototypes
as per the ARC specification. They are actually 64bit on MIPS64 based
machines and our paddr_t is not equal to pointer size.
(arc is ILP32 but has 64bit paddr_t)
- While here, change some unsigned long to u_long for consistency.
 1.3 04-Oct-2004  he branches: 1.3.4;
Track the change of int -> paddr_t for the arguments to the ARCBIOS
routines.
 1.2 13-Mar-2002  simonb branches: 1.2.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 21-Nov-2001  thorpej branches: 1.1.2;
Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Nov-2001  thorpej file putchar.c was added on branch kqueue on 2002-01-10 19:48:35 +0000
 1.2.12.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.12.1 19-Oct-2004  skrll Sync with HEAD
 1.3.4.1 29-Apr-2005  kent sync with -current
 1.6.78.1 16-May-2008  yamt sync with head.
 1.6.76.1 18-May-2008  yamt sync with head.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.30.1 05-Mar-2011  bouyer Sync with HEAD
 1.7.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.22.1 05-Mar-2011  rmind sync with head
 1.6 20-Feb-2011  matt Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework
Deal with arcbios calls being O32 and kernels being N32/N64.
Need to save/restore T8 across arcbios calls.
 1.5 28-Apr-2008  martin branches: 1.5.22; 1.5.28; 1.5.30;
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 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 13-Mar-2002  simonb branches: 1.2.12;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1 21-Nov-2001  thorpej branches: 1.1.2;
Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Nov-2001  thorpej file start.S was added on branch kqueue on 2002-01-10 19:48:36 +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.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.30.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.22.1 05-Mar-2011  rmind sync with 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 11-Aug-2004  sekiya branches: 1.1.2;
Start routine for 64-bit ABI.
 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 12-Aug-2004  skrll Sync with HEAD.
 1.1.2.1 11-Aug-2004  skrll file start64.S was added on branch ktrace-lwp on 2004-08-12 11:41:14 +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.2 21-Nov-2001  thorpej - Adjust bootinfo to work sanely in an ARCS world, and pass some
info along to the kernel (currently just the symbol table info).
- Don't bother with the startprog dance; we don't need to do anything
special, here, so just call the entry point directly.
- A bunch of random cleanup.
 1.1 21-Nov-2001  thorpej Initial cut at a bootloader for NetBSD/sgimips, by Michael Hitch.
 1.6 23-Dec-2005  ginsbach Fix the build of sgivol as a host tool on a platform without libutil,
e.g. MacOS X. Identical to method used in the disklabel(8) Makefile.
 1.5 13-Dec-2002  lukem branches: 1.5.22;
minor delint
 1.4 12-Dec-2001  tv branches: 1.4.2;
MKfoo=no -> NOfoo
 1.3 21-Nov-2001  soren Install loader in /usr/mdec.
 1.2 20-Nov-2001  thorpej - General code cleanup (and enable warnings).
- It's perfectly legal to have an 8 byte volume filename; the trailing
NUL is not required in this case.
- Default the partition type to "4.2BSD", not "EFS".
 1.1 20-Nov-2001  soren Michael Hitch's volume header tool.
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:48:36 +0000
 1.5.22.1 21-Jun-2006  yamt sync with head.
 1.22 13-May-2024  msaitoh ficticious -> fictitious in comment.
 1.21 28-Mar-2014  christos use err
 1.20 26-Mar-2014  christos kill sprintf.
 1.19 27-Jun-2013  christos branches: 1.19.2;
close fp
http://M00nBSD.net/ae123a9bae03f7dde5c6d654412daf5a.html
 1.18 03-Aug-2008  rumble branches: 1.18.28; 1.18.38;
Add -m to usage and do not simply use strcmp to compare names as the volhdr
name is not necessarily nul-terminated.
 1.17 03-Aug-2008  rumble Add -m to move (rename) files in the volume header. While here, remove
some magic constants and fix some space-limited printfs.
 1.16 28-Apr-2008  martin branches: 1.16.2; 1.16.6;
Remove clause 3 and 4 from TNF licenses
 1.15 30-Dec-2006  rumble branches: 1.15.44; 1.15.46; 1.15.48;
Remove braces from non-optional arguments in usage.
 1.14 30-Dec-2006  rumble Add -p command to usage.
 1.13 03-Jul-2006  mrg branches: 1.13.4;
don't pass unsigned char * to functions wanting char *.
 1.12 05-May-2006  thorpej branches: 1.12.4;
Don't include <sys/endian.h> if building as a host tool.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.6; 1.11.8; 1.11.10; 1.11.12;
merge ktrace-lwp.
 1.10 28-Feb-2005  sekiya branches: 1.10.4;
0 is a success code for ioctl(). Fixes install problem introduced by
revision 1.9 last November.
 1.9 24-Nov-2004  jmc branches: 1.9.4; 1.9.6;
Retool sgivol into a proper hostool that doesn't depend on disklabel.h.
Assume defaults for file images that match what a vnd would have used.
Native use will still use the standard NetBSD label to get this data.
Fixes PR#25996
 1.8 08-Nov-2003  sekiya branches: 1.8.4;
Avoid namespace collision when sgivol is compiled as a native application.
 1.7 01-Nov-2003  sekiya Use be*toh() and htobe*() to permit use in cross-build environments. Add -h flag to override default volume header size.
 1.6 26-Oct-2003  sekiya NULL -> 0
 1.5 18-Jul-2002  rafal branches: 1.5.6;
Cleanup and enhancements to sgivol, mostly from Scott G. Taylor, with some
tweaking by me. Specifically, this gives sgivol an "unattended" mode that
can be used from eg. sysinst to install the bootblocks.
 1.4 13-Mar-2002  simonb branches: 1.4.4; 1.4.6;
Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.3 20-Nov-2001  thorpej branches: 1.3.2;
Use strncmp() when looking up volume files.
 1.2 20-Nov-2001  thorpej - General code cleanup (and enable warnings).
- It's perfectly legal to have an 8 byte volume filename; the trailing
NUL is not required in this case.
- Default the partition type to "4.2BSD", not "EFS".
 1.1 20-Nov-2001  soren Michael Hitch's volume header tool.
 1.3.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 20-Nov-2001  thorpej file sgivol.c was added on branch kqueue on 2002-01-10 19:48:36 +0000
 1.4.6.1 19-Jul-2002  lukem Pull up revision 1.5 (requested by rafal in ticket #521):
Cleanup and enhancements to sgivol, mostly from Scott G. Taylor, with some
tweaking by me. Specifically, this gives sgivol an "unattended" mode that
can be used from eg. sysinst to install the bootblocks.
 1.4.4.1 21-Jul-2002  gehenna catch up with -current.
 1.5.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.6.4 29-Nov-2004  skrll Sync with HEAD.
 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.8.4.2 01-Dec-2005  riz Pull up following revision(s) (requested by tsutsui in ticket #10164):
sys/arch/sgimips/stand/sgivol/sgivol.c: revision 1.10
0 is a success code for ioctl(). Fixes install problem introduced by
revision 1.9 last November.
 1.8.4.1 06-Apr-2005  tron branches: 1.8.4.1.2;
Pull up revision 1.9 (requested by jmc in ticket #1028):
Retool sgivol into a proper hostool that doesn't depend on disklabel.h.
Assume defaults for file images that match what a vnd would have used.
Native use will still use the standard NetBSD label to get this data.
Fixes PR#25996
 1.8.4.1.2.1 01-Dec-2005  riz Pull up following revision(s) (requested by tsutsui in ticket #10164):
sys/arch/sgimips/stand/sgivol/sgivol.c: revision 1.10
0 is a success code for ioctl(). Fixes install problem introduced by
revision 1.9 last November.
 1.9.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.4.1 29-Apr-2005  kent sync with -current
 1.10.4.2 30-Dec-2006  yamt sync with head.
 1.10.4.1 21-Jun-2006  yamt sync with head.
 1.11.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.11.10.1 11-May-2006  elad sync with head
 1.11.8.2 11-Aug-2006  yamt sync with head
 1.11.8.1 24-May-2006  yamt sync with head.
 1.11.6.1 01-Jun-2006  kardel Sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.13.4.1 12-Jan-2007  ad Sync with head.
 1.15.48.2 04-May-2009  yamt sync with head.
 1.15.48.1 16-May-2008  yamt sync with head.
 1.15.46.1 18-May-2008  yamt sync with head.
 1.15.44.2 28-Sep-2008  mjf Sync with HEAD.
 1.15.44.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.6.1 19-Oct-2008  haad Sync with HEAD.
 1.16.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.18.38.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.28.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.2.1 18-May-2014  rmind sync with head
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
XIO device ids. Nothing here yet.
 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 14-Jun-2000  bouyer file README was added on branch thorpej_scsipi on 2000-11-20 20:23:49 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file README was added on branch minoura-xpg4dl on 2000-06-22 17:03:46 +0000
 1.1 14-Jun-2000  soren branches: 1.1.4; 1.1.6;
XIO device ids. Nothing here yet.
 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 14-Jun-2000  bouyer file xiodevs was added on branch thorpej_scsipi on 2000-11-20 20:23:49 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 14-Jun-2000  minoura file xiodevs was added on branch minoura-xpg4dl on 2000-06-22 17:03:46 +0000

RSS XML Feed