Home | History | Annotate | only in /src/sys/arch/amiga/dev
History log of /src/sys/arch/amiga/dev
RevisionDateAuthorComments
 1.7 25-Oct-2008  apb Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.6 11-Dec-2005  christos branches: 1.6.74; 1.6.78; 1.6.84;
merge ktrace-lwp.
 1.5 16-Jul-2003  is pass source file name to gpsa, so that gspa could (in theory) embed the
used filename in the output.
 1.4 26-May-2002  jdolecek branches: 1.4.2; 1.4.4; 1.4.10;
remove space in generated NetBSD RCS Id
 1.3 26-May-2002  jdolecek pregenerate grf_ultms.c, so that gspa isn't needed during kernel build
 1.2 09-Feb-1994  mycroft branches: 1.2.6; 1.2.18;
Clean up deleted files.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2.18.1 30-May-2002  gehenna Catch up with -current.
 1.2.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 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.4.4.2 20-Jun-2002  nathanw Catch up to -current.
 1.4.4.1 26-May-2002  nathanw file Makefile was added on branch nathanw_sa on 2002-06-20 03:37:52 +0000
 1.4.2.3 28-May-2002  tv Pull up revision 1.4 (requested by jdolecek):
remove space in generated NetBSD RCS Id
 1.4.2.2 28-May-2002  tv Pull up revision 1.3 (requested by jdolecek):
pregenerate grf_ultms.c, so that gspa isn't needed during kernel build
 1.4.2.1 26-May-2002  tv file Makefile was added on branch netbsd-1-6 on 2002-05-28 19:34:52 +0000
 1.6.84.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.6.78.1 04-May-2009  yamt sync with head.
 1.6.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.5 28-Dec-1994  mycroft Clean up deleted files.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 10-Jul-1994  chopps branches: 1.3.2;
bring up to date with siop.c
 1.2 11-Feb-1994  chopps branches: 1.2.2;
Add missing Id's
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2.2.1 10-Jul-1994  cgd from trunk, at chopps request
 1.3.2.2 10-Jul-1994  chopps bring up to date with siop.c
 1.3.2.1 10-Jul-1994  chopps file Zeus.script was added on branch netbsd-1-0 on 1994-07-10 23:00:30 +0000
 1.7 08-May-1994  mycroft Clean up deleted files.
 1.6 18-Apr-1994  chopps make current with recent vm changes.
 1.5 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.2 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.4 08-May-1994  mycroft Clean up deleted files.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.26 27-Jan-2013  rkujawa Remove confusing, leftover comment.
 1.25 14-Nov-2012  rkujawa The a2kbbc is now based on MI MSM6242B driver.
 1.24 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.23 03-Jun-2011  matt branches: 1.23.2; 1.23.12;
CFATTACH_DECL_NEW, device_t, cfdata_t
 1.22 08-Feb-2011  rmind branches: 1.22.2;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.21 10-Oct-2006  mhitch branches: 1.21.78; 1.21.84; 1.21.86;
Conversion to clock_ymdhms wasn't complete: the match routine was calling
ugettod() with a NULL pointer to test if the clock was present. That
argument was changed to a struct clock_ymdhms pointer and is no longer
optional. Change to pass the address of a local structure when probing
for the clock.
 1.20 11-Sep-2006  gdamore branches: 1.20.2;
Convert a2kbbc and a3kbbc to newer clock_ymdhms convenience routines in
kern_todr.
 1.19 07-Sep-2006  mhitch Correct some error returns for gettod() and settod() left over from the
pre-todr code, and use actual E* return codes for any error return.
 1.18 05-Sep-2006  mhitch branches: 1.18.2;
Switch amiga to MI todr.
 1.17 11-Dec-2005  christos branches: 1.17.4; 1.17.8;
merge ktrace-lwp.
 1.16 13-Jun-2005  jmc branches: 1.16.2;
Fix a ton of const/volatile issues shown with new warning flags
 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 02-Oct-2002  thorpej branches: 1.14.6;
Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.11 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.10 15-Mar-2000  kleink branches: 1.10.8; 1.10.12;
Kill a couple of unnecessary cf_unit (ab)uses.
 1.9 03-Jan-2000  is Write part of the y2k fix.
This is not strictly necessary, as
- at least for the Ricoh chip in the A3000 and A4000, as those chips' Y10
registers happily continue to count up from 0xA if manually incremented
past 0x9.
- the Amiga ROMs and "setclock" commands seem to interpret 0xA 0x? like
200?, etc.

However,
- the Amiga setclock writes the modulo 10 value into the chips
- the chip docs of both chips, including the Y2K information of their
manufacturers, only refer to the range 0-9
- the chips increment from 9 to 0

So we better conform to this, to avoid unpleasant surprises.
 1.8 02-Jan-2000  is *sigh*
Y2000-patch for A2000, A3000 and A4000 battery backed clock modules,
mostly by Adam Ciarcinski.
 1.7 28-Mar-1999  is branches: 1.7.2; 1.7.8;
Dont write through a zero pointer (when in probe mode of a2kugettod()).
 1.6 14-Mar-1999  is Use the 1/256s-resolution when reading the DraCo battery backed clock
 1.5 12-Jan-1998  thorpej Adjust for changes to config.
 1.4 19-Oct-1997  is zbus.c
 1.3 23-Jul-1997  is Fix a complaint by Eric Delcamp on port-amiga... looks like Thorsten Fruehauf
didn't find all occurences of unprotected is_draco(), and I didn't look hard
enough, either, when fixing.
 1.2 22-Jul-1997  kleink a2kbbc_match(): check unit explicitly against 0. Minor KNF.
 1.1 19-Jul-1997  is Make Amiga battery clocks autoconfiguration devices, so that they can be
left out of specialized configurations.
 1.7.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.7.2.1 08-Jan-2000  he Pull up revisions 1.8-1.9 (requested by is):
Y2K fix for A2000, A3000 and A4000 battery backed clock modules.
 1.10.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.10.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.10.8.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.10.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.14.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.6.1 03-Aug-2004  skrll Sync with HEAD
 1.16.2.1 30-Dec-2006  yamt sync with head.
 1.17.8.1 14-Sep-2006  yamt sync with head.
 1.17.4.1 09-Sep-2006  rpaulo sync with head
 1.18.2.1 18-Nov-2006  ad Sync with head.
 1.20.2.1 22-Oct-2006  yamt sync with head
 1.21.86.1 17-Feb-2011  bouyer Sync with HEAD
 1.21.84.1 06-Jun-2011  jruoho Sync with HEAD.
 1.21.78.2 12-Jun-2011  rmind sync with head
 1.21.78.1 05-Mar-2011  rmind sync with head
 1.22.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.23.12.2 25-Feb-2013  tls resync with head
 1.23.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.23.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.23.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.23.2.1 30-Oct-2012  yamt sync with head
 1.7 08-May-1994  mycroft Clean up deleted files.
 1.6 18-Apr-1994  chopps make current with recent vm changes.
 1.5 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.2 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.4 08-May-1994  mycroft Clean up deleted files.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.25 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.24 07-Sep-2025  thorpej Don't keep state in globals; define and use an a34kbbc_softc.
 1.23 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.22 03-Jun-2011  matt branches: 1.22.2; 1.22.12;
CFATTACH_DECL_NEW, device_t, cfdata_t
 1.21 08-Feb-2011  rmind branches: 1.21.2;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.20 10-Oct-2006  mhitch branches: 1.20.78; 1.20.84; 1.20.86;
Conversion to clock_ymdhms wasn't complete: the match routine was calling
ugettod() with a NULL pointer to test if the clock was present. That
argument was changed to a struct clock_ymdhms pointer and is no longer
optional. Change to pass the address of a local structure when probing
for the clock.
 1.19 11-Sep-2006  gdamore branches: 1.19.2;
Convert a2kbbc and a3kbbc to newer clock_ymdhms convenience routines in
kern_todr.
 1.18 07-Sep-2006  mhitch Correct some error returns for gettod() and settod() left over from the
pre-todr code, and use actual E* return codes for any error return.
 1.17 05-Sep-2006  mhitch branches: 1.17.2;
Switch amiga to MI todr.
 1.16 30-Dec-2005  is branches: 1.16.4; 1.16.8;
fixing typo in comment
 1.15 11-Dec-2005  christos merge ktrace-lwp.
 1.14 13-Jun-2005  jmc branches: 1.14.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.12 02-Oct-2002  thorpej branches: 1.12.6;
Use CFATTACH_DECL().
 1.11 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.10 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.9 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.8 15-Mar-2000  kleink branches: 1.8.8; 1.8.12;
Kill a couple of unnecessary cf_unit (ab)uses.
 1.7 06-Jan-2000  is Fix comment. No code change.
 1.6 03-Jan-2000  is The Ricoh chip has a seperate leapyear counter.
We must write this when we write the year register, keeping them in sync.
XXX the chosen algorithm only works for 1901 <= year <= 2099.
 1.5 03-Jan-2000  is Write part of the y2k fix.
This is not strictly necessary, as
- at least for the Ricoh chip in the A3000 and A4000, as those chips' Y10
registers happily continue to count up from 0xA if manually incremented
past 0x9.
- the Amiga ROMs and "setclock" commands seem to interpret 0xA 0x? like
200?, etc.

However,
- the Amiga setclock writes the modulo 10 value into the chips
- the chip docs of both chips, including the Y2K information of their
manufacturers, only refer to the range 0-9
- the chips increment from 9 to 0

So we better conform to this, to avoid unpleasant surprises.
 1.4 02-Jan-2000  is *sigh*
Y2000-patch for A2000, A3000 and A4000 battery backed clock modules,
mostly by Adam Ciarcinski.
 1.3 14-Mar-1999  is branches: 1.3.2; 1.3.8;
Use the 1/256s-resolution when reading the DraCo battery backed clock
 1.2 12-Jan-1998  thorpej Adjust for changes to config.
 1.1 19-Jul-1997  is Make Amiga battery clocks autoconfiguration devices, so that they can be
left out of specialized configurations.
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.3.2.2 08-Jan-2000  he Pull up revision 1.6 (requested by is):
Write the Ricoh RP5C01 leapyear bits when writing the year.
 1.3.2.1 08-Jan-2000  he Pull up revisions 1.4-1.5 (requested by is):
Y2K fix for A2000, A3000 and A4000 battery backed clock modules.
 1.8.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.8.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.8.8.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.8.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.12.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.6.1 03-Aug-2004  skrll 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.16.8.1 14-Sep-2006  yamt sync with head.
 1.16.4.1 09-Sep-2006  rpaulo sync with head
 1.17.2.1 18-Nov-2006  ad Sync with head.
 1.19.2.1 22-Oct-2006  yamt sync with head
 1.20.86.1 17-Feb-2011  bouyer Sync with HEAD
 1.20.84.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.78.2 12-Jun-2011  rmind sync with head
 1.20.78.1 05-Mar-2011  rmind sync with head
 1.21.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.22.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.22.2.1 30-Oct-2012  yamt sync with head
 1.7 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.6 04-Aug-2023  rin amiga/acafh(4): Appease GCC 12.3.0 -Wmisleading-indentation

No binary changes. Alternatively, pmap_update(9) can be placed in
this loop, but it should make nothing other than small overhead.
 1.5 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.4 24-Apr-2021  thorpej branches: 1.4.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.3 26-Dec-2013  rkujawa branches: 1.3.4; 1.3.6; 1.3.10; 1.3.50;
Implement the probe procedure for ACA500. Now the user just needs acafh0
compiled in his kernel and it all should(tm) work.

Due to lack of obio in amiga port, the probe is called directly from mbattach().
This is going to change with the introduction of obio for all non-autoconfig
expansions.
 1.2 22-Dec-2013  rkujawa Changes to ACA500 support:
- Add support for second (aux) CF slot.
- Rework wdc attachment to be more sane.
- Add support for clockport on ACA500.
- Fix style where appropriate.
 1.1 22-Dec-2013  rkujawa Add preliminary support for the Individual Computers ACA500 in the form of acahf
driver. If ACA500 is equipped with supported accelerator with MMU, it allows
running NetBSD on an Amiga 500.

Since ACA is not autoconf-aware, and the probe procedure does not exist yet, the
driver is activated with the ACA500_SUPPORT kernel option. The acahf driver
is commented out in the GENERIC kernel for now (at least until it stops being
very experimental and hackish).

When it comes to ACA-specific hardware, for now the boot CF slot works. Support for everything else is incoming...
 1.3.50.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.3.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.10.1 26-Dec-2013  tls file acafh.c was added on branch tls-maxphys on 2014-08-20 00:02:43 +0000
 1.3.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.1 26-Dec-2013  yamt file acafh.c was added on branch yamt-pagecache on 2014-05-22 11:39:28 +0000
 1.3.4.2 18-May-2014  rmind sync with head
 1.3.4.1 26-Dec-2013  rmind file acafh.c was added on branch rmind-smpnet on 2014-05-18 17:44:55 +0000
 1.4.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.4 03-Jan-2014  rkujawa branches: 1.4.4; 1.4.6; 1.4.10;
Rework handling of Commodore Gayle chip. Avoid ugly struct casts, introduce
proper bus_space accesses and some abstraction layer. All drivers that utilised
Gayle also had to be refactored.

I tried not to break anything more, but this clearly needs more testing...
 1.3 26-Dec-2013  rkujawa Implement the probe procedure for ACA500. Now the user just needs acafh0
compiled in his kernel and it all should(tm) work.

Due to lack of obio in amiga port, the probe is called directly from mbattach().
This is going to change with the introduction of obio for all non-autoconfig
expansions.
 1.2 22-Dec-2013  rkujawa Changes to ACA500 support:
- Add support for second (aux) CF slot.
- Rework wdc attachment to be more sane.
- Add support for clockport on ACA500.
- Fix style where appropriate.
 1.1 22-Dec-2013  rkujawa Add preliminary support for the Individual Computers ACA500 in the form of acahf
driver. If ACA500 is equipped with supported accelerator with MMU, it allows
running NetBSD on an Amiga 500.

Since ACA is not autoconf-aware, and the probe procedure does not exist yet, the
driver is activated with the ACA500_SUPPORT kernel option. The acahf driver
is commented out in the GENERIC kernel for now (at least until it stops being
very experimental and hackish).

When it comes to ACA-specific hardware, for now the boot CF slot works. Support for everything else is incoming...
 1.4.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.10.1 03-Jan-2014  tls file acafhreg.h was added on branch tls-maxphys on 2014-08-20 00:02:43 +0000
 1.4.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.6.1 03-Jan-2014  yamt file acafhreg.h was added on branch yamt-pagecache on 2014-05-22 11:39:28 +0000
 1.4.4.2 18-May-2014  rmind sync with head
 1.4.4.1 03-Jan-2014  rmind file acafhreg.h was added on branch rmind-smpnet on 2014-05-18 17:44:55 +0000
 1.3 26-Dec-2013  rkujawa branches: 1.3.4; 1.3.6; 1.3.10;
Implement the probe procedure for ACA500. Now the user just needs acafh0
compiled in his kernel and it all should(tm) work.

Due to lack of obio in amiga port, the probe is called directly from mbattach().
This is going to change with the introduction of obio for all non-autoconfig
expansions.
 1.2 22-Dec-2013  rkujawa Changes to ACA500 support:
- Add support for second (aux) CF slot.
- Rework wdc attachment to be more sane.
- Add support for clockport on ACA500.
- Fix style where appropriate.
 1.1 22-Dec-2013  rkujawa Add preliminary support for the Individual Computers ACA500 in the form of acahf
driver. If ACA500 is equipped with supported accelerator with MMU, it allows
running NetBSD on an Amiga 500.

Since ACA is not autoconf-aware, and the probe procedure does not exist yet, the
driver is activated with the ACA500_SUPPORT kernel option. The acahf driver
is commented out in the GENERIC kernel for now (at least until it stops being
very experimental and hackish).

When it comes to ACA-specific hardware, for now the boot CF slot works. Support for everything else is incoming...
 1.3.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.10.1 26-Dec-2013  tls file acafhvar.h was added on branch tls-maxphys on 2014-08-20 00:02:43 +0000
 1.3.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.1 26-Dec-2013  yamt file acafhvar.h was added on branch yamt-pagecache on 2014-05-22 11:39:28 +0000
 1.3.4.2 18-May-2014  rmind sync with head
 1.3.4.1 26-Dec-2013  rmind file acafhvar.h was added on branch rmind-smpnet on 2014-05-18 17:44:55 +0000
 1.47 27-Aug-2023  andvar remove empty #ifdef DEBUG block.
 1.46 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.45 24-Apr-2021  thorpej branches: 1.45.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.44 27-Oct-2012  chs branches: 1.44.18; 1.44.28; 1.44.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.43 20-Dec-2010  matt branches: 1.43.8; 1.43.18;
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.42 13-Jun-2008  cegger branches: 1.42.18;
use device_lookup_private to get softc
 1.41 17-Oct-2007  garbled branches: 1.41.16; 1.41.18; 1.41.20; 1.41.22; 1.41.24;
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.40 20-Aug-2007  is branches: 1.40.2;
First part of amigappc support patches by Frank Wille.
 1.39 05-Mar-2007  he branches: 1.39.2; 1.39.10; 1.39.14; 1.39.18;
Use char*, not void* for pointer arithmetic.
 1.38 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 08-Mar-2006  lukem branches: 1.37.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.36 11-Dec-2005  christos branches: 1.36.4; 1.36.6; 1.36.8; 1.36.10;
merge ktrace-lwp.
 1.35 13-Jun-2005  jmc branches: 1.35.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.34 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.33 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.32 09-Apr-2003  thorpej branches: 1.32.2;
Use PAGE_SIZE rather than NBPG.
 1.31 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.28 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.27 25-Apr-2001  bouyer branches: 1.27.2; 1.27.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.26 10-Jan-1999  tron branches: 1.26.8; 1.26.20;
Don't use void pointer for arithmetic.
 1.25 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.24 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.23 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.22 12-Jan-1998  thorpej Adjust for changes to config.
 1.21 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.20 23-Dec-1996  veego branches: 1.20.8; 1.20.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.19 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.18 13-Oct-1996  christos backout previous kprintf change
 1.17 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.16 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.15 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.14 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.13 18-Mar-1996  mhitch A couple more misses from the device attachment changes:
afcd_cd --> afsc_cd
atzsccd --> atzsc_cd
 1.12 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.11 15-Mar-1996  mhitch Correct 53c710 initialization for the A4000T. Remove the A4000T probe
debugging output.
 1.10 28-Jan-1996  chopps fix typo closes 1978
 1.9 05-Oct-1995  chopps first attempt at A4000T support, remove GRF_AGA's dependence on GRF_ECS.
page 0 is now invalid, other minor cleanup.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.5 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.3 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 06-Oct-1994  chopps branches: 1.1.2;
fix a thinko in gvp diag. Add 4091 driver from Michael Hitch
(osymh@gemini.oscs.montana.edu)
 1.1.2.2 06-Oct-1994  chopps fix a thinko in gvp diag. Add 4091 driver from Michael Hitch
(osymh@gemini.oscs.montana.edu)
 1.1.2.1 06-Oct-1994  chopps file afsc.c was added on branch netbsd-1-0 on 1994-10-06 19:06:41 +0000
 1.20.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.20.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.26.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.26.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.27.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.27.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.27.8.1 25-Apr-2001  nathanw file afsc.c was added on branch nathanw_sa on 2002-02-28 04:06:30 +0000
 1.27.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.27.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.32.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.32.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.2.1 03-Aug-2004  skrll Sync with HEAD
 1.35.2.2 03-Sep-2007  yamt sync with head.
 1.35.2.1 21-Jun-2006  yamt sync with head.
 1.36.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.36.8.1 13-Mar-2006  yamt sync with head.
 1.36.6.1 22-Apr-2006  simonb Sync with head.
 1.36.4.1 09-Sep-2006  rpaulo sync with head
 1.37.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.39.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.39.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.39.10.1 03-Oct-2007  garbled Sync with HEAD
 1.39.2.1 09-Oct-2007  ad Sync with head.
 1.40.2.1 06-Nov-2007  matt sync with HEAD
 1.41.24.1 18-Jun-2008  simonb Sync with head.
 1.41.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.41.20.1 04-May-2009  yamt sync with head.
 1.41.18.1 17-Jun-2008  yamt sync with head.
 1.41.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.42.18.1 05-Mar-2011  rmind sync with head
 1.43.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.43.8.1 30-Oct-2012  yamt sync with head
 1.44.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.44.28.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.44.18.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.44.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.45.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.40 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.39 24-Apr-2021  thorpej branches: 1.39.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.38 27-Oct-2012  chs branches: 1.38.18; 1.38.28; 1.38.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.37 05-Feb-2010  phx branches: 1.37.12; 1.37.22;
Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.36 13-Jun-2008  cegger use device_lookup_private to get softc
 1.35 11-Dec-2005  christos branches: 1.35.74; 1.35.76; 1.35.78; 1.35.80; 1.35.82;
merge ktrace-lwp.
 1.34 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.33 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.32 03-May-2003  wiz branches: 1.32.2;
DMA, not dma nor Dma.
 1.31 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.28 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.27 25-Apr-2001  bouyer branches: 1.27.2; 1.27.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.26 15-Jan-2000  aymeric branches: 1.26.6;
make this work again (include machine/cpu.h)
 1.25 05-Dec-1998  mjacob branches: 1.25.10;
Update HBAs to incorporate the new max_lun property.
 1.24 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.23 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.22 04-Sep-1998  is Add support for Apollo-68060-board-reworked A3000 motherboards.
This is only tested on the original A3000...
 1.21 21-Aug-1998  is Prepare for support of Apollo-cpuboard-reworked A3000 mainboard SCSI.
 1.20 12-Jan-1998  thorpej Adjust for changes to config.
 1.19 27-Aug-1997  bouyer branches: 1.19.4;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.18 23-Dec-1996  veego branches: 1.18.8; 1.18.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.17 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.16 13-Oct-1996  christos backout previous kprintf change
 1.15 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.14 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.13 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.12 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.11 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.10 04-Sep-1995  chopps sbic and board changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.7 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 16-May-1994  chopps remove uneeded function from ser.c and fix common bad arg to sbicintr() in ahsc
and atzsc
 1.2 11-May-1994  chopps general cleanup including boot diag messages.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.18.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.18.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.19.4.1 19-Jan-1999  cgd pull up revs 1.21-1.22 from trunk (is)
 1.25.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.26.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.27.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.27.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.27.8.1 25-Apr-2001  nathanw file ahsc.c was added on branch nathanw_sa on 2002-02-28 04:06:31 +0000
 1.27.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.27.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.32.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.2.1 03-Aug-2004  skrll Sync with HEAD
 1.35.82.1 18-Jun-2008  simonb Sync with head.
 1.35.80.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.35.78.2 11-Mar-2010  yamt sync with head
 1.35.78.1 04-May-2009  yamt sync with head.
 1.35.76.1 17-Jun-2008  yamt sync with head.
 1.35.74.1 29-Jun-2008  mjf Sync with HEAD.
 1.37.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.37.12.1 30-Oct-2012  yamt sync with head
 1.38.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.38.28.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.38.18.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.38.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.39.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 26-Oct-1994  cgd branches: 1.2.66;
new RCS ID format.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.40 06-Jul-2022  jandberg Return display depth correctly from WSDISPLAYIO_GET_FBINFO.
(previous workaround to always return 1 no longer needed with latest wsfb)
 1.39 06-Feb-2022  jandberg Refactor cursor drawing.
Fixes rare case where cursor gets painted over when screen is cleared.
 1.38 21-Aug-2021  andvar fix mainly same typos as in my previous commit but outside sys/dev/dm.
 1.37 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.36 15-Jun-2021  rin branches: 1.36.2;
Remove parentheses from return. No functional changes.
 1.35 15-Jun-2021  rin Add support for WSDISPLAYIO_MODE_DUMBFB to WSDISPLAYIO_SMODE.
 1.34 24-Apr-2021  thorpej branches: 1.34.2;
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.33 06-Jan-2021  jandberg branches: 1.33.2;
Implement the WSDISPLAYIO_GET_FBINFO ioctl, needed by X wsfb driver.
 1.32 03-Sep-2018  riastradh branches: 1.32.4; 1.32.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.31 28-Jan-2018  jandberg branches: 1.31.2; 1.31.4;
Make the console framebuffer visible when polling mode console input is used.
 1.30 06-Feb-2016  jandberg Fix some awkward language in manpage and code comments.
 1.29 12-Nov-2015  phx Use the MD_BTOP() macro as replacement for m68k_btop() in all device
drivers which are shared with amigappc.
 1.28 05-Aug-2015  mrg remove include of <dev/rcons/raster.h>, which is not necessary.
 1.27 29-Mar-2014  mlelstv branches: 1.27.6;
Mark variables only used in KASSET to appease compiler.
 1.26 27-Oct-2012  chs branches: 1.26.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.25 11-Jan-2012  macallan branches: 1.25.6;
adjust wsfont_find()
 1.24 15-Dec-2011  phx Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.23 17-Jul-2011  joerg branches: 1.23.2; 1.23.6;
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.22 18-Mar-2009  cegger bzero -> memset
 1.21 19-Dec-2008  cegger branches: 1.21.2;
use M_ZERO on malloc() and remove subsequent bzero().
 1.20 04-Mar-2007  christos branches: 1.20.40; 1.20.44; 1.20.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 12-Apr-2006  jmmv branches: 1.19.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10; 1.18.12;
merge ktrace-lwp.
 1.17 01-Jun-2005  jandberg branches: 1.17.2;
Tell kbd when it is the console keyboard instead of always assuming
it is. Also console keyboard initialization is now made during consinit
instead of autoconf.
Reviewed by <is>.
 1.16 13-Dec-2004  chs for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.15 23-Feb-2004  jandberg Add wsfont pseudo-device.

With this the custom font loading code isn't needed and is removed.
 1.14 12-Nov-2003  jandberg amidisplaycc.c:
Add screen types suitable for PAL displays, and fix typos
in older screen type names; reported by Gunther Nikl.
amidisplay.4:
Document the new screen types and add some misc information.
 1.13 12-Nov-2003  jandberg Fix bug/typo and rewrite some funnily structured code.
Pointed out by compiler warnings.
 1.12 14-Jul-2003  aymeric The second argument to amidisplaycc_setnamedfont() really should be a const.
Make it so.
 1.11 10-Feb-2003  jandberg branches: 1.11.2;
make sure cursor is cleared from old location before drawing in the next
 1.10 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 02-Sep-2002  aymeric call grfcc_probe() and viewprobe(), even when we are not the console.
This fixes a panic when using a serial console and wsconscfg.
(The monitors list wouldn't be initialized in grfabs.c)
 1.7 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.6 17-Mar-2002  atatat branches: 1.6.4; 1.6.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.5 13-Mar-2002  ad Reorganise the wsfont stuff slightly so that multiple display adapters
with different bit/byte order requirements can co-exist happily.
 1.4 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.3 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.2 13-Jan-2002  jandberg Amiga wsdisplay updates.

conf/GENERIC:
conf/files.amiga:
- Bring in wsfont definitions.

dev/grfabs_reg.h:
- Add macros for decomposing palette entries.

dev/amidisplaycc.c:
- Support for fonts, either wsfonts compiled into kernel
or runtime-loadable by ioctl. Font width still limited to 8,
height may vary.
- Limited support for mapped displays. No way to adjust display
mode. Palette setting works.
- Prettier default palette (white on black).
- Probes correctly as WSDISPLAY_TYPE_AMIGACC.
- Support for screen blanking.
 1.1 02-Feb-2001  is branches: 1.1.2; 1.1.6; 1.1.10;
Initial, still incomplete wscons support by Jukka Andberg, PR 11068
 1.1.10.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.10.4 17-Sep-2002  nathanw Catch up to -current.
 1.1.10.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.10.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.6.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.6.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 02-Feb-2001  bouyer file amidisplaycc.c was added on branch thorpej_scsipi on 2001-02-11 19:08:46 +0000
 1.6.6.1 04-Sep-2002  lukem Pull up revision 1.8 (requested by aymeric in ticket #762):
call grfcc_probe() and viewprobe(), even when we are not the console.
This fixes a panic when using a serial console and wsconscfg.
(The monitors list wouldn't be initialized in grfabs.c)
 1.6.4.1 16-Jul-2002  gehenna catch up with -current.
 1.11.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.11.2.4 21-Nov-2004  skrll Adapt to branch.
 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.17.2.2 03-Sep-2007  yamt sync with head.
 1.17.2.1 21-Jun-2006  yamt sync with head.
 1.18.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.18.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.18.8.1 24-May-2006  yamt sync with head.
 1.18.6.1 22-Apr-2006  simonb Sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.19.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.20.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.20.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.20.44.1 04-May-2009  yamt sync with head.
 1.20.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.21.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.23.6.1 18-Feb-2012  mrg merge to -current.
 1.23.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.23.2.2 30-Oct-2012  yamt sync with head
 1.23.2.1 17-Apr-2012  yamt sync with head
 1.25.6.3 03-Dec-2017  jdolecek update from HEAD
 1.25.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.26.2.1 18-May-2014  rmind sync with head
 1.27.6.3 19-Mar-2016  skrll Sync with HEAD
 1.27.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.27.6.1 22-Sep-2015  skrll Sync with HEAD
 1.31.4.1 10-Jun-2019  christos Sync with HEAD
 1.31.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.32.12.1 03-Apr-2021  thorpej Sync with HEAD.
 1.32.4.1 13-Oct-2021  martin Pull up following revision(s) (requested by abs in ticket #1359):

sys/arch/amiga/dev/amidisplaycc.c: revision 1.33
share/man/man4/man4.amiga/amidisplaycc.4: revision 1.14
sys/arch/amiga/dev/amidisplaycc.c: revision 1.35
sys/arch/amiga/dev/amidisplaycc.c: revision 1.36

Implement the WSDISPLAYIO_GET_FBINFO ioctl, needed by X wsfb driver.

Add support for WSDISPLAYIO_MODE_DUMBFB to WSDISPLAYIO_SMODE.

Remove parentheses from return. No functional changes.

Update documentation to mention current status of X11
 1.33.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.34.2.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.36.2.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.24 22-Sep-2018  maxv Remove isic(4). It is part of ISDN, which we are now retiring.
 1.23 27-Oct-2012  chs branches: 1.23.36; 1.23.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.22 19-Jul-2011  dyoung branches: 1.22.2; 1.22.12;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.21 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.20 01-Jan-2003  thorpej branches: 1.20.104; 1.20.106; 1.20.108;
Use aprint_normal() for cfprint routines.
 1.19 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.18 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.17 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.16 28-Jan-2002  aymeric branches: 1.16.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.15 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.14 26-Apr-2001  is branches: 1.14.2; 1.14.8;
Be more specific than "some isic board".
 1.13 20-Feb-2001  is branches: 1.13.2;
Clean up messages, and replace nested ifs by switch statement.
 1.12 14-Feb-2001  is Print out IPL.
 1.11 08-Feb-2001  is Support for BSC ISDN Master II. As far as we are concerned, this seems
to be identical to the old model.
 1.10 28-Jan-2001  is Jens Sch�nfeld seems to recall the name is ISDN link.
 1.9 26-Jan-2001  is Support for the Zeus Development(?) ISDN board (2189/3).
 1.8 25-Jan-2001  is Add support for ISDN Surfer (ISDN only, for the time being).
 1.7 23-Jan-2000  aymeric sync with new bus.h
 1.6 31-Dec-1999  is assign the pointer
 1.5 30-Dec-1999  is Rewrite of the Amiga bus_space machinery to prepare for the support of
the generic IDE driver and the PCMCIA slots.
 1.4 17-Mar-1999  is branches: 1.4.8;
ISDN Master II support added.
Actually, support for this has still to be added to the isdn4bsd release.
 1.3 16-Feb-1999  is Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 10-Aug-1998  is ISDN Blaster / Master: ZBus attachment / SUPIO driver.
 1.4.8.3 12-Mar-2001  bouyer Sync with HEAD.
 1.4.8.2 11-Feb-2001  bouyer Sync with HEAD.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.13.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.14.8.5 03-Jan-2003  thorpej Sync with HEAD.
 1.14.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.14.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.14.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.14.8.1 26-Apr-2001  nathanw file aster.c was added on branch nathanw_sa on 2002-02-28 04:06:31 +0000
 1.14.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.16.8.1 16-May-2002  gehenna Include sys/conf.h directly.
 1.20.108.1 16-May-2008  yamt sync with head.
 1.20.106.1 18-May-2008  yamt sync with head.
 1.20.104.1 02-Jun-2008  mjf Sync with HEAD.
 1.22.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.22.2.1 30-Oct-2012  yamt sync with head
 1.23.38.1 10-Jun-2019  christos Sync with HEAD
 1.23.36.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.45 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.44 24-Apr-2021  thorpej branches: 1.44.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.43 27-Oct-2012  chs branches: 1.43.18; 1.43.28; 1.43.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.42 09-Feb-2010  phx branches: 1.42.10; 1.42.20;
Moved the macros amiga_cpu_sync() and amiga_membarrier() from amiga/device.h
to the MD include/cpu.h.
Also make sure that grf_cvreg.h includes cpu.h as it is needed by Xamiga
in xsrc/xfree/xc/programs/Xserver/hw/netbsd/amiga/s3/amigaCV.h.
 1.41 07-Feb-2010  he branches: 1.41.2;
Remove a now-unused variable declaration.
 1.40 05-Feb-2010  phx Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.39 16-Oct-2009  phx Fixed typo in DEBUG: atysc -> atzsc
 1.38 13-Jun-2008  cegger use device_lookup_private to get softc
 1.37 03-Dec-2007  ad branches: 1.37.14; 1.37.16; 1.37.18; 1.37.20; 1.37.22;
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.36 11-Dec-2005  christos branches: 1.36.30; 1.36.48; 1.36.50; 1.36.56;
merge ktrace-lwp.
 1.35 07-Aug-2003  agc branches: 1.35.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.34 03-May-2003  wiz branches: 1.34.2;
DMA, not dma nor Dma.
 1.33 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.30 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.29 25-Apr-2001  bouyer branches: 1.29.2; 1.29.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.28 05-Dec-1998  mjacob branches: 1.28.10; 1.28.22;
Update HBAs to incorporate the new max_lun property.
 1.27 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.26 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.25 21-Aug-1998  is Prepare for support of Apollo-cpuboard-reworked A3000 mainboard SCSI.
 1.24 12-Jan-1998  thorpej Adjust for changes to config.
 1.23 27-Aug-1997  bouyer branches: 1.23.4;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.22 23-Dec-1996  veego branches: 1.22.8; 1.22.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.21 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.20 13-Oct-1996  christos backout previous kprintf change
 1.19 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.18 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.17 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.16 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.15 18-Mar-1996  mhitch A couple more misses from the device attachment changes:
afcd_cd --> afsc_cd
atzsccd --> atzsc_cd
 1.14 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.13 04-Sep-1995  chopps sbic and board changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.12 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.11 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.10 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 16-Jul-1994  chopps branches: 1.6.2;
fix a couple things pointed out from Michael.
 1.5 02-Jul-1994  chopps branches: 1.5.2;
couple fixes from Michael. 2091 now uses 24bit only dma (oops)
 1.4 16-Jun-1994  chopps fix boot diag output.
 1.3 16-May-1994  chopps remove uneeded function from ser.c and fix common bad arg to sbicintr() in ahsc
and atzsc
 1.2 11-May-1994  chopps general cleanup including boot diag messages.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.5.2.1 16-Jul-1994  cgd from trunk, per chopps
 1.6.2.2 16-Jul-1994  chopps fix a couple things pointed out from Michael.
 1.6.2.1 16-Jul-1994  chopps file atzsc.c was added on branch netbsd-1-0 on 1994-07-16 19:45:45 +0000
 1.22.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.22.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.23.4.1 19-Jan-1999  cgd pull up rev 1.25 from trunk (is)
 1.28.22.1 21-Jun-2001  nathanw Catch up to -current.
 1.28.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.29.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.29.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.29.8.1 25-Apr-2001  nathanw file atzsc.c was added on branch nathanw_sa on 2002-02-28 04:06:31 +0000
 1.29.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.29.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.34.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.34.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.34.2.1 03-Aug-2004  skrll Sync with HEAD
 1.35.16.1 07-Dec-2007  yamt sync with head
 1.36.56.1 08-Dec-2007  mjf Sync with HEAD.
 1.36.50.1 09-Jan-2008  matt sync with HEAD
 1.36.48.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.36.30.1 03-Dec-2007  ad Sync with HEAD.
 1.37.22.1 18-Jun-2008  simonb Sync with head.
 1.37.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.37.18.2 11-Mar-2010  yamt sync with head
 1.37.18.1 04-May-2009  yamt sync with head.
 1.37.16.1 17-Jun-2008  yamt sync with head.
 1.37.14.1 29-Jun-2008  mjf Sync with HEAD.
 1.41.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.42.20.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.42.10.1 30-Oct-2012  yamt sync with head
 1.43.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.43.28.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.43.18.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.43.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.44.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 26-Jan-2002  aymeric branches: 1.3.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.2 26-Oct-1994  cgd branches: 1.2.46; 1.2.50;
new RCS ID format.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2.50.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.46.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.16.1 03-Aug-2004  skrll Sync with HEAD
 1.48 29-Feb-2020  isaki round_blocksize must return a multiple of the framesize.
aucc(4) supports 3 channels mode.
 1.47 07-Sep-2019  rin branches: 1.47.2;
The device does not support recording.
Fix diagnostic assertion failure in aucc_set_format().

OK isaki

XXX
pullup to netbsd-9
 1.46 08-Jun-2019  isaki branches: 1.46.2;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.
 1.45 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.44 16-Mar-2019  isaki branches: 1.44.2;
Use C99 style struct initializer to audio_hw_if.
 1.43 22-Mar-2014  christos branches: 1.43.30;
kill sprintf
fix unused variables
 1.42 27-Oct-2012  chs branches: 1.42.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.41 23-Nov-2011  jmcneill branches: 1.41.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.40 08-Mar-2006  lukem branches: 1.40.102; 1.40.104;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.39 11-Dec-2005  christos branches: 1.39.4; 1.39.6; 1.39.8; 1.39.10;
merge ktrace-lwp.
 1.38 22-May-2005  christos branches: 1.38.2;
No 0x in front of %p...
 1.37 15-Jan-2005  kent ansify and KNF
 1.36 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.35 29-Oct-2004  yamt branches: 1.35.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.34 03-May-2003  wiz branches: 1.34.2;
DMA, not dma nor Dma.
 1.33 06-Apr-2003  wiz Respect the law: Use A-law and mu-law as spellings as far as easily possible.
Inspired by Igor Sobrado in PR 19680.
 1.32 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.31 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.30 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.29 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.28 03-Oct-2001  augustss branches: 1.28.4;
Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
 1.27 08-May-2001  is branches: 1.27.2; 1.27.4;
defopt LEV6_DEFER.
 1.26 03-Sep-2000  mhitch branches: 1.26.2;
Use the correct DMA pointer for the second channel on 14-bit byte-swapped
conversion. Fixes NULL pointer reference crash when playing 16 bit little
endian audio.
 1.25 16-Mar-2000  kleink branches: 1.25.4;
Kill more broken cf_unit bogons.
 1.24 04-Mar-1999  is branches: 1.24.2; 1.24.8;
Modifications to aucc.c for more input formats and 14bit stereo output.
By Bernardo Innocenti, submitted as PR 6787.
Some KNF-ifying done by myself, so you might want to blame me instead
if the original patch worked for you.
-is
 1.23 17-Aug-1998  augustss * Redo the way the way the MIDI driver attaches to audio devices.
* Improve the midisyn layer a little.
* Add a driver for the Yamaha OPL[23] FM synths.
The opl driver is not finished yet; it sounds pretty awful.

For some strange reason I cannot get any FM sound from my SB64 cards,
but a regular SB16 works fine.
 1.22 12-Jan-1998  thorpej Adjust for changes to config.
 1.21 24-Nov-1997  is Workaround for the "xanim volume setting problem":
We play mono samples on all 4 channels.
However, we get the volume settings for mono samples as a symmetic two-channel
setting... the other two channels used to stay at max volume...
I believe that something else is wrong here, but dont want to change MI
code (which in turn influences a couple of MD driver) thus late in the release
cycle.
 1.20 19-Oct-1997  augustss branches: 1.20.2;
Make the audio API (almost) SunOS compatible.
The changes is to allow some limited mixer manipulation through
the audio device (instead of the mixer device).
This rendered 4 methods in audio_hw_if unused so garbage collect these.
 1.19 11-Oct-1997  mycroft AudioC[A-Z] -> AudioC[a-z]
AudioElinear -> AudioEslinear
 1.18 24-Aug-1997  augustss - Change audio_hw_if a little: set_param now sets the play and record modes
at the same time instead by using two different calls. This enables
it to check more easily if the combined mode is all right.
- Improve the error checking in audio.c.
- Add a new audio property, AUDIO_PROP_INDEPENDENT, show if the
play and record settings are independent.
- Fix some buglets in audio.c.
 1.17 19-Aug-1997  augustss Change the MI audio driver so it attaches to the MD driver in the
normal way. This requires adding a line to the config files to
get audio to work again.
 1.16 31-Jul-1997  augustss Audio changes:
- Change the way attach and open works to allow multiple audio
devices.
- Split the mulaw.c file into two to avoid dragging in mulaw
convertsion when they are not needed. Add 16 bit alaw/mulaw tables.
- Change the way audio properties are gotten.
- Recognize more versions os SoundBlaster.
 1.15 28-Jul-1997  augustss branches: 1.15.2;
Audio: Remove the machine dependant code I put in audio.c by mistake.
This adds another method to audio_hw_if. Also remove a field from
audio_hw_if that was not read-only.
 1.14 28-Jul-1997  augustss Update forgotten audio driver for changes in audio_hw_if.
 1.13 27-Jul-1997  augustss audio: Simplify handling of AUDIO_SETFD and committing of encoding mode.
 1.12 15-Jul-1997  augustss Garbage collect some unused routines.
 1.11 15-Jul-1997  augustss In the name of backwards compatibility AUDIO_ENCODING_LINEAR has been
renamed AUDIO_ENCODING_SLINEAR and AUDIO_ENCODING_LINEAR reverts to the
NetBSD 1.2 sematics. A kernel with COMPAT_12 defined will accept
AUDIO_ENCODING_LINEAR and treat it as before, without COMPAT_12 it
will be rejected.
 1.10 10-Jul-1997  is - Fix gain control.
- play mono stuff on all channels.
 1.9 09-Jul-1997  is Make multichannel output work. The cc parameter to hw_start_output is
a byte counter, it seems. Somebody should really write man 9 audio_if.
While here, make debug output invisible #ifndef AUCCDEBUG.
 1.8 04-Jul-1997  is Multichannel output still doesn't work, but while working on it, I repaired
the double buffering code, and setting a couple of other parameters works now.
 1.7 23-Jun-1997  is Make aucc work in the presence of LEV6_DEFER.
 1.6 21-Jun-1997  kleink Change last commit to use `#error'.
 1.5 21-Jun-1997  is Make this fail to compile with LEV6_DEFER.
XXX This isn't nice, but stopping the system clock isn't nice, either.
We will repair this soon.
 1.4 20-Jun-1997  is Add RCS ids, and clean up some unused in newstyle audio hardware drivers
functions.
 1.3 15-Jun-1997  is Actually commit the sample rate to the hardware.
While we're here, add missing parts of (software encoded) ULINEAR encoding.
 1.2 15-Jun-1997  is A bit more of KNF.
 1.1 14-Jun-1997  is Amiga custom chip audio hardware driver, by Stefan Thesing
(thesing@cs.uni-sb.de), heavily hacked upon by me to
- make it work with -current audio system
- make it shut off Amiga audio DMA only at appropriate places.
XXX A couple of bugs still remain, which well be handled later.
XXX Among them: only mono output; doesn't refuse to handle input, but chokes;
will not play last millichunk (is this 20 ms?) of data.
 1.15.2.3 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.2.2 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.2.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.20.2.1 24-Nov-1997  perry pullup from trunk (requested by ig)
 1.24.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.24.2.1 09-Sep-2000  he Pull up revision 1.26 (requested by is):
Use the correct DMA pointer for the second channel on 14-bit
byte-swapped conversion. Fixes NULL pointer reference crash
when playing 16-bit little-endian audio.
 1.25.4.1 03-Sep-2000  mhitch Pullup revision 1.26 (requested by mhitch, approved by jhawk)

Log Message:
Use the correct DMA pointer for the second channel on 14-bit byte-swapped
conversion. Fixes NULL pointer reference crash when playing 16 bit little
endian audio.
 1.26.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.27.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.27.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.27.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.27.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.28.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.28.4.1 03-Oct-2001  nathanw file aucc.c was added on branch nathanw_sa on 2002-02-28 04:06:32 +0000
 1.34.2.3 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.34.2.2 17-Jan-2005  skrll Sync with HEAD.
 1.34.2.1 02-Nov-2004  skrll Sync with HEAD.
 1.35.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.35.2.1 03-Jan-2005  kent * adopt the filter pipeline framework.
* repulse.c follows ac97_attach() change
 1.38.2.1 21-Jun-2006  yamt sync with head.
 1.39.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.39.8.1 13-Mar-2006  yamt sync with head.
 1.39.6.1 22-Apr-2006  simonb Sync with head.
 1.39.4.1 09-Sep-2006  rpaulo sync with head
 1.40.104.2 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.40.104.1 20-Nov-2011  mrg port these to audiomp: support get_locks, and take the intr_lock
in the interrupt handler.
 1.40.102.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.40.102.2 30-Oct-2012  yamt sync with head
 1.40.102.1 17-Apr-2012  yamt sync with head
 1.41.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.41.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.42.2.1 18-May-2014  rmind sync with head
 1.43.30.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.43.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.43.30.1 10-Jun-2019  christos Sync with HEAD
 1.44.2.3 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.44.2.2 04-May-2019  isaki Remove simple flags that indicate whether the device is opened.
These are handled in the upper layer now.
 1.44.2.1 21-Apr-2019  isaki Adapt to audio2.
- Remove its own mulaw converter.
- XXX I'm not sure about 3,4ch mode vs 8/14bit mode.
 1.46.2.2 21-Mar-2020  martin Pull up following revision(s) (requested by isaki in ticket #792):

sys/arch/amiga/dev/aucc.c: revision 1.48
sys/dev/pci/auixp.c: revision 1.49
sys/dev/pci/gcscaudio.c: revision 1.19
sys/dev/pci/auich.c: revision 1.159
sys/dev/sbus/dbri.c: revision 1.42
sys/dev/pci/auvia.c: revision 1.85
sys/dev/pci/auacer.c: revision 1.39

Drop 512 bytes limit on auvia_round_blocksize().

This fixes attach on 6 channels device.
PR kern/55017.

round_blocksize must return a multiple of the framesize.
aucc(4) supports 3 channels mode.

round_blocksize must return a multiple of the framesize
even if passed blocksize is greater than the upper limit.

round_blocksize must return a multiple of the framesize.

It's not divisible when blk=GCSCAUDI_PRD_SIZE_MAX and channels=4.
round_blocksize must return a multiple of the framesize
even if 6 channels mode.

I believe that keeping "good alignment" is just a wish, not constraint.
 1.46.2.1 07-Sep-2019  snj Pull up following revision(s) (requested by rin in ticket #189):
sys/arch/amiga/dev/aucc.c: revision 1.47
The device does not support recording.
Fix diagnostic assertion failure in aucc_set_format().
OK isaki
 1.47.2.1 29-Feb-2020  ad Sync with head.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 15-Jan-2005  kent ansify and KNF
 1.4 26-Jan-2002  aymeric branches: 1.4.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.3 04-Jul-1997  is branches: 1.3.34; 1.3.38;
Multichannel output still doesn't work, but while working on it, I repaired
the double buffering code, and setting a couple of other parameters works now.
 1.2 20-Jun-1997  is Add RCS ids, and clean up some unused in newstyle audio hardware drivers
functions.
 1.1 14-Jun-1997  is Amiga custom chip audio hardware driver, by Stefan Thesing
(thesing@cs.uni-sb.de), heavily hacked upon by me to
- make it work with -current audio system
- make it shut off Amiga audio DMA only at appropriate places.
XXX A couple of bugs still remain, which well be handled later.
XXX Among them: only mono output; doesn't refuse to handle input, but chokes;
will not play last millichunk (is this 20 ms?) of data.
 1.3.38.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.34.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.4.16.1 17-Jan-2005  skrll Sync with HEAD.
 1.5 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.4 24-Apr-2021  thorpej branches: 1.4.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.3 27-Oct-2012  chs branches: 1.3.18; 1.3.28; 1.3.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.2 10-Jan-2012  rkujawa branches: 1.2.6;
Changes to Phase5 hardware support:
- Rework p5pb driver - simplify, cleanup, make more flexible.
- Add p5membar driver, which handles PCI resources autoconfigured by the firmware.
- Introduce intermediate p5bus layer, between zbus and CSPPC/BPPC on-board devices (p5pb, cbiiisc, bppcsc).
- Add experimental G-REX support to p5pb (first slot support only).
- Split CV64/3D PCI bridge support into separate cv3dpb driver (to be committed later).

Approved by phx.
 1.1 14-Jan-2011  phx branches: 1.1.6; 1.1.10; 1.1.14;
Driver for BlizzardPPC 603e+ SCSI host adatper.
Patch submitted by Radoslaw Kujawa.
 1.1.14.1 18-Feb-2012  mrg merge to -current.
 1.1.10.2 30-Oct-2012  yamt sync with head
 1.1.10.1 17-Apr-2012  yamt sync with head
 1.1.6.2 05-Mar-2011  rmind sync with head
 1.1.6.1 14-Jan-2011  rmind file bppcsc.c was added on branch rmind-uvmplock on 2011-03-05 20:49:20 +0000
 1.2.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.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.3.28.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.3.18.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.3.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.4.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.33 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.32 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.31 20-Dec-2010  matt branches: 1.31.58; 1.31.60;
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.30 18-Oct-2010  phx opt_m68k_arch.h can only be included when compiling for amiga/68k.
 1.29 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.28 23-Nov-2009  rmind branches: 1.28.2; 1.28.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.27 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.26 13-Apr-2008  tsutsui branches: 1.26.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.25 17-Oct-2007  garbled branches: 1.25.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.24 20-Aug-2007  is branches: 1.24.2;
First part of amigappc support patches by Frank Wille.
 1.23 11-Mar-2007  he branches: 1.23.8; 1.23.12; 1.23.16;
Correct a thinko of mine in the previous change, pointed out by
is@. Even though the argument type changes as an effect of the
caddr_t removal, there really is no need to indirect where we didn't
before. Instead, add the appropriate cast.
 1.22 05-Mar-2007  he branches: 1.22.2;
Fix one missing indirection causing a type conflict, and use char* for
pointer arithmetic.
 1.21 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20 29-Mar-2006  thorpej branches: 1.20.14;
Use device_cfdata().
 1.19 08-Mar-2006  lukem branches: 1.19.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10;
merge ktrace-lwp.
 1.17 13-Jun-2005  jmc branches: 1.17.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.16 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.15 01-Apr-2003  thorpej branches: 1.15.2;
Use PAGE_SIZE rather than NBPG.
 1.14 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.11 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.10 25-Apr-2001  bouyer branches: 1.10.2; 1.10.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.9 05-Jun-2000  tsutsui branches: 1.9.4;
Adapt MI ncr53c9x changes.
 1.8 30-Sep-1999  thorpej branches: 1.8.2; 1.8.10;
Update for SCSIPI changes.
 1.7 25-Sep-1999  is vm_offset_t -> vaddr_t/paddr_t
 1.6 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.5 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.4 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.3 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.2 12-Jan-1998  thorpej Adjust for changes to config.
 1.1 10-Oct-1997  mhitch branches: 1.1.2;
Add separate driver frontend for the Blizzard-IV; the differences with
the Blizzard-II are more extensive than I orginally thought.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 10-Oct-1997  thorpej file bzivsc.c was added on branch marc-pcmcia on 1997-10-14 08:26:09 +0000
 1.8.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.8.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.9.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.10.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.10.8.1 25-Apr-2001  nathanw file bzivsc.c was added on branch nathanw_sa on 2002-02-28 04:06:32 +0000
 1.10.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.10.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.15.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.17.2.2 03-Sep-2007  yamt sync with head.
 1.17.2.1 21-Jun-2006  yamt sync with head.
 1.18.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.18.8.2 01-Apr-2006  yamt sync with head.
 1.18.8.1 13-Mar-2006  yamt sync with head.
 1.18.6.1 22-Apr-2006  simonb Sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.19.2.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.20.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.22.2.2 09-Oct-2007  ad Sync with head.
 1.22.2.1 13-Mar-2007  ad Sync with head.
 1.23.16.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.23.12.1 03-Sep-2007  skrll Sync with HEAD.
 1.23.8.1 03-Oct-2007  garbled Sync with HEAD
 1.24.2.1 06-Nov-2007  matt sync with HEAD
 1.25.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.26.4.2 11-Aug-2010  yamt sync with head.
 1.26.4.1 11-Mar-2010  yamt sync with head
 1.28.4.2 05-Mar-2011  rmind sync with head
 1.28.4.1 03-Jul-2010  rmind sync with head
 1.28.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.28.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.31.60.1 10-Jun-2019  christos Sync with HEAD
 1.31.58.2 18-Jan-2019  pgoyette Synch with HEAD
 1.31.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.3 13-Apr-2008  tsutsui branches: 1.3.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.2 25-Sep-1999  is branches: 1.2.138;
vm_offset_t -> vaddr_t/paddr_t
 1.1 10-Oct-1997  mhitch branches: 1.1.2;
Add separate driver frontend for the Blizzard-IV; the differences with
the Blizzard-II are more extensive than I orginally thought.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 10-Oct-1997  thorpej file bzivscvar.h was added on branch marc-pcmcia on 1997-10-14 08:26:11 +0000
 1.2.138.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.4.1 11-Mar-2010  yamt sync with head
 1.5 16-Dec-1996  is The original docs for the Phase 5 Development SCSI boards had a edito,
making me think that the Blizzard-IV and the Blizzard-2060 scsi
options have nearly identical DMA engines (just with a different
address offset). Alas, this isn't true.

Herewith I replace the "bznsc" (all-new-Blizzard-models) driver with the
"bztzsc" (Blizzard Two Zero).
 1.4 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.3 11-Nov-1996  is oops; converted twice from hex to decimal earlier
 1.2 19-Oct-1996  is Clean up the attach messages a bit.
 1.1 17-Oct-1996  is Add driver bznsc (for BliZzard, New version: -IV, -1260, -2060).

Still untested on -1260/-1230, and hangs when enforcing SFAS_NO_DMA on 2060;
but works with DMA on the latter.

Still untested in a NetBSD-12A environment. (Sorry, don't have the hardware
myself.)

Thanks to Laurent Baroukh for being the guinea pig, and to Jerome Lovy
for forwarding the hardware information Phase V gave him, and to Phase
V for providing it.
 1.2 16-Dec-1996  is The original docs for the Phase 5 Development SCSI boards had a edito,
making me think that the Blizzard-IV and the Blizzard-2060 scsi
options have nearly identical DMA engines (just with a different
address offset). Alas, this isn't true.

Herewith I replace the "bznsc" (all-new-Blizzard-models) driver with the
"bztzsc" (Blizzard Two Zero).
 1.1 17-Oct-1996  is Add driver bznsc (for BliZzard, New version: -IV, -1260, -2060).

Still untested on -1260/-1230, and hangs when enforcing SFAS_NO_DMA on 2060;
but works with DMA on the latter.

Still untested in a NetBSD-12A environment. (Sorry, don't have the hardware
myself.)

Thanks to Laurent Baroukh for being the guinea pig, and to Jerome Lovy
for forwarding the hardware information Phase V gave him, and to Phase
V for providing it.
 1.2 16-Dec-1996  is The original docs for the Phase 5 Development SCSI boards had a edito,
making me think that the Blizzard-IV and the Blizzard-2060 scsi
options have nearly identical DMA engines (just with a different
address offset). Alas, this isn't true.

Herewith I replace the "bznsc" (all-new-Blizzard-models) driver with the
"bztzsc" (Blizzard Two Zero).
 1.1 17-Oct-1996  is Add driver bznsc (for BliZzard, New version: -IV, -1260, -2060).

Still untested on -1260/-1230, and hangs when enforcing SFAS_NO_DMA on 2060;
but works with DMA on the latter.

Still untested in a NetBSD-12A environment. (Sorry, don't have the hardware
myself.)

Thanks to Laurent Baroukh for being the guinea pig, and to Jerome Lovy
for forwarding the hardware information Phase V gave him, and to Phase
V for providing it.
 1.50 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.49 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.48 20-Dec-2010  matt branches: 1.48.58; 1.48.60;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.47 18-Oct-2010  phx opt_m68k_arch.h can only be included when compiling for amiga/68k.
 1.46 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.45 23-Nov-2009  rmind branches: 1.45.2; 1.45.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.44 13-Apr-2008  tsutsui branches: 1.44.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.43 17-Oct-2007  garbled branches: 1.43.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.42 20-Aug-2007  is branches: 1.42.2;
First part of amigappc support patches by Frank Wille.
 1.41 11-Mar-2007  he branches: 1.41.8; 1.41.12; 1.41.16;
Correct a thinko of mine in the previous change, pointed out by
is@. Even though the argument type changes as an effect of the
caddr_t removal, there really is no need to indirect where we didn't
before. Instead, add the appropriate cast.
 1.40 05-Mar-2007  he branches: 1.40.2;
Fix one missing indirection causing a type conflict, and use char* for
pointer arithmetic.
 1.39 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.38 29-Mar-2006  thorpej branches: 1.38.14;
Use device_cfdata().
 1.37 08-Mar-2006  lukem branches: 1.37.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.36 11-Dec-2005  christos branches: 1.36.4; 1.36.6; 1.36.8; 1.36.10;
merge ktrace-lwp.
 1.35 13-Jun-2005  jmc branches: 1.35.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.34 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.33 01-Apr-2003  thorpej branches: 1.33.2;
Use PAGE_SIZE rather than NBPG.
 1.32 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.31 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.30 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.29 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.28 25-Apr-2001  bouyer branches: 1.28.2; 1.28.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.27 05-Jun-2000  tsutsui branches: 1.27.4;
Adapt MI ncr53c9x changes.
 1.26 30-Sep-1999  thorpej branches: 1.26.2; 1.26.10;
Update for SCSIPI changes.
 1.25 25-Sep-1999  is vm_offset_t -> vaddr_t/paddr_t
 1.24 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.23 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.22 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.21 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.20 12-Jan-1998  thorpej Adjust for changes to config.
 1.19 12-Oct-1997  mhitch Oops, wrong file was committed. Get the right one this time.
 1.18 10-Oct-1997  mhitch Add separate driver frontend for the Blizzard-IV; the differences with
the Blizzard-II are more extensive than I orginally thought.
 1.17 04-Oct-1997  mhitch Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.16 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.15 21-Jan-1997  thorpej branches: 1.15.6; 1.15.8;
Initialize max_target in the SCSI link.
 1.14 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.13 13-Oct-1996  christos backout previous kprintf change
 1.12 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.11 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.10 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.9 01-Jul-1996  is There are Blizzard boards without SCSI options - we need to probe for the
existence of the SCSI hardware in the boards adress region.
Thanks to Oster Nerhus for the detailed bug report and to Ralph Schmidt for
the recommended probing method.
 1.8 10-Jun-1996  is Activate M68040 cache flushing code also in 68060 only kernels.
 1.7 21-Apr-1996  veego branches: 1.7.4;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.6 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.5 09-Oct-1995  chopps fix typo
 1.4 07-Oct-1995  chopps fixes for fastlane from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.3 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 26-Jun-1995  chopps typo fix from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.7.4.2 02-Jul-1996  jtc Pulled up from version 1.9 by request from Ignatios Souvatzis
 1.7.4.1 10-Jun-1996  is Pull up bug fix from main branch:
activate M68040 style dma flush also on M68060 only kernels.
 1.15.8.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.8.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.6.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.26.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.26.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.27.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.28.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.28.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.28.8.1 25-Apr-2001  nathanw file bzsc.c was added on branch nathanw_sa on 2002-02-28 04:06:33 +0000
 1.28.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.28.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.33.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.33.2.1 03-Aug-2004  skrll Sync with HEAD
 1.35.2.2 03-Sep-2007  yamt sync with head.
 1.35.2.1 21-Jun-2006  yamt sync with head.
 1.36.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.36.8.2 01-Apr-2006  yamt sync with head.
 1.36.8.1 13-Mar-2006  yamt sync with head.
 1.36.6.1 22-Apr-2006  simonb Sync with head.
 1.36.4.1 09-Sep-2006  rpaulo sync with head
 1.37.2.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.38.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.40.2.2 09-Oct-2007  ad Sync with head.
 1.40.2.1 13-Mar-2007  ad Sync with head.
 1.41.16.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.41.12.1 03-Sep-2007  skrll Sync with HEAD.
 1.41.8.1 03-Oct-2007  garbled Sync with HEAD
 1.42.2.1 06-Nov-2007  matt sync with HEAD
 1.43.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.44.4.2 11-Aug-2010  yamt sync with head.
 1.44.4.1 11-Mar-2010  yamt sync with head
 1.45.4.2 05-Mar-2011  rmind sync with head
 1.45.4.1 03-Jul-2010  rmind sync with head
 1.45.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.45.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.48.60.1 10-Jun-2019  christos Sync with HEAD
 1.48.58.2 18-Jan-2019  pgoyette Synch with HEAD
 1.48.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3 05-Oct-1997  veego Unused files after the sfas driver is replaced by the MI ncr53c9x driver.
 1.2 21-Apr-1996  veego branches: 1.2.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.5 13-Apr-2008  tsutsui branches: 1.5.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.4 25-Sep-1999  is branches: 1.4.138;
vm_offset_t -> vaddr_t/paddr_t
 1.3 04-Oct-1997  mhitch Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.2 21-Apr-1996  veego branches: 1.2.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.138.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.4.1 11-Mar-2010  yamt sync with head
 1.38 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.37 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.36 20-Dec-2010  matt branches: 1.36.58; 1.36.60;
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.35 18-Oct-2010  phx opt_m68k_arch.h can only be included when compiling for amiga/68k.
 1.34 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.33 23-Nov-2009  rmind branches: 1.33.2; 1.33.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.32 15-Nov-2009  snj Drop 3rd and 4th clauses (except in one case, where copyright is shared
with UCB and only the 3rd clause is dropped). Approved by mhitch@ and is@
(copyright holders).
 1.31 13-Apr-2008  tsutsui branches: 1.31.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.30 17-Oct-2007  garbled branches: 1.30.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.29 20-Aug-2007  is branches: 1.29.2;
First part of amigappc support patches by Frank Wille.
 1.28 11-Mar-2007  he branches: 1.28.8; 1.28.12; 1.28.16;
Correct a thinko of mine in the previous change, pointed out by
is@. Even though the argument type changes as an effect of the
caddr_t removal, there really is no need to indirect where we didn't
before. Instead, add the appropriate cast.
 1.27 05-Mar-2007  he branches: 1.27.2;
Fix one missing indirection causing a type conflict, and use char* for
pointer arithmetic.
 1.26 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.25 29-Mar-2006  thorpej branches: 1.25.14;
Use device_cfdata().
 1.24 08-Mar-2006  lukem branches: 1.24.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.23 11-Dec-2005  christos branches: 1.23.4; 1.23.6; 1.23.8; 1.23.10;
merge ktrace-lwp.
 1.22 13-Jun-2005  jmc branches: 1.22.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.21 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.20 01-Apr-2003  thorpej branches: 1.20.2;
Use PAGE_SIZE rather than NBPG.
 1.19 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.18 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.17 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.16 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.15 25-Apr-2001  bouyer branches: 1.15.2; 1.15.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.14 05-Jun-2000  tsutsui branches: 1.14.4;
Adapt MI ncr53c9x changes.
 1.13 30-Sep-1999  thorpej branches: 1.13.2; 1.13.10;
Update for SCSIPI changes.
 1.12 25-Sep-1999  is vm_offset_t -> vaddr_t/paddr_t
 1.11 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.10 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.9 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.8 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.7 12-Jan-1998  thorpej Adjust for changes to config.
 1.6 24-Oct-1997  mhitch Check manufacturer and product codes correctly. The Blizzard 2060 driver
was trying to configure on a Cyberstorm MKI SCSI.
 1.5 04-Oct-1997  mhitch branches: 1.5.2;
Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.4 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.3 21-Jan-1997  thorpej branches: 1.3.6; 1.3.8;
Initialize max_target in the SCSI link.
 1.2 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.1 16-Dec-1996  is The original docs for the Phase 5 Development SCSI boards had a edito,
making me think that the Blizzard-IV and the Blizzard-2060 scsi
options have nearly identical DMA engines (just with a different
address offset). Alas, this isn't true.

Herewith I replace the "bznsc" (all-new-Blizzard-models) driver with the
"bztzsc" (Blizzard Two Zero).
 1.3.8.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.8.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.6.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.5.2.1 24-Oct-1997  mellon Pull rev 1.6 up from trunk
 1.13.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.13.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.14.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.15.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.15.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.15.8.1 25-Apr-2001  nathanw file bztzsc.c was added on branch nathanw_sa on 2002-02-28 04:06:33 +0000
 1.15.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.15.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.20.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.22.2.2 03-Sep-2007  yamt sync with head.
 1.22.2.1 21-Jun-2006  yamt sync with head.
 1.23.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.23.8.2 01-Apr-2006  yamt sync with head.
 1.23.8.1 13-Mar-2006  yamt sync with head.
 1.23.6.1 22-Apr-2006  simonb Sync with head.
 1.23.4.1 09-Sep-2006  rpaulo sync with head
 1.24.2.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.25.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.2.2 09-Oct-2007  ad Sync with head.
 1.27.2.1 13-Mar-2007  ad Sync with head.
 1.28.16.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.28.12.1 03-Sep-2007  skrll Sync with HEAD.
 1.28.8.1 03-Oct-2007  garbled Sync with HEAD
 1.29.2.1 06-Nov-2007  matt sync with HEAD
 1.30.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.31.4.2 11-Aug-2010  yamt sync with head.
 1.31.4.1 11-Mar-2010  yamt sync with head
 1.33.4.2 05-Mar-2011  rmind sync with head
 1.33.4.1 03-Jul-2010  rmind sync with head
 1.33.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.33.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.36.60.1 10-Jun-2019  christos Sync with HEAD
 1.36.58.2 18-Jan-2019  pgoyette Synch with HEAD
 1.36.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2 05-Oct-1997  veego Unused files after the sfas driver is replaced by the MI ncr53c9x driver.
 1.1 16-Dec-1996  is branches: 1.1.10;
The original docs for the Phase 5 Development SCSI boards had a edito,
making me think that the Blizzard-IV and the Blizzard-2060 scsi
options have nearly identical DMA engines (just with a different
address offset). Alas, this isn't true.

Herewith I replace the "bznsc" (all-new-Blizzard-models) driver with the
"bztzsc" (Blizzard Two Zero).
 1.1.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.4 13-Apr-2008  tsutsui branches: 1.4.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.3 25-Sep-1999  is branches: 1.3.138;
vm_offset_t -> vaddr_t/paddr_t
 1.2 04-Oct-1997  mhitch Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.1 16-Dec-1996  is branches: 1.1.10;
The original docs for the Phase 5 Development SCSI boards had a edito,
making me think that the Blizzard-IV and the Blizzard-2060 scsi
options have nearly identical DMA engines (just with a different
address offset). Alas, this isn't true.

Herewith I replace the "bznsc" (all-new-Blizzard-models) driver with the
"bztzsc" (Blizzard Two Zero).
 1.1.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.138.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.4.1 11-Mar-2010  yamt sync with head
 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 27-Oct-2012  chs branches: 1.21.18; 1.21.28; 1.21.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.20 10-Jan-2012  rkujawa branches: 1.20.6;
Changes to Phase5 hardware support:
- Rework p5pb driver - simplify, cleanup, make more flexible.
- Add p5membar driver, which handles PCI resources autoconfigured by the firmware.
- Introduce intermediate p5bus layer, between zbus and CSPPC/BPPC on-board devices (p5pb, cbiiisc, bppcsc).
- Add experimental G-REX support to p5pb (first slot support only).
- Split CV64/3D PCI bridge support into separate cv3dpb driver (to be committed later).

Approved by phx.
 1.19 20-Dec-2010  matt branches: 1.19.8; 1.19.12;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.18 05-Feb-2010  phx branches: 1.18.4;
Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.17 09-Jan-2009  mhitch This driver doesn't use sicallbacks, so don't bother pre-allocating one.
Probably left over from a copy/edit of the zssc driver.
 1.16 13-Jun-2008  cegger branches: 1.16.4;
use device_lookup_private to get softc
 1.15 08-Mar-2006  lukem branches: 1.15.64; 1.15.66; 1.15.68; 1.15.70; 1.15.72;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.14 11-Dec-2005  christos branches: 1.14.4; 1.14.6; 1.14.8; 1.14.10;
merge ktrace-lwp.
 1.13 28-Mar-2004  mhitch branches: 1.13.16;
Remove license clauses 3 and 4 in my licenses.
 1.12 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.11 09-Apr-2003  thorpej branches: 1.11.2;
Use PAGE_SIZE rather than NBPG.
 1.10 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 25-Apr-2001  bouyer branches: 1.6.2; 1.6.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.5 07-Jun-1999  is branches: 1.5.2; 1.5.14;
Check for an unterminated bus; if yes: complain and don't try to use this
bus. Without this, cbiiisc used to hang if nothing was connected.
Reported by Matthias Scheler. A similar method to avoid this was suggested
by Ralph Schmidt.
 1.4 06-Jun-1999  is Don't dump all the registers at attach time. It works now.
 1.3 26-Mar-1999  mhitch branches: 1.3.2; 1.3.4; 1.3.6;
More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.2 09-Mar-1999  is The SCSI clock is 50 MHz for this board.
 1.1 07-Mar-1999  is Added very preliminary version of Symbios 53c7[27]0c driver and Cyberstorm
Mk. III SCSI backend, by Michael Hitch.
XXX No wide transfers supported at the moment.
 1.3.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

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

synchronization to latest KAME will take place on HEAD branch soon.
 1.3.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.1 22-Jun-1999  perry pullup 1.4->1.5 (is): disable adapter if completely unterminated
 1.5.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.2.3 29-Mar-2001  bouyer Make these pass a compile test on i386.
 1.5.2.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.6.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.1 25-Apr-2001  nathanw file cbiiisc.c was added on branch nathanw_sa on 2002-02-28 04:06:34 +0000
 1.6.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 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.16.1 21-Jun-2006  yamt sync with head.
 1.14.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.14.8.1 13-Mar-2006  yamt sync with head.
 1.14.6.1 22-Apr-2006  simonb Sync with head.
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.15.72.1 18-Jun-2008  simonb Sync with head.
 1.15.70.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.15.68.2 11-Mar-2010  yamt sync with head
 1.15.68.1 04-May-2009  yamt sync with head.
 1.15.66.1 17-Jun-2008  yamt sync with head.
 1.15.64.2 17-Jan-2009  mjf Sync with HEAD.
 1.15.64.1 29-Jun-2008  mjf Sync with HEAD.
 1.16.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.18.4.1 05-Mar-2011  rmind sync with head
 1.19.12.1 18-Feb-2012  mrg merge to -current.
 1.19.8.2 30-Oct-2012  yamt sync with head
 1.19.8.1 17-Apr-2012  yamt sync with head
 1.20.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.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.21.28.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.21.18.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.21.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.22.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.34 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.33 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.32 20-Dec-2010  matt branches: 1.32.58; 1.32.60;
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.31 18-Oct-2010  phx opt_m68k_arch.h can only be included when compiling for amiga/68k.
 1.30 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.29 23-Nov-2009  rmind branches: 1.29.2; 1.29.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.28 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.27 13-Apr-2008  tsutsui branches: 1.27.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.26 17-Oct-2007  garbled branches: 1.26.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.25 20-Aug-2007  is branches: 1.25.2;
First part of amigappc support patches by Frank Wille.
 1.24 11-Mar-2007  he branches: 1.24.8; 1.24.12; 1.24.16;
Correct a thinko of mine in the previous change, pointed out by
is@. Even though the argument type changes as an effect of the
caddr_t removal, there really is no need to indirect where we didn't
before. Instead, add the appropriate cast.
 1.23 05-Mar-2007  he branches: 1.23.2;
Fix one missing indirection causing a type conflict, and use char* for
pointer arithmetic.
 1.22 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.21 29-Mar-2006  thorpej branches: 1.21.14;
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 13-Jun-2005  jmc branches: 1.18.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.17 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.16 01-Apr-2003  thorpej branches: 1.16.2;
Use PAGE_SIZE rather than NBPG.
 1.15 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.12 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.11 25-Apr-2001  bouyer branches: 1.11.2; 1.11.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.10 05-Jun-2000  tsutsui branches: 1.10.4;
Adapt MI ncr53c9x changes.
 1.9 30-Sep-1999  thorpej branches: 1.9.2; 1.9.10;
Update for SCSIPI changes.
 1.8 25-Sep-1999  is vm_offset_t -> vaddr_t/paddr_t
 1.7 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.6 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.5 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.4 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.3 12-Jan-1998  thorpej Adjust for changes to config.
 1.2 24-Oct-1997  mhitch Check manufacturer and product codes correctly. The Blizzard 2060 driver
was trying to configure on a Cyberstorm MKI SCSI.
 1.1 04-Oct-1997  mhitch branches: 1.1.2; 1.1.4;
Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.1.4.1 24-Oct-1997  mellon Pull rev 1.2 up from trunk
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 04-Oct-1997  thorpej file cbiisc.c was added on branch marc-pcmcia on 1997-10-14 08:26:22 +0000
 1.9.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.10.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.11.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.11.8.1 25-Apr-2001  nathanw file cbiisc.c was added on branch nathanw_sa on 2002-02-28 04:06:34 +0000
 1.11.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.11.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.16.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.18.2.2 03-Sep-2007  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.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.21.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.2.2 09-Oct-2007  ad Sync with head.
 1.23.2.1 13-Mar-2007  ad Sync with head.
 1.24.16.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.24.12.1 03-Sep-2007  skrll Sync with HEAD.
 1.24.8.1 03-Oct-2007  garbled Sync with HEAD
 1.25.2.1 06-Nov-2007  matt sync with HEAD
 1.26.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.27.4.2 11-Aug-2010  yamt sync with head.
 1.27.4.1 11-Mar-2010  yamt sync with head
 1.29.4.2 05-Mar-2011  rmind sync with head
 1.29.4.1 03-Jul-2010  rmind sync with head
 1.29.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.29.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.32.60.1 10-Jun-2019  christos Sync with HEAD
 1.32.58.2 18-Jan-2019  pgoyette Synch with HEAD
 1.32.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.3 13-Apr-2008  tsutsui branches: 1.3.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.2 25-Sep-1999  is branches: 1.2.138;
vm_offset_t -> vaddr_t/paddr_t
 1.1 04-Oct-1997  mhitch branches: 1.1.2;
Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 04-Oct-1997  thorpej file cbiiscvar.h was added on branch marc-pcmcia on 1997-10-14 08:26:24 +0000
 1.2.138.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.4.1 11-Mar-2010  yamt sync with head
 1.35 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.34 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.33 20-Dec-2010  matt branches: 1.33.58; 1.33.60;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.32 18-Oct-2010  phx opt_m68k_arch.h can only be included when compiling for amiga/68k.
 1.31 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.30 23-Nov-2009  rmind branches: 1.30.2; 1.30.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.29 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.28 13-Apr-2008  tsutsui branches: 1.28.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.27 17-Oct-2007  garbled branches: 1.27.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.26 20-Aug-2007  is branches: 1.26.2;
First part of amigappc support patches by Frank Wille.
 1.25 11-Mar-2007  he branches: 1.25.8; 1.25.12; 1.25.16;
Correct a thinko of mine in the previous change, pointed out by
is@. Even though the argument type changes as an effect of the
caddr_t removal, there really is no need to indirect where we didn't
before. Instead, add the appropriate cast.
 1.24 05-Mar-2007  he branches: 1.24.2;
Fix one missing indirection causing a type conflict, and use char* for
pointer arithmetic.
 1.23 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 29-Mar-2006  thorpej branches: 1.22.14;
Use device_cfdata().
 1.21 08-Mar-2006  lukem branches: 1.21.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.20 11-Dec-2005  christos branches: 1.20.4; 1.20.6; 1.20.8; 1.20.10;
merge ktrace-lwp.
 1.19 13-Jun-2005  jmc branches: 1.19.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.18 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.17 01-Apr-2003  thorpej branches: 1.17.2;
Use PAGE_SIZE rather than NBPG.
 1.16 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.15 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.14 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.13 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.12 25-Apr-2001  bouyer branches: 1.12.2; 1.12.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.11 05-Jun-2000  tsutsui branches: 1.11.4;
Adapt MI ncr53c9x changes.
 1.10 30-Sep-1999  thorpej branches: 1.10.2; 1.10.10;
Update for SCSIPI changes.
 1.9 25-Sep-1999  is vm_offset_t -> vaddr_t/paddr_t
 1.8 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.7 14-Nov-1998  mhitch Some CyberStorm MK I SCSI modules use the same product ID as the Fastlane.
Add a check for that product ID and not a Zorro III address.
 1.6 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.5 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.4 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.3 12-Jan-1998  thorpej Adjust for changes to config.
 1.2 24-Oct-1997  mhitch Check manufacturer and product codes correctly. The Blizzard 2060 driver
was trying to configure on a Cyberstorm MKI SCSI.
 1.1 04-Oct-1997  mhitch branches: 1.1.2; 1.1.4;
Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.1.4.2 22-Nov-1998  cgd pull up rev 1.7 from trunk (mhitch)
 1.1.4.1 24-Oct-1997  mellon Pull rev 1.2 up from trunk
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 04-Oct-1997  thorpej file cbsc.c was added on branch marc-pcmcia on 1997-10-14 08:26:25 +0000
 1.10.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.11.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.12.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.12.8.1 25-Apr-2001  nathanw file cbsc.c was added on branch nathanw_sa on 2002-02-28 04:06:34 +0000
 1.12.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.12.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.17.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.2.2 03-Sep-2007  yamt sync with head.
 1.19.2.1 21-Jun-2006  yamt sync with head.
 1.20.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.20.8.2 01-Apr-2006  yamt sync with head.
 1.20.8.1 13-Mar-2006  yamt sync with head.
 1.20.6.1 22-Apr-2006  simonb Sync with head.
 1.20.4.1 09-Sep-2006  rpaulo sync with head
 1.21.2.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.22.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.2.2 09-Oct-2007  ad Sync with head.
 1.24.2.1 13-Mar-2007  ad Sync with head.
 1.25.16.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.25.12.1 03-Sep-2007  skrll Sync with HEAD.
 1.25.8.1 03-Oct-2007  garbled Sync with HEAD
 1.26.2.1 06-Nov-2007  matt sync with HEAD
 1.27.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.28.4.2 11-Aug-2010  yamt sync with head.
 1.28.4.1 11-Mar-2010  yamt sync with head
 1.30.4.2 05-Mar-2011  rmind sync with head
 1.30.4.1 03-Jul-2010  rmind sync with head
 1.30.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.30.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.33.60.1 10-Jun-2019  christos Sync with HEAD
 1.33.58.2 18-Jan-2019  pgoyette Synch with HEAD
 1.33.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.3 13-Apr-2008  tsutsui branches: 1.3.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.2 25-Sep-1999  is branches: 1.2.138;
vm_offset_t -> vaddr_t/paddr_t
 1.1 04-Oct-1997  mhitch branches: 1.1.2;
Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 04-Oct-1997  thorpej file cbscvar.h was added on branch marc-pcmcia on 1997-10-14 08:26:27 +0000
 1.2.138.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.4.1 11-Mar-2010  yamt sync with head
 1.59 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.58 03-Jul-2020  maxv hardclock_ticks -> getticks()
 1.57 29-May-2020  rin For clk_timecounter:
- Use C99 initializer.
- Leave .tc_name NULL initially.
No functional changes.
 1.56 19-May-2020  rin Round amiga_clk_interval to the nearest integer, in order to emulate
100 Hz clock better by that running at PAL frequency (709379 Hz).

No functional changes for systems running at NTSC freq (715909 Hz).
 1.55 12-Nov-2015  phx Use the MD_BTOP() macro as replacement for m68k_btop() in all device
drivers which are shared with amigappc.
 1.54 27-Oct-2012  chs branches: 1.54.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.53 03-Jun-2011  matt branches: 1.53.2; 1.53.12;
CFATTACH_DECL_NEW, device_t, cfdata_t
 1.52 08-Feb-2011  rmind branches: 1.52.2;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.51 12-Dec-2009  phx branches: 1.51.4; 1.51.6; 1.51.8;
Reverted the CIA-timer based delay() to the pre-5.0 method of a calibrated
delay loop.
This fixes keyboard handshaking problems with some A1200 models since 5.0
and restores the precision for short delays on DraCo systems (the QuickLogic
timer has only a seventh of the CIA precision).
Changed the keyboard handshaking delay from 2000 back to 200ms, although
even the recommended 85ms were successfully tested on the most problematic
A1200 keyboards.
All those changes were tested on an A3000 and A1200 with 68060/50 CPU, and
previously discussed on the port-amiga ML.
 1.50 11-Sep-2009  phx Handle the situation of a wrapped interval counter, while the hardclock()
interrupt was not yet executed to update the hardclock_ticks variable.
 1.49 11-Sep-2009  phx Reverted last change after discussion with the author, Michael L. Hitch:
http://mail-index.netbsd.org/port-amiga/2009/08/14/msg007164.html
We have a full 32-bit counter, so the masking is not needed.
 1.48 07-Dec-2008  mhitch Fix timecounters using interval timers: amiga counters are not 32 bits,
so the tc_counter_mask needs to be set based on the interval timer.
Process cpu usage was returning negative or very large values.
 1.47 06-Jan-2008  mhitch branches: 1.47.6; 1.47.10; 1.47.16; 1.47.18; 1.47.20;
Add timecounter support and borrow counter-based delay from i386.
From joerg; testing and final tweaks by me.
 1.46 04-Mar-2007  christos branches: 1.46.20; 1.46.26; 1.46.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.45 05-Sep-2006  mhitch branches: 1.45.8;
Switch amiga to MI todr.
 1.44 11-Dec-2005  christos branches: 1.44.4; 1.44.8;
merge ktrace-lwp.
 1.43 13-Jun-2005  jmc branches: 1.43.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.42 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.41 02-Oct-2002  thorpej branches: 1.41.6;
Use CFATTACH_DECL().
 1.40 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.39 14-May-2002  matt Eliminate commons. (including a few unused or mismatched ones).
 1.38 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.37 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.36 15-Mar-2001  chs branches: 1.36.2; 1.36.8;
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.35 29-Jun-2000  mrg branches: 1.35.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.34 14-Mar-1999  is branches: 1.34.8;
Use the 1/256s-resolution when reading the DraCo battery backed clock
 1.33 26-Jul-1998  is yet more atomic operations accessing DraCo registers
 1.32 12-Jan-1998  thorpej Adjust for changes to config.
 1.31 15-Sep-1997  is Only create verbose delay loop calibration message for DIAGNOSTIC kernels.
 1.30 19-Jul-1997  is branches: 1.30.2;
Make Amiga battery clocks autoconfiguration devices, so that they can be
left out of specialized configurations.
 1.29 17-Jul-1997  is Make the DraCo hardware clock an autoconfiguration device.
 1.28 06-Jul-1997  is Implement the RTC_OFFSET kernel option/rtc_offset variable for the Amiga port.
To get the old behaviour, set options RTC_OFFSET=0 in your kernel configuration
file.
 1.27 06-Jul-1997  is A first hack at DraCo real-time clock support; only reads clock, currently.
Also only whole seconds are used (while the hardware provides 1/256 seconds).
 1.26 25-May-1997  veego Converted for the use of sys/dev/clock_subr.[ch].
Add some comments about the a2000 oki clock chip and stop the clock while
writing.
 1.25 02-Jan-1997  is Use the right parameter to decide whether it's early configuration. (I wonder
why this worked with some configurations... it shouldn't have).

While we're here, correct the 2.4% error in the delay divisor message.
 1.24 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.23 17-Dec-1996  is Make clock an early configuration device, configured before early console
configuration. This way, the delay loop is calibrated before graphics and
serial hardware is touched.

This change should smooth pr 2890 by Thorsten Frueauf (also privately
reported by Laurent Badoukh). While the real problem with those is the
paranoically high delay() calls in the grf_cl initialization, it was made
even more visible by the miscalibrated (to the save side) new style delay
loop.
 1.22 14-Oct-1996  is KNF patrol.
 1.21 13-Oct-1996  christos backout previous kprintf change
 1.20 11-Oct-1996  mhitch Fix compile errors when not configured for the Draco.
 1.19 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.18 29-Sep-1996  is a) replace our delay() with a Gordon Ross style one, calibrated at
clock_attach() time (for now).
This removes our dependance on the DraCo ROM access timing and frees
the second CIA on Amigas.
b) support for DraCo rev. >= 4 native timer chips.
 1.17 20-Jun-1996  is Use the right microsecond delay address. To achieve this, also map that
piece of hardware into kernel virtual memory (was only a guess 'til now).
XXX Unfortunately, the hardware vendor reserves the right to change this in
future DraCo revisions. We must rethink delay() and DELAY(), at least for the
DraCo, soon.
 1.16 18-Jun-1996  is Don't use the inline assembler 64bit integer division if our kernel might
run on 68060. Some graphics boards need delay() in early initialization (that
is, before initcpu() was called.
 1.15 10-May-1996  is branches: 1.15.4;
Clean up the mess I left over from my yestereve's commit: partially unused
variables left over from color background debugging, partially wrong #ifdefs
making some variables unused in non-M68060 kernels.
 1.14 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.13 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.12 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.11 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.10 20-Feb-1995  chopps rtc now reads and writes erbe0011@FH-Karlsruhe.DE (Bernd Ernesti)
 1.9 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.8 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 16-Jun-1994  chopps fix boot diag output.
 1.4 15-Jun-1994  chopps clock now uses passed in frequency if present protect dma cache
flush calls from non 040. don't compile ite_xx if not used.
 1.3 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 09-May-1994  chopps update for recent sig changes and fix clock.c and ite.c
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.15.4.2 21-Jun-1996  jtc Pulled up from version 1.17 by request from ignatios.

"use correct rather than guessed microsecond delay address in
delay() and DELAY() on the DraCo".,
 1.15.4.1 18-Jun-1996  is From trunk, to avoid kernel panics during initialization:
Don't use inline assembler 64bit division if we might run on 68060.
Some graphics drivers need deley during early console initialization (that
is, before initcpu() has installed the emulation software).
 1.30.2.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.34.8.2 27-Mar-2001  bouyer Sync with HEAD.
 1.34.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.35.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.36.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.36.8.5 24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.36.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.36.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.36.8.2 17-Nov-2001  scw curproc now points to a struct lwp.
 1.36.8.1 15-Mar-2001  scw file clock.c was added on branch nathanw_sa on 2001-11-17 23:08:32 +0000
 1.36.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.36.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.36.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.41.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.41.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.41.6.1 03-Aug-2004  skrll Sync with HEAD
 1.43.2.3 21-Jan-2008  yamt sync with head
 1.43.2.2 03-Sep-2007  yamt sync with head.
 1.43.2.1 30-Dec-2006  yamt sync with head.
 1.44.8.1 14-Sep-2006  yamt sync with head.
 1.44.4.1 09-Sep-2006  rpaulo sync with head
 1.45.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.46.32.1 08-Jan-2008  bouyer Sync with HEAD
 1.46.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.46.20.1 09-Jan-2008  matt sync with HEAD
 1.47.20.4 16-Jul-2010  riz Pull up following revision(s) (requested by phx in ticket #1412):
sys/arch/amiga/dev/clock.c: revision 1.51
sys/arch/amiga/amiga/locore.s: revision 1.149 via patch
sys/arch/amiga/dev/kbd.c: revision 1.53
sys/arch/amiga/amiga/amiga_init.c: revision 1.118
Reverted the CIA-timer based delay() to the pre-5.0 method of a calibrated
delay loop.
This fixes keyboard handshaking problems with some A1200 models since 5.0
and restores the precision for short delays on DraCo systems (the QuickLogic
timer has only a seventh of the CIA precision).
Changed the keyboard handshaking delay from 2000 back to 200ms, although
even the recommended 85ms were successfully tested on the most problematic
A1200 keyboards.
All those changes were tested on an A3000 and A1200 with 68060/50 CPU, and
previously discussed on the port-amiga ML.
 1.47.20.3 03-Oct-2009  snj Pull up following revision(s) (requested by mhitch in ticket #1049):
sys/arch/amiga/dev/clock.c: revision 1.49
Reverted last change after discussion with the author, Michael L. Hitch:
http://mail-index.netbsd.org/port-amiga/2009/08/14/msg007164.html
We have a full 32-bit counter, so the masking is not needed.
 1.47.20.2 26-Sep-2009  snj Pull up following revision(s) (requested by phx in ticket #1011):
sys/arch/amiga/dev/clock.c: revision 1.50
Handle the situation of a wrapped interval counter, while the hardclock()
interrupt was not yet executed to update the hardclock_ticks variable.
 1.47.20.1 10-Dec-2008  snj branches: 1.47.20.1.4;
Pull up following revision(s) (requested by mhitch in ticket #172):
sys/arch/amiga/dev/clock.c: revision 1.48
Fix timecounters using interval timers: amiga counters are not 32 bits,
so the tc_counter_mask needs to be set based on the interval timer.
Process cpu usage was returning negative or very large values.
 1.47.20.1.4.1 21-Apr-2010  matt sync to netbsd-5
 1.47.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.47.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.47.10.3 11-Mar-2010  yamt 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.47.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.51.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.51.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.51.4.2 12-Jun-2011  rmind sync with head
 1.51.4.1 05-Mar-2011  rmind sync with head
 1.52.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.53.12.2 03-Dec-2017  jdolecek update from HEAD
 1.53.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.53.2.1 30-Oct-2012  yamt sync with head
 1.54.14.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.6 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.5 08-Feb-2011  rmind branches: 1.5.14; 1.5.32;
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.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106; 1.4.108;
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 26-Oct-1994  cgd branches: 1.2.66;
new RCS ID format.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.4.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 05-Mar-2011  rmind sync with head
 1.5.32.1 22-Sep-2015  skrll Sync with HEAD
 1.5.14.1 03-Dec-2017  jdolecek update from HEAD
 1.31 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.30 19-Jul-2011  dyoung branches: 1.30.52; 1.30.54;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.29 22-Jan-2011  tsutsui Adjust sc_frequency in MD attachment as quirks.
It is not applicable to all 1665x variants.

XXX: It looks IOBlix board actually has 22.1184MHz OSC without clock divisor
http://amiga.resource.cx/photos/gallery/ioblix.jpg
so needs to investigate why we have to divide sc_frequency by four
to get right baud rate on IOBlix com. (firmware sets MCR_PRESCALE?)
 1.28 02-Feb-2010  phx branches: 1.28.4; 1.28.6; 1.28.8;
Fix compilation warnings and errors with amigappc.
 1.27 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.26 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.25 14-Mar-2008  cube branches: 1.25.2; 1.25.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.24 04-Mar-2008  he Fix reference to sc_dev so that this builds again.
 1.23 29-Feb-2008  dyoung Use pmf_device_register1() instead of shutdownhook_establish() to
register com_cleanup() as the shutdown hook.

Add a generic suspend routine. Suspend and resume com@isa.

Protect against dereferencing a NULL softc in comioctl().

Destroy both a mutex and a callout in com_detach().

Cosmetic: use aprint_*_dev(). Use PMF_FN_ARGS, PMF_FN_PROTO.
 1.22 21-Dec-2006  yamt branches: 1.22.24; 1.22.40; 1.22.44;
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.21 13-Jul-2006  gdamore branches: 1.21.4; 1.21.6;
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.20 11-Dec-2005  christos branches: 1.20.4; 1.20.8; 1.20.16;
merge ktrace-lwp.
 1.19 07-Aug-2003  agc branches: 1.19.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.18 06-Jan-2003  wiz branches: 1.18.2;
interrupt with two rs.
 1.17 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.14 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.13 22-Jun-1999  is branches: 1.13.16; 1.13.20;
Align adresses better
 1.12 16-Sep-1998  is branches: 1.12.8;
Garbage collect unused 3rd parameter to comprobe1().
 1.11 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.10 10-Aug-1998  is Fix ommision in last backout.
 1.9 10-Aug-1998  is Back out last change --- it doesn't work this way
 1.8 09-Aug-1998  is Actually probe the hardware.
This is for HyperCom 3i slaveboards (to be done soon) that might or might not
sit on top of a HyperCom 3Z or HyperCom 4 or ISDN Blaster.
 1.7 11-Apr-1998  is amiga_ttyspl -> amiga_serialspl (and keep ttyspl constant at 4 again).
(Part of this change slipped in with my last machdep commit; thanks to
Matthias Scheler for pointing this out).
 1.6 10-Nov-1997  is Remove remnants from ISA com console attachment code, which caused, due
to missing variable initialization, a panic on the DraCo.
 1.5 16-Oct-1997  thorpej branches: 1.5.2;
Adjust for new home of "com" driver.
 1.4 16-Sep-1997  is Support for the upcoming NetBSD/Amiga Hypercom driver family:
* support chip clocks != COM_FREQ, by introducing sc_frequency (for the
mainline code) and adding a frequency parameter right after the rate
parameter to comcnattach() and com_kgdb_attach().
- Make com_isa and com_multi initialize sc_frequency to COM_FREQ.
- Make i386/machdep.c and alpha/dec_xxx.c call com*attach() with the freq.
parameter.
* supio_attach_args get two more fields: a sc_ipl and a sc_arg, both ints.
- com_supio uses the first for interupt establishment (all childs will, as
soon as they exist) and the 2nd for sc_frequency.
- drsupio passes sc_ipl alway as 5, and for the "com"s, sc_arg as 16*115200
- hyper will pass sc_ipl as 6, and sc_arg as 16 * 460800
 1.3 27-Aug-1997  is branches: 1.3.2;
Yet another BROKEN removed, and another small cleanup.
 1.2 27-Aug-1997  is Rename the _probe function to _match, and remove the
#ifdef _BROKEN_INDIRECT_CONFIG which we dont need here.
Thanks to Bernd Ernesti for pointing this out.
 1.1 27-Aug-1997  is Define supio, a direct bus with a single locator, the port number. This
is for "standard PC i/o stuff" at known and constant locations, e.g. when
multi-io chips are used on non-ISA mainboards.
Implement drsupio.c, the DraCo version of this.
Attach the generic com.c to this bus.
Remove the old drcom hack.
 1.3.2.4 16-Oct-1997  thorpej Sync w/ trunk.
 1.3.2.3 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.2.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.2.1 27-Aug-1997  thorpej file com_supio.c was added on branch marc-pcmcia on 1997-09-01 20:06:37 +0000
 1.5.2.1 12-Nov-1997  mellon Pull rev 1.6 up from trunk (is)
 1.12.8.1 01-Jul-1999  thorpej Sync w/ -current.
 1.13.20.3 07-Jan-2003  thorpej Sync with HEAD.
 1.13.20.2 18-Oct-2002  nathanw Catch up to -current.
 1.13.20.1 28-Feb-2002  nathanw Catch up to -current.
 1.13.16.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.13.16.1 11-Feb-2002  jdolecek Sync w/ -current.
 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.19.16.2 17-Mar-2008  yamt sync with head.
 1.19.16.1 30-Dec-2006  yamt sync with head.
 1.20.16.5 13-Jul-2006  gdamore Merge from HEAD.
 1.20.16.4 17-Jun-2006  gdamore Well, tweak this some more, we are returning COM_INIT_REGS, because it
just doesn't work to have a #define for sc_iot and company. Ugh.
 1.20.16.3 17-Jun-2006  gdamore Undo COM_INIT_REGS.
 1.20.16.2 16-Jun-2006  gdamore Attempt at KNF cleanup. Not tested since m68k tools don't work for cross
building from Solaris.
 1.20.16.1 16-Jun-2006  gdamore amiga com(4) rewhack. i can't cross-compile this from Solaris due to

sh /home/garrett/netbsd/src/sys/arch/m68k/fpsp/asm2gas /home/garrett/netbsd/src
/sys/arch/m68k/fpsp/fpsp.h >fpsp.defs
sed: # format canonicalization is an unrecognized command.
sed: # operator conversion is an unrecognized command.
sed: # operand conversion is an unrecognized command.
sed: # Floating point literal conversion is an unrecognized command.

so I am not entirely sure it even compiles. YMMV.
 1.20.8.1 11-Aug-2006  yamt sync with head
 1.20.4.1 09-Sep-2006  rpaulo sync with head
 1.21.6.1 29-Sep-2006  yamt implement splraiseipl/makeiplcookie for amiga.
 1.21.4.1 12-Jan-2007  ad Sync with head.
 1.22.44.2 02-Jun-2008  mjf Sync with HEAD.
 1.22.44.1 03-Apr-2008  mjf Sync with HEAD.
 1.22.40.1 24-Mar-2008  keiichi sync with head.
 1.22.24.1 23-Mar-2008  matt sync with HEAD
 1.25.4.2 11-Mar-2010  yamt sync with head
 1.25.4.1 16-May-2008  yamt sync with head.
 1.25.2.1 18-May-2008  yamt sync with head.
 1.28.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.28.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.28.4.1 05-Mar-2011  rmind sync with head
 1.30.54.1 10-Jun-2019  christos Sync with HEAD
 1.30.52.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.3 08-May-1994  mycroft Clean up deleted files.
 1.2 25-Mar-1994  chopps move HIST out of DEBUG conditional.
 1.1 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.14 30-May-2010  dholland another undead file
 1.13 04-Mar-2007  christos branches: 1.13.2; 1.13.6; 1.13.34; 1.13.44; 1.13.46; 1.13.48; 1.13.50;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.12 14-May-2006  elad branches: 1.12.8;
integrate kauth.
 1.11 05-Apr-1994  chopps branches: 1.11.10; 1.11.12; 1.11.28; 1.11.34; 1.11.44; 1.11.48; 1.11.50;
added floppy driver from Brad Pepers, doesn't work on my machine, some
major cleanup by me no code changes ... yet.
 1.10 28-Mar-1994  chopps some scsi changes, 4M system hack, and a boot messgae addition. from
Michael Hitch.
 1.9 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.8 21-Feb-1994  chopps fixed a couple minor bugs in con code for ite. added floptical support in
sd.c (based on patch from Andreas E. Heitman).
 1.7 11-Feb-1994  chopps Add missing Id's
 1.6 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.11.50.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.11.48.1 14-Sep-2006  yamt sync with head.
 1.11.44.1 09-Sep-2006  rpaulo sync with head
 1.11.34.1 03-Sep-2007  yamt sync with head.
 1.11.28.1 03-Aug-2004  skrll Sync with HEAD
 1.11.12.1 01-Oct-2001  fvdl Catch up with -current.
 1.11.10.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.12.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.13.50.1 30-May-2010  rmind sync with head
 1.13.48.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.13.46.1 24-Oct-2010  jym Sync with HEAD
 1.13.44.3 28-Apr-2009  skrll Sync with HEAD.
 1.13.44.2 19-Jan-2009  skrll Sync with HEAD.
 1.13.44.1 04-Mar-2007  skrll file device.h was added on branch nick-hppapmap on 2009-01-19 13:15:55 +0000
 1.13.34.1 11-Aug-2010  yamt sync with head.
 1.13.6.2 11-Jul-2007  mjf Sync with head.
 1.13.6.1 04-Mar-2007  mjf file device.h was added on branch mjf-ufs-trans on 2007-07-11 19:57:49 +0000
 1.13.2.2 09-Oct-2007  ad Sync with head.
 1.13.2.1 09-Jun-2007  ad Sync with head.
 1.3 30-Oct-1993  mycroft Clean up deleted files.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 30-Oct-1993  mycroft Clean up deleted files.
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.3 30-Oct-1993  mycroft Clean up deleted files.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 28-Mar-1995  jtc branches: 1.9.66;
KERNEL -> _KERNEL
 1.8 26-Oct-1994  cgd new RCS ID format.
 1.7 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.6 11-Feb-1994  chopps Add missing Id's
 1.5 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.9.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.66.1 03-Aug-2004  skrll Sync with HEAD
 1.22 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.21 07-Sep-2025  thorpej Keep the todr handle in the softc. Eliminate the global softc pointer; it's
not required.
 1.20 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.19 20-Dec-2010  matt branches: 1.19.8; 1.19.18;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.18 12-Dec-2009  tsutsui branches: 1.18.4;
Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
 1.17 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.16 07-Sep-2006  mhitch branches: 1.16.54; 1.16.56; 1.16.58;
Correct some error returns for gettod() and settod() left over from the
pre-todr code, and use actual E* return codes for any error return.
 1.15 05-Sep-2006  mhitch branches: 1.15.2;
Switch amiga to MI todr.
 1.14 20-Jun-2006  is Fix typo in comment
 1.13 11-Dec-2005  christos branches: 1.13.4; 1.13.8; 1.13.16;
merge ktrace-lwp.
 1.12 13-Jun-2005  jmc branches: 1.12.2;
Fix some shadowing of variables
 1.11 01-Apr-2003  thorpej branches: 1.11.2;
Use PAGE_SIZE rather than NBPG.
 1.10 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 16-Mar-2000  kleink branches: 1.6.8; 1.6.12;
Kill more broken cf_unit bogons.
 1.5 14-Mar-1999  is branches: 1.5.8;
Use the 1/256s-resolution when reading the DraCo battery backed clock
 1.4 16-Feb-1999  is Fix Copyright dates
 1.3 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.2 12-Jan-1998  thorpej Adjust for changes to config.
 1.1 17-Jul-1997  is Make the DraCo hardware clock an autoconfiguration device.
 1.5.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.6.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.6.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.11.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.2.2 30-Dec-2006  yamt sync with head.
 1.12.2.1 21-Jun-2006  yamt sync with head.
 1.13.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.13.8.2 14-Sep-2006  yamt sync with head.
 1.13.8.1 26-Jun-2006  yamt sync with head.
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.15.2.1 18-Nov-2006  ad Sync with head.
 1.16.58.2 11-Mar-2010  yamt sync with head
 1.16.58.1 16-May-2008  yamt sync with head.
 1.16.56.1 18-May-2008  yamt sync with head.
 1.16.54.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.4.1 05-Mar-2011  rmind sync with head
 1.19.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.19.8.1 30-Oct-2012  yamt sync with head
 1.3 27-Aug-1997  is Define supio, a direct bus with a single locator, the port number. This
is for "standard PC i/o stuff" at known and constant locations, e.g. when
multi-io chips are used on non-ISA mainboards.
Implement drsupio.c, the DraCo version of this.
Attach the generic com.c to this bus.
Remove the old drcom hack.
 1.2 23-Dec-1996  veego branches: 1.2.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.1 30-Nov-1996  is com.c variant for the 16550 core on the DraCo superio chip.
drisavar.h pretends to provide a few bus.h macros, hardwired to
that chip.

This should eventually be replaced by attachment code for the normal
com.c driver, once that one is split up into chip core driver and
attachment code, and once we have busxxx macros in NetBSD/Amiga.
 1.2.10.1 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2 27-Aug-1997  is Define supio, a direct bus with a single locator, the port number. This
is for "standard PC i/o stuff" at known and constant locations, e.g. when
multi-io chips are used on non-ISA mainboards.
Implement drsupio.c, the DraCo version of this.
Attach the generic com.c to this bus.
Remove the old drcom hack.
 1.1 30-Nov-1996  is branches: 1.1.10;
com.c variant for the 16550 core on the DraCo superio chip.
drisavar.h pretends to provide a few bus.h macros, hardwired to
that chip.

This should eventually be replaced by attachment code for the normal
com.c driver, once that one is split up into chip core driver and
attachment code, and once we have busxxx macros in NetBSD/Amiga.
 1.1.10.1 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2 27-Aug-1997  is Define supio, a direct bus with a single locator, the port number. This
is for "standard PC i/o stuff" at known and constant locations, e.g. when
multi-io chips are used on non-ISA mainboards.
Implement drsupio.c, the DraCo version of this.
Attach the generic com.c to this bus.
Remove the old drcom hack.
 1.1 30-Nov-1996  is branches: 1.1.10;
com.c variant for the 16550 core on the DraCo superio chip.
drisavar.h pretends to provide a few bus.h macros, hardwired to
that chip.

This should eventually be replaced by attachment code for the normal
com.c driver, once that one is split up into chip core driver and
attachment code, and once we have busxxx macros in NetBSD/Amiga.
 1.1.10.1 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2 27-Aug-1997  is This is no longer needed.
 1.1 30-Nov-1996  is branches: 1.1.10;
com.c variant for the 16550 core on the DraCo superio chip.
drisavar.h pretends to provide a few bus.h macros, hardwired to
that chip.

This should eventually be replaced by attachment code for the normal
com.c driver, once that one is split up into chip core driver and
attachment code, and once we have busxxx macros in NetBSD/Amiga.
 1.1.10.1 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.35 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.34 24-Apr-2021  thorpej branches: 1.34.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.33 22-Mar-2014  christos branches: 1.33.10; 1.33.20; 1.33.44;
kill sprintf
fix unused variables
 1.32 27-Oct-2012  chs branches: 1.32.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.31 20-Dec-2010  matt branches: 1.31.8; 1.31.18;
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.30 19-May-2009  phx branches: 1.30.4;
Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.29 13-Jun-2008  cegger use device_lookup_private to get softc
 1.28 11-Dec-2005  christos branches: 1.28.74; 1.28.76; 1.28.78; 1.28.80; 1.28.82;
merge ktrace-lwp.
 1.27 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.26 25-Mar-2004  is Only change my own license conditions.
 1.25 25-Mar-2004  is UCB no longer requires the advertising clause.
 1.24 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.23 01-Apr-2003  thorpej branches: 1.23.2;
Use PAGE_SIZE rather than NBPG.
 1.22 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.21 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.19 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.18 25-Apr-2001  bouyer branches: 1.18.2; 1.18.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.17 16-Mar-2000  kleink branches: 1.17.6;
Kill more broken cf_unit bogons.
 1.16 16-Jan-2000  is Yet another cpu.h.
 1.15 05-Dec-1998  mjacob branches: 1.15.10;
Update HBAs to incorporate the new max_lun property.
 1.14 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.13 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.12 26-Jul-1998  is yet more atomic operations accessing DraCo registers
 1.11 12-Jan-1998  thorpej Adjust for changes to config.
 1.10 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.9 23-Dec-1996  veego branches: 1.9.8; 1.9.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.8 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.7 30-Nov-1996  is Make sure autoconfiguration is searching for _us_. There is more than
one DraCo specific device on the DraCo mainbus.
 1.6 13-Oct-1996  christos backout previous kprintf change
 1.5 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.3 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.2 19-May-1996  is Yet some more cleanup for missing prototypes, if DRACO is supported.
 1.1 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.9.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.15.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.17.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.18.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.18.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.18.8.1 25-Apr-2001  nathanw file drsc.c was added on branch nathanw_sa on 2002-02-28 04:06:35 +0000
 1.18.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.18.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.23.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.23.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.82.1 18-Jun-2008  simonb Sync with head.
 1.28.80.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.28.78.2 20-Jun-2009  yamt sync with head
 1.28.78.1 04-May-2009  yamt sync with head.
 1.28.76.1 17-Jun-2008  yamt sync with head.
 1.28.74.1 29-Jun-2008  mjf Sync with HEAD.
 1.30.4.1 05-Mar-2011  rmind sync with head
 1.31.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.31.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.31.8.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.31.8.1 30-Oct-2012  yamt sync with head
 1.32.2.1 18-May-2014  rmind sync with head
 1.33.44.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.33.20.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.33.10.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.33.10.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.34.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 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 27-Oct-2012  chs branches: 1.21.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.20 19-Jul-2011  dyoung branches: 1.20.2; 1.20.12;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.19 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.18 28-Apr-2008  martin branches: 1.18.22;
Remove clause 3 and 4 from TNF licenses
 1.17 11-Dec-2005  christos branches: 1.17.74; 1.17.76; 1.17.78;
merge ktrace-lwp.
 1.16 13-Jun-2005  jmc Fix a ton of const/volatile issues shown with new warning flags
 1.15 01-Apr-2003  thorpej branches: 1.15.2;
Use PAGE_SIZE rather than NBPG.
 1.14 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.13 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 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 28-Jan-2002  aymeric branches: 1.10.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.9 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.8 16-Mar-2000  kleink branches: 1.8.8; 1.8.12;
Kill more broken cf_unit bogons.
 1.7 30-Dec-1999  is Rewrite of the Amiga bus_space machinery to prepare for the support of
the generic IDE driver and the PCMCIA slots.
 1.6 16-Feb-1999  is branches: 1.6.8;
Fix Copyright dates
 1.5 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.4 12-Jan-1998  thorpej Adjust for changes to config.
 1.3 27-Sep-1997  is First part of splitting lpt.c, and the NetBSD/Amiga "supio" frontend. Needs
a bit more work to allow an ISA frontend.
 1.2 16-Sep-1997  is Support for the upcoming NetBSD/Amiga Hypercom driver family:
* support chip clocks != COM_FREQ, by introducing sc_frequency (for the
mainline code) and adding a frequency parameter right after the rate
parameter to comcnattach() and com_kgdb_attach().
- Make com_isa and com_multi initialize sc_frequency to COM_FREQ.
- Make i386/machdep.c and alpha/dec_xxx.c call com*attach() with the freq.
parameter.
* supio_attach_args get two more fields: a sc_ipl and a sc_arg, both ints.
- com_supio uses the first for interupt establishment (all childs will, as
soon as they exist) and the 2nd for sc_frequency.
- drsupio passes sc_ipl alway as 5, and for the "com"s, sc_arg as 16*115200
- hyper will pass sc_ipl as 6, and sc_arg as 16 * 460800
 1.1 27-Aug-1997  is branches: 1.1.2;
Define supio, a direct bus with a single locator, the port number. This
is for "standard PC i/o stuff" at known and constant locations, e.g. when
multi-io chips are used on non-ISA mainboards.
Implement drsupio.c, the DraCo version of this.
Attach the generic com.c to this bus.
Remove the old drcom hack.
 1.1.2.4 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.3 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 27-Aug-1997  thorpej file drsupio.c was added on branch marc-pcmcia on 1997-09-01 20:06:41 +0000
 1.6.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.8.12.4 03-Jan-2003  thorpej Sync with HEAD.
 1.8.12.3 18-Oct-2002  nathanw Catch up to -current.
 1.8.12.2 17-Sep-2002  nathanw Catch up to -current.
 1.8.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.8.8.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.8.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.10.8.1 16-May-2002  gehenna Include sys/conf.h directly.
 1.15.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.78.1 16-May-2008  yamt sync with head.
 1.17.76.1 18-May-2008  yamt sync with head.
 1.17.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.22.1 05-Mar-2011  rmind sync with head
 1.20.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.20.2.1 30-Oct-2012  yamt sync with head
 1.21.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.22.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.17 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.16 06-May-2023  andvar s/regster/register/ in comments and error messages.
 1.15 20-Oct-2017  jdolecek move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.14 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.13 04-Sep-2017  phx Remove double device pointers. The pointer is already part of sc_wdcdev.
 1.12 03-Jan-2014  rkujawa branches: 1.12.18;
Rework handling of Commodore Gayle chip. Avoid ugly struct casts, introduce
proper bus_space accesses and some abstraction layer. All drivers that utilised
Gayle also had to be refactored.

I tried not to break anything more, but this clearly needs more testing...
 1.11 31-Jul-2012  bouyer branches: 1.11.2; 1.11.4;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.10 26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.9 24-Jul-2012  jakllsch Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.
 1.8 15-Jul-2012  dsl Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.
 1.7 09-Jul-2012  rkujawa PR port-amiga/46672

Removed surpluss semicolon after if().
 1.6 02-Jul-2012  bouyer Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.5 05-Nov-2011  rkujawa Simplify bus space mapping.
 1.4 30-Oct-2011  rkujawa branches: 1.4.2;
Improve probe procedure in efa(4). Update man apge to reflect this.
 1.3 29-Oct-2011  rkujawa Allow 32-bit transfers for drives which support it. Add missing bus_space methods needed for such transfers.
 1.2 29-Oct-2011  rkujawa Fix style (pointed out by phx).
 1.1 27-Oct-2011  rkujawa Add driver for ELBOX FastATA 1200 Mk-III/Mk-IV (and the man page).
 1.4.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.4.2.2 30-Oct-2012  yamt sync with head
 1.4.2.1 10-Nov-2011  yamt sync with head
 1.11.4.1 18-May-2014  rmind sync with head
 1.11.2.2 03-Dec-2017  jdolecek update from HEAD
 1.11.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.18.2 27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.12.18.1 24-Apr-2017  jdolecek use ata_queue_alloc() to dynamically allocate ata_queue for ata channel
 1.3 03-Jan-2014  rkujawa Rework handling of Commodore Gayle chip. Avoid ugly struct casts, introduce
proper bus_space accesses and some abstraction layer. All drivers that utilised
Gayle also had to be refactored.

I tried not to break anything more, but this clearly needs more testing...
 1.2 29-Oct-2011  rkujawa branches: 1.2.2; 1.2.12; 1.2.16;
Fix style (pointed out by phx).
 1.1 27-Oct-2011  rkujawa Add driver for ELBOX FastATA 1200 Mk-III/Mk-IV (and the man page).
 1.2.16.1 18-May-2014  rmind sync with head
 1.2.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.2 04-Sep-2017  phx Remove double device pointers. The pointer is already part of sc_wdcdev.
 1.1 27-Oct-2011  rkujawa branches: 1.1.12; 1.1.42;
Add driver for ELBOX FastATA 1200 Mk-III/Mk-IV (and the man page).
 1.1.42.1 24-Apr-2017  jdolecek use ata_queue_alloc() to dynamically allocate ata_queue for ata channel
 1.1.12.1 03-Dec-2017  jdolecek update from HEAD
 1.30 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.29 24-Apr-2021  thorpej branches: 1.29.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.28 22-Jan-2014  christos branches: 1.28.44;
gcc-4.8.x unused variable fixes
 1.27 27-Oct-2012  chs branches: 1.27.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.26 11-Dec-2005  christos branches: 1.26.112; 1.26.122;
merge ktrace-lwp.
 1.25 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.24 02-Oct-2002  thorpej branches: 1.24.6;
Use CFATTACH_DECL().
 1.23 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.22 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.21 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.20 25-Apr-2001  bouyer branches: 1.20.2; 1.20.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.19 10-Jan-1999  tron branches: 1.19.8; 1.19.20;
Don't use void pointer for arithmetic.
 1.18 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.17 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.16 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.15 12-Jan-1998  thorpej Adjust for changes to config.
 1.14 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.13 23-Dec-1996  veego branches: 1.13.8; 1.13.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.12 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.11 13-Oct-1996  christos backout previous kprintf change
 1.10 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.9 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.8 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.7 10-May-1996  is Back out last change, which was caused by a wrong way merge at home.
Sorry for the inconvenience.
 1.6 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.5 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.4 05-Apr-1996  is Typo in the new new config conversion fixed.
 1.3 28-Mar-1996  is The interrupt routine of the ivsc (and the empsc, which seems to have copied
it) looks truncated. At least the return(1) is missing, which I now add as
a first stopgap. Somebody needs to find out if anything else is missing for
these boards.
 1.2 28-Mar-1996  is Adapt to new attach scheme. Fix operator precedence error. Normalize
function name prefixes.
 1.1 28-Mar-1996  is Emplant SCSI driver backend by Sean Riddle and Bo Najdrovsky.
 1.13.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.19.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.19.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.20.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.20.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.20.8.1 25-Apr-2001  nathanw file empsc.c was added on branch nathanw_sa on 2002-02-28 04:06:35 +0000
 1.20.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.20.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.24.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.6.1 03-Aug-2004  skrll Sync with HEAD
 1.26.122.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.26.112.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.26.112.1 30-Oct-2012  yamt sync with head
 1.27.2.1 18-May-2014  rmind sync with head
 1.28.44.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.29.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.6 16-Feb-1995  mycroft Clean up deleted files.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.17 26-Sep-2021  thorpej Driver "kqfilter" entry points return an error code, so if an invalid
filter is requested, return EINVAL rather than 1.
 1.16 26-Sep-2021  thorpej Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89
 1.15 19-Dec-2020  thorpej Use sel{record,remove}_knote().
 1.14 25-Oct-2017  maya branches: 1.14.16;
Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- { a, b, c, d
+ {
+ .f_isfd = a,
+ .f_attach = b,
+ .f_detach = c,
+ .f_event = d,
};
 1.13 01-Mar-2008  rmind branches: 1.13.48;
Welcome to 4.99.55:

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

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

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

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.12 04-Mar-2007  christos branches: 1.12.20; 1.12.36; 1.12.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 11-Dec-2005  christos branches: 1.11.26;
merge ktrace-lwp.
 1.10 07-Aug-2003  agc branches: 1.10.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 26-Nov-2002  christos branches: 1.9.6;
si_ -> sel_
 1.8 23-Oct-2002  jdolecek merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.7 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.6 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.5 11-Oct-1996  mhitch branches: 1.5.42; 1.5.46;
Changes for poll(2).
 1.4 08-Oct-1996  thorpej Merge netbsd-1-2 branch back into mainline.
 1.3 26-Oct-1994  cgd branches: 1.3.6;
new RCS ID format.
 1.2 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.3.6.1 31-May-1996  is Add missing splx(). (from Jason Thorpe)
 1.5.46.3 11-Dec-2002  thorpej Sync with HEAD.
 1.5.46.2 11-Nov-2002  nathanw Catch up to -current
 1.5.46.1 28-Feb-2002  nathanw Catch up to -current.
 1.5.42.4 02-Oct-2002  jdolecek do not need the (void *) cast for kn_hook anymore
 1.5.42.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.5.42.2 12-Sep-2001  thorpej Fix a past'o.
 1.5.42.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.9.6.4 21-Nov-2004  skrll Adapt to branch.
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.3 17-Mar-2008  yamt sync with head.
 1.10.16.2 03-Sep-2007  yamt sync with head.
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.11.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.12.36.1 24-Mar-2008  keiichi sync with head.
 1.12.20.1 23-Mar-2008  matt sync with HEAD
 1.13.48.1 03-Dec-2017  jdolecek update from HEAD
 1.14.16.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.9 01-Mar-2008  rmind Welcome to 4.99.55:

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

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

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

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.8 04-Mar-2007  christos branches: 1.8.20; 1.8.36; 1.8.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 11-Dec-2005  christos branches: 1.7.26;
merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 23-Oct-2002  jdolecek branches: 1.5.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.4 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.3 11-Oct-1996  mhitch branches: 1.3.42; 1.3.46;
Changes for poll(2).
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.3.46.2 11-Nov-2002  nathanw Catch up to -current
 1.3.46.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.42.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.42.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.5.6.4 21-Nov-2004  skrll Adapt to branch.
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.3 17-Mar-2008  yamt sync with head.
 1.6.16.2 03-Sep-2007  yamt sync with head.
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.36.1 24-Mar-2008  keiichi sync with head.
 1.8.20.1 23-Mar-2008  matt sync with HEAD
 1.104 14-Oct-2023  andvar fix various typos in comments and documentation, mainly in word "between".
 1.103 13-Oct-2023  andvar s/fdstartegy/fdstrategy/ in comment.
 1.102 26-Aug-2023  andvar amiga/fdc(4): revert bp->b_bcount format specifiers from %ld to %d,
changed in rev 1.62. b_bcount has a type of int.

fixes FDDEBUG build.
 1.101 17-Jan-2022  andvar fix typos in comments.
 1.100 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.99 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.98 24-Apr-2021  thorpej branches: 1.98.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.97 03-Sep-2018  riastradh branches: 1.97.14;
Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.96 26-Apr-2015  mlelstv branches: 1.96.2; 1.96.8; 1.96.16; 1.96.18;
Use C99-style initializers for struct dkdriver.
 1.95 02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.94 31-Dec-2014  christos fix typo
 1.93 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.92 08-Aug-2014  joerg branches: 1.92.4;
Fix misspelling of binary and as logical and.
 1.91 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

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

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

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.88 22-Jan-2014  christos gcc-4.8.x unused variable fixes
 1.87 27-Oct-2012  chs branches: 1.87.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.86 03-Jun-2011  matt branches: 1.86.2; 1.86.12;
CFATTACH_DECL_NEW, device_t, cfdata_t
 1.85 20-Dec-2010  matt branches: 1.85.2; 1.85.6;
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.84 15-Jan-2010  dyoung branches: 1.84.4;
Use __arraycount().
 1.83 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.82 18-Mar-2009  cegger bcopy -> memcpy
 1.81 18-Mar-2009  cegger bzero -> memset
 1.80 13-Jan-2009  yamt branches: 1.80.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.79 11-Jun-2008  tsutsui branches: 1.79.4;
Use device_private() and device_lookup_private() to get softc.
 1.78 02-Jan-2008  ad branches: 1.78.6; 1.78.8; 1.78.10; 1.78.12; 1.78.14;
Merge vmlocking2 to head.
 1.77 17-Oct-2007  garbled branches: 1.77.2; 1.77.4; 1.77.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.76 08-Oct-2007  ad Missed brelse() change.
 1.75 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.74 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.73 20-Aug-2007  is branches: 1.73.2; 1.73.4;
First part of amigappc support patches by Frank Wille.
 1.72 29-Jul-2007  ad branches: 1.72.4;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.71 29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.70 09-Jul-2007  ad branches: 1.70.2; 1.70.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.69 05-Mar-2007  he branches: 1.69.2; 1.69.4; 1.69.10;
Use char* for pointer arithmetic.
 1.68 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.67 26-Mar-2006  thorpej branches: 1.67.14;
Use device_unit().
 1.66 11-Dec-2005  christos branches: 1.66.4; 1.66.6; 1.66.8; 1.66.10; 1.66.12;
merge ktrace-lwp.
 1.65 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.64 13-Jun-2005  jmc branches: 1.64.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.63 28-Oct-2004  yamt move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.62 14-Jul-2003  aymeric get rid of printf() warnings in the FDDEBUG case by using the right format
specifiers
 1.61 10-May-2003  thorpej branches: 1.61.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.60 03-May-2003  wiz DMA, not dma nor Dma.
 1.59 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.58 06-Jan-2003  wiz synchronous, not syncronous.
 1.57 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.56 01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

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

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

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.54 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.53 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.52 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.51 07-Aug-2002  hannken Convert to new device buffer queue interface.

Approved by: Ignatios Souvatzis <is@netbsd.org>
 1.50 28-Jan-2002  aymeric branches: 1.50.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.49 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.48 16-Sep-2001  wiz branches: 1.48.4;
Spell 'occurred' with two 'r's.
 1.47 13-Jan-2001  aymeric branches: 1.47.2; 1.47.4;
make this compile again
 1.46 20-Nov-2000  chs 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.45 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.44 16-Mar-2000  kleink Kill more broken cf_unit bogons.
 1.43 07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.42 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.41 04-Dec-1999  ragge CL* discarding.
 1.40 12-Jan-1998  thorpej branches: 1.40.14; 1.40.20;
Adjust for changes to config.
 1.39 11-Oct-1997  mhitch Fix typo from DIOCGDEFLABEL implementation.
 1.38 08-Oct-1997  thorpej Implement DIOCGDEFLABEL.
 1.37 17-Jul-1997  jtk branches: 1.37.2;
use locator defines in "locators.h" to index cf_loc[]
 1.36 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.35 13-Oct-1996  christos backout previous kprintf change
 1.34 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.33 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.32 04-May-1996  mhitch Floppy driver now supports MSDOS track format. Minor device 1 (/dev/fd?b)
uses MSDOS MFM track encoding. From Ezra Story (ezy@panix.com) with
a couple of changes by me.
 1.31 30-Apr-1996  mhitch Remove include of sys/cpu.h.
 1.30 29-Apr-1996  mhitch Add floppy index interrupt routine for future MSDOS floppy support.
Don't seek to track 0 before checking for diskchange: if drive steps,
the diskchange flag is cleared. Just select the drive, then test for
a diskchange.
Clean up for -Wall with FDDEBUG defined, and fix a message typo.
 1.29 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.28 05-Apr-1996  mhitch Pass reserved blocks in label so adosfs computes root block
correctly (close PR 2232).
 1.27 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.26 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.25 28-Jan-1996  chopps make sure master enable is set #1920
 1.24 15-Jan-1996  thorpej Call disk_busy() a bit earlier in case an exceptional condition causes
fddone() (and thus disk_unbusy()) to be called directly from fdstart().
Pointed out by Ezra Story <ezy@panix.com>.
 1.23 14-Jan-1996  thorpej Fixed typo (that I probably introduced with the disk changes). From
Thorsten Frueauf <frueauf@ira.uka.de>, PR #1924.
 1.22 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.21 12-Aug-1995  mycroft minphys() functions really should return void.
 1.20 26-Jul-1995  chopps fix typo
 1.19 24-Jul-1995  cgd bound xfer properly in minphys, panic if can't.
 1.18 05-Jul-1995  chopps remove indirect use of strategy which brok with recent changes
 1.17 13-Apr-1995  chopps couple small changes from Michael.
 1.16 10-Apr-1995  mycroft Fdclose --> fdclose
 1.15 06-Apr-1995  chopps say something more for unconfigured devices
 1.14 13-Dec-1994  mycroft fdclose -> Fdclose
 1.13 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.12 26-Oct-1994  cgd new RCS ID format.
 1.11 18-Jul-1994  chopps branches: 1.11.2;
don't hang if no floppy in system.
 1.10 04-Jul-1994  chopps branches: 1.10.2;
move to new disk minor encoding (parts have lowest 4 bits instead of 3)
 1.9 20-Jun-1994  chopps fixed a couple bogons with continueation and motoroff.
 1.8 16-Jun-1994  chopps must use file system blocks that are multiples of CLBYTES. (for now)
 1.7 07-Jun-1994  chopps add fix from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me. floppy changes, should now be solid.
some changes to ite and ms to fix a couple bugs report by Donn.
 1.5 29-May-1994  chopps new floppy driver from me to replace the old one.
 1.4 22-Apr-1994  chopps changes to make fd work better (not done yet) from Michael Hitch
(osymh@montana.edu)
 1.3 07-Apr-1994  chopps yuck, there has got to be a better way to derive things and copyright them.
 1.2 07-Apr-1994  chopps all amigas ahve internal drive so anything to the contrary is bogus.
 1.1 05-Apr-1994  chopps fp -> fd, consistency good. [nameclash bad.]
 1.10.2.1 18-Jul-1994  cgd from trunk; fix a hang. from chopps
 1.11.2.2 18-Jul-1994  chopps don't hang if no floppy in system.
 1.11.2.1 18-Jul-1994  chopps file fd.c was added on branch netbsd-1-0 on 1994-07-18 01:37:49 +0000
 1.37.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.40.20.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.40.20.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

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

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

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.40.14.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.40.14.2 22-Nov-2000  bouyer Sync with HEAD.
 1.40.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.47.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.47.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.47.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.47.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.47.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.47.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.48.4.8 07-Jan-2003  thorpej Sync with HEAD.
 1.48.4.7 03-Jan-2003  thorpej Sync with HEAD.
 1.48.4.6 11-Nov-2002  nathanw Catch up to -current
 1.48.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.48.4.4 17-Sep-2002  nathanw Catch up to -current.
 1.48.4.3 13-Aug-2002  nathanw Catch up to -current.
 1.48.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.48.4.1 16-Sep-2001  nathanw file fd.c was added on branch nathanw_sa on 2002-02-28 04:06:36 +0000
 1.50.8.2 30-Aug-2002  gehenna catch up with -current.
 1.50.8.1 16-May-2002  gehenna Add the block/character device switch.
 1.61.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.61.2.5 21-Nov-2004  skrll Adapt to branch.
 1.61.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.61.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.61.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.61.2.1 03-Aug-2004  skrll Sync with HEAD
 1.64.2.4 21-Jan-2008  yamt sync with head
 1.64.2.3 27-Oct-2007  yamt sync with head.
 1.64.2.2 03-Sep-2007  yamt sync with head.
 1.64.2.1 21-Jun-2006  yamt sync with head.
 1.66.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.66.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.66.8.1 01-Apr-2006  yamt sync with head.
 1.66.6.1 22-Apr-2006  simonb Sync with head.
 1.66.4.1 09-Sep-2006  rpaulo sync with head
 1.67.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.69.10.2 16-Oct-2007  garbled Sync with HEAD
 1.69.10.1 03-Oct-2007  garbled Sync with HEAD
 1.69.4.1 11-Jul-2007  mjf Sync with head.
 1.69.2.5 09-Oct-2007  ad Sync with head.
 1.69.2.4 09-Oct-2007  ad Sync with head.
 1.69.2.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.69.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.69.2.1 15-Jul-2007  ad Sync with head.
 1.70.4.2 03-Sep-2007  skrll Sync with HEAD.
 1.70.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.70.2.1 07-Aug-2007  matt Sync with HEAD.
 1.72.4.2 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.72.4.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.73.4.1 14-Oct-2007  yamt sync with head.
 1.73.2.2 09-Jan-2008  matt sync with HEAD
 1.73.2.1 06-Nov-2007  matt sync with HEAD
 1.77.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.77.4.1 31-Dec-2007  ad Catch up with buffer cache changes.
 1.77.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.78.14.1 18-Jun-2008  simonb Sync with head.
 1.78.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.78.10.2 11-Mar-2010  yamt sync with head
 1.78.10.1 04-May-2009  yamt sync with head.
 1.78.8.1 17-Jun-2008  yamt sync with head.
 1.78.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.78.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.79.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.79.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.80.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.84.4.2 12-Jun-2011  rmind sync with head
 1.84.4.1 05-Mar-2011  rmind sync with head
 1.85.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.85.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.86.12.3 03-Dec-2017  jdolecek update from HEAD
 1.86.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.86.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.86.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.86.2.1 30-Oct-2012  yamt sync with head
 1.87.2.1 18-May-2014  rmind sync with head
 1.89.2.1 10-Aug-2014  tls Rebase.
 1.92.4.2 06-Jun-2015  skrll Sync with HEAD
 1.92.4.1 06-Apr-2015  skrll Sync with HEAD
 1.96.18.1 10-Jun-2019  christos Sync with HEAD
 1.96.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.96.8.1 27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.96.2.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.96.2.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.97.14.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.98.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.47 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.46 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.45 20-Dec-2010  matt branches: 1.45.58; 1.45.60;
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.44 18-Oct-2010  phx opt_m68k_arch.h can only be included when compiling for amiga/68k.
 1.43 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.42 23-Nov-2009  rmind branches: 1.42.2; 1.42.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.41 13-Apr-2008  tsutsui branches: 1.41.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.40 11-Mar-2007  he branches: 1.40.38;
Correct a thinko of mine in the previous change, pointed out by
is@. Even though the argument type changes as an effect of the
caddr_t removal, there really is no need to indirect where we didn't
before. Instead, add the appropriate cast.
 1.39 05-Mar-2007  he branches: 1.39.2;
Fix one missing indirection causing a type conflict, and use char* for
pointer arithmetic.
 1.38 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 29-Mar-2006  thorpej branches: 1.37.14;
Use device_cfdata().
 1.36 08-Mar-2006  lukem branches: 1.36.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.35 11-Dec-2005  christos branches: 1.35.4; 1.35.6; 1.35.8; 1.35.10;
merge ktrace-lwp.
 1.34 13-Jun-2005  jmc branches: 1.34.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.33 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.32 01-Apr-2003  thorpej branches: 1.32.2;
Use PAGE_SIZE rather than NBPG.
 1.31 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.28 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.27 25-Apr-2001  bouyer branches: 1.27.2; 1.27.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.26 05-Jun-2000  tsutsui branches: 1.26.4;
Adapt MI ncr53c9x changes.
 1.25 30-Sep-1999  thorpej branches: 1.25.2; 1.25.10;
Update for SCSIPI changes.
 1.24 25-Sep-1999  is vm_offset_t -> vaddr_t/paddr_t
 1.23 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.22 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.21 04-Jul-1998  jonathan defopt DDB.
 1.20 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.19 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.18 12-Jan-1998  thorpej Adjust for changes to config.
 1.17 24-Oct-1997  mhitch Don't rely on fixed padding to longword align the buffer used for non-aligned
transfers - compute aligned address when interface is attached. Fixes PR#4258.
 1.16 04-Oct-1997  mhitch branches: 1.16.2;
Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.15 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.14 23-Dec-1996  veego branches: 1.14.8; 1.14.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.13 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.12 13-Oct-1996  christos backout previous kprintf change
 1.11 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.10 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.9 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.8 04-Aug-1996  is Program around the Fastlane's DMA hardware shortcomings.
Fix by Matthias Scheler (PR #2672), based on information provided by Ralph
Schmidt/Reinhard Grams (Phase 5), forwarded by Jerome Lovy. Thanks to all.
 1.7 10-Jun-1996  is Activate M68040 cache flushing code also in 68060 only kernels.
 1.6 03-Jun-1996  is Don't get fooled by the CyberSCSI MK I, which uses the same man/prod id
as the Fastlane Z3, but is different enough to let the kernel crash.
Closes PR #2492 by Matthias Scheler. [thanks also to Ralph Schmidt for
confirmation of the patch]
 1.5 21-Apr-1996  veego branches: 1.5.4;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.4 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.3 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.2 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.5.4.3 05-Aug-1996  jtc Pulled up from rev 1.8 by request from Ignatios Souvatzis
 1.5.4.2 10-Jun-1996  is Pull up bug fix from main branch:
activate M68040 style dma flush also on M68060 only kernels.
 1.5.4.1 03-Jun-1996  is Pull up buf fix from main branch: dont get fooled by Cyberscsi masquerading
as Fastlane.
 1.14.10.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.16.2.1 24-Oct-1997  mellon Pull rev 1.17 up from trunk
 1.25.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.25.2.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.25.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.26.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.27.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.27.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.27.8.1 25-Apr-2001  nathanw file flsc.c was added on branch nathanw_sa on 2002-02-28 04:06:36 +0000
 1.27.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.27.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.32.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.32.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.2.1 03-Aug-2004  skrll Sync with HEAD
 1.34.2.2 03-Sep-2007  yamt sync with head.
 1.34.2.1 21-Jun-2006  yamt sync with head.
 1.35.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.35.8.2 01-Apr-2006  yamt sync with head.
 1.35.8.1 13-Mar-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.36.2.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.37.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.39.2.1 13-Mar-2007  ad Sync with head.
 1.40.38.1 02-Jun-2008  mjf Sync with HEAD.
 1.41.4.2 11-Aug-2010  yamt sync with head.
 1.41.4.1 11-Mar-2010  yamt sync with head
 1.42.4.2 05-Mar-2011  rmind sync with head
 1.42.4.1 03-Jul-2010  rmind sync with head
 1.42.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.42.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.45.60.1 10-Jun-2019  christos Sync with HEAD
 1.45.58.2 18-Jan-2019  pgoyette Synch with HEAD
 1.45.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3 05-Oct-1997  veego Unused files after the sfas driver is replaced by the MI ncr53c9x driver.
 1.2 21-Apr-1996  veego branches: 1.2.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.6 13-Apr-2008  tsutsui branches: 1.6.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.5 25-Sep-1999  is branches: 1.5.138;
vm_offset_t -> vaddr_t/paddr_t
 1.4 24-Oct-1997  mhitch Don't rely on fixed padding to longword align the buffer used for non-aligned
transfers - compute aligned address when interface is attached. Fixes PR#4258.
 1.3 04-Oct-1997  mhitch branches: 1.3.2;
Replace Fastlane and Blizzard SCSI driver frontends, using the machine
independent ncr53c9x driver. Add 12x0-IV support to the 1230 driver, and
add Cyberstorm SCSI I and II drivers.
 1.2 21-Apr-1996  veego branches: 1.2.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.2.1 24-Oct-1997  mellon Pull rev 1.4 up from trunk
 1.5.138.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.4.1 11-Mar-2010  yamt sync with head
 1.2 05-Apr-1994  mycroft Clean up deleted files.
 1.1 05-Apr-1994  chopps added floppy driver from Brad Pepers, doesn't work on my machine, some
major cleanup by me no code changes ... yet.
 1.34 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.33 24-Apr-2021  thorpej branches: 1.33.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.32 02-Mar-2020  is branches: 1.32.8;
The Gayle interface uses swapped (little-endian) word accesses, so we
need to use the amiga_bus_stride_1swap methods for the word accesses.

Analyzed and submitted via port-amiga@ by Martin Ã…berg.

Tested on formerly working hardware

- by Jukka Andberg with Dlink DE-660+ (ne)
- by Frank Wille with D-Link DFE-670TXD (ne)

Tested on formerly not working hardware:

- by Martin with 3Com 3c589 Etherling III (ep)
- by Martin and Frank with CompactFlash cards (wdc)
 1.31 08-Feb-2015  jandberg branches: 1.31.10; 1.31.18; 1.31.22;
Add a delay between the recently added new PCMCIA reset method and the old
reset method to get the card reset work reliably on my A1200 model and network
cards.

Discussed on port-amiga.
 1.30 07-Sep-2014  phx branches: 1.30.2;
According to http://eab.abime.net/showpost.php?p=782840&postcount=115
there are two methods for a Gayle PCMCIA soft-reset.
pccard_attach() only implemented a method with works on A600 and some
older (?) A1200 models. I added the second method as well, to make the
reset work in any case. Tested on the latest A1200 model, which failed before.
 1.29 22-Jan-2014  christos branches: 1.29.4;
gcc-4.8.x unused variable fixes
 1.28 03-Jan-2014  rkujawa Rework handling of Commodore Gayle chip. Avoid ugly struct casts, introduce
proper bus_space accesses and some abstraction layer. All drivers that utilised
Gayle also had to be refactored.

I tried not to break anything more, but this clearly needs more testing...
 1.27 23-Sep-2013  jandberg Fix interrupt handler arg (needs to be softc instead of device_t)
 1.26 27-Oct-2012  chs branches: 1.26.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.25 26-Jul-2011  dyoung branches: 1.25.2; 1.25.12;
Don't set the iobase and iosize members of pcmciabus_attach_args because
they're not used in any meaningful way.
 1.24 13-Jan-2011  phx Recognize Amiga 600 model.
Patch submited by Radoslaw Kujawa.
 1.23 17-Oct-2007  garbled branches: 1.23.42;
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 09-Jul-2007  ad branches: 1.22.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.21 22-Feb-2007  thorpej branches: 1.21.4; 1.21.6; 1.21.12;
TRUE -> true, FALSE -> false
 1.20 30-Mar-2006  chs branches: 1.20.14;
use uvm_km_alloc() instead of uvm_map().
 1.19 05-Mar-2006  aymeric branches: 1.19.2; 1.19.4;
. free VM if attach fails
. many small cleanups
No functional improvement
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8;
merge ktrace-lwp.
 1.17 13-Sep-2004  drochner branches: 1.17.12;
use config_found() instead of config_found_sm() if no submatch
function is used
 1.16 22-Aug-2004  jandberg pcf_io_map() was returning invalid bus space handles.
Generate them with bus_space_map() like suggested by <aymeric>.
 1.15 16-Aug-2004  aymeric add a noop settype() method to the pcmcia_chip_functions to cope with the
recent changes in the PCMCIA code.
This is only compile-tested, but should work because we only support IO cards
on the A1200 for now.
 1.14 02-Oct-2002  thorpej branches: 1.14.6;
Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.11 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.10 10-Sep-2001  chris branches: 1.10.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.
 1.9 24-Apr-2001  thorpej branches: 1.9.2; 1.9.4;
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.8 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.7 11-Feb-2001  is branches: 1.7.2;
Be a bit more helpful in the error case.
 1.6 27-Sep-2000  aymeric branches: 1.6.2;
minor aesthetic changes, plus explicitly state this is public domain
 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 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.3 26-Jun-2000  mrg remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.2 21-Feb-2000  aymeric fix a couple of things to handle interrupts more cleanly on the A1200
 1.1 23-Jan-2000  aymeric add PCMCIA generic support
 1.6.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.6.2.3 11-Feb-2001  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.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.6.2.1 27-Sep-2000  bouyer file gayle_pcmcia.c was added on branch thorpej_scsipi on 2000-11-20 19:58:33 +0000
 1.7.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.7.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.9.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.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.9.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.9.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.10.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.10.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.10.4.1 10-Sep-2001  nathanw file gayle_pcmcia.c was added on branch nathanw_sa on 2002-02-28 04:06:37 +0000
 1.14.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.6.1 25-Aug-2004  skrll Sync with HEAD.
 1.17.12.3 03-Sep-2007  yamt sync with head.
 1.17.12.2 26-Feb-2007  yamt sync with head.
 1.17.12.1 21-Jun-2006  yamt sync with head.
 1.18.8.2 01-Apr-2006  yamt sync with head.
 1.18.8.1 13-Mar-2006  yamt sync with head.
 1.18.6.1 22-Apr-2006  simonb Sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.19.4.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.19.2.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.20.14.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.21.12.1 03-Oct-2007  garbled Sync with HEAD
 1.21.6.1 11-Jul-2007  mjf Sync with head.
 1.21.4.1 15-Jul-2007  ad Sync with head.
 1.22.10.1 06-Nov-2007  matt sync with HEAD
 1.23.42.1 05-Mar-2011  rmind sync with head
 1.25.12.3 03-Dec-2017  jdolecek update from HEAD
 1.25.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.25.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.25.2.1 30-Oct-2012  yamt sync with head
 1.26.2.1 18-May-2014  rmind sync with head
 1.29.4.3 08-Mar-2020  martin Pull up following revision(s) (requested by is in ticket #1724):

sys/arch/amiga/dev/gayle_pcmcia.c: revision 1.32

The Gayle interface uses swapped (little-endian) word accesses, so we
need to use the amiga_bus_stride_1swap methods for the word accesses.

Analyzed and submitted via port-amiga@ by Martin �berg.

Tested on formerly working hardware
- by Jukka Andberg with Dlink DE-660+ (ne)
- by Frank Wille with D-Link DFE-670TXD (ne)

Tested on formerly not working hardware:
- by Martin with 3Com 3c589 Etherling III (ep)
- by Martin and Frank with CompactFlash cards (wdc)
 1.29.4.2 16-Feb-2015  martin Pull up following revision(s) (requested by jandberg in ticket #516):
sys/arch/amiga/dev/gayle_pcmcia.c: revision 1.31
Add a delay between the recently added new PCMCIA reset method and
the old reset method to get the card reset work reliably on my
A1200 model and network cards.
Discussed on port-amiga.
 1.29.4.1 11-Sep-2014  martin Pull up following revision(s) (requested by phx in ticket #85):
sys/arch/amiga/dev/gayle_pcmcia.c: revision 1.30
Add support for newer A1200 models.
 1.30.2.1 06-Apr-2015  skrll Sync with HEAD
 1.31.22.1 08-Mar-2020  martin Pull up following revision(s) (requested by is in ticket #760):

sys/arch/amiga/dev/gayle_pcmcia.c: revision 1.32
sys/arch/amigappc/include/bus_defs.h: revision 1.8

The Gayle interface uses swapped (little-endian) word accesses, so we
need to use the amiga_bus_stride_1swap methods for the word accesses.

Analyzed and submitted via port-amiga@ by Martin �berg.

Tested on formerly working hardware
- by Jukka Andberg with Dlink DE-660+ (ne)
- by Frank Wille with D-Link DFE-670TXD (ne)

Tested on formerly not working hardware:
- by Martin with 3Com 3c589 Etherling III (ep)
- by Martin and Frank with CompactFlash cards (wdc)

-

gayle wants stride_1swap now, so declare the rest of the bus methods since
we already define them anyway.
 1.31.18.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.31.10.1 08-Mar-2020  martin Pull up following revision(s) (requested by is in ticket #1517):

sys/arch/amiga/dev/gayle_pcmcia.c: revision 1.32

The Gayle interface uses swapped (little-endian) word accesses, so we
need to use the amiga_bus_stride_1swap methods for the word accesses.

Analyzed and submitted via port-amiga@ by Martin �berg.

Tested on formerly working hardware
- by Jukka Andberg with Dlink DE-660+ (ne)
- by Frank Wille with D-Link DFE-670TXD (ne)

Tested on formerly not working hardware:
- by Martin with 3Com 3c589 Etherling III (ep)
- by Martin and Frank with CompactFlash cards (wdc)
 1.32.8.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.33.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.2 02-Mar-1996  veego Updated for the new CyberVision64 console
gen_cvtab.c is no longer needed
 1.1 24-Feb-1996  chopps remove floating point expressions. gen_cvtab.c generates a conversion
table to replace a specific floating point expression in grf_cv.c
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 14-Jul-2003  lukem rcsid
 1.8 26-Jan-2002  aymeric branches: 1.8.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.7 17-Aug-2001  is branches: 1.7.6;
Ansification by Petri Koistinen
 1.6 16-Feb-1995  chopps branches: 1.6.46;
cleanup copyright stuff
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.6.46.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.46.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.7.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.7.6.1 17-Aug-2001  nathanw file genpar.c was added on branch nathanw_sa on 2002-02-28 04:06:37 +0000
 1.8.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.16.1 03-Aug-2004  skrll Sync with HEAD
 1.69 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.68 24-May-2022  andvar fix various typos in comment, documentation and log messages.
 1.67 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.66 27-Apr-2021  thorpej branches: 1.66.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.65 24-Apr-2021  thorpej branches: 1.65.2;
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.64 12-Nov-2015  phx branches: 1.64.32;
Xorg for amiga via wsfb. Currently available on CV64 and CV64/3D. More
graphics cards will follow, when adding wscons support to them.

I didn't manage to make the "wskbd" protocol the default in the X server,
so you have to provide a small xorg.conf with Option "Protocol" "wskbd".
The standard protocol will not work as the Amiga wskbd cannot be switched
into raw mode and has no AT-scancode translation in the kernel.

On the positive side, wskbd also works with national keymaps under X.

The graphics modes can still be defined via grfconfig(8). Xorg's wsfb
driver uses the current grf video mode, which is usually mode #1.
All resolutions and depths seem to work (tested on CV64).
 1.63 07-Nov-2015  phx Improved wscons support. Virtual screens are now working.
 1.62 25-Jul-2014  dholland branches: 1.62.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.61 29-Mar-2014  mlelstv branches: 1.61.2;
Appease compiler.
 1.60 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.59 27-Oct-2012  chs branches: 1.59.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.58 13-Mar-2012  elad branches: 1.58.2;
Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.57 15-Dec-2011  phx Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.56 30-Jun-2011  wiz branches: 1.56.2; 1.56.6;
dependant -> dependent
 1.55 03-Jun-2011  matt CFATTACH_DECL_NEW, device_t, cfdata_t
 1.54 08-Feb-2011  rmind branches: 1.54.2;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.53 20-Dec-2010  matt branches: 1.53.2; 1.53.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.52 26-Oct-2009  cegger branches: 1.52.4;
kill extra whitespaces
reviewed by tsutsui@
 1.51 18-Mar-2009  cegger bcopy -> memcpy
 1.50 04-Mar-2007  christos branches: 1.50.44; 1.50.52; 1.50.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.49 11-Dec-2005  christos branches: 1.49.26;
merge ktrace-lwp.
 1.48 07-Aug-2003  agc branches: 1.48.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.47 01-Jan-2003  thorpej branches: 1.47.2;
Use aprint_normal() for cfprint routines.
 1.46 23-Oct-2002  jdolecek merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.45 10-Oct-2002  jdolecek replace the somewhat strange poll routine with standard nopoll() (a.k.a
seltrue())
 1.44 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.43 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.42 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.41 17-Mar-2002  atatat branches: 1.41.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.40 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.39 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.38 19-Sep-2001  thorpej branches: 1.38.4;
machine/fbio.h -> dev/sun/fbio.h
 1.37 29-Jun-2000  mrg branches: 1.37.2; 1.37.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.36 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.35 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.34 16-Aug-1999  is branches: 1.34.2; 1.34.12;
Add a quick and dirty FBIOGVIDEO implementation. This is hardware independent,
by saving the last written FIOSVIDEO/GRFIOCBLANK value into a shadow variable
in the grf_softc and returning this value on FBIOGVIDEO.
The presence of this ioctl is needed by screenblank(8) nowadays.
Original problem reported by Lars Hecking on the port-amiga mailing list.
 1.33 12-Jan-1998  thorpej branches: 1.33.8;
Adjust for changes to config.
 1.32 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.31 13-Oct-1996  christos backout previous kprintf change
 1.30 11-Oct-1996  mhitch Changes for poll(2).
 1.29 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.28 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.27 19-May-1996  is Screenblank support:
- new fbio.h in arch/amiga/include, defining only FBIOSVIDEO
- add an IOCTL translation to arch/amiga/dev/grf.c
- add screenblank to the list of specials to build on amiga.
 1.26 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.25 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.24 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.23 09-Oct-1995  chopps branches: 1.23.2;
new cybervision 64 grf from Bernd Ernesti <bernd@arresum.inka.de> and others
update config files (adding missing scsibus entry for aftsc0)
 1.22 18-Aug-1995  chopps change for a2410 from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.21 07-May-1995  chopps enable pseudo-dma on ivsc, allow no ite/grfcc.
 1.20 23-Apr-1995  chopps new grfcl driver submitted by Ezra Story <ezy@panix.com>
 1.19 10-Apr-1995  mycroft map --> mmap
 1.18 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.17 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.16 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.15 26-Oct-1994  cgd new RCS ID format.
 1.14 16-Jun-1994  chopps fix boot diag output.
 1.13 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me. floppy changes, should now be solid.
some changes to ite and ms to fix a couple bugs report by Donn.
 1.12 11-May-1994  chopps general cleanup including boot diag messages.
 1.11 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.10 01-Apr-1994  chopps no more MAP_FILE
 1.9 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.8 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.7 11-Feb-1994  chopps Add missing Id's
 1.6 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.23.2.1 20-Oct-1995  chopps take a couple devices from needs-count to needs-flag.
move tty pointers to softc structs
loadbsd now fails if it cannot allocate enough chipmem.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.33.8.1 18-Feb-2000  he Pull up revision 1.34 (requested by is):
Implement GRFIOGLANK ioctl, which is nowadays needed by
screenblank(8).
 1.34.12.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.34.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.37.4.6 10-Oct-2002  jdolecek use nokqfilter (or seltrue_kqfilter()) for drivers which provide poll
routine very similar to seltrue(); the poll routines would be cleaned
up on trunk
 1.37.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.37.4.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.37.4.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.37.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.37.4.1 12-Sep-2001  thorpej Add noop kqueue entry points.
 1.37.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.37.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.38.4.7 03-Jan-2003  thorpej Sync with HEAD.
 1.38.4.6 11-Nov-2002  nathanw Catch up to -current
 1.38.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.38.4.4 17-Sep-2002  nathanw Catch up to -current.
 1.38.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.38.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.38.4.1 19-Sep-2001  nathanw file grf.c was added on branch nathanw_sa on 2002-02-28 04:06:37 +0000
 1.41.4.3 16-May-2002  gehenna Add the character device switch.
Replace the access to devsw table with calling devsw API.
 1.41.4.2 16-May-2002  gehenna Call device interface via device switch, not directly.
 1.41.4.1 16-May-2002  gehenna Remove BANKEDDEVPAGER stuff.
 1.47.2.4 21-Nov-2004  skrll Adapt to branch.
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.48.16.2 03-Sep-2007  yamt sync with head.
 1.48.16.1 21-Jun-2006  yamt sync with head.
 1.49.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.50.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.50.44.2 11-Mar-2010  yamt sync with head
 1.50.44.1 04-May-2009  yamt sync with head.
 1.52.4.2 12-Jun-2011  rmind sync with head
 1.52.4.1 05-Mar-2011  rmind sync with head
 1.53.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.53.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.54.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.56.6.2 05-Apr-2012  mrg sync to latest -current.
 1.56.6.1 18-Feb-2012  mrg merge to -current.
 1.56.2.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.56.2.2 30-Oct-2012  yamt sync with head
 1.56.2.1 17-Apr-2012  yamt sync with head
 1.58.2.3 03-Dec-2017  jdolecek update from HEAD
 1.58.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.58.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.59.2.1 18-May-2014  rmind sync with head
 1.61.2.1 10-Aug-2014  tls Rebase.
 1.62.4.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.64.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.65.2.1 13-May-2021  thorpej Sync with HEAD.
 1.66.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.44 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.43 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42 27-Apr-2021  thorpej branches: 1.42.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.41 27-Oct-2012  chs branches: 1.41.54;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.40 15-Dec-2011  phx branches: 1.40.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.39 20-Dec-2010  matt branches: 1.39.8; 1.39.12;
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.38 26-Oct-2009  cegger branches: 1.38.4;
kill extra whitespaces
reviewed by tsutsui@
 1.37 18-Mar-2009  cegger bcopy -> memcpy
 1.36 04-Mar-2007  christos branches: 1.36.44; 1.36.52; 1.36.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 01-Jan-2003  thorpej branches: 1.35.18; 1.35.56;
Use aprint_normal() for cfprint routines.
 1.34 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.33 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.32 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.31 17-Mar-2002  atatat branches: 1.31.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.30 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.29 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.28 29-Jun-2000  mrg branches: 1.28.4; 1.28.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.27 26-Jun-2000  mrg remove redundant vm includes.
 1.26 24-Mar-1999  mrg branches: 1.26.8;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.25 10-Jul-1998  mhitch Add UVM support to amiga
 1.24 12-Jan-1998  thorpej Adjust for changes to config.
 1.23 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.22 13-Oct-1996  christos backout previous kprintf change
 1.21 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.20 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.19 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.18 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.17 16-Feb-1995  chopps cleanup copyright stuff
 1.16 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.15 26-Oct-1994  cgd new RCS ID format.
 1.14 15-Jun-1994  chopps clock now uses passed in frequency if present protect dma cache
flush calls from non 040. don't compile ite_xx if not used.
 1.13 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.12 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.11 10-Apr-1994  chopps little bit of KNiFeing, view and ite ioctl names cleaned. ite bell
values made sensical for users. (that is pitch,msec not period,count)
 1.10 30-Mar-1994  chopps remove dlists.h oops.
 1.9 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.8 11-Feb-1994  chopps Add missing Id's
 1.7 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.6 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.5 31-Oct-1993  mw Change gfx-drivers to used g_data for their private data, and use regaddr
for what it's meant, that's to point to the register area. Now, both
gfx drivers should be fairly controllable from user-level applications.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.26.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.28.8.5 03-Jan-2003  thorpej Sync with HEAD.
 1.28.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.28.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.28.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.28.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.28.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.28.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.28.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.31.4.1 16-May-2002  gehenna Call device interfaces via device switch, not directly.
 1.35.56.1 12-Mar-2007  rmind Sync with HEAD.
 1.35.18.1 03-Sep-2007  yamt sync with head.
 1.36.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.36.44.2 11-Mar-2010  yamt sync with head
 1.36.44.1 04-May-2009  yamt sync with head.
 1.38.4.1 05-Mar-2011  rmind sync with head
 1.39.12.1 18-Feb-2012  mrg merge to -current.
 1.39.8.2 30-Oct-2012  yamt sync with head
 1.39.8.1 17-Apr-2012  yamt sync with head
 1.40.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.41.54.1 13-May-2021  thorpej Sync with HEAD.
 1.42.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.10 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.9 21-Apr-1996  veego branches: 1.9.44; 1.9.48;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.8 16-Feb-1995  chopps cleanup copyright stuff
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.5 11-Feb-1994  chopps Add missing Id's
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.9.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.9.44.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.58 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.57 27-Aug-2023  andvar amiga/grfcl(4): return prx, pry definition/assigment lost with rev 1.49,
however under CL_SHIFTSPRITE code block only, where it is used.

Fixes build with the CL_SHIFTSPRITE enabled option.
 1.56 14-Feb-2023  andvar s/programm/program/ and s/suuport/support/ in comments and message.
 1.55 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.54 26-Dec-2021  andvar fix various typos, mainly in comments.
 1.53 04-Oct-2021  andvar follow fcambus steps by fixing typos for "unknown" in few more error messages.
 1.52 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.51 27-Apr-2021  thorpej branches: 1.51.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.50 16-Nov-2015  phx branches: 1.50.34;
wscons and Xorg support for CirrusLogic GD542x based boards (grf3).
 1.49 22-Jan-2014  christos branches: 1.49.6;
gcc-4.8.x unused variable fixes
 1.48 08-Nov-2012  rkujawa branches: 1.48.2;
Make Amiga video drivers work again after device/softc changes.
Patch from chs@.
 1.47 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.46 15-Dec-2011  phx branches: 1.46.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.45 26-Oct-2009  cegger branches: 1.45.12; 1.45.16;
kill extra whitespaces
reviewed by tsutsui@
 1.44 18-Mar-2009  cegger bcopy -> memcpy
 1.43 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.42 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.41 17-Oct-2007  garbled branches: 1.41.20; 1.41.28; 1.41.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.40 20-Aug-2007  is branches: 1.40.2;
First part of amigappc support patches by Frank Wille.
 1.39 06-Mar-2007  he branches: 1.39.2; 1.39.10; 1.39.14; 1.39.18;
Make the various graphics card drivers compile again.
Try to preserve `volatile' qualification where possible, though
uses of kvtop() gain an unfortunate but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
 1.38 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 24-Nov-2006  wiz branches: 1.37.4;
s/independant/independent/, from Zafer.
 1.36 11-Dec-2005  christos branches: 1.36.20; 1.36.22;
merge ktrace-lwp.
 1.35 13-Jun-2005  jmc branches: 1.35.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.34 01-Jan-2003  thorpej branches: 1.34.2;
Use aprint_normal() for cfprint routines.
 1.33 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.30 14-May-2002  matt branches: 1.30.2; 1.30.4;
Eliminate commons. (including a few unused or mismatched ones).
 1.29 17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.28 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.27 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.26 05-Aug-2001  jdolecek branches: 1.26.6;
use unsigned variable types as appropriate
 1.25 29-Jun-1999  is branches: 1.25.12; 1.25.16;
Fix horizontal timings for console mode (this helps, at least,
Lars Hecking).
 1.24 25-Mar-1999  is branches: 1.24.2; 1.24.4; 1.24.6;
defopt Amiga graphics console options
 1.23 14-Mar-1999  veego Add support for future PicassoIV's which use an autoconfig space of 64MB.
The framebuffer base address is then at a different offset.
The patch is from Klaus Burkert.
 1.22 17-Apr-1998  veego Don't use an 'register char' as an array index, change it to an int.
 1.21 12-Jan-1998  thorpej Adjust for changes to config.
 1.20 29-Jul-1997  veego - increase the number of possible grfmodes from 8 to 24
- changes for the grfconfig interface:
- Remove gv->{hblank_stop,vblank_stop} and calculate HBE and VBE from
gv->{htotal,vtotal}.
- Add support for gv->disp_flags to select interlace, doublescan and
horizontal/vertical sync polarity.
- Return EINVAL for gv->disp_flags and sync-on-green.
This makes it possible to use xfree values for grfconfig.
 1.19 05-Mar-1997  veego branches: 1.19.2;
- PicassoIV support
- Fixes for Interlace and DoubleScan
- Memorysizedetction for 1MB Bords
- Clockdoubling for PicassoIV and PiccoloSD64
NOTE: Don't use the X11R6.1 Xserver with -useHWC on the SD64
with a gfxmode >80Mhz or you get a broken mousepointer.
- HiColor and TrueColor Support
(doesn't work yet, since it needs some fixes for the XServer)
 1.18 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.17 21-Oct-1996  veego Fix console problem on fast machines. pr#2777
 1.16 13-Oct-1996  christos backout previous kprintf change
 1.15 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.14 08-Oct-1996  thorpej Merge netbsd-1-2 branch back into mainline.
 1.13 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.12 03-Jun-1996  is #define GRFIOCBLANK_LIVE and GRFIOCBLANK_DARK in grfioctl.h to make absolutely
clear which switches the video signal on and which off.
Make all grf_??.c (which supported it) use the same polarity of the test.
While being here, use a > test instead of implicit != to make it extensible
to darker than dark values for power managment systems.
 1.11 19-May-1996  veego branches: 1.11.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.10 28-Apr-1996  mhitch Cleanup for -Wall if CL5426CONSOLE is not defined.
 1.9 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.8 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.7 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.6 05-Mar-1996  is Fix problems with fast CPUs and Picasso boards. Patches originally by,
Klaus Burkert <crest@arkon.dontpanic.sub.org>, sent in by Ezra Story.
Closes port-amiga/2135.
k
 1.5 09-Oct-1995  chopps update from Ezra Story <ezy@panix.com>
 1.4 29-Sep-1995  chopps move 040 to hp300 style, use new MI lance ethernet driver
a few minor fixes WRT prototypes.
if_le from Charles rest from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.3 26-Jun-1995  chopps be sure of product from Ezra Story <ezy@panix.com>
 1.2 07-May-1995  chopps enable pseudo-dma on ivsc, allow no ite/grfcc.
 1.1 23-Apr-1995  chopps new grfcl driver submitted by Ezra Story <ezy@panix.com>
 1.11.4.2 11-Jun-1996  is from trunk: leave room for darkerthan dark, which is now possible to add in the future in a compatible way; with jtc's permission
 1.11.4.1 27-May-1996  is Bug fixes for Piccolo SD64 by Bernd Ernesti, Michael Teske and Klaus Burkert.
 1.19.2.2 05-Mar-1997  veego - PicassoIV support
- Fixes for Interlace and DoubleScan
- Memorysizedetction for 1MB Bords
- Clockdoubling for PicassoIV and PiccoloSD64
NOTE: Don't use the X11R6.1 Xserver with -useHWC on the SD64
with a gfxmode >80Mhz or you get a broken mousepointer.
- HiColor and TrueColor Support
(doesn't work yet, since it needs some fixes for the XServer)
 1.19.2.1 05-Mar-1997  veego file grf_cl.c was added on branch is-newarp on 1997-03-05 22:46:33 +0000
 1.24.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

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

synchronization to latest KAME will take place on HEAD branch soon.
 1.24.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.24.2.1 02-Jul-1999  perry pullup 1.24->1.25 (is): Fix grf_cl console mode timing
 1.25.16.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.25.16.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.25.16.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.25.16.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.25.16.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.25.12.1 16-Aug-2001  tv Pullup [jdolecek]:

sys/arch/amiga/dev/grf_cl.c 1.26
sys/arch/amiga/dev/grfioctl.h 1.14
sys/arch/hpcmips/dev/plumvideo.c 1.20
sys/arch/macppc/dev/ofb.c 1.25
sys/arch/sparc/dev/cgtwo.c 1.35
sys/arch/sparc/include/fbio.h patch
sys/arch/sparc64/include/fbio.h patch
sys/arch/sun3/dev/cg2.c 1.14
sys/arch/sun3/include/fbio.h patch
sys/dev/pci/tga.c 1.35
sys/dev/tc/cfb.c 1.28
sys/dev/tc/mfb.c 1.27
sys/dev/tc/sfb.c 1.46
sys/dev/tc/sfbplus.c 1.10 via patch
sys/dev/tc/tfb.c 1.30
sys/dev/tc/xcfb.c 1.23
sys/net/if_ppp.c 1.71

Use unsigned variable types to make bounds checking more correct.
 1.26.6.7 03-Jan-2003  thorpej Sync with HEAD.
 1.26.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.26.6.5 13-Aug-2002  nathanw Catch up to -current.
 1.26.6.4 20-Jun-2002  nathanw Catch up to -current.
 1.26.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.26.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.26.6.1 05-Aug-2001  nathanw file grf_cl.c was added on branch nathanw_sa on 2002-02-28 04:06:38 +0000
 1.30.4.1 07-Aug-2002  lukem Pull up revision 1.31 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.30.2.1 30-Aug-2002  gehenna catch up with -current.
 1.34.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.2 03-Sep-2007  yamt sync with head.
 1.35.2.1 30-Dec-2006  yamt sync with head.
 1.36.22.1 10-Dec-2006  yamt sync with head.
 1.36.20.1 12-Jan-2007  ad Sync with head.
 1.37.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.39.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.39.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.39.10.1 03-Oct-2007  garbled Sync with HEAD
 1.39.2.1 09-Oct-2007  ad Sync with head.
 1.40.2.1 06-Nov-2007  matt sync with HEAD
 1.41.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.41.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.41.20.2 11-Mar-2010  yamt sync with head
 1.41.20.1 04-May-2009  yamt sync with head.
 1.45.16.1 18-Feb-2012  mrg merge to -current.
 1.45.12.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.45.12.3 16-Jan-2013  yamt sync with (a bit old) head
 1.45.12.2 30-Oct-2012  yamt sync with head
 1.45.12.1 17-Apr-2012  yamt sync with head
 1.46.6.3 03-Dec-2017  jdolecek update from HEAD
 1.46.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.46.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.48.2.1 18-May-2014  rmind sync with head
 1.49.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.50.34.1 13-May-2021  thorpej Sync with HEAD.
 1.51.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.10 18-Dec-2008  mhitch Don't expose kernel functions when including these in the Xamiga server
build. Should fix the amiga build failures.
 1.9 24-Dec-2005  perry branches: 1.9.74; 1.9.78; 1.9.86;
bare asm -> __asm
 1.8 25-Apr-2002  aymeric branches: 1.8.26;
o replace definitions by declarations in header files
o put definitions where due
o cleanup some types (u_int -> vaddr_t's for example)
o minor other cleanup
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 21-Mar-1997  veego branches: 1.6.36; 1.6.40;
Add a missing test for the PicassoIV, which fix the colour problem.
 1.5 08-Oct-1996  thorpej Merge netbsd-1-2 branch back into mainline.
 1.4 19-May-1996  veego branches: 1.4.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.3 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.2 05-Mar-1996  is Fix problems with fast CPUs and Picasso boards. Patches originally by,
Klaus Burkert <crest@arkon.dontpanic.sub.org>, sent in by Ezra Story.
Closes port-amiga/2135.
k
 1.1 23-Apr-1995  chopps new grfcl driver submitted by Ezra Story <ezy@panix.com>
 1.4.4.1 27-May-1996  is Bug fixes for Piccolo SD64 by Bernd Ernesti, Michael Teske and Klaus Burkert.
 1.6.40.2 20-Jun-2002  nathanw Catch up to -current.
 1.6.40.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.36.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.36.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.8.26.1 21-Jun-2006  yamt sync with head.
 1.9.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.78.1 04-May-2009  yamt sync with head.
 1.9.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.64 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.63 01-Jan-2022  msaitoh s/frambuffer/framebuffer/ in comment.
 1.62 26-Dec-2021  andvar fix various typos, mainly in comments.
 1.61 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.60 27-Apr-2021  thorpej branches: 1.60.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.59 16-Nov-2015  phx branches: 1.59.34;
Fixed bug in wsdisplay copyrows textop.
Fixed WSDISPLAYIO_SVIDEO, which had inverted functionality.
Improved FBINFO setup. 15 and 16 bits depth both have 16bpp now.
 1.58 12-Nov-2015  phx Xorg for amiga via wsfb. Currently available on CV64 and CV64/3D. More
graphics cards will follow, when adding wscons support to them.

I didn't manage to make the "wskbd" protocol the default in the X server,
so you have to provide a small xorg.conf with Option "Protocol" "wskbd".
The standard protocol will not work as the Amiga wskbd cannot be switched
into raw mode and has no AT-scancode translation in the kernel.

On the positive side, wskbd also works with national keymaps under X.

The graphics modes can still be defined via grfconfig(8). Xorg's wsfb
driver uses the current grf video mode, which is usually mode #1.
All resolutions and depths seem to work (tested on CV64).
 1.57 07-Nov-2015  phx Improved wscons support. Virtual screens are now working.
 1.56 22-Jan-2014  christos branches: 1.56.6;
gcc-4.8.x unused variable fixes
 1.55 08-Nov-2012  rkujawa branches: 1.55.2;
Make Amiga video drivers work again after device/softc changes.
Patch from chs@.
 1.54 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.53 15-Dec-2011  phx branches: 1.53.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.52 30-Jun-2011  wiz branches: 1.52.2; 1.52.6;
dependant -> dependent
 1.51 05-Feb-2010  phx Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.50 31-Jan-2010  phx Fixed for amigappc by executing eieio after writing to a vga register.
 1.49 30-Jan-2010  phx Fixed compiler warnings when CV_INT_NUM == 2 or CV64CONSOLE is not defined.
 1.48 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.47 18-Mar-2009  cegger bcopy -> memcpy
 1.46 17-Oct-2007  garbled branches: 1.46.20; 1.46.28; 1.46.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.45 20-Aug-2007  is branches: 1.45.2;
First part of amigappc support patches by Frank Wille.
 1.44 05-Mar-2007  he branches: 1.44.2; 1.44.10; 1.44.14; 1.44.18;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.43 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.42 24-Nov-2006  wiz branches: 1.42.4;
s/independant/independent/, from Zafer.
 1.41 03-Aug-2006  mhitch branches: 1.41.4; 1.41.6;
gcc4 checks for and warns about specifying a general register constraint
for operands that won't accept an address register. Change constraint
to specify only a data register.
 1.40 24-Dec-2005  perry branches: 1.40.4; 1.40.8;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.39 11-Dec-2005  christos merge ktrace-lwp.
 1.38 13-Jun-2005  jmc branches: 1.38.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.37 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.36 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.35 31-May-2003  kristerw branches: 1.35.2;
Use __asm instead of asm, to keep lint happy.
 1.34 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.33 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.30 17-Mar-2002  atatat branches: 1.30.4; 1.30.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.29 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.28 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.27 25-Mar-1999  is branches: 1.27.22; 1.27.26;
defopt Amiga graphics console options
 1.26 06-Oct-1998  tron Add a few "nop" instructions to make the memory size probe more reliable.
 1.25 12-Jan-1998  thorpej Adjust for changes to config.
 1.24 30-Jul-1997  veego branches: 1.24.4;
Fix the doublescan mode which was broken in the last commit.
 1.23 29-Jul-1997  veego branches: 1.23.2;
- s/inline/__inline/
- Use interrrupt #6 instead of #2. #6 is the default interrupt and there
seems to be a problem with Cyberstorm 060 and #2.
- Set the interrupt register before enabling the interrupt.
- GC M2INS
- minor cleanup
- Switch from +hsync/+vsync to -hsync/-vsync.
- changes for the grfconfig interface:
- Remove gv->{hblank_stop,vblank_stop} and calculate HBE and VBE from
gv->{htotal,vtotal}.
- Add support for gv->disp_flags to select interlace, doublescan and
horizontal/vertical sync polarity.
- Return EINVAL for gv->disp_flags and sync-on-green.
This makes it possible to use xfree values for grfconfig.
 1.22 15-Jun-1997  veego Add a missing ; if CV64CONSOLE is undefined.
 1.21 25-May-1997  veego New Hardware Cursor support from Michael Teske.
 1.20 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.19 22-Oct-1996  veego Fix GRFTOGGLE.
The old version only toggles to the amiga signal and do not go back to
the CyberVision signal.
 1.18 13-Oct-1996  christos backout previous kprintf change
 1.17 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.16 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.15 03-Jun-1996  is #define GRFIOCBLANK_LIVE and GRFIOCBLANK_DARK in grfioctl.h to make absolutely
clear which switches the video signal on and which off.
Make all grf_??.c (which supported it) use the same polarity of the test.
While being here, use a > test instead of implicit != to make it extensible
to darker than dark values for power managment systems.
 1.14 19-May-1996  veego branches: 1.14.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.13 01-May-1996  veego Cleanup for -Wall if CV64CONSOLE, ULOWELLCONSOLE or RETINACONSOLE is not
defined.
 1.12 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.11 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.10 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9 06-Mar-1996  is Back out change intended for netbsd-1-1 and accidentally committed here
 1.8 04-Mar-1996  is Fix for newer S3 chipsets by Matthias Scheler (from -current).
 1.7 02-Mar-1996  veego Updated for the new CyberVision64 console
gen_cvtab.c is no longer needed
 1.6 24-Feb-1996  chopps remove floating point expressions. gen_cvtab.c generates a conversion
table to replace a specific floating point expression in grf_cv.c
 1.5 27-Dec-1995  chopps fix for newer boards (pr#1829) from Matthias Scheler
 1.4 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.3 09-Oct-1995  chopps branches: 1.3.2;
fix use of uninit vars from Bernd Ernesti <bernd@arresum.inka.de>
 1.2 09-Oct-1995  chopps make work with newer grfconfig now in /usr/sbin. from
Bernd Ernesti <bernd@arresum.inka.de>
 1.1 09-Oct-1995  chopps new cybervision 64 from Bernd Ernesti <bernd@arresum.inka.de> (and others)
 1.3.2.4 06-Mar-1996  is Really commit Monday's fix to netbsd-1-1, where it was intended.
 1.3.2.3 10-Nov-1995  chopps final update to grf_cv device
 1.3.2.2 21-Oct-1995  chopps add rcsids
 1.3.2.1 20-Oct-1995  chopps some bug fixes from Bernd Ernesti <bernd@arresum.inka.de>
 1.14.4.1 11-Jun-1996  is from trunk: leave room for darkerthan dark, which is now possible to add in the future in a compatible way; with jtc's permission
 1.23.2.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.24.4.1 22-Nov-1998  cgd pull up rev 1.26 from trunk (veego)
 1.27.26.5 03-Jan-2003  thorpej Sync with HEAD.
 1.27.26.4 18-Oct-2002  nathanw Catch up to -current.
 1.27.26.3 13-Aug-2002  nathanw Catch up to -current.
 1.27.26.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.27.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.27.22.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.27.22.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.27.22.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.30.6.1 07-Aug-2002  lukem Pull up revision 1.31 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.30.4.1 30-Aug-2002  gehenna catch up with -current.
 1.35.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.1 03-Aug-2004  skrll Sync with HEAD
 1.38.2.3 03-Sep-2007  yamt sync with head.
 1.38.2.2 30-Dec-2006  yamt sync with head.
 1.38.2.1 21-Jun-2006  yamt sync with head.
 1.40.8.1 11-Aug-2006  yamt sync with head
 1.40.4.1 09-Sep-2006  rpaulo sync with head
 1.41.6.1 10-Dec-2006  yamt sync with head.
 1.41.4.1 12-Jan-2007  ad Sync with head.
 1.42.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.44.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.44.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.44.10.1 03-Oct-2007  garbled Sync with HEAD
 1.44.2.1 09-Oct-2007  ad Sync with head.
 1.45.2.1 06-Nov-2007  matt sync with HEAD
 1.46.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.46.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.46.20.2 11-Mar-2010  yamt sync with head
 1.46.20.1 04-May-2009  yamt sync with head.
 1.52.6.1 18-Feb-2012  mrg merge to -current.
 1.52.2.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.52.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.52.2.2 30-Oct-2012  yamt sync with head
 1.52.2.1 17-Apr-2012  yamt sync with head
 1.53.6.3 03-Dec-2017  jdolecek update from HEAD
 1.53.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.53.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.55.2.1 18-May-2014  rmind sync with head
 1.56.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.59.34.1 13-May-2021  thorpej Sync with HEAD.
 1.60.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.39 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.38 01-Jan-2022  msaitoh s/frambuffer/framebuffer/ in comment.
 1.37 26-Dec-2021  andvar fix various typos, mainly in comments.
 1.36 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.35 27-Apr-2021  thorpej branches: 1.35.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.34 17-Jun-2016  phx branches: 1.34.34;
Remove the "totally untested" comments for the ZorroII frame buffer
select macro. The card is confirmed to work in an A2000.
 1.33 16-Nov-2015  phx Fixed bug in wsdisplay copyrows textop.
Fixed WSDISPLAYIO_SVIDEO, which had inverted functionality.
Improved FBINFO setup. 15 and 16 bits depth both have 16bpp now.
 1.32 12-Nov-2015  phx Xorg for amiga via wsfb. Currently available on CV64 and CV64/3D. More
graphics cards will follow, when adding wscons support to them.

I didn't manage to make the "wskbd" protocol the default in the X server,
so you have to provide a small xorg.conf with Option "Protocol" "wskbd".
The standard protocol will not work as the Amiga wskbd cannot be switched
into raw mode and has no AT-scancode translation in the kernel.

On the positive side, wskbd also works with national keymaps under X.

The graphics modes can still be defined via grfconfig(8). Xorg's wsfb
driver uses the current grf video mode, which is usually mode #1.
All resolutions and depths seem to work (tested on CV64).
 1.31 07-Nov-2015  phx Improved wscons support. Virtual screens are now working.
 1.30 22-Jan-2014  christos branches: 1.30.6;
gcc-4.8.x unused variable fixes
 1.29 08-Nov-2012  rkujawa branches: 1.29.2;
Make Amiga video drivers work again after device/softc changes.
Patch from chs@.
 1.28 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.27 14-Oct-2012  phx CV3DONZORRO2 option is no longer needed.
grf_cv3d.c was successfully tested running in a Zorro2 slot.
 1.26 15-Dec-2011  phx branches: 1.26.2; 1.26.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.25 26-Oct-2009  cegger branches: 1.25.12; 1.25.16;
kill extra whitespaces
reviewed by tsutsui@
 1.24 18-Mar-2009  cegger bcopy -> memcpy
 1.23 17-Oct-2007  garbled branches: 1.23.20; 1.23.28; 1.23.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.22 20-Aug-2007  is branches: 1.22.2;
First part of amigappc support patches by Frank Wille.
 1.21 05-Mar-2007  he branches: 1.21.2; 1.21.10; 1.21.14; 1.21.18;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.20 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 24-Nov-2006  wiz branches: 1.19.4;
s/independant/independent/, from Zafer.
 1.18 24-Dec-2005  perry branches: 1.18.20; 1.18.22;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 10-Nov-2003  wiz branches: 1.16.16;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.15 31-May-2003  kristerw branches: 1.15.2;
Use __asm instead of asm, to keep lint happy.
 1.14 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.13 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.11 06-Aug-2002  itojun integer overflow. reported by silvio@qualys.com
 1.10 17-Mar-2002  atatat branches: 1.10.4; 1.10.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.9 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.8 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.7 25-Mar-1999  is branches: 1.7.18; 1.7.22; 1.7.26;
defopt Amiga graphics console options
 1.6 12-Jan-1998  thorpej Adjust for changes to config.
 1.5 20-Dec-1997  perry patch from is -- I don't know what it does, but he says it's critical.
 1.4 23-Nov-1997  veego Ups, forget a 'i'.
 1.3 09-Nov-1997  is - recognize CV3D in Zorro-II mode.
- use board address space > 4 MB, instead of iszthreepa(), to detect Z3-mode
boards. We dont want the bus, but want the address configuration.
- s/CV64CONSOLE/CV3DCONSOLE/
- s/cv3d_zorroIII == 1/cv3d_zorroIII/ and s/cv3d_zorroIII != 1/!cv3d_zorroIII/
 1.2 29-Oct-1997  veego The Console driver works now.
Added some fixes for Zorro2 mode, but keep it still disabled.
 1.1 19-Oct-1997  veego branches: 1.1.2;
First version of the CyberVision 3D driver. This driver is based on
the CyberVision64 driver. Modified by Tobias Abt with some bugfixes
from Bernd Ernesti.
ZorroII is at the moment not supported and there is a small problem
with the Console driver where you just get a black screen, but the
system boots and you can use X11 without a problem.
 1.1.2.4 20-Dec-1997  perry pullup patch from is -- he says it's critical.
 1.1.2.3 24-Nov-1997  mellon Pull rev 1.4 up from trunk (veego)
 1.1.2.2 11-Nov-1997  mellon Pull rev 1.3 up from trunk (is)
 1.1.2.1 30-Oct-1997  mellon Pull rev 1.2 up from trunk (veego)
 1.7.26.5 03-Jan-2003  thorpej Sync with HEAD.
 1.7.26.4 18-Oct-2002  nathanw Catch up to -current.
 1.7.26.3 13-Aug-2002  nathanw Catch up to -current.
 1.7.26.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.7.22.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.22.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.7.22.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.7.18.1 04-Sep-2002  itojun pullup (itojun)

sys/arch/amiga/dev/grf_cv3d.c 1.11
sys/arch/hpcmips/dev/mq200.c 1.21
sys/arch/i386/i386/sys_machdep.c 1.64
sys/arch/luna68k/dev/lunafb.c 1.9
sys/arch/sparc/dev/bt_subr.c via patch
sys/arch/sparc64/dev/bt_subr.c via patch
sys/arch/sun3/dev/bt_subr.c via patch
sys/compat/ibcs2/ibcs2_stat.c 1.21-1.23
sys/dev/sun/bt_subr.c 1.3
sys/dev/tc/cfb.c 1.34
sys/dev/tc/sfb.c 1.53
sys/dev/tc/xcfb.c 1.29
integer overflow. reported by silvio@qualys.com
 1.10.6.1 07-Aug-2002  lukem Pull up revision 1.11 (requested by itojun in ticket #616):
integer overflow. reported by silvio@qualys.com
 1.10.4.1 30-Aug-2002  gehenna catch up with -current.
 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.16.16.3 03-Sep-2007  yamt sync with head.
 1.16.16.2 30-Dec-2006  yamt sync with head.
 1.16.16.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.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.21.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.21.10.1 03-Oct-2007  garbled Sync with HEAD
 1.21.2.1 09-Oct-2007  ad Sync with head.
 1.22.2.1 06-Nov-2007  matt sync with HEAD
 1.23.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.23.28.1 28-Apr-2009  skrll 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.25.16.1 18-Feb-2012  mrg merge to -current.
 1.25.12.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.25.12.3 16-Jan-2013  yamt sync with (a bit old) head
 1.25.12.2 30-Oct-2012  yamt sync with head
 1.25.12.1 17-Apr-2012  yamt sync with head
 1.26.6.3 03-Dec-2017  jdolecek update from HEAD
 1.26.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.26.2.1 22-Nov-2012  riz Pull up following revision(s) (requested by phx in ticket #680):
sys/arch/amiga/dev/grf_cv3d.c: revision 1.27
sys/arch/amiga/conf/files.amiga: revision 1.162
CV3DONZORRO2 option is no longer needed.
grf_cv3d.c was successfully tested running in a Zorro2 slot.
 1.29.2.1 18-May-2014  rmind sync with head
 1.30.6.2 09-Jul-2016  skrll Sync with HEAD
 1.30.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.34.34.1 13-May-2021  thorpej Sync with HEAD.
 1.35.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.13 17-Jun-2016  phx Remove the "totally untested" comments for the ZorroII frame buffer
select macro. The card is confirmed to work in an A2000.
 1.12 22-Jan-2014  christos branches: 1.12.6;
gcc-4.8.x unused variable fixes
 1.11 12-Feb-2012  matt branches: 1.11.6; 1.11.10;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.10 15-Dec-2011  phx Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.9 05-Mar-2007  he branches: 1.9.78; 1.9.82;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.8 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 24-Dec-2005  perry branches: 1.7.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 31-May-2003  kristerw branches: 1.6.18;
Use __asm instead of asm, to keep lint happy.
 1.5 25-Apr-2002  aymeric o replace definitions by declarations in header files
o put definitions where due
o cleanup some types (u_int -> vaddr_t's for example)
o minor other cleanup
 1.4 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.3 09-Nov-1997  is branches: 1.3.28; 1.3.32;
- recognize CV3D in Zorro-II mode.
- use board address space > 4 MB, instead of iszthreepa(), to detect Z3-mode
boards. We dont want the bus, but want the address configuration.
- s/CV64CONSOLE/CV3DCONSOLE/
- s/cv3d_zorroIII == 1/cv3d_zorroIII/ and s/cv3d_zorroIII != 1/!cv3d_zorroIII/
 1.2 29-Oct-1997  veego The Console driver works now.
Added some fixes for Zorro2 mode, but keep it still disabled.
 1.1 19-Oct-1997  veego branches: 1.1.2;
First version of the CyberVision 3D driver. This driver is based on
the CyberVision64 driver. Modified by Tobias Abt with some bugfixes
from Bernd Ernesti.
ZorroII is at the moment not supported and there is a small problem
with the Console driver where you just get a black screen, but the
system boots and you can use X11 without a problem.
 1.1.2.2 11-Nov-1997  mellon Pull rev 1.3 up from trunk (is)
 1.1.2.1 30-Oct-1997  mellon Pull rev 1.2 up from trunk (veego)
 1.3.32.2 20-Jun-2002  nathanw Catch up to -current.
 1.3.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.28.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.18.2 03-Sep-2007  yamt sync with head.
 1.6.18.1 21-Jun-2006  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.82.1 18-Feb-2012  mrg merge to -current.
 1.9.78.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.9.78.1 17-Apr-2012  yamt sync with head
 1.11.10.1 18-May-2014  rmind sync with head
 1.11.6.2 03-Dec-2017  jdolecek update from HEAD
 1.11.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.6.1 09-Jul-2016  skrll Sync with HEAD
 1.20 22-Jan-2014  christos gcc-4.8.x unused variable fixes
 1.19 12-Feb-2012  matt branches: 1.19.6; 1.19.10;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.18 15-Dec-2011  phx Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.17 21-May-2011  christos branches: 1.17.4; 1.17.8;
ifdef _KERNEL the inlines
 1.16 09-Feb-2010  phx branches: 1.16.2; 1.16.4;
Moved the macros amiga_cpu_sync() and amiga_membarrier() from amiga/device.h
to the MD include/cpu.h.
Also make sure that grf_cvreg.h includes cpu.h as it is needed by Xamiga
in xsrc/xfree/xc/programs/Xserver/hw/netbsd/amiga/s3/amigaCV.h.
 1.15 05-Feb-2010  phx branches: 1.15.2;
Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.14 31-Jan-2010  phx Fixed for amigappc by executing eieio after writing to a vga register.
 1.13 18-Dec-2008  mhitch Don't expose kernel functions when including these in the Xamiga server
build. Should fix the amiga build failures.
 1.12 05-Mar-2007  he branches: 1.12.40; 1.12.44; 1.12.52;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.11 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 24-Dec-2005  perry branches: 1.10.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.9 31-May-2003  kristerw branches: 1.9.18;
Use __asm instead of asm, to keep lint happy.
 1.8 25-Apr-2002  aymeric o replace definitions by declarations in header files
o put definitions where due
o cleanup some types (u_int -> vaddr_t's for example)
o minor other cleanup
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 29-Jul-1997  veego branches: 1.6.34; 1.6.38;
s/inline/__inline/
 1.5 19-May-1996  veego - grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.4 02-Mar-1996  veego Updated for the new CyberVision64 console
gen_cvtab.c is no longer needed
 1.3 27-Dec-1995  chopps fix for newer boards (pr#1829) from Matthias Scheler
 1.2 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.1 09-Oct-1995  chopps branches: 1.1.2;
new cybervision 64 from Bernd Ernesti <bernd@arresum.inka.de> (and others)
 1.1.2.3 12-Mar-1996  is Patch for new version of S3 chips; from -current.
 1.1.2.2 10-Nov-1995  chopps final update to grf_cv device
 1.1.2.1 21-Oct-1995  chopps add rcsids
 1.6.38.2 20-Jun-2002  nathanw Catch up to -current.
 1.6.38.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.34.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.34.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.9.18.2 03-Sep-2007  yamt sync with head.
 1.9.18.1 21-Jun-2006  yamt sync with head.
 1.10.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.12.44.2 11-Mar-2010  yamt sync with head
 1.12.44.1 04-May-2009  yamt sync with head.
 1.12.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.16.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.16.2.1 31-May-2011  rmind sync with head
 1.17.8.1 18-Feb-2012  mrg merge to -current.
 1.17.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.17.4.1 17-Apr-2012  yamt sync with head
 1.19.10.1 18-May-2014  rmind sync with head
 1.19.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.41 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.40 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.39 26-Dec-2021  andvar fix various typos, mainly in comments.
 1.38 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.37 27-Apr-2021  thorpej branches: 1.37.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.36 05-Mar-2018  rin branches: 1.36.20;
Remove duplicate vgaw() accidentally introduced in the previous revision.
 1.35 05-Mar-2018  christos use an inline function for the "4 reads"
 1.34 04-Mar-2018  mrg avoid gcc 6 indentation issues. rewrite:
if (vgar()); if (vgar()); if (vgar()); if (vgar());
as
vgar();
vgar();
vgar();
vgar();

verified the ass output has the 4 reads (the macro uses a
volatile pointer, so it should remain so too.)
 1.33 04-Nov-2016  phx wscons and Xorg support for Tseng ET4000/W32 based boards (grf6).
 1.32 22-Jan-2014  christos branches: 1.32.6; 1.32.10;
gcc-4.8.x unused variable fixes
 1.31 08-Nov-2012  rkujawa branches: 1.31.2;
Make Amiga video drivers work again after device/softc changes.
Patch from chs@.
 1.30 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.29 15-Dec-2011  phx branches: 1.29.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.28 26-Oct-2009  cegger branches: 1.28.12; 1.28.16;
kill extra whitespaces
reviewed by tsutsui@
 1.27 18-Mar-2009  cegger bcopy -> memcpy
 1.26 17-Oct-2007  garbled branches: 1.26.20; 1.26.28; 1.26.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.25 20-Aug-2007  is branches: 1.25.2;
First part of amigappc support patches by Frank Wille.
 1.24 05-Mar-2007  he branches: 1.24.2; 1.24.10; 1.24.14; 1.24.18;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.23 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 24-Nov-2006  wiz branches: 1.22.4;
s/independant/independent/, from Zafer.
 1.21 18-Apr-2003  is branches: 1.21.18; 1.21.48; 1.21.50;
fix fatal typo
 1.20 18-Apr-2003  is iszthreepa() takes a physical address, not a virtual address.
This fixes PR 19175, reported and heavily debugged by Pawel Chwalowski.
 1.19 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.18 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.17 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.16 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.15 17-Mar-2002  atatat branches: 1.15.4; 1.15.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.14 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.13 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.12 25-Mar-1999  is branches: 1.12.18; 1.12.22; 1.12.26;
defopt Amiga graphics console options
 1.11 12-Jan-1998  thorpej Adjust for changes to config.
 1.10 29-Jul-1997  veego - increase the number of possible grfmodes from 8 to 24
- changes for the grfconfig interface:
- Remove gv->{hblank_stop,vblank_stop} and calculate HBE and VBE from
gv->{htotal,vtotal}.
- Add support for gv->disp_flags to select interlace, doublescan and
horizontal/vertical sync polarity.
- Return EINVAL for gv->disp_flags and sync-on-green.
This makes it possible to use xfree values for grfconfig.
 1.9 05-Mar-1997  veego branches: 1.9.2;
- Merlin works now in ZorroIII mode
- Fixes for Interlace and DoubleScan
- Memorysizedetction for 1MB Bords
- HiColor and TrueColor Support
- support for the Domino 16M proto card
 1.8 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.7 13-Oct-1996  christos backout previous kprintf change
 1.6 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.5 08-Oct-1996  thorpej Merge netbsd-1-2 branch back into mainline.
 1.4 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.3 09-Jun-1996  veego Make this really work on the Domino. Patch from Klaus Burkert
 1.2 03-Jun-1996  is #define GRFIOCBLANK_LIVE and GRFIOCBLANK_DARK in grfioctl.h to make absolutely
clear which switches the video signal on and which off.
Make all grf_??.c (which supported it) use the same polarity of the test.
While being here, use a > test instead of implicit != to make it extensible
to darker than dark values for power managment systems.
 1.1 19-May-1996  veego branches: 1.1.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.1.4.5 11-Jun-1996  is from trunk: leave room for darkerthan dark, which is now possible to add in the future in a compatible way; with jtc's permission
 1.1.4.4 11-Jun-1996  veego put a few spaces around some ='s
 1.1.4.3 11-Jun-1996  thorpej Pullup from trunk, at veego's request.
 1.1.4.2 04-Jun-1996  is Minimalist change to make this driver behave like the others on GRFIOCBLANK
and FBIOCSVIDEO.
 1.1.4.1 27-May-1996  is Fixes by Tobias Abt for Amiga Tseng driver: handle Zorro-III variants of these
boards correctly.
 1.9.2.2 05-Mar-1997  veego - Merlin works now in ZorroIII mode
- Fixes for Interlace and DoubleScan
- Memorysizedetction for 1MB Bords
- HiColor and TrueColor Support
- support for the Domino 16M proto card
 1.9.2.1 05-Mar-1997  veego file grf_et.c was added on branch is-newarp on 1997-03-05 22:50:39 +0000
 1.12.26.5 03-Jan-2003  thorpej Sync with HEAD.
 1.12.26.4 18-Oct-2002  nathanw Catch up to -current.
 1.12.26.3 13-Aug-2002  nathanw Catch up to -current.
 1.12.26.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.12.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.12.22.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.12.22.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.12.22.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.12.18.1 27-May-2003  msaitoh Pullup rev. 1.20-1.21 (requested by Ignatios in ticket #42)
iszthreepa() takes a physical address, not a virtual address.
Fixes PR#19175
 1.15.6.2 16-Jun-2003  grant Pull up revisions 1.20-1.21 (requested by is in ticket #1266):

iszthreepa() takes a physical address, not a virtual address.
This fixes PR 19175, reported and heavily debugged by Pawel
Chwalowski.

fix fatal typo
 1.15.6.1 07-Aug-2002  lukem Pull up revision 1.16 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.15.4.1 30-Aug-2002  gehenna catch up with -current.
 1.21.50.1 10-Dec-2006  yamt sync with head.
 1.21.48.1 12-Jan-2007  ad Sync with head.
 1.21.18.2 03-Sep-2007  yamt sync with head.
 1.21.18.1 30-Dec-2006  yamt sync with head.
 1.22.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.24.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.24.10.1 03-Oct-2007  garbled Sync with HEAD
 1.24.2.1 09-Oct-2007  ad Sync with head.
 1.25.2.1 06-Nov-2007  matt sync with HEAD
 1.26.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.26.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.26.20.2 11-Mar-2010  yamt sync with head
 1.26.20.1 04-May-2009  yamt sync with head.
 1.28.16.1 18-Feb-2012  mrg merge to -current.
 1.28.12.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.28.12.3 16-Jan-2013  yamt sync with (a bit old) head
 1.28.12.2 30-Oct-2012  yamt sync with head
 1.28.12.1 17-Apr-2012  yamt sync with head
 1.29.6.3 03-Dec-2017  jdolecek update from HEAD
 1.29.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.31.2.1 18-May-2014  rmind sync with head
 1.32.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.32.6.1 05-Dec-2016  skrll Sync with HEAD
 1.36.20.1 13-May-2021  thorpej Sync with HEAD.
 1.37.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.7 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 24-Dec-2005  perry branches: 1.6.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.5 26-Jan-2002  aymeric branches: 1.5.32;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 29-Jul-1997  veego branches: 1.4.34; 1.4.38;
s/inline/__inline/
 1.3 05-Mar-1997  veego branches: 1.3.2;
- Merlin works now in ZorroIII mode
- Fixes for Interlace and DoubleScan
- Memorysizedetction for 1MB Bords
- HiColor and TrueColor Support
- support for the Domino 16M proto card
 1.2 09-Jun-1996  veego Make this really work on the Domino. Patch from Klaus Burkert
 1.1 19-May-1996  veego branches: 1.1.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.1.4.2 11-Jun-1996  thorpej Pullup from trunk, at veego's request.
 1.1.4.1 27-May-1996  is Fixes by Tobias Abt for Amiga Tseng driver: handle Zorro-III variants of these
boards correctly.
 1.3.2.2 05-Mar-1997  veego - Merlin works now in ZorroIII mode
- Fixes for Interlace and DoubleScan
- Memorysizedetction for 1MB Bords
- HiColor and TrueColor Support
- support for the Domino 16M proto card
 1.3.2.1 05-Mar-1997  veego file grf_etreg.h was added on branch is-newarp on 1997-03-05 22:50:41 +0000
 1.4.38.1 28-Feb-2002  nathanw Catch up to -current.
 1.4.34.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.5.32.2 03-Sep-2007  yamt sync with head.
 1.5.32.1 21-Jun-2006  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.62 03-May-2022  andvar fix various typos, mainly s/trasfering/transferring/ and s/theese/these/.
 1.61 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.60 09-Aug-2021  andvar s/definitons/definitions/
 1.59 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.58 27-Apr-2021  thorpej branches: 1.58.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.57 22-Jan-2014  christos branches: 1.57.46;
gcc-4.8.x unused variable fixes
 1.56 08-Nov-2012  rkujawa branches: 1.56.2;
Make Amiga video drivers work again after device/softc changes.
Patch from chs@.
 1.55 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.54 15-Dec-2011  phx branches: 1.54.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.53 26-Oct-2009  cegger branches: 1.53.12; 1.53.16;
kill extra whitespaces
reviewed by tsutsui@
 1.52 18-Mar-2009  cegger bcopy -> memcpy
 1.51 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.50 17-Oct-2007  garbled branches: 1.50.20; 1.50.28; 1.50.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.49 20-Aug-2007  is branches: 1.49.2;
First part of amigappc support patches by Frank Wille.
 1.48 05-Mar-2007  he branches: 1.48.2; 1.48.10; 1.48.14; 1.48.18;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.47 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.46 24-Nov-2006  wiz branches: 1.46.4;
s/independant/independent/, from Zafer.
 1.45 24-Dec-2005  perry branches: 1.45.20; 1.45.22;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.44 11-Dec-2005  christos merge ktrace-lwp.
 1.43 13-Jun-2005  jmc branches: 1.43.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.42 31-May-2003  kristerw branches: 1.42.2;
Use __asm instead of asm, to keep lint happy.
 1.41 20-Jan-2003  simonb The Double-Semi-Colon Police.
 1.40 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.39 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.38 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.37 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.36 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.35 17-Mar-2002  atatat branches: 1.35.4; 1.35.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.34 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.33 27-Jan-2002  is Add some video modes which are displayable on my LCD.
 1.32 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.31 20-Aug-2001  wiz branches: 1.31.6;
"wierd" is weird.
 1.30 26-Jul-2001  wiz Various typos in comments (neccessary, sceme, choise, ...).
 1.29 25-Mar-1999  is branches: 1.29.22;
defopt Amiga graphics console options
 1.28 12-Jan-1998  thorpej Adjust for changes to config.
 1.27 29-Jul-1997  veego - Change the check in r[ht]_getvmode for md->DEP == 4 to md->DEP != 4.
This fixes a wrong output from grfconfig /dev/grf[23]
- changes for the grfconfig interface:
- Remove gv->hblank_stop and gv->vblank_stop.
- Only print doublescan and interlace flags. Horizontal/vertical sync
polarities are not yet supported and sync-on-green will never be
supported.
 1.26 31-Dec-1996  is First part of making hardware cursor actually work.
For some reason it wouldn't get positioned right when mapped in through the
blitter memory mapped location, so switched to the register mapping, which
works.
XXX colormap handling for the cursor is still broken.
 1.25 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.24 13-Oct-1996  christos backout previous kprintf change
 1.23 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.22 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.21 11-Aug-1996  veego Disable the Hardwarecursor on the RetinaZ3 to solve the problems with
wrong mouse jumps under X11.
Remove the not working options KGDB from DRACO and GENERIC and added
an option to enable the HWC for the RetinaZ3
 1.20 03-Jun-1996  is #define GRFIOCBLANK_LIVE and GRFIOCBLANK_DARK in grfioctl.h to make absolutely
clear which switches the video signal on and which off.
Make all grf_??.c (which supported it) use the same polarity of the test.
While being here, use a > test instead of implicit != to make it extensible
to darker than dark values for power managment systems.
 1.19 24-May-1996  is Delete some occurences of kernel startup debug code, move others inside
#ifdef DEBUG_KERNEL_START.
 1.18 24-May-1996  is Make the GRFIOCBLANK ioctl set the right timing divisor when switching the
screen back on.
 1.17 19-May-1996  veego branches: 1.17.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.16 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.15 01-May-1996  veego Cleanup for -Wall if CV64CONSOLE, ULOWELLCONSOLE or RETINACONSOLE is not
defined.
 1.14 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.13 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.12 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.11 06-Mar-1996  is Altais graphics board support, and some nicer formatting of preconftab.
Closes PR #1812 by myself.
 1.10 28-Jan-1996  chopps applied patch from 1811 which unifies mode support across gfx boards.
 1.9 20-Aug-1995  chopps rename RZ3_64BIT_SPRITE to RH_64BIT_SPRITE
 1.8 20-Aug-1995  chopps make defaults more accessable.
 1.7 20-Aug-1995  chopps fix grf_rh problem with sprite and allow mode changing.
from mw@eunet.ch (Markus Wild)
 1.6 16-Feb-1995  chopps cleanup copyright stuff
 1.5 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 15-Jun-1994  chopps clock now uses passed in frequency if present protect dma cache
flush calls from non 040. don't compile ite_xx if not used.
 1.1 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me.
 1.17.4.3 06-Sep-1996  jtc Pulled up rev 1.21 by request from Bernd Ernesti
 1.17.4.2 11-Jun-1996  is from trunk: leave room for darkerthan dark, which is now possible to add in the future in a compatible way; with jtc's permission
 1.17.4.1 26-May-1996  is Pull up of bug fixes for Retina screenblank ioctl and an unused variable
warning from if_ae when building INSTALL (that is, without bpfilter) kernels.
 1.29.22.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.29.22.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.29.22.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.29.22.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.29.22.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.29.22.1 03-Aug-2001  lukem update to -current
 1.31.6.7 03-Jan-2003  thorpej Sync with HEAD.
 1.31.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.31.6.5 17-Sep-2002  nathanw Catch up to -current.
 1.31.6.4 13-Aug-2002  nathanw Catch up to -current.
 1.31.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.31.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.31.6.1 20-Aug-2001  nathanw file grf_rh.c was added on branch nathanw_sa on 2002-02-28 04:06:40 +0000
 1.35.6.1 07-Aug-2002  lukem Pull up revision 1.36 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.35.4.2 30-Aug-2002  gehenna catch up with -current.
 1.35.4.1 16-May-2002  gehenna Remove BANKEDDEVPAGER stuff.
 1.42.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.43.2.3 03-Sep-2007  yamt sync with head.
 1.43.2.2 30-Dec-2006  yamt sync with head.
 1.43.2.1 21-Jun-2006  yamt sync with head.
 1.45.22.1 10-Dec-2006  yamt sync with head.
 1.45.20.1 12-Jan-2007  ad Sync with head.
 1.46.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.48.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.48.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.48.10.1 03-Oct-2007  garbled Sync with HEAD
 1.48.2.1 09-Oct-2007  ad Sync with head.
 1.49.2.1 06-Nov-2007  matt sync with HEAD
 1.50.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.50.20.2 11-Mar-2010  yamt sync with head
 1.50.20.1 04-May-2009  yamt sync with head.
 1.53.16.1 18-Feb-2012  mrg merge to -current.
 1.53.12.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.53.12.3 16-Jan-2013  yamt sync with (a bit old) head
 1.53.12.2 30-Oct-2012  yamt sync with head
 1.53.12.1 17-Apr-2012  yamt sync with head
 1.54.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.54.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.56.2.1 18-May-2014  rmind sync with head
 1.57.46.1 13-May-2021  thorpej Sync with HEAD.
 1.58.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.18 20-Jul-2024  andvar s/hardwar-cursor/hardware-cursor/, s/hardrare/hardware/ in comments.
 1.17 03-May-2022  andvar branches: 1.17.10;
fix various typos, mainly s/trasfering/transferring/ and s/theese/these/.
 1.16 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 24-Dec-2005  perry branches: 1.15.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.14 11-Dec-2005  christos merge ktrace-lwp.
 1.13 24-Feb-2004  wiz branches: 1.13.16;
parameter with two es. From Peter Postma.
 1.12 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.11 05-Feb-2003  perry branches: 1.11.2;
"Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
 1.10 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.9 13-Mar-2000  soren branches: 1.9.8; 1.9.12;
Fix doubled 'the's in comments.
 1.8 29-Jul-1997  veego branches: 1.8.20;
s/inline/__inline/
 1.7 19-May-1996  veego - grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.6 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.5 20-Aug-1995  chopps fix grf_rh problem with sprite and allow mode changing.
from mw@eunet.ch (Markus Wild)
 1.4 16-Feb-1995  chopps cleanup copyright stuff
 1.3 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me.
 1.8.20.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.9.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.9.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 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.16.2 03-Sep-2007  yamt sync with head.
 1.13.16.1 21-Jun-2006  yamt sync with head.
 1.15.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.17.10.1 02-Aug-2025  perseant Sync with HEAD
 1.62 03-May-2022  andvar fix various typos, mainly s/trasfering/transferring/ and s/theese/these/.
 1.61 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.60 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.59 27-Apr-2021  thorpej branches: 1.59.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.58 18-Oct-2014  snj branches: 1.58.36;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.57 08-Nov-2012  rkujawa Make Amiga video drivers work again after device/softc changes.
Patch from chs@.
 1.56 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.55 15-Dec-2011  phx branches: 1.55.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.54 26-Oct-2009  cegger branches: 1.54.12; 1.54.16;
kill extra whitespaces
reviewed by tsutsui@
 1.53 18-Mar-2009  cegger bcopy -> memcpy
 1.52 05-Mar-2007  he branches: 1.52.44; 1.52.52; 1.52.58;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.51 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.50 11-Dec-2005  christos branches: 1.50.26;
merge ktrace-lwp.
 1.49 13-Jun-2005  jmc branches: 1.49.2;
Fix some shadowing of variables
 1.48 20-Jan-2003  simonb branches: 1.48.2;
The Double-Semi-Colon Police.
 1.47 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.46 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.45 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.44 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.43 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.42 17-Mar-2002  atatat branches: 1.42.4; 1.42.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.41 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.40 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.39 20-Aug-2001  wiz branches: 1.39.6;
"wierd" is weird.
 1.38 26-Jul-2001  wiz Various typos in comments (neccessary, sceme, choise, ...).
 1.37 25-Mar-1999  is branches: 1.37.22;
defopt Amiga graphics console options
 1.36 12-Jan-1998  thorpej Adjust for changes to config.
 1.35 29-Jul-1997  veego - Change the check in r[ht]_getvmode for md->DEP == 4 to md->DEP != 4.
This fixes a wrong output from grfconfig /dev/grf[23]
- changes for the grfconfig interface:
- Remove gv->hblank_stop and gv->vblank_stop.
- Only print doublescan and interlace flags. Horizontal/vertical sync
polarities are not yet supported and sync-on-green will never be
supported.
 1.34 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.33 13-Oct-1996  christos backout previous kprintf change
 1.32 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.31 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.30 03-Jun-1996  is #define GRFIOCBLANK_LIVE and GRFIOCBLANK_DARK in grfioctl.h to make absolutely
clear which switches the video signal on and which off.
Make all grf_??.c (which supported it) use the same polarity of the test.
While being here, use a > test instead of implicit != to make it extensible
to darker than dark values for power managment systems.
 1.29 25-May-1996  is Fix stupid pasto.
 1.28 24-May-1996  is Make the GRFIOCBLANK ioctl set the right timing divisor when switching the
screen back on.
 1.27 19-May-1996  veego branches: 1.27.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.26 01-May-1996  veego Cleanup for -Wall if CV64CONSOLE, ULOWELLCONSOLE or RETINACONSOLE is not
defined.
 1.25 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.24 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.23 28-Jan-1996  chopps applied patch from 1811 which unifies mode support across gfx boards.
 1.22 23-Feb-1995  chopps fix warnings (br#816)
 1.21 16-Feb-1995  chopps cleanup copyright stuff
 1.20 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.19 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.18 26-Oct-1994  cgd new RCS ID format.
 1.17 31-Jul-1994  chopps branches: 1.17.2;
fix default frequency so that normal VGA monitor types don't puke.
 1.16 23-Jun-1994  chopps branches: 1.16.2;
some various fixes from ahh@netcom.com (Andy Heffernan)
 1.15 15-Jun-1994  chopps clock now uses passed in frequency if present protect dma cache
flush calls from non 040. don't compile ite_xx if not used.
 1.14 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me. floppy changes, should now be solid.
some changes to ite and ms to fix a couple bugs report by Donn.
 1.13 04-Jun-1994  chopps started out cleaning up amiga_init.c ended up touching alot of files.
 1.12 03-Jun-1994  chopps z buses early config support, needs testing.
 1.11 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.10 26-Apr-1994  chopps don't reinit board twice if it works once.
 1.9 22-Apr-1994  chopps Changed fonts. Added 2 non (c) fonts kf_8x{8,11}.c retina now uses
kf_8x8. CC console users can now choose between the provided fonts
or provide there own.
 1.8 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.7 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.6 11-Feb-1994  chopps Add missing Id's
 1.5 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.4 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.3 31-Oct-1993  mw Change gfx-drivers to used g_data for their private data, and use regaddr
for what it's meant, that's to point to the register area. Now, both
gfx drivers should be fairly controllable from user-level applications.
 1.2 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.16.2.1 03-Aug-1994  cgd from trunk.
 1.17.2.2 31-Jul-1994  chopps fix default frequency so that normal VGA monitor types don't puke.
 1.17.2.1 31-Jul-1994  chopps file grf_rt.c was added on branch netbsd-1-0 on 1994-07-31 18:42:07 +0000
 1.27.4.2 11-Jun-1996  is from trunk: leave room for darkerthan dark, which is now possible to add in the future in a compatible way; with jtc's permission
 1.27.4.1 26-May-1996  is Pull up of bug fixes for Retina screenblank ioctl and an unused variable
warning from if_ae when building INSTALL (that is, without bpfilter) kernels.
 1.37.22.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.37.22.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.37.22.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.37.22.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.37.22.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.37.22.1 03-Aug-2001  lukem update to -current
 1.39.6.7 03-Jan-2003  thorpej Sync with HEAD.
 1.39.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.39.6.5 17-Sep-2002  nathanw Catch up to -current.
 1.39.6.4 13-Aug-2002  nathanw Catch up to -current.
 1.39.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.39.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.39.6.1 20-Aug-2001  nathanw file grf_rt.c was added on branch nathanw_sa on 2002-02-28 04:06:41 +0000
 1.42.6.1 07-Aug-2002  lukem Pull up revision 1.43 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.42.4.2 30-Aug-2002  gehenna catch up with -current.
 1.42.4.1 16-May-2002  gehenna Remove BANKEDDEVPAGER stuff.
 1.48.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.49.2.1 03-Sep-2007  yamt sync with head.
 1.50.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.52.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.52.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.52.44.2 11-Mar-2010  yamt sync with head
 1.52.44.1 04-May-2009  yamt sync with head.
 1.54.16.1 18-Feb-2012  mrg merge to -current.
 1.54.12.3 16-Jan-2013  yamt sync with (a bit old) head
 1.54.12.2 30-Oct-2012  yamt sync with head
 1.54.12.1 17-Apr-2012  yamt sync with head
 1.55.6.2 03-Dec-2017  jdolecek update from HEAD
 1.55.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.58.36.1 13-May-2021  thorpej Sync with HEAD.
 1.59.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.17 03-May-2022  andvar fix various typos, mainly s/trasfering/transferring/ and s/theese/these/.
 1.16 28-Feb-2010  snj Fight the ever-increasing size of src checkouts by spelling "useful"
without an extra l.
 1.15 04-Mar-2007  christos branches: 1.15.44; 1.15.64;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 24-Dec-2005  perry branches: 1.14.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 10-Nov-2003  wiz branches: 1.12.16;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.11 26-Jan-2002  aymeric branches: 1.11.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.10 26-Jul-2001  wiz branches: 1.10.6;
Various typos in comments (neccessary, sceme, choise, ...).
 1.9 13-Mar-2000  soren branches: 1.9.8;
Fix doubled 'the's in comments.
 1.8 29-Jul-1997  veego branches: 1.8.20;
s/inline/__inline/
 1.7 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.6 16-Feb-1995  chopps cleanup copyright stuff
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.8.20.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.9.8.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.9.8.1 03-Aug-2001  lukem update to -current
 1.10.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.10.6.1 26-Jul-2001  nathanw file grf_rtreg.h was added on branch nathanw_sa on 2002-02-28 04:06:42 +0000
 1.11.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.16.1 03-Aug-2004  skrll Sync with HEAD
 1.12.16.2 03-Sep-2007  yamt sync with head.
 1.12.16.1 21-Jun-2006  yamt sync with head.
 1.14.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.64.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.15.44.1 11-Mar-2010  yamt sync with head
 1.6 01-Mar-1995  mycroft Clean up deleted files.
 1.5 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.56 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.55 28-Aug-2023  andvar rename DEBUG_UL to UL_DEBUG for naming consistency.
remove stray UL_DEBUG definition in grf_ul.c
 1.54 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.53 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.52 27-Apr-2021  thorpej branches: 1.52.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.51 03-Nov-2016  kamil branches: 1.51.32;
Prefer modern simple past tense and past participle of catch

The "catched" form is obsolete and nonstandard, prefer "caught".
 1.50 22-Jan-2014  christos branches: 1.50.6; 1.50.10;
gcc-4.8.x unused variable fixes
 1.49 08-Nov-2012  rkujawa branches: 1.49.2;
Make Amiga video drivers work again after device/softc changes.
Patch from chs@.
 1.48 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.47 15-Dec-2011  phx branches: 1.47.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.46 26-Oct-2009  cegger branches: 1.46.12; 1.46.16;
kill extra whitespaces
reviewed by tsutsui@
 1.45 18-Mar-2009  cegger bcopy -> memcpy
 1.44 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.43 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.42 28-Apr-2008  martin branches: 1.42.8; 1.42.14;
Remove clause 3 and 4 from TNF licenses
 1.41 05-Mar-2007  he branches: 1.41.40; 1.41.42; 1.41.44;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.40 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.39 24-Dec-2005  perry branches: 1.39.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.38 11-Dec-2005  christos merge ktrace-lwp.
 1.37 13-Feb-2004  wiz branches: 1.37.16;
Uppercase CPU, plural is CPUs.
 1.36 06-Jan-2003  wiz branches: 1.36.2;
interrupt with two rs.
 1.35 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.34 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.33 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.32 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.31 17-Mar-2002  atatat branches: 1.31.4; 1.31.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.30 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.29 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.28 25-Mar-1999  is branches: 1.28.22; 1.28.26;
defopt Amiga graphics console options
 1.27 16-Feb-1999  is Fix Copyright dates
 1.26 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.25 12-Jan-1998  thorpej Adjust for changes to config.
 1.24 29-Jul-1997  veego - changes for the grfconfig interface (provided by Ignatios Souvatzis):
- Remove gv->{hblank_stop,vblank_stop} and use the other grfvideo_mode
values to set ba->data.
- Add gv->disp_flags to select interlace.
- Not yet supported are: doublescan, sync-on-green and the horizontal/vertical
sync polarity.
This makes it possible to use xfree values for grfconfig.
 1.23 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.22 13-Oct-1996  christos backout previous kprintf change
 1.21 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.20 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.19 08-Jul-1996  is Cleaned up copyright notice, fixed a typo, and sync the comment in the
GSP assembler file with reality.
 1.18 03-Jun-1996  is #define GRFIOCBLANK_LIVE and GRFIOCBLANK_DARK in grfioctl.h to make absolutely
clear which switches the video signal on and which off.
Make all grf_??.c (which supported it) use the same polarity of the test.
While being here, use a > test instead of implicit != to make it extensible
to darker than dark values for power managment systems.
 1.17 09-May-1996  is branches: 1.17.4;
First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.16 01-May-1996  veego Cleanup for -Wall if CV64CONSOLE, ULOWELLCONSOLE or RETINACONSOLE is not
defined.
 1.15 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.14 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.13 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.12 04-Mar-1996  is Grr... my fault when send-pr'ing the "CPU too fast" error patch. The chip
is called BT458, not BT478.
 1.11 28-Jan-1996  chopps fix bounds check #1939
 1.10 27-Dec-1995  chopps add support for GRFIOCBLANK (pr#1810) from Ignatios Souvatzis
 1.9 27-Dec-1995  chopps fix initializtion (pr#1853) from Ignatios Souvatzis
 1.8 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.7 09-Oct-1995  chopps branches: 1.7.2;
update from Ignatios Souvatzis <is@beverly.rhein.de>
 1.6 09-Oct-1995  chopps new cybervision 64 grf from Bernd Ernesti <bernd@arresum.inka.de> and others
update config files (adding missing scsibus entry for aftsc0)
 1.5 07-Oct-1995  chopps update from Ignatios Souvatzis <is@beverly.rhein.de>
 1.4 07-Oct-1995  chopps transpose osc values from Ignatios Souvatzis <is@beverly.rhein.de>
 1.3 29-Sep-1995  chopps fix wrong arg to strncpy
 1.2 18-Aug-1995  chopps resolve conflict with grf_rt over monitor_defs symbol
 1.1 18-Aug-1995  chopps new a2410 driver from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.7.2.2 04-Mar-1996  is Two bug fixes from -current:
1) remove a timing assumption in grf_ul.c which breaks on Amigas with
68040 accelerator boards
2) correct an off-by-one error in a test which made grf_ul reject the last
monitor definition in the table.
 1.7.2.1 10-Nov-1995  chopps update grf_ul; support files now only used if needed.
 1.17.4.1 11-Jun-1996  is from trunk: leave room for darkerthan dark, which is now possible to add in the future in a compatible way; with jtc's permission
 1.28.26.6 07-Jan-2003  thorpej Sync with HEAD.
 1.28.26.5 03-Jan-2003  thorpej Sync with HEAD.
 1.28.26.4 18-Oct-2002  nathanw Catch up to -current.
 1.28.26.3 13-Aug-2002  nathanw Catch up to -current.
 1.28.26.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.28.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.28.22.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.28.22.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.28.22.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.28.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.31.6.1 07-Aug-2002  lukem Pull up revision 1.32 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.31.4.1 30-Aug-2002  gehenna catch up with -current.
 1.36.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.36.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.36.2.1 03-Aug-2004  skrll Sync with HEAD
 1.37.16.2 03-Sep-2007  yamt sync with head.
 1.37.16.1 21-Jun-2006  yamt sync with head.
 1.39.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.41.44.3 11-Mar-2010  yamt sync with head
 1.41.44.2 04-May-2009  yamt sync with head.
 1.41.44.1 16-May-2008  yamt sync with head.
 1.41.42.1 18-May-2008  yamt sync with head.
 1.41.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.42.14.1 13-May-2009  jym Sync with HEAD.

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

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.46.12.3 16-Jan-2013  yamt sync with (a bit old) head
 1.46.12.2 30-Oct-2012  yamt sync with head
 1.46.12.1 17-Apr-2012  yamt sync with head
 1.47.6.3 03-Dec-2017  jdolecek update from HEAD
 1.47.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.49.2.1 18-May-2014  rmind sync with head
 1.50.10.1 04-Nov-2016  pgoyette Sync with HEAD
 1.50.6.1 05-Dec-2016  skrll Sync with HEAD
 1.51.32.1 13-May-2021  thorpej Sync with HEAD.
 1.52.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.2 27-Dec-1995  chopps rename grf_ul.gsp
 1.1 18-Aug-1995  chopps branches: 1.1.2;
new a2410 driver from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.1.2.1 10-Nov-1995  chopps update grf_ul; support files now only used if needed.
 1.10 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9 05-Mar-2007  he branches: 1.9.40; 1.9.42; 1.9.44;
Make the various graphics card drivers compile again.
Use casts to char* before pointer arithmetic.
Try to preserve `volatile' qualification where possible, though
uses of kvtop(), strcpy(), copyin() and copyout() gain an unfortunate
but probably unavoidable __UNVOLATILE().
Correct various instances of "void *ba, fb" to have * in front of fb as well.
Remove some redundant parenthesis pairs in some of the vga* macros.
 1.8 24-Dec-2005  perry branches: 1.8.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.7 26-Jan-2002  aymeric branches: 1.7.32;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 16-Feb-1999  is branches: 1.6.22; 1.6.26;
Fix Copyright dates
 1.5 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.4 08-Jul-1996  is Cleaned up copyright notice, fixed a typo, and sync the comment in the
GSP assembler file with reality.
 1.3 31-Dec-1995  chopps explicitly mask the address value
 1.2 07-Oct-1995  chopps update from Ignatios Souvatzis <is@beverly.rhein.de>
 1.1 18-Aug-1995  chopps new a2410 driver from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.6.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.7.32.2 03-Sep-2007  yamt sync with head.
 1.7.32.1 21-Jun-2006  yamt sync with head.
 1.8.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.44.1 16-May-2008  yamt sync with head.
 1.9.42.1 18-May-2008  yamt sync with head.
 1.9.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 26-May-2002  jdolecek branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
regen (RCS Id fix)
 1.1 26-May-2002  jdolecek pregenerate grf_ultms.c, so that gspa isn't needed during kernel build
 1.2.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1 26-May-2002  jdolecek file grf_ultms.c was added on branch kqueue on 2002-06-23 17:34:28 +0000
 1.2.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.2.6.1 26-May-2002  nathanw file grf_ultms.c was added on branch nathanw_sa on 2002-06-20 03:37:53 +0000
 1.2.4.2 30-May-2002  gehenna Catch up with -current.
 1.2.4.1 26-May-2002  gehenna file grf_ultms.c was added on branch gehenna-devsw on 2002-05-30 15:32:34 +0000
 1.2.2.3 28-May-2002  tv Pull up revision 1.2 (requested by jdolecek):
regen (RCS Id fix)
 1.2.2.2 28-May-2002  tv Pull up revision 1.1 (requested by jdolecek):
pregenerate grf_ultms.c, so that gspa isn't needed during kernel build
 1.2.2.1 26-May-2002  tv file grf_ultms.c was added on branch netbsd-1-6 on 2002-05-28 19:34:58 +0000
 1.10 09-Nov-2009  is Move to two-clause license.
 1.9 11-Dec-2005  christos branches: 1.9.78;
merge ktrace-lwp.
 1.8 16-Jul-2003  is Update comments.
 1.7 26-May-2002  jdolecek branches: 1.7.6;
update comments
 1.6 26-Jan-2002  aymeric branches: 1.6.8; 1.6.10;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.5 13-Jun-2001  wiz branches: 1.5.2; 1.5.8;
withough -> without
 1.4 05-Jan-1998  perry branches: 1.4.26;
RCSID Police.
 1.3 08-Jul-1996  is Cleaned up copyright notice, fixed a typo, and sync the comment in the
GSP assembler file with reality.
 1.2 27-Dec-1995  chopps rename grf_ul.gsp
 1.1 10-Nov-1995  chopps branches: 1.1.2;
file grf_ultms.g was initially added on branch netbsd-1-1.
 1.1.2.1 10-Nov-1995  chopps update grf_ul; support files now only used if needed.
 1.4.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.5.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.5.8.1 13-Jun-2001  nathanw file grf_ultms.g was added on branch nathanw_sa on 2002-02-28 04:06:42 +0000
 1.5.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.10.1 28-May-2002  tv Pull up revision 1.7 (requested by jdolecek):
update comments
 1.6.8.1 30-May-2002  gehenna Catch up with -current.
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.78.1 11-Mar-2010  yamt sync with head
 1.2 09-Oct-1995  chopps file is now generated at compile time
 1.1 18-Aug-1995  chopps new a2410 driver from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.7 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.6 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.5 21-Apr-1996  veego branches: 1.5.44; 1.5.48;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2 27-Mar-1994  chopps dlists.h ==> sys/queue.h
 1.1 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.5.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.5.44.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.39 12-Jul-2023  mlelstv Make inclusion of sys/intr.h explicit for spl*.
 1.38 23-Jan-2023  andvar s/makre/make/ in comment.
 1.37 26-Mar-2022  andvar branches: 1.37.4;
s/logial/logical/
 1.36 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.35 08-Jul-2011  mrg avoid uninitialised variable warnings.
 1.34 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.33 26-Oct-2009  cegger branches: 1.33.4;
kill extra whitespaces
reviewed by tsutsui@
 1.32 18-Mar-2009  cegger bcopy -> memcpy
 1.31 18-Mar-2009  cegger bzero -> memset
 1.30 17-Oct-2007  garbled branches: 1.30.20; 1.30.28; 1.30.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.29 16-Jun-2007  dsl branches: 1.29.10;
Put the argument to '#if defined' in ().
The C standard allows either form, but we normally treat 'defined' as
a function, not an operator.
 1.28 08-Mar-2006  lukem branches: 1.28.20; 1.28.22; 1.28.28;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.27 11-Dec-2005  christos branches: 1.27.4; 1.27.6; 1.27.8; 1.27.10;
merge ktrace-lwp.
 1.26 13-Jun-2005  jmc branches: 1.26.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.25 24-Feb-2004  wiz becuase -> because. From Peter Postma.
 1.24 01-Apr-2003  thorpej branches: 1.24.2;
Use PAGE_SIZE rather than NBPG.
 1.23 13-Mar-2002  jandberg Fixed cc_load_mode restart copper after setting the new list
when called with null argument. This is needed for the screen
blank to actually take effect.
 1.22 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.21 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.20 25-May-2000  is branches: 1.20.8; 1.20.12;
Prepare for AmigaPPC.
 1.19 25-Mar-1999  is branches: 1.19.8;
Defopting grf_cc configuration parameters
 1.18 24-Mar-1999  is AGA: VGAonly timing (GRF_AGA_VGA), by Adam Ciarcinski
 1.17 19-Sep-1997  mhitch Add an 800x600 Super72 mode; started by Neil Clark and finished by me.
NOTE: due to hardware requirement of the AGA chipset, the framebuffer width
has to be a multiple of 64 bits. An 800x600 display will use a memory width
of 832 bits, which the current X server can't handle. To get a usable
display, the width needs to be 832 or 768.
 1.16 10-Jun-1997  veego branches: 1.16.4;
s/amiga_round_page/m68k_round_page/
 1.15 13-Oct-1996  christos backout previous kprintf change
 1.14 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 08-Oct-1996  thorpej Merge netbsd-1-2 branch back into mainline.
 1.12 19-May-1996  veego branches: 1.12.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.11 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.10 05-Oct-1995  chopps first attempt at A4000T support, remove GRF_AGA's dependence on GRF_ECS.
page 0 is now invalid, other minor cleanup.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 29-Sep-1995  chopps move 040 to hp300 style, use new MI lance ethernet driver
a few minor fixes WRT prototypes.
if_le from Charles rest from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 26-Jun-1995  chopps fix for sprite problem from Kenneth Dyke <kcd@babylon5.jumpgate.com>
 1.7 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 30-Jun-1994  chopps some aga cleanup from osymh@gemini.oscs.montana.edu (Michael Hitch)
 1.4 29-Jun-1994  chopps aga mode, finally.. thanks to osymh@gemini.oscs.montana.edu (Michael Hitch)
 1.3 27-Mar-1994  chopps dlists.h ==> sys/queue.h
 1.2 14-Mar-1994  chopps use dmode passed in to fetch the frame pointers. fix from,
francis@hasler.ascom.ch (Francis Demierre).
 1.1 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.12.4.1 28-May-1996  is The AGA changes for VGA monitors seem to have problems for some people,
especially when making screens large. Put them inside #ifdef GRF_AGA_VGA
until a better fix is known. (On request from veego)
 1.16.4.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.19.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.20.12.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.20.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.20.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.20.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.24.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.2.2 03-Sep-2007  yamt sync with head.
 1.26.2.1 21-Jun-2006  yamt sync with head.
 1.27.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.27.8.1 13-Mar-2006  yamt sync with head.
 1.27.6.1 22-Apr-2006  simonb Sync with head.
 1.27.4.1 09-Sep-2006  rpaulo sync with head
 1.28.28.1 26-Jun-2007  garbled Sync with HEAD.
 1.28.22.1 11-Jul-2007  mjf Sync with head.
 1.28.20.1 15-Jul-2007  ad Sync with head.
 1.29.10.1 06-Nov-2007  matt sync with HEAD
 1.30.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.30.20.2 11-Mar-2010  yamt sync with head
 1.30.20.1 04-May-2009  yamt sync with head.
 1.33.4.1 05-Mar-2011  rmind sync with head
 1.37.4.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

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

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

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

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

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

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

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

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

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

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

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

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

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

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

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

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

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

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

ddb: Cast pointer to uintptr_t first before db_expr_t.

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

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

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

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

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

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

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

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

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

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

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

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

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

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

fix hppa and vax builds.

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

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

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

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

re-fix hppa builds.

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

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

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

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

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

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

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

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

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

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

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

Note that fls32 is 1-based and returns 0 for x=0.
 1.11 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.10 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.9 25-Mar-1999  is branches: 1.9.22; 1.9.26;
Defopting grf_cc configuration parameters
 1.8 28-Apr-1996  mhitch Fix warnings from -Wall.
 1.7 05-Oct-1995  chopps first attempt at A4000T support, remove GRF_AGA's dependence on GRF_ECS.
page 0 is now invalid, other minor cleanup.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 02-Jul-1994  chopps couple fixes from Michael. 2091 now uses 24bit only dma (oops)
 1.4 29-Jun-1994  chopps aga mode, finally.. thanks to osymh@gemini.oscs.montana.edu (Michael Hitch)
 1.3 27-Mar-1994  chopps dlists.h ==> sys/queue.h
 1.2 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.1 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.9.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.9.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.9 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.8 26-Jan-2002  aymeric branches: 1.8.32; 1.8.46; 1.8.48; 1.8.50; 1.8.52;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.7 19-Sep-1997  mhitch branches: 1.7.30; 1.7.34;
Add an 800x600 Super72 mode; started by Neil Clark and finished by me.
NOTE: due to hardware requirement of the AGA chipset, the framebuffer width
has to be a multiple of 64 bits. An 800x600 display will use a memory width
of 832 bits, which the current X server can't handle. To get a usable
display, the width needs to be 832 or 768.
 1.6 05-Oct-1995  chopps branches: 1.6.14;
first attempt at A4000T support, remove GRF_AGA's dependence on GRF_ECS.
page 0 is now invalid, other minor cleanup.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 29-Jun-1994  chopps aga mode, finally.. thanks to osymh@gemini.oscs.montana.edu (Michael Hitch)
 1.2 27-Mar-1994  chopps dlists.h ==> sys/queue.h
 1.1 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.6.14.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.34.1 28-Feb-2002  nathanw Catch up to -current.
 1.7.30.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.8.52.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.8.50.1 13-Mar-2006  yamt sync with head.
 1.8.48.1 22-Apr-2006  simonb Sync with head.
 1.8.46.1 09-Sep-2006  rpaulo sync with head
 1.8.32.1 21-Jun-2006  yamt sync with head.
 1.10 05-Dec-2021  msaitoh s/convience/convenience/ in comment.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 13-Jun-2005  jmc Fix a ton of const/volatile issues shown with new warning flags
 1.7 26-Jan-2002  aymeric branches: 1.7.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 13-Jan-2002  jandberg Amiga wsdisplay updates.

conf/GENERIC:
conf/files.amiga:
- Bring in wsfont definitions.

dev/grfabs_reg.h:
- Add macros for decomposing palette entries.

dev/amidisplaycc.c:
- Support for fonts, either wsfonts compiled into kernel
or runtime-loadable by ioctl. Font width still limited to 8,
height may vary.
- Limited support for mapped displays. No way to adjust display
mode. Palette setting works.
- Prettier default palette (white on black).
- Probes correctly as WSDISPLAY_TYPE_AMIGACC.
- Support for screen blanking.
 1.5 21-Apr-1996  veego branches: 1.5.44; 1.5.48;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 29-Jun-1994  chopps aga mode, finally.. thanks to osymh@gemini.oscs.montana.edu (Michael Hitch)
 1.2 27-Mar-1994  chopps dlists.h ==> sys/queue.h
 1.1 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.5.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.5.44.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.7.16.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.23 24-May-2022  andvar s/changable/changeable/ in comments.
 1.22 01-Nov-2021  andvar fix typos, mainly in words minimum and maximum, but also few others.
 1.21 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.20 08-Feb-2011  rmind branches: 1.20.14; 1.20.32;
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.19 04-Mar-2007  christos branches: 1.19.66; 1.19.72; 1.19.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.18 24-Nov-2006  wiz branches: 1.18.4;
s/independant/independent/, from Zafer.
 1.17 11-Dec-2005  christos branches: 1.17.20; 1.17.22;
merge ktrace-lwp.
 1.16 07-Aug-2003  agc branches: 1.16.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.15 26-Jan-2002  aymeric branches: 1.15.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.14 05-Aug-2001  jdolecek branches: 1.14.6;
use unsigned variable types as appropriate
 1.13 29-Jul-1997  veego branches: 1.13.30; 1.13.34;
- Remove grfvideo_mode->hblank_stop and grfvideo_mode->vblank_stop.
- Add grfvideo_mode->disp_flags to select interlace, doublescan,
sync-on-green and horizontal/vertical sync polarity.
- Add some constants for grfvideo_mode->disp_flags.
 1.12 03-Jun-1996  is #define GRFIOCBLANK_LIVE and GRFIOCBLANK_DARK in grfioctl.h to make absolutely
clear which switches the video signal on and which off.
Make all grf_??.c (which supported it) use the same polarity of the test.
While being here, use a > test instead of implicit != to make it extensible
to darker than dark values for power managment systems.
 1.11 09-Oct-1995  chopps branches: 1.11.6;
new cybervision 64 grf from Bernd Ernesti <bernd@arresum.inka.de> and others
update config files (adding missing scsibus entry for aftsc0)
 1.10 23-Apr-1995  chopps new grfcl driver submitted by Ezra Story <ezy@panix.com>
 1.9 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.8 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 11-Feb-1994  chopps Add missing Id's
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.11.6.1 04-Jun-1996  is From main branch: add GRFIOCBLANK_LIVE and _DARK definitions, so that
X server writers will know what to use.
 1.13.34.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.13.34.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.13.30.1 16-Aug-2001  tv Pullup [jdolecek]:

sys/arch/amiga/dev/grf_cl.c 1.26
sys/arch/amiga/dev/grfioctl.h 1.14
sys/arch/hpcmips/dev/plumvideo.c 1.20
sys/arch/macppc/dev/ofb.c 1.25
sys/arch/sparc/dev/cgtwo.c 1.35
sys/arch/sparc/include/fbio.h patch
sys/arch/sparc64/include/fbio.h patch
sys/arch/sun3/dev/cg2.c 1.14
sys/arch/sun3/include/fbio.h patch
sys/dev/pci/tga.c 1.35
sys/dev/tc/cfb.c 1.28
sys/dev/tc/mfb.c 1.27
sys/dev/tc/sfb.c 1.46
sys/dev/tc/sfbplus.c 1.10 via patch
sys/dev/tc/tfb.c 1.30
sys/dev/tc/xcfb.c 1.23
sys/net/if_ppp.c 1.71

Use unsigned variable types to make bounds checking more correct.
 1.14.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.14.6.1 05-Aug-2001  nathanw file grfioctl.h was added on branch nathanw_sa on 2002-02-28 04:06:44 +0000
 1.15.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.16.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.2 03-Sep-2007  yamt sync with head.
 1.16.16.1 30-Dec-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.74.1 17-Feb-2011  bouyer Sync with HEAD
 1.19.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.66.1 05-Mar-2011  rmind sync with head
 1.20.32.1 22-Sep-2015  skrll Sync with HEAD
 1.20.14.1 03-Dec-2017  jdolecek update from HEAD
 1.25 07-Nov-2015  phx Improved wscons support. Virtual screens are now working.
 1.24 27-Oct-2012  chs branches: 1.24.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.23 15-Dec-2011  phx branches: 1.23.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.22 08-Feb-2011  rmind branches: 1.22.4; 1.22.8;
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.21 21-Nov-2008  he branches: 1.21.8; 1.21.10; 1.21.12;
Don't define struct grf_softc unless _KERNEL is defined, because it
depends on struct device which is also not defined unless _KERNEL is
defined. Fixes usr.sbin/videomode build.
 1.20 04-Mar-2007  christos branches: 1.20.40; 1.20.44; 1.20.50; 1.20.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 11-Dec-2005  christos branches: 1.19.26;
merge ktrace-lwp.
 1.18 07-Aug-2003  agc branches: 1.18.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.17 26-Jan-2002  aymeric branches: 1.17.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.16 16-Aug-1999  is branches: 1.16.16; 1.16.20;
Add a quick and dirty FBIOGVIDEO implementation. This is hardware independent,
by saving the last written FIOSVIDEO/GRFIOCBLANK value into a shadow variable
in the grf_softc and returning this value on FBIOGVIDEO.
The presence of this ioctl is needed by screenblank(8) nowadays.
Original problem reported by Lars Hecking on the port-amiga mailing list.
 1.15 19-Oct-1997  veego branches: 1.15.10;
New unit number for the CyberVision 64/3D.
 1.14 19-May-1996  veego - grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.13 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.12 09-Oct-1995  chopps new cybervision 64 grf from Bernd Ernesti <bernd@arresum.inka.de> and others
update config files (adding missing scsibus entry for aftsc0)
 1.11 18-Aug-1995  chopps change for a2410 from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.10 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 26-Oct-1994  cgd new RCS ID format.
 1.8 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me. floppy changes, should now be solid.
some changes to ite and ms to fix a couple bugs report by Donn.
 1.7 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.6 11-Feb-1994  chopps Add missing Id's
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.15.10.1 18-Feb-2000  he Pull up revision 1.16 (requested by is):
Implement GRFIOGLANK ioctl, which is nowadays needed by
screenblank(8).
 1.16.20.1 28-Feb-2002  nathanw Catch up to -current.
 1.16.16.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.17.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.16.1 03-Aug-2004  skrll Sync with HEAD
 1.18.16.1 03-Sep-2007  yamt sync with head.
 1.19.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.20.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.20.50.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.20.44.1 04-May-2009  yamt sync with head.
 1.20.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.21.12.1 17-Feb-2011  bouyer Sync with HEAD
 1.21.10.1 06-Jun-2011  jruoho Sync with HEAD.
 1.21.8.1 05-Mar-2011  rmind sync with head
 1.22.8.1 18-Feb-2012  mrg merge to -current.
 1.22.4.2 30-Oct-2012  yamt sync with head
 1.22.4.1 17-Apr-2012  yamt sync with head
 1.23.6.2 03-Dec-2017  jdolecek update from HEAD
 1.23.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.14.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.2 07-Nov-2015  phx Improved wscons support. Virtual screens are now working.
 1.1 15-Dec-2011  phx branches: 1.1.4; 1.1.6; 1.1.10; 1.1.28;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.1.28.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.1.10.1 03-Dec-2017  jdolecek update from HEAD
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 15-Dec-2011  yamt file grfws.h was added on branch yamt-pagecache on 2012-04-17 00:06:02 +0000
 1.1.4.2 18-Feb-2012  mrg merge to -current.
 1.1.4.1 15-Dec-2011  mrg file grfws.h was added on branch jmcneill-usbmp on 2012-02-18 07:31:17 +0000
 1.43 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42 24-Apr-2021  thorpej branches: 1.42.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.41 27-Oct-2012  chs branches: 1.41.18; 1.41.28; 1.41.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.40 09-Feb-2010  phx branches: 1.40.10; 1.40.20;
Moved the macros amiga_cpu_sync() and amiga_membarrier() from amiga/device.h
to the MD include/cpu.h.
Also make sure that grf_cvreg.h includes cpu.h as it is needed by Xamiga
in xsrc/xfree/xc/programs/Xserver/hw/netbsd/amiga/s3/amigaCV.h.
 1.39 05-Feb-2010  phx branches: 1.39.2;
Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.38 13-Jun-2008  cegger use device_lookup_private to get softc
 1.37 03-Dec-2007  ad branches: 1.37.14; 1.37.16; 1.37.18; 1.37.20; 1.37.22;
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.36 08-Mar-2006  lukem branches: 1.36.20; 1.36.38; 1.36.40; 1.36.46;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.35 11-Dec-2005  christos branches: 1.35.4; 1.35.6; 1.35.8; 1.35.10;
merge ktrace-lwp.
 1.34 07-Aug-2003  agc branches: 1.34.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.33 03-May-2003  wiz branches: 1.33.2;
DMA, not dma nor Dma.
 1.32 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.31 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.30 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.29 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.28 25-Apr-2001  bouyer branches: 1.28.2; 1.28.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.27 05-Dec-1998  mjacob branches: 1.27.10; 1.27.22;
Update HBAs to incorporate the new max_lun property.
 1.26 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.25 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.24 21-Aug-1998  is Prepare for support of Apollo-cpuboard-reworked A3000 mainboard SCSI.
 1.23 12-Jan-1998  thorpej Adjust for changes to config.
 1.22 27-Aug-1997  bouyer branches: 1.22.4;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.21 21-Jan-1997  thorpej branches: 1.21.6; 1.21.8;
Initialize max_target in the SCSI link.
 1.20 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.19 13-Oct-1996  christos backout previous kprintf change
 1.18 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.17 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.16 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.15 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.14 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.13 04-Sep-1995  chopps sbic and board changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.12 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.11 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.10 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 06-Oct-1994  chopps branches: 1.6.2;
fix a thinko in gvp diag. Add 4091 driver from Michael Hitch
(osymh@gemini.oscs.montana.edu)
 1.5 16-Jun-1994  chopps fix boot diag output.
 1.4 25-May-1994  chopps add beginning of support for series I controllers doesn't work yet.
 1.3 16-May-1994  chopps move mysterious dk_establish() stub routine from gtsc driver to disksubr.c
 1.2 11-May-1994  chopps general cleanup including boot diag messages.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.6.2.2 06-Oct-1994  chopps fix a thinko in gvp diag. Add 4091 driver from Michael Hitch
(osymh@gemini.oscs.montana.edu)
 1.6.2.1 06-Oct-1994  chopps file gtsc.c was added on branch netbsd-1-0 on 1994-10-06 19:06:42 +0000
 1.21.8.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.21.6.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.22.4.1 19-Jan-1999  cgd pull up rev 1.24 from trunk (is)
 1.27.22.1 21-Jun-2001  nathanw Catch up to -current.
 1.27.10.2 29-Mar-2001  bouyer Make these pass a compile test on i386.
 1.27.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.28.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.28.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.28.8.1 25-Apr-2001  nathanw file gtsc.c was added on branch nathanw_sa on 2002-02-28 04:06:45 +0000
 1.28.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.28.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.33.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.33.2.1 03-Aug-2004  skrll Sync with HEAD
 1.34.16.2 07-Dec-2007  yamt sync with head
 1.34.16.1 21-Jun-2006  yamt sync with head.
 1.35.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.35.8.1 13-Mar-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.36.46.1 08-Dec-2007  mjf Sync with HEAD.
 1.36.40.1 09-Jan-2008  matt sync with HEAD
 1.36.38.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.36.20.1 03-Dec-2007  ad Sync with HEAD.
 1.37.22.1 18-Jun-2008  simonb Sync with head.
 1.37.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.37.18.2 11-Mar-2010  yamt sync with head
 1.37.18.1 04-May-2009  yamt sync with head.
 1.37.16.1 17-Jun-2008  yamt sync with head.
 1.37.14.1 29-Jun-2008  mjf Sync with HEAD.
 1.39.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.40.20.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.40.10.1 30-Oct-2012  yamt sync with head
 1.41.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.41.28.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.41.18.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.41.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.42.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 26-Oct-1994  cgd branches: 1.2.66;
new RCS ID format.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.8 01-Mar-1995  mycroft Clean up deleted files.
 1.7 18-Apr-1994  chopps make current with recent vm changes.
 1.6 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.5 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.2 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 11-Feb-1994  chopps Add missing Id's
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.28 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.27 24-Apr-2021  thorpej branches: 1.27.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.26 27-Oct-2012  chs branches: 1.26.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.25 03-Jun-2011  matt branches: 1.25.2; 1.25.12;
CFATTACH_DECL_NEW, device_t, cfdata_t
 1.24 26-Oct-2009  cegger branches: 1.24.4; 1.24.6; 1.24.10;
kill extra whitespaces
reviewed by tsutsui@
 1.23 18-Mar-2009  cegger bcopy -> memcpy
 1.22 01-Jan-2003  thorpej branches: 1.22.108; 1.22.116; 1.22.122;
Use aprint_normal() for cfprint routines.
 1.21 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.20 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.19 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.18 27-Jan-2002  is Attach multifunction GVP boards.
 1.17 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.16 12-Jan-1998  thorpej branches: 1.16.28; 1.16.32;
Adjust for changes to config.
 1.15 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.14 13-Oct-1996  christos backout previous kprintf change
 1.13 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.12 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.11 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.10 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 05-Mar-1995  chopps add recognition of GVP 530 and change magnum scsi interrupt level to 6
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.6 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 21-Jun-1994  chopps no gvp series I yet. and if_le.c from Rob Healey (rhealey@aggregate.com)
 1.2 25-May-1994  chopps add beginning of support for series I controllers doesn't work yet.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.16.32.3 03-Jan-2003  thorpej Sync with HEAD.
 1.16.32.2 18-Oct-2002  nathanw Catch up to -current.
 1.16.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.16.28.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.16.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.22.122.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.22.116.1 28-Apr-2009  skrll Sync with HEAD.
 1.22.108.2 11-Mar-2010  yamt sync with head
 1.22.108.1 04-May-2009  yamt sync with head.
 1.24.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.24.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.24.4.1 12-Jun-2011  rmind sync with head
 1.25.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.25.2.1 30-Oct-2012  yamt sync with head
 1.26.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.27.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.8 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 05-Mar-1995  chopps add recognition of GVP 530 and change magnum scsi interrupt level to 6
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 02-Mar-1995  chopps fix long standing bug with A2091 and dma.
Move the copy from bounce buffer after dmafree() in the case of
the A2091 this allows the dma fifo to be flushed.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.4 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 25-May-1994  chopps add beginning of support for series I controllers doesn't work yet.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 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 27-Oct-2012  chs branches: 1.20.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.19 19-Jul-2011  dyoung branches: 1.19.2; 1.19.12;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.18 02-Feb-2010  phx Fix compilation warnings and errors with amigappc.
 1.17 09-Nov-2009  is Move to two-clause license.
 1.16 04-Mar-2007  christos branches: 1.16.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 21-Dec-2006  yamt branches: 1.15.2;
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.14 06-Jan-2003  wiz branches: 1.14.18; 1.14.48; 1.14.50;
interrupt with two rs.
 1.13 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.12 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.11 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.10 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.9 28-Jan-2002  aymeric branches: 1.9.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.8 27-Jan-2002  is remove double {
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 08-Nov-2000  is branches: 1.6.4; 1.6.8;
Remove some of the bitrot.
 1.5 23-Jan-2000  aymeric sync with new bus.h
 1.4 30-Dec-1999  is Rewrite of the Amiga bus_space machinery to prepare for the support of
the generic IDE driver and the PCMCIA slots.
 1.3 01-Apr-1999  is branches: 1.3.8;
snchronize with reality.
Actually, this should have been done months ago, but slipped the cracks.
 1.2 12-Jan-1998  thorpej Adjust for changes to config.
 1.1 19-Oct-1997  is zbus.c
 1.3.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.6.8.5 07-Jan-2003  thorpej Sync with HEAD.
 1.6.8.4 03-Jan-2003  thorpej Sync with HEAD.
 1.6.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.6.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.9.8.1 16-May-2002  gehenna Include sys/conf.h directly.
 1.14.50.1 29-Sep-2006  yamt implement splraiseipl/makeiplcookie for amiga.
 1.14.48.1 12-Jan-2007  ad Sync with head.
 1.14.18.2 03-Sep-2007  yamt sync with head.
 1.14.18.1 30-Dec-2006  yamt sync with head.
 1.15.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.44.1 11-Mar-2010  yamt sync with head
 1.19.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.19.2.1 30-Oct-2012  yamt sync with head
 1.20.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.21.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.24 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.23 24-Apr-2021  thorpej branches: 1.23.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.22 27-Oct-2012  chs branches: 1.22.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.21 19-Jul-2011  dyoung branches: 1.21.2; 1.21.12;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.20 02-Feb-2010  phx Fix compilation warnings and errors with amigappc.
 1.19 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.18 11-Dec-2005  christos branches: 1.18.74; 1.18.76; 1.18.78;
merge ktrace-lwp.
 1.17 13-Jun-2005  jmc Fix a ton of const/volatile issues shown with new warning flags
 1.16 01-Jan-2003  thorpej branches: 1.16.2;
Use aprint_normal() for cfprint routines.
 1.15 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 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.12 28-Jan-2002  aymeric branches: 1.12.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.11 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.10 30-Dec-1999  is branches: 1.10.8; 1.10.12;
Rewrite of the Amiga bus_space machinery to prepare for the support of
the generic IDE driver and the PCMCIA slots.
 1.9 10-May-1999  is branches: 1.9.2;
Add HyperCom 3+/4+ parallel port support
 1.8 16-Feb-1999  is branches: 1.8.2; 1.8.4; 1.8.6;
Fix Copyright dates
 1.7 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.6 10-Jan-1999  is Make this compile again. 1.5 was committed from the wrong directory.
We apologize for any inconvenience caused.
 1.5 26-Dec-1998  is Make it table-driven. Besides making adding more devices easier, the resulting
code is 14% smaller (alas, for this file only).
 1.4 14-Dec-1998  is Support for Hypercom 3+ / 4+. Untested yet, but its only some additional
entries in a table.
 1.3 09-Aug-1998  is Cosmetics: it's a "HyperCom 3Z" on a ZBUS, no "HyperCom 3".
 1.2 12-Jan-1998  thorpej Adjust for changes to config.
 1.1 18-Oct-1997  is Driver for the VMC HyperCom3/zbus and the VMC HyperCom4.
lpt on HyperCom3 isn't supported yet.
 1.8.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

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

synchronization to latest KAME will take place on HEAD branch soon.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.2.1 18-Jun-1999  perry pullup 1.8->1.9 (is): Support for HyperCom 3+/4+ lpt ports
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.10.12.4 03-Jan-2003  thorpej Sync with HEAD.
 1.10.12.3 18-Oct-2002  nathanw Catch up to -current.
 1.10.12.2 17-Sep-2002  nathanw Catch up to -current.
 1.10.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.10.8.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.10.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.12.8.1 16-May-2002  gehenna Include sys/conf.h directly.
 1.16.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.78.2 11-Mar-2010  yamt sync with head
 1.18.78.1 16-May-2008  yamt sync with head.
 1.18.76.1 18-May-2008  yamt sync with head.
 1.18.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.21.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.2.1 30-Oct-2012  yamt sync with head
 1.22.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.23.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.61 26-Mar-2006  is idesc.c was unreferenced for 14 months; time has finally come to move it]
to the Attic.
 1.60 29-Jan-2006  dsl branches: 1.60.2; 1.60.4; 1.60.6; 1.60.8; 1.60.10;
Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
 1.59 11-Dec-2005  christos branches: 1.59.2;
merge ktrace-lwp.
 1.58 21-Feb-2005  thorpej branches: 1.58.4;
Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding. Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes. Place items described
by the SCSI Primary Commands document into scsi_spc.h.
 1.57 07-Dec-2004  thorpej branches: 1.57.2; 1.57.4;
READ_CAPACITY -> READ_CAPACITY_10
 1.56 07-Dec-2004  thorpej USe more appropriate macro/struct names for READ/WRITE (6) and
READ/WRITE (10).
 1.55 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.54 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.53 18-Jun-2003  drochner branches: 1.53.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.52 17-Jan-2003  lonewolf Compiles and works (tested on my A1200) again
XXX scsipi mid layer spews out a few "generic HBA error"s during device probe (no slave device on bus), I don't know how to fix this
XXX This whole thing should die now that we have wdc_amiga
 1.51 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.50 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.49 28-Jan-2002  aymeric branches: 1.49.10;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.48 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.47 25-Apr-2001  bouyer branches: 1.47.2; 1.47.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.46 25-May-2000  is branches: 1.46.6;
Prepare for AmigaPPC.
 1.45 18-Jan-2000  thorpej Remove one line of junk.
 1.44 15-Jan-2000  aymeric make this compile again
 1.43 10-Dec-1999  mhitch Check for valid device when starting a request with interrupts; device
probes are now done with interrupts, and would hang when probing for
non-existent device.
 1.42 30-Sep-1999  thorpej branches: 1.42.2; 1.42.8;
Update for SCSIPI changes.
 1.41 17-Apr-1999  mhitch Correct the way I was using the transfer length for ATAPI commands. ATAPI ZIP
drives are now usable.
 1.40 17-Apr-1999  mhitch Do a REQUEST SENSE when ATAPI operation returns an error. This is needed to clear
the Unit Attention status, i.e. after a media change on a CDROM.
 1.39 16-Apr-1999  mhitch Change reading the ATAPI IDENTIFY data: a ZIP drive responds differently than my CDROM
and will cause the drive to hang on boot. The ZIP drive still does not work, but the
system no longer will hang,
 1.38 01-Apr-1999  mhitch branches: 1.38.2;
Turn off some ATAPI debugging output.
 1.37 26-Mar-1999  mhitch Add some ATAPI support. My CDROM drive works, but I don't have other devices to
test. This should provide interim ATAPI support until the MI wdc driver is used.
 1.36 10-Jan-1999  tron Don't use void pointer for arithmetic.
 1.35 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.34 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.33 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.32 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.31 12-Jan-1998  thorpej Adjust for changes to config.
 1.30 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.29 23-Dec-1996  veego branches: 1.29.8; 1.29.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.28 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.27 13-Oct-1996  christos backout previous kprintf change
 1.26 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.25 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.24 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.23 30-May-1996  mhitch Fix the third LBA extraction from a 6 byte SCSI command that I missed.
 1.22 27-May-1996  mhitch The logical block address in a 6 byte command is 21 bits, not 20.
Also a transfer length of 0 indicates 256 blocks.
 1.21 12-May-1996  mhitch branches: 1.21.4;
Remove old-style disk instrumentation now that iostat, systat, and
vmstat are fixed.
 1.20 28-Apr-1996  mhitch Fix warning from -Wall.
 1.19 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.18 24-Mar-1996  mhitch Fix for SCSI mode sense disk_pages structure change, and use the _lto3b()
conversion function.
 1.17 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.16 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.15 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.14 05-Oct-1995  chopps first attempt at A4000T support, remove GRF_AGA's dependence on GRF_ECS.
page 0 is now invalid, other minor cleanup.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.13 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.12 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.11 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.10 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 06-Oct-1994  chopps branches: 1.5.2;
Add Amiga 1200 support (kbd and ide) from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 22-Jun-1994  chopps cleanup from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.3 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 22-May-1994  chopps fix check for configured device in interrupt routine.
 1.1 22-May-1994  chopps an ide driver and hack reload device to do symbols.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5.2.2 06-Oct-1994  chopps Add Amiga 1200 support (kbd and ide) from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5.2.1 06-Oct-1994  chopps file idesc.c was added on branch netbsd-1-0 on 1994-10-06 19:54:29 +0000
 1.21.4.2 30-May-1996  mhitch Pulled up the other SCSI emulation fix from the trunk.
 1.21.4.1 28-May-1996  mhitch Pull in bug fix for SCSI emulation of 6 byte commands.
 1.29.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.29.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.38.2.3 19-Apr-1999  cjs branches: 1.38.2.3.2;
Pull up to HEAD 1.41, per Michael L. Hitch <osymh@terra.oscs.montana.edu>.
 1.38.2.2 17-Apr-1999  mhitch Pull up revision 1.40. Approved by Curt Sampson.
A request sense operation is required on ATAPI devices so the Unit Attention
status gets cleared. Changing CDROM media now works without needing to reboot
the system.
 1.38.2.1 16-Apr-1999  mhitch Pull up revision 1.39.
Change reading ATAPI IDENTIFY data to prevent ZIP drive from hanging
system on boot.
 1.38.2.3.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.42.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.42.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.46.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.47.8.4 17-Jan-2003  thorpej Sync with HEAD.
 1.47.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.47.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.47.8.1 25-Apr-2001  nathanw file idesc.c was added on branch nathanw_sa on 2002-02-28 04:06:45 +0000
 1.47.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.47.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.49.10.1 26-Jan-2003  jmc Pullup revisions 1.51-1.52 (requested by lonewolf in ticket #1101)
Compiles and works (tested on my A1200) again
 1.53.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.53.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.53.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.53.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.53.2.1 03-Aug-2004  skrll Sync with HEAD
 1.57.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.57.2.1 29-Apr-2005  kent sync with -current
 1.58.4.1 21-Jun-2006  yamt sync with head.
 1.59.2.1 01-Feb-2006  yamt sync with head.
 1.60.10.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.60.8.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.60.6.1 01-Apr-2006  yamt sync with head.
 1.60.4.1 22-Apr-2006  simonb Sync with head.
 1.60.2.1 09-Sep-2006  rpaulo sync with head
 1.15 27-Mar-1997  veego if_le supports now the Ariadne card.
 1.14 18-Mar-1997  veego Remove NAE, put the revision into ae_softc and fixes from dev/ic/am7990.c:
>Signed shifts are evil.
>Thanks to Michael Smith for reporting, Jason Thorpe for pointing to the
>report, doing a quick workaround which pointed me to the right code part and
>for testing the final fix.
 1.13 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.12 23-Dec-1996  veego branches: 1.12.6;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.11 13-Oct-1996  christos backout previous kprintf change
 1.10 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.9 25-May-1996  is Yet another unused variable cleanup; noticed in a kernel without bpfilter.
 1.8 07-May-1996  thorpej branches: 1.8.4;
Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.7 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.6 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.5 24-Feb-1996  chopps use newly allocated ethernet address (fixes #2117)
 1.4 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.3 07-Oct-1995  chopps update to ariadne ethernet device from Bernd Ernesti <bernd@arresum.inka.de>
 1.2 18-Aug-1995  chopps add rcs ids
 1.1 18-Aug-1995  chopps ariadne ethernet driver from Bernd Ernesti <bernd@arresum.inka.de>
 1.8.4.1 26-May-1996  is Pull up of bug fixes for Retina screenblank ioctl and an unused variable
warning from if_ae when building INSTALL (that is, without bpfilter) kernels.
 1.12.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.12.6.1 06-Mar-1997  is Convert to new ARP style.
 1.3 27-Mar-1997  veego if_le supports now the Ariadne card.
 1.2 18-Aug-1995  chopps add rcs ids
 1.1 18-Aug-1995  chopps ariadne ethernet driver from Bernd Ernesti <bernd@arresum.inka.de>
 1.35 02-Sep-1998  is Split SMC chipset ARCnet driver into
- machine independent chip driver, in dev/ic/smc90cx6.c/...reg.h,...var.h,
using bus_space methods
- ZBUS frontend in arch/amiga/dev/if_bah_zbus.c
- added IPL_SOFTNET to arch/amiga/include/intr.h, for this
Implementing the ISA bus frontend is left as an exercise to the reader.
 1.34 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.33 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.32 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.31 12-Jan-1998  thorpej Adjust for changes to config.
 1.30 04-Apr-1997  is Actually ask for ARP initialization on this interface.
Somehow this commit was forgotten. Sorry folks.
 1.29 23-Mar-1997  is Now that ARP on ARCnet works, set it as default.
 1.28 17-Mar-1997  is Make this compile on Amiga. Bug report by Bernd Ernesti.
 1.27 16-Mar-1997  is move if_arc.h to sys/net
 1.26 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.25 23-Dec-1996  veego branches: 1.25.6;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.24 18-Nov-1996  is Change the token loss report algorithm:

Earlier, we re-complained about excessive token losses about once a minute.
However, on small ARCnet networks, the token will also be lost if only one
station (us) is active (ifconfig'd down interfaces don't take place in the
token exchange), and our syslog would be filled with repeated messages about
this condition.

Our new code only complains once, starts a timeout() each time a token
regeneration is reported by the chip, and generates a log message about
the regenerated token if it was stable for 15 seconds.
 1.23 18-Nov-1996  is Fix a bug in the "spurious rx interupt" detection: don't copy the spurious
buffer out of the hardware (it is invalid!).
This fixes hangups due to spurious rx interupts.
XXX Maybe I should completely reset the hardware in this case?
 1.22 13-Oct-1996  christos backout previous kprintf change
 1.21 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.20 08-Sep-1996  is "Never type in what you can equally well cut'n'paste." - (myself)
 1.19 02-Sep-1996  is Add IP multicast support as per RFC 1122 section 3.3.7 to ARCnet.
"The mapping of IP Class D addresses to local addresses is
currently specified for the following types of networks:
[...]
o Any network that supports broadcast but not multicast,
addressing: all IP Class D addresses map to the local
broadcast address."
 1.18 07-May-1996  thorpej branches: 1.18.4;
Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.17 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.16 20-Mar-1996  is - Zeroth version of M68060 support (dont want to cause emulation traps for
the "Fast Assembler Version of the copy loop)
- Yet another sanity check included: initialize unused receive buffers to
zero sender id; and test for sender hardware id of zero in the receiver.
Gives us better error messages in case flaky hardware causes spurious
receive interupts.
 1.15 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.14 27-Dec-1995  chopps make changed from pr#1824 from Ignatios Souvatzis
 1.13 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.12 09-Oct-1995  chopps add prototypes for isr stuff fixes pr# 1284 and 1569
 1.11 09-Oct-1995  chopps fix hang bug from Ignatios Souvatzis <ignatios@theory.cs.uni-bonn.de>
 1.10 02-Jul-1995  mycroft Remove references to if_addrlist.
 1.9 27-Jun-1995  chopps udpate to match ifnets new use of sys/queue.h
 1.8 07-Jun-1995  cgd update from Ignatios Souvatzis
 1.7 15-Apr-1995  cgd cleanup; mostly KNF.
 1.6 14-Apr-1995  chopps couple small changes plus a new watchdog timer from Ignatios Souvatzis <is@beverly.rhein.de>
 1.5 11-Apr-1995  chopps fix up some changes
 1.4 11-Apr-1995  mycroft Sync with the rest of the world. Various additional cleanup.
 1.3 02-Mar-1995  chopps some cleanup..
 1.2 01-Mar-1995  chopps Fixup (c)'s and ids.
 1.1 28-Feb-1995  chopps new arcnet (2060) device from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.18.4.1 05-Dec-1996  rat Pullup request 1.22 -> 1.23 from Ignatios Souvatzis <is@beverly.rhein.de>

>The (new in -1.2) spurious RX interupt / invalid sender id code didn't ignore
>the bad packets, but tried to copy them out anyway, messing up the drivers
>notion of the hardware state. This would hang the driver.
 1.25.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.25.6.1 06-Mar-1997  is Convert to new ARP style.
 1.18 24-Feb-2020  rin 0x%p --> %p for non-external codes.
 1.17 23-Oct-2017  msaitoh branches: 1.17.4; 1.17.10;
Return if bah_attach_subr() failed.
 1.16 30-Oct-2015  phx branches: 1.16.10;
Fixed format string types to make it compile with BAH_DEBUG again.
 1.15 27-Oct-2012  chs branches: 1.15.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.14 19-Jul-2011  dyoung branches: 1.14.2; 1.14.12;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.13 18-Oct-2010  phx opt_m68k_arch.h can only be included when compiling for amiga/68k.
 1.12 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.11 28-Apr-2008  martin branches: 1.11.20; 1.11.22;
Remove clause 3 and 4 from TNF licenses
 1.10 02-Oct-2002  thorpej branches: 1.10.108; 1.10.110; 1.10.112;
Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 23-Jan-2000  aymeric branches: 1.6.8; 1.6.12;
sync with new bus.h
 1.5 30-Dec-1999  is Rewrite of the Amiga bus_space machinery to prepare for the support of
the generic IDE driver and the PCMCIA slots.
 1.4 16-Feb-1999  is branches: 1.4.8;
Fix Copyright dates
 1.3 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.2 04-Sep-1998  is Account for the 68060 store buffer.
 1.1 02-Sep-1998  is Split SMC chipset ARCnet driver into
- machine independent chip driver, in dev/ic/smc90cx6.c/...reg.h,...var.h,
using bus_space methods
- ZBUS frontend in arch/amiga/dev/if_bah_zbus.c
- added IPL_SOFTNET to arch/amiga/include/intr.h, for this
Implementing the ISA bus frontend is left as an exercise to the reader.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.6.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.6.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.10.112.2 11-Aug-2010  yamt sync with head.
 1.10.112.1 16-May-2008  yamt sync with head.
 1.10.110.1 18-May-2008  yamt sync with head.
 1.10.108.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.22.2 05-Mar-2011  rmind sync with head
 1.11.22.1 03-Jul-2010  rmind sync with head
 1.11.20.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.11.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.14.12.2 03-Dec-2017  jdolecek update from HEAD
 1.14.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.2.1 30-Oct-2012  yamt sync with head
 1.15.14.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.16.10.1 10-Dec-2017  snj Pull up following revision(s) (requested by msaitoh in ticket #427):
sys/arch/amiga/dev/if_bah_zbus.c: 1.17
sys/arch/arm/broadcom/bcm53xx_eth.c: 1.30
sys/arch/powerpc/booke/dev/pq3etsec.c: 1.32
sys/arch/usermode/dev/if_veth.c: 1.9
sys/dev/ic/an.c: 1.66
sys/dev/ic/athn.c: 1.17
sys/dev/ic/atw.c: 1.162
sys/dev/ic/bwi.c: 1.33
sys/dev/ic/dwc_gmac.c: 1.41-1.42
sys/dev/ic/malo.c: 1.10
sys/dev/ic/rt2560.c: 1.31
sys/dev/ic/rt2661.c: 1.36
sys/dev/ic/rt2860.c: 1.29
sys/dev/ic/rtw.c: 1.127
sys/dev/ic/rtwvar.h: 1.46
sys/dev/ic/smc90cx6.c: 1.71
sys/dev/ic/smc90cx6var.h: 1.12
sys/dev/ic/wi.c: 1.244
sys/dev/pci/if_ipw.c: 1.66
sys/dev/pci/if_iwi.c: 1.104
sys/dev/pci/if_iwm.c: 1.76
sys/dev/pci/if_iwn.c: 1.86
sys/dev/pci/if_rtwn.c: 1.13
sys/dev/pci/if_wm.c: 1.541
sys/dev/pci/if_wpi.c: 1.79
sys/dev/pci/ixgbe/ixgbe.c: 1.106
sys/dev/pci/ixgbe/ixv.c: 1.73 via patch
sys/dev/pcmcia/if_malo_pcmcia.c: 1.15
sys/dev/scsipi/if_se.c: 1.95
sys/dev/usb/if_upl.c: 1.60
sys/net/if.c: 1.396
sys/net/if.h: 1.241
sys/net/if_arc.h: 1.23
sys/net/if_arcsubr.c: 1.78
sys/net/if_bridge.c: 1.136-1.137
sys/net/if_etherip.c: 1.39
sys/net/if_faith.c: 1.56
sys/net/if_gif.c: 1.131
sys/net/if_loop.c: 1.96
sys/net/if_mpls.c: 1.30
sys/net/if_pppoe.c: 1.129
sys/net/if_srt.c: 1.27
sys/net/if_stf.c: 1.102
sys/net/if_tap.c: 1.100
sys/net/if_vlan.c: 1.105
sys/netinet/ip_carp.c: 1.91
sys/rump/net/lib/libshmif/if_shmem.c: 1.73-1.74
sys/rump/net/lib/libvirtif/if_virt.c: 1.55-1.56
if_initalize() and if_attach() failed when resource allocation failed
(e.g. allocating softint). Without this change, it panics. It's bad because
resource shortage really occured when a lot of pseudo interface is created.
To avoid this problem, don't panic and change return value of if_initialize()
and if_attach() to int. Caller fanction will be recover from error cleanly by
checking the return value.
Return if bah_attach_subr() failed.
If if_attach() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add some missing frees in bridge_clone_destroy().
- KNF
If error occured in bcmeth_ccb_attach(), free resources and return.
If error occured in pq3etsec_attach(), free resources and return.
If error occured in the attach function, free resources and return.
- If if_initialize() failed in athn_attach(), free resources and return.
- Add missing pmf_event_deregister() in athn_detach().
- Free resources correctly on some errors in atw_attach().
- Use apint*() insread of printf() in the attach function.
If if_initialize() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add missing dwc_gmac_free_dma_rings() and mutex_destroy() when attach
failed.
- If if_initialize() failed in the attach function, free resources and return.
- ifp is always not NULL in iwi_detach(). Check correctly with ifp->if_softc.
- If if_initialize() failed in the attach function, free resources and return.
- Fix error path in the attach function correctly.
If if_initialize() failed in the attach function, free resources and return.
If if_attach() failed in the attach function, free resources and return.
- If if_initialize() failed in the attach function, free resources and return.
- KNF
- If if_attach() failed in the attach function, free resources and return.
- KNF
Fix compile error.
Fix compile error.
We don't need '&mii', but just 'mii' for mii_detach().
Don't free sc_rthash twice
 1.17.10.1 29-Feb-2020  ad Sync with head.
 1.17.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.5 27-Feb-1999  is Oops.
Forgot to commit this LONG ago.
 1.4 07-Jun-1995  cgd update from Ignatios Souvatzis
 1.3 02-Mar-1995  chopps some cleanup..
 1.2 01-Mar-1995  chopps Fixup (c)'s and ids.
 1.1 28-Feb-1995  chopps new arcnet (2060) device from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.63 14-Oct-2012  phx New ed(4) device driver for Hydra and ASDG Zorro2 bus network cards.
This driver is based on the MI dp8390 backend.
 1.62 05-Apr-2010  joerg branches: 1.62.8; 1.62.14; 1.62.18;
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.61 19-Jan-2010  pooka branches: 1.61.2; 1.61.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.60 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.59 19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.58 18-Mar-2009  cegger bcopy -> memcpy
 1.57 18-Mar-2009  cegger bcmp -> memcmp
 1.56 07-Nov-2008  dyoung branches: 1.56.4;
*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.55 17-Oct-2007  garbled branches: 1.55.16; 1.55.20; 1.55.26; 1.55.28;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.54 03-Sep-2007  he Rename function argument from command to cmd, to make the code
actually build after the previous change.

Also remove a local variable which is no longer used.
 1.53 01-Sep-2007  dyoung Change a bazillion occurrences of code resembling this,

error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);

if (error == ENETRESET) {

to this,

if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
 1.52 26-Aug-2007  dyoung branches: 1.52.2;
Constify.
 1.51 05-Mar-2007  he branches: 1.51.2; 1.51.10; 1.51.14; 1.51.18;
Do pointer arithmetic on char* or u_char* pointers.
 1.50 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.49 29-Mar-2006  thorpej branches: 1.49.14;
Use device_cfdata().
 1.48 11-Dec-2005  christos branches: 1.48.4; 1.48.6; 1.48.8; 1.48.10; 1.48.12;
merge ktrace-lwp.
 1.47 13-Jun-2005  jmc branches: 1.47.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.46 30-Oct-2004  thorpej When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.45 24-Feb-2004  wiz branches: 1.45.4;
Spell interrupt with two rs. From Peter Postma.
 1.44 21-Jan-2003  bouyer branches: 1.44.2;
Pass proper len to word_zero().
Bump totlen in the last wantsbyte case, so that it's always even.
Both pointed out by Gunther Nikl.
 1.43 20-Jan-2003  bouyer bzero the part of the buffer used to pad the packet to
ETHER_MIN_LEN - ETHER_CRC_LEN.
 1.42 06-Jan-2003  wiz interrupt with two rs.
 1.41 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.40 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.39 28-Jan-2002  aymeric branches: 1.39.10;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.38 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.37 16-Sep-2001  wiz branches: 1.37.4;
Spell 'occurred' with two 'r's.
 1.36 12-Jun-2001  wiz branches: 1.36.2; 1.36.4;
retrieve, not retreive
 1.35 15-Nov-2000  thorpej branches: 1.35.2;
Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.34 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.33 11-Feb-2000  is Only output message on really special DEBUG kernels.
 1.32 18-May-1999  thorpej branches: 1.32.2;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.31 25-Mar-1999  thorpej branches: 1.31.2; 1.31.4;
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.30 10-Jan-1999  tron Don't use void pointer for arithmetic.
 1.29 05-Jul-1998  jonathan branches: 1.29.6;
defopt NS, NSIP.
 1.28 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.27 12-Jan-1998  thorpej Adjust for changes to config.
 1.26 17-Mar-1997  is Make this compile again on Amiga. Fix by Bernd Ernesti.
 1.25 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.24 23-Dec-1996  veego branches: 1.24.6;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.23 13-Oct-1996  christos backout previous kprintf change
 1.22 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.21 07-May-1996  thorpej Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.20 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.19 21-Mar-1996  is Interupts must be disabled and cleared before the PROM is read, as the int
line is shared with one of the PROMs address lines.
From PR #1478 by Jukka Marin.
 1.18 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.17 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.16 01-Oct-1995  chopps only use one xmit buffer for ASDG
 1.15 20-Aug-1995  chopps fix bogus length check (#1299)
 1.14 02-Jul-1995  mycroft Remove references to if_addrlist.
 1.13 28-Jun-1995  cgd note that most of dev/ic's contents have changed names
 1.12 27-Jun-1995  chopps udpate to match ifnets new use of sys/queue.h
 1.11 11-May-1995  chopps fix len bug from Jason Thorpe <thorpej@nas.nasa.gov>
 1.10 08-May-1995  chopps fix a few thinkos
 1.9 08-May-1995  chopps may now work for asdg boards.. offsets obtained months ago but untestable here
 1.8 16-Apr-1995  chopps new driver from charles.
 1.7 14-Apr-1995  chopps update doomed driver (i.e. its going to be replace soon)
 1.6 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.5 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 26-Jul-1994  chopps branches: 1.2.2;
fix check in edintr(), do not deref NULL pointer.
 1.1 16-Jul-1994  chopps branches: 1.1.2;
ed driver for 8390 based ethernet boards (currently only hydra supported)
original code from Timo Rossi <trossi@bedivere.cc.jyu.fi>, some major
style changes (KNF, pull i386 comments in, et al.) plus converting to
config.new by me.
 1.1.2.1 26-Jul-1994  cgd from trunk.
 1.2.2.2 26-Jul-1994  chopps fix check in edintr(), do not deref NULL pointer.
 1.2.2.1 26-Jul-1994  chopps file if_ed.c was added on branch netbsd-1-0 on 1994-07-26 17:51:20 +0000
 1.24.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.24.6.1 06-Mar-1997  is Convert to new ARP style.
 1.29.6.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.31.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.31.2.1 12-Feb-2000  he Pull up revision 1.33 (requested by is):
Only output diagnostic message on really special DEBUG kernels.
 1.32.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.32.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.35.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.36.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.36.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.36.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.36.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.37.4.4 07-Jan-2003  thorpej Sync with HEAD.
 1.37.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.37.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.37.4.1 16-Sep-2001  nathanw file if_ed.c was added on branch nathanw_sa on 2002-02-28 04:06:46 +0000
 1.39.10.1 28-Jan-2003  jmc Pullup revisions 1.42-1.44 (requested by bouyer in ticket #1121)
Bzero the part of the buffer used to pad the packet to
ETHER_MIN_LEN - ETHER_CRC_LEN.
Pass proper len to word_zero().
Bump totlen in the last wantsbyte case, so that it's always even.
 1.44.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.44.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.44.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.44.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.44.2.1 03-Aug-2004  skrll Sync with HEAD
 1.45.4.1 24-Jan-2005  he Pull up revision 1.46 (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.47.2.2 03-Sep-2007  yamt sync with head.
 1.47.2.1 21-Jun-2006  yamt sync with head.
 1.48.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.48.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.48.8.1 01-Apr-2006  yamt sync with head.
 1.48.6.1 22-Apr-2006  simonb Sync with head.
 1.48.4.1 09-Sep-2006  rpaulo sync with head
 1.49.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.51.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.51.14.2 10-Sep-2007  skrll Sync with HEAD.
 1.51.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.51.10.1 03-Oct-2007  garbled Sync with HEAD
 1.51.2.1 09-Oct-2007  ad Sync with head.
 1.52.2.1 06-Nov-2007  matt sync with HEAD
 1.55.28.2 28-Apr-2009  skrll Sync with HEAD.
 1.55.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.55.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.55.20.4 11-Aug-2010  yamt sync with head.
 1.55.20.3 11-Mar-2010  yamt sync with head
 1.55.20.2 20-Jun-2009  yamt sync with head
 1.55.20.1 04-May-2009  yamt sync with head.
 1.55.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.56.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.61.4.1 30-May-2010  rmind sync with head
 1.61.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.62.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.62.14.1 22-Nov-2012  riz Pull up following revision(s) (requested by phx in ticket #681):
sys/arch/amiga/dev/if_edreg.h: file removal
sys/dev/ic/dp8390reg.h: revision 1.9
sys/arch/amiga/conf/files.amiga: revision 1.161
sys/arch/amiga/dev/if_ed_zbus.c: revision 1.1
sys/arch/amiga/dev/if_ed_zbus.c: revision 1.2
sys/arch/amiga/dev/if_ed.c: file removal
New ed(4) device driver for Hydra and ASDG Zorro2 bus network cards.
This driver is based on the MI dp8390 backend.
Fixed receiving of odd-length packets. Driver works now perfectly.
Thanks to Harald Meinzer for providing me with a Hydra for a few days.
ed_ring structure is no longer needed for compatibility, as the last
device driver using it (amiga/ed(4)) has been converted now.
 1.62.8.1 30-Oct-2012  yamt sync with head
 1.2 27-Oct-2012  phx branches: 1.2.2; 1.2.4; 1.2.6;
Fixed receiving of odd-length packets. Driver works now perfectly.
Thanks to Harald Meinzer for providing me with a Hydra for a few days.
 1.1 14-Oct-2012  phx New ed(4) device driver for Hydra and ASDG Zorro2 bus network cards.
This driver is based on the MI dp8390 backend.
 1.2.6.2 22-Nov-2012  riz Pull up following revision(s) (requested by phx in ticket #681):
sys/arch/amiga/dev/if_edreg.h: file removal
sys/dev/ic/dp8390reg.h: revision 1.9
sys/arch/amiga/conf/files.amiga: revision 1.161
sys/arch/amiga/dev/if_ed_zbus.c: revision 1.1
sys/arch/amiga/dev/if_ed_zbus.c: revision 1.2
sys/arch/amiga/dev/if_ed.c: file removal
New ed(4) device driver for Hydra and ASDG Zorro2 bus network cards.
This driver is based on the MI dp8390 backend.
Fixed receiving of odd-length packets. Driver works now perfectly.
Thanks to Harald Meinzer for providing me with a Hydra for a few days.
ed_ring structure is no longer needed for compatibility, as the last
device driver using it (amiga/ed(4)) has been converted now.
 1.2.6.1 27-Oct-2012  riz file if_ed_zbus.c was added on branch netbsd-6 on 2012-11-22 00:27:54 +0000
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 27-Oct-2012  tls file if_ed_zbus.c was added on branch tls-maxphys on 2012-11-20 03:00:58 +0000
 1.2.2.2 30-Oct-2012  yamt sync with head
 1.2.2.1 27-Oct-2012  yamt file if_ed_zbus.c was added on branch yamt-pagecache on 2012-10-30 17:18:49 +0000
 1.5 14-Oct-2012  phx New ed(4) device driver for Hydra and ASDG Zorro2 bus network cards.
This driver is based on the MI dp8390 backend.
 1.4 08-May-1995  chopps branches: 1.4.206; 1.4.212; 1.4.216;
may now work for asdg boards.. offsets obtained months ago but untestable here
 1.3 16-Apr-1995  chopps new driver from charles.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 16-Jul-1994  chopps branches: 1.1.2;
ed driver for 8390 based ethernet boards (currently only hydra supported)
original code from Timo Rossi <trossi@bedivere.cc.jyu.fi>, some major
style changes (KNF, pull i386 comments in, et al.) plus converting to
config.new by me.
 1.1.2.2 16-Jul-1994  chopps ed driver for 8390 based ethernet boards (currently only hydra supported)
original code from Timo Rossi <trossi@bedivere.cc.jyu.fi>, some major
style changes (KNF, pull i386 comments in, et al.) plus converting to
config.new by me.
 1.1.2.1 16-Jul-1994  chopps file if_edreg.h was added on branch netbsd-1-0 on 1994-07-16 02:27:46 +0000
 1.4.216.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.212.1 22-Nov-2012  riz Pull up following revision(s) (requested by phx in ticket #681):
sys/arch/amiga/dev/if_edreg.h: file removal
sys/dev/ic/dp8390reg.h: revision 1.9
sys/arch/amiga/conf/files.amiga: revision 1.161
sys/arch/amiga/dev/if_ed_zbus.c: revision 1.1
sys/arch/amiga/dev/if_ed_zbus.c: revision 1.2
sys/arch/amiga/dev/if_ed.c: file removal
New ed(4) device driver for Hydra and ASDG Zorro2 bus network cards.
This driver is based on the MI dp8390 backend.
Fixed receiving of odd-length packets. Driver works now perfectly.
Thanks to Harald Meinzer for providing me with a Hydra for a few days.
ed_ring structure is no longer needed for compatibility, as the last
device driver using it (amiga/ed(4)) has been converted now.
 1.4.206.1 30-Oct-2012  yamt sync with head
 1.70 27-Aug-2023  andvar amiga/es(4): start_ptr/end_ptr are initialized with USEPKTBUF option only,
thus add this option check, when they are defined/used under ESDEBUG.
 1.69 26-Aug-2023  andvar amiga/es(4): constify es_dump_smcregs char* argument to fix ESDEBUG build.
 1.68 17-Sep-2022  thorpej Eliminate use of IFF_OACTIVE.
 1.67 20-Aug-2022  thorpej esstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".
 1.66 24-May-2022  andvar fix various typos in comment, documentation and log messages.
 1.65 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.64 29-May-2019  msaitoh branches: 1.64.4;
Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
- Add ec_ifmedia into struct ethercom.
- ec_mii in struct ethercom is kept and used as it is. It might be used in
future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
ec_mii for keeping the if_media. Those should be changed in future.
 1.63 29-May-2019  msaitoh KNF. No functional change.
 1.62 29-May-2019  msaitoh Whitespace fix. No functional change.
 1.61 05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.60 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.59 26-Jun-2018  msaitoh branches: 1.59.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.58 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.57 22-Feb-2017  nonaka branches: 1.57.6; 1.57.12;
Apply deferred if_start to more MD drivers.
 1.56 15-Dec-2016  ozaki-r branches: 1.56.2;
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.55 10-Jun-2016  ozaki-r branches: 1.55.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.54 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.53 20-May-2015  ozaki-r Remove leftover use of AF_NS and NS option

Unnecessary NETISR_NS is also removed.
 1.52 22-Jan-2014  christos branches: 1.52.6;
gcc-4.8.x unused variable fixes
 1.51 27-Oct-2012  chs branches: 1.51.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.50 05-Apr-2010  joerg branches: 1.50.8; 1.50.18;
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.49 19-Jan-2010  pooka branches: 1.49.2; 1.49.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.48 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.47 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.46 19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.45 19-Mar-2009  he Correct one more bungled bcopy() -> memcpy() conversion.
 1.44 18-Mar-2009  cegger bcopy -> memcpy
 1.43 07-Nov-2008  dyoung branches: 1.43.4;
*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.42 17-Oct-2007  garbled branches: 1.42.16; 1.42.20; 1.42.26; 1.42.28;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.41 03-Sep-2007  he Rename function argument from command to cmd, to make the code
actually build after the previous change.
 1.40 01-Sep-2007  dyoung Change a bazillion occurrences of code resembling this,

error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);

if (error == ENETRESET) {

to this,

if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
 1.39 26-Aug-2007  dyoung branches: 1.39.2;
Constify.
 1.38 04-Mar-2007  christos branches: 1.38.2; 1.38.10; 1.38.14; 1.38.18;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 11-Dec-2005  christos branches: 1.37.26;
merge ktrace-lwp.
 1.36 13-Jun-2005  jmc branches: 1.36.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.35 30-Oct-2004  thorpej When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.34 28-Jan-2003  wiz branches: 1.34.2; 1.34.6;
success, not sucess. Noted by mjl.
 1.33 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 06-Mar-2002  mhitch Add media support (such as it is), manual is all you get.
 1.30 03-Mar-2002  mhitch Enable transmit error and EPH interrupt, and reset NIC on EPH interrupt.
Fixes a source of lost interrupts.
 1.29 02-Mar-2002  mhitch Make reset actually do something and enable the use of the watchdog timer.
Losing interrupts no longer will hang the network.
 1.28 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.27 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.26 15-Nov-2000  thorpej branches: 1.26.4; 1.26.8;
Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.25 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.24 10-Dec-1999  mhitch Add multicast capability to the A4066 (es) driver; now it will do IPv6.
 1.23 18-May-1999  thorpej branches: 1.23.2; 1.23.8;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.22 05-Jul-1998  jonathan branches: 1.22.6; 1.22.10;
defopt NS, NSIP.
 1.21 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.20 04-Jul-1998  jonathan defopt DDB.
 1.19 12-Jan-1998  thorpej Adjust for changes to config.
 1.18 17-Mar-1997  is if_es.c
 1.17 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.16 23-Dec-1996  veego branches: 1.16.6;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.15 13-Oct-1996  christos backout previous kprintf change
 1.14 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 07-May-1996  thorpej Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.12 01-May-1996  mhitch Define BSR_MASK and use BSR_MASK to get the current bank select register.
Clean up the debugging code a bit and the warnings from -Wall.
Don't define ESDEBUG - it can now be set from the config file.

If the Ethernet chip gets reset during the copy of the transmit buffer,
requeue the current packet and reinitialize the controller. This recovers
from an apparent hardware bug when running on my A2000/Zeus system.
 1.11 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.10 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.9 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.8 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.7 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 02-Jul-1995  mycroft Remove references to if_addrlist.
 1.5 27-Jun-1995  chopps udpate to match ifnets new use of sys/queue.h
 1.4 14-Apr-1995  chopps bring up-to-date with recent chages (arpwhohas->arp_ifinit
and int xx_start->void xx_start)
 1.3 11-Apr-1995  mycroft Sync with the rest of the world. Define BSR_BANK[0-3] constants and use them.
Various other cleanup.
 1.2 02-Apr-1995  chopps cleanup SG4_, fix magnum interrupts, gvp hack for ziii, new gvp configs, 4066
4066 interrupt fix, add baudrate gen and don't clear other port lines for mfc
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 13-Feb-1995  chopps add ethernet driver (from Michael)
 1.16.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.16.6.1 06-Mar-1997  is Convert to new ARP style.
 1.22.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.22.6.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.23.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.23.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.23.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.26.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.26.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.26.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.26.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.26.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.26.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.34.6.1 24-Jan-2005  he Pull up revision 1.35 (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.34.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.34.2.1 02-Nov-2004  skrll Sync with HEAD.
 1.36.2.1 03-Sep-2007  yamt sync with head.
 1.37.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.38.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.38.14.2 10-Sep-2007  skrll Sync with HEAD.
 1.38.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.38.10.1 03-Oct-2007  garbled Sync with HEAD
 1.38.2.1 09-Oct-2007  ad Sync with head.
 1.39.2.1 06-Nov-2007  matt sync with HEAD
 1.42.28.2 28-Apr-2009  skrll Sync with HEAD.
 1.42.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.42.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.42.20.4 11-Aug-2010  yamt sync with head.
 1.42.20.3 11-Mar-2010  yamt sync with head
 1.42.20.2 20-Jun-2009  yamt sync with head
 1.42.20.1 04-May-2009  yamt sync with head.
 1.42.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.43.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.49.4.1 30-May-2010  rmind sync with head
 1.49.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.50.18.3 03-Dec-2017  jdolecek update from HEAD
 1.50.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.50.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.50.8.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.50.8.1 30-Oct-2012  yamt sync with head
 1.51.2.1 18-May-2014  rmind sync with head
 1.52.6.5 28-Aug-2017  skrll Sync with HEAD
 1.52.6.4 05-Feb-2017  skrll Sync with HEAD
 1.52.6.3 09-Jul-2016  skrll Sync with HEAD
 1.52.6.2 19-Mar-2016  skrll Sync with HEAD
 1.52.6.1 06-Jun-2015  skrll Sync with HEAD
 1.55.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.55.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.56.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.57.12.3 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.57.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.57.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.57.6.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.59.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.59.2.1 10-Jun-2019  christos Sync with HEAD
 1.64.4.1 29-Feb-2020  ad Sync with head.
 1.10 24-Jun-2023  msaitoh Fix typo in comment.
 1.9 19-Feb-2023  andvar s/collsions/collisions/ in comment.
 1.8 31-May-2022  andvar fix various typos in comments, documentation and messages.
 1.7 21-Oct-2009  snj Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.6 28-Jan-2003  wiz branches: 1.6.108;
success, not sucess. Noted by mjl.
 1.5 03-Mar-2002  mhitch Enable transmit error and EPH interrupt, and reset NIC on EPH interrupt.
Fixes a source of lost interrupts.
 1.4 01-May-1996  mhitch branches: 1.4.44; 1.4.48;
Define BSR_MASK and use BSR_MASK to get the current bank select register.
 1.3 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 11-Apr-1995  mycroft Sync with the rest of the world. Define BSR_BANK[0-3] constants and use them.
Various other cleanup.
 1.1 13-Feb-1995  chopps add ethernet driver (from Michael)
 1.4.48.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.44.1 16-Mar-2002  jdolecek Catch up with -current.
 1.6.108.1 11-Mar-2010  yamt sync with head
 1.47 01-Aug-2023  andvar fix various typos in comments.
 1.46 22-Jan-2014  christos gcc-4.8.x unused variable fixes
 1.45 19-Jan-2010  pooka branches: 1.45.12; 1.45.22; 1.45.26;
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.44 19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.43 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.42 04-Apr-2008  tsutsui branches: 1.42.2; 1.42.4;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.41 24-Dec-2005  perry branches: 1.41.74;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.40 11-Dec-2005  christos merge ktrace-lwp.
 1.39 13-Jun-2005  jmc branches: 1.39.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.38 02-Oct-2002  thorpej branches: 1.38.6;
Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.35 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.34 20-Jun-2001  jdolecek branches: 1.34.2; 1.34.8;
Adapt to lance_init() change
 1.33 30-May-2001  mrg use _KERNEL_OPT
 1.32 10-Jan-1999  tron branches: 1.32.20;
Don't use void pointer for arithmetic.
 1.31 17-Aug-1998  mycroft Assign my copyrights to TNF.
 1.30 21-Jul-1998  drochner adapt to LANCE driver split
 1.29 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.28 09-Mar-1998  is Bug fix for the Ariadne panic: don't touch addresses outside the buffer we
got passed.
- analysis by Charles Hannum
- bugfix by Michael van Elst
- test by Thorsten Frueauf & Matthias Scheler
 1.27 04-Oct-1997  thorpej branches: 1.27.2;
Copyright assigned to The NetBSD Foundation.
 1.26 27-Mar-1997  veego branches: 1.26.4;
if_le supports now the Ariadne card.
 1.25 17-Mar-1997  is Make this compile again on Amiga. Fix by Bernd Ernesti.
 1.24 17-Mar-1997  thorpej #include <net/if_media.h>
 1.23 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.22 23-Dec-1996  veego branches: 1.22.6;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.21 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.20 22-Apr-1996  christos Add a hardware dependent initialization function lehwinit()
 1.19 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.18 18-Apr-1996  cgd change LANCE copy & zero functions' names to start with amd7990_, and
remove their 'integrate' (usually defined to be 'static') keywords.
when lance drivers are split up by attachment, more than one file will
reference the copy/zero functions (i.e. not just the file that pulls in
am7990.c... and eventually inclusion of am7990.c should go away entirely).
 1.17 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.16 27-Dec-1995  chopps remove uneeded routines (pr#1837) from Bernd Ernesti
 1.15 29-Sep-1995  chopps move 040 to hp300 style, use new MI lance ethernet driver
a few minor fixes WRT prototypes.
if_le from Charles rest from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.14 02-Jul-1995  mycroft Remove references to if_addrlist.
 1.13 27-Jun-1995  chopps udpate to match ifnets new use of sys/queue.h
 1.12 13-Apr-1995  chopps couple small changes from Michael.
 1.11 11-Apr-1995  chopps fix up some changes
 1.10 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.9 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 21-Jun-1994  chopps no gvp series I yet. and if_le.c from Rob Healey (rhealey@aggregate.com)
 1.5 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.4 12-Feb-1994  chopps no more if_init.
 1.3 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.22.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.22.6.1 06-Mar-1997  is Convert to new ARP style.
 1.26.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.27.2.1 05-May-1998  mycroft Pull up 1.28, per request of is.
 1.32.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.34.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.34.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.34.8.1 20-Jun-2001  nathanw file if_le.c was added on branch nathanw_sa on 2002-02-28 04:06:47 +0000
 1.34.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.34.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.38.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.39.2.1 21-Jun-2006  yamt sync with head.
 1.41.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.42.4.3 11-Mar-2010  yamt sync with head
 1.42.4.2 20-Jun-2009  yamt sync with head
 1.42.4.1 16-May-2008  yamt sync with head.
 1.42.2.1 18-May-2008  yamt sync with head.
 1.45.26.1 18-May-2014  rmind sync with head
 1.45.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.45.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6 30-Sep-1995  chopps no longer needed by lance driver (now uses /dev/ic...)
 1.5 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 27-Mar-1997  veego branches: 1.5.56;
if_le supports now the Ariadne card.
 1.4 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.3 07-May-1996  thorpej branches: 1.3.8;
Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.2 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.1 30-Sep-1995  chopps oops, forgot to cvs add this
 1.3.8.1 06-Mar-1997  is Convert to new ARP style.
 1.5.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.56.1 03-Aug-2004  skrll Sync with HEAD
 1.5 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.4 13-Aug-2013  rkujawa branches: 1.4.2; 1.4.6; 1.4.10;
Add support for X-Surf 100 integrated MII PHY. MAC part seems to be compatible
with AX88190, while PHY itself can be handled by ukphy.
 1.3 13-Aug-2013  rkujawa Clean up a bit, add debug function to print the register mappings.
 1.2 11-Aug-2013  rkujawa Use the proper NE2000_TYPE for AX88796.
 1.1 08-Aug-2013  rkujawa Add preliminary support for Individual Computers new X-Surf 100 network card.
 1.4.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.10.1 13-Aug-2013  tls file if_ne_xsh.c was added on branch tls-maxphys on 2014-08-20 00:02:43 +0000
 1.4.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.6.1 13-Aug-2013  yamt file if_ne_xsh.c was added on branch yamt-pagecache on 2014-05-22 11:39:28 +0000
 1.4.2.2 28-Aug-2013  rmind sync with head
 1.4.2.1 13-Aug-2013  rmind file if_ne_xsh.c was added on branch rmind-smpnet on 2013-08-28 23:59:10 +0000
 1.2 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.1 15-May-2012  rkujawa branches: 1.1.2; 1.1.4;
- Split X-Surf driver from if_ne_zbus, rework, add support for clockports present on X-Surf boards.
- Add gencp(4), a driver for generic clockports (it just needs a base address).

Approved by phx.
 1.1.4.2 02-Jun-2012  mrg sync to latest -current.
 1.1.4.1 15-May-2012  mrg file if_ne_xsurf.c was added on branch jmcneill-usbmp on 2012-06-02 11:08:50 +0000
 1.1.2.2 23-May-2012  yamt sync with head.
 1.1.2.1 15-May-2012  yamt file if_ne_xsurf.c was added on branch yamt-pagecache on 2012-05-23 10:07:40 +0000
 1.17 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.16 15-May-2012  rkujawa - Split X-Surf driver from if_ne_zbus, rework, add support for clockports present on X-Surf boards.
- Add gencp(4), a driver for generic clockports (it just needs a base address).

Approved by phx.
 1.15 09-Apr-2012  rkujawa Workaround for the fake X-Surf autoconfig entry, created by the Deneb firmware v11.
 1.14 19-Jul-2011  dyoung branches: 1.14.2; 1.14.6; 1.14.8; 1.14.12; 1.14.14;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.13 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.12 12-Mar-2008  cube branches: 1.12.2; 1.12.4;
Split device_t and softc for the NE2000 Ethernet chip and all its variants
and attachments. Use device_t accessors, correct types, and ANSIfy when
appropriate.
 1.11 02-Oct-2002  thorpej branches: 1.11.22; 1.11.84; 1.11.104; 1.11.108;
Use CFATTACH_DECL().
 1.10 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.9 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.8 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.7 12-Feb-2001  thorpej branches: 1.7.4; 1.7.8;
Adjust the way that media is initialized on DP8390-compatible
chips. The dp8390_softc now has media_init and media_fini
function pointers that do the work.
 1.6 29-Dec-2000  is The name is X-surf, not X-serv. I'll never learn this.
Thanks to Petri Koistinen for the correction.
 1.5 23-Jan-2000  aymeric branches: 1.5.4;
sync with new bus.h
 1.4 30-Dec-1999  is Rewrite of the Amiga bus_space machinery to prepare for the support of
the generic IDE driver and the PCMCIA slots.
 1.3 25-Nov-1999  is Address range scaling is hidden by the bus_space functions. Correct the
definitions in case we ever do bus_space accounting on Amiga.
 1.2 25-Nov-1999  is Another RTL8019 board: X-serve by Individual Computers Jens Schoenfeld.
 1.1 11-Nov-1998  veego branches: 1.1.4; 1.1.10; 1.1.16;
New driver for the Ariadne II.
 1.1.16.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.10.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.10.2 05-Jan-2001  bouyer Sync with HEAD
 1.1.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.1.4.1 23-Jan-2000  he Pull up revision 1.2 (requested by is):
Add support for X-surf board.
 1.5.4.1 25-Jan-2001  jhawk Pull up revision 1.6 (requested by is):
Correct and add (Respectively) the name of the X-surf board in comments.
 1.7.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.7.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.7.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.7.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.11.108.2 02-Jun-2008  mjf Sync with HEAD.
 1.11.108.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.104.1 24-Mar-2008  keiichi sync with head.
 1.11.84.1 23-Mar-2008  matt sync with HEAD
 1.11.22.1 17-Mar-2008  yamt sync with head.
 1.12.4.1 16-May-2008  yamt sync with head.
 1.12.2.1 18-May-2008  yamt sync with head.
 1.14.14.1 06-Jun-2013  riz Pull up following revision(s) (requested by rkujawa in ticket #892):
sys/arch/amiga/dev/if_ne_zbus.c: revision 1.15
Workaround for the fake X-Surf autoconfig entry, created by the Deneb =
firmware v11.
 1.14.12.1 06-Jun-2013  riz Pull up following revision(s) (requested by rkujawa in ticket #892):
sys/arch/amiga/dev/if_ne_zbus.c: revision 1.15
Workaround for the fake X-Surf autoconfig entry, created by the Deneb =
firmware v11.
 1.14.8.1 06-Jun-2013  riz Pull up following revision(s) (requested by rkujawa in ticket #892):
sys/arch/amiga/dev/if_ne_zbus.c: revision 1.15
Workaround for the fake X-Surf autoconfig entry, created by the Deneb =
firmware v11.
 1.14.6.2 02-Jun-2012  mrg sync to latest -current.
 1.14.6.1 29-Apr-2012  mrg sync to latest -current.
 1.14.2.2 23-May-2012  yamt sync with head.
 1.14.2.1 17-Apr-2012  yamt sync with head
 1.53 17-Sep-2022  thorpej Eliminate use of IFF_OACTIVE.
 1.52 17-Sep-2022  thorpej Make qn_softc::transmit_pending a bool. NFC.
 1.51 17-Sep-2022  thorpej Remove statically allocated qn_softc[] array. NFC, as it was not
referenced by anything.
 1.50 05-Dec-2021  msaitoh s/timout/timeout/
 1.49 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.48 12-Nov-2019  msaitoh branches: 1.48.2;
Add missing initialization of sc_dev.
 1.47 05-Feb-2019  msaitoh branches: 1.47.4;
Remove very old IFF_NOTRAILERS flag.
 1.46 26-Jun-2018  msaitoh branches: 1.46.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.45 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.44 22-Feb-2017  nonaka branches: 1.44.6; 1.44.12;
Apply deferred if_start to more MD drivers.
 1.43 15-Dec-2016  ozaki-r branches: 1.43.2;
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.42 10-Jun-2016  ozaki-r branches: 1.42.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.41 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.40 20-May-2015  ozaki-r Remove leftover use of AF_NS and NS option

Unnecessary NETISR_NS is also removed.
 1.39 27-Oct-2012  chs branches: 1.39.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.38 05-Apr-2010  joerg branches: 1.38.8; 1.38.18;
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.37 19-Jan-2010  pooka branches: 1.37.2; 1.37.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.36 18-Jan-2010  pooka Fix bpf. compile-tested only.
 1.35 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.34 19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.33 18-Mar-2009  cegger bcopy -> memcpy
 1.32 07-Nov-2008  dyoung branches: 1.32.4;
*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.31 17-Oct-2007  garbled branches: 1.31.16; 1.31.20; 1.31.26; 1.31.28;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.30 03-Sep-2007  he Rename function argument from command to cmd, to make the code
actually build after the previous change.
 1.29 01-Sep-2007  dyoung Change a bazillion occurrences of code resembling this,

error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);

if (error == ENETRESET) {

to this,

if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
 1.28 26-Aug-2007  dyoung branches: 1.28.2;
Constify.
 1.27 05-Mar-2007  he branches: 1.27.2; 1.27.10; 1.27.14; 1.27.18;
Cast to char* before doing pointer arithmetic.
 1.26 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.25 10-May-2006  skrll branches: 1.25.14;
Fix a bunch of cast lvalues.
 1.24 02-Oct-2002  thorpej branches: 1.24.22; 1.24.36; 1.24.38; 1.24.40; 1.24.42; 1.24.44;
Use CFATTACH_DECL().
 1.23 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.22 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.21 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.20 15-Nov-2000  thorpej branches: 1.20.4; 1.20.8;
Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.19 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.18 18-May-1999  thorpej branches: 1.18.2;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.17 25-Mar-1999  thorpej branches: 1.17.4;
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves. Subtract ETHER_CRC_LEN as necessary to get the same values
for these constants as were previously defined locally.
 1.16 05-Jul-1998  jonathan branches: 1.16.6;
defopt NS, NSIP.
 1.15 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.14 17-Apr-1998  veego Add missing int after an register.
 1.13 12-Jan-1998  thorpej Adjust for changes to config.
 1.12 17-Mar-1997  is Make this compile again.
 1.11 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.10 23-Dec-1996  veego branches: 1.10.6;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.9 13-Oct-1996  christos backout previous kprintf change
 1.8 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.7 18-Jun-1996  is During the data type cleanup, a bug crept in in the code handling mbufs with
odd length. This would lead to corrupt data sent.
 1.6 07-May-1996  thorpej branches: 1.6.4;
Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.5 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.4 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.3 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.2 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.1 07-Oct-1995  chopps branches: 1.1.2;
new quicknet ethernet driver from Kortelainen Mika <k125374@cs.tut.fi>
 1.1.2.1 10-Nov-1995  chopps update to if_qn from root@aivo.ton.tut.fi (Mika Kortelainen)
 1.6.4.1 18-Jun-1996  is Critical bug fix from the trunk:
During the recent data type cleanups, a bug crept in in the handling of
mbufs with odd length, leading to possible data corruption.
Fixes PR 2521 by Mika Kortelainen.
 1.10.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.10.6.1 06-Mar-1997  is Convert to new ARP style.
 1.16.6.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.17.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.18.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.18.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.20.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.20.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.20.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.20.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.24.44.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.24.42.1 11-May-2006  elad sync with head
 1.24.40.1 24-May-2006  yamt sync with head.
 1.24.38.1 01-Jun-2006  kardel Sync with head.
 1.24.36.1 09-Sep-2006  rpaulo sync with head
 1.24.22.2 03-Sep-2007  yamt sync with head.
 1.24.22.1 21-Jun-2006  yamt sync with head.
 1.25.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.27.14.2 10-Sep-2007  skrll Sync with HEAD.
 1.27.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.27.10.1 03-Oct-2007  garbled Sync with HEAD
 1.27.2.1 09-Oct-2007  ad Sync with head.
 1.28.2.1 06-Nov-2007  matt sync with HEAD
 1.31.28.2 28-Apr-2009  skrll Sync with HEAD.
 1.31.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.31.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.31.20.4 11-Aug-2010  yamt sync with head.
 1.31.20.3 11-Mar-2010  yamt sync with head
 1.31.20.2 20-Jun-2009  yamt sync with head
 1.31.20.1 04-May-2009  yamt sync with head.
 1.31.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.32.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.4.1 30-May-2010  rmind sync with head
 1.37.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.38.18.2 03-Dec-2017  jdolecek update from HEAD
 1.38.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.38.8.1 30-Oct-2012  yamt sync with head
 1.39.14.5 28-Aug-2017  skrll Sync with HEAD
 1.39.14.4 05-Feb-2017  skrll Sync with HEAD
 1.39.14.3 09-Jul-2016  skrll Sync with HEAD
 1.39.14.2 19-Mar-2016  skrll Sync with HEAD
 1.39.14.1 06-Jun-2015  skrll Sync with HEAD
 1.42.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.42.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.43.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.44.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.44.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.44.6.2 14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1439):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.


Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.


Add missing initialization of sc_dev.
 1.44.6.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.46.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.46.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.46.2.1 10-Jun-2019  christos Sync with HEAD
 1.47.4.1 14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #425):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.

Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.

Add missing initialization of sc_dev.
 1.48.2.1 29-Feb-2020  ad Sync with head.
 1.2 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.1 07-Oct-1995  chopps branches: 1.1.2;
new quicknet ethernet driver from Kortelainen Mika <k125374@cs.tut.fi>
 1.1.2.1 10-Nov-1995  chopps update to if_qn from root@aivo.ton.tut.fi (Mika Kortelainen)
 1.21 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.20 24-Apr-2021  thorpej branches: 1.20.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.19 27-Oct-2012  chs branches: 1.19.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.18 19-Jul-2011  dyoung branches: 1.18.2; 1.18.12;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.17 21-Jul-2010  jklos Fix the port order so that port ttyC0 refers to port 1 on the IOBlix,
ttyC1 to port 2, ttyC2 to port 3, and ttyC3 to port 4.
 1.16 20-Jul-2010  jklos Properly initialize the IOBlix card's lpt port on boot. From Frank Wille
and Michael L. Hitch.
 1.15 02-Feb-2010  phx branches: 1.15.2; 1.15.4;
Fix compilation warnings and errors with amigappc.
 1.14 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.13 11-Dec-2005  christos branches: 1.13.74; 1.13.76; 1.13.78;
merge ktrace-lwp.
 1.12 13-Jun-2005  jmc Fix a ton of const/volatile issues shown with new warning flags
 1.11 06-Jan-2003  wiz branches: 1.11.2;
interrupt with two rs.
 1.10 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.9 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.8 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.7 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.6 28-Jan-2002  aymeric branches: 1.6.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.5 27-Jan-2002  is Register a shutdown handler that switches off interupts.
 1.4 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.3 10-Mar-2001  is branches: 1.3.2; 1.3.8;
- The ioblix zbus board comes in 24 MHz and 22.1184 MHz clock variants.
We default to the (newer, more sane) 22.1184 MHz value, but set it from
the iobzclock variable (in Hz), which is initialized from the IOBZCLOCK
configuration option and patchable.
XXX we should time the clock at system startup.
- add ioblix_zbus to the GENERIC configuration.
 1.2 08-Mar-2001  is Add rcsid.
 1.1 23-Mar-2000  is branches: 1.1.6; 1.1.8;
Initial IOBlix support. Only lpt and com; lpt untested; com assumes 24 MHz
clock (needs autoprobe of clock speed).
 1.1.8.1 09-Apr-2001  nathanw Catch up with -current.
 1.1.6.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.1.6.1 23-Mar-2000  bouyer file ioblix_zbus.c was added on branch thorpej_scsipi on 2000-11-20 19:58:37 +0000
 1.3.8.6 07-Jan-2003  thorpej Sync with HEAD.
 1.3.8.5 03-Jan-2003  thorpej Sync with HEAD.
 1.3.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.3.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.3.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.8.1 10-Mar-2001  nathanw file ioblix_zbus.c was added on branch nathanw_sa on 2002-02-28 04:06:48 +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 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.8.1 16-May-2002  gehenna Include sys/conf.h directly.
 1.11.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.78.3 11-Aug-2010  yamt sync with head.
 1.13.78.2 11-Mar-2010  yamt sync with head
 1.13.78.1 16-May-2008  yamt sync with head.
 1.13.76.1 18-May-2008  yamt sync with head.
 1.13.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.4.1 05-Mar-2011  rmind sync with head
 1.15.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.18.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.2.1 30-Oct-2012  yamt sync with head
 1.19.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.20.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.20 22-Sep-2018  maxv Remove isic(4). It is part of ISDN, which we are now retiring.
 1.19 27-Oct-2012  chs branches: 1.19.36; 1.19.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.18 19-Jul-2011  dyoung branches: 1.18.2; 1.18.12;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.17 19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.16 11-Dec-2005  christos branches: 1.16.78;
merge ktrace-lwp.
 1.15 13-Jun-2005  jmc Fix a ton of const/volatile issues shown with new warning flags
 1.14 21-Nov-2004  is Somebody forgot this change when changing the structure name.
Pointed out by Nick Hudson.
 1.13 06-Jan-2003  wiz branches: 1.13.2; 1.13.4;
interrupt with two rs.
 1.12 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.11 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.10 24-Mar-2002  martin Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
 1.9 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.8 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.7 26-Apr-2001  is branches: 1.7.2; 1.7.8;
Be more specific than "some isic board".
 1.6 25-Mar-2001  is Missing changes to the last update, making this compile (and work) again.
 1.5 24-Mar-2001  martin Adjust to new hardware driver <-> isdn layer 2 and above sheme.
 1.4 20-Feb-2001  martin branches: 1.4.2;
Filename cleanup: remove i4b_ prefixes outside sys/netisdn, last round.

Renamed in sys/dev/ic:
i4b_hscx.c -> hscx.c
i4b_hscx.h -> hscx.h
i4b_ipac.h -> ipac.h
i4b_isac.c -> isac.c
i4b_isac.h -> isac.h
i4b_isic.c -> isic.c
i4b_isicbchan.c -> isic_bchan.c
i4b_isicl1.c -> isic_l1.c
i4b_isicl1.h -> isic_l1.h
i4b_isicl1fsm.c -> isic_l1fsm.c
 1.3 28-Jan-2001  is branches: 1.3.2;
Add NetBSD rcsid, clean up comments.
 1.2 25-Jan-2001  is Add support for ISDN Surfer (ISDN only, for the time being).
 1.1 21-Jan-2001  is Amiga part of isdn4bsd, and an example kernel configuration file.
 1.3.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.3.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.3.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.3.2.1 28-Jan-2001  bouyer file isic_supio.c was added on branch thorpej_scsipi on 2001-02-11 19:08:47 +0000
 1.4.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.7.8.5 07-Jan-2003  thorpej Sync with HEAD.
 1.7.8.4 18-Oct-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 28-Feb-2002  nathanw Catch up to -current.
 1.7.8.1 26-Apr-2001  nathanw file isic_supio.c was added on branch nathanw_sa on 2002-02-28 04:06:48 +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 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.13.4.1 29-Nov-2004  jmc Pullup rev 1.14 (requested by is in ticket #996)

Typo in structure name
 1.13.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.2.1 29-Nov-2004  skrll Sync with HEAD.
 1.16.78.1 20-Jun-2009  yamt sync with head
 1.18.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.2.1 30-Oct-2012  yamt sync with head
 1.19.38.1 10-Jun-2019  christos Sync with HEAD
 1.19.36.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.100 28-May-2022  andvar fix various typos, mainly in comments.
 1.99 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.98 25-Jul-2014  dholland branches: 1.98.26; 1.98.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.97 22-Mar-2014  christos branches: 1.97.2;
kill sprintf
fix unused variables
 1.96 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.95 22-Jan-2014  christos gcc-4.8.x unused variable fixes
 1.94 27-Oct-2012  chs branches: 1.94.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.93 15-Dec-2011  phx branches: 1.93.6;
Amiga wscons/Xorg support, first phase.
Implemented wscons for CV64 and CV64/3D. Other graphics cards drivers are
prepared for it, but will not be attempted before Xorg is not running.
The wscons support is disabled by default. A GENERIC kernel should behave
like always. Use WSCONS to try out a kernel with wscons support.
Done by rkujawa@ and phx@.
 1.92 24-Apr-2011  rmind branches: 1.92.4; 1.92.8;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.91 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.90 30-Jan-2010  phx branches: 1.90.4; 1.90.6; 1.90.8;
Do not crash when ite wasn't configured to be console.
 1.89 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.88 19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.87 18-Mar-2009  cegger bcopy -> memcpy
 1.86 18-Mar-2009  cegger bzero -> memset
 1.85 18-Mar-2009  cegger bcmp -> memcmp
 1.84 11-Jun-2008  tsutsui branches: 1.84.4; 1.84.10;
Use device_private() and device_lookup_private() to get softc.
 1.83 20-May-2008  phx branches: 1.83.2;
amiga/amiga/isr.h must not be included for __m68k__ only.
At the moment it is required by amigappc as well.
 1.82 02-Dec-2007  mhitch branches: 1.82.14; 1.82.16; 1.82.18; 1.82.20;
Initializing the callout structure while it's in use is bad.
Only do it on the first call to iteinit().
 1.81 19-Nov-2007  ad - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.80 18-Oct-2007  joerg branches: 1.80.2;
Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
 1.79 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.78 11-Jul-2007  he branches: 1.78.8; 1.78.10; 1.78.14;
Move the declaration of repeat_ch up before its first use,
so that this builds again.
 1.77 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.76 04-Mar-2007  christos branches: 1.76.2; 1.76.4; 1.76.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.75 01-Oct-2006  elad branches: 1.75.4;
Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.74 23-Jul-2006  ad branches: 1.74.4; 1.74.6;
Use the LWP cached credentials where sane.
 1.73 14-May-2006  elad integrate kauth.
 1.72 11-Dec-2005  christos branches: 1.72.4; 1.72.6; 1.72.8; 1.72.10; 1.72.12;
merge ktrace-lwp.
 1.71 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.70 13-Jun-2005  jmc branches: 1.70.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.69 02-Mar-2005  chs getitesp() can return NULL, so check for that in iteopen().
pointed out by Michael Hitch.
 1.68 19-Jan-2005  chs branches: 1.68.2;
use a flag in the softc to indicate if an instance has been configured,
rather than a bit in 32-bit global variable indexed by unit number.
 1.67 24-Feb-2004  wiz branches: 1.67.8;
becuase -> because. From Peter Postma.
 1.66 01-Nov-2003  jdolecek g/c local index() routine and switch to (libkern's) strchr()
 1.65 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.64 23-Oct-2002  jdolecek branches: 1.64.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.63 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.62 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.61 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.60 30-May-2002  thorpej Statements must follow labels.
 1.59 17-Mar-2002  atatat branches: 1.59.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.58 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.57 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.56 02-May-2001  scw branches: 1.56.2; 1.56.4; 1.56.8;
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.55 13-Jan-2001  aymeric branches: 1.55.2;
Make these compile again, plus minor aesthetic changes.
 1.54 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.53 25-May-2000  is Prepare for AmigaPPC.
 1.52 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.51 04-Jul-1998  jonathan branches: 1.51.14;
defopt DDB.
 1.50 25-Mar-1998  is - remove one level of soft interupt in the software autorepeat code
- WOPEN -> wopen
 1.49 23-Feb-1998  is Initialize keyboard structures also from kbdopen(), if necessary.
To do this, move the flag variable to kbdenable().
This will make kernels with serial console provice a working keyboard driver.
 1.48 12-Jan-1998  thorpej Adjust for changes to config.
 1.47 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.46 13-Oct-1996  christos backout previous kprintf change
 1.45 12-Oct-1996  mhitch KDASSERT is now in lib/libkern/libkern.h, so we don't need
amiga/amiga/kdassert.h.
 1.44 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.43 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.42 06-Jun-1996  mhitch Add tty_attach() calls for pstat -t. Closes PR #2519
 1.41 19-May-1996  is branches: 1.41.4;
Yet some more cleanup for missing prototypes, if DRACO is supported.
 1.40 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.39 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.38 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.37 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.36 16-Mar-1996  mhitch Removed Debugger() declaration - the prototype is in sys/systm.h.
 1.35 24-Feb-1996  chopps remove local strncmp (fixes #2115)
 1.34 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.33 20-Oct-1995  chopps cleanup warnings (fixes pr#1642)
 1.32 09-Oct-1995  chopps branches: 1.32.2;
add prototypes for isr stuff fixes pr# 1284 and 1569
 1.31 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.30 14-May-1995  chopps fix ITEIOC[GS]BELL and ITEIOCGREPT cases in iteioctl()
 1.29 07-May-1995  chopps enable pseudo-dma on ivsc, allow no ite/grfcc.
 1.28 23-Apr-1995  chopps bring up-to-date with recent conf.c and sunos changes.
 1.27 10-Apr-1995  mycroft Add dummy itestop(), and rename a few functions.
 1.26 02-Mar-1995  chopps allow 8 bit chars in ite.
 1.25 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.24 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.23 26-Oct-1994  cgd new RCS ID format.
 1.22 23-Jun-1994  chopps some various fixes from ahh@netcom.com (Andy Heffernan)
 1.21 16-Jun-1994  chopps fix boot diag output.
 1.20 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.19 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me. floppy changes, should now be solid.
some changes to ite and ms to fix a couple bugs report by Donn.
 1.18 31-May-1994  chopps MIN/MAX->min/max
 1.17 11-May-1994  chopps general cleanup including boot diag messages.
 1.16 09-May-1994  chopps update for recent sig changes and fix clock.c and ite.c
 1.15 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.14 20-Mar-1994  chopps yes ite is now auto margin, this fixes a conflict with the
termcap which has vt100 vt102 vt200 and v320 all as automargin.
 1.13 14-Mar-1994  chopps add LALT-LMETA-F10 to enter the kernel debugger.
 1.12 11-Mar-1994  chopps ack yucky dependenc on unit nums, temp hack for now.
 1.11 21-Feb-1994  chopps toss chars instead of outputing when in GRF mode.
 1.10 21-Feb-1994  chopps fixed a couple minor bugs in con code for ite. added floptical support in
sd.c (based on patch from Andreas E. Heitman).
 1.9 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.8 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.7 11-Feb-1994  chopps ioctl's always pass proc.
 1.6 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.32.2.2 20-Oct-1995  chopps take a couple devices from needs-count to needs-flag.
move tty pointers to softc structs
loadbsd now fails if it cannot allocate enough chipmem.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.32.2.1 20-Oct-1995  chopps bring in changes from mainbranch (oops)
 1.41.4.1 06-Jun-1996  mhitch Pull up from trunk:
> Add tty_attach() calls for pstat -t. Closes PR #2519
 1.51.14.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.51.14.2 22-Nov-2000  bouyer Sync with HEAD.
 1.51.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.55.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.56.8.7 11-Nov-2002  nathanw Catch up to -current
 1.56.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.56.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.56.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.56.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.56.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.56.8.1 02-May-2001  nathanw file ite.c was added on branch nathanw_sa on 2002-02-28 04:06:48 +0000
 1.56.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.56.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.56.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.56.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.56.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.59.4.2 09-Jul-2002  gehenna catch up with -current.
 1.59.4.1 16-May-2002  gehenna Add the character device switch.
 1.64.6.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.64.6.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.64.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.64.6.4 21-Nov-2004  skrll Adapt to branch.
 1.64.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.64.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.64.6.1 03-Aug-2004  skrll Sync with HEAD
 1.67.8.1 29-Apr-2005  kent sync with -current
 1.68.2.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.70.2.5 07-Dec-2007  yamt sync with head
 1.70.2.4 27-Oct-2007  yamt sync with head.
 1.70.2.3 03-Sep-2007  yamt sync with head.
 1.70.2.2 30-Dec-2006  yamt sync with head.
 1.70.2.1 21-Jun-2006  yamt sync with head.
 1.72.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.72.10.3 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.72.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.72.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.72.8.2 11-Aug-2006  yamt sync with head
 1.72.8.1 24-May-2006  yamt sync with head.
 1.72.6.1 01-Jun-2006  kardel Sync with head.
 1.72.4.1 09-Sep-2006  rpaulo sync with head
 1.74.6.1 22-Oct-2006  yamt sync with head
 1.74.4.1 18-Nov-2006  ad Sync with head.
 1.75.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.76.10.1 03-Oct-2007  garbled Sync with HEAD
 1.76.4.1 11-Jul-2007  mjf Sync with head.
 1.76.2.4 03-Dec-2007  ad Sync with HEAD.
 1.76.2.3 03-Dec-2007  ad Sync with HEAD.
 1.76.2.2 23-Oct-2007  ad Sync with head.
 1.76.2.1 15-Jul-2007  ad Sync with head.
 1.78.14.2 21-Nov-2007  bouyer Sync with HEAD
 1.78.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.78.10.2 09-Jan-2008  matt sync with HEAD
 1.78.10.1 06-Nov-2007  matt sync with HEAD
 1.78.8.3 03-Dec-2007  joerg Sync with HEAD.
 1.78.8.2 21-Nov-2007  joerg Sync with HEAD.
 1.78.8.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.80.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.82.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.82.18.3 11-Mar-2010  yamt sync with head
 1.82.18.2 20-Jun-2009  yamt sync with head
 1.82.18.1 04-May-2009  yamt sync with head.
 1.82.16.2 17-Jun-2008  yamt sync with head.
 1.82.16.1 04-Jun-2008  yamt sync with head
 1.82.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.82.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.83.2.1 18-Jun-2008  simonb Sync with head.
 1.84.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.84.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.90.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.90.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.90.4.2 31-May-2011  rmind sync with head
 1.90.4.1 05-Mar-2011  rmind sync with head
 1.92.8.1 18-Feb-2012  mrg merge to -current.
 1.92.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.92.4.2 30-Oct-2012  yamt sync with head
 1.92.4.1 17-Apr-2012  yamt sync with head
 1.93.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.93.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.94.2.1 18-May-2014  rmind sync with head
 1.97.2.1 10-Aug-2014  tls Rebase.
 1.98.28.1 10-Jun-2019  christos Sync with HEAD
 1.98.26.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.40 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.39 18-Mar-2009  cegger branches: 1.39.62; 1.39.64;
bzero -> memset
 1.38 04-Mar-2007  christos branches: 1.38.44; 1.38.52; 1.38.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 11-Dec-2005  christos branches: 1.37.26;
merge ktrace-lwp.
 1.36 13-Jun-2005  jmc branches: 1.36.2;
Fix some shadowing of variables
 1.35 24-Feb-2004  wiz becuase -> because. From Peter Postma.
 1.34 31-May-2003  kristerw branches: 1.34.2;
Use __asm instead of asm, to keep lint happy.
 1.33 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.32 17-Mar-2002  atatat branches: 1.32.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.31 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.30 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.29 21-Jun-2000  is branches: 1.29.4; 1.29.8;
- auto-USE_C_BFOPS when !defined(__m68k__)
- for bold characters, only blit the leftmost ftwidth pixels per character
cell row. The rightmost row which used to be printed would have been
overwritten formerly by the next character on sequential output, so no
visible change will result most of the time.
This fixes two problems:
* USE_C_BFOPS (which only works for 8 pixel wide fonts) blits the same
for bold characters now... it used to print the rightmost 8 pixel columns
of the bold-smeared characters
* we no longer need a reserved 1 pixel column at the right end of the screen.
That is, a 640x400 screen will hold 80x50 charactes with the 8x8 font.
 1.28 24-May-2000  is branches: 1.28.4;
missed one line when converting m68k asm() to macro calls.
 1.27 20-Sep-1999  is branches: 1.27.2;
replace inline asm by macro calls, that expand to the original inline asm
or to C replacements depending on the USE_C_BFOPS option.
The C replacement only works for our 8 bit wide fonts.
 1.26 25-Mar-1999  is Defopting grf_cc configuration parameters
 1.25 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.24 07-May-1995  chopps enable pseudo-dma on ivsc, allow no ite/grfcc.
 1.23 02-Mar-1995  chopps allow 8 bit chars in ite.
 1.22 16-Feb-1995  chopps cleanup copyright stuff
 1.21 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.20 26-Oct-1994  cgd new RCS ID format.
 1.19 15-Jun-1994  chopps clock now uses passed in frequency if present protect dma cache
flush calls from non 040. don't compile ite_xx if not used.
 1.18 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.17 25-May-1994  chopps MIN() -> min()
 1.16 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.15 22-Apr-1994  chopps spaces pasted should be tabs
 1.14 22-Apr-1994  chopps Changed fonts. Added 2 non (c) fonts kf_8x{8,11}.c retina now uses
kf_8x8. CC console users can now choose between the provided fonts
or provide there own.
 1.13 10-Apr-1994  chopps little bit of KNiFeing, view and ite ioctl names cleaned. ite bell
values made sensical for users. (that is pitch,msec not period,count)
 1.12 30-Mar-1994  chopps remove dlists.h oops.
 1.11 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.10 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.9 11-Feb-1994  chopps Add missing Id's
 1.8 11-Feb-1994  chopps ioctl's always pass proc.
 1.7 30-Jan-1994  chopps Re-enabled views, fixed warning in serial driver.
 1.6 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.5 31-Oct-1993  mw Change gfx-drivers to used g_data for their private data, and use regaddr
for what it's meant, that's to point to the register area. Now, both
gfx drivers should be fairly controllable from user-level applications.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.27.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.28.4.1 25-Jun-2000  is Sync to -current (with releng permission):
Only plot font_width pixel colums even for bold chars.
The excess column would have been overwritten by the next sequentially written
character anyway. Besides, the C methods did not do this right at all.
As a result, a 640 pixel column screen now holds 80 character columns.
 1.29.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.29.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.29.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.29.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.29.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.29.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.32.4.1 16-May-2002  gehenna Call device interfaces via device switch, not directly.
 1.34.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.34.2.4 21-Nov-2004  skrll Adapt to branch.
 1.34.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.34.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.34.2.1 03-Aug-2004  skrll Sync with HEAD
 1.36.2.2 03-Sep-2007  yamt sync with head.
 1.36.2.1 21-Jun-2006  yamt sync with head.
 1.37.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.38.58.1 13-May-2009  jym Sync with HEAD.

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

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.11 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.10 18-Mar-2009  cegger bcopy -> memcpy
 1.9 05-Mar-2007  he branches: 1.9.44; 1.9.52; 1.9.58;
Propagate volatile-ness from g_fbkva or g_regkva etc. as best as possible.
Some uses of __UNVOLATILE(), either in preparation of calls to bcopy()
or in the invocations themselves.
 1.8 11-Dec-2005  christos branches: 1.8.26;
merge ktrace-lwp.
 1.7 14-Oct-2004  mhitch branches: 1.7.12;
The gcc3 compiler optimized away writing character data to the Cirrus chip,
which results in a blank display - making it rather difficult to do an
install or upgrade when using a Cirrus-based display. Change the pointer
used to write the character and attribute to volatile. The console screen
now shows data and is usable.
 1.6 28-Jan-2002  aymeric branches: 1.6.16; 1.6.18;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.5 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 27-Jun-1999  is branches: 1.4.16; 1.4.20;
Don't even try to output to, scroll or clear the device if we are in graphics
mode. On this chip, we need to access some registers to set the text plane,
which messes up the graphics setup.
This should fix the grf3 problems reported by several people.
Michael Hitch and Joerg Lehners analyzed the problem and provided the fix.
 1.3 25-Mar-1999  is branches: 1.3.2; 1.3.4; 1.3.6;
defopt Amiga graphics console options
 1.2 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.1 23-Apr-1995  chopps new grfcl driver submitted by Ezra Story <ezy@panix.com>
 1.3.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

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

synchronization to latest KAME will take place on HEAD branch soon.
 1.3.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.3.2.1 28-Jun-1999  perry pullup 1.3->1.4 (is)
 1.4.20.1 28-Feb-2002  nathanw Catch up to -current.
 1.4.16.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.18.1 12-Nov-2004  jmc Pullup rev 1.7 (requested by mhitch in ticket #923)

The gcc3 compiler optimized away writing character data to the Cirrus chip,
which results in a blank display - making it rather difficult to do an
install or upgrade when using a Cirrus-based display. Change the pointer
used to write the character and attribute to volatile. The console screen
now shows data and is usable.
 1.6.16.1 19-Oct-2004  skrll Sync with HEAD
 1.7.12.1 03-Sep-2007  yamt sync with head.
 1.8.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.44.2 11-Mar-2010  yamt sync with head
 1.9.44.1 04-May-2009  yamt sync with head.
 1.8 05-Mar-2007  he Propagate volatile-ness from g_fbkva or g_regkva etc. as best as possible.
Some uses of __UNVOLATILE(), either in preparation of calls to bcopy()
or in the invocations themselves.
 1.7 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 28-Jan-2002  aymeric branches: 1.6.32; 1.6.70;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.5 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 25-Mar-1999  is branches: 1.4.22; 1.4.26;
defopt Amiga graphics console options
 1.3 19-May-1996  veego - grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.2 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.1 02-Mar-1996  veego console driver for the CyberVision64
 1.4.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.4.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.70.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.32.1 03-Sep-2007  yamt sync with head.
 1.7 05-Mar-2007  he Propagate volatile-ness from g_fbkva or g_regkva etc. as best as possible.
Some uses of __UNVOLATILE(), either in preparation of calls to bcopy()
or in the invocations themselves.
 1.6 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 28-Jan-2002  aymeric branches: 1.5.32; 1.5.70;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.4 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.3 25-Mar-1999  is branches: 1.3.22; 1.3.26;
defopt Amiga graphics console options
 1.2 10-Nov-1997  is Forgot this yestereve: s/CV64CONSOLE/CV3DCONSOLE/
 1.1 19-Oct-1997  veego branches: 1.1.2;
First version of the CyberVision 3D driver. This driver is based on
the CyberVision64 driver. Modified by Tobias Abt with some bugfixes
from Bernd Ernesti.
ZorroII is at the moment not supported and there is a small problem
with the Console driver where you just get a black screen, but the
system boots and you can use X11 without a problem.
 1.1.2.1 11-Nov-1997  mellon Pull rev 1.2 up from trunk (is)
 1.3.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.5.70.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.32.1 03-Sep-2007  yamt sync with head.
 1.12 05-Mar-2007  he Propagate volatile-ness from g_fbkva or g_regkva etc. as best as possible.
Some uses of __UNVOLATILE(), either in preparation of calls to bcopy()
or in the invocations themselves.
 1.11 07-Jun-2006  he branches: 1.11.12;
Get rid of LHS casts by introducing a pair of local helper variables.
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.6; 1.10.8; 1.10.14;
merge ktrace-lwp.
 1.9 13-Jun-2005  jmc branches: 1.9.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.8 30-Dec-2004  is Hardware pointers must be volatile.
Patch by Pawel Chwalowski via PR 28810, from a similar patch by Michael
Hitch to ite_cl.c.
 1.7 06-Sep-2004  is While in graphics mode, short-circuit text-mode functions that would destroy
graphics state. Same fix as ite_cl.c 1.4.
Problem reported, and original fix provided, by Pawel Chwalowski in PR 26788
(but had to be recreated because the original patch didn't apply due to
a whitespace problem).
 1.6 28-Jan-2002  aymeric branches: 1.6.10; 1.6.16; 1.6.18;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.5 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 25-Mar-1999  is branches: 1.4.22; 1.4.26;
defopt Amiga graphics console options
 1.3 05-Mar-1997  veego branches: 1.3.2;
- Merlin works now in ZorroIII mode
- Fixes for Interlace and DoubleScan
- Memorysizedetction for 1MB Bords
- HiColor and TrueColor Support
- support for the Domino 16M proto card
 1.2 08-Oct-1996  thorpej Merge netbsd-1-2 branch back into mainline.
 1.1 19-May-1996  veego branches: 1.1.4;
- grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.1.4.1 27-May-1996  is Fixes by Tobias Abt for Amiga Tseng driver: handle Zorro-III variants of these
boards correctly.
 1.3.2.2 05-Mar-1997  veego - Merlin works now in ZorroIII mode
- Fixes for Interlace and DoubleScan
- Memorysizedetction for 1MB Bords
- HiColor and TrueColor Support
- support for the Domino 16M proto card
 1.3.2.1 05-Mar-1997  veego file ite_et.c was added on branch is-newarp on 1997-03-05 22:50:42 +0000
 1.4.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.4.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.18.1 10-Sep-2004  jmc branches: 1.6.18.1.2;
Pullup rev 1.7 (requested by is in ticket #816)

While in graphics mode, short-circuit text-mode functions that would destroy
graphics state. PR#26788
 1.6.18.1.2.1 06-Apr-2005  he Pull up revision 1.8 (requested by is in ticket #1055):
Ensure that hardware pointers are volatile. Fixes PR#28810.
 1.6.16.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.16.3 17-Jan-2005  skrll Sync with HEAD.
 1.6.16.2 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.16.1 18-Sep-2004  skrll Sync with HEAD.
 1.6.10.1 11-Nov-2004  he Pull up revision 1.7 (requested by is in ticket #1742):
While in graphics mode, short-circuit text-mode functions
which would otherwise destroy graphics state. Fixes PR#26788.
 1.9.2.2 03-Sep-2007  yamt sync with head.
 1.9.2.1 21-Jun-2006  yamt sync with head.
 1.10.14.1 19-Jun-2006  chap Sync with head.
 1.10.8.1 26-Jun-2006  yamt sync with head.
 1.10.6.1 07-Jun-2006  kardel Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.11.12.1 12-Mar-2007  rmind Sync with HEAD.
 1.14 20-Dec-2017  msaitoh rt_init() in a comment must be rh_init(). Fix it.
 1.13 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.12 18-Mar-2009  cegger bcopy -> memcpy
 1.11 05-Mar-2007  he branches: 1.11.44; 1.11.52; 1.11.58;
Propagate volatile-ness from g_fbkva or g_regkva etc. as best as possible.
Some uses of __UNVOLATILE(), either in preparation of calls to bcopy()
or in the invocations themselves.
 1.10 28-Jan-2002  aymeric branches: 1.10.32; 1.10.70;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.9 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.8 25-Mar-1999  is branches: 1.8.22; 1.8.26;
defopt Amiga graphics console options
 1.7 23-Apr-1996  veego Added some ifdef's for RETINA_SPEED_HACK
Argh, why is a fuction from the RetinaZ2 console driver in the console
driver for the RetinaZ3 ? Fixed.
Fixed some warnings from -Wall if you don't use -DDEBUG
 1.6 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.5 06-Apr-1995  chopps made current retina vertical scroll code conditional on the new
option RETINA_SPEED_HACK. Old commented code has been resurected.
This reportedly fixes the smear problems some retinas have.
John Vrolijk <dsnjvro@etmsun.etm.ericsson.se> noticed this.
 1.4 16-Feb-1995  chopps cleanup copyright stuff
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 15-Jun-1994  chopps clock now uses passed in frequency if present protect dma cache
flush calls from non 040. don't compile ite_xx if not used.
 1.1 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me.
 1.8.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.8.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.10.70.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.32.1 03-Sep-2007  yamt sync with head.
 1.11.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.11.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.11.44.2 11-Mar-2010  yamt sync with head
 1.11.44.1 04-May-2009  yamt sync with head.
 1.25 22-Jan-2014  christos gcc-4.8.x unused variable fixes
 1.24 26-Oct-2009  cegger branches: 1.24.12; 1.24.22; 1.24.26;
kill extra whitespaces
reviewed by tsutsui@
 1.23 18-Mar-2009  cegger bcopy -> memcpy
 1.22 05-Mar-2007  he branches: 1.22.44; 1.22.52; 1.22.58;
Propagate volatile-ness from g_fbkva or g_regkva etc. as best as possible.
Some uses of __UNVOLATILE(), either in preparation of calls to bcopy()
or in the invocations themselves.
 1.21 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20 24-Dec-2005  perry branches: 1.20.26;
bare asm -> __asm
 1.19 06-Sep-2002  gehenna branches: 1.19.22;
Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.18 28-Jan-2002  aymeric branches: 1.18.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.17 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.16 23-Apr-1996  veego branches: 1.16.44; 1.16.48;
Added some ifdef's for RETINA_SPEED_HACK
Argh, why is a fuction from the RetinaZ2 console driver in the console
driver for the RetinaZ3 ? Fixed.
Fixed some warnings from -Wall if you don't use -DDEBUG
 1.15 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.14 08-Apr-1995  chopps fix typo
 1.13 06-Apr-1995  chopps made current retina vertical scroll code conditional on the new
option RETINA_SPEED_HACK. Old commented code has been resurected.
This reportedly fixes the smear problems some retinas have.
John Vrolijk <dsnjvro@etmsun.etm.ericsson.se> noticed this.
 1.12 16-Feb-1995  chopps cleanup copyright stuff
 1.11 26-Oct-1994  cgd new RCS ID format.
 1.10 15-Jun-1994  chopps clock now uses passed in frequency if present protect dma cache
flush calls from non 040. don't compile ite_xx if not used.
 1.9 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.8 05-Apr-1994  chopps allow user to not use their retina board as the console.
 1.7 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.6 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.5 11-Feb-1994  chopps Add missing Id's
 1.4 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.3 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 31-Oct-1993  mw Change gfx-drivers to used g_data for their private data, and use regaddr
for what it's meant, that's to point to the register area. Now, both
gfx drivers should be fairly controllable from user-level applications.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.16.48.2 17-Sep-2002  nathanw Catch up to -current.
 1.16.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.16.44.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.16.44.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.18.8.1 16-May-2002  gehenna Remove BANKEDDEVPAGER stuff.
 1.19.22.2 03-Sep-2007  yamt sync with head.
 1.19.22.1 21-Jun-2006  yamt sync with head.
 1.20.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.22.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.22.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.22.44.2 11-Mar-2010  yamt sync with head
 1.22.44.1 04-May-2009  yamt sync with head.
 1.24.26.1 18-May-2014  rmind sync with head
 1.24.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2 26-Jan-1994  mycroft Clean up deleted files.
 1.1 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.6 01-Mar-1995  mycroft Clean up deleted files.
 1.5 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.17 28-Aug-2023  andvar rename DEBUG_UL to UL_DEBUG for naming consistency.
remove stray UL_DEBUG definition in grf_ul.c
 1.16 28-Aug-2023  andvar fix format specifier from %lx to %hx, cmd has a type of u_int16_t.

fixes DEBUG_UL build for amiga (will be renamed to UL_DEBUG in next commit).
 1.15 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.14 14-Mar-2009  dsl branches: 1.14.62; 1.14.64;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.13 28-Apr-2008  martin branches: 1.13.8; 1.13.14;
Remove clause 3 and 4 from TNF licenses
 1.12 05-Mar-2007  he branches: 1.12.40; 1.12.42; 1.12.44;
Propagate volatile-ness from g_fbkva or g_regkva etc. as best as possible.
Some uses of __UNVOLATILE(), either in preparation of calls to bcopy()
or in the invocations themselves.
 1.11 28-Jan-2002  aymeric branches: 1.11.32; 1.11.70;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.10 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.9 16-Feb-1999  is branches: 1.9.22; 1.9.26;
Fix Copyright dates
 1.8 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.7 13-Oct-1996  christos backout previous kprintf change
 1.6 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.5 08-Jul-1996  is Cleaned up copyright notice, fixed a typo, and sync the comment in the
GSP assembler file with reality.
 1.4 10-May-1996  is Back out last change, which was caused by a wrong way merge at home.
Sorry for the inconvenience.
 1.3 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.2 27-Dec-1995  chopps cleanup for -Wall (pr#1559) from Ignatios Souvatzis
 1.1 18-Aug-1995  chopps new a2410 driver from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.9.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.9.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.11.70.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.32.1 03-Sep-2007  yamt sync with head.
 1.12.44.2 04-May-2009  yamt sync with head.
 1.12.44.1 16-May-2008  yamt sync with head.
 1.12.42.1 18-May-2008  yamt sync with head.
 1.12.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.14.64.1 10-Jun-2019  christos Sync with HEAD
 1.14.62.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.14 01-Nov-2021  andvar fix typos, mainly in words minimum and maximum, but also few others.
 1.13 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.12 08-Feb-2011  rmind branches: 1.12.14; 1.12.32;
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.11 11-Dec-2005  christos branches: 1.11.100; 1.11.106; 1.11.108;
merge ktrace-lwp.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 26-Oct-1994  cgd branches: 1.9.66;
new RCS ID format.
 1.8 11-May-1994  chopps general cleanup including boot diag messages.
 1.7 10-Apr-1994  chopps little bit of KNiFeing, view and ite ioctl names cleaned. ite bell
values made sensical for users. (that is pitch,msec not period,count)
 1.6 11-Feb-1994  chopps Add missing Id's
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.9.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.66.1 03-Aug-2004  skrll Sync with HEAD
 1.11.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.11.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.100.1 05-Mar-2011  rmind sync with head
 1.12.32.1 22-Sep-2015  skrll Sync with HEAD
 1.12.14.1 03-Dec-2017  jdolecek update from HEAD
 1.20 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.19 04-Mar-2007  christos branches: 1.19.78; 1.19.88;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.18 11-Dec-2005  christos branches: 1.18.26;
merge ktrace-lwp.
 1.17 19-Jan-2005  chs branches: 1.17.8;
use a flag in the softc to indicate if an instance has been configured,
rather than a bit in 32-bit global variable indexed by unit number.
 1.16 06-Sep-2002  gehenna branches: 1.16.6; 1.16.14;
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.15 26-Jan-2002  aymeric branches: 1.15.8;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.14 21-Apr-1996  veego branches: 1.14.42; 1.14.44; 1.14.48;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.13 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.12 20-Oct-1995  chopps cleanup warnings (fixes pr#1642)
 1.11 20-Aug-1995  chopps branches: 1.11.2;
fix protos (#1390) from Bernd Ernesti <bernd@arresum.inka.de>
 1.10 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.9 26-Oct-1994  cgd new RCS ID format.
 1.8 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.7 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.6 11-Feb-1994  chopps Add missing Id's
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.11.2.2 20-Oct-1995  chopps take a couple devices from needs-count to needs-flag.
move tty pointers to softc structs
loadbsd now fails if it cannot allocate enough chipmem.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.11.2.1 20-Oct-1995  chopps bring in changes from mainbranch (oops)
 1.14.48.2 17-Sep-2002  nathanw Catch up to -current.
 1.14.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.14.44.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.44.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.14.42.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.15.8.1 16-May-2002  gehenna Remove unnecessary prototypes.
 1.16.14.1 29-Apr-2005  kent sync with -current
 1.16.6.2 24-Jan-2005  skrll Sync with HEAD.
 1.16.6.1 21-Nov-2004  skrll Adapt to branch.
 1.17.8.2 03-Sep-2007  yamt sync with head.
 1.17.8.1 21-Jun-2006  yamt sync with head.
 1.18.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.88.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.19.78.1 30-Oct-2012  yamt sync with head
 1.39 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.38 24-Apr-2021  thorpej branches: 1.38.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.37 22-Jan-2014  christos branches: 1.37.44;
gcc-4.8.x unused variable fixes
 1.36 27-Oct-2012  chs branches: 1.36.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.35 11-Dec-2005  christos branches: 1.35.112; 1.35.122;
merge ktrace-lwp.
 1.34 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.33 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.32 02-Oct-2002  thorpej branches: 1.32.6;
Use CFATTACH_DECL().
 1.31 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.30 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.29 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.28 25-Apr-2001  bouyer branches: 1.28.2; 1.28.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.27 10-Jan-1999  tron branches: 1.27.8; 1.27.20;
Don't use void pointer for arithmetic.
 1.26 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.25 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.24 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.23 12-Jan-1998  thorpej Adjust for changes to config.
 1.22 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.21 23-Dec-1996  veego branches: 1.21.8; 1.21.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.20 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.19 13-Oct-1996  christos backout previous kprintf change
 1.18 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.17 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.16 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.15 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.14 28-Mar-1996  is The interrupt routine of the ivsc (and the empsc, which seems to have copied
it) looks truncated. At least the return(1) is missing, which I now add as
a first stopgap. Somebody needs to find out if anything else is missing for
these boards.
 1.13 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.12 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.11 07-May-1995  chopps enable pseudo-dma on ivsc, allow no ite/grfcc.
 1.10 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.9 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.8 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 06-Oct-1994  chopps branches: 1.4.2;
fix a couple warnings.
 1.3 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 29-May-1994  chopps 5380 driver update from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.4.2.2 06-Oct-1994  chopps fix a couple warnings.
 1.4.2.1 06-Oct-1994  chopps file ivsc.c was added on branch netbsd-1-0 on 1994-10-06 20:34:26 +0000
 1.21.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.21.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.27.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.27.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.28.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.28.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.28.8.1 25-Apr-2001  nathanw file ivsc.c was added on branch nathanw_sa on 2002-02-28 04:06:50 +0000
 1.28.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.28.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.32.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.6.1 03-Aug-2004  skrll Sync with HEAD
 1.35.122.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.35.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.35.112.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.35.112.1 30-Oct-2012  yamt sync with head
 1.36.2.1 18-May-2014  rmind sync with head
 1.37.44.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.38.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.62 08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.61 07-Aug-2021  thorpej branches: 1.61.12;
Merge thorpej-cfargs2.
 1.60 03-Jun-2021  rin branches: 1.60.2;
kbd(4) and ms(4) carry multiple interface attributes. They are configurable
both as standalone drivers for legacy framebuffer console, or parents of
wskbd(4) and wsmouse(4), respectively. For the latter, be explicit about
using "wskbddev" and "wsmousedev" interface attributes for children.
 1.59 24-Apr-2021  thorpej branches: 1.59.2; 1.59.6;
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.58 24-Feb-2019  jandberg branches: 1.58.14;
fix comment
 1.57 25-Jul-2014  dholland branches: 1.57.28;
Add d_discard to all struct cdevsw instances I could find.

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

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.55 27-Oct-2012  chs branches: 1.55.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.54 03-Jun-2011  matt branches: 1.54.2; 1.54.12;
CFATTACH_DECL_NEW, device_t, cfdata_t
 1.53 12-Dec-2009  phx branches: 1.53.4; 1.53.6; 1.53.10;
Reverted the CIA-timer based delay() to the pre-5.0 method of a calibrated
delay loop.
This fixes keyboard handshaking problems with some A1200 models since 5.0
and restores the precision for short delays on DraCo systems (the QuickLogic
timer has only a seventh of the CIA precision).
Changed the keyboard handshaking delay from 2000 back to 200ms, although
even the recommended 85ms were successfully tested on the most problematic
A1200 keyboards.
All those changes were tested on an A3000 and A1200 with 68060/50 CPU, and
previously discussed on the port-amiga ML.
 1.52 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.51 12-Jan-2009  mhitch branches: 1.51.2;
Retain compatibility with old firm_event. Old Xamiga binary now works with
-current kernel.
 1.50 28-Dec-2007  joerg branches: 1.50.6; 1.50.10; 1.50.18; 1.50.20; 1.50.26;
Prepare for timecounter support on amiga.
 1.49 04-Mar-2007  christos branches: 1.49.20; 1.49.26; 1.49.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.48 11-Dec-2005  christos branches: 1.48.26;
merge ktrace-lwp.
 1.47 01-Jun-2005  jandberg branches: 1.47.2;
Tell kbd when it is the console keyboard instead of always assuming
it is. Also console keyboard initialization is now made during consinit
instead of autoconf.
Reviewed by <is>.
 1.46 21-Sep-2003  jdolecek cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
the owner of descriptor, according to appropriate sematics
of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
 1.45 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.44 06-Jan-2003  wiz branches: 1.44.2;
interrupt with two rs.
 1.43 23-Oct-2002  jdolecek merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.42 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.41 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.40 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.39 17-Mar-2002  atatat branches: 1.39.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.38 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.37 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.36 13-Jan-2002  jandberg wskbd updates.
kbd.c: Now identifies itself as WSKBD_TYPE_AMIGA.
wskbdmap_amiga.c: Updated de/dk/sv/no keymaps.
 1.35 02-Feb-2001  is branches: 1.35.2; 1.35.4; 1.35.8;
Initial, still incomplete wscons support by Jukka Andberg, PR 11068
 1.34 25-May-2000  is Prepare for AmigaPPC.
 1.33 26-Jul-1998  is branches: 1.33.14;
yet more atomic operations accessing DraCo registers
 1.32 08-Mar-1998  is Conditionally (on defined(DRACO)) compile new DraCo keyboard code sequences.
Pointed out by Bernd Ernesti.
 1.31 28-Feb-1998  is Probe for the native DraCo (rekeycaped MF-II) keyboard, instead of guessing
it from the QuickLogic chip version byte.
If found, switch it to non-autorepeat mode (which seems to avoid the race
condition which made my keyboard driver / X server lose state under heavy
interupt load).
If not found, assume an Amiga keyboard on CIA-A.
XXX We should probe for the presence of the CIAs on the DraCo.
 1.30 23-Feb-1998  is Initialize keyboard structures also from kbdopen(), if necessary.
To do this, move the flag variable to kbdenable().
This will make kernels with serial console provice a working keyboard driver.
 1.29 12-Jan-1998  thorpej Adjust for changes to config.
 1.28 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.27 30-Nov-1996  is The DraCo MF-II to Amiga translation table is const-ant.
 1.26 13-Oct-1996  christos backout previous kprintf change
 1.25 11-Oct-1996  mhitch Changes for poll(2).
 1.24 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.23 14-Sep-1996  is Kill two debug printfs whose output always haunt me in the boot
messages, but which I didn't find when looking for then.
 1.22 16-May-1996  is merge.
 1.21 16-May-1996  is Correct a -Wall correction.
 1.20 10-May-1996  is Cleanup the mess I left when committing yestereve's changes; in this case,
an unused variable.
 1.19 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.18 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.17 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.16 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.15 07-May-1995  chopps enable pseudo-dma on ivsc, allow no ite/grfcc.
 1.14 10-Apr-1995  mycroft Nuke write routines.
 1.13 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.12 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.11 26-Oct-1994  cgd new RCS ID format.
 1.10 06-Oct-1994  chopps branches: 1.10.2;
Add Amiga 1200 support (kbd and ide) from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.8 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.7 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.6 11-Feb-1994  chopps Add missing Id's
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.10.2.2 06-Oct-1994  chopps Add Amiga 1200 support (kbd and ide) from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.10.2.1 06-Oct-1994  chopps file kbd.c was added on branch netbsd-1-0 on 1994-10-06 19:54:31 +0000
 1.33.14.2 11-Feb-2001  bouyer Sync with HEAD.
 1.33.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.35.8.6 07-Jan-2003  thorpej Sync with HEAD.
 1.35.8.5 11-Nov-2002  nathanw Catch up to -current
 1.35.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.35.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.35.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.35.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.35.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.35.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.35.4.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.35.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.39.4.1 16-May-2002  gehenna Add the character device switch.
 1.44.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.44.2.4 21-Nov-2004  skrll Adapt to branch.
 1.44.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.44.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.44.2.1 03-Aug-2004  skrll Sync with HEAD
 1.47.2.3 21-Jan-2008  yamt sync with head
 1.47.2.2 03-Sep-2007  yamt sync with head.
 1.47.2.1 21-Jun-2006  yamt sync with head.
 1.48.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.49.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.49.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.49.20.1 09-Jan-2008  matt sync with HEAD
 1.50.26.1 20-May-2011  matt bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat).
 1.50.20.1 16-Jul-2010  riz Pull up following revision(s) (requested by phx in ticket #1412):
sys/arch/amiga/dev/clock.c: revision 1.51
sys/arch/amiga/amiga/locore.s: revision 1.149 via patch
sys/arch/amiga/dev/kbd.c: revision 1.53
sys/arch/amiga/amiga/amiga_init.c: revision 1.118
Reverted the CIA-timer based delay() to the pre-5.0 method of a calibrated
delay loop.
This fixes keyboard handshaking problems with some A1200 models since 5.0
and restores the precision for short delays on DraCo systems (the QuickLogic
timer has only a seventh of the CIA precision).
Changed the keyboard handshaking delay from 2000 back to 200ms, although
even the recommended 85ms were successfully tested on the most problematic
A1200 keyboards.
All those changes were tested on an A3000 and A1200 with 68060/50 CPU, and
previously discussed on the port-amiga ML.
 1.50.18.2 28-Apr-2009  skrll Sync with HEAD.
 1.50.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.50.10.2 11-Mar-2010  yamt sync with head
 1.50.10.1 04-May-2009  yamt sync with head.
 1.50.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.51.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.53.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.53.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.53.4.1 12-Jun-2011  rmind sync with head
 1.54.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.54.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.54.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.54.2.1 30-Oct-2012  yamt sync with head
 1.55.2.1 18-May-2014  rmind sync with head
 1.56.2.1 10-Aug-2014  tls Rebase.
 1.57.28.1 10-Jun-2019  christos Sync with HEAD
 1.58.14.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.59.6.1 06-Jun-2021  cjep sync with head
 1.59.2.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.60.2.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.61.12.1 02-Aug-2025  perseant Sync with HEAD
 1.13 08-Aug-2014  joerg Avoid non-UTF8 input.
 1.12 28-Jan-2002  aymeric branches: 1.12.166; 1.12.182;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.11 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.10 06-Sep-1997  veego branches: 1.10.32; 1.10.36;
Add missing keypad entry for '+' and correct a comment. From pr#3893.
 1.9 21-Apr-1996  veego branches: 1.9.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.8 16-Feb-1995  chopps cleanup copyright stuff
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.5 11-Feb-1994  chopps Add missing Id's
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.9.12.1 06-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.36.1 28-Feb-2002  nathanw Catch up to -current.
 1.10.32.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.12.182.1 10-Aug-2014  tls Rebase.
 1.12.166.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.10 21-Apr-1996  veego branches: 1.10.44; 1.10.48;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.9 07-May-1995  chopps enable pseudo-dma on ivsc, allow no ite/grfcc.
 1.8 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.7 16-Feb-1995  chopps cleanup copyright stuff
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 11-Feb-1994  chopps Add missing Id's
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.10.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.10.44.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.8 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.7 11-Dec-2005  christos branches: 1.7.122; 1.7.142;
merge ktrace-lwp.
 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 26-Oct-1994  cgd branches: 1.5.66;
new RCS ID format.
 1.4 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.5.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.66.1 03-Aug-2004  skrll Sync with HEAD
 1.7.142.1 22-Sep-2015  skrll Sync with HEAD
 1.7.122.1 03-Dec-2017  jdolecek update from HEAD
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 01-Jun-2005  jandberg branches: 1.1.8;
Tell kbd when it is the console keyboard instead of always assuming
it is. Also console keyboard initialization is now made during consinit
instead of autoconf.
Reviewed by <is>.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 01-Jun-2005  skrll file kbdvar.h was added on branch ktrace-lwp on 2005-11-10 13:51:36 +0000
 1.5 22-Apr-1994  mycroft Clean up deleted files.
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.7 19-Apr-2002  heinz Removed the files after renaming to kf_iso8859_1_* (in agreement with
is@netbsd.org).
 1.6 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.5 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 21-Oct-1997  is branches: 1.4.28; 1.4.32;
Make l different from |.
Downgrades PR 1998 from software bug to change request.
 1.3 26-Oct-1994  cgd branches: 1.3.18;
new RCS ID format.
 1.2 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.1 22-Apr-1994  chopps Changed fonts. Added 2 non (c) fonts kf_8x{8,11}.c retina now uses
kf_8x8. CC console users can now choose between the provided fonts
or provide there own.
 1.3.18.1 22-Oct-1997  mellon pull up from main trunk
 1.4.32.2 20-Jun-2002  nathanw Catch up to -current.
 1.4.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.4.28.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.7 19-Apr-2002  heinz Removed the files after renaming to kf_iso8859_1_* (in agreement with
is@netbsd.org).
 1.6 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.5 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 21-Oct-1997  is branches: 1.4.28; 1.4.32;
Make l different from |.
Downgrades PR 1998 from software bug to change request.
 1.3 26-Oct-1994  cgd branches: 1.3.18;
new RCS ID format.
 1.2 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.1 22-Apr-1994  chopps Changed fonts. Added 2 non (c) fonts kf_8x{8,11}.c retina now uses
kf_8x8. CC console users can now choose between the provided fonts
or provide there own.
 1.3.18.1 22-Oct-1997  mellon pull up from main trunk
 1.4.32.2 20-Jun-2002  nathanw Catch up to -current.
 1.4.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.4.28.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.1 17-Apr-2002  heinz branches: 1.1.6; 1.1.8;
Renamed kf_8x8.c and kf_8x11.c to kf_iso8859_1_8x8.c and kf_iso8859_1_8x11.c
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 17-Apr-2002  jdolecek file kf_iso8859_1_8x11.c was added on branch kqueue on 2002-06-23 17:34:29 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 17-Apr-2002  nathanw file kf_iso8859_1_8x11.c was added on branch nathanw_sa on 2002-06-20 03:37:54 +0000
 1.1 17-Apr-2002  heinz branches: 1.1.6; 1.1.8;
Renamed kf_8x8.c and kf_8x11.c to kf_iso8859_1_8x8.c and kf_iso8859_1_8x11.c
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 17-Apr-2002  jdolecek file kf_iso8859_1_8x8.c was added on branch kqueue on 2002-06-23 17:34:29 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 17-Apr-2002  nathanw file kf_iso8859_1_8x8.c was added on branch nathanw_sa on 2002-06-20 03:37:54 +0000
 1.1 17-Apr-2002  heinz branches: 1.1.6; 1.1.8;
Add East European (iso8859-2) console fonts
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 17-Apr-2002  jdolecek file kf_iso8859_2_8x11.c was added on branch kqueue on 2002-06-23 17:34:30 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 17-Apr-2002  nathanw file kf_iso8859_2_8x11.c was added on branch nathanw_sa on 2002-06-20 03:37:54 +0000
 1.1 17-Apr-2002  heinz branches: 1.1.6; 1.1.8;
Add East European (iso8859-2) console fonts
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 17-Apr-2002  jdolecek file kf_iso8859_2_8x8.c was added on branch kqueue on 2002-06-23 17:34:30 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 17-Apr-2002  nathanw file kf_iso8859_2_8x8.c was added on branch nathanw_sa on 2002-06-20 03:37:54 +0000
 1.14 19-Jul-2011  dyoung Change <machine/bus.h> to <sys/bus.h> throughout.
 1.13 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.12 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.11 07-Mar-2008  cube branches: 1.11.2; 1.11.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.10 02-Oct-2002  thorpej branches: 1.10.22; 1.10.84; 1.10.104; 1.10.108;
Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 22-Jun-1999  is branches: 1.6.16; 1.6.20;
Align adresses better
 1.5 16-Feb-1999  is branches: 1.5.4;
Fix Copyright dates
 1.4 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.3 18-Jul-1998  is Switching dev/ic/lpt.c to use spllpt() instead of spltty(). It doesn't use
tty structures, and on some machines (namely the DraCo internal lpt, and some
multi-i/o boards for Amigas and DraCos), tying spltty to the pretty high printer
interupt level would hurt serial performance.

On all affected ports but Amiga, spllpt() has been defined in machine/intr.h
to be spltty(), thus preserving old behaviour. Portmasters are encouraged to
change is, if they feel something else is better (e.g., one of its own were
possible).
 1.2 11-Apr-1998  is amiga_ttyspl -> amiga_serialspl (and keep ttyspl constant at 4 again).
(Part of this change slipped in with my last machdep commit; thanks to
Matthias Scheler for pointing this out).
 1.1 27-Sep-1997  is branches: 1.1.2;
First part of splitting lpt.c, and the NetBSD/Amiga "supio" frontend. Needs
a bit more work to allow an ISA frontend.
 1.1.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 27-Sep-1997  thorpej file lpt_supio.c was added on branch marc-pcmcia on 1997-10-14 08:26:41 +0000
 1.5.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.6.20.2 18-Oct-2002  nathanw Catch up to -current.
 1.6.20.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.16.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.16.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.10.108.2 02-Jun-2008  mjf Sync with HEAD.
 1.10.108.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.104.1 24-Mar-2008  keiichi sync with head.
 1.10.84.1 23-Mar-2008  matt sync with HEAD
 1.10.22.1 17-Mar-2008  yamt sync with head.
 1.11.4.2 11-Mar-2010  yamt sync with head
 1.11.4.1 16-May-2008  yamt sync with head.
 1.11.2.1 18-May-2008  yamt sync with head.
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 11-Feb-1994  chopps Add missing Id's
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.3 21-Jan-2002  jdolecek Switch to MI dev/md_root.c for archs which don't have any special
memory disk hooks (i.e. everything except atari).
 1.2 17-Mar-1999  sommerfe branches: 1.2.22; 1.2.26;
defopt MINIROOTSIZE
 1.1 03-Jul-1998  mhitch Add memory disk.
 1.2.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.19 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.18 27-Oct-2012  chs branches: 1.18.38; 1.18.40;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.17 23-Nov-2011  jmcneill branches: 1.17.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.16 19-Jul-2011  dyoung branches: 1.16.2; 1.16.4;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.15 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.14 17-Oct-2007  garbled branches: 1.14.16; 1.14.18; 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 07-Sep-2007  lukem Fix caddr_t fallout; use "uint8_t *" as the type for sc_intack because that
seems it will result in the closest behaviour to that of the caddr_t
abusing code (which did, amongst other things, " *sc->sc_intack = 0; ".)
 1.12 04-Mar-2007  christos branches: 1.12.2; 1.12.10; 1.12.14; 1.12.18; 1.12.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 02-Oct-2002  thorpej branches: 1.11.22; 1.11.60; 1.11.62;
Use CFATTACH_DECL().
 1.10 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.9 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.8 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.7 23-Jan-2000  aymeric branches: 1.7.8; 1.7.12;
sync with new bus.h
 1.6 30-Dec-1999  is Rewrite of the Amiga bus_space machinery to prepare for the support of
the generic IDE driver and the PCMCIA slots.
 1.5 16-Feb-1999  is branches: 1.5.8;
Fix Copyright dates
 1.4 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.3 10-Jan-1999  tron Don't use void pointer for arithmetic.
 1.2 12-Jan-1998  thorpej Adjust for changes to config.
 1.1 16-Oct-1997  is TMS320AV110 (mpeg layer 2 decoder chip) and ZBUS Melody board, which uses it.
No optionboards yet for Melody, only audio driver.
MPEG data types for audio.c
 1.5.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.7.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.7.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.7.8.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.7.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.11.62.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.11.60.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.22.2 27-Oct-2007  yamt sync with head.
 1.11.22.1 03-Sep-2007  yamt sync with head.
 1.12.20.1 06-Nov-2007  matt sync with HEAD
 1.12.18.1 02-Oct-2007  joerg Sync with HEAD.
 1.12.14.1 10-Sep-2007  skrll Sync with HEAD.
 1.12.10.1 03-Oct-2007  garbled Sync with HEAD
 1.12.2.1 09-Oct-2007  ad Sync with head.
 1.14.20.1 16-May-2008  yamt sync with head.
 1.14.18.1 18-May-2008  yamt sync with head.
 1.14.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.4.1 20-Nov-2011  jmcneill adapt to audiomp api changes
 1.16.2.2 30-Oct-2012  yamt sync with head
 1.16.2.1 17-Apr-2012  yamt sync with head
 1.17.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.40.1 25-Apr-2019  isaki Adapt to audio2.
- Starting playback in init_output() no longer works.
Introduce sc_active flag instead and do it in start_output().
 1.18.38.1 10-Jun-2019  christos Sync with HEAD
 1.62 08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.61 26-Oct-2022  riastradh branches: 1.61.8;
amiga/mfc(4): Convert to ttylock/ttyunlock.
 1.60 21-Oct-2021  andvar fix various typos, mainly in comments, but also in man pages and log messages.
 1.59 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.58 24-Apr-2021  thorpej branches: 1.58.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.57 25-Jul-2014  dholland branches: 1.57.8; 1.57.18; 1.57.42;
Add d_discard to all struct cdevsw instances I could find.

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

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.55 27-Oct-2012  chs branches: 1.55.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.54 24-Apr-2011  rmind branches: 1.54.4; 1.54.14;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.53 26-Oct-2009  cegger branches: 1.53.4; 1.53.6;
kill extra whitespaces
reviewed by tsutsui@
 1.52 19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.51 18-Mar-2009  cegger bcopy -> memcpy
 1.50 11-Jun-2008  tsutsui branches: 1.50.4; 1.50.10;
Use device_private() and device_lookup_private() to get softc.
 1.49 25-May-2008  ad branches: 1.49.2;
Properly fix the "hanging in tty" bug that was worked around with cv_wakeup()
some time again.
 1.48 19-Nov-2007  ad branches: 1.48.14; 1.48.16; 1.48.18; 1.48.20;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.47 07-Nov-2007  ad Merge tty changes from the vmlocking branch.
 1.46 04-Mar-2007  christos branches: 1.46.2; 1.46.18; 1.46.20; 1.46.24; 1.46.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.45 24-Jan-2007  hubertf branches: 1.45.2;
Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
 1.44 01-Oct-2006  elad More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.43 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!

Also, add forgotten splx() calls in some places.
 1.42 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.41 23-Jul-2006  ad branches: 1.41.4; 1.41.6;
Use the LWP cached credentials where sane.
 1.40 14-May-2006  elad integrate kauth.
 1.39 26-Mar-2006  thorpej Use device_unit().
 1.38 11-Dec-2005  christos branches: 1.38.4; 1.38.6; 1.38.8; 1.38.10; 1.38.12;
merge ktrace-lwp.
 1.37 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.36 13-Jun-2005  jmc branches: 1.36.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.35 25-Apr-2004  matt Constify the speedtab arrays
 1.34 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.33 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.32 23-Oct-2002  jdolecek branches: 1.32.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.31 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 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.28 17-Mar-2002  atatat branches: 1.28.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.27 17-Feb-2002  veego Add a missing ) from an 6 year old cleanup commit (rev 1.10):
s/sizeof(struct mfcp_softc,/sizeof(struct mfcp_softc),/
Noticed by Nagilum on irc.
 1.26 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.25 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.24 30-May-2001  lukem branches: 1.24.2; 1.24.4; 1.24.8;
add missing #include "opt_kgdb.h"
 1.23 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.22 13-Jan-2001  aymeric branches: 1.22.2;
Make these compile again, plus minor aesthetic changes.
 1.21 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.20 01-Sep-1998  mhitch branches: 1.20.12;
Quick fix for TS_WOPEN -> t_wopen change. Compiles and works.
 1.19 12-Jan-1998  thorpej Adjust for changes to config.
 1.18 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.17 13-Oct-1996  christos backout previous kprintf change
 1.16 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.15 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.14 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.13 06-Jun-1996  mhitch Add tty_attach() calls for pstat -t. Closes PR #2519
 1.12 21-Apr-1996  veego branches: 1.12.4;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.11 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.10 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.8 09-Oct-1995  chopps branches: 1.8.2;
add prototypes for isr stuff fixes pr# 1284 and 1569
 1.7 29-Sep-1995  chopps move 040 to hp300 style, use new MI lance ethernet driver
a few minor fixes WRT prototypes.
if_le from Charles rest from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 04-Jul-1995  chopps misc cleanup, better tty alloc for mfc. from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 23-Apr-1995  chopps bring up-to-date with recent conf.c and sunos changes.
 1.4 02-Apr-1995  chopps cleanup SG4_, fix magnum interrupts, gvp hack for ziii, new gvp configs, 4066
4066 interrupt fix, add baudrate gen and don't clear other port lines for mfc
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.3 02-Mar-1995  chopps fix long standing bug with A2091 and dma.
Move the copy from bounce buffer after dmafree() in the case of
the A2091 this allows the dma fifo to be flushed.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.1 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8.2.1 20-Oct-1995  chopps take a couple devices from needs-count to needs-flag.
move tty pointers to softc structs
loadbsd now fails if it cannot allocate enough chipmem.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.12.4.1 06-Jun-1996  mhitch Pull up from trunk:
> Add tty_attach() calls for pstat -t. Closes PR #2519
 1.20.12.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.20.12.1 22-Nov-2000  bouyer Sync with HEAD.
 1.22.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.24.8.6 11-Nov-2002  nathanw Catch up to -current
 1.24.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.24.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.24.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.24.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.24.8.1 30-May-2001  nathanw file mfc.c was added on branch nathanw_sa on 2002-02-28 04:06:52 +0000
 1.24.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.24.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.24.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.24.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.24.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.24.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.28.4.1 16-May-2002  gehenna Add the character device switch.
Replace the direct-access to devsw table with calling devsw API.
 1.32.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.32.6.4 21-Nov-2004  skrll Adapt to branch.
 1.32.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.6.1 03-Aug-2004  skrll Sync with HEAD
 1.36.2.6 07-Dec-2007  yamt sync with head
 1.36.2.5 15-Nov-2007  yamt sync with head.
 1.36.2.4 03-Sep-2007  yamt sync with head.
 1.36.2.3 26-Feb-2007  yamt sync with head.
 1.36.2.2 30-Dec-2006  yamt sync with head.
 1.36.2.1 21-Jun-2006  yamt sync with head.
 1.38.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.38.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.38.10.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.38.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.38.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.38.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.38.8.3 11-Aug-2006  yamt sync with head
 1.38.8.2 24-May-2006  yamt sync with head.
 1.38.8.1 01-Apr-2006  yamt sync with head.
 1.38.6.2 01-Jun-2006  kardel Sync with head.
 1.38.6.1 22-Apr-2006  simonb Sync with head.
 1.38.4.1 09-Sep-2006  rpaulo sync with head
 1.41.6.1 22-Oct-2006  yamt sync with head
 1.41.4.2 01-Feb-2007  ad Sync with head.
 1.41.4.1 18-Nov-2006  ad Sync with head.
 1.45.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.46.26.2 08-Dec-2007  mjf Sync with HEAD.
 1.46.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.46.24.2 21-Nov-2007  bouyer Sync with HEAD
 1.46.24.1 13-Nov-2007  bouyer Sync with HEAD
 1.46.20.2 09-Jan-2008  matt sync with HEAD
 1.46.20.1 08-Nov-2007  matt sync with -HEAD
 1.46.18.2 21-Nov-2007  joerg Sync with HEAD.
 1.46.18.1 11-Nov-2007  joerg Sync with HEAD.
 1.46.2.1 03-Dec-2007  ad Sync with HEAD.
 1.48.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.48.18.3 11-Mar-2010  yamt sync with head
 1.48.18.2 20-Jun-2009  yamt sync with head
 1.48.18.1 04-May-2009  yamt sync with head.
 1.48.16.2 17-Jun-2008  yamt sync with head.
 1.48.16.1 04-Jun-2008  yamt sync with head
 1.48.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.48.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.49.2.1 18-Jun-2008  simonb Sync with head.
 1.50.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.53.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.53.4.1 31-May-2011  rmind sync with head
 1.54.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.54.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.54.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.54.4.1 30-Oct-2012  yamt sync with head
 1.55.2.1 18-May-2014  rmind sync with head
 1.56.2.1 10-Aug-2014  tls Rebase.
 1.57.42.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.57.18.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.57.8.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.57.8.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.58.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.61.8.1 02-Aug-2025  perseant Sync with HEAD
 1.48 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.47 24-Apr-2021  thorpej branches: 1.47.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.46 27-Oct-2012  chs branches: 1.46.18; 1.46.28; 1.46.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.45 20-Dec-2010  matt branches: 1.45.8; 1.45.18;
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.44 19-May-2009  phx branches: 1.44.4;
Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.43 13-Jun-2008  cegger use device_lookup_private to get softc
 1.42 05-Mar-2007  he branches: 1.42.40; 1.42.42; 1.42.44; 1.42.46; 1.42.48;
Use char* for pointer arithmetic.
 1.41 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.40 08-Mar-2006  lukem branches: 1.40.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.39 11-Dec-2005  christos branches: 1.39.4; 1.39.6; 1.39.8; 1.39.10;
merge ktrace-lwp.
 1.38 28-Mar-2004  mhitch branches: 1.38.16;
Remove license clauses 3 and 4 in my licenses.
 1.37 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.36 09-Apr-2003  thorpej branches: 1.36.2;
Use PAGE_SIZE rather than NBPG.
 1.35 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.34 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.33 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.32 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.31 25-Apr-2001  bouyer branches: 1.31.2; 1.31.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.30 10-Jan-1999  tron branches: 1.30.8; 1.30.20;
Don't use void pointer for arithmetic.
 1.29 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.28 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.27 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.26 12-Jan-1998  thorpej Adjust for changes to config.
 1.25 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.24 23-Dec-1996  veego branches: 1.24.8; 1.24.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.23 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.22 13-Oct-1996  christos backout previous kprintf change
 1.21 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.20 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.19 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.18 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.17 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.16 15-Mar-1996  mhitch Correct 53c710 initialization for the A4000T. Remove the A4000T probe
debugging output.
 1.15 09-Oct-1995  chopps add prototypes for isr stuff fixes pr# 1284 and 1569
 1.14 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.13 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.12 02-Apr-1995  chopps cleanup SG4_, fix magnum interrupts, gvp hack for ziii, new gvp configs, 4066
4066 interrupt fix, add baudrate gen and don't clear other port lines for mfc
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.11 05-Mar-1995  chopps add recognition of GVP 530 and change magnum scsi interrupt level to 6
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.10 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.9 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 27-Sep-1994  chopps branches: 1.5.2;
Fix serious typo.
 1.4 16-Jun-1994  chopps branches: 1.4.2;
fix boot diag output.
 1.3 14-Jun-1994  chopps don't flush cache on context switches for 040's, reduce flushing
on dma operations. code from me and Michael Hitch
 1.2 12-May-1994  chopps update from osymh@gemini.oscs.montana.edu (Michael L. Hitch) add support
for zthreebus siop scsi drivers and better machine recocgnition.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.4.2.1 29-Sep-1994  cgd from trunk, per chopps.
 1.5.2.2 27-Sep-1994  chopps Fix serious typo.
 1.5.2.1 27-Sep-1994  chopps file mgnsc.c was added on branch netbsd-1-0 on 1994-09-27 05:08:00 +0000
 1.24.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.24.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.30.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.30.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.31.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.31.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.31.8.1 25-Apr-2001  nathanw file mgnsc.c was added on branch nathanw_sa on 2002-02-28 04:06:53 +0000
 1.31.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.31.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.36.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.36.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.36.2.1 03-Aug-2004  skrll Sync with HEAD
 1.38.16.2 03-Sep-2007  yamt sync with head.
 1.38.16.1 21-Jun-2006  yamt sync with head.
 1.39.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.39.8.1 13-Mar-2006  yamt sync with head.
 1.39.6.1 22-Apr-2006  simonb Sync with head.
 1.39.4.1 09-Sep-2006  rpaulo sync with head
 1.40.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.42.48.1 18-Jun-2008  simonb Sync with head.
 1.42.46.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.42.44.2 20-Jun-2009  yamt sync with head
 1.42.44.1 04-May-2009  yamt sync with head.
 1.42.42.1 17-Jun-2008  yamt sync with head.
 1.42.40.1 29-Jun-2008  mjf Sync with HEAD.
 1.44.4.1 05-Mar-2011  rmind sync with head
 1.45.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.45.8.1 30-Oct-2012  yamt sync with head
 1.46.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.46.28.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.46.18.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.46.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.47.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 25-Mar-1994  chopps move HIST out of DEBUG conditional.
 1.1 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.34 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.33 24-Apr-2021  thorpej branches: 1.33.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.32 22-Jan-2014  christos branches: 1.32.44;
gcc-4.8.x unused variable fixes
 1.31 27-Oct-2012  chs branches: 1.31.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.30 11-Dec-2005  christos branches: 1.30.112; 1.30.122;
merge ktrace-lwp.
 1.29 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.28 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.27 02-Oct-2002  thorpej branches: 1.27.6;
Use CFATTACH_DECL().
 1.26 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.25 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.24 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.23 25-Apr-2001  bouyer branches: 1.23.2; 1.23.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.22 05-Dec-1998  mjacob branches: 1.22.10; 1.22.22;
Update HBAs to incorporate the new max_lun property.
 1.21 28-Nov-1998  is Fix typo.
 1.20 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.19 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.18 12-Jan-1998  thorpej Adjust for changes to config.
 1.17 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.16 23-Dec-1996  veego branches: 1.16.8; 1.16.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.15 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.14 13-Oct-1996  christos backout previous kprintf change
 1.13 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.12 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.11 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.10 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.9 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.8 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.7 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 29-May-1994  chopps 5380 driver update from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.16.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.16.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.22.22.1 21-Jun-2001  nathanw Catch up to -current.
 1.22.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.23.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.23.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.23.8.1 25-Apr-2001  nathanw file mlhsc.c was added on branch nathanw_sa on 2002-02-28 04:06:53 +0000
 1.23.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.23.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.27.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.27.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.27.6.1 03-Aug-2004  skrll Sync with HEAD
 1.30.122.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.30.112.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.112.1 30-Oct-2012  yamt sync with head
 1.31.2.1 18-May-2014  rmind sync with head
 1.32.44.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.33.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.5 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.4 24-Apr-2021  thorpej branches: 1.4.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.3 04-Oct-2017  rkujawa branches: 1.3.2; 1.3.20;
Update driver to support firmware v1.5+.

From Lukas F. Hartmann. With hopeful style fixes from me.
 1.2 23-Oct-2016  phx branches: 1.2.2;
Fixed WSCONS kernels. The cnprobe function must only be called when
MNTVA_CONSOLE is defined.
 1.1 03-Oct-2016  rkujawa branches: 1.1.2;
Add a driver for MNTMN VA2000.

Supports accelerated wsdisplay console and running X via wsfb driver.
 1.1.2.3 05-Dec-2016  skrll Sync with HEAD
 1.1.2.2 05-Oct-2016  skrll Sync with HEAD
 1.1.2.1 03-Oct-2016  skrll file mntva.c was added on branch nick-nhusb on 2016-10-05 20:55:24 +0000
 1.2.2.2 04-Nov-2016  pgoyette Sync with HEAD
 1.2.2.1 23-Oct-2016  pgoyette file mntva.c was added on branch pgoyette-localcount on 2016-11-04 14:48:57 +0000
 1.3.20.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.3.2.2 03-Dec-2017  jdolecek update from HEAD
 1.3.2.1 04-Oct-2017  jdolecek file mntva.c was added on branch tls-maxphys on 2017-12-03 11:35:48 +0000
 1.4.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.2 04-Oct-2017  rkujawa branches: 1.2.2;
Update driver to support firmware v1.5+.

From Lukas F. Hartmann. With hopeful style fixes from me.
 1.1 03-Oct-2016  rkujawa branches: 1.1.2; 1.1.4;
Add a driver for MNTMN VA2000.

Supports accelerated wsdisplay console and running X via wsfb driver.
 1.1.4.2 04-Nov-2016  pgoyette Sync with HEAD
 1.1.4.1 03-Oct-2016  pgoyette file mntvareg.h was added on branch pgoyette-localcount on 2016-11-04 14:48:57 +0000
 1.1.2.2 05-Oct-2016  skrll Sync with HEAD
 1.1.2.1 03-Oct-2016  skrll file mntvareg.h was added on branch nick-nhusb on 2016-10-05 20:55:24 +0000
 1.2.2.2 03-Dec-2017  jdolecek update from HEAD
 1.2.2.1 04-Oct-2017  jdolecek file mntvareg.h was added on branch tls-maxphys on 2017-12-03 11:35:48 +0000
 1.2 04-Oct-2017  rkujawa branches: 1.2.2;
Update driver to support firmware v1.5+.

From Lukas F. Hartmann. With hopeful style fixes from me.
 1.1 03-Oct-2016  rkujawa branches: 1.1.2; 1.1.4;
Add a driver for MNTMN VA2000.

Supports accelerated wsdisplay console and running X via wsfb driver.
 1.1.4.2 04-Nov-2016  pgoyette Sync with HEAD
 1.1.4.1 03-Oct-2016  pgoyette file mntvavar.h was added on branch pgoyette-localcount on 2016-11-04 14:48:57 +0000
 1.1.2.2 05-Oct-2016  skrll Sync with HEAD
 1.1.2.1 03-Oct-2016  skrll file mntvavar.h was added on branch nick-nhusb on 2016-10-05 20:55:24 +0000
 1.2.2.2 03-Dec-2017  jdolecek update from HEAD
 1.2.2.1 04-Oct-2017  jdolecek file mntvavar.h was added on branch tls-maxphys on 2017-12-03 11:35:48 +0000
 1.43 01-Aug-2022  rin ms_wscons_ioctl(): Return EPASSTHROUGH instead of -1, for unsupported
ioctl, as done for other backends of wsmouse(4).
 1.42 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.41 03-Jun-2021  rin branches: 1.41.2;
kbd(4) and ms(4) carry multiple interface attributes. They are configurable
both as standalone drivers for legacy framebuffer console, or parents of
wskbd(4) and wsmouse(4), respectively. For the latter, be explicit about
using "wskbddev" and "wsmousedev" interface attributes for children.
 1.40 24-Apr-2021  thorpej branches: 1.40.2; 1.40.6;
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 25-Jul-2014  dholland branches: 1.39.8; 1.39.18; 1.39.42;
Add d_discard to all struct cdevsw instances I could find.

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

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.37 27-Oct-2012  chs branches: 1.37.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.36 14-Mar-2009  dsl branches: 1.36.12; 1.36.22;
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.35 12-Jan-2009  mhitch branches: 1.35.2;
Retain compatibility with old firm_event. Old Xamiga binary now works with
-current kernel.
 1.34 28-Dec-2007  joerg branches: 1.34.6; 1.34.10; 1.34.18;
Prepare for timecounter support on amiga.
 1.33 17-Oct-2007  garbled branches: 1.33.2; 1.33.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.32 09-Jul-2007  ad branches: 1.32.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.31 04-Mar-2007  christos branches: 1.31.2; 1.31.4; 1.31.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30 12-Nov-2006  plunky branches: 1.30.4;
Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
 1.29 11-Dec-2005  christos branches: 1.29.20; 1.29.22;
merge ktrace-lwp.
 1.28 22-Sep-2003  jandberg branches: 1.28.16;
add wscons support to amiga mouse
 1.27 21-Sep-2003  jdolecek cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
the owner of descriptor, according to appropriate sematics
of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
 1.26 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.25 05-Feb-2003  perry branches: 1.25.2;
"Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
 1.24 23-Oct-2002  jdolecek merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 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 28-Jan-2002  aymeric branches: 1.20.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.19 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.18 18-May-2000  is branches: 1.18.6; 1.18.8; 1.18.12;
Initialize hardware for mouse mode at open time.
This fixes MB2 and MB3 on the 2nd mouse port (the first is initialized by
the Amiga ROM at boot time).
 1.17 18-May-2000  kleink Restructure the ms(4) autoconfiguration code to attach as a single device
instance and select a mouse port via the least significant bit of its
device minor number. Fixes abuse of cf_unit in this driver.
 1.16 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.15 12-Jan-1998  thorpej branches: 1.15.14;
Adjust for changes to config.
 1.14 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.13 13-Oct-1996  christos backout previous kprintf change
 1.12 11-Oct-1996  mhitch Changes for poll(2).
 1.11 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.10 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.9 24-Apr-1996  is Make the Amiga mainboard mice, which used to be pseudo-devices, real devices.
(We want to support Amigoids without this interface in the near future.)
 1.8 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.7 10-Apr-1995  mycroft Nuke write routines.
 1.6 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 05-Jun-1994  chopps add grfrh (retina ziii) from Donn Cave <donn@u.washington.edu>
light cleanup from me. floppy changes, should now be solid.
some changes to ite and ms to fix a couple bugs report by Donn.
 1.3 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.15.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.18.12.4 11-Nov-2002  nathanw Catch up to -current
 1.18.12.3 18-Oct-2002  nathanw Catch up to -current.
 1.18.12.2 17-Sep-2002  nathanw Catch up to -current.
 1.18.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.18.8.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.18.8.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.18.8.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.18.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.20.8.1 16-May-2002  gehenna Add the character device switch.
 1.25.2.4 21-Nov-2004  skrll Adapt to branch.
 1.25.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.16.4 21-Jan-2008  yamt sync with head
 1.28.16.3 03-Sep-2007  yamt sync with head.
 1.28.16.2 30-Dec-2006  yamt sync with head.
 1.28.16.1 21-Jun-2006  yamt sync with head.
 1.29.22.1 10-Dec-2006  yamt sync with head.
 1.29.20.1 18-Nov-2006  ad Sync with head.
 1.30.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.31.10.1 03-Oct-2007  garbled Sync with HEAD
 1.31.4.1 11-Jul-2007  mjf Sync with head.
 1.31.2.1 15-Jul-2007  ad Sync with head.
 1.32.10.2 09-Jan-2008  matt sync with HEAD
 1.32.10.1 06-Nov-2007  matt sync with HEAD
 1.33.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.33.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.34.18.2 28-Apr-2009  skrll Sync with HEAD.
 1.34.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.34.10.1 04-May-2009  yamt sync with head.
 1.34.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.35.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.22.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.36.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.36.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.36.12.1 30-Oct-2012  yamt sync with head
 1.37.2.1 18-May-2014  rmind sync with head
 1.38.2.1 10-Aug-2014  tls Rebase.
 1.39.42.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.39.18.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.39.8.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.40.6.1 06-Jun-2021  cjep sync with head
 1.40.2.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.41.2.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.48 26-Oct-2022  riastradh amiga/msc(4): Convert to ttylock/ttyunlock.
 1.47 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

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

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.45 27-Oct-2012  chs branches: 1.45.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.44 03-Jun-2011  matt branches: 1.44.2; 1.44.12;
CFATTACH_DECL_NEW, device_t, cfdata_t
 1.43 24-Apr-2011  rmind branches: 1.43.2;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.42 25-May-2010  jklos branches: 1.42.2;
For some reason the 6502 clock detection routine takes 1553 iterations
of the delay loop to finish on a normally clocked A2232.
 1.41 25-May-2008  ad branches: 1.41.18; 1.41.20;
Properly fix the "hanging in tty" bug that was worked around with cv_wakeup()
some time again.
 1.40 19-Nov-2007  ad branches: 1.40.14; 1.40.16; 1.40.18; 1.40.20;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.39 07-Nov-2007  ad Merge tty changes from the vmlocking branch.
 1.38 04-Mar-2007  christos branches: 1.38.2; 1.38.18; 1.38.20; 1.38.24; 1.38.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.36 01-Oct-2006  elad branches: 1.36.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.35 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.34 23-Jul-2006  ad branches: 1.34.4; 1.34.6;
Use the LWP cached credentials where sane.
 1.33 14-May-2006  elad integrate kauth.
 1.32 26-Mar-2006  thorpej Use device_unit().
 1.31 11-Dec-2005  christos branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10; 1.31.12;
merge ktrace-lwp.
 1.30 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.29 13-Jun-2005  jmc branches: 1.29.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.28 25-Apr-2004  matt Constify the speedtab arrays
 1.27 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.26 23-Oct-2002  jdolecek branches: 1.26.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.25 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.24 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.23 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.22 17-Mar-2002  atatat branches: 1.22.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.21 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.20 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.19 19-Jun-2001  wiz branches: 1.19.2; 1.19.4; 1.19.8;
`existent', not `existant'
 1.18 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.17 13-Jan-2001  aymeric branches: 1.17.2;
Make these compile again, plus minor aesthetic changes.
 1.16 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.15 01-Sep-1998  mhitch branches: 1.15.12;
Quick fix for TS_WOPEN -> t_wopen change. Compiles, but I can't verify
that it actually works again.
 1.14 12-Jan-1998  thorpej Adjust for changes to config.
 1.13 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.12 20-Dec-1996  veego Disable CD debug output.
 1.11 09-Dec-1996  is New version by Jukka Marin <jmarin@pyy.jmp.fi>, with rewritten (to fix
problems) carrier detect code. Slightly cleaned up by Bernd Ernesti
<veego@netbsd.org>
 1.10 13-Oct-1996  christos backout previous kprintf change
 1.9 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.7 06-Jun-1996  mhitch Add tty_attach() calls for pstat -t. Closes PR #2519
 1.6 21-Apr-1996  veego branches: 1.6.4;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.5 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.4 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.3 02-Feb-1996  mycroft Fix #includes.
 1.2 07-Oct-1995  chopps update to 2232 from Jukka Marin <jmarin@teeri.jmp.fi> and
rhealey@kas.helios.mn.org (Rob Healey)
 1.1 30-Sep-1995  chopps new 2232 multiport serial device from:
Rob Healey <rhealey@kas.helios.mn.org>, Jukka Marin <jmarin@teeri.jmp.fi>,
Timo Rossi <trossi@jyu.fi> and Zik
 1.6.4.2 26-Jan-1997  rat Pullup new version of msc* driver per Ignatios Souvatzis. Fixes lockups
associated with this card.
 1.6.4.1 06-Jun-1996  mhitch Pull up from trunk:
> Add tty_attach() calls for pstat -t. Closes PR #2519
 1.15.12.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.15.12.1 22-Nov-2000  bouyer Sync with HEAD.
 1.17.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.19.8.6 11-Nov-2002  nathanw Catch up to -current
 1.19.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.19.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.19.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.19.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.19.8.1 19-Jun-2001  nathanw file msc.c was added on branch nathanw_sa on 2002-02-28 04:06:53 +0000
 1.19.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.19.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.19.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.19.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.22.4.1 16-May-2002  gehenna Add the character device switch.
 1.26.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.26.6.4 21-Nov-2004  skrll Adapt to branch.
 1.26.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.26.6.1 03-Aug-2004  skrll Sync with HEAD
 1.29.2.6 07-Dec-2007  yamt sync with head
 1.29.2.5 15-Nov-2007  yamt sync with head.
 1.29.2.4 03-Sep-2007  yamt sync with head.
 1.29.2.3 26-Feb-2007  yamt sync with head.
 1.29.2.2 30-Dec-2006  yamt sync with head.
 1.29.2.1 21-Jun-2006  yamt sync with head.
 1.31.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.31.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.31.10.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.31.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.31.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.31.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.31.8.3 11-Aug-2006  yamt sync with head
 1.31.8.2 24-May-2006  yamt sync with head.
 1.31.8.1 01-Apr-2006  yamt sync with head.
 1.31.6.2 01-Jun-2006  kardel Sync with head.
 1.31.6.1 22-Apr-2006  simonb Sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.34.6.1 22-Oct-2006  yamt sync with head
 1.34.4.1 18-Nov-2006  ad Sync with head.
 1.36.4.2 12-Mar-2007  rmind Sync with HEAD.
 1.36.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.38.26.2 08-Dec-2007  mjf Sync with HEAD.
 1.38.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.38.24.2 21-Nov-2007  bouyer Sync with HEAD
 1.38.24.1 13-Nov-2007  bouyer Sync with HEAD
 1.38.20.2 09-Jan-2008  matt sync with HEAD
 1.38.20.1 08-Nov-2007  matt sync with -HEAD
 1.38.18.2 21-Nov-2007  joerg Sync with HEAD.
 1.38.18.1 11-Nov-2007  joerg Sync with HEAD.
 1.38.2.1 03-Dec-2007  ad Sync with HEAD.
 1.40.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.40.18.2 11-Aug-2010  yamt sync with head.
 1.40.18.1 04-May-2009  yamt sync with head.
 1.40.16.1 04-Jun-2008  yamt sync with head
 1.40.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.41.20.3 12-Jun-2011  rmind sync with head
 1.41.20.2 31-May-2011  rmind sync with head
 1.41.20.1 30-May-2010  rmind sync with head
 1.41.18.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.42.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.43.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.44.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.44.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.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.44.2.1 30-Oct-2012  yamt sync with head
 1.45.2.1 18-May-2014  rmind sync with head
 1.46.2.1 10-Aug-2014  tls Rebase.
 1.5 23-Oct-2009  snj Drop 3rd and 4th clauses. Approved by Jukka Marin (copyright holder).
 1.4 26-Jan-2002  aymeric branches: 1.4.122;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.3 09-Dec-1996  is branches: 1.3.42; 1.3.46;
New version by Jukka Marin <jmarin@pyy.jmp.fi>, with rewritten (to fix
problems) carrier detect code. Slightly cleaned up by Bernd Ernesti
<veego@netbsd.org>
 1.2 07-Oct-1995  chopps branches: 1.2.6;
update to 2232 from Jukka Marin <jmarin@teeri.jmp.fi> and
rhealey@kas.helios.mn.org (Rob Healey)
 1.1 30-Sep-1995  chopps new 2232 multiport serial device from:
Rob Healey <rhealey@kas.helios.mn.org>, Jukka Marin <jmarin@teeri.jmp.fi>,
Timo Rossi <trossi@jyu.fi> and Zik
 1.2.6.1 26-Jan-1997  rat Pullup new version of msc* driver per Ignatios Souvatzis. Fixes lockups
associated with this card.
 1.3.46.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.42.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.4.122.1 11-Mar-2010  yamt sync with head
 1.9 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.8 11-Dec-2005  christos branches: 1.8.26;
merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 26-Jan-2002  aymeric branches: 1.6.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.5 09-Dec-1996  is branches: 1.5.42; 1.5.46;
New version by Jukka Marin <jmarin@pyy.jmp.fi>, with rewritten (to fix
problems) carrier detect code. Slightly cleaned up by Bernd Ernesti
<veego@netbsd.org>
 1.4 07-Oct-1995  chopps branches: 1.4.6;
change break val from rhealey@kas.helios.mn.org (Rob Healey)
 1.3 07-Oct-1995  chopps update to 2232 from Jukka Marin <jmarin@teeri.jmp.fi> and
rhealey@kas.helios.mn.org (Rob Healey)
 1.2 30-Sep-1995  chopps some style cleanup
 1.1 30-Sep-1995  chopps new 2232 multiport serial device from:
Rob Healey <rhealey@kas.helios.mn.org>, Jukka Marin <jmarin@teeri.jmp.fi>,
Timo Rossi <trossi@jyu.fi> and Zik
 1.4.6.1 26-Jan-1997  rat Pullup new version of msc* driver per Ignatios Souvatzis. Fixes lockups
associated with this card.
 1.5.46.1 28-Feb-2002  nathanw Catch up to -current.
 1.5.42.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.16.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 26-Feb-2007  yamt sync with head.
 1.8.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.35 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.34 24-Apr-2021  thorpej branches: 1.34.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.33 22-Jan-2014  christos branches: 1.33.44;
gcc-4.8.x unused variable fixes
 1.32 27-Oct-2012  chs branches: 1.32.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.31 11-Dec-2005  christos branches: 1.31.112; 1.31.122;
merge ktrace-lwp.
 1.30 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.29 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.28 02-Oct-2002  thorpej branches: 1.28.6;
Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.25 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.24 25-Apr-2001  bouyer branches: 1.24.2; 1.24.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.23 10-Jan-1999  tron branches: 1.23.8; 1.23.20;
Don't use void pointer for arithmetic.
 1.22 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.21 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.20 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.19 12-Jan-1998  thorpej Adjust for changes to config.
 1.18 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.17 23-Dec-1996  veego branches: 1.17.8; 1.17.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.16 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.15 13-Oct-1996  christos backout previous kprintf change
 1.14 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.12 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.11 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.10 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.7 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 29-May-1994  chopps 5380 driver update from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.17.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.17.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.23.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.23.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.24.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.24.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.24.8.1 25-Apr-2001  nathanw file otgsc.c was added on branch nathanw_sa on 2002-02-28 04:06:55 +0000
 1.24.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.24.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.28.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.6.1 03-Aug-2004  skrll Sync with HEAD
 1.31.122.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.31.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.31.112.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.31.112.1 30-Oct-2012  yamt sync with head
 1.32.2.1 18-May-2014  rmind sync with head
 1.33.44.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.34.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 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 27-Oct-2012  chs branches: 1.4.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.3 12-Feb-2012  matt branches: 1.3.4; 1.3.6; 1.3.10;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.2 19-Jan-2012  rkujawa Tons of enchancements to MD PCI code:
- The G-REX 4000 and G-REX 1200 are now really supported and working (still only 1st slot but the rest are a matter of time).
- Add bridge identification to p5pb, simplifies the driver and make it more user-friendly.
- Retire P5PB_GENFB and P5PB_OLD_FIRMWARE options, these are now handled automatically, depending on used hardware and firmware.
- Add PCI bus reconfiguration support to p5pb (PCI_NETBSD_CONFIGURE), allows using G-REX without boot to AmigaOS.
- Bring p5pb registers desription up to date with my knowledge.
- Add a lot of debugging code to p5pb (enabled by P5PB_DEBUG kernel option).
- Fix PCI_NETBSD_CONFIGURE in mppb (now it really works).
- Fix quirk handling in zbus.
- Update GENERIC.in and regen the kernel configs.
- Misc cleanup.
 1.1 10-Jan-2012  rkujawa Changes to Phase5 hardware support:
- Rework p5pb driver - simplify, cleanup, make more flexible.
- Add p5membar driver, which handles PCI resources autoconfigured by the firmware.
- Introduce intermediate p5bus layer, between zbus and CSPPC/BPPC on-board devices (p5pb, cbiiisc, bppcsc).
- Add experimental G-REX support to p5pb (first slot support only).
- Split CV64/3D PCI bridge support into separate cv3dpb driver (to be committed later).

Approved by phx.
 1.3.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.6.3 30-Oct-2012  yamt sync with head
 1.3.6.2 17-Apr-2012  yamt sync with head
 1.3.6.1 12-Feb-2012  yamt file p5bus.c was added on branch yamt-pagecache on 2012-04-17 00:06:02 +0000
 1.3.4.2 18-Feb-2012  mrg merge to -current.
 1.3.4.1 12-Feb-2012  mrg file p5bus.c was added on branch jmcneill-usbmp on 2012-02-18 07:31:18 +0000
 1.4.52.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 03-Aug-2021  thorpej Adapt to CFARGS().
 1.1 10-Jan-2012  rkujawa branches: 1.1.4; 1.1.6;
Changes to Phase5 hardware support:
- Rework p5pb driver - simplify, cleanup, make more flexible.
- Add p5membar driver, which handles PCI resources autoconfigured by the firmware.
- Introduce intermediate p5bus layer, between zbus and CSPPC/BPPC on-board devices (p5pb, cbiiisc, bppcsc).
- Add experimental G-REX support to p5pb (first slot support only).
- Split CV64/3D PCI bridge support into separate cv3dpb driver (to be committed later).

Approved by phx.
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 10-Jan-2012  yamt file p5busvar.h was added on branch yamt-pagecache on 2012-04-17 00:06:02 +0000
 1.1.4.2 18-Feb-2012  mrg merge to -current.
 1.1.4.1 10-Jan-2012  mrg file p5busvar.h was added on branch jmcneill-usbmp on 2012-02-18 07:31:18 +0000
 1.41 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.40 25-Jul-2014  dholland branches: 1.40.26; 1.40.28;
Add d_discard to all struct cdevsw instances I could find.

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

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.38 27-Oct-2012  chs branches: 1.38.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.37 31-May-2009  phx branches: 1.37.12; 1.37.22;
Fixed format string from %x to %llx for dev_t.
 1.36 17-Oct-2007  garbled branches: 1.36.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.35 09-Jul-2007  ad branches: 1.35.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.34 04-Mar-2007  christos branches: 1.34.2; 1.34.4; 1.34.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.33 16-Feb-2007  ad branches: 1.33.2;
More spllowersoftclock() fallout.
 1.32 26-Mar-2006  thorpej Use device_unit().
 1.31 11-Dec-2005  christos branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10; 1.31.12;
merge ktrace-lwp.
 1.30 07-Aug-2003  agc branches: 1.30.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.29 23-Oct-2002  jdolecek branches: 1.29.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.28 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.25 28-Jan-2002  aymeric branches: 1.25.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.24 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.23 27-Aug-2000  is branches: 1.23.2; 1.23.4; 1.23.8;
Replace one callout handler by using a timeout in tsleep().
1.4.x version of it submitted by Ingolf Koch; translated to 1.5-ish by
myself.
 1.22 23-Apr-2000  mhitch Long term bug finally reared its head: size of device softc was specified
as sizeof(struct device) when amiga switched to new config, and recent
additions of callout structures and a long missing struct device to the
soft structure resulted in kernel panics when attempting to open the builtin
serial port. The callout structure initialization was clearing the serial
port softc data! Fixed by using sizeof(struct par_softc).
 1.21 26-Mar-2000  frueauf Add "struct device sc_dev;" to struct par_softc.

Reviewed by Ignatios Souvatzis.
 1.20 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.19 16-Mar-2000  kleink Kill more broken cf_unit bogons.
 1.18 05-Aug-1999  thorpej branches: 1.18.2;
Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied. Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

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

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX. This platforms still have this bug until their
XXX spl*() functions are fixed.
 1.17 12-Jan-1998  thorpej Adjust for changes to config.
 1.16 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.15 13-Oct-1996  christos backout previous kprintf change
 1.14 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.12 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.11 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.10 26-Oct-1994  cgd new RCS ID format.
 1.9 26-Oct-1994  cgd new RCS ID format.
 1.8 31-May-1994  chopps MIN/MAX->min/max
 1.7 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.6 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.5 11-Feb-1994  chopps ioctl's always pass proc.
 1.4 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.3 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.18.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.23.8.4 11-Nov-2002  nathanw Catch up to -current
 1.23.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.23.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.23.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.23.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.23.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.23.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.25.8.1 16-May-2002  gehenna Add the character device switch.
 1.29.6.4 21-Nov-2004  skrll Adapt to branch.
 1.29.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.29.6.1 03-Aug-2004  skrll Sync with HEAD
 1.30.16.3 03-Sep-2007  yamt sync with head.
 1.30.16.2 26-Feb-2007  yamt sync with head.
 1.30.16.1 21-Jun-2006  yamt sync with head.
 1.31.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.31.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.31.8.1 01-Apr-2006  yamt sync with head.
 1.31.6.1 22-Apr-2006  simonb Sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.33.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.34.10.1 03-Oct-2007  garbled Sync with HEAD
 1.34.4.1 11-Jul-2007  mjf Sync with head.
 1.34.2.1 15-Jul-2007  ad Sync with head.
 1.35.10.1 06-Nov-2007  matt sync with HEAD
 1.36.20.1 20-Jun-2009  yamt sync with head
 1.37.22.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.37.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.37.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.37.12.1 30-Oct-2012  yamt sync with head
 1.38.2.1 18-May-2014  rmind sync with head
 1.39.2.1 10-Aug-2014  tls Rebase.
 1.40.28.1 10-Jun-2019  christos Sync with HEAD
 1.40.26.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 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 26-Oct-1994  cgd branches: 1.5.66;
new RCS ID format.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.5.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.66.1 03-Aug-2004  skrll Sync with HEAD
 1.7 12-Feb-1995  mycroft Clean up deleted files.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 11-Feb-1994  chopps Add missing Id's
 1.4 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 02-Aug-1993  mycroft Add RCS identifiers.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.24 12-Feb-2022  andvar s/epxected/expected/
 1.23 08-Jun-2019  isaki Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.
 1.22 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.21 16-Mar-2019  isaki branches: 1.21.2;
Use C99 style struct initializer to audio_hw_if.
 1.20 22-Jan-2014  christos branches: 1.20.30;
gcc-4.8.x unused variable fixes
 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 23-Nov-2011  jmcneill branches: 1.18.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.17 19-Jul-2011  dyoung branches: 1.17.2; 1.17.4;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.16 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.15 11-Dec-2005  christos branches: 1.15.28; 1.15.74; 1.15.76; 1.15.78;
merge ktrace-lwp.
 1.14 13-Jun-2005  jmc Fix a ton of const/volatile issues shown with new warning flags
 1.13 15-Jan-2005  kent ansify and KNF
 1.12 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.11 09-Nov-2004  kent branches: 1.11.2;
remove mixer setting code in repulse_attach() because ac97_attach() does it
 1.10 29-Oct-2004  yamt constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.9 22-Sep-2004  kent ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case.

PR: kern/26973
 1.8 06-Apr-2003  wiz branches: 1.8.2; 1.8.4;
Respect the law: Use A-law and mu-law as spellings as far as easily possible.
Inspired by Igor Sobrado in PR 19680.
 1.7 08-Oct-2002  kent Sync with the recent ac97 changes.
- AC97_CODEC_DOES_VRA -> AC97_EXT_AUDIO_VRA
- Use ac97_codec_if::get_extcaps()
- Remove VRA/VRM enabling code
 1.6 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.3 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.2 03-Oct-2001  augustss branches: 1.2.4;
Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
 1.1 25-Aug-2001  is branches: 1.1.2; 1.1.4;
Driver for the ALiENDESiGN Repulse board.
- only 8/16 bit precision supported
- no support for the Repulse special S/P-DIF I/O yet
- I think ac97.c needs some work.
 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 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 25-Aug-2001  thorpej file repulse.c was added on branch kqueue on 2001-09-13 01:13:00 +0000
 1.1.2.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.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 03-Oct-2001  nathanw file repulse.c was added on branch nathanw_sa on 2002-02-28 04:06:56 +0000
 1.8.4.1 22-Sep-2004  jmc Pullup rev 1.9 (requested by kent in ticket #867)

ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case. PR#26973
 1.8.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.4 17-Jan-2005  skrll Sync with HEAD.
 1.8.2.3 14-Nov-2004  skrll Sync with HEAD.
 1.8.2.2 02-Nov-2004  skrll Sync with HEAD.
 1.8.2.1 24-Sep-2004  skrll Sync with HEAD.
 1.11.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.11.2.1 03-Jan-2005  kent * adopt the filter pipeline framework.
* repulse.c follows ac97_attach() change
 1.15.78.1 16-May-2008  yamt sync with head.
 1.15.76.1 18-May-2008  yamt sync with head.
 1.15.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.28.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.17.4.3 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.17.4.2 20-Nov-2011  mrg complete the port to audiomp: don't forget to take sc_intr_lock in the
hardware interrupt routines.
 1.17.4.1 20-Nov-2011  mrg port this to audiomp branch. no allocm/freem here, no detach, so just
add/initialise sc_lock and sc_intr_lock, and add get_locks() support.

XXX: untested, but amiga kernels compile now.
 1.17.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.17.2.2 30-Oct-2012  yamt sync with head
 1.17.2.1 17-Apr-2012  yamt sync with head
 1.18.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.19.2.1 18-May-2014  rmind sync with head
 1.20.30.1 10-Jun-2019  christos Sync with HEAD
 1.21.2.2 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.21.2.1 21-Apr-2019  isaki Adapt to audio2.
 1.2 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.1 25-Aug-2001  is branches: 1.1.4; 1.1.8;
Driver for the ALiENDESiGN Repulse board.
- only 8/16 bit precision supported
- no support for the Repulse special S/P-DIF I/O yet
- I think ac97.c needs some work.
 1.1.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.8.1 25-Aug-2001  nathanw file repulse_firmware.h was added on branch nathanw_sa on 2002-02-28 04:06:56 +0000
 1.1.4.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 25-Aug-2001  thorpej file repulse_firmware.h was added on branch kqueue on 2001-09-13 01:13:00 +0000
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 22-Apr-1994  chopps Changed fonts. Added 2 non (c) fonts kf_8x{8,11}.c retina now uses
kf_8x8. CC console users can now choose between the provided fonts
or provide there own.
 1.2 11-Feb-1994  chopps Add missing Id's
 1.1 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 01-Mar-1995  mycroft Clean up deleted files.
 1.1 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.10 14-Nov-2012  rkujawa Nuke unused clock struct, was used by a2kbbc before conversion to MI msm6242b
driver.
 1.9 14-May-2002  matt branches: 1.9.150; 1.9.160;
Eliminate commons. (including a few unused or mismatched ones).
 1.8 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.7 03-Jan-2000  is branches: 1.7.8; 1.7.12;
The Ricoh chip has a seperate leapyear counter.
We must write this when we write the year register, keeping them in sync.
XXX the chosen algorithm only works for 1901 <= year <= 2099.
 1.6 14-Mar-1999  is branches: 1.6.2; 1.6.8;
Use the 1/256s-resolution when reading the DraCo battery backed clock
 1.5 17-Jul-1997  is Make the DraCo hardware clock an autoconfiguration device.
 1.4 25-May-1997  veego Remove some defines which are no longer needed.
clock.c uses now sys/dev/clock_subr.[ch].
 1.3 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.6.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.6.2.1 08-Jan-2000  he Pull up revision 1.7 (requested by is):
Write the Ricoh RP5C01 leapyear bits when writing the year.
 1.7.12.2 20-Jun-2002  nathanw Catch up to -current.
 1.7.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.7.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.9.160.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.150.1 16-Jan-2013  yamt sync with (a bit old) head
 1.5 01-Mar-1995  mycroft Clean up deleted files.
 1.4 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.5 01-Mar-1995  mycroft Clean up deleted files.
 1.4 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.4 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.3 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.2 26-Oct-1994  cgd branches: 1.2.46; 1.2.50;
new RCS ID format.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2.50.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.46.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.3 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.2 26-Oct-1994  cgd branches: 1.2.46; 1.2.50;
new RCS ID format.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2.50.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.46.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 07-Feb-1994  mycroft Clean up deleted files.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.75 09-Mar-2016  christos PR/50928: David Binderman: Clarify precedence with parentheses.
 1.74 19-Jan-2015  phx Make it compile with -DDEBUG again.
 1.73 07-Aug-2014  joerg branches: 1.73.2; 1.73.4; 1.73.8;
Drop extra ().
 1.72 22-Jan-2014  christos branches: 1.72.2;
gcc-4.8.x unused variable fixes
 1.71 27-Oct-2012  chs branches: 1.71.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.70 07-Jul-2011  mrg branches: 1.70.2; 1.70.12;
apply some parens around an expression to get the desired behaviour,
as suggested by gcc 4.5
 1.69 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.68 18-Oct-2010  phx opt_m68k_arch.h can only be included when compiling for amiga/68k.
 1.67 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.66 05-Feb-2010  phx branches: 1.66.2; 1.66.4;
Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.65 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.64 18-Mar-2009  cegger bcopy -> memcpy
 1.63 18-Mar-2009  cegger bzero -> memset
 1.62 17-Oct-2007  garbled branches: 1.62.20; 1.62.28; 1.62.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.61 20-Aug-2007  is branches: 1.61.2;
First part of amigappc support patches by Frank Wille.
 1.60 09-Jul-2007  ad branches: 1.60.4; 1.60.8;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.59 04-Mar-2007  christos branches: 1.59.2; 1.59.4; 1.59.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.58 13-Sep-2006  spz branches: 1.58.6;
change the variable name in the CSR_TRACE macro so it doesn't collide with
a previous definition of 's' (which makes gcc4 warn)
Reviewed by <is>.
 1.57 08-Mar-2006  lukem branches: 1.57.10;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.56 11-Dec-2005  christos branches: 1.56.4; 1.56.6; 1.56.8; 1.56.10;
merge ktrace-lwp.
 1.55 13-Jun-2005  jmc branches: 1.55.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.54 22-May-2005  christos No 0x in front of %p...
 1.53 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.52 18-Jun-2003  drochner branches: 1.52.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.51 03-May-2003  wiz DMA, not dma nor Dma.
 1.50 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.49 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.48 30-May-2002  thorpej Remove unnecessary assignments (for which the operation may be
undefined).
 1.47 30-May-2002  thorpej Nuke a trigraph.
 1.46 28-Jan-2002  aymeric branches: 1.46.8; 1.46.10;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.45 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.44 22-Jul-2001  wiz branches: 1.44.6;
seperate -> separate
 1.43 25-Apr-2001  bouyer branches: 1.43.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.42 29-Jun-2000  mrg branches: 1.42.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.41 27-Jun-2000  mrg remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h>
 1.40 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.39 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.38 18-Jan-2000  thorpej Remove one line of junk.
 1.37 01-Nov-1999  is Don't call the sc->sbic_dmago() function if the data length is zero.
This avoids a zero pointer dereference, which fixes PR 8571.
Make sbic_dmago() report selection timeouts to the upper layer.
This makes sbic really work again with 1.4L.
 1.36 04-Oct-1999  is branches: 1.36.2; 1.36.4; 1.36.6;
Make this compile with -DDEBUG again.
 1.35 30-Sep-1999  thorpej Update for SCSIPI changes.
 1.34 05-Nov-1998  frueauf branches: 1.34.6;
Add braces to make egcs happy.
 1.33 21-Aug-1998  is Prepare for support of Apollo-cpuboard-reworked A3000 mainboard SCSI.
 1.32 04-Jul-1998  jonathan defopt DDB.
 1.31 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.30 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.29 27-Aug-1997  bouyer branches: 1.29.4;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.28 13-Oct-1996  christos branches: 1.28.8; 1.28.10;
backout previous kprintf change
 1.27 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.26 10-Jun-1996  is Activate M68040 cache flushing code also in 68060 only kernels.
 1.25 12-May-1996  mhitch branches: 1.25.4;
Remove old-style disk instrumentation now that iostat, systat, and
vmstat are fixed.
 1.24 01-May-1996  mhitch More cleanup for -Wall with DEBUG.
 1.23 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.22 23-Mar-1996  is It looks like the sense_data structure lost the extended_ prefix in the
name of some of its members. Adapt sbic.c to this. (Fixes PR 2245)
 1.21 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.20 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.19 05-Oct-1995  chopps branches: 1.19.2;
Only enable timeouts (debugging) when actually transfering data.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.18 29-Sep-1995  chopps move 040 to hp300 style, use new MI lance ethernet driver
a few minor fixes WRT prototypes.
if_le from Charles rest from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.17 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.16 04-Sep-1995  chopps sbic and board changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.15 24-Aug-1995  chopps couple fixes from Eduardo E. Horvath eeh@btr.com
 1.14 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.13 12-Aug-1995  mycroft minphys() functions really should return void.
 1.12 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.11 02-Mar-1995  chopps fix long standing bug with A2091 and dma.
Move the copy from bounce buffer after dmafree() in the case of
the A2091 this allows the dma fifo to be flushed.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.10 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.9 26-Jan-1995  chopps apply patch to fix some renagade drives. from Eduardo E. Horvath (eeh@btr.com)
also enable sync by default.
 1.8 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 20-Jun-1994  chopps don't set 040 specific flush flag if not 040 system.
 1.4 15-Jun-1994  chopps clock now uses passed in frequency if present protect dma cache
flush calls from non 040. don't compile ite_xx if not used.
 1.3 14-Jun-1994  chopps don't flush cache on context switches for 040's, reduce flushing
on dma operations. code from me and Michael Hitch
 1.2 12-May-1994  chopps ifdef out use of scsi_xfer->req_sense_length for now..
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.19.2.1 24-Nov-1995  chopps add sync flag to booter and use in scsi devs instead of binpatch
 1.25.4.1 10-Jun-1996  is Pull up bug fix from main branch:
activate M68040 style dma flush also on M68060 only kernels.
 1.28.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.28.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.29.4.1 19-Jan-1999  cgd pull up rev 1.33 from trunk (is)
 1.34.6.1 05-Oct-1999  he Pull up revision 1.36 (requested by is):
Make this compile with -DDEBUG.
 1.36.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.36.4.1 15-Nov-1999  fvdl Sync with -current
 1.36.2.3 29-Mar-2001  bouyer Make these pass a compile test on i386.
 1.36.2.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.36.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.42.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.43.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.43.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.43.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.43.2.1 03-Aug-2001  lukem update to -current
 1.44.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.44.6.3 20-Jun-2002  nathanw Catch up to -current.
 1.44.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.44.6.1 22-Jul-2001  nathanw file sbic.c was added on branch nathanw_sa on 2002-02-28 04:06:58 +0000
 1.46.10.1 30-May-2002  tv Pull up revision 1.47 (requested by thorpej in ticket #96):
Nuke a trigraph.
 1.46.8.1 09-Jul-2002  gehenna catch up with -current.
 1.52.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.52.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.52.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.52.2.1 03-Aug-2004  skrll Sync with HEAD
 1.55.2.3 03-Sep-2007  yamt sync with head.
 1.55.2.2 30-Dec-2006  yamt sync with head.
 1.55.2.1 21-Jun-2006  yamt sync with head.
 1.56.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.56.8.2 14-Sep-2006  yamt sync with head.
 1.56.8.1 13-Mar-2006  yamt sync with head.
 1.56.6.1 22-Apr-2006  simonb Sync with head.
 1.56.4.1 09-Sep-2006  rpaulo sync with head
 1.57.10.1 18-Nov-2006  ad Sync with head.
 1.58.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.59.10.1 03-Oct-2007  garbled Sync with HEAD
 1.59.4.1 11-Jul-2007  mjf Sync with head.
 1.59.2.2 09-Oct-2007  ad Sync with head.
 1.59.2.1 15-Jul-2007  ad Sync with head.
 1.60.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.60.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.61.2.1 06-Nov-2007  matt sync with HEAD
 1.62.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.62.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.62.20.3 11-Aug-2010  yamt sync with head.
 1.62.20.2 11-Mar-2010  yamt sync with head
 1.62.20.1 04-May-2009  yamt sync with head.
 1.66.4.2 05-Mar-2011  rmind sync with head
 1.66.4.1 03-Jul-2010  rmind sync with head
 1.66.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.66.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.70.12.3 03-Dec-2017  jdolecek update from HEAD
 1.70.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.70.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.70.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.70.2.1 30-Oct-2012  yamt sync with head
 1.71.2.1 18-May-2014  rmind sync with head
 1.72.2.1 10-Aug-2014  tls Rebase.
 1.73.8.1 18-Jan-2017  skrll Sync with netbsd-5
 1.73.4.2 19-Mar-2016  skrll Sync with HEAD
 1.73.4.1 06-Apr-2015  skrll Sync with HEAD
 1.73.2.1 03-Jan-2017  snj Pull up following revision(s) (requested by mlelstv in ticket #1345):
sys/arch/amiga/dev/sbic.c: revision 1.74
Make it compile with -DDEBUG again.
 1.9 16-Sep-2021  andvar fix various typos, mainly in comments.
 1.8 05-Feb-2010  phx Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.7 14-May-2006  elad branches: 1.7.66;
integrate kauth.
 1.6 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.5 11-Dec-2005  christos branches: 1.5.4; 1.5.6; 1.5.8; 1.5.10;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc branches: 1.4.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 21-Aug-1998  is branches: 1.3.46;
Prepare for support of Apollo-cpuboard-reworked A3000 mainboard SCSI.
 1.2 26-Oct-1994  cgd branches: 1.2.18;
new RCS ID format.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.2.18.1 19-Jan-1999  cgd pull up rev 1.3 from trunk (is)
 1.3.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.46.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.5.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.5.8.1 13-Mar-2006  yamt sync with head.
 1.5.6.1 22-Apr-2006  simonb Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.7.66.1 11-Mar-2010  yamt sync with head
 1.27 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.26 01-Jan-2022  andvar fix typos in comments, mainly basicly -> basically.
 1.25 27-Dec-2019  msaitoh s/transfered/transferred/
 1.24 27-Oct-2012  chs branches: 1.24.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.23 11-Dec-2005  christos branches: 1.23.112; 1.23.122;
merge ktrace-lwp.
 1.22 07-Dec-2004  thorpej Use "struct scsipi_command" in internal command structures so that
we have enough space for 16-byte CDBs.
 1.21 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.20 03-May-2003  wiz branches: 1.20.2;
DMA, not dma nor Dma.
 1.19 09-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.18 14-May-2002  matt Eliminate commons. (including a few unused or mismatched ones).
 1.17 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.16 25-Apr-2001  bouyer branches: 1.16.2; 1.16.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.15 23-Mar-2000  thorpej branches: 1.15.6;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.14 19-Nov-1998  thorpej branches: 1.14.10;
Adapt to the new scsipi_adapter interface.
 1.13 21-Aug-1998  is Prepare for support of Apollo-cpuboard-reworked A3000 mainboard SCSI.
 1.12 27-Aug-1997  bouyer branches: 1.12.4;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.11 21-Apr-1996  veego branches: 1.11.10; 1.11.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.10 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.9 04-Sep-1995  chopps branches: 1.9.2;
sbic and board changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 12-Aug-1995  mycroft minphys() functions really should return void.
 1.6 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.5 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.4 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 14-Jun-1994  chopps don't flush cache on context switches for 040's, reduce flushing
on dma operations. code from me and Michael Hitch
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.9.2.1 24-Nov-1995  chopps add sync flag to booter and use in scsi devs instead of binpatch
 1.11.12.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.10.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.12.4.1 19-Jan-1999  cgd pull up rev 1.13 from trunk (is)
 1.14.10.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.14.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.15.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.16.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.16.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.16.8.1 25-Apr-2001  nathanw file sbicvar.h was added on branch nathanw_sa on 2002-02-28 04:06:58 +0000
 1.16.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.16.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.20.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.23.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.23.112.1 30-Oct-2012  yamt sync with head
 1.24.38.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.37 10-Feb-2024  andvar s/psuedo/pseudo/ in comments.
 1.36 22-Jan-2014  christos gcc-4.8.x unused variable fixes
 1.35 27-Oct-2012  chs branches: 1.35.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.34 20-Dec-2010  matt branches: 1.34.8; 1.34.18;
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.33 26-Nov-2005  tsutsui branches: 1.33.100;
Fix typo (FALLTHOUGH -> FALLTHROUGH). From Jeff Ito.
 1.32 13-Jun-2005  jmc branches: 1.32.2; 1.32.8;
Fix a ton of const/volatile issues shown with new warning flags
 1.31 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.30 31-Oct-2003  bouyer In sci_scsipi_request, add a splbio() which was erroneously missed when
thorpej_scsipi was integrated. Pointed out by Havard Eidnes.
 1.29 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.28 18-Jun-2003  drochner branches: 1.28.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.27 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.26 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.25 25-Apr-2001  bouyer branches: 1.25.2; 1.25.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.24 29-Jun-2000  mrg branches: 1.24.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.23 26-Jun-2000  mrg remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.22 18-Jan-2000  thorpej Remove one line of junk.
 1.21 30-Sep-1999  thorpej branches: 1.21.2;
Update for SCSIPI changes.
 1.20 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.19 13-Oct-1996  christos branches: 1.19.8; 1.19.10;
backout previous kprintf change
 1.18 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.17 12-May-1996  mhitch Remove old-style disk instrumentation now that iostat, systat, and
vmstat are fixed.
 1.16 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.15 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.14 29-Sep-1995  chopps move 040 to hp300 style, use new MI lance ethernet driver
a few minor fixes WRT prototypes.
if_le from Charles rest from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.13 12-Aug-1995  mycroft minphys() functions really should return void.
 1.12 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.11 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.10 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 26-Oct-1994  cgd new RCS ID format.
 1.7 22-Jun-1994  chopps cleanup from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 29-May-1994  chopps 5380 driver update from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.3 18-Apr-1994  chopps make current with recent vm changes.
 1.2 08-Mar-1994  chopps fix typo.
 1.1 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.19.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.19.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.21.2.3 29-Mar-2001  bouyer Make these pass a compile test on i386.
 1.21.2.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.21.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.24.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.25.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.25.8.1 25-Apr-2001  nathanw file sci.c was added on branch nathanw_sa on 2002-02-28 04:06:59 +0000
 1.25.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.28.2.5 11-Dec-2005  christos Sync with head.
 1.28.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.28.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.2.1 03-Aug-2004  skrll Sync with HEAD
 1.32.8.1 29-Nov-2005  yamt sync with head.
 1.32.2.1 21-Jun-2006  yamt sync with head.
 1.33.100.1 05-Mar-2011  rmind sync with head
 1.34.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.34.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.34.8.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.34.8.1 30-Oct-2012  yamt sync with head
 1.35.2.1 18-May-2014  rmind sync with head
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 03-May-2003  wiz branches: 1.4.2;
DMA, not dma nor Dma.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 29-May-1994  chopps 5380 driver update from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19 07-Apr-2022  andvar s/psuedo/pseudo/
 1.18 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.17 11-Dec-2005  christos branches: 1.17.112; 1.17.122;
merge ktrace-lwp.
 1.16 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.15 03-May-2003  wiz branches: 1.15.2;
DMA, not dma nor Dma.
 1.14 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.13 25-Apr-2001  bouyer branches: 1.13.2; 1.13.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.12 19-Nov-1998  thorpej branches: 1.12.10; 1.12.22;
Adapt to the new scsipi_adapter interface.
 1.11 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.10 28-Apr-1996  mhitch branches: 1.10.10; 1.10.12;
Prototype the pseudo-dma function declarations.
 1.9 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.8 12-Aug-1995  mycroft minphys() functions really should return void.
 1.7 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.6 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.5 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 29-May-1994  chopps 5380 driver update from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.1 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.10.12.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.10.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.12.22.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.10.2 29-Mar-2001  bouyer Make these pass a compile test on i386.
 1.12.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.13.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.13.8.1 25-Apr-2001  nathanw file scivar.h was added on branch nathanw_sa on 2002-02-28 04:06:59 +0000
 1.13.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 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.17.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.17.112.1 30-Oct-2012  yamt sync with head
 1.12 01-Mar-1995  mycroft Clean up deleted files.
 1.11 18-Apr-1994  chopps make current with recent vm changes.
 1.10 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.9 21-Feb-1994  chopps fixed a couple minor bugs in con code for ite. added floptical support in
sd.c (based on patch from Andreas E. Heitman).
 1.8 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.7 11-Feb-1994  chopps Add missing Id's
 1.6 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 30-Oct-1993  mycroft Clean up deleted files.
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.5 19-May-1996  veego - grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.2 11-Feb-1994  chopps Add missing Id's
 1.1 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.8 01-Mar-1995  mycroft Clean up deleted files.
 1.7 11-Feb-1994  chopps Add missing Id's
 1.6 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.9 01-Mar-1995  mycroft Clean up deleted files.
 1.8 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.7 11-Feb-1994  chopps Add missing Id's
 1.6 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.15 25-May-1994  mycroft Clean up deleted files.
 1.14 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.13 18-Apr-1994  chopps make current with recent vm changes.
 1.12 06-Apr-1994  chopps fix to floptical code from
Andreas Heitmann (heitmann@crunch.ikp.physik.th-darmstadt.de)
 1.11 21-Feb-1994  chopps fixed a couple minor bugs in con code for ite. added floptical support in
sd.c (based on patch from Andreas E. Heitman).
 1.10 19-Feb-1994  chopps fix typo.
 1.9 14-Feb-1994  chopps don't ignore users request for specific boot device, reported by Ty Sarna
 1.8 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.7 11-Feb-1994  chopps Add missing Id's
 1.6 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 30-Oct-1993  mycroft Clean up deleted files.
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.86 26-Oct-2022  riastradh ddb/db_active.h: New home for extern db_active.

This can be included unconditionally, and db_active can then be
queried unconditionally; if DDB is not in the kernel, then db_active
is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
 1.85 04-Oct-2022  rin Remove unused extern declaration of constty.
 1.84 21-Oct-2021  andvar fix various typos, mainly in comments, but also in man pages and log messages.
 1.83 25-Jul-2014  dholland branches: 1.83.8; 1.83.18;
Add d_discard to all struct cdevsw instances I could find.

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

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.81 22-Jan-2014  christos gcc-4.8.x unused variable fixes
 1.80 27-Oct-2012  chs branches: 1.80.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.79 24-Apr-2011  rmind branches: 1.79.4; 1.79.14;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.78 11-Jun-2008  tsutsui branches: 1.78.18; 1.78.24;
Use device_private() and device_lookup_private() to get softc.
 1.77 19-Nov-2007  ad branches: 1.77.14; 1.77.16; 1.77.18; 1.77.20; 1.77.22;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.76 04-Mar-2007  christos branches: 1.76.2; 1.76.18; 1.76.20; 1.76.24; 1.76.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.75 01-Oct-2006  elad branches: 1.75.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.74 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.73 23-Jul-2006  ad branches: 1.73.4; 1.73.6;
Use the LWP cached credentials where sane.
 1.72 14-May-2006  elad integrate kauth.
 1.71 11-Dec-2005  christos branches: 1.71.4; 1.71.6; 1.71.8; 1.71.10; 1.71.12;
merge ktrace-lwp.
 1.70 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.69 07-Aug-2003  agc branches: 1.69.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.68 23-Oct-2002  jdolecek branches: 1.68.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.67 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.66 01-Oct-2002  aymeric . treat a stream of framing errors as a single break
. trigger ddb upon receiving a break if we are the console
 1.65 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.64 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.63 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.62 17-Mar-2002  atatat branches: 1.62.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.61 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.60 27-Jan-2002  aymeric make sure we have CLOCAL set and HUPCL unset when the serial port is used as
a console.
 1.59 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.58 05-Nov-2001  aymeric branches: 1.58.2;
defopt SERCONSOLE
 1.57 30-May-2001  lukem branches: 1.57.2; 1.57.4; 1.57.6;
add missing #include "opt_kgdb.h"
 1.56 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.55 13-Jan-2001  aymeric branches: 1.55.2;
Make these compile again, plus minor aesthetic changes.
 1.54 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.53 27-Apr-2000  is Fix thinko in fix for fix for cf_unit abuse.
 1.52 14-Apr-2000  is Make this work again after the last changes...
remember, folks, potential Amiga console devices run autoconfiguration
_twice_.
 1.51 07-Apr-2000  aymeric Prevent serial port from hanging when used as both console and terminal.
 1.50 16-Mar-2000  kleink Kill more broken cf_unit bogons.
 1.49 22-Jul-1998  is branches: 1.49.14;
Back out previous change. It breaks Seyon in a non-obvious way.
 1.48 18-Jul-1998  is Precompute lots of bitmasks etc. in serparam(). Results in slightly better
(but I suspect, insignificant) performance, and also prepares for 8bit +
parity support.
 1.47 07-Jul-1998  is The INTF_RBF bit of INTREQ is mirrored in SERDAT. As we would read this
register anyway when the bit is set, we can safe one of the (slow) custom
chip accesses by using this bit.
Sounds ridiculous, but at a hardware FIFO depth of 1 and ~1 usec per
access (at IPL 5) it might help the highspeed addicts.
 1.46 29-Jun-1998  is Synchronize shadow ciab.pra variable on first open.
 1.45 26-Jun-1998  is Fix a problem with bogus hangups that Thorsten Frueauf has reported.
 1.44 11-Apr-1998  is Make ser.c compile again (preliminary release). It needs still a lot of
cleanup, but at least mainstream usage should be possible again (worked
for me 5 minutes ago).
 1.43 12-Jan-1998  thorpej Adjust for changes to config.
 1.42 04-Oct-1997  mhitch Use a global variable to hold the current speed of the internal serial port.
This will be used by certain SCSI drivers to limit the length of DMA transfers
when the serial port is running at higher speeds. GVP and Phase5 DMA
interfers significantly with CPU execution, and significantly increases
receive buffer overruns (silo overflow). Reducing the DMA transfer length
can reduce the overruns.
 1.41 21-Sep-1997  is Deal with HUPCL, closing (but in a different way than proposed) PR 1010.
 1.40 18-Sep-1997  mhitch Read the received data register before clearing the RBF interrupt. Clearing
RBF appears to also clear the OVRUN bit in the receive data, resulting in
the loss of of overflow status.
 1.39 23-Dec-1996  veego branches: 1.39.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.38 13-Oct-1996  christos backout previous kprintf change
 1.37 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.36 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.35 06-Jun-1996  mhitch Add tty_attach() calls for pstat -t. Closes PR #2519
 1.34 27-Apr-1996  veego branches: 1.34.4;
Make the compiler happy if you make a kernel with -Wall
 1.33 23-Apr-1996  is Protect two critical lines of ser.c with splser(). Without this, a
race condition exists which makes the internal serial drop incoming
characters under heavy load.
 1.32 23-Apr-1996  is Changed the speed calculations of the Amiga-builtin-serial driver to
allow any baudrate the hardware allows, and to forbid two baudrates
(50 and 75) which the hardware does NOT support but which the old
speed conversion table pretended to support.
 1.31 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.30 17-Mar-1996  mhitch Clean up typos and other errors from new device attachment changes.
 1.29 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.28 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.27 23-Apr-1995  chopps branches: 1.27.2;
bring up-to-date with recent conf.c and sunos changes.
 1.26 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.25 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.24 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.23 26-Oct-1994  cgd new RCS ID format.
 1.22 06-Oct-1994  chopps branches: 1.22.2;
fix flow control and a couple bugs. from:
niklas@appli.se (Niklas Hallqvist) and
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.21 31-Aug-1994  chopps cleanup diagnostic messages
 1.20 16-Jun-1994  chopps fix boot diag output.
 1.19 04-Jun-1994  chopps started out cleaning up amiga_init.c ended up touching alot of files.
 1.18 22-May-1994  chopps an ide driver and hack reload device to do symbols.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.17 16-May-1994  chopps remove uneeded function from ser.c and fix common bad arg to sbicintr() in ahsc
and atzsc
 1.16 11-May-1994  chopps general cleanup including boot diag messages.
 1.15 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.14 22-Apr-1994  chopps update to deal with ttyflags from tsarna@endicor.com (Ty Sarna),
major design changes by me which include shrinking of ring buffer
size from 16k to 256 bytes and removing code that realloced the
clists for the tty from default to 8192 (was using 24k) suggested
as suggested by theo.
 1.13 30-Mar-1994  chopps remove dlists.h oops.
 1.12 28-Mar-1994  chopps some scsi changes, 4M system hack, and a boot messgae addition. from
Michael Hitch.
 1.11 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.10 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.9 11-Feb-1994  chopps Add missing Id's
 1.8 11-Feb-1994  chopps ioctl's always pass proc.
 1.7 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.6 30-Jan-1994  chopps Re-enabled views, fixed warning in serial driver.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.22.2.2 06-Oct-1994  chopps fix flow control and a couple bugs. from:
niklas@appli.se (Niklas Hallqvist) and
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.22.2.1 06-Oct-1994  chopps file ser.c was added on branch netbsd-1-0 on 1994-10-06 19:20:56 +0000
 1.27.2.2 23-Apr-1996  is Two fixes:
- add a missing splser()/splx() pair in ser.c. Without it, we used to
drop incoming characters under heavy load.
- delete the entries for 50 and 75 bps from the serspeedtab, as our
hardware doesn't support these speeds.
 1.27.2.1 20-Oct-1995  chopps take a couple devices from needs-count to needs-flag.
move tty pointers to softc structs
loadbsd now fails if it cannot allocate enough chipmem.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.34.4.1 06-Jun-1996  mhitch Pull up from trunk:
> Add tty_attach() calls for pstat -t. Closes PR #2519
 1.39.10.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.39.10.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.49.14.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.49.14.2 22-Nov-2000  bouyer Sync with HEAD.
 1.49.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.55.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.57.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.57.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.57.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.57.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.57.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.57.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.57.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.58.2.6 11-Nov-2002  nathanw Catch up to -current
 1.58.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.58.2.4 17-Sep-2002  nathanw Catch up to -current.
 1.58.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.58.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.58.2.1 05-Nov-2001  nathanw file ser.c was added on branch nathanw_sa on 2002-02-28 04:06:59 +0000
 1.62.4.1 16-May-2002  gehenna Add the character device switch.
Replace the direct-access to devsw table with calling devsw API.
 1.68.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.68.6.4 21-Nov-2004  skrll Adapt to branch.
 1.68.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.68.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.68.6.1 03-Aug-2004  skrll Sync with HEAD
 1.69.16.4 07-Dec-2007  yamt sync with head
 1.69.16.3 03-Sep-2007  yamt sync with head.
 1.69.16.2 30-Dec-2006  yamt sync with head.
 1.69.16.1 21-Jun-2006  yamt sync with head.
 1.71.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.71.10.3 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.71.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.71.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.71.8.2 11-Aug-2006  yamt sync with head
 1.71.8.1 24-May-2006  yamt sync with head.
 1.71.6.1 01-Jun-2006  kardel Sync with head.
 1.71.4.1 09-Sep-2006  rpaulo sync with head
 1.73.6.1 22-Oct-2006  yamt sync with head
 1.73.4.1 18-Nov-2006  ad Sync with head.
 1.75.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.76.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.76.24.1 21-Nov-2007  bouyer Sync with HEAD
 1.76.20.1 09-Jan-2008  matt sync with HEAD
 1.76.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.76.2.1 03-Dec-2007  ad Sync with HEAD.
 1.77.22.1 18-Jun-2008  simonb Sync with head.
 1.77.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.77.18.1 04-May-2009  yamt sync with head.
 1.77.16.1 17-Jun-2008  yamt sync with head.
 1.77.14.1 29-Jun-2008  mjf Sync with HEAD.
 1.78.24.1 06-Jun-2011  jruoho Sync with HEAD.
 1.78.18.1 31-May-2011  rmind sync with head
 1.79.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.79.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.79.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.79.4.1 30-Oct-2012  yamt sync with head
 1.80.2.1 18-May-2014  rmind sync with head
 1.82.2.1 10-Aug-2014  tls Rebase.
 1.83.18.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.83.8.2 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.83.8.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 31-Jan-1999  is branches: 1.8.42;
Wrong sign of dialout.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.5 11-Feb-1994  chopps Add missing Id's
 1.4 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.8.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.42.1 03-Aug-2004  skrll Sync with HEAD
 1.14 05-Oct-1997  veego Unused files after the sfas driver is replaced by the MI ncr53c9x driver.
 1.13 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.12 13-Oct-1996  christos branches: 1.12.8; 1.12.10;
backout previous kprintf change
 1.11 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.10 10-Jun-1996  is Activate M68040 cache flushing code also in 68060 only kernels.
 1.9 23-Apr-1996  veego branches: 1.9.4;
Added some ifdef's for RETINA_SPEED_HACK
Argh, why is a fuction from the RetinaZ2 console driver in the console
driver for the RetinaZ3 ? Fixed.
Fixed some warnings from -Wall if you don't use -DDEBUG
 1.8 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.7 24-Feb-1996  chopps remove floating point expressions. gen_cvtab.c generates a conversion
table to replace a specific floating point expression in grf_cv.c
 1.6 28-Jan-1996  chopps fix loading of 0 to intended value of 256. closes 1871
 1.5 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.4 18-Aug-1995  chopps branches: 1.4.2;
SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.3 12-Aug-1995  mycroft minphys() functions really should return void.
 1.2 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.4.2.2 04-Mar-1996  is Correct attempted word write to byte register (from -current).
 1.4.2.1 24-Nov-1995  chopps add sync flag to booter and use in scsi devs instead of binpatch
 1.9.4.1 10-Jun-1996  is Pull up bug fix from main branch:
activate M68040 style dma flush also on M68060 only kernels.
 1.12.10.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.3 05-Oct-1997  veego Unused files after the sfas driver is replaced by the MI ncr53c9x driver.
 1.2 21-Apr-1996  veego branches: 1.2.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6 05-Oct-1997  veego Unused files after the sfas driver is replaced by the MI ncr53c9x driver.
 1.5 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.4 21-Apr-1996  veego branches: 1.4.10; 1.4.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.3 12-Aug-1995  mycroft minphys() functions really should return void.
 1.2 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.1 12-May-1995  chopps scsi drivers for fastlane and blizzard controllers that use the
Emulex FAS216 chip. from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.4.12.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.12.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.10.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.71 07-Apr-2022  andvar fix various typos in comments.
 1.70 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.69 21-Sep-2014  christos branches: 1.69.20;
remove dead code
 1.68 22-Jan-2014  christos branches: 1.68.4;
gcc-4.8.x unused variable fixes
 1.67 27-Oct-2012  chs branches: 1.67.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.66 20-Dec-2010  matt branches: 1.66.8; 1.66.18;
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.65 29-Jan-2010  phx branches: 1.65.4;
Define DCIAS() for amigappc.
 1.64 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.63 18-Mar-2009  cegger bcopy -> memcpy
 1.62 18-Mar-2009  cegger bzero -> memset
 1.61 10-Jan-2009  mhitch branches: 1.61.2;
For some reason lost in obscurity and time, I did not ever implement a
timeout capability to these drivers. Apparently no one has ever had
scsi devices that failed to complete a scsi operation in some fashion,
or at least no one has reported it as best I can remember. I've just
run into this situation and figured out that one disk would fail to
complete an I/O transaction and never timed out. Add the appropriate
timeout function to reset the controller and restart things.
 1.60 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.59 08-Dec-2008  mhitch Deal with unrecognized SCSI message byte - restart script to clear the
ACK. No longer hangs the driver when an unhandled message byte is seen.
 1.58 17-Oct-2007  garbled branches: 1.58.16; 1.58.20; 1.58.26; 1.58.28; 1.58.30;
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.57 20-Aug-2007  is branches: 1.57.2;
First part of amigappc support patches by Frank Wille.
 1.56 13-May-2007  mhitch branches: 1.56.4; 1.56.8;
Fix warnings with DEBUG enabled.
 1.55 04-Mar-2007  christos branches: 1.55.2; 1.55.4; 1.55.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.54 08-Mar-2006  lukem branches: 1.54.14; 1.54.16; 1.54.20;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.53 11-Dec-2005  christos branches: 1.53.4; 1.53.6; 1.53.8; 1.53.10;
merge ktrace-lwp.
 1.52 13-Jun-2005  jmc branches: 1.52.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.51 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.50 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.49 18-Jun-2003  drochner branches: 1.49.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.48 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.47 24-Feb-2002  is remove unused prototype (a duplicate with a typing error)
 1.46 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.45 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.44 25-Apr-2001  bouyer branches: 1.44.2; 1.44.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.43 30-Sep-1999  thorpej branches: 1.43.2; 1.43.14;
Update for SCSIPI changes.
 1.42 06-Sep-1999  is Switch to cacheops. This closes PR 1960.
 1.41 28-Mar-1999  is The "Phase mismatch, REQ not asserted" error happens on one of my disks
a few times a day. As the driver and system always recovers, when typing
a few c-ontinues, I think not entering the Debugger() won't hurt.
 1.40 26-Mar-1999  mhitch More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.39 04-Jul-1998  jonathan defopt DDB.
 1.38 27-Nov-1997  mhitch delay() is using calculated timing, so correct the delay during polled
SCSI wait to get a more accurate timeout.
 1.37 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.36 26-Jul-1997  is branches: 1.36.2;
Lowering spl when doing disk I/O below splbio() isnt recommended.
 1.35 13-Oct-1996  christos branches: 1.35.8;
backout previous kprintf change
 1.34 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.33 12-May-1996  mhitch Remove old-style disk instrumentation now that iostat, systat, and
vmstat are fixed.
 1.32 28-Apr-1996  mhitch Correct check for NULL pointer references in siop_scsidone().
Only call Debugger() if DDB is defined.
If the wait for reselect is interrupted and sc_nexus was NULL, only
print the debug message if DEBUG is defined.
 1.31 23-Apr-1996  veego Added some ifdef's for RETINA_SPEED_HACK
Argh, why is a fuction from the RetinaZ2 console driver in the console
driver for the RetinaZ3 ? Fixed.
Fixed some warnings from -Wall if you don't use -DDEBUG
 1.30 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.29 15-Mar-1996  mhitch Correct 53c710 initialization for the A4000T. Remove the A4000T probe
debugging output.
 1.28 03-Feb-1996  chuck Ensure siop_acb alignment via malloc rather than let alignment depend
on the size of MI data structures that come before it in the softc.
Chip will not function properly if alignment is wrong. (as per OpenBSD)
Detected and fixed by: Chuck Cranor <chuck@ccrc.wustl.edu>
and Michael L Hitch <osymh@gemini.oscs.montana.edu>
 1.27 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.26 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.25 29-Sep-1995  chopps branches: 1.25.2;
move 040 to hp300 style, use new MI lance ethernet driver
a few minor fixes WRT prototypes.
if_le from Charles rest from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.24 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.23 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.22 12-Aug-1995  mycroft minphys() functions really should return void.
 1.21 26-Jul-1995  chopps fix minphys routine to match others
 1.20 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.19 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.18 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.17 26-Oct-1994  cgd new RCS ID format.
 1.16 18-Jul-1994  chopps branches: 1.16.2;
fix so it compiles without DEBUG.
 1.15 27-Jun-1994  chopps branches: 1.15.2;
some fixes from Michael
 1.14 22-Jun-1994  chopps cleanup from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.13 14-Jun-1994  chopps remove dumb comment of mine.
 1.12 14-Jun-1994  chopps don't flush cache on context switches for 040's, reduce flushing
on dma operations. code from me and Michael Hitch
 1.11 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.10 22-May-1994  chopps an ide driver and hack reload device to do symbols.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 12-May-1994  chopps ifdef out use of scsi_xfer->req_sense_length for now..
 1.8 12-May-1994  chopps update from osymh@gemini.oscs.montana.edu (Michael L. Hitch) add support
for zthreebus siop scsi drivers and better machine recocgnition.
 1.7 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.6 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.5 21-Feb-1994  chopps fixed a couple minor bugs in con code for ite. added floptical support in
sd.c (based on patch from Andreas E. Heitman).
 1.4 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.15.2.1 18-Jul-1994  cgd update from trunk, per chopps
 1.16.2.2 18-Jul-1994  chopps fix so it compiles without DEBUG.
 1.16.2.1 18-Jul-1994  chopps file siop.c was added on branch netbsd-1-0 on 1994-07-18 08:06:41 +0000
 1.25.2.1 24-Nov-1995  chopps add sync flag to booter and use in scsi devs instead of binpatch
 1.35.8.2 30-Jul-1997  bouyer Sync with trunk.
 1.35.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.36.2.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.43.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.43.2.4 23-Apr-2001  is Shouldn't the compiler warn about uninitialized variables?
 1.43.2.3 29-Mar-2001  bouyer Make these pass a compile test on i386.
 1.43.2.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.43.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.44.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.44.8.1 25-Apr-2001  nathanw file siop.c was added on branch nathanw_sa on 2002-02-28 04:07:00 +0000
 1.44.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.44.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.49.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.49.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.49.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.49.2.1 03-Aug-2004  skrll Sync with HEAD
 1.52.2.2 03-Sep-2007  yamt sync with head.
 1.52.2.1 21-Jun-2006  yamt sync with head.
 1.53.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.53.8.1 13-Mar-2006  yamt sync with head.
 1.53.6.1 22-Apr-2006  simonb Sync with head.
 1.53.4.1 09-Sep-2006  rpaulo sync with head
 1.54.20.1 04-Jun-2007  wrstuden Update to today's netbsd-4.
 1.54.16.2 17-May-2007  yamt sync with head.
 1.54.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.54.14.2 13-Dec-2008  bouyer Pull up following revision(s) (requested by mhitch in ticket #1247):
sys/arch/amiga/dev/siop.c: revision 1.59
sys/arch/amiga/dev/siop2.c: revision 1.31
Deal with unrecognized SCSI message byte - restart script to clear the
ACK. No longer hangs the driver when an unhandled message byte is seen.
 1.54.14.1 23-May-2007  riz Pull up following revision(s) (requested by mhitch in ticket #658):
sys/arch/amiga/dev/siop2.c: revision 1.28
sys/arch/amiga/dev/siop.c: revision 1.56
Fix warnings with DEBUG enabled.
 1.55.10.2 03-Oct-2007  garbled Sync with HEAD
 1.55.10.1 22-May-2007  matt Update to HEAD.
 1.55.4.1 11-Jul-2007  mjf Sync with head.
 1.55.2.2 09-Oct-2007  ad Sync with head.
 1.55.2.1 27-May-2007  ad Sync with head.
 1.56.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.56.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.57.2.1 06-Nov-2007  matt sync with HEAD
 1.58.30.2 16-Jan-2009  bouyer Pull up following revision(s) (requested by mhitch in ticket #256):
sys/arch/amiga/dev/siop2.c: revision 1.33
sys/arch/amiga/dev/siop.c: revision 1.61
For some reason lost in obscurity and time, I did not ever implement a
timeout capability to these drivers. Apparently no one has ever had
scsi devices that failed to complete a scsi operation in some fashion,
or at least no one has reported it as best I can remember. I've just
run into this situation and figured out that one disk would fail to
complete an I/O transaction and never timed out. Add the appropriate
timeout function to reset the controller and restart things.
 1.58.30.1 13-Dec-2008  bouyer Pull up following revision(s) (requested by mhitch in ticket #175):
sys/arch/amiga/dev/siop.c: revision 1.59
sys/arch/amiga/dev/siop2.c: revision 1.31
Deal with unrecognized SCSI message byte - restart script to clear the
ACK. No longer hangs the driver when an unhandled message byte is seen.
 1.58.28.2 28-Apr-2009  skrll Sync with HEAD.
 1.58.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.58.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.58.20.2 11-Mar-2010  yamt sync with head
 1.58.20.1 04-May-2009  yamt sync with head.
 1.58.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.61.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.65.4.1 05-Mar-2011  rmind sync with head
 1.66.18.3 03-Dec-2017  jdolecek update from HEAD
 1.66.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.66.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.66.8.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.66.8.1 30-Oct-2012  yamt sync with head
 1.67.2.1 18-May-2014  rmind sync with head
 1.68.4.1 30-Oct-2014  martin Pull up following revision(s) (requested by maxv in ticket #165):
sys/arch/newsmips/stand/boot/netif_news.c: revision 1.9
sys/arch/mvme68k/stand/installboot/installboot.c: revision 1.19
sys/arch/arm/arm32/pmap.c: revision 1.300
sys/arch/amiga/dev/siop2.c: revision 1.43
sys/arch/amiga/amiga/disksubr.c: revision 1.62
sys/arch/news68k/news68k/bus_space.c: revision 1.13
sys/arch/amiga/dev/siop.c: revision 1.69
sys/arch/x86/x86/x86_autoconf.c: revision 1.72
Remove dead code in various places under arch/.
 1.69.20.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.44 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.43 21-Sep-2014  christos branches: 1.43.20;
remove dead code
 1.42 22-Jan-2014  christos branches: 1.42.4;
gcc-4.8.x unused variable fixes
 1.41 27-Oct-2012  chs branches: 1.41.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.40 20-Dec-2010  matt branches: 1.40.8; 1.40.18;
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.39 22-May-2010  phx Disabled DEBUG_SYNC. Reenable when needed.
 1.38 05-Feb-2010  phx branches: 1.38.2; 1.38.4;
Added two new macros to device.h:
amiga_membarrier() enforces a reorder protection on memory read/writes.
amiga_cpu_sync() makes sure the instruction pipelines are flushed.
Both macros may be used in all amiga device drivers for compatibility with
amigappc. For the start I fixed some SCSI drivers.
cbiiisc and ahsc were tested and seem to work really fast with DMA now.
Some stability problems with amigappc remain nevertheless (spontaneous
kernel DSI traps with high CPU/SCSI load).
 1.37 29-Jan-2010  phx Define DCIAS() for amigappc.
 1.36 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.35 18-Mar-2009  cegger bcopy -> memcpy
 1.34 18-Mar-2009  cegger bzero -> memset
 1.33 10-Jan-2009  mhitch branches: 1.33.2;
For some reason lost in obscurity and time, I did not ever implement a
timeout capability to these drivers. Apparently no one has ever had
scsi devices that failed to complete a scsi operation in some fashion,
or at least no one has reported it as best I can remember. I've just
run into this situation and figured out that one disk would fail to
complete an I/O transaction and never timed out. Add the appropriate
timeout function to reset the controller and restart things.
 1.32 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.31 08-Dec-2008  mhitch Deal with unrecognized SCSI message byte - restart script to clear the
ACK. No longer hangs the driver when an unhandled message byte is seen.
 1.30 17-Oct-2007  garbled branches: 1.30.16; 1.30.20; 1.30.26; 1.30.28; 1.30.30;
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.29 20-Aug-2007  is branches: 1.29.2;
First part of amigappc support patches by Frank Wille.
 1.28 13-May-2007  mhitch branches: 1.28.4; 1.28.8;
Fix warnings with DEBUG enabled.
 1.27 04-Mar-2007  christos branches: 1.27.2; 1.27.4; 1.27.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 08-Mar-2006  lukem branches: 1.26.14; 1.26.16; 1.26.20;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.6; 1.25.8; 1.25.10;
merge ktrace-lwp.
 1.24 13-Jun-2005  jmc branches: 1.24.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.23 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.22 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.21 18-Jun-2003  drochner branches: 1.21.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.20 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.19 24-Feb-2002  is remove unused prototype (a duplicate with a typing error)
 1.18 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.17 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.16 08-Oct-2001  is branches: 1.16.4;
Make the Cyberstorm PPC/ Cyberstorm Mk. 3 driver drive the LED.
Actually, this is added to the siop2_script; should we ever support another
siopng board that does connect something else to GPREG bit 4, we'll have
to move this to C code and make it optional.
OTOH, by then we'll have switched to the MI driver by then.
 1.15 25-Apr-2001  bouyer branches: 1.15.2; 1.15.4;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.14 30-Sep-1999  thorpej branches: 1.14.2; 1.14.14;
Update for SCSIPI changes.
 1.13 07-Sep-1999  is Oops. I forgot to add cachops here earlier.
 1.12 07-Jun-1999  is Check for an unterminated bus; if yes: complain and don't try to use this
bus. Without this, cbiiisc used to hang if nothing was connected.
Reported by Matthias Scheler. A similar method to avoid this was suggested
by Ralph Schmidt.
 1.11 01-Apr-1999  mhitch branches: 1.11.2; 1.11.4; 1.11.6;
Show 50ns period instead of 48ns for Ultra.
 1.10 28-Mar-1999  is Remove 20 lines of register dump from normal operation.
 1.9 28-Mar-1999  mhitch I had to have been asleep when I changed Ignatios's constants to register symbols.
Use the correct symbols for ODR full bits.
 1.8 28-Mar-1999  is Add back the "810" id string.
 1.7 28-Mar-1999  is Initialize all 16 elements. We're wide.
 1.6 26-Mar-1999  mhitch More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.5 22-Mar-1999  is 53c810A identification
 1.4 13-Mar-1999  is Identify the chip type when attaching.
 1.3 13-Mar-1999  is The 53c720 and up are really different. For example, the method to determine,
when disconnecting etc., how much data were transferred, has changed.
Symptom: SIOP invalid instructions when doing data transfers to disks that
disconnect.
XXX The bits etc. need to be defined correctly in the siopreg.h file, and
symbolic values used.
 1.2 12-Mar-1999  is fix some typos introduced when integrating the driver
 1.1 07-Mar-1999  is Added very preliminary version of Symbios 53c7[27]0c driver and Cyberstorm
Mk. III SCSI backend, by Michael Hitch.
XXX No wide transfers supported at the moment.
 1.11.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

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

synchronization to latest KAME will take place on HEAD branch soon.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11.2.1 22-Jun-1999  perry pullup 1.11->1.12 (is): disable adapter if completely unterminated
 1.14.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.14.2.4 22-Apr-2001  is it's siopng, not sea.
 1.14.2.3 29-Mar-2001  bouyer Make these pass a compile test on i386.
 1.14.2.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.14.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.15.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.15.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.15.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.15.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.16.4.1 08-Oct-2001  nathanw file siop2.c was added on branch nathanw_sa on 2002-02-28 04:07:00 +0000
 1.21.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Aug-2004  skrll Sync with HEAD
 1.24.2.2 03-Sep-2007  yamt sync with head.
 1.24.2.1 21-Jun-2006  yamt sync with head.
 1.25.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.25.8.1 13-Mar-2006  yamt sync with head.
 1.25.6.1 22-Apr-2006  simonb Sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.26.20.1 04-Jun-2007  wrstuden Update to today's netbsd-4.
 1.26.16.2 17-May-2007  yamt sync with head.
 1.26.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.14.2 13-Dec-2008  bouyer Pull up following revision(s) (requested by mhitch in ticket #1247):
sys/arch/amiga/dev/siop.c: revision 1.59
sys/arch/amiga/dev/siop2.c: revision 1.31
Deal with unrecognized SCSI message byte - restart script to clear the
ACK. No longer hangs the driver when an unhandled message byte is seen.
 1.26.14.1 23-May-2007  riz Pull up following revision(s) (requested by mhitch in ticket #658):
sys/arch/amiga/dev/siop2.c: revision 1.28
sys/arch/amiga/dev/siop.c: revision 1.56
Fix warnings with DEBUG enabled.
 1.27.10.2 03-Oct-2007  garbled Sync with HEAD
 1.27.10.1 22-May-2007  matt Update to HEAD.
 1.27.4.1 11-Jul-2007  mjf Sync with head.
 1.27.2.2 09-Oct-2007  ad Sync with head.
 1.27.2.1 27-May-2007  ad Sync with head.
 1.28.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.28.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.29.2.1 06-Nov-2007  matt sync with HEAD
 1.30.30.2 16-Jan-2009  bouyer Pull up following revision(s) (requested by mhitch in ticket #256):
sys/arch/amiga/dev/siop2.c: revision 1.33
sys/arch/amiga/dev/siop.c: revision 1.61
For some reason lost in obscurity and time, I did not ever implement a
timeout capability to these drivers. Apparently no one has ever had
scsi devices that failed to complete a scsi operation in some fashion,
or at least no one has reported it as best I can remember. I've just
run into this situation and figured out that one disk would fail to
complete an I/O transaction and never timed out. Add the appropriate
timeout function to reset the controller and restart things.
 1.30.30.1 13-Dec-2008  bouyer Pull up following revision(s) (requested by mhitch in ticket #175):
sys/arch/amiga/dev/siop.c: revision 1.59
sys/arch/amiga/dev/siop2.c: revision 1.31
Deal with unrecognized SCSI message byte - restart script to clear the
ACK. No longer hangs the driver when an unhandled message byte is seen.
 1.30.28.2 28-Apr-2009  skrll Sync with HEAD.
 1.30.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.30.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.30.20.3 11-Aug-2010  yamt sync with head.
 1.30.20.2 11-Mar-2010  yamt sync with head
 1.30.20.1 04-May-2009  yamt sync with head.
 1.30.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.33.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.38.4.2 05-Mar-2011  rmind sync with head
 1.38.4.1 30-May-2010  rmind sync with head
 1.38.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.40.18.3 03-Dec-2017  jdolecek update from HEAD
 1.40.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.40.8.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.40.8.1 30-Oct-2012  yamt sync with head
 1.41.2.1 18-May-2014  rmind sync with head
 1.42.4.1 30-Oct-2014  martin Pull up following revision(s) (requested by maxv in ticket #165):
sys/arch/newsmips/stand/boot/netif_news.c: revision 1.9
sys/arch/mvme68k/stand/installboot/installboot.c: revision 1.19
sys/arch/arm/arm32/pmap.c: revision 1.300
sys/arch/amiga/dev/siop2.c: revision 1.43
sys/arch/amiga/amiga/disksubr.c: revision 1.62
sys/arch/news68k/news68k/bus_space.c: revision 1.13
sys/arch/amiga/dev/siop.c: revision 1.69
sys/arch/x86/x86/x86_autoconf.c: revision 1.72
Remove dead code in various places under arch/.
 1.43.20.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 08-Oct-2001  is branches: 1.3.4;
Make the Cyberstorm PPC/ Cyberstorm Mk. 3 driver drive the LED.
Actually, this is added to the siop2_script; should we ever support another
siopng board that does connect something else to GPREG bit 4, we'll have
to move this to C code and make it optional.
OTOH, by then we'll have switched to the MI driver by then.
 1.2 26-Mar-1999  mhitch branches: 1.2.20; 1.2.22;
More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.1 07-Mar-1999  is Added very preliminary version of Symbios 53c7[27]0c driver and Cyberstorm
Mk. III SCSI backend, by Michael Hitch.
XXX No wide transfers supported at the moment.
 1.2.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.20.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.3.4.2 08-Oct-2001  is Make the Cyberstorm PPC/ Cyberstorm Mk. 3 driver drive the LED.
Actually, this is added to the siop2_script; should we ever support another
siopng board that does connect something else to GPREG bit 4, we'll have
to move this to C code and make it optional.
OTOH, by then we'll have switched to the MI driver by then.
 1.3.4.1 08-Oct-2001  is file siop2_script.out was added on branch nathanw_sa on 2001-10-08 21:18:59 +0000
 1.8 12-Dec-2016  maya acknowleg -> acknowledg, proceedure -> procedure.
only comments were changed.

from miod
 1.7 21-Oct-2009  snj branches: 1.7.22; 1.7.40; 1.7.44;
Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.6 11-Dec-2005  christos branches: 1.6.78;
merge ktrace-lwp.
 1.5 25-Jul-2005  is normalize capitalization. No functional change.
 1.4 08-Oct-2001  is branches: 1.4.4; 1.4.20; 1.4.36;
Make the Cyberstorm PPC/ Cyberstorm Mk. 3 driver drive the LED.
Actually, this is added to the siop2_script; should we ever support another
siopng board that does connect something else to GPREG bit 4, we'll have
to move this to C code and make it optional.
OTOH, by then we'll have switched to the MI driver by then.
 1.3 26-Mar-1999  mhitch branches: 1.3.20; 1.3.22;
More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.2 13-Mar-1999  is Adjust to match the assembled code
 1.1 07-Mar-1999  is Added very preliminary version of Symbios 53c7[27]0c driver and Cyberstorm
Mk. III SCSI backend, by Michael Hitch.
XXX No wide transfers supported at the moment.
 1.3.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.20.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.4.36.1 21-Jun-2006  yamt sync with head.
 1.4.20.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.4.2 08-Oct-2001  is Make the Cyberstorm PPC/ Cyberstorm Mk. 3 driver drive the LED.
Actually, this is added to the siop2_script; should we ever support another
siopng board that does connect something else to GPREG bit 4, we'll have
to move this to C code and make it optional.
OTOH, by then we'll have switched to the MI driver by then.
 1.4.4.1 08-Oct-2001  is file siop2_script.ss was added on branch nathanw_sa on 2001-10-08 21:18:59 +0000
 1.6.78.1 11-Mar-2010  yamt sync with head
 1.7.44.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.7.40.1 05-Feb-2017  skrll Sync with HEAD
 1.7.22.1 03-Dec-2017  jdolecek update from HEAD
 1.4 26-Mar-1999  mhitch More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.3 05-Jan-1998  perry RCSID Police.
 1.2 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 12-Dec-2016  maya acknowleg -> acknowledg, proceedure -> procedure.
only comments were changed.

from miod
 1.5 21-Oct-2009  snj branches: 1.5.22; 1.5.40; 1.5.44;
Drop 3rd and 4th clauses (except on files where copyright is shared
with UC, in which case only the ad clause has been removed). Approved
by mhitch@ (copyright holder).
 1.4 26-Mar-1999  mhitch branches: 1.4.148;
More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.3 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 04-Jul-1995  chopps misc cleanup, better tty alloc for mfc. from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4.148.1 11-Mar-2010  yamt sync with head
 1.5.44.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.5.40.1 05-Feb-2017  skrll Sync with HEAD
 1.5.22.1 03-Dec-2017  jdolecek update from HEAD
 1.16 27-Jun-2022  andvar s/loobpack/loopback/ in comment.
 1.15 24-Aug-2012  msaitoh Fix typos
 1.14 08-Mar-2006  lukem branches: 1.14.102;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.13 11-Dec-2005  christos branches: 1.13.4; 1.13.6; 1.13.8; 1.13.10;
merge ktrace-lwp.
 1.12 07-Aug-2003  agc branches: 1.12.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 28-Mar-2001  tsutsui branches: 1.11.8; 1.11.24;
Fix an obvious typo.
 1.10 26-Mar-1999  mhitch branches: 1.10.8; 1.10.20;
More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.9 09-Mar-1999  is Missing part of CS Mk. III changes
 1.8 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.7 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 12-May-1994  chopps update from osymh@gemini.oscs.montana.edu (Michael L. Hitch) add support
for zthreebus siop scsi drivers and better machine recocgnition.
 1.3 11-Feb-1994  chopps Add missing Id's
 1.2 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.10.20.1 09-Apr-2001  nathanw Catch up with -current.
 1.10.8.1 21-Apr-2001  bouyer Sync with HEAD
 1.11.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.24.1 03-Aug-2004  skrll Sync with HEAD
 1.11.8.2 28-Mar-2001  tsutsui Fix an obvious typo.
 1.11.8.1 28-Mar-2001  tsutsui file siopreg.h was added on branch nathanw_sa on 2001-03-28 17:33:08 +0000
 1.12.16.1 21-Jun-2006  yamt sync with head.
 1.13.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.13.8.1 13-Mar-2006  yamt sync with head.
 1.13.6.1 22-Apr-2006  simonb Sync with head.
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.14.102.1 30-Oct-2012  yamt sync with head
 1.29 07-Apr-2022  andvar fix various typos in comments.
 1.28 01-Jan-2022  andvar fix typos in comments, mainly basicly -> basically.
 1.27 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.26 19-May-2009  phx branches: 1.26.12; 1.26.22;
Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.25 11-Dec-2005  christos branches: 1.25.78;
merge ktrace-lwp.
 1.24 07-Dec-2004  thorpej Use "struct scsipi_command" in internal command structures so that
we have enough space for 16-byte CDBs.
 1.23 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.22 09-Apr-2003  thorpej branches: 1.22.2;
Use PAGE_SIZE rather than NBPG.
 1.21 14-May-2002  matt Eliminate commons. (including a few unused or mismatched ones).
 1.20 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.19 25-Apr-2001  bouyer branches: 1.19.2; 1.19.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.18 26-Mar-1999  mhitch branches: 1.18.8; 1.18.20;
More 53c770 stuff: update 53c720/770 register defines and use them in
siop2.c. Add wide negotiation and Ultra support. Modify siop.c to match
the siop2.c sync negotiation changes. The CyberStorm MKIII driver now
supports 15 targets. Remove some old table-driven sync rate stuff from
the original Zeus driver.
 1.17 09-Mar-1999  is Missing part of CS Mk. III changes
 1.16 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.15 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.14 21-Apr-1996  veego branches: 1.14.10; 1.14.12;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.13 03-Feb-1996  chuck Ensure siop_acb alignment via malloc rather than let alignment depend
on the size of MI data structures that come before it in the softc.
Chip will not function properly if alignment is wrong. (as per OpenBSD)
Detected and fixed by: Chuck Cranor <chuck@ccrc.wustl.edu>
and Michael L Hitch <osymh@gemini.oscs.montana.edu>
 1.12 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.11 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.10 12-Aug-1995  mycroft minphys() functions really should return void.
 1.9 26-Jul-1995  chopps fix minphys routine to match others
 1.8 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.7 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 14-Jun-1994  chopps don't flush cache on context switches for 040's, reduce flushing
on dma operations. code from me and Michael Hitch
 1.3 12-May-1994  chopps update from osymh@gemini.oscs.montana.edu (Michael L. Hitch) add support
for zthreebus siop scsi drivers and better machine recocgnition.
 1.2 11-Feb-1994  chopps Add missing Id's
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.14.12.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.10.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.18.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.18.8.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.18.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.19.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.19.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.19.8.1 25-Apr-2001  nathanw file siopvar.h was added on branch nathanw_sa on 2002-02-28 04:07:01 +0000
 1.19.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.22.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.22.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.78.1 20-Jun-2009  yamt sync with head
 1.26.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.26.12.1 30-Oct-2012  yamt sync with head
 1.3 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.2 23-Apr-2016  skrll Merge nick-nhusb

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
 1.1 27-Apr-2013  rkujawa branches: 1.1.4; 1.1.12; 1.1.14; 1.1.16; 1.1.20;
Add Thylacine USB Host Controller driver (just a zbus frontend to slhci).

Barely works due to combination of SL811HS brain damagae and our unforgiving
driver. At least most keyboards and mices are good. Of course on amiga WSCONS
kernel is needed to make any use of them.
 1.1.20.1 23-Jan-2017  skrll Adapt to branch
 1.1.16.1 03-Dec-2014  skrll The grand renaming of structure members.

No functional change.
 1.1.14.1 05-Apr-2017  snj Pull up following revision(s) (requested by skrll in ticket #1395):
share/man/man4/axe.4: netbsd-7-nhusb
share/man/man4/axen.4: netbsd-7-nhusb
share/man/man4/cdce.4: netbsd-7-nhusb
share/man/man4/uaudio.4: netbsd-7-nhusb
share/man/man4/ucom.4: netbsd-7-nhusb
share/man/man4/uep.4: netbsd-7-nhusb
share/man/man4/urtw.4: netbsd-7-nhusb
share/man/man4/usb.4: netbsd-7-nhusb
share/man/man4/uyap.4: netbsd-7-nhusb
share/man/man4/xhci.4: netbsd-7-nhusb
share/man/man9/usbdi.9: netbsd-7-nhusb
sys/arch/amd64/conf/ALL: netbsd-7-nhusb
sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
sys/arch/i386/conf/ALL: netbsd-7-nhusb
sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
sys/conf/files: netbsd-7-nhusb
sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
sys/dev/ic/sl811hs.c: netbsd-7-nhusb
sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
sys/dev/usb/TODO: netbsd-7-nhusb
sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
sys/dev/usb/auvitek.c: netbsd-7-nhusb
sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
sys/dev/usb/ehci.c: netbsd-7-nhusb
sys/dev/usb/ehcireg.h: netbsd-7-nhusb
sys/dev/usb/ehcivar.h: netbsd-7-nhusb
sys/dev/usb/emdtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
sys/dev/usb/ezload.c: netbsd-7-nhusb
sys/dev/usb/ezload.h: netbsd-7-nhusb
sys/dev/usb/files.usb: netbsd-7-nhusb
sys/dev/usb/hid.c: netbsd-7-nhusb
sys/dev/usb/hid.h: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
sys/dev/usb/if_atu.c: netbsd-7-nhusb
sys/dev/usb/if_atureg.h: netbsd-7-nhusb
sys/dev/usb/if_aue.c: netbsd-7-nhusb
sys/dev/usb/if_auereg.h: netbsd-7-nhusb
sys/dev/usb/if_axe.c: netbsd-7-nhusb
sys/dev/usb/if_axen.c: netbsd-7-nhusb
sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
sys/dev/usb/if_axereg.h: netbsd-7-nhusb
sys/dev/usb/if_cdce.c: netbsd-7-nhusb
sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
sys/dev/usb/if_cue.c: netbsd-7-nhusb
sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
sys/dev/usb/if_kue.c: netbsd-7-nhusb
sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
sys/dev/usb/if_otus.c: netbsd-7-nhusb
sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
sys/dev/usb/if_rum.c: netbsd-7-nhusb
sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
sys/dev/usb/if_run.c: netbsd-7-nhusb
sys/dev/usb/if_runvar.h: netbsd-7-nhusb
sys/dev/usb/if_smsc.c: netbsd-7-nhusb
sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
sys/dev/usb/if_udav.c: netbsd-7-nhusb
sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
sys/dev/usb/if_upgt.c: netbsd-7-nhusb
sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
sys/dev/usb/if_upl.c: netbsd-7-nhusb
sys/dev/usb/if_ural.c: netbsd-7-nhusb
sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
sys/dev/usb/if_url.c: netbsd-7-nhusb
sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
sys/dev/usb/if_urndis.c: netbsd-7-nhusb
sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtw.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
sys/dev/usb/if_zyd.c: netbsd-7-nhusb
sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
sys/dev/usb/irmce.c: netbsd-7-nhusb
sys/dev/usb/moscom.c: netbsd-7-nhusb
sys/dev/usb/motg.c: netbsd-7-nhusb
sys/dev/usb/motgvar.h: netbsd-7-nhusb
sys/dev/usb/ohci.c: netbsd-7-nhusb
sys/dev/usb/ohcireg.h: netbsd-7-nhusb
sys/dev/usb/ohcivar.h: netbsd-7-nhusb
sys/dev/usb/pseye.c: netbsd-7-nhusb
sys/dev/usb/slurm.c: netbsd-7-nhusb
sys/dev/usb/stuirda.c: netbsd-7-nhusb
sys/dev/usb/u3g.c: netbsd-7-nhusb
sys/dev/usb/uark.c: netbsd-7-nhusb
sys/dev/usb/uatp.c: netbsd-7-nhusb
sys/dev/usb/uaudio.c: netbsd-7-nhusb
sys/dev/usb/uberry.c: netbsd-7-nhusb
sys/dev/usb/ubsa.c: netbsd-7-nhusb
sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
sys/dev/usb/ubsavar.h: netbsd-7-nhusb
sys/dev/usb/ubt.c: netbsd-7-nhusb
sys/dev/usb/uchcom.c: netbsd-7-nhusb
sys/dev/usb/ucom.c: netbsd-7-nhusb
sys/dev/usb/ucomvar.h: netbsd-7-nhusb
sys/dev/usb/ucycom.c: netbsd-7-nhusb
sys/dev/usb/udl.c: netbsd-7-nhusb
sys/dev/usb/udl.h: netbsd-7-nhusb
sys/dev/usb/udsbr.c: netbsd-7-nhusb
sys/dev/usb/udsir.c: netbsd-7-nhusb
sys/dev/usb/uep.c: netbsd-7-nhusb
sys/dev/usb/uftdi.c: netbsd-7-nhusb
sys/dev/usb/uftdireg.h: netbsd-7-nhusb
sys/dev/usb/ugen.c: netbsd-7-nhusb
sys/dev/usb/ugensa.c: netbsd-7-nhusb
sys/dev/usb/uhci.c: netbsd-7-nhusb
sys/dev/usb/uhcireg.h: netbsd-7-nhusb
sys/dev/usb/uhcivar.h: netbsd-7-nhusb
sys/dev/usb/uhid.c: netbsd-7-nhusb
sys/dev/usb/uhidev.c: netbsd-7-nhusb
sys/dev/usb/uhidev.h: netbsd-7-nhusb
sys/dev/usb/uhmodem.c: netbsd-7-nhusb
sys/dev/usb/uhso.c: netbsd-7-nhusb
sys/dev/usb/uhub.c: netbsd-7-nhusb
sys/dev/usb/uipad.c: netbsd-7-nhusb
sys/dev/usb/uipaq.c: netbsd-7-nhusb
sys/dev/usb/uirda.c: netbsd-7-nhusb
sys/dev/usb/uirdavar.h: netbsd-7-nhusb
sys/dev/usb/ukbd.c: netbsd-7-nhusb
sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.h: netbsd-7-nhusb
sys/dev/usb/ulpt.c: netbsd-7-nhusb
sys/dev/usb/umass.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
sys/dev/usb/umassvar.h: netbsd-7-nhusb
sys/dev/usb/umcs.c: netbsd-7-nhusb
sys/dev/usb/umct.c: netbsd-7-nhusb
sys/dev/usb/umidi.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
sys/dev/usb/umodem.c: netbsd-7-nhusb
sys/dev/usb/umodem_common.c: netbsd-7-nhusb
sys/dev/usb/umodemvar.h: netbsd-7-nhusb
sys/dev/usb/ums.c: netbsd-7-nhusb
sys/dev/usb/uplcom.c: netbsd-7-nhusb
sys/dev/usb/urio.c: netbsd-7-nhusb
sys/dev/usb/urio.h: netbsd-7-nhusb
sys/dev/usb/usb.c: netbsd-7-nhusb
sys/dev/usb/usb.h: netbsd-7-nhusb
sys/dev/usb/usb_mem.c: netbsd-7-nhusb
sys/dev/usb/usb_mem.h: netbsd-7-nhusb
sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
sys/dev/usb/usb_subr.c: netbsd-7-nhusb
sys/dev/usb/usbdevices.config: netbsd-7-nhusb
sys/dev/usb/usbdevs: netbsd-7-nhusb
sys/dev/usb/usbdevs.h: netbsd-7-nhusb
sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
sys/dev/usb/usbdi.c: netbsd-7-nhusb
sys/dev/usb/usbdi.h: netbsd-7-nhusb
sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
sys/dev/usb/usbdivar.h: netbsd-7-nhusb
sys/dev/usb/usbhid.h: netbsd-7-nhusb
sys/dev/usb/usbhist.h: netbsd-7-nhusb
sys/dev/usb/usbroothub.c: netbsd-7-nhusb
sys/dev/usb/usbroothub.h: netbsd-7-nhusb
sys/dev/usb/usbroothub_subr.c: delete
sys/dev/usb/usbroothub_subr.h: delete
sys/dev/usb/uscanner.c: netbsd-7-nhusb
sys/dev/usb/uslsa.c: netbsd-7-nhusb
sys/dev/usb/usscanner.c: netbsd-7-nhusb
sys/dev/usb/ustir.c: netbsd-7-nhusb
sys/dev/usb/uthum.c: netbsd-7-nhusb
sys/dev/usb/utoppy.c: netbsd-7-nhusb
sys/dev/usb/uts.c: netbsd-7-nhusb
sys/dev/usb/uvideo.c: netbsd-7-nhusb
sys/dev/usb/uvisor.c: netbsd-7-nhusb
sys/dev/usb/uvscom.c: netbsd-7-nhusb
sys/dev/usb/uyap.c: netbsd-7-nhusb
sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
sys/dev/usb/uyurex.c: netbsd-7-nhusb
sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
sys/dev/usb/xhci.c: netbsd-7-nhusb
sys/dev/usb/xhcireg.h: netbsd-7-nhusb
sys/dev/usb/xhcivar.h: netbsd-7-nhusb
sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/include/linux/err.h: delete
sys/external/bsd/drm2/include/linux/workqueue.h: delete
sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
sys/external/bsd/drm2/linux/linux_work.c: delete
sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
sys/sys/mbuf.h: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler
at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
the network stack.
- kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
softnet_lock held across usb xfr
- kern/50491 - unkillable wait in usbd_transfer while using usmsc0
on raspberry pi 2
- kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)
 1.1.12.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.12.1 27-Apr-2013  yamt file slhci_zbus.c was added on branch yamt-pagecache on 2014-05-22 11:39:29 +0000
 1.1.4.3 03-Dec-2017  jdolecek update from HEAD
 1.1.4.2 23-Jun-2013  tls resync from head
 1.1.4.1 27-Apr-2013  tls file slhci_zbus.c was added on branch tls-maxphys on 2013-06-23 06:19:59 +0000
 1.2 09-Feb-1994  mycroft Clean up deleted files.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 09-Feb-1994  mycroft Clean up deleted files.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 09-Feb-1994  mycroft Clean up deleted files.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.15 25-May-1994  mycroft Clean up deleted files.
 1.14 10-Apr-1994  chopps fix pretend_tobe hack. from Robert Leland (leland@wacky.acet.org)
 1.13 20-Feb-1994  chopps changes to support Python tape drive.
 1.12 14-Feb-1994  chopps moved n "}" outside of conditional DEBUG
 1.11 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.10 11-Feb-1994  chopps Add missing Id's
 1.9 11-Feb-1994  chopps ioctl's always pass proc.
 1.8 09-Feb-1994  chopps added support for TEAC 60M, quite possibly the worst scsi interface on the planet earth.
 1.7 07-Feb-1994  chopps removed old drivers. updated st.c for buf struct changes (used diff from hp300)
 1.6 01-Feb-1994  chopps SCSI re-org, and misc. cleanup of compiler warnings.
 1.5 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.4 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3 02-Sep-1993  mw new source release integrated from amiga-release.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.1 02-Sep-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2 30-Oct-1993  mycroft Clean up deleted files.
 1.1.1.1 02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.5 25-May-1994  mycroft Clean up deleted files.
 1.4 11-Feb-1994  chopps Add missing Id's
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.8 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.74; 1.7.76; 1.7.78;
merge ktrace-lwp.
 1.6 13-Jun-2005  jmc Fix a ton of const/volatile issues shown with new warning flags
 1.5 16-Feb-1999  is branches: 1.5.42;
Fix Copyright dates
 1.4 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.3 22-Mar-1998  is This is no longer DraCo-specific (and hasn't been for a long time).
 1.2 16-Sep-1997  is Support for the upcoming NetBSD/Amiga Hypercom driver family:
* support chip clocks != COM_FREQ, by introducing sc_frequency (for the
mainline code) and adding a frequency parameter right after the rate
parameter to comcnattach() and com_kgdb_attach().
- Make com_isa and com_multi initialize sc_frequency to COM_FREQ.
- Make i386/machdep.c and alpha/dec_xxx.c call com*attach() with the freq.
parameter.
* supio_attach_args get two more fields: a sc_ipl and a sc_arg, both ints.
- com_supio uses the first for interupt establishment (all childs will, as
soon as they exist) and the 2nd for sc_frequency.
- drsupio passes sc_ipl alway as 5, and for the "com"s, sc_arg as 16*115200
- hyper will pass sc_ipl as 6, and sc_arg as 16 * 460800
 1.1 27-Aug-1997  is branches: 1.1.2;
Define supio, a direct bus with a single locator, the port number. This
is for "standard PC i/o stuff" at known and constant locations, e.g. when
multi-io chips are used on non-ISA mainboards.
Implement drsupio.c, the DraCo version of this.
Attach the generic com.c to this bus.
Remove the old drcom hack.
 1.1.2.3 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 27-Aug-1997  thorpej file supio.h was added on branch marc-pcmcia on 1997-09-01 20:06:42 +0000
 1.5.42.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.78.1 16-May-2008  yamt sync with head.
 1.7.76.1 18-May-2008  yamt sync with head.
 1.7.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 28-Mar-1994  chopps some scsi changes, 4M system hack, and a boot messgae addition. from
Michael Hitch.
 1.2 25-Mar-1994  chopps move HIST out of DEBUG conditional.
 1.1 28-Feb-1994  chopps Michael Hitches patch applied for misc things, limited 5380 support.
 1.22 27-Aug-2023  andvar amiga/toccata(4): define ad1848debug to fix AUDIO_DEBUG enabled amiga build.

The code is taken from sys/dev/isa/ad1848_isa.c for consistency.
Unsure, if new debug level variable wouldn't be better or it is needed at all.
 1.21 29-Feb-2020  isaki Remove rounding by 4 bytes on round_blocksize().
For drivers which supports only 16bit * 2channels sampling,
rounding by 4 bytes no longer meaningful.
 1.20 08-Jun-2019  isaki branches: 1.20.4;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.
 1.19 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.18 16-Mar-2019  isaki branches: 1.18.2;
Use C99 style struct initializer to audio_hw_if.
 1.17 22-Jan-2014  christos branches: 1.17.30;
gcc-4.8.x unused variable fixes
 1.16 09-Dec-2013  wiz Fix typo ("then" instead of "than")
 1.15 23-Nov-2011  jmcneill branches: 1.15.8; 1.15.12;
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.14 19-Jul-2011  dyoung branches: 1.14.2; 1.14.4;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.13 02-Jun-2011  tsutsui Split device_t/softc of all ad1848 variants properly. Compile test only.

Please check all attribute users in all files.* on device_t/softc split.

XXX: not sure if gus(4) needs device_t in ad1848_isa_softc
 1.12 28-Apr-2008  martin branches: 1.12.22; 1.12.28; 1.12.32;
Remove clause 3 and 4 from TNF licenses
 1.11 11-Dec-2005  christos branches: 1.11.28; 1.11.74; 1.11.76; 1.11.78;
merge ktrace-lwp.
 1.10 15-Jan-2005  kent ansify and KNF
 1.9 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.8 29-Oct-2004  yamt branches: 1.8.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.7 10-Jan-2004  is remove forgotten debug printf from development.
 1.6 06-Jan-2003  wiz branches: 1.6.2;
interrupt with two rs.
 1.5 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 27-Mar-2002  christos branches: 1.3.4;
fix compilo in debugging code. Reported by: Klaus Heinz
 1.2 28-Jan-2002  aymeric branches: 1.2.2; 1.2.4;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.1 21-Jan-2002  is First draft of a Toccata driver.
 1.2.4.5 07-Jan-2003  thorpej Sync with HEAD.
 1.2.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 28-Jan-2002  nathanw file toccata.c was added on branch nathanw_sa on 2002-02-28 04:07:01 +0000
 1.2.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.2.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 28-Jan-2002  jdolecek file toccata.c was added on branch kqueue on 2002-02-11 20:07:08 +0000
 1.3.4.1 15-Mar-2004  jmc Pullup rev 1.7 (requested by is in ticket #1593)

Remove forgotten debug printf from development.
 1.6.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.6.2.4 02-Nov-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.8.2.1 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.11.78.1 16-May-2008  yamt sync with head.
 1.11.76.1 18-May-2008  yamt sync with head.
 1.11.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.28.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.12.32.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.12.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.22.1 12-Jun-2011  rmind sync with head
 1.14.4.2 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.14.4.1 20-Nov-2011  mrg port these to audiomp: support get_locks, and take the intr_lock
in the interrupt handler.
 1.14.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.14.2.1 17-Apr-2012  yamt sync with head
 1.15.12.1 18-May-2014  rmind sync with head
 1.15.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.17.30.1 10-Jun-2019  christos Sync with HEAD
 1.18.2.3 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.18.2.2 04-May-2019  isaki Remove obsoleted methods in audio_hw_if.
- drain: is handled in audio upper layer now.
- mappage: is handled in audio upper layer now.
- setfd: no one uses and it's meaningless now.
 1.18.2.1 21-Apr-2019  isaki Adapt ad1848/cs4231 families to audio2.
 1.20.4.1 29-Feb-2020  ad Sync with head.
 1.2 26-Jan-1994  mycroft Clean up deleted files.
 1.1 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 07-Feb-1994  mycroft Clean up deleted files.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2 09-Feb-1994  mycroft Clean up deleted files.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.36 27-Jan-2025  andvar s/probeing/probing/ in comments.
 1.35 26-Mar-2023  andvar branches: 1.35.6;
s/dipslay/display/ in comments.
 1.34 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.33 12-Nov-2015  phx Use the MD_BTOP() macro as replacement for m68k_btop() in all device
drivers which are shared with amigappc.
 1.32 20-Aug-2015  christos include "ioconf.h" to get the 'void <driver>attach(int count);' prototype.
 1.31 25-Jul-2014  dholland branches: 1.31.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.30 16-Mar-2014  dholland branches: 1.30.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.29 26-Oct-2009  cegger branches: 1.29.12; 1.29.22; 1.29.26;
kill extra whitespaces
reviewed by tsutsui@
 1.28 18-Mar-2009  cegger bcopy -> memcpy
 1.27 23-Mar-2008  cube branches: 1.27.4; 1.27.12; 1.27.18;
Use M_TEMP for allocations instead of the now deceased M_IOCTLOPS.
 1.26 04-Mar-2007  christos branches: 1.26.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.25 11-Dec-2005  christos branches: 1.25.26;
merge ktrace-lwp.
 1.24 23-Oct-2002  jdolecek branches: 1.24.6; 1.24.22;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23 10-Oct-2002  jdolecek replace the somewhat strange poll routine with standard nopoll() (a.k.a
seltrue())
 1.22 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.21 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.20 17-Mar-2002  atatat branches: 1.20.4; 1.20.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.19 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.18 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.17 26-Jun-2000  simonb branches: 1.17.2; 1.17.4; 1.17.8;
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.16 13-Oct-1996  christos branches: 1.16.28; 1.16.38;
backout previous kprintf change
 1.15 11-Oct-1996  mhitch Changes for poll(2).
 1.14 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.12 10-Apr-1995  mycroft map --> mmap
 1.11 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.10 26-Oct-1994  cgd new RCS ID format.
 1.9 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.7 10-Apr-1994  chopps little bit of KNiFeing, view and ite ioctl names cleaned. ite bell
values made sensical for users. (that is pitch,msec not period,count)
 1.6 30-Mar-1994  chopps remove dlists.h oops.
 1.5 17-Feb-1994  chopps modified to use generic cons. (and some grf defs changed)
 1.4 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.3 30-Jan-1994  chopps Re-enabled views, fixed warning in serial driver.
 1.2 29-Jan-1994  chopps Fixed my incorrect copyright.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.16.38.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.16.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.17.8.6 11-Nov-2002  nathanw Catch up to -current
 1.17.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.17.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.17.8.3 13-Aug-2002  nathanw Catch up to -current.
 1.17.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.17.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.17.4.6 10-Oct-2002  jdolecek use nokqfilter (or seltrue_kqfilter()) for drivers which provide poll
routine very similar to seltrue(); the poll routines would be cleaned
up on trunk
 1.17.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.17.4.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.17.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.17.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.17.4.1 12-Sep-2001  thorpej Add noop kqueue entry points.
 1.17.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.20.6.1 07-Aug-2002  lukem Pull up revision 1.21 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.20.4.2 30-Aug-2002  gehenna catch up with -current.
 1.20.4.1 16-May-2002  gehenna Add the character device switch.
 1.24.22.3 24-Mar-2008  yamt sync with head.
 1.24.22.2 03-Sep-2007  yamt sync with head.
 1.24.22.1 21-Jun-2006  yamt sync with head.
 1.24.6.1 21-Nov-2004  skrll Adapt to branch.
 1.25.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.27.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.27.4.2 11-Mar-2010  yamt sync with head
 1.27.4.1 04-May-2009  yamt sync with head.
 1.29.26.1 18-May-2014  rmind sync with head
 1.29.22.2 03-Dec-2017  jdolecek update from HEAD
 1.29.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.2.1 10-Aug-2014  tls Rebase.
 1.31.4.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.31.4.1 22-Sep-2015  skrll Sync with HEAD
 1.35.6.1 02-Aug-2025  perseant Sync with HEAD
 1.12 26-Mar-2023  andvar s/dipslay/display/ in comments.
 1.11 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.10 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.9 06-Sep-2002  gehenna branches: 1.9.156; 1.9.176;
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.8 25-Apr-2002  aymeric branches: 1.8.2;
o replace definitions by declarations in header files
o put definitions where due
o cleanup some types (u_int -> vaddr_t's for example)
o minor other cleanup
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 21-Apr-1996  veego branches: 1.6.42; 1.6.44; 1.6.48;
- Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 10-Apr-1994  chopps little bit of KNiFeing, view and ite ioctl names cleaned. ite bell
values made sensical for users. (that is pitch,msec not period,count)
 1.3 13-Feb-1994  chopps cleaned up include's relocated grf/* stuf to grfabs*.
 1.2 29-Jan-1994  chopps Fixed my incorrect copyright.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.6.48.3 17-Sep-2002  nathanw Catch up to -current.
 1.6.48.2 20-Jun-2002  nathanw Catch up to -current.
 1.6.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.6.44.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.6.44.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.44.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.42.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.8.2.1 16-May-2002  gehenna Remove unnecessary prototypes.
 1.9.176.1 22-Sep-2015  skrll Sync with HEAD
 1.9.156.1 03-Dec-2017  jdolecek update from HEAD
 1.6 26-Mar-2023  andvar s/dipslay/display/ in comments.
 1.5 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.4 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.3 26-Oct-1994  cgd branches: 1.3.46; 1.3.50;
new RCS ID format.
 1.2 29-Jan-1994  chopps Fixed my incorrect copyright.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.3.50.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.46.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.5 09-Feb-1994  mycroft Clean up deleted files.
 1.4 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.4 09-Feb-1994  mycroft Clean up deleted files.
 1.3 30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.5 28-Aug-2006  he Collapse two more separate instances of MD vuid_event.h header
files to instead use the common <dev/sun/vuid_event.h> header.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 26-Oct-1994  cgd branches: 1.2.66;
new RCS ID format.
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 30-Dec-2006  yamt sync with head.
 1.4.8.1 03-Sep-2006  yamt sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.7 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.6 20-Oct-2017  jdolecek move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.5 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.4 04-Sep-2017  phx Remove double device pointers. The pointer is already part of sc_wdcdev.
 1.3 03-Jan-2014  rkujawa branches: 1.3.4; 1.3.6; 1.3.10; 1.3.24;
Rework handling of Commodore Gayle chip. Avoid ugly struct casts, introduce
proper bus_space accesses and some abstraction layer. All drivers that utilised
Gayle also had to be refactored.

I tried not to break anything more, but this clearly needs more testing...
 1.2 22-Dec-2013  rkujawa Changes to ACA500 support:
- Add support for second (aux) CF slot.
- Rework wdc attachment to be more sane.
- Add support for clockport on ACA500.
- Fix style where appropriate.
 1.1 22-Dec-2013  rkujawa Add preliminary support for the Individual Computers ACA500 in the form of acahf
driver. If ACA500 is equipped with supported accelerator with MMU, it allows
running NetBSD on an Amiga 500.

Since ACA is not autoconf-aware, and the probe procedure does not exist yet, the
driver is activated with the ACA500_SUPPORT kernel option. The acahf driver
is commented out in the GENERIC kernel for now (at least until it stops being
very experimental and hackish).

When it comes to ACA-specific hardware, for now the boot CF slot works. Support for everything else is incoming...
 1.3.24.2 27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.3.24.1 24-Apr-2017  jdolecek use ata_queue_alloc() to dynamically allocate ata_queue for ata channel
 1.3.10.3 03-Dec-2017  jdolecek update from HEAD
 1.3.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.10.1 03-Jan-2014  tls file wdc_acafh.c was added on branch tls-maxphys on 2014-08-20 00:02:43 +0000
 1.3.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.1 03-Jan-2014  yamt file wdc_acafh.c was added on branch yamt-pagecache on 2014-05-22 11:39:29 +0000
 1.3.4.2 18-May-2014  rmind sync with head
 1.3.4.1 03-Jan-2014  rmind file wdc_acafh.c was added on branch rmind-smpnet on 2014-05-18 17:44:55 +0000
 1.41 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.40 20-Oct-2017  jdolecek move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.39 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.38 18-Apr-2015  mlelstv branches: 1.38.6;
detect a4000 hardware only once, then use the result.
 1.37 03-Jan-2014  rkujawa branches: 1.37.6;
Rework handling of Commodore Gayle chip. Avoid ugly struct casts, introduce
proper bus_space accesses and some abstraction layer. All drivers that utilised
Gayle also had to be refactored.

I tried not to break anything more, but this clearly needs more testing...
 1.36 31-Jul-2012  bouyer branches: 1.36.2; 1.36.4;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.35 26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.34 02-Jul-2012  bouyer Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.33 19-Jul-2011  dyoung branches: 1.33.2;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.32 13-Jan-2011  phx Recognize Amiga 600 model.
Patch submited by Radoslaw Kujawa.
 1.31 28-Apr-2008  martin branches: 1.31.22;
Remove clause 3 and 4 from TNF licenses
 1.30 18-Mar-2008  cube branches: 1.30.2; 1.30.4;
Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
 1.29 27-Mar-2006  aymeric branches: 1.29.38; 1.29.58; 1.29.62;
as far as control registers are concerned, the A1200 behaves the same as the
A4000. This allows the use of ATAPI drives on the A1200.
Idesc can really rest in peace now.
 1.28 29-Jan-2006  dsl branches: 1.28.2; 1.28.4; 1.28.6; 1.28.8; 1.28.10;
Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
 1.27 16-Jan-2006  bouyer properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.
 1.26 11-Dec-2005  christos branches: 1.26.2;
merge ktrace-lwp.
 1.25 13-Jun-2005  jmc branches: 1.25.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.24 23-Aug-2004  jandberg Call wdc_init_shadow_regs() after data structures are filled in.
Idea monkeyed from a commit by <mycroft>; reviewed by <aymeric>.
 1.23 20-Aug-2004  thorpej Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
 1.22 14-Aug-2004  thorpej - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
ata_channel. Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
maximum number of drives that can be present on the channel. For now,
this is always 2. Add an ATA_MAXDRIVES constant that places an upper
limit on this value, also currently 2.
 1.21 25-May-2004  thorpej Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.
 1.20 06-Jan-2004  he Make these compile again after the latest adjustments.
 1.19 03-Jan-2004  thorpej More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc
 1.18 03-Jan-2004  thorpej Rename "struct channel_softc" to "struct wdc_channel".
 1.17 01-Jan-2004  thorpej Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.
 1.16 31-Dec-2003  thorpej Simplify allocation of the channel queue.
 1.15 07-Dec-2003  is 2nd half of new wdc register mapping
 1.14 07-Dec-2003  is adapt to the new world of wdc register mappings
 1.13 08-Oct-2003  bouyer Adapt for wdcattach() prototype change.
 1.12 25-Sep-2003  mycroft Hide the use of config_interrupts() in one place.
 1.11 19-Sep-2003  mycroft 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
(it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
*_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
drives more quickly.
 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 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.7 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.6 07-Apr-2001  tron branches: 1.6.2; 1.6.8;
Don't call "is_a1200()" again after its result was stored in the "softc"
structure.
 1.5 21-Feb-2000  aymeric branches: 1.5.6; 1.5.8;
fix a couple of things to handle interrupts more cleanly on the A1200
 1.4 19-Feb-2000  aymeric acknowledge the interrupt to gayle before entering wdc_intr.
This fixes the lost interrupts problem.
fix some glitches on the A1200 too.
 1.3 10-Feb-2000  aymeric fix interrupt handling
I still get lost interrupts on the A1200, but the problem is certainly
elsewhere (not in wdc_amiga).
 1.2 09-Feb-2000  aymeric fix a couple of things to (hopefully) make this work on the A1200
 1.1 05-Feb-2000  mhitch At long last, the MI wdc glue for the Amiga. Tested on my A4000, but not
on an A1200 yet. Configuration of wdc/atapi in GENERIC is currently
commented out to prevent the suprise of an IDE drive changing from sd0
to wd0 (and the first real SCSI drive changing from sd1/sd1 to sd0).
 1.5.8.1 09-Apr-2001  nathanw Catch up with -current.
 1.5.6.3 21-Apr-2001  bouyer Sync with HEAD
 1.5.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.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.5.6.1 21-Feb-2000  bouyer file wdc_amiga.c was added on branch thorpej_scsipi on 2000-11-20 19:58:44 +0000
 1.6.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.1 07-Apr-2001  nathanw file wdc_amiga.c was added on branch nathanw_sa on 2002-02-28 04:07:02 +0000
 1.6.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.10.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.2 25-Aug-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.25.2.2 24-Mar-2008  yamt sync with head.
 1.25.2.1 21-Jun-2006  yamt sync with head.
 1.26.2.1 01-Feb-2006  yamt sync with head.
 1.28.10.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.28.8.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.28.6.1 01-Apr-2006  yamt sync with head.
 1.28.4.1 22-Apr-2006  simonb Sync with head.
 1.28.2.1 09-Sep-2006  rpaulo sync with head
 1.29.62.2 02-Jun-2008  mjf Sync with HEAD.
 1.29.62.1 03-Apr-2008  mjf Sync with HEAD.
 1.29.58.1 24-Mar-2008  keiichi sync with head.
 1.29.38.1 23-Mar-2008  matt sync with HEAD
 1.30.4.1 16-May-2008  yamt sync with head.
 1.30.2.1 18-May-2008  yamt sync with head.
 1.31.22.1 05-Mar-2011  rmind sync with head
 1.33.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.33.2.1 30-Oct-2012  yamt sync with head
 1.36.4.1 18-May-2014  rmind sync with head
 1.36.2.2 03-Dec-2017  jdolecek update from HEAD
 1.36.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.37.6.1 06-Jun-2015  skrll Sync with HEAD
 1.38.6.2 27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.38.6.1 26-Sep-2017  jdolecek switch to ata_queue_alloc() so that this at least compiles
 1.11 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.10 20-Oct-2017  jdolecek move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.9 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.8 31-Jul-2012  bouyer branches: 1.8.2; 1.8.28;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.7 26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.6 02-Jul-2012  bouyer Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.5 19-Jul-2011  dyoung branches: 1.5.2;
Change <machine/bus.h> to <sys/bus.h> throughout.
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 18-Mar-2008  cube branches: 1.3.2; 1.3.4;
Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
 1.2 21-Aug-2007  is branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.12; 1.2.26; 1.2.30;
whitespace cleanup
 1.1 20-Aug-2007  is wdc frontent for the buddha and catweazle Z2 hardware. From an old prototype
by me which was never committed due to lack of testers, adopted to 4.99 and
fixed by Frank Wille.
 1.2.30.2 02-Jun-2008  mjf Sync with HEAD.
 1.2.30.1 03-Apr-2008  mjf Sync with HEAD.
 1.2.26.1 24-Mar-2008  keiichi sync with head.
 1.2.12.2 09-Oct-2007  ad Sync with head.
 1.2.12.1 21-Aug-2007  ad file wdc_buddha.c was added on branch vmlocking on 2007-10-09 16:37:14 +0000
 1.2.8.2 03-Sep-2007  jmcneill Sync with HEAD.
 1.2.8.1 21-Aug-2007  jmcneill file wdc_buddha.c was added on branch jmcneill-pm on 2007-09-03 16:47:13 +0000
 1.2.6.3 24-Mar-2008  yamt sync with head.
 1.2.6.2 03-Sep-2007  yamt sync with head.
 1.2.6.1 21-Aug-2007  yamt file wdc_buddha.c was added on branch yamt-lazymbuf on 2007-09-03 14:22:58 +0000
 1.2.4.2 03-Sep-2007  skrll Sync with HEAD.
 1.2.4.1 21-Aug-2007  skrll file wdc_buddha.c was added on branch nick-csl-alignment on 2007-09-03 10:18:23 +0000
 1.2.2.1 23-Mar-2008  matt sync with HEAD
 1.3.4.1 16-May-2008  yamt sync with head.
 1.3.2.1 18-May-2008  yamt sync with head.
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.8.28.2 27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.8.28.1 24-Apr-2017  jdolecek use ata_queue_alloc() to dynamically allocate ata_queue for ata channel
 1.8.2.1 03-Dec-2017  jdolecek update from HEAD
 1.6 20-Oct-2017  jdolecek move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.5 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.4 04-Sep-2017  phx Remove double device pointers. The pointer is already part of sc_wdcdev.
 1.3 04-Sep-2017  phx Set the correct device data size wdc_xsurf_softc instead of wdc_softc.
 1.2 21-Nov-2012  rkujawa branches: 1.2.2; 1.2.6; 1.2.30; 1.2.34;
Remove confusing comment, misc style.
 1.1 19-Nov-2012  rkujawa Add X-Surf IDE driver.
 1.2.34.1 11-Sep-2017  snj Pull up following revision(s) (requested by phx in ticket #265):
sys/arch/amiga/dev/wdc_xsurf.c: revision 1.3
Set the correct device data size wdc_xsurf_softc instead of wdc_softc.
 1.2.30.4 29-Sep-2017  jdolecek remove <sys/param.h> include again, atavar.h no longer needs it
 1.2.30.3 27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.2.30.2 26-Sep-2017  jdolecek need <sys/param.h> for DEV_BSIZE needed by atavar.h
 1.2.30.1 24-Apr-2017  jdolecek use ata_queue_alloc() to dynamically allocate ata_queue for ata channel
 1.2.6.3 03-Dec-2017  jdolecek update from HEAD
 1.2.6.2 25-Feb-2013  tls resync with head
 1.2.6.1 21-Nov-2012  tls file wdc_xsurf.c was added on branch tls-maxphys on 2013-02-25 00:28:22 +0000
 1.2.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.2.2.1 21-Nov-2012  yamt file wdc_xsurf.c was added on branch yamt-pagecache on 2013-01-16 05:32:42 +0000
 1.42 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.41 24-Apr-2021  thorpej branches: 1.41.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.40 27-Oct-2012  chs branches: 1.40.18; 1.40.28; 1.40.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.39 20-Dec-2010  matt branches: 1.39.8; 1.39.18;
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.38 13-Jun-2008  cegger branches: 1.38.18;
use device_lookup_private to get softc
 1.37 05-Mar-2007  he branches: 1.37.40; 1.37.42; 1.37.44; 1.37.46; 1.37.48;
Cast to char* before doing pointer arithmetic.
 1.36 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 08-Mar-2006  lukem branches: 1.35.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.34 11-Dec-2005  christos branches: 1.34.4; 1.34.6; 1.34.8; 1.34.10;
merge ktrace-lwp.
 1.33 28-Mar-2004  mhitch branches: 1.33.16;
Remove license clauses 3 and 4 in my licenses.
 1.32 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.31 09-Apr-2003  thorpej branches: 1.31.2;
Use PAGE_SIZE rather than NBPG.
 1.30 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.29 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.28 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.27 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.26 25-Apr-2001  bouyer branches: 1.26.2; 1.26.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.25 10-Jan-1999  tron branches: 1.25.8; 1.25.20;
Don't use void pointer for arithmetic.
 1.24 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.23 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.22 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.21 12-Jan-1998  thorpej Adjust for changes to config.
 1.20 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.19 23-Dec-1996  veego branches: 1.19.8; 1.19.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.18 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.17 13-Oct-1996  christos backout previous kprintf change
 1.16 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.15 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.14 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.13 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.12 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.11 15-Mar-1996  mhitch Correct 53c710 initialization for the A4000T. Remove the A4000T probe
debugging output.
 1.10 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.9 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.7 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 16-Jun-1994  chopps fix boot diag output.
 1.2 14-Jun-1994  chopps don't flush cache on context switches for 040's, reduce flushing
on dma operations. code from me and Michael Hitch
 1.1 12-May-1994  chopps new scsi siop drivers and zthreebus support from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.19.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.19.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.25.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.25.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.26.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.26.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.26.8.1 25-Apr-2001  nathanw file wesc.c was added on branch nathanw_sa on 2002-02-28 04:07:02 +0000
 1.26.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.26.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.31.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.31.2.1 03-Aug-2004  skrll Sync with HEAD
 1.33.16.2 03-Sep-2007  yamt sync with head.
 1.33.16.1 21-Jun-2006  yamt sync with head.
 1.34.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.34.8.1 13-Mar-2006  yamt sync with head.
 1.34.6.1 22-Apr-2006  simonb Sync with head.
 1.34.4.1 09-Sep-2006  rpaulo sync with head
 1.35.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.48.1 18-Jun-2008  simonb Sync with head.
 1.37.46.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.37.44.1 04-May-2009  yamt sync with head.
 1.37.42.1 17-Jun-2008  yamt sync with head.
 1.37.40.1 29-Jun-2008  mjf Sync with HEAD.
 1.38.18.1 05-Mar-2011  rmind sync with head
 1.39.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.39.8.1 30-Oct-2012  yamt sync with head
 1.40.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.40.28.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.40.18.2 20-Jul-2016  pgoyette Redo previous. Rather than separately extracting the device_t, we can
rely on sc->sc_dev when we need to call device_release().
 1.40.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.41.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 11-Dec-2005  christos branches: 1.8.74; 1.8.76; 1.8.78;
merge ktrace-lwp.
 1.7 04-Jan-2004  jandberg Keymap updates.
- us/de keymaps based on ite keymaps, converted by Gunther Nikl
(with slight adjustments by me)
- es/fr/sv keymaps similarly based on ite keymaps
- removed the commented out keymaps
- some small fixes to the rest of the existing keymaps
 1.6 25-Oct-2003  jandberg Add polish wscons keymaps for amiga.

From Pawel Chwalowski in port-amiga/22961.
 1.5 30-May-2002  thorpej branches: 1.5.6;
Put the __unused__ attribute one some unused kbd maps.
 1.4 28-Jan-2002  aymeric branches: 1.4.8;
add __KERNEL_RCSID as suggested by Luke Mewburn
 1.3 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.2 13-Jan-2002  jandberg wskbd updates.
kbd.c: Now identifies itself as WSKBD_TYPE_AMIGA.
wskbdmap_amiga.c: Updated de/dk/sv/no keymaps.
 1.1 02-Feb-2001  is branches: 1.1.2; 1.1.6; 1.1.10;
Initial, still incomplete wscons support by Jukka Andberg, PR 11068
 1.1.10.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.10.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 02-Feb-2001  bouyer file wskbdmap_amiga.c was added on branch thorpej_scsipi on 2001-02-11 19:08:48 +0000
 1.4.8.1 09-Jul-2002  gehenna catch up with -current.
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.78.1 16-May-2008  yamt sync with head.
 1.8.76.1 18-May-2008  yamt sync with head.
 1.8.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 02-Feb-2001  is branches: 1.1.2; 1.1.128; 1.1.130; 1.1.132;
Initial, still incomplete wscons support by Jukka Andberg, PR 11068
 1.1.132.1 16-May-2008  yamt sync with head.
 1.1.130.1 18-May-2008  yamt sync with head.
 1.1.128.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 02-Feb-2001  bouyer file wskbdmap_amiga.h was added on branch thorpej_scsipi on 2001-02-11 19:08:49 +0000
 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 06-Feb-2019  mrg branches: 1.35.14;
properly check SCI_CSR_DREQ in one place.
 1.34 22-Jan-2014  christos branches: 1.34.30;
gcc-4.8.x unused variable fixes
 1.33 27-Oct-2012  chs branches: 1.33.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.32 11-Dec-2005  christos branches: 1.32.112; 1.32.122;
merge ktrace-lwp.
 1.31 13-Jun-2005  jmc Fix a ton of const/volatile issues shown with new warning flags
 1.30 28-Mar-2004  mhitch Remove license clauses 3 and 4 in my licenses.
 1.29 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.28 02-Oct-2002  thorpej branches: 1.28.6;
Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.25 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.24 25-Apr-2001  bouyer branches: 1.24.2; 1.24.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.23 05-Dec-1998  mjacob branches: 1.23.10; 1.23.22;
Update HBAs to incorporate the new max_lun property.
 1.22 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.21 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.20 12-Jan-1998  thorpej Adjust for changes to config.
 1.19 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.18 23-Dec-1996  veego branches: 1.18.8; 1.18.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.17 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.16 13-Oct-1996  christos backout previous kprintf change
 1.15 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.14 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.13 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.12 28-Apr-1996  mhitch Fix warning from word transfer pseudo-dma function.
 1.11 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.10 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.7 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 29-May-1994  chopps 5380 driver update from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.18.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.18.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.23.22.1 21-Jun-2001  nathanw Catch up to -current.
 1.23.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.24.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.24.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.24.8.1 25-Apr-2001  nathanw file wstsc.c was added on branch nathanw_sa on 2002-02-28 04:07:03 +0000
 1.24.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.24.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.28.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.28.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.6.1 03-Aug-2004  skrll Sync with HEAD
 1.32.122.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.32.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.32.112.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.32.112.1 30-Oct-2012  yamt sync with head
 1.33.2.1 18-May-2014  rmind sync with head
 1.34.30.1 10-Jun-2019  christos Sync with HEAD
 1.35.14.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.36.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.5 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.4 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.3 24-Apr-2021  thorpej branches: 1.3.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.2 09-Aug-2013  rkujawa branches: 1.2.2; 1.2.6; 1.2.10; 1.2.50;
Fix style.
 1.1 08-Aug-2013  rkujawa Add preliminary support for Individual Computers new X-Surf 100 network card.
 1.2.50.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.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 09-Aug-2013  tls file xsh.c was added on branch tls-maxphys on 2014-08-20 00:02:43 +0000
 1.2.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.6.1 09-Aug-2013  yamt file xsh.c was added on branch yamt-pagecache on 2014-05-22 11:39:29 +0000
 1.2.2.2 28-Aug-2013  rmind sync with head
 1.2.2.1 09-Aug-2013  rmind file xsh.c was added on branch rmind-smpnet on 2013-08-28 23:59:10 +0000
 1.3.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.1 08-Aug-2013  rkujawa branches: 1.1.2; 1.1.6; 1.1.10;
Add preliminary support for Individual Computers new X-Surf 100 network card.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 08-Aug-2013  tls file xshvar.h was added on branch tls-maxphys on 2014-08-20 00:02:43 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 08-Aug-2013  yamt file xshvar.h was added on branch yamt-pagecache on 2014-05-22 11:39:29 +0000
 1.1.2.2 28-Aug-2013  rmind sync with head
 1.1.2.1 08-Aug-2013  rmind file xshvar.h was added on branch rmind-smpnet on 2013-08-28 23:59:10 +0000
 1.6 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.5 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.4 24-Apr-2021  thorpej branches: 1.4.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.3 19-Nov-2012  rkujawa branches: 1.3.52;
Add X-Surf IDE driver.
 1.2 29-Oct-2012  rkujawa Apparently, clockport present at offset 0xC00 is the first clockport.
 1.1 15-May-2012  rkujawa branches: 1.1.2; 1.1.4; 1.1.6;
- Split X-Surf driver from if_ne_zbus, rework, add support for clockports present on X-Surf boards.
- Add gencp(4), a driver for generic clockports (it just needs a base address).

Approved by phx.
 1.1.6.2 25-Feb-2013  tls resync with head
 1.1.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.4.2 02-Jun-2012  mrg sync to latest -current.
 1.1.4.1 15-May-2012  mrg file xsurf.c was added on branch jmcneill-usbmp on 2012-06-02 11:08:50 +0000
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 23-May-2012  yamt sync with head.
 1.1.2.1 15-May-2012  yamt file xsurf.c was added on branch yamt-pagecache on 2012-05-23 10:07:40 +0000
 1.3.52.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.4.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.1 15-May-2012  rkujawa branches: 1.1.2; 1.1.4;
- Split X-Surf driver from if_ne_zbus, rework, add support for clockports present on X-Surf boards.
- Add gencp(4), a driver for generic clockports (it just needs a base address).

Approved by phx.
 1.1.4.2 02-Jun-2012  mrg sync to latest -current.
 1.1.4.1 15-May-2012  mrg file xsurfvar.h was added on branch jmcneill-usbmp on 2012-06-02 11:08:51 +0000
 1.1.2.2 23-May-2012  yamt sync with head.
 1.1.2.1 15-May-2012  yamt file xsurfvar.h was added on branch yamt-pagecache on 2012-05-23 10:07:40 +0000
 1.6 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.5 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.4 24-Apr-2021  thorpej branches: 1.4.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.3 01-Jun-2015  phx branches: 1.3.32;
Removed unused variable to make it compile again.
 1.2 26-Nov-2012  rkujawa branches: 1.2.2; 1.2.6; 1.2.18;
Try to make z3rambd less crude. Also support BigRamPlus, FastLane Z3 RAM and
DKB3128.
 1.1 25-Nov-2012  rkujawa Add z3rambd driver, it allows using Zorro III RAM boards as block devices.
This makes sense in machines equipped with RAM on accelerator boards, where
difference between accelerator RAM and Zorro III RAM is significant. Hacks
were needed in amiga_init.c and zbus.c, but they are only enabled if this
driver is present in kernel. Otherwise user will get the usual behaviour.
 1.2.18.1 06-Jun-2015  skrll Sync with HEAD
 1.2.6.3 03-Dec-2017  jdolecek update from HEAD
 1.2.6.2 25-Feb-2013  tls resync with head
 1.2.6.1 26-Nov-2012  tls file z3rambd.c was added on branch tls-maxphys on 2013-02-25 00:28:22 +0000
 1.2.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.2.2.1 26-Nov-2012  yamt file z3rambd.c was added on branch yamt-pagecache on 2013-01-16 05:32:42 +0000
 1.3.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.4.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.1 26-Nov-2012  rkujawa branches: 1.1.2; 1.1.6;
Try to make z3rambd less crude. Also support BigRamPlus, FastLane Z3 RAM and
DKB3128.
 1.1.6.2 25-Feb-2013  tls resync with head
 1.1.6.1 26-Nov-2012  tls file z3rambdvar.h was added on branch tls-maxphys on 2013-02-25 00:28:22 +0000
 1.1.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.1 26-Nov-2012  yamt file z3rambdvar.h was added on branch yamt-pagecache on 2013-01-16 05:32:42 +0000
 1.78 03-May-2023  phx Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.
 1.77 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.76 27-Apr-2021  thorpej branches: 1.76.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.75 04-Oct-2017  rkujawa branches: 1.75.20;
Update driver to support firmware v1.5+.

From Lukas F. Hartmann. With hopeful style fixes from me.
 1.74 03-Oct-2016  rkujawa Add a driver for MNTMN VA2000.

Supports accelerated wsdisplay console and running X via wsfb driver.
 1.73 26-Nov-2012  rkujawa branches: 1.73.14; 1.73.18;
Try to make z3rambd less crude. Also support BigRamPlus, FastLane Z3 RAM and
DKB3128.
 1.72 25-Nov-2012  rkujawa Add z3rambd driver, it allows using Zorro III RAM boards as block devices.
This makes sense in machines equipped with RAM on accelerator boards, where
difference between accelerator RAM and Zorro III RAM is significant. Hacks
were needed in amiga_init.c and zbus.c, but they are only enabled if this
driver is present in kernel. Otherwise user will get the usual behaviour.
 1.71 25-Nov-2012  christos readability fix.
 1.70 25-Nov-2012  rkujawa Use constants, not magic values.
 1.69 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.68 19-Jan-2012  rkujawa branches: 1.68.6;
Tons of enchancements to MD PCI code:
- The G-REX 4000 and G-REX 1200 are now really supported and working (still only 1st slot but the rest are a matter of time).
- Add bridge identification to p5pb, simplifies the driver and make it more user-friendly.
- Retire P5PB_GENFB and P5PB_OLD_FIRMWARE options, these are now handled automatically, depending on used hardware and firmware.
- Add PCI bus reconfiguration support to p5pb (PCI_NETBSD_CONFIGURE), allows using G-REX without boot to AmigaOS.
- Bring p5pb registers desription up to date with my knowledge.
- Add a lot of debugging code to p5pb (enabled by P5PB_DEBUG kernel option).
- Fix PCI_NETBSD_CONFIGURE in mppb (now it really works).
- Fix quirk handling in zbus.
- Update GENERIC.in and regen the kernel configs.
- Misc cleanup.
 1.67 21-Sep-2011  rkujawa branches: 1.67.2; 1.67.6;
Fix build for both amiga and amigappc (discussed with christos).
 1.66 20-Sep-2011  christos try to make this compile again.
 1.65 17-Sep-2011  rkujawa Add driver for Prometheus PCI bridge.
Change approved by phx.
 1.64 04-Aug-2011  rkujawa Add basic PCI support for amiga port.
Add missing bus_space(9) methods needed for MI PCI.
Add p5pb(4) - Phase5 PCI bridge driver (and the man page).
Add quirks table to zbus(4) - needed for p5pb.
Change approved by phx.
 1.63 03-Jun-2011  matt CFATTACH_DECL_NEW, device_t, cfdata_t
 1.62 20-Dec-2010  matt branches: 1.62.2; 1.62.6;
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.61 17-Oct-2007  garbled branches: 1.61.42;
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.60 20-Aug-2007  is branches: 1.60.2;
First part of amigappc support patches by Frank Wille.
 1.59 20-Aug-2007  is fix capitalization error
 1.58 20-Aug-2007  is Fix spelling error.
 1.57 04-Mar-2007  christos branches: 1.57.2; 1.57.10; 1.57.14; 1.57.18;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.56 11-Dec-2005  christos branches: 1.56.26;
merge ktrace-lwp.
 1.55 13-Jun-2005  jmc branches: 1.55.2;
Fix a ton of const/volatile issues shown with new warning flags
 1.54 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.53 04-Jan-2004  wiz Spell controller with two ls. Inspired by miod@openbsd.
 1.52 19-Dec-2003  is man/prod id submitted by Pavel Chwalowski in PR 23789.
 1.51 01-Apr-2003  thorpej branches: 1.51.2;
Use PAGE_SIZE rather than NBPG.
 1.50 01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 1.49 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.48 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.47 25-Apr-2002  aymeric o replace definitions by declarations in header files
o put definitions where due
o cleanup some types (u_int -> vaddr_t's for example)
o minor other cleanup
 1.46 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.45 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.44 13-Sep-2000  is branches: 1.44.4; 1.44.8;
Missing piece of PowerPC support.
 1.43 25-Nov-1999  is Jens, not Joerg
 1.42 25-Nov-1999  is Add a few boards we know about.
This should really be table-driven and optional.
 1.41 25-Sep-1999  is branches: 1.41.2; 1.41.8;
vm_offset_t -> vaddr_t/paddr_t
 1.40 22-Jun-1999  is Align adresses better
 1.39 31-Mar-1999  mhitch branches: 1.39.4;
Add CyberStorm MK III.
 1.38 11-Nov-1998  veego Add the Ariadne II.
 1.37 12-Jan-1998  thorpej Adjust for changes to config.
 1.36 19-Oct-1997  is zbus.c
 1.35 19-Oct-1997  veego Add an entry for the CyberVison 64/3D to the aconftab and to the
preconftab list.
 1.34 15-Sep-1997  is A few more boards. This really should be split into a seperate file, only
active if the kernel has ZBUS_VERBOSE similar to PCI, EISA, (podulebus?),
but I don't have that stuff ready yet.
 1.33 27-Mar-1997  veego branches: 1.33.4;
s/ae/le/ for the recent Ariadne changes.
 1.32 05-Mar-1997  veego branches: 1.32.2;
PicassoIV and Domino proto 16M product id's.
 1.31 06-Jan-1997  is Add manufacturer/product id for Apollo-68060 accellerator board.
 1.30 31-Dec-1996  is Add names for some more Phase5 boards.
 1.29 23-Dec-1996  veego Get rid of __BROKEN_INDIRECT_CONFIG.
 1.28 09-Dec-1996  is It turned out that my orginal docs were wrong wrt. Blizzard IV
scsi... it is NOT nearly identical to the Blizzard 2060 scsi option.
Make the name reflect this. Driver cleanup will follow.
 1.27 17-Oct-1996  is Change Blizzard IV/1260/2060 to the name used by the driver.
While we're here, clean up a few other entries.
 1.26 13-Oct-1996  christos backout previous kprintf change
 1.25 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.24 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.23 09-Aug-1996  is Add manu/prod id for the DMI resolver board here. (No, no driver yet)
 1.22 22-Jul-1996  is Note Blizzard IV and Blizzard 2060 (scsi?) options. While we're here,
correct a typo in a comment.
 1.21 17-Jul-1996  is Being bored, decided to scan the existing drivers for further additions
to the "not configured" list:
Added some devices, replaced an obvious placeholder.
 1.20 17-Jul-1996  is Add two manufacturer/product id combinations which I stumbled over analyzing
an unrelated bug report. This will make kernel startups a bit more readable
in the presence of unsupported hardware.
Information contributed by Andreas Bussjaeger.
 1.19 19-May-1996  veego - grf_cl.c, grf_clreg.h: added support for Piccolo SD64
- grf_cv.c, grf_cvreg.h, ite_cv.c: some cleanups
- grf_rh.c, grf_rhreg.h, grf_rt.c: new blank ioctl and some KNF
- grf_et.c, grf_etreg.h, ite_et.c: new graphics driver for et4000 based board
(oMniBus, Domino and Merlin)
- grfabs_cc: fix PR#2034
- grfvar.h: new grfunit for GRF_ET4000_UNIT
- scsidefs.h: no longer useful
- zbus.c: new entries for: Piccolo SD64, oMniBus, Domino and Merlin
 1.18 09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.17 28-Mar-1996  is Emplant SCSI driver backend by Sean Riddle and Bo Najdrovsky.
 1.16 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.15 06-Mar-1996  is Altais graphics board support, and some nicer formatting of preconftab.
Closes PR #1812 by myself.
 1.14 02-Mar-1996  veego Updated for the new CyberVision64 console
gen_cvtab.c is no longer needed
 1.13 27-Dec-1995  chopps fixup the table (pr#980) from Ignatios Souvatzis
 1.12 09-Oct-1995  chopps new cybervision 64 grf from Bernd Ernesti <bernd@arresum.inka.de> and others
update config files (adding missing scsibus entry for aftsc0)
 1.11 07-Oct-1995  chopps new quicknet ethernet driver from Kortelainen Mika <k125374@cs.tut.fi>
 1.10 07-Oct-1995  chopps fixes for fastlane from Daniel Widenfalk <t94dwi@student.tdb.uu.se>
 1.9 30-Sep-1995  chopps fix typo (pr#1224)
 1.8 18-Aug-1995  chopps change for a2410 from is@Beverly.Rhein.DE (Ignatios Souvatzis)
 1.7 18-Aug-1995  chopps new Ariadne ether from Bernd Ernesti <bernd@arresum.inka.de>
 1.6 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.5 04-Jul-1995  chopps misc cleanup, better tty alloc for mfc. from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 23-Apr-1995  chopps new grfcl driver submitted by Ezra Story <ezy@panix.com>
 1.3 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.2 05-Jan-1995  chopps fix a couple small bugs pointed out by Michael
 1.1 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.32.2.2 05-Mar-1997  veego PicassoIV and Domino proto 16M product id's.
 1.32.2.1 05-Mar-1997  veego file zbus.c was added on branch is-newarp on 1997-03-05 22:41:04 +0000
 1.33.4.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.39.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.41.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.41.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.44.8.4 03-Jan-2003  thorpej Sync with HEAD.
 1.44.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.44.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.44.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.44.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.44.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.44.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.51.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.51.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.51.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.51.2.1 03-Aug-2004  skrll Sync with HEAD
 1.55.2.1 03-Sep-2007  yamt sync with head.
 1.56.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.57.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.57.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.57.10.1 03-Oct-2007  garbled Sync with HEAD
 1.57.2.1 09-Oct-2007  ad Sync with head.
 1.60.2.1 06-Nov-2007  matt sync with HEAD
 1.61.42.2 12-Jun-2011  rmind sync with head
 1.61.42.1 05-Mar-2011  rmind sync with head
 1.62.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.62.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.67.6.1 18-Feb-2012  mrg merge to -current.
 1.67.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.67.2.2 30-Oct-2012  yamt sync with head
 1.67.2.1 17-Apr-2012  yamt sync with head
 1.68.6.3 03-Dec-2017  jdolecek update from HEAD
 1.68.6.2 25-Feb-2013  tls resync with head
 1.68.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.73.18.1 04-Nov-2016  pgoyette Sync with HEAD
 1.73.14.1 05-Oct-2016  skrll Sync with HEAD
 1.75.20.1 13-May-2021  thorpej Sync with HEAD.
 1.76.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.10 21-Sep-2011  christos no parameter names.
 1.9 21-Sep-2011  rkujawa Fix build for both amiga and amigappc (discussed with christos).
 1.8 02-Feb-2010  phx Fix compilation warnings and errors with amigappc.
 1.7 04-Mar-2007  christos branches: 1.7.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 09-Apr-2003  thorpej branches: 1.6.18; 1.6.56;
Use PAGE_SIZE rather than NBPG.
 1.5 25-Apr-2002  aymeric o replace definitions by declarations in header files
o put definitions where due
o cleanup some types (u_int -> vaddr_t's for example)
o minor other cleanup
 1.4 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.3 20-Sep-2000  is branches: 1.3.4; 1.3.8;
On AmigaPPC, the kernel directly maps the i/o range.
 1.2 25-Sep-1999  is branches: 1.2.2;
vm_offset_t -> vaddr_t/paddr_t
 1.1 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.3.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.3.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.56.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.18.1 03-Sep-2007  yamt sync with head.
 1.7.44.1 11-Mar-2010  yamt sync with head
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 11-Feb-1994  chopps Add missing Id's
 1.1 26-Jan-1994  mw Integrate recent changes done to the amiga branch. Includes support
for the '40.
Support for more scsi controllers (zeus, magnum)
Support for more tapes (in st.c)
New custom chip console code integrated.
 1.48 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.47 24-Apr-2021  thorpej branches: 1.47.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.46 12-Nov-2019  msaitoh branches: 1.46.10;
Add missing initialization of sc_dev.
 1.45 27-Oct-2012  chs branches: 1.45.18; 1.45.28; 1.45.30; 1.45.38; 1.45.42;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.44 20-Dec-2010  matt branches: 1.44.8; 1.44.18;
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.43 16-Oct-2009  phx branches: 1.43.4;
Fixed typos in zssc_dump() (DEBUG).
 1.42 19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.41 13-Jun-2008  cegger use device_lookup_private to get softc
 1.40 05-Mar-2007  he branches: 1.40.40; 1.40.42; 1.40.44; 1.40.46; 1.40.48;
Cast to char* before doing pointer arithmetic.
 1.39 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.38 08-Mar-2006  lukem branches: 1.38.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.37 11-Dec-2005  christos branches: 1.37.4; 1.37.6; 1.37.8; 1.37.10;
merge ktrace-lwp.
 1.36 28-Mar-2004  mhitch branches: 1.36.16;
Remove license clauses 3 and 4 in my licenses.
 1.35 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.34 09-Apr-2003  thorpej branches: 1.34.2;
Use PAGE_SIZE rather than NBPG.
 1.33 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 28-Jan-2002  aymeric add __KERNEL_RCSID as suggested by Luke Mewburn
 1.30 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.29 25-Apr-2001  bouyer branches: 1.29.2; 1.29.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.28 10-Jan-1999  tron branches: 1.28.8; 1.28.20;
Don't use void pointer for arithmetic.
 1.27 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.26 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.25 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.24 12-Jan-1998  thorpej Adjust for changes to config.
 1.23 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.22 23-Dec-1996  veego branches: 1.22.8; 1.22.10;
Get rid of __BROKEN_INDIRECT_CONFIG.
 1.21 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.20 13-Oct-1996  christos backout previous kprintf change
 1.19 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.18 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.17 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.16 21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
- Added support for multiple floppy drives
- CyberVision64:
- has now a real console mode
- another bugfix for boards with the new S3 chip
- Ariadne:
- fixed crashes with aeput (mbuf failure)
 1.15 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.14 15-Mar-1996  mhitch Correct 53c710 initialization for the A4000T. Remove the A4000T probe
debugging output.
 1.13 09-Oct-1995  chopps add prototypes for isr stuff fixes pr# 1284 and 1569
 1.12 16-Sep-1995  chopps Add minimal dumpfile support.
Fix a bug in pt_enter_ptpage which caused MMU faults on low-mem conditions.
Change siop drivers to better handle sync.
Remove diag. done for ide -- its redundant as the ROM does similar.
fixed ite_filter to not panic if typing before the device is fully setup
All thanks to osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.11 18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.10 12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.9 05-Jan-1995  chopps catchup with scsi changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.8 28-Dec-1994  chopps consolidate the zbusses. le support for multiple tx buffs and full use of 32k
RAM. AGA dbl PAL mode added for console. Many changes to siop--most not
yet done. All from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 16-Jun-1994  chopps fix boot diag output.
 1.4 14-Jun-1994  chopps don't flush cache on context switches for 040's, reduce flushing
on dma operations. code from me and Michael Hitch
 1.3 22-May-1994  chopps an ide driver and hack reload device to do symbols.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.2 12-May-1994  chopps update from osymh@gemini.oscs.montana.edu (Michael L. Hitch) add support
for zthreebus siop scsi drivers and better machine recocgnition.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.22.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.22.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.28.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.28.8.2 29-Mar-2001  bouyer Make these pass a compile test on i386.
 1.28.8.1 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.29.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.29.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.29.8.1 25-Apr-2001  nathanw file zssc.c was added on branch nathanw_sa on 2002-02-28 04:07:04 +0000
 1.29.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.29.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.34.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.34.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.34.2.1 03-Aug-2004  skrll Sync with HEAD
 1.36.16.2 03-Sep-2007  yamt sync with head.
 1.36.16.1 21-Jun-2006  yamt sync with head.
 1.37.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.37.8.1 13-Mar-2006  yamt sync with head.
 1.37.6.1 22-Apr-2006  simonb Sync with head.
 1.37.4.1 09-Sep-2006  rpaulo sync with head
 1.38.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.40.48.1 18-Jun-2008  simonb Sync with head.
 1.40.46.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.40.44.3 11-Mar-2010  yamt sync with head
 1.40.44.2 20-Jun-2009  yamt sync with head
 1.40.44.1 04-May-2009  yamt sync with head.
 1.40.42.1 17-Jun-2008  yamt sync with head.
 1.40.40.1 29-Jun-2008  mjf Sync with HEAD.
 1.43.4.1 05-Mar-2011  rmind sync with head
 1.44.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.8.1 30-Oct-2012  yamt sync with head
 1.45.42.1 14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #425):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.

Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.

Add missing initialization of sc_dev.
 1.45.38.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.45.30.1 14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1439):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.


Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.


Add missing initialization of sc_dev.
 1.45.28.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.45.18.1 19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.46.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.47.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.10 28-Dec-1994  mycroft Clean up deleted files.
 1.9 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.8 26-Oct-1994  cgd new RCS ID format.
 1.7 06-Oct-1994  chopps branches: 1.7.2;
fix a thinko in gvp diag. Add 4091 driver from Michael Hitch
(osymh@gemini.oscs.montana.edu)
 1.6 16-Jun-1994  chopps fix boot diag output.
 1.5 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.4 04-Jun-1994  chopps started out cleaning up amiga_init.c ended up touching alot of files.
 1.3 03-Jun-1994  chopps z buses early config support, needs testing.
 1.2 22-May-1994  chopps an ide driver and hack reload device to do symbols.
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.1 12-May-1994  chopps new scsi siop drivers and zthreebus support from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.7.2.2 06-Oct-1994  chopps fix a thinko in gvp diag. Add 4091 driver from Michael Hitch
(osymh@gemini.oscs.montana.edu)
 1.7.2.1 06-Oct-1994  chopps file zthreebus.c was added on branch netbsd-1-0 on 1994-10-06 19:06:44 +0000
 1.4 28-Dec-1994  mycroft Clean up deleted files.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 04-Jun-1994  chopps started out cleaning up amiga_init.c ended up touching alot of files.
 1.1 12-May-1994  chopps new scsi siop drivers and zthreebus support from
osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.12 28-Dec-1994  mycroft Clean up deleted files.
 1.11 01-Dec-1994  chopps bring up to current. change sun to sunos. handle changes in device
open params and autoconf match function params.
 1.10 26-Oct-1994  cgd new RCS ID format.
 1.9 16-Jul-1994  chopps branches: 1.9.2;
ed driver for 8390 based ethernet boards (currently only hydra supported)
original code from Timo Rossi <trossi@bedivere.cc.jyu.fi>, some major
style changes (KNF, pull i386 comments in, et al.) plus converting to
config.new by me.
 1.8 16-Jun-1994  chopps branches: 1.8.2;
fix boot diag output.
 1.7 13-Jun-1994  chopps some cleanup and various fixes for new fs code. plus some general
fixes from from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.6 04-Jun-1994  chopps started out cleaning up amiga_init.c ended up touching alot of files.
 1.5 03-Jun-1994  chopps z buses early config support, needs testing.
 1.4 26-May-1994  chopps fix typo
 1.3 25-May-1994  chopps add beginning of support for series I controllers doesn't work yet.
 1.2 11-May-1994  chopps general cleanup including boot diag messages.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.8.2.1 16-Jul-1994  cgd update from trunk, per chopps
 1.9.2.2 16-Jul-1994  chopps ed driver for 8390 based ethernet boards (currently only hydra supported)
original code from Timo Rossi <trossi@bedivere.cc.jyu.fi>, some major
style changes (KNF, pull i386 comments in, et al.) plus converting to
config.new by me.
 1.9.2.1 16-Jul-1994  chopps file ztwobus.c was added on branch netbsd-1-0 on 1994-07-16 02:26:31 +0000
 1.4 28-Dec-1994  mycroft Clean up deleted files.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 04-Jun-1994  chopps started out cleaning up amiga_init.c ended up touching alot of files.
 1.1 08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.1 03-May-2023  phx Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.
 1.1 03-May-2023  phx Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.
 1.1 03-May-2023  phx Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.
 1.2 05-Feb-2024  andvar fix various typos in comments.
 1.1 03-May-2023  phx Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.
 1.1 03-May-2023  phx Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.
 1.2 31-Aug-2025  rillig sys/arch: fix typos in comments
 1.1 03-May-2023  phx Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.
 1.1 03-May-2023  phx Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.

RSS XML Feed