Home | History | Annotate | only in /src/sys/arch/sun3/dev
History log of /src/sys/arch/sun3/dev
RevisionDateAuthorComments
 1.3 19-Nov-1996  gwr kill some outdated stuff
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.2 13-Oct-1995  gwr Remove (again) things accidently revived by cvs tag...
 1.1 30-Jul-1993  glass add todo list for dev directory
 1.3 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.2 03-May-2003  wiz branches: 1.2.230;
DMA, not dma nor Dma.
 1.1 29-Oct-1995  gwr branches: 1.1.2;
New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.2 29-Oct-1995  gwr New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.1 29-Oct-1995  gwr file am9516.h was added on branch netbsd-1-1 on 1995-10-29 21:19:07 +0000
 1.2.230.1 02-Aug-2025  perseant Sync with HEAD
 1.10 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.9 11-Dec-2005  christos branches: 1.9.202;
merge ktrace-lwp.
 1.8 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.7 07-Aug-2003  agc branches: 1.7.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 15-Jul-2003  lukem __KERNEL_RCSID()
 1.5 03-Aug-2002  itojun branches: 1.5.6;
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.4 19-Sep-2001  thorpej branches: 1.4.4; 1.4.12; 1.4.14;
machine/fbio.h -> dev/sun/fbio.h
 1.3 05-Sep-2001  tsutsui branches: 1.3.2;
Remove register prefixes.
 1.2 10-Apr-1995  gwr branches: 1.2.44; 1.2.48;
Oops, sparc -> sun3
 1.1 10-Mar-1995  gwr New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.2.48.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.48.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.48.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.44.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.3.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.4.14.1 07-Aug-2002  lukem Pull up revision 1.5 (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.4.12.1 31-Aug-2002  gehenna catch up with -current.
 1.4.4.2 13-Aug-2002  nathanw Catch up to -current.
 1.4.4.1 19-Sep-2001  nathanw file bt_subr.c was added on branch nathanw_sa on 2002-08-13 02:18:59 +0000
 1.5.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.9.202.1 02-Aug-2025  perseant Sync with HEAD
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 10-Mar-1995  gwr branches: 1.1.68;
New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.1.68.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.68.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.68.1 03-Aug-2004  skrll Sync with HEAD
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.2 07-Aug-2003  agc branches: 1.2.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 10-Mar-1995  gwr branches: 1.1.68;
New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.1.68.4 24-Jan-2005  skrll Sync with HEAD.
 1.1.68.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.68.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.68.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.39 21-Dec-2024  tsutsui Make local dev_type_*() functions static.
 1.38 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.37 20-Dec-2023  thorpej branches: 1.37.2;
Remove unnecessary <sys/malloc.h>.
 1.36 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.35 16-Mar-2014  dholland branches: 1.35.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.34 28-Jun-2008  tsutsui branches: 1.34.30; 1.34.40; 1.34.46;
Split softc/device_t, with misc cosmetic changes.
 1.33 08-Jun-2008  tsutsui branches: 1.33.2;
Use device_private() and device_lookup_private() to get softc
and to see if device unit is vaild.
 1.32 12-Mar-2007  tsutsui branches: 1.32.38; 1.32.40; 1.32.42; 1.32.44;
Fix printf formats in #ifdef DEBUG.
 1.31 04-Mar-2007  christos branches: 1.31.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30 29-Mar-2006  thorpej branches: 1.30.14;
Use device_cfdata().
 1.29 28-Mar-2006  thorpej Use device_unit().
 1.28 11-Dec-2005  christos branches: 1.28.4; 1.28.6; 1.28.8; 1.28.10; 1.28.12;
merge ktrace-lwp.
 1.27 19-Jun-2005  thorpej branches: 1.27.2;
Move common Sun ID PROM definitions into <dev/sun/idprom.h>.
 1.26 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.25 07-Aug-2003  agc branches: 1.25.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.24 15-Jul-2003  lukem __KERNEL_RCSID()
 1.23 23-Oct-2002  jdolecek branches: 1.23.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.22 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.21 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.20 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.19 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.18 30-May-2002  thorpej Statements must follow labels.
 1.17 19-Sep-2001  thorpej branches: 1.17.4; 1.17.12;
machine/fbio.h -> dev/sun/fbio.h
 1.16 29-Jun-2000  mrg branches: 1.16.2; 1.16.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.15 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.14 08-Feb-1998  gwr branches: 1.14.14; 1.14.24;
Rewrite the match/attch routines to use the P4 register
(when it exists). Also get the size right; other fixes.
 1.13 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.12 12-Jan-1998  thorpej branches: 1.12.2;
Update for changes to config.
 1.11 06-Oct-1997  gwr Use vm_offset_t to represent control space addresses, because
they are more like physical addresses in that you can not just
dereference a pointer to access the space. (Also, if you use a
pointer type for such things, gdb will _try_ to deference it.)
 1.10 19-Feb-1997  gwr branches: 1.10.4;
Get the screen size right on the 3/260 (Fixes PR#2402)
 1.9 17-Dec-1996  gwr branches: 1.9.6;
Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.8 13-Oct-1996  christos backout previous kprintf change
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 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 10-Nov-1995  gwr Allow unit != 0
 1.4 10-Apr-1995  mycroft branches: 1.4.2;
map --> mmap
 1.3 10-Apr-1995  mycroft map --> mmap
 1.2 07-Apr-1995  gwr Changed fb_attach() interface
 1.1 10-Mar-1995  gwr New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.4.2.1 10-Nov-1995  gwr Update from HEAD
 1.9.6.1 12-Mar-1997  is Merge in changes from The Trunk
 1.10.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.2.2 27-Jan-1998  gwr Fix a warning.
 1.12.2.1 27-Jan-1998  gwr Merge Sun3X support. Video enable stuff moved out to enable.c
Still needs work, i.e. P4 register, etc. Later...
 1.14.24.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.14.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.16.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.16.4.3 28-Jun-2002  jdolecek provide kqfilter hooks (equivalent to seltrue() for poll() case), and
hook them to fb driver
 1.16.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.16.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.16.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.17.12.2 15-Jul-2002  gehenna catch up with -current.
 1.17.12.1 17-May-2002  gehenna Add device switch.
 1.17.4.5 11-Nov-2002  nathanw Catch up to -current
 1.17.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.17.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.17.4.2 20-Jun-2002  nathanw Catch up to -current.
 1.17.4.1 19-Sep-2001  nathanw file bw2.c was added on branch nathanw_sa on 2002-06-20 03:41:42 +0000
 1.23.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.23.6.5 04-Feb-2005  skrll Adapt to branch.
 1.23.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.23.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.23.6.1 03-Aug-2004  skrll Sync with HEAD
 1.25.8.1 29-Apr-2005  kent sync with -current
 1.27.2.2 03-Sep-2007  yamt sync with head.
 1.27.2.1 21-Jun-2006  yamt sync with head.
 1.28.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.28.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.28.8.1 01-Apr-2006  yamt sync with head.
 1.28.6.1 22-Apr-2006  simonb Sync with head.
 1.28.4.1 09-Sep-2006  rpaulo sync with head
 1.30.14.2 24-Mar-2007  yamt sync with head.
 1.30.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.31.2.1 13-Mar-2007  ad Sync with head.
 1.32.44.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.32.44.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.32.42.1 04-May-2009  yamt sync with head.
 1.32.40.1 17-Jun-2008  yamt sync with head.
 1.32.38.1 29-Jun-2008  mjf Sync with HEAD.
 1.33.2.1 03-Jul-2008  simonb Sync with head.
 1.34.46.1 18-May-2014  rmind sync with head
 1.34.40.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.34.30.1 22-May-2014  yamt sync with head.

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

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

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 10-Mar-1995  gwr branches: 1.1.68;
New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.1.68.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.68.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.68.1 03-Aug-2004  skrll Sync with HEAD
 1.34 21-Dec-2024  tsutsui Make local dev_type_*() functions static.
 1.33 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.32 20-Dec-2023  thorpej branches: 1.32.2;
Remove unnecessary <sys/malloc.h>.
 1.31 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.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 28-Jun-2008  tsutsui branches: 1.29.30; 1.29.40; 1.29.46;
Split softc/device_t, with misc cosmetic changes.
 1.28 08-Jun-2008  tsutsui branches: 1.28.2;
Use device_private() and device_lookup_private() to get softc
and to see if device unit is vaild.
 1.27 04-Mar-2007  christos branches: 1.27.40; 1.27.42; 1.27.44; 1.27.46;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 11-Dec-2005  christos branches: 1.26.26;
merge ktrace-lwp.
 1.25 22-Jan-2005  chs branches: 1.25.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.24 07-Aug-2003  agc branches: 1.24.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.23 15-Jul-2003  lukem __KERNEL_RCSID()
 1.22 23-Oct-2002  jdolecek branches: 1.22.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.21 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.20 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.19 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.18 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.17 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.16 19-Sep-2001  thorpej branches: 1.16.4; 1.16.12; 1.16.14;
machine/fbio.h -> dev/sun/fbio.h
 1.15 05-Sep-2001  tsutsui branches: 1.15.2;
Remove register prefixes.
 1.14 05-Aug-2001  jdolecek use unsigned variable types as appropriate
 1.13 29-Jun-2000  mrg branches: 1.13.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.12 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.11 23-Jan-1998  gwr branches: 1.11.16; 1.11.26;
Add: extern struct cfdriver cgtwo_cd;
 1.10 12-Jan-1998  thorpej Update for changes to config.
 1.9 17-Oct-1997  gwr Clean up cg2match()
 1.8 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.7 13-Oct-1996  christos backout previous kprintf change
 1.6 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.5 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.4 10-Apr-1995  mycroft map --> mmap
 1.3 10-Apr-1995  mycroft map --> mmap
 1.2 08-Apr-1995  gwr It works now.
 1.1 07-Apr-1995  gwr First cut at cgtwo driver. Not quite right yet.
 1.11.26.2 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.11.26.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.11.16.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.4.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.13.4.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.13.4.4 28-Jun-2002  jdolecek provide kqfilter hooks (equivalent to seltrue() for poll() case), and
hook them to fb driver
 1.13.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.13.4.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.15.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.15.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.16.14.1 07-Aug-2002  lukem Pull up revision 1.17 (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.16.12.2 31-Aug-2002  gehenna catch up with -current.
 1.16.12.1 17-May-2002  gehenna Add device switch.
 1.16.4.5 11-Nov-2002  nathanw Catch up to -current
 1.16.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.16.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.16.4.2 13-Aug-2002  nathanw Catch up to -current.
 1.16.4.1 19-Sep-2001  nathanw file cg2.c was added on branch nathanw_sa on 2002-08-13 02:18:59 +0000
 1.22.6.5 04-Feb-2005  skrll Adapt to branch.
 1.22.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.22.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.6.1 03-Aug-2004  skrll Sync with HEAD
 1.24.8.1 29-Apr-2005  kent sync with -current
 1.25.8.2 03-Sep-2007  yamt sync with head.
 1.25.8.1 21-Jun-2006  yamt sync with head.
 1.26.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.46.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.27.46.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.27.44.1 04-May-2009  yamt sync with head.
 1.27.42.1 17-Jun-2008  yamt sync with head.
 1.27.40.1 29-Jun-2008  mjf Sync with HEAD.
 1.28.2.1 03-Jul-2008  simonb Sync with head.
 1.29.46.1 18-May-2014  rmind sync with head
 1.29.40.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.30.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.32.2.1 02-Aug-2025  perseant Sync with HEAD
 1.44 21-Dec-2024  tsutsui Make local dev_type_*() functions static.
 1.43 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.42 21-Nov-2020  thorpej branches: 1.42.24;
malloc(9) -> kmem(9)
 1.41 25-Jul-2014  dholland branches: 1.41.40;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.40 16-Mar-2014  dholland branches: 1.40.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.39 28-Jun-2008  tsutsui branches: 1.39.30; 1.39.40; 1.39.46;
Split softc/device_t, with misc cosmetic changes.
 1.38 08-Jun-2008  tsutsui branches: 1.38.2;
Use device_private() and device_lookup_private() to get softc
and to see if device unit is vaild.
 1.37 12-Mar-2007  tsutsui branches: 1.37.38; 1.37.40; 1.37.42; 1.37.44;
Fix printf formats in #ifdef DEBUG.
 1.36 04-Mar-2007  christos branches: 1.36.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 29-Mar-2006  thorpej branches: 1.35.14;
Use device_cfdata().
 1.34 28-Mar-2006  thorpej Use device_unit().
 1.33 11-Dec-2005  christos branches: 1.33.4; 1.33.6; 1.33.8; 1.33.10; 1.33.12;
merge ktrace-lwp.
 1.32 22-Jan-2005  chs branches: 1.32.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.31 07-Aug-2003  agc branches: 1.31.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.30 15-Jul-2003  lukem __KERNEL_RCSID()
 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 Add trailing ; to CFATTACH_DECL.
 1.27 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.26 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.25 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.24 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.23 19-Sep-2001  thorpej branches: 1.23.4; 1.23.12; 1.23.14;
machine/fbio.h -> dev/sun/fbio.h
 1.22 05-Sep-2001  tsutsui branches: 1.22.2;
Remove register prefixes.
 1.21 29-Jun-2000  mrg branches: 1.21.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.20 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.19 09-Jun-1998  gwr branches: 1.19.14; 1.19.24;
Simplify ifdefs in cg4b_ldcmap()
 1.18 09-Jun-1998  gwr Make this work on the 3/80, which has the Brooktree DAC
wired high-byte-only like the sparc. (yuck!)
 1.17 21-Mar-1998  gwr Deal with missing P4 register on old Sun3/60 machines.
 1.16 08-Mar-1998  gwr Need to use an offset to map the colormap H/W now that the
config address is that of the P4 register. Oops.
 1.15 08-Feb-1998  gwr Rewrite the match/attch routines to use the P4 register
(when it exists). Also get the size right; other fixes.
 1.14 26-Jan-1998  gwr Simplify the colormap and blanking stuff a little.
 1.13 12-Jan-1998  thorpej branches: 1.13.2;
Update for changes to config.
 1.12 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.11 29-Oct-1996  gwr Checkpoint new version of this driver with support for the "Type A"
variant of the CG4 (the one with the AMD colormap DACs). This has
been tested only on the "Type B" H/W at this point (Brooktree DACs).
Thanks to Ezra Story and Scott Ellis for the "Type A" support.
 1.10 13-Oct-1996  christos backout previous kprintf change
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 09-Oct-1996  thorpej Merge netbsd-1-2 branch back into mainline.
 1.7 17-Mar-1996  thorpej branches: 1.7.4;
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 13-Apr-1995  gwr fix typo
 1.5 10-Apr-1995  mycroft map --> mmap
 1.4 10-Apr-1995  mycroft map --> mmap
 1.3 07-Apr-1995  gwr Fix that probe sequence right this time.
 1.2 07-Apr-1995  gwr Changed fb_attach() interface, hack probe to avoid impossible matches.
Corrected fbtype->fb_size (which x11r6 is picky about...)
 1.1 10-Mar-1995  gwr New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.7.4.1 08-Aug-1996  gwr Fix an uninitialized pointer.
 1.13.2.1 26-Jan-1998  gwr Merge recent changes on the head onto the gwr-3x3 branch.
 1.19.24.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.19.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.21.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.21.4.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.21.4.3 28-Jun-2002  jdolecek provide kqfilter hooks (equivalent to seltrue() for poll() case), and
hook them to fb driver
 1.21.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.21.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.22.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.22.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.23.14.1 07-Aug-2002  lukem Pull up revision 1.24 (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.23.12.2 31-Aug-2002  gehenna catch up with -current.
 1.23.12.1 17-May-2002  gehenna Add device switch.
 1.23.4.5 11-Nov-2002  nathanw Catch up to -current
 1.23.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.23.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.23.4.2 13-Aug-2002  nathanw Catch up to -current.
 1.23.4.1 19-Sep-2001  nathanw file cg4.c was added on branch nathanw_sa on 2002-08-13 02:18:59 +0000
 1.29.6.5 04-Feb-2005  skrll Adapt to branch.
 1.29.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.29.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.29.6.1 03-Aug-2004  skrll Sync with HEAD
 1.31.8.1 29-Apr-2005  kent sync with -current
 1.32.8.2 03-Sep-2007  yamt sync with head.
 1.32.8.1 21-Jun-2006  yamt sync with head.
 1.33.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.33.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.33.8.1 01-Apr-2006  yamt sync with head.
 1.33.6.1 22-Apr-2006  simonb Sync with head.
 1.33.4.1 09-Sep-2006  rpaulo sync with head
 1.35.14.2 24-Mar-2007  yamt sync with head.
 1.35.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.36.2.1 13-Mar-2007  ad Sync with head.
 1.37.44.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.37.44.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.37.42.1 04-May-2009  yamt sync with head.
 1.37.40.1 17-Jun-2008  yamt sync with head.
 1.37.38.1 29-Jun-2008  mjf Sync with HEAD.
 1.38.2.1 03-Jul-2008  simonb Sync with head.
 1.39.46.1 18-May-2014  rmind sync with head
 1.39.40.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.39.30.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.40.2.1 10-Aug-2014  tls Rebase.
 1.41.40.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.42.24.1 02-Aug-2025  perseant Sync with HEAD
 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 08-Mar-1998  gwr branches: 1.5.48;
No need for default base addresses here anymore.
 1.4 08-Feb-1998  gwr Define the CG4B_OFF_* values to be relative to the location of
the P4 register so the probe routine finds the P4 at off=0.
 1.3 29-Oct-1996  gwr Checkpoint new version of this driver with support for the "Type A"
variant of the CG4 (the one with the AMD colormap DACs). This has
been tested only on the "Type B" H/W at this point (Brooktree DACs).
Thanks to Ezra Story and Scott Ellis for the "Type A" support.
 1.2 07-Apr-1995  gwr Corrected fbtype->fb_size (which x11r6 is picky about...)
 1.1 10-Mar-1995  gwr New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.5.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.48.1 03-Aug-2004  skrll Sync with HEAD
 1.25 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.24 20-Dec-2023  thorpej branches: 1.24.2;
Remove unnecessary <sys/malloc.h>.
 1.23 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.22 13-Oct-2012  tsutsui branches: 1.22.36; 1.22.38;
Fix botch on device_t/softc split in #if 0'ed debug printf. from chs@
 1.21 16-Dec-2008  christos branches: 1.21.14; 1.21.24;
replace bitmask_snprintf(9) with snprintb(3)
 1.20 13-Apr-2008  tsutsui branches: 1.20.4; 1.20.12;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.19 04-Mar-2007  tsutsui branches: 1.19.40;
Add (char *) casts on pointer arith.
 1.18 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.17 03-Feb-2007  tsutsui branches: 1.17.2;
Make esp and its dma on 3/80 use bus_dma(9).

XXX: Maybe we should consider to use MI sys/dev/ic/lsi64854.c.
 1.16 11-Dec-2005  christos branches: 1.16.20;
merge ktrace-lwp.
 1.15 22-Jan-2005  chs branches: 1.15.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.14 15-Jul-2003  lukem branches: 1.14.8;
__KERNEL_RCSID()
 1.13 02-Oct-2002  thorpej branches: 1.13.6;
Add trailing ; to CFATTACH_DECL.
 1.12 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.11 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.10 08-Apr-1999  gwr branches: 1.10.2; 1.10.22; 1.10.26;
Make "dma" a real device so it can attach before esp.
Also pull in some changes from the sparc version.
 1.9 13-Dec-1998  kleink Printf format warning cleanup.
 1.8 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.7 07-Oct-1997  gwr branches: 1.7.4;
fix warnings
 1.6 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.5 26-Jun-1997  jeremy branches: 1.5.2; 1.5.4;
Duplicate changes recently made to the SPARC version of this file:
Do not print warnings if selection of a target via DMA was interrupted
by another target.
 1.4 20-Mar-1997  gwr Now using dev/ic/ncr53c9x.c
 1.3 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.2 24-Feb-1997  gwr branches: 1.2.2;
No need for dma_cd, so move it into the #if 0 section too.
 1.1 24-Feb-1997  jeremy branches: 1.1.1;
Initial revision
 1.1.1.1 24-Feb-1997  jeremy Initial import from SPARC port.
 1.2.2.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.5.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.7.4.1 27-Jan-1998  gwr Merged Sun3 and Sun3X kernel sources.
 1.10.26.1 18-Oct-2002  nathanw Catch up to -current.
 1.10.22.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.10.2.2 08-Apr-1999  gwr Make "dma" a real device so it can attach before esp.
Also pull in some changes from the sparc version.
 1.10.2.1 08-Apr-1999  gwr file dma.c was added on branch netbsd-1-4 on 1999-04-08 04:46:42 +0000
 1.13.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.13.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14.8.1 29-Apr-2005  kent sync with -current
 1.15.8.2 03-Sep-2007  yamt sync with head.
 1.15.8.1 26-Feb-2007  yamt sync with head.
 1.16.20.1 09-Feb-2007  ad Sync with HEAD.
 1.17.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.19.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.20.4.1 04-May-2009  yamt sync with head.
 1.21.24.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.14.1 30-Oct-2012  yamt sync with head
 1.22.38.1 10-Jun-2019  christos Sync with HEAD
 1.22.36.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.24.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 03-Feb-2007  tsutsui Make esp and its dma on 3/80 use bus_dma(9).

XXX: Maybe we should consider to use MI sys/dev/ic/lsi64854.c.
 1.5 11-Dec-2005  christos branches: 1.5.20;
merge ktrace-lwp.
 1.4 22-Jan-2005  chs branches: 1.4.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.3 08-Apr-1999  gwr branches: 1.3.2; 1.3.42; 1.3.50;
Make "dma" a real device so it can attach before esp.
Also pull in some changes from the sparc version.
 1.2 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.1 24-Feb-1997  jeremy branches: 1.1.1; 1.1.2;
Initial revision
 1.1.2.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.1.1.1 24-Feb-1997  jeremy Initial import from SPARC port.
 1.3.50.1 29-Apr-2005  kent sync with -current
 1.3.42.1 24-Jan-2005  skrll Sync with HEAD.
 1.3.2.2 08-Apr-1999  gwr Make "dma" a real device so it can attach before esp.
Also pull in some changes from the sparc version.
 1.3.2.1 08-Apr-1999  gwr file dmareg.h was added on branch netbsd-1-4 on 1999-04-08 04:46:42 +0000
 1.4.8.1 26-Feb-2007  yamt sync with head.
 1.5.20.1 09-Feb-2007  ad Sync with HEAD.
 1.10 13-Apr-2008  tsutsui Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.9 04-Mar-2007  tsutsui branches: 1.9.40;
Minor space nits.
 1.8 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 03-Feb-2007  tsutsui branches: 1.7.2;
Make esp and its dma on 3/80 use bus_dma(9).

XXX: Maybe we should consider to use MI sys/dev/ic/lsi64854.c.
 1.6 11-Dec-2005  christos branches: 1.6.20;
merge ktrace-lwp.
 1.5 22-Jan-2005  chs branches: 1.5.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.4 08-Apr-1999  gwr branches: 1.4.2; 1.4.42; 1.4.50;
Make "dma" a real device so it can attach before esp.
Also pull in some changes from the sparc version.
 1.3 20-Mar-1997  gwr Now using dev/ic/ncr53c9x.c
 1.2 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.1 24-Feb-1997  jeremy branches: 1.1.1; 1.1.2;
Initial revision
 1.1.2.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.1.1.1 24-Feb-1997  jeremy Initial import from SPARC port.
 1.4.50.1 29-Apr-2005  kent sync with -current
 1.4.42.1 24-Jan-2005  skrll Sync with HEAD.
 1.4.2.2 08-Apr-1999  gwr Make "dma" a real device so it can attach before esp.
Also pull in some changes from the sparc version.
 1.4.2.1 08-Apr-1999  gwr file dmavar.h was added on branch netbsd-1-4 on 1999-04-08 04:46:42 +0000
 1.5.8.2 03-Sep-2007  yamt sync with head.
 1.5.8.1 26-Feb-2007  yamt sync with head.
 1.6.20.1 09-Feb-2007  ad Sync with HEAD.
 1.7.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.35 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.34 21-Nov-2020  thorpej branches: 1.34.24;
malloc(9) -> kmem(9)
 1.33 10-Nov-2019  chs branches: 1.33.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.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 28-Jun-2008  tsutsui branches: 1.31.82; 1.31.84;
Split softc/device_t, with misc cosmetic changes.
 1.30 28-Apr-2008  martin branches: 1.30.2; 1.30.4;
Remove clause 3 and 4 from TNF licenses
 1.29 04-Mar-2007  christos branches: 1.29.40; 1.29.42; 1.29.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.28 11-Dec-2005  christos branches: 1.28.26;
merge ktrace-lwp.
 1.27 19-Jun-2005  thorpej branches: 1.27.2;
Move common Sun ID PROM definitions into <dev/sun/idprom.h>.
 1.26 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.25 15-Jul-2003  lukem branches: 1.25.8;
__KERNEL_RCSID()
 1.24 02-Oct-2002  thorpej branches: 1.24.6;
Add trailing ; to CFATTACH_DECL.
 1.23 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.21 05-Sep-2001  tsutsui branches: 1.21.6;
bcopy() -> memcpy(), bzero() -> memset()
 1.20 05-Jun-2001  thorpej branches: 1.20.2;
(locally defined) HZ -> hz
 1.19 27-May-2001  chs don't abuse cf_unit.
 1.18 05-Feb-1998  gwr branches: 1.18.26;
Merge arch/sun3x into arch/sun3
 1.17 12-Jan-1998  thorpej branches: 1.17.2;
Update for changes to config.
 1.16 28-Apr-1997  gwr No longer needs an early init call (just normal autoconfig).
 1.15 18-Mar-1997  gwr Read the EEPROM once at attach time, then do user I/O on the copy.
Make /dev/eeprom support normal "read to EOF" behaviour.
Removed ee_console, ee_get_byte (dead code).
 1.14 27-Jan-1997  gwr Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.13 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.12 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.11 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.10 13-Oct-1996  christos backout previous kprintf change
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 26-Mar-1996  gwr New autoconfig design that controls attach order.
 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 24-May-1995  gwr Fix missing return(0) - from Jason Thorpe - fixes PR 1049
 1.5 10-Mar-1995  gwr Provide ee_console for drivers.
 1.4 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.3 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 20-Sep-1994  gwr branches: 1.1.2;
New functions to handle writing EEPROM with correct delay.
Also provides ee_get_byte() for early use by other drivers.
 1.1.2.2 20-Sep-1994  gwr New functions to handle writing EEPROM with correct delay.
Also provides ee_get_byte() for early use by other drivers.
 1.1.2.1 20-Sep-1994  gwr file eeprom.c was added on branch netbsd-1-0 on 1994-09-20 16:35:45 +0000
 1.17.2.1 27-Jan-1998  gwr Avoid stepping on the Mostek clock found in the end of the EEPROM
on the Sun3/80 (and other Sun3X changes).
 1.18.26.1 21-Jun-2001  nathanw Catch up to -current.
 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 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.21.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.21.6.1 05-Sep-2001  nathanw file eeprom.c was added on branch nathanw_sa on 2002-10-18 02:40:19 +0000
 1.24.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.24.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.6.1 03-Aug-2004  skrll Sync with HEAD
 1.25.8.1 29-Apr-2005  kent sync with -current
 1.27.2.1 03-Sep-2007  yamt sync with head.
 1.28.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.29.44.2 04-May-2009  yamt sync with head.
 1.29.44.1 16-May-2008  yamt sync with head.
 1.29.42.1 18-May-2008  yamt sync with head.
 1.29.40.2 29-Jun-2008  mjf Sync with HEAD.
 1.29.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.30.4.1 03-Jul-2008  simonb Sync with head.
 1.30.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.31.84.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.31.84.1 10-Jun-2019  christos Sync with HEAD
 1.31.82.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.33.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.34.24.1 02-Aug-2025  perseant Sync with HEAD
 1.30 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.29 02-Jun-2024  andvar branches: 1.29.2;
fix various typos in word `interrupt', mainly in comments.
 1.28 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.27 13-Apr-2008  tsutsui branches: 1.27.2; 1.27.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 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 03-Feb-2007  tsutsui branches: 1.25.2;
Make esp and its dma on 3/80 use bus_dma(9).

XXX: Maybe we should consider to use MI sys/dev/ic/lsi64854.c.
 1.24 23-Jan-2007  tsutsui Use bus_space(9).
 1.23 28-Mar-2006  thorpej branches: 1.23.8;
Use device_unit().
 1.22 08-Mar-2006  lukem branches: 1.22.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.21 11-Dec-2005  christos branches: 1.21.4; 1.21.6; 1.21.8; 1.21.10;
merge ktrace-lwp.
 1.20 30-Jan-2005  tsutsui branches: 1.20.6;
Enable NCR_F_DMASELECT to use DMA xfer on command/selection phase.

It didn't work on sun3x when I and gwr tried back in April 1999,
but now it just works fine.
 1.19 22-Jan-2005  chs branches: 1.19.2;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.18 15-Jul-2003  lukem branches: 1.18.8;
__KERNEL_RCSID()
 1.17 02-Oct-2002  thorpej branches: 1.17.6;
Add trailing ; to CFATTACH_DECL.
 1.16 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.15 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.14 25-Apr-2001  bouyer branches: 1.14.2; 1.14.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.13 29-Mar-2001  petrov use NCR_F_DMASELECT instead of ncr53c9x_dmaselect
 1.12 05-Jun-2000  nisimura branches: 1.12.4;
Have MI ncr53c9x_attach() the 2nd and 3rd arguments for scsipi_adater
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
 1.11 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.10 08-Apr-1999  gwr branches: 1.10.2; 1.10.8; 1.10.16;
Make "dma" a real device so it can attach before esp.
Also pull in some changes from the sparc version.
 1.9 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.8 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.7 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.6 12-Jan-1998  thorpej branches: 1.6.4;
Update for config changes.
 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 27-Jun-1997  jeremy branches: 1.4.2; 1.4.4;
Add reference to DMA selection variable used in dev/ic/ncr53c9x.c and sample
code to enable it. Currently commented out.
 1.3 20-Mar-1997  gwr Now using dev/ic/ncr53c9x.c
 1.2 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.1 24-Feb-1997  jeremy branches: 1.1.1; 1.1.2;
Initial revision
 1.1.2.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.1.1.1 24-Feb-1997  jeremy Initial import from SPARC port.
 1.4.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.6.4.1 27-Jan-1998  gwr Merged Sun3 and Sun3X kernel sources.
 1.10.16.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.8.3 21-Apr-2001  bouyer Sync with HEAD
 1.10.8.2 29-Mar-2001  bouyer Test-compile on i386.
 1.10.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.2.2 08-Apr-1999  gwr Make "dma" a real device so it can attach before esp.
Also pull in some changes from the sparc version.
 1.10.2.1 08-Apr-1999  gwr file esp.c was added on branch netbsd-1-4 on 1999-04-08 04:46:42 +0000
 1.12.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.12.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.14.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.14.8.1 25-Apr-2001  nathanw file esp.c was added on branch nathanw_sa on 2002-10-18 02:40:19 +0000
 1.14.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.17.6.5 04-Feb-2005  skrll Sync with HEAD.
 1.17.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.17.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.6.1 03-Aug-2004  skrll Sync with HEAD
 1.18.8.1 29-Apr-2005  kent sync with -current
 1.19.2.1 12-Feb-2005  yamt sync with head.
 1.20.6.3 03-Sep-2007  yamt sync with head.
 1.20.6.2 26-Feb-2007  yamt sync with head.
 1.20.6.1 21-Jun-2006  yamt sync with head.
 1.21.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.21.8.2 01-Apr-2006  yamt sync with head.
 1.21.8.1 13-Mar-2006  yamt sync with head.
 1.21.6.1 22-Apr-2006  simonb Sync with head.
 1.21.4.1 09-Sep-2006  rpaulo sync with head
 1.22.2.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.23.8.2 09-Feb-2007  ad Sync with HEAD.
 1.23.8.1 01-Feb-2007  ad Sync with head.
 1.25.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.27.4.1 16-May-2008  yamt sync with head.
 1.27.2.1 18-May-2008  yamt sync with head.
 1.29.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 24-Jan-1996  gwr Update for the new z8530 driver
 1.4 01-Dec-1994  gwr Export some headers that X will want, and minor clean-up.
 1.3 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.4 24-Jan-1996  gwr Update for the new z8530 driver
 1.3 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.18 21-Dec-2024  tsutsui Make local dev_type_*() functions static.
 1.17 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.16 25-Jul-2014  dholland branches: 1.16.64;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.15 16-Mar-2014  dholland branches: 1.15.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.14 04-Mar-2007  christos branches: 1.14.78; 1.14.88; 1.14.94;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 11-Dec-2005  christos branches: 1.13.26;
merge ktrace-lwp.
 1.12 22-Jan-2005  chs branches: 1.12.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.11 07-Aug-2003  agc branches: 1.11.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

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

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.8 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.7 19-Sep-2001  thorpej branches: 1.7.4; 1.7.12;
machine/fbio.h -> dev/sun/fbio.h
 1.6 26-Jun-2000  simonb branches: 1.6.2; 1.6.4;
Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.5 08-Feb-1998  gwr branches: 1.5.14; 1.5.24;
Add fb_eeprom_setsize() for setting the FB size based on the EEPROM
value (to be used only if unit=0). Add P4 helper functions:
fb_pfour_id, fb_pfour_setsize, fb_pfour_{get,set}_video
 1.4 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.3 10-Apr-1995  mycroft map --> mmap
 1.2 07-Apr-1995  gwr Changed fb_attach() interface
 1.1 10-Mar-1995  gwr New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.5.24.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.5.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.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.6.4.2 28-Jun-2002  jdolecek provide kqfilter hooks (equivalent to seltrue() for poll() case), and
hook them to fb driver
 1.6.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.6.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.7.12.1 17-May-2002  gehenna Add device switch.
 1.7.4.3 11-Nov-2002  nathanw Catch up to -current
 1.7.4.2 17-Sep-2002  nathanw Catch up to -current.
 1.7.4.1 19-Sep-2001  nathanw file fb.c was added on branch nathanw_sa on 2002-09-17 21:18:15 +0000
 1.9.6.5 04-Feb-2005  skrll Adapt to branch.
 1.9.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11.8.1 29-Apr-2005  kent sync with -current
 1.12.8.2 03-Sep-2007  yamt sync with head.
 1.12.8.1 21-Jun-2006  yamt sync with head.
 1.13.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.94.1 18-May-2014  rmind sync with head
 1.14.88.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.78.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.15.2.1 10-Aug-2014  tls Rebase.
 1.16.64.1 02-Aug-2025  perseant Sync with HEAD
 1.14 12-Feb-2022  riastradh sys: Fix various abuse of struct device internals.

Will help to make struct device opaque later.
 1.13 28-Jun-2008  tsutsui Split softc/device_t, with misc cosmetic changes.
 1.12 04-Mar-2007  christos branches: 1.12.40; 1.12.44; 1.12.46; 1.12.48;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 05-Oct-2006  tsutsui branches: 1.11.4;
Make sun3 use common sun68k/sun68k/isr.c, sun68k/include/cpu.h and
sun68k/include/intr.h.

This also means now sun3 has GENERIC_SOFT_INTERRUPTS support,
so also adapt fd.c and zs.c to MI softintr(9) APIs.

(I'll also update related sources in yamt-splraiseipl branch later)
 1.10 11-Dec-2005  christos branches: 1.10.20; 1.10.22;
merge ktrace-lwp.
 1.9 22-Jan-2005  chs branches: 1.9.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.8 07-Aug-2003  agc branches: 1.8.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

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

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.6 26-Jun-2000  simonb branches: 1.6.2; 1.6.4; 1.6.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.5 08-Feb-1998  gwr branches: 1.5.14; 1.5.24;
Add fb_eeprom_setsize() for setting the FB size based on the EEPROM
value (to be used only if unit=0). Add P4 helper functions:
fb_pfour_id, fb_pfour_setsize, fb_pfour_{get,set}_video
 1.4 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.3 29-Oct-1996  gwr Fix typo (fbattach => fb_attach)
 1.2 07-Apr-1995  gwr Changed fb_attach() interface
 1.1 10-Mar-1995  gwr New frame-buffer support from Chuck Silvers (plus some tweaks from me)
 1.5.24.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.5.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.8.1 11-Nov-2002  nathanw Catch up to -current
 1.6.4.1 28-Jun-2002  jdolecek provide kqfilter hooks (equivalent to seltrue() for poll() case), and
hook them to fb driver
 1.6.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.7.6.5 04-Feb-2005  skrll Adapt to branch.
 1.7.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.8.1 29-Apr-2005  kent sync with -current
 1.9.8.3 03-Sep-2007  yamt sync with head.
 1.9.8.2 30-Dec-2006  yamt sync with head.
 1.9.8.1 21-Jun-2006  yamt sync with head.
 1.10.22.1 06-Oct-2006  tsutsui Sync files of recent sun3 and sun68k merge and intersil7170(4) changes
with HEAD to build sun3 kernel on this branch.
 1.10.20.1 18-Nov-2006  ad Sync with head.
 1.11.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.48.1 03-Jul-2008  simonb Sync with head.
 1.12.46.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.12.44.1 04-May-2009  yamt sync with head.
 1.12.40.1 29-Jun-2008  mjf Sync with HEAD.
 1.89 21-Dec-2024  tsutsui Make local dev_type_*() functions static.
 1.88 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.87 20-May-2022  andvar branches: 1.87.10;
s/auxillary/auxiliary/ in comments.
 1.86 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.85 24-Apr-2021  thorpej branches: 1.85.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.84 21-Nov-2020  thorpej branches: 1.84.2;
malloc(9) -> kmem(9)
 1.83 10-Nov-2019  chs branches: 1.83.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.82 08-Feb-2019  mrg make *fd*.c's fd_dev_to_type() always a static inline. some
have it as a const, and have code to copy the defaults to
modify them before using them, but that probably requires a
real test to feel confident in changing.
 1.81 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.80 26-Apr-2015  mlelstv branches: 1.80.16; 1.80.18;
Use C99-style initializers for struct dkdriver.
 1.79 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.78 20-Aug-2014  tsutsui branches: 1.78.2;
Sync with sparc/dev/fd.c rev 1.155.

> Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().

Note sun3 still uses gcc 4.5.4 but also panicked by this old bug,
so probably this problem was triggered by not gcc 4.8 but struct disk
changes (struct disk_geom was added in <sys/disk.h> rev 1.58),
which increased sizeof(struct fd_softc) from 248 bytes to 296 bytes.
(i.e. now struct fd_softc could be allocated in a different pool block,
probably near the wrong pointer of the struct disklabel)

Anyway, this fix should be pullued up to netbsd-7.
(probably I'm the only user of floppy on sun3 though)
 1.77 25-Jul-2014  dholland branches: 1.77.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.76 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.75 16-Mar-2014  dholland branches: 1.75.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.74 29-Oct-2012  chs branches: 1.74.2;
fix compile problems.
 1.73 13-Oct-2012  tsutsui struct device * -> device_t, struct cfdata * -> cfdata_t
use device_xname() (from chs@)
 1.72 16-Jul-2011  mrg branches: 1.72.2; 1.72.8; 1.72.12; 1.72.14; 1.72.16;
apply some static.
 1.71 26-Sep-2009  tsutsui Make local functions static.
 1.70 26-Sep-2009  tsutsui Replace shutdownhook_establish(9) with pmf_device_register1(9).
Tested on 3/80.
 1.69 13-Jan-2009  yamt g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.68 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.67 09-Nov-2008  tsutsui Make compile this with options DIAGNOSTIC.
 1.66 28-Jun-2008  tsutsui branches: 1.66.2; 1.66.4; 1.66.6;
Pull some fdformat fixes from sys/arch/sparc/dev/fd.c.
 1.65 28-Jun-2008  tsutsui Split softc/device_t, with misc cosmetic changes.
 1.64 08-Jun-2008  tsutsui branches: 1.64.2;
Use device_private() and device_lookup_private() in more places.
 1.63 08-Jun-2008  tsutsui Use device_private() and device_lookup_private() to get softc.
 1.62 04-Jan-2008  joerg branches: 1.62.6; 1.62.8; 1.62.10; 1.62.12;
Add missing mutex for cv_timedwait.
 1.61 02-Jan-2008  ad Merge vmlocking2 to head.
 1.60 04-Dec-2007  tsutsui branches: 1.60.4;
Adapt sun68k ports to recent interrupt handling changes.

XXX: sun2 (m68010) doesn't have CAS instructions.
 1.59 17-Oct-2007  garbled branches: 1.59.2; 1.59.4;
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.58 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.57 29-Jul-2007  ad branches: 1.57.4; 1.57.6; 1.57.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.56 09-Jul-2007  ad branches: 1.56.2; 1.56.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.55 04-Mar-2007  tsutsui branches: 1.55.2; 1.55.4; 1.55.10;
Add (char *) casts on pointer arith.
 1.54 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.53 15-Feb-2007  reinoud branches: 1.53.2;
Rename the B_XXX flag to B_DEVPRIVATE flag since it was never used for
debugging and its main use is in device drivers. Its used there to signal
that the flagged buffer has a special meaning or should be handled
differently.

OK'd by Bill Sudenmund on tech-kern.
 1.52 14-Oct-2006  tsutsui Make this compile with FD_DEBUG.
 1.51 06-Oct-2006  tsutsui Use IPL_BIO rather than (temporarily defined) IPL_SOFT_LEVEL2.
Both of them share cpu ipl 2, and maybe it's intentional design
since fd.c uses ipl 6 for hardware interrupt.
 1.50 05-Oct-2006  tsutsui Make sun3 use common sun68k/sun68k/isr.c, sun68k/include/cpu.h and
sun68k/include/intr.h.

This also means now sun3 has GENERIC_SOFT_INTERRUPTS support,
so also adapt fd.c and zs.c to MI softintr(9) APIs.

(I'll also update related sources in yamt-splraiseipl branch later)
 1.49 01-Sep-2006  matt branches: 1.49.2; 1.49.4;
Fix a -Wshadow error.
 1.48 19-Apr-2006  he Follow up i/o statistics collection conversion, patterned after the sparc fd.c.
 1.47 23-Feb-2006  thorpej branches: 1.47.2; 1.47.4; 1.47.6;
Use device_parent().
 1.46 24-Dec-2005  perry branches: 1.46.2; 1.46.4; 1.46.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.45 11-Dec-2005  christos merge ktrace-lwp.
 1.44 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.43 03-Jun-2005  tsutsui branches: 1.43.2;
Constify.
 1.42 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.41 28-Oct-2004  yamt branches: 1.41.4;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.40 24-Mar-2004  pk Remove my name from the old UCB copyright notice, thereby reducing its
reference count to 1.
 1.39 26-Sep-2003  tsutsui TAB/space cleanup.
 1.38 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.37 15-Jul-2003  lukem __KERNEL_RCSID()
 1.36 18-Jun-2003  drochner branches: 1.36.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.35 21-May-2003  kristerw Correct a diagnostic printf format specifier.
 1.34 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.33 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.32 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.31 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.30 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.29 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.28 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.27 24-Jul-2002  hannken Fix a bug from last commit: Look for more work AFTER the current buf
is removed from the queue.
 1.26 23-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Nathan J. Williams <nathanw@netbsd.org>
 1.25 05-Sep-2001  tsutsui branches: 1.25.2; 1.25.6; 1.25.14;
bcopy() -> memcpy(), bzero() -> memset()
 1.24 05-Sep-2001  tsutsui Remove register prefixes.
 1.23 08-Jul-2001  wiz branches: 1.23.2;
Correct various misspellings of 'transfer' and inflected forms.
 1.22 24-Aug-2000  nathanw In fdioctl(), allocate fd_formb dynamically when needed, rather than on
the stack, and remove the no-longer-necessary PHOLD()/PRELE() calls
in fdformat().

(This eliminates 1/3 of the instances of PHOLD()/PRELE() in the kernel code.)

XXX We still have too many mostly-redundant floppy drivers.
 1.21 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.20 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.19 16-May-2000  thorpej branches: 1.19.2;
Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
 1.18 07-Apr-2000  thorpej Use separate callouts for motor-on and motor-off. Fixes a condition
where the floppy driver would wedge because a motor-on timeout would
be cancelled by another I/O operation cancelling a motor-off timeout.

From enami tsugutomo <enami@sm.sony.co.jp>.
 1.17 31-Mar-2000  tsutsui Add include <vm/vm.h> and <uvm/uvm_extern.h> for
declaration of uvm_swapin(), which is no longer in <sys/proc.h>.
 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 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.14 28-Jan-2000  thorpej Fix part of previous commit.
 1.13 28-Jan-2000  jdc BUFQ_* fixes.
 1.12 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.11 08-Feb-1999  bouyer branches: 1.11.8; 1.11.14;
Change DIOCEJECT to do what's needed to eject a device before the eject
command (unlock for sd and cd) if no other partitions are open, return
EBUSY otherwise. DIOCEJECT will have the old semantic if its argument is not
0. The old ioctl has been renamed to ODIOCEJECT for binary compatibility.
 1.10 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.9 23-Jul-1998  gwr Print a complaint when no children were specified
in the config file. Better than a link error...
 1.8 04-Jul-1998  jonathan defopt DDB.
 1.7 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.6 22-Jan-1998  gwr branches: 1.6.4;
Add: extern struct cfdriver fdc_cd;
 1.5 12-Jan-1998  thorpej Update for config changes.
 1.4 30-May-1997  jeremy When turning off the drive motor, de-select the drive so the busy light
extinguishes.
 1.3 24-May-1997  jeremy Prevent RAM disk hooks from compiling until sun3 md_root.c can support
ram disk images that are read in from the outside.
Sync with some old local changes.
 1.2 25-Apr-1997  gwr Fixed OBIO locators bug, so this can do the normal thing now.
Also improved handling of spurious interrupts, and sync up with
the sparc version.
 1.1 09-Apr-1997  jeremy First working version.
 1.6.4.1 27-Jan-1998  gwr Merged Sun3 and Sun3X kernel sources.
 1.11.14.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.11.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.19.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.23.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.23.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.23.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.25.14.2 31-Aug-2002  gehenna catch up with -current.
 1.25.14.1 17-May-2002  gehenna Add device switch.
 1.25.6.6 03-Jan-2003  thorpej Sync with HEAD.
 1.25.6.5 11-Nov-2002  nathanw Catch up to -current
 1.25.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.25.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.25.6.2 01-Aug-2002  nathanw Catch up to -current.
 1.25.6.1 05-Sep-2001  nathanw file fd.c was added on branch nathanw_sa on 2002-08-01 02:43:54 +0000
 1.25.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.36.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.36.2.6 04-Feb-2005  skrll Adapt to branch.
 1.36.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.36.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.36.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.36.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.36.2.1 03-Aug-2004  skrll Sync with HEAD
 1.41.4.1 29-Apr-2005  kent sync with -current
 1.43.2.7 21-Jan-2008  yamt sync with head
 1.43.2.6 07-Dec-2007  yamt sync with head
 1.43.2.5 27-Oct-2007  yamt sync with head.
 1.43.2.4 03-Sep-2007  yamt sync with head.
 1.43.2.3 26-Feb-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.46.6.1 22-Apr-2006  simonb Sync with head.
 1.46.4.1 09-Sep-2006  rpaulo sync with head
 1.46.2.1 01-Mar-2006  yamt sync with head.
 1.47.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.47.4.1 11-May-2006  elad sync with head
 1.47.2.2 03-Sep-2006  yamt sync with head.
 1.47.2.1 24-May-2006  yamt sync with head.
 1.49.4.2 22-Oct-2006  yamt sync with head
 1.49.4.1 06-Oct-2006  tsutsui Sync files of recent sun3 and sun68k merge and intersil7170(4) changes
with HEAD to build sun3 kernel on this branch.
 1.49.2.1 18-Nov-2006  ad Sync with head.
 1.53.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.55.10.2 16-Oct-2007  garbled Sync with HEAD
 1.55.10.1 03-Oct-2007  garbled Sync with HEAD
 1.55.4.1 11-Jul-2007  mjf Sync with head.
 1.55.2.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.55.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.55.2.1 15-Jul-2007  ad Sync with head.
 1.56.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.56.2.1 07-Aug-2007  matt Sync with HEAD.
 1.57.8.1 14-Oct-2007  yamt sync with head.
 1.57.6.2 09-Jan-2008  matt sync with HEAD
 1.57.6.1 06-Nov-2007  matt sync with HEAD
 1.57.4.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.57.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.59.4.2 31-Dec-2007  ad Catch up with buffer cache changes.
 1.59.4.1 08-Dec-2007  ad Sync with head.
 1.59.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.59.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.60.4.2 08-Jan-2008  bouyer Sync with HEAD
 1.60.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.62.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.62.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.62.10.2 11-Mar-2010  yamt sync with head
 1.62.10.1 04-May-2009  yamt sync with head.
 1.62.8.1 17-Jun-2008  yamt sync with head.
 1.62.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.62.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.64.2.1 03-Jul-2008  simonb Sync with head.
 1.66.6.1 15-Nov-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #61):
sys/arch/sun3/dev/fd.c: revision 1.67
Make compile this with options DIAGNOSTIC.
 1.66.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.66.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.72.16.1 03-Nov-2014  msaitoh Pull up following revision(s) (requested by tsutsui in ticket #1139):
sys/arch/sun3/dev/fd.c: revision 1.78
sys/arch/sparc/dev/fd.c: revision 1.155
sys/arch/sparc64/dev/fdc.c: revision 1.42
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
I'm not sure why this 18 year old bug didn't cause problem before
(at least my old 5.99.23 kernel worked), but probably it's triggered
by new gcc 4.8 which might do more aggressive memory allocation.
The problem is found by Nobuyoshi Sato on trying eject(1) against fd(4).
Should be pulled up to netbsd-7.
Sync with sparc/dev/fd.c:1.155.
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
I'm not sure why this 18 year old bug didn't cause problem before
(at least my old 5.99.23 kernel worked), but probably it's triggered
by new gcc 4.8 which might do more aggressive memory allocation.
The problem is found by Nobuyoshi Sato on trying eject(1) against fd(4).
Should be pulled up to netbsd-7.
Sync with sparc/dev/fd.c rev 1.155.
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
Note sun3 still uses gcc 4.5.4 but also panicked by this old bug,
so probably this problem was triggered by not gcc 4.8 but struct disk
changes (struct disk_geom was added in <sys/disk.h> rev 1.58),
which increased sizeof(struct fd_softc) from 248 bytes to 296 bytes.
(i.e. now struct fd_softc could be allocated in a different pool block,
probably near the wrong pointer of the struct disklabel)
Anyway, this fix should be pullued up to netbsd-7.
(probably I'm the only user of floppy on sun3 though)
 1.72.14.1 03-Nov-2014  msaitoh Pull up following revision(s) (requested by tsutsui in ticket #1139):
sys/arch/sun3/dev/fd.c: revision 1.78
sys/arch/sparc/dev/fd.c: revision 1.155
sys/arch/sparc64/dev/fdc.c: revision 1.42
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
I'm not sure why this 18 year old bug didn't cause problem before
(at least my old 5.99.23 kernel worked), but probably it's triggered
by new gcc 4.8 which might do more aggressive memory allocation.
The problem is found by Nobuyoshi Sato on trying eject(1) against fd(4).
Should be pulled up to netbsd-7.
Sync with sparc/dev/fd.c:1.155.
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
I'm not sure why this 18 year old bug didn't cause problem before
(at least my old 5.99.23 kernel worked), but probably it's triggered
by new gcc 4.8 which might do more aggressive memory allocation.
The problem is found by Nobuyoshi Sato on trying eject(1) against fd(4).
Should be pulled up to netbsd-7.
Sync with sparc/dev/fd.c rev 1.155.
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
Note sun3 still uses gcc 4.5.4 but also panicked by this old bug,
so probably this problem was triggered by not gcc 4.8 but struct disk
changes (struct disk_geom was added in <sys/disk.h> rev 1.58),
which increased sizeof(struct fd_softc) from 248 bytes to 296 bytes.
(i.e. now struct fd_softc could be allocated in a different pool block,
probably near the wrong pointer of the struct disklabel)
Anyway, this fix should be pullued up to netbsd-7.
(probably I'm the only user of floppy on sun3 though)
 1.72.12.3 03-Dec-2017  jdolecek update from HEAD
 1.72.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.72.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.72.8.1 03-Nov-2014  msaitoh Pull up following revision(s) (requested by tsutsui in ticket #1139):
sys/arch/sun3/dev/fd.c: revision 1.78
sys/arch/sparc/dev/fd.c: revision 1.155
sys/arch/sparc64/dev/fdc.c: revision 1.42
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
I'm not sure why this 18 year old bug didn't cause problem before
(at least my old 5.99.23 kernel worked), but probably it's triggered
by new gcc 4.8 which might do more aggressive memory allocation.
The problem is found by Nobuyoshi Sato on trying eject(1) against fd(4).
Should be pulled up to netbsd-7.
Sync with sparc/dev/fd.c:1.155.
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
I'm not sure why this 18 year old bug didn't cause problem before
(at least my old 5.99.23 kernel worked), but probably it's triggered
by new gcc 4.8 which might do more aggressive memory allocation.
The problem is found by Nobuyoshi Sato on trying eject(1) against fd(4).
Should be pulled up to netbsd-7.
Sync with sparc/dev/fd.c rev 1.155.
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
Note sun3 still uses gcc 4.5.4 but also panicked by this old bug,
so probably this problem was triggered by not gcc 4.8 but struct disk
changes (struct disk_geom was added in <sys/disk.h> rev 1.58),
which increased sizeof(struct fd_softc) from 248 bytes to 296 bytes.
(i.e. now struct fd_softc could be allocated in a different pool block,
probably near the wrong pointer of the struct disklabel)
Anyway, this fix should be pullued up to netbsd-7.
(probably I'm the only user of floppy on sun3 though)
 1.72.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.72.2.1 30-Oct-2012  yamt sync with head
 1.74.2.1 18-May-2014  rmind sync with head
 1.75.2.1 10-Aug-2014  tls Rebase.
 1.77.2.1 24-Aug-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #53):
sys/arch/sun3/dev/fd.c: revision 1.78
sys/arch/sparc/dev/fd.c: revision 1.155
sys/arch/sparc64/dev/fdc.c: revision 1.42
Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
 1.78.2.2 06-Jun-2015  skrll Sync with HEAD
 1.78.2.1 06-Apr-2015  skrll Sync with HEAD
 1.80.18.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.80.18.1 10-Jun-2019  christos Sync with HEAD
 1.80.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.83.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.84.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.85.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.87.10.1 02-Aug-2025  perseant Sync with HEAD
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.2 07-Aug-2003  agc branches: 1.2.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 09-Apr-1997  jeremy branches: 1.1.50;
First working version.
 1.1.50.4 24-Jan-2005  skrll Sync with HEAD.
 1.1.50.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.50.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.50.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.7 30-Jun-2011  wiz dependant -> dependent
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.76; 1.5.78;
merge ktrace-lwp.
 1.4 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.3 03-May-2003  wiz branches: 1.3.2; 1.3.10;
DMA, not dma nor Dma.
 1.2 05-Sep-1998  pk Assign my copyrights to TNF.
 1.1 09-Apr-1997  jeremy First working version.
 1.3.10.1 29-Apr-2005  kent sync with -current
 1.3.2.1 24-Jan-2005  skrll Sync with HEAD.
 1.5.78.1 16-May-2008  yamt sync with head.
 1.5.76.1 18-May-2008  yamt sync with head.
 1.5.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.6 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.5 13-Feb-1997  gwr Replace caddr_t with u_int in device structs.
Reduce MAXMCAST by a few to be safe.
 1.4 13-Dec-1996  gwr branches: 1.4.6;
Increase MAXMCAST from 50 to 250 (to match dev/ic/i82586.h).
 1.3 08-Oct-1995  gwr Note that this should be merged with dev/ic/i82586reg.h
 1.2 26-Jan-1995  gwr Updated ie driver based on i386 version 1.30
 1.1 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.4.6.1 12-Mar-1997  is Merge in changes from The Trunk
 1.22 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.21 17-Oct-1997  gwr branches: 1.21.4;
Sync. with the sun3x (mostly cosmetic changes).
 1.20 06-Oct-1997  gwr Use vm_offset_t to represent control space addresses, because
they are more like physical addresses in that you can not just
dereference a pointer to access the space. (Also, if you use a
pointer type for such things, gdb will _try_ to deference it.)
 1.19 28-Apr-1997  gwr branches: 1.19.4;
Sync. up with the sun3x version.
 1.18 27-Jan-1997  gwr Nuke sunmon.h, add machdep.h
 1.17 27-Jan-1997  gwr Use sunmon_abort() instead of mon_panic()
Let idprom_init() have void return.
 1.16 27-Jan-1997  gwr Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.15 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.14 13-Dec-1996  gwr Kill some dead code.
 1.13 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.12 26-Mar-1996  gwr New autoconfig design that controls attach order.
 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 11-Feb-1995  gwr Moved some functions here from sun3_startup.c
 1.9 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.8 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 06-May-1994  gwr Tracking 4.4 integration
 1.5 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.4 08-Aug-1993  glass stuff to make them compile properly
 1.3 05-Aug-1993  glass gets to consinit() and blows up
 1.2 30-Jul-1993  glass make idprom compile, and a bogus OBIO addr
 1.1 29-Jun-1993  glass added /dev/idprom driver :), doesn't compile yet
 1.19.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.21.4.1 25-Jan-1998  gwr Now in ../sun3 or ../sun3x
 1.74 09-Feb-2024  andvar fix spelling mistakes, mainly in comments and log messages.
 1.73 24-Oct-2021  andvar fix various typos in comments, mainly copypasta.
 1.72 19-Mar-2020  thorpej Don't bother with IFF_OACTIVE. Just keep processing so long as
sc->xmit_busy is less than sc->ntxbuf.
 1.71 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.70 28-May-2019  msaitoh branches: 1.70.4;
Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.69 23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.68 23-May-2019  msaitoh -No functional change:
- KNF
- u_int*_t -> uint*_t.
 1.67 05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.66 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.65 26-Jun-2018  msaitoh branches: 1.65.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.64 22-Jun-2018  msaitoh Remove bpf_tap() in iexmit() because ie_start() does bpf_mtap().
 1.63 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.62 22-Feb-2017  nonaka branches: 1.62.6; 1.62.12;
Apply deferred if_start to more MD drivers.
 1.61 15-Dec-2016  ozaki-r branches: 1.61.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.60 06-Dec-2016  ozaki-r Remove obsolete ancient optimization for bpf

The optimization code was obsoleted over 15 years ago.
We can remove it safely.
 1.59 07-Jul-2016  msaitoh branches: 1.59.2;
KNF. Remove extra spaces. No functional change.
 1.58 10-Jun-2016  ozaki-r 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.57 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.56 20-May-2015  ozaki-r Remove leftover use of AF_NS and NS option

Unnecessary NETISR_NS is also removed.
 1.55 05-Apr-2010  joerg branches: 1.55.18; 1.55.36;
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.54 19-Jan-2010  pooka branches: 1.54.2; 1.54.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.53 18-Mar-2009  cegger bcmp -> memcmp
 1.52 07-Nov-2008  dyoung branches: 1.52.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.51 28-Jun-2008  tsutsui branches: 1.51.2; 1.51.4;
Split softc/device_t, with misc cosmetic changes.
 1.50 17-Oct-2007  garbled branches: 1.50.16; 1.50.20; 1.50.22; 1.50.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.49 06-Sep-2007  he Remove a now-unused local variable.
 1.48 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.47 26-Aug-2007  dyoung branches: 1.47.2;
Constify.
 1.46 04-Mar-2007  tsutsui branches: 1.46.2; 1.46.10; 1.46.14; 1.46.18;
Use proper casts.
 1.45 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.44 11-Dec-2005  christos branches: 1.44.26;
merge ktrace-lwp.
 1.43 03-Jun-2005  tsutsui branches: 1.43.2;
Appease gcc -Wcast-qual by __UNVOLATILE().
 1.42 30-May-2005  tsutsui Avoid NULL pointer dereference in case of #if NBPFILTER == 0.
Closes PR port-sun3/21699.
 1.41 22-Jan-2005  chs branches: 1.41.6;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.40 30-Oct-2004  thorpej branches: 1.40.4;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.39 15-Jul-2003  lukem branches: 1.39.2; 1.39.4;
__KERNEL_RCSID()
 1.38 20-Jan-2003  bouyer branches: 1.38.2;
bzero the part of the buffer used to pad the packet to
ETHER_MIN_LEN - ETHER_CRC_LEN.
 1.37 05-Sep-2001  tsutsui branches: 1.37.6; 1.37.16;
- bcopy() -> memcpy(), strcpy()
- bcmp() -> (static inline) ether_cmp()
- 6 -> ETHER_ADDR_LEN
 1.36 05-Sep-2001  tsutsui Remove register prefixes.
 1.35 15-Nov-2000  thorpej branches: 1.35.4;
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 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.32 20-Aug-1999  chs branches: 1.32.2;
fix typo in previous commit. fixes PR 7879.
 1.31 21-May-1999  thorpej Copy alignment fix from dev/ic/i82586.c (Um, this extra copy should die,
too, but at least it's not as bad as the podulebus ie driver).
 1.30 18-May-1999  thorpej Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.29 25-Mar-1999  thorpej branches: 1.29.4;
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.28 01-Oct-1998  thorpej branches: 1.28.4;
Update for bcopy/bzero -> memcpy/memset changes.
 1.27 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.26 05-Jul-1998  jonathan defopt NS, NSIP.
 1.25 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.24 12-Jan-1998  thorpej Update for changes to config.
 1.23 05-Nov-1997  gwr Silence collisions
 1.22 28-Oct-1997  gwr Quiet down those "interrupt stuck?" messages.
 1.21 29-Jul-1997  fair branches: 1.21.6;
%x -> 0x%x, fixes for PR#3757
 1.20 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.19 10-Mar-1997  gwr Use the macros sc_if, sc_addr to avoid lots of references to sc_arpcom.
 1.18 28-Feb-1997  gwr Get rid of some printf noise.
 1.17 13-Feb-1997  gwr Reorganize/simplify the way the memory layout is done.
Update to the latest sys/dev/isa/if_ie.c (new ieget).
 1.16 17-Dec-1996  gwr branches: 1.16.6;
Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.15 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.14 13-Oct-1996  christos backout previous kprintf change
 1.13 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.12 09-May-1996  thorpej Fix typo, noticed by Curt Sampson <curt@portal.ca>.
 1.11 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.10 26-Mar-1996  gwr Use the traditional names (*reg.h, *var.h)
 1.9 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
 1.8 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.7 28-Feb-1996  gwr Kill a mis-matched and unnecessary declaration.
 1.6 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.5 11-Apr-1995  mycroft Sync with the rest of the world.
 1.4 09-Apr-1995  gwr Sync with net/if.h changes
 1.3 26-Jan-1995  gwr Updated ie driver based on i386 version 1.30
 1.2 15-Dec-1994  gwr Fixes to make "ie" work (from Chuck Silvers -- Thanks!)
 1.1 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.16.6.5 13-Mar-1997  gwr Merge changes from the trunk
 1.16.6.4 10-Mar-1997  gwr Use sc_if ...
 1.16.6.3 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.16.6.2 06-Mar-1997  is Fix typo.
 1.16.6.1 06-Mar-1997  is Convert to new ARP version.
 1.21.6.2 05-Nov-1997  mellon Pull rev 1.23 up from trunk (gwr)
 1.21.6.1 29-Oct-1997  mellon Pull rev 1.22 up from trunk (gwr)
 1.28.4.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.29.4.1 21-Jun-1999  thorpej Sync w/ -current.
 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.
 1.35.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.37.16.2 26-Oct-2005  riz Pull up following revision(s) (requested by tsutsui in ticket #5784):
sys/arch/sun3/dev/if_ie.c: revision 1.42
Avoid NULL pointer dereference in case of #if NBPFILTER == 0.
Closes PR port-sun3/21699.
 1.37.16.1 28-Jan-2003  jmc Pullup revisions 1.37-1.38 (requested by bouyer in ticket #1123)
bzero the part of the buffer used to pad the packet to
ETHER_MIN_LEN - ETHER_CRC_LEN.
 1.37.6.2 05-Sep-2001  tsutsui - bcopy() -> memcpy(), strcpy()
- bcmp() -> (static inline) ether_cmp()
- 6 -> ETHER_ADDR_LEN
 1.37.6.1 05-Sep-2001  tsutsui file if_ie.c was added on branch nathanw_sa on 2001-09-05 13:55:28 +0000
 1.38.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.38.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.38.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.38.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.38.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.38.2.1 03-Aug-2004  skrll Sync with HEAD
 1.39.4.2 31-May-2005  riz Pull up revision 1.42 (requested by tsutsui in ticket #1874):
Avoid NULL pointer dereference in case of #if NBPFILTER == 0.
Closes PR port-sun3/21699.
 1.39.4.1 24-Jan-2005  he Pull up revision 1.40 (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.39.2.1 31-May-2005  riz Pull up revision 1.42 (requested by tsutsui in ticket #1874):
Avoid NULL pointer dereference in case of #if NBPFILTER == 0.
Closes PR port-sun3/21699.
 1.40.4.1 29-Apr-2005  kent sync with -current
 1.41.6.1 31-May-2005  snj Pull up revision 1.42 (requested by tsutsui in ticket #359):
Avoid NULL pointer dereference in case of #if NBPFILTER == 0.
Closes PR port-sun3/21699.
 1.43.2.2 27-Oct-2007  yamt sync with head.
 1.43.2.1 03-Sep-2007  yamt sync with head.
 1.44.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.46.18.2 02-Oct-2007  joerg Sync with HEAD.
 1.46.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.46.14.2 10-Sep-2007  skrll Sync with HEAD.
 1.46.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.46.10.1 03-Oct-2007  garbled Sync with HEAD
 1.46.2.1 09-Oct-2007  ad Sync with head.
 1.47.2.1 06-Nov-2007  matt sync with HEAD
 1.50.24.1 03-Jul-2008  simonb Sync with head.
 1.50.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.50.20.3 11-Aug-2010  yamt 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.50.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.50.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.51.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.51.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.51.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.52.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.54.4.1 30-May-2010  rmind sync with head
 1.54.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.55.36.5 28-Aug-2017  skrll Sync with HEAD
 1.55.36.4 05-Feb-2017  skrll Sync with HEAD
 1.55.36.3 09-Jul-2016  skrll Sync with HEAD
 1.55.36.2 19-Mar-2016  skrll Sync with HEAD
 1.55.36.1 06-Jun-2015  skrll Sync with HEAD
 1.55.18.1 03-Dec-2017  jdolecek update from HEAD
 1.59.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.59.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.61.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.62.12.3 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.62.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.62.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.62.6.2 31-Jul-2018  martin Pull up following revision(s) (requested by msaitoh in ticket #948):

sys/arch/sun3/dev/if_ie.c: revision 1.64

Remove bpf_tap() in iexmit() because ie_start() does bpf_mtap().
 1.62.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.65.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.65.2.1 10-Jun-2019  christos Sync with HEAD
 1.70.4.1 29-Feb-2020  ad Sync with head.
 1.2 26-Mar-1996  gwr Use the traditional names (*reg.h, *var.h)
 1.1 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.26 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.25 28-Jun-2008  tsutsui branches: 1.25.120;
Split softc/device_t, with misc cosmetic changes.
 1.24 28-Apr-2008  martin branches: 1.24.2; 1.24.4;
Remove clause 3 and 4 from TNF licenses
 1.23 04-Mar-2007  tsutsui branches: 1.23.40; 1.23.42; 1.23.44;
Add (char *) casts on pointer arith.
 1.22 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.21 11-Dec-2005  christos branches: 1.21.26;
merge ktrace-lwp.
 1.20 22-Jan-2005  chs branches: 1.20.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.19 15-Jul-2003  lukem branches: 1.19.8;
__KERNEL_RCSID()
 1.18 02-Oct-2002  thorpej branches: 1.18.6;
Add trailing ; to CFATTACH_DECL.
 1.17 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15 01-Oct-1998  thorpej branches: 1.15.26; 1.15.30;
Update for bcopy/bzero -> memcpy/memset changes.
 1.14 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.13 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.12 08-Dec-1997  gwr branches: 1.12.2;
The ie_reset function needs to turn off loopback mode.
(Remember the TDR complaint: short X clocks away?
that was because the chip was in looback mode! 8)
 1.11 07-Oct-1997  gwr Use sizeof(struct ieob) instead of a sun3-specific macro,
so this driver will work on the sun3x as well. (Works!)
 1.10 28-Apr-1997  gwr branches: 1.10.4;
Rename obio_alloc/obio_mapin and check for obio in match functions
for attachments that will use obio_mapin.
 1.9 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.8 27-Jan-1997  gwr branches: 1.8.4;
Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.7 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.6 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.5 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 26-Mar-1996  gwr Use the traditional names (*reg.h, *var.h)
 1.1 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
 1.8.4.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.8.4.1 06-Mar-1997  is Convert to new ARP version.
 1.10.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.2.1 27-Jan-1998  gwr Merged Sun3 and Sun3X kernel sources.
 1.15.30.1 18-Oct-2002  nathanw Catch up to -current.
 1.15.26.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.18.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.18.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.6.1 03-Aug-2004  skrll Sync with HEAD
 1.19.8.1 29-Apr-2005  kent sync with -current
 1.20.8.1 03-Sep-2007  yamt sync with head.
 1.21.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.44.2 04-May-2009  yamt sync with head.
 1.23.44.1 16-May-2008  yamt sync with head.
 1.23.42.1 18-May-2008  yamt sync with head.
 1.23.40.2 29-Jun-2008  mjf Sync with HEAD.
 1.23.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.24.4.1 03-Jul-2008  simonb Sync with head.
 1.24.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.25.120.1 02-Aug-2025  perseant Sync with HEAD
 1.17 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.16 28-Jun-2008  tsutsui branches: 1.16.120;
Split softc/device_t, with misc cosmetic changes.
 1.15 28-Apr-2008  martin branches: 1.15.2; 1.15.4;
Remove clause 3 and 4 from TNF licenses
 1.14 04-Mar-2007  tsutsui branches: 1.14.40; 1.14.42; 1.14.44;
Add (char *) casts on pointer arith.
 1.13 11-Dec-2005  christos branches: 1.13.26;
merge ktrace-lwp.
 1.12 03-Jun-2005  tsutsui branches: 1.12.2;
Constify.
 1.11 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.10 15-Jul-2003  lukem branches: 1.10.8;
__KERNEL_RCSID()
 1.9 02-Oct-2002  thorpej branches: 1.9.6;
Add trailing ; to CFATTACH_DECL.
 1.8 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.7 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.6 01-Oct-1998  thorpej branches: 1.6.26; 1.6.30;
Update for bcopy/bzero -> memcpy/memset changes.
 1.5 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.4 08-Dec-1997  gwr Several fixes. This version actually works!
 1.3 25-Oct-1997  gwr I had the memory map wrong for the SCSI/Ethernet board.
Fixes from Michael Thompson.
 1.2 17-Oct-1997  gwr branches: 1.2.2;
Nuke same-unit hack in match.
 1.1 17-Oct-1997  gwr Add support for the Sun3/E "se" (Ethernet/SCSI) board.
Compiles, but NOT YET TESTED.
 1.2.2.2 09-Dec-1997  thorpej Sync w/ trunk: Sun3/E SCSI/Ethernet now works. (gwr)
 1.2.2.1 26-Oct-1997  mellon Pull rev 1.3 up from trunk (gwr)
 1.6.30.1 18-Oct-2002  nathanw Catch up to -current.
 1.6.26.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.6.4 24-Jan-2005  skrll Sync with HEAD.
 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.8.1 29-Apr-2005  kent sync with -current
 1.12.2.1 03-Sep-2007  yamt sync with head.
 1.13.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.44.2 04-May-2009  yamt sync with head.
 1.14.44.1 16-May-2008  yamt sync with head.
 1.14.42.1 18-May-2008  yamt sync with head.
 1.14.40.2 29-Jun-2008  mjf Sync with HEAD.
 1.14.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.4.1 03-Jul-2008  simonb Sync with head.
 1.15.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.16.120.1 02-Aug-2025  perseant Sync with HEAD
 1.8 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
 1.7 26-Sep-1995  gwr New DVMA interface, and various cleanup.
 1.6 13-Feb-1995  gwr DVMA slave mapping support.
 1.5 26-Jan-1995  gwr Updated ie driver based on i386 version 1.30
 1.4 11-Jan-1995  gwr Enable VME configuration.
 1.3 15-Dec-1994  gwr Fixes to make "ie" work (from Chuck Silvers -- Thanks!)
 1.2 13-Dec-1994  gwr Have working bus_peek(), and drivers use it.
 1.1 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.7 26-Mar-1996  gwr Use the traditional names (*reg.h, *var.h)
 1.6 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
 1.5 13-Feb-1995  gwr DVMA slave mapping support.
 1.4 26-Jan-1995  gwr Updated ie driver based on i386 version 1.30
 1.3 24-Jan-1995  gwr Increase TX buf size to fix overrun bug.
 1.2 15-Dec-1994  gwr Fixes to make "ie" work (from Chuck Silvers -- Thanks!)
 1.1 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.24 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.23 28-Jun-2008  tsutsui branches: 1.23.120;
Split softc/device_t, with misc cosmetic changes.
 1.22 28-Apr-2008  martin branches: 1.22.2; 1.22.4;
Remove clause 3 and 4 from TNF licenses
 1.21 04-Mar-2007  tsutsui branches: 1.21.40; 1.21.42; 1.21.44;
Add (char *) casts on pointer arith.
 1.20 11-Dec-2005  christos branches: 1.20.26;
merge ktrace-lwp.
 1.19 03-Jun-2005  tsutsui branches: 1.19.2;
Constify.
 1.18 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.17 15-Jul-2003  lukem branches: 1.17.8;
__KERNEL_RCSID()
 1.16 02-Oct-2002  thorpej branches: 1.16.6;
Add trailing ; to CFATTACH_DECL.
 1.15 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 01-Oct-1998  thorpej branches: 1.13.26; 1.13.30;
Update for bcopy/bzero -> memcpy/memset changes.
 1.12 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.11 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.10 09-Dec-1997  gwr branches: 1.10.4;
The ie_reset function needs to turn off loopback mode.
(Remember the TDR complaint: short X clocks away?
that was because the chip was in looback mode! 8)
 1.9 17-Oct-1997  gwr Clean up the match function.
 1.8 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.7 27-Jan-1997  gwr branches: 1.7.4;
Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.6 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.5 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 26-Mar-1996  gwr Use the traditional names (*reg.h, *var.h)
 1.1 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
 1.7.4.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.7.4.1 06-Mar-1997  is Convert to new ARP version.
 1.10.4.1 27-Jan-1998  gwr s/vmes/vme/g
 1.13.30.1 18-Oct-2002  nathanw Catch up to -current.
 1.13.26.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.16.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.16.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.16.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.6.1 03-Aug-2004  skrll Sync with HEAD
 1.17.8.1 29-Apr-2005  kent sync with -current
 1.19.2.1 03-Sep-2007  yamt sync with head.
 1.20.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.44.2 04-May-2009  yamt sync with head.
 1.21.44.1 16-May-2008  yamt sync with head.
 1.21.42.1 18-May-2008  yamt sync with head.
 1.21.40.2 29-Jun-2008  mjf Sync with HEAD.
 1.21.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.22.4.1 03-Jul-2008  simonb Sync with head.
 1.22.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.23.120.1 02-Aug-2025  perseant Sync with HEAD
 1.11 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.10 09-Dec-1997  gwr branches: 1.10.2;
The ie_reset function needs to turn off loopback mode.
(Remember the TDR complaint: short X clocks away?
that was because the chip was in looback mode! 8)
 1.9 17-Oct-1997  gwr Clean up the match function.
 1.8 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.7 27-Jan-1997  gwr branches: 1.7.4;
Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.6 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.5 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 26-Mar-1996  gwr Use the traditional names (*reg.h, *var.h)
 1.1 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
 1.7.4.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.7.4.1 06-Mar-1997  is Convert to new ARP version.
 1.10.2.1 25-Jan-1998  gwr Now if_ie_vme.c
 1.2 24-Oct-2021  andvar fix various typos in comments, mainly copypasta.
 1.1 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.17 24-Oct-2021  andvar fix various typos in comments, mainly copypasta.
 1.16 13-Sep-2019  msaitoh if_flags is neither int nor short. It's unsigned short.
 1.15 28-Jun-2008  tsutsui branches: 1.15.84;
Split softc/device_t, with misc cosmetic changes.
 1.14 04-Mar-2007  christos branches: 1.14.40; 1.14.44; 1.14.46; 1.14.48;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 11-Dec-2005  christos branches: 1.13.26;
merge ktrace-lwp.
 1.12 22-Jan-2005  chs branches: 1.12.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.11 13-Mar-2000  soren branches: 1.11.28; 1.11.36;
Fix doubled 'the's in comments.
 1.10 01-Oct-1998  thorpej branches: 1.10.12;
Update for bcopy/bzero -> memcpy/memset changes.
 1.9 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.8 13-Feb-1997  gwr Tune MXFRAMES and MXFRAMES down a little.
Reorganize the softc for convenience in ddb.
 1.7 17-Dec-1996  gwr branches: 1.7.6;
Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.6 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
 1.5 13-Feb-1995  gwr DVMA slave mapping support.
 1.4 26-Jan-1995  gwr Updated ie driver based on i386 version 1.30
 1.3 24-Jan-1995  gwr Increase TX buf size to fix overrun bug.
 1.2 15-Dec-1994  gwr Fixes to make "ie" work (from Chuck Silvers -- Thanks!)
 1.1 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.7.6.2 13-Mar-1997  gwr Merge changes from the trunk
 1.7.6.1 06-Mar-1997  is Convert to new ARP version.
 1.10.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.36.1 29-Apr-2005  kent sync with -current
 1.11.28.1 24-Jan-2005  skrll Sync with HEAD.
 1.12.8.1 03-Sep-2007  yamt sync with head.
 1.13.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.48.1 03-Jul-2008  simonb Sync with head.
 1.14.46.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.14.44.1 04-May-2009  yamt sync with head.
 1.14.40.1 29-Jun-2008  mjf Sync with HEAD.
 1.15.84.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.53 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.52 19-Jan-2010  pooka branches: 1.52.100;
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.51 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.50 04-Apr-2008  tsutsui branches: 1.50.2; 1.50.4;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.49 24-Dec-2005  perry branches: 1.49.74;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.48 11-Dec-2005  christos merge ktrace-lwp.
 1.47 22-Jan-2005  chs branches: 1.47.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.46 15-Jul-2003  lukem branches: 1.46.8;
__KERNEL_RCSID()
 1.45 02-Oct-2002  thorpej branches: 1.45.6;
Add trailing ; to CFATTACH_DECL.
 1.44 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.43 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.42 30-May-2001  mrg branches: 1.42.2; 1.42.8;
use _KERNEL_OPT
 1.41 21-Jul-1998  drochner branches: 1.41.26;
adapt to LANCE driver split
 1.40 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.39 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.38 28-Apr-1997  gwr branches: 1.38.10;
Rename obio_alloc/obio_mapin and check for obio in match functions
for attachments that will use obio_mapin.
 1.37 17-Mar-1997  thorpej #include <net/if_media.h>
 1.36 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.35 27-Jan-1997  gwr branches: 1.35.4;
Map regs using sizeof(struct lereg1) instead of OBIO_AMD_ETHER_SIZE.
Also fix copyright (s/REGENTS/FOUNDATION/)
 1.34 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.33 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.32 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.31 13-Oct-1996  christos backout previous kprintf change
 1.30 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.29 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.28 22-Apr-1996  christos Add a hardware dependent initialization function lehwinit()
 1.27 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.26 26-Mar-1996  gwr Adapt to redesigned autoconfig scheme for obio, and
define a fast ETHER_CMP routine for dev/ic/am7990.c
 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 10-Dec-1995  mycroft Use the MI LANCE code.
 1.23 27-Oct-1995  gwr Work around the LANCE Rev. C bug in a way that does not cause error
messages when BPF puts the interface in to promiscuous mode.
 1.22 27-Jun-1995  gwr branches: 1.22.2;
Catch up with net/if.h changes
 1.21 24-May-1995  gwr Turn off IFF_MULTICAST for now...
 1.20 26-Apr-1995  gwr Add work-around for LANCE Rev. C bug.
Needs to be fixed for multicasts...
 1.19 16-Apr-1995  gwr Make less noise about CRC/Framing errors (Sun3/50 gets lots of them).
 1.18 13-Apr-1995  gwr arpwhohas -> arp_ifinit etc.
 1.17 09-Apr-1995  gwr Sync with net/if.h changes
 1.16 03-Jan-1995  gwr New, improved "le" driver from Charles Hannum and Paul Richards.
 1.15 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.14 23-Nov-1994  gwr New cd_match prototype.
 1.13 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.12 26-Oct-1994  cgd new RCS ID format.
 1.11 11-Jul-1994  gwr branches: 1.11.2;
Add Theo's fix for "must be one" bits in tdr2.
 1.10 28-May-1994  gwr branches: 1.10.2;
New version (from Theo (from 4.4)) - supports multicast.
 1.9 16-May-1994  gwr Add call to ether_ifattach() for Lite network code.
 1.8 01-Mar-1994  glass canonicalize includes. cleanup. missing copyrights.
 1.7 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.6 23-Nov-1993  glass Now works with current tree, as opposed to the july 8th tree in which it was
written.
Requires magnum infrastructure now, particularly the clock stuff.
Fails to exec init because the /sbin/init binary
is a sunos binary. Next step is to integrate sunos compatibility code
from /sys/compat/sunos, and the amiga port.
Does not yet implement MACHINE_NOCONTIG support.

[from glass Mon Nov 22 21:22:45 PST 1993 home tag: home2]
 1.5 12-Oct-1993  glass sun3 port updated. netboot integrated.
 1.4 28-Aug-1993  glass last snapshot before uploading. we still have serious clock problems
 1.3 24-Aug-1993  glass snapshot. starts nfsmountroot but doesn't seem to emit any packets
 1.2 16-Aug-1993  glass 'clock' is now part of the standard config system instead of being done
early and in a hacked way. the movement of startrtclock() to below
cpu_startup() allows this.
 1.1 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.10.2.1 12-Jul-1994  cgd updates from trunk, per gwr
 1.11.2.2 11-Jul-1994  gwr Add Theo's fix for "must be one" bits in tdr2.
 1.11.2.1 11-Jul-1994  gwr file if_le.c was added on branch netbsd-1-0 on 1994-07-11 03:31:18 +0000
 1.22.2.1 27-Oct-1995  gwr Update from HEAD
 1.35.4.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.35.4.1 06-Mar-1997  is Convert to new ARP version.
 1.38.10.1 27-Jan-1998  gwr Add Sun3X support (needs differnt value of sc->sc_conf3)
 1.41.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.42.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.42.8.1 30-May-2001  nathanw file if_le.c was added on branch nathanw_sa on 2002-10-18 02:40:20 +0000
 1.42.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.45.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.45.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.45.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.45.6.1 03-Aug-2004  skrll Sync with HEAD
 1.46.8.1 29-Apr-2005  kent sync with -current
 1.47.8.1 21-Jun-2006  yamt sync with head.
 1.49.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.50.4.2 11-Mar-2010  yamt sync with head
 1.50.4.1 16-May-2008  yamt sync with head.
 1.50.2.1 18-May-2008  yamt sync with head.
 1.52.100.1 02-Aug-2025  perseant Sync with HEAD
 1.7 26-Mar-1996  gwr replaced by if_levar.h
 1.6 03-Jan-1995  gwr New, improved "le" driver from Charles Hannum and Paul Richards.
 1.5 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.4 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 28-May-1994  gwr New version (from Theo (from 4.4)) - supports multicast.
 1.1 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.13 26-Mar-1996  gwr obsolete
 1.12 26-Sep-1995  gwr New DVMA interface, and various cleanup.
 1.11 03-Jan-1995  gwr New, improved "le" driver from Charles Hannum and Paul Richards.
 1.10 13-Dec-1994  gwr Have working bus_peek(), and drivers use it.
 1.9 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.8 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 20-Sep-1994  gwr branches: 1.6.2;
Call obio_alloc with just two args (mappings always writable).
 1.5 28-May-1994  gwr New version (from Theo (from 4.4)) - supports multicast.
 1.4 16-Mar-1994  glass do nothing obio_probe_byte()
 1.3 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.2 21-Aug-1993  glass snapshot. for uploading. gets lost in swtch after enablertclock()
 1.1 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.6.2.2 20-Sep-1994  gwr Call obio_alloc with just two args (mappings always writable).
 1.6.2.1 20-Sep-1994  gwr file if_le_subr.c was added on branch netbsd-1-0 on 1994-09-20 16:21:45 +0000
 1.8 26-Mar-1996  gwr obsolete
 1.7 03-Jan-1995  gwr New, improved "le" driver from Charles Hannum and Paul Richards.
 1.6 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.5 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 28-May-1994  gwr New version (from Theo (from 4.4)) - supports multicast.
 1.2 24-Aug-1993  glass snapshot. starts nfsmountroot but doesn't seem to emit any packets
 1.1 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.13 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.12 26-Mar-1996  gwr Adapt to redesigned autoconfig scheme for obio, and
define a fast ETHER_CMP routine for dev/ic/am7990.c
 1.11 10-Dec-1995  mycroft Use the MI LANCE code.
 1.10 24-Jan-1995  gwr Increase TX buf size to fix overrun bug.
 1.9 03-Jan-1995  gwr New, improved "le" driver from Charles Hannum and Paul Richards.
 1.8 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.7 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 11-Jul-1994  gwr branches: 1.5.2;
Add Theo's fix for "must be one" bits in tdr2.
 1.4 28-May-1994  gwr branches: 1.4.2;
New version (from Theo (from 4.4)) - supports multicast.
 1.3 28-Aug-1993  glass last snapshot before uploading. we still have serious clock problems
 1.2 24-Aug-1993  glass snapshot. starts nfsmountroot but doesn't seem to emit any packets
 1.1 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.4.2.1 12-Jul-1994  cgd updates from trunk, per gwr
 1.5.2.2 11-Jul-1994  gwr Add Theo's fix for "must be one" bits in tdr2.
 1.5.2.1 11-Jul-1994  gwr file if_lereg.h was added on branch netbsd-1-0 on 1994-07-11 03:31:21 +0000
 1.3 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.2 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.1 10-Dec-1995  mycroft Use the MI LANCE code.
 1.12 24-Jan-1996  gwr Update for the new z8530 driver
 1.11 08-Oct-1995  gwr Temporary hack to restrict open to root or the
same UID as the session attached to /dev/kd
 1.10 24-May-1995  gwr Sunc with sparc version (adds key repeat capability)
 1.9 24-Mar-1995  gwr Cleanup, and deal with kd != console
 1.8 17-Dec-1994  gwr Fix kd (keyboard/display) driver kdcngetc/kdcnputc functions.
 1.7 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.6 01-Dec-1994  gwr Export some headers that X will want, and minor clean-up.
 1.5 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 03-Jun-1994  gwr Fix initialization of keyboard port (works now).
 1.2 06-May-1994  gwr Tracking 4.4 integration
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.4 13-Oct-1995  gwr Remove (again) things accidently revived by cvs tag...
 1.3 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.4 13-Oct-1995  gwr Remove (again) things accidently revived by cvs tag...
 1.3 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.61 21-Dec-2024  tsutsui Make local dev_type_*() functions static.
 1.60 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.59 25-Jul-2014  dholland branches: 1.59.64;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.58 16-Mar-2014  dholland branches: 1.58.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.57 27-Oct-2012  chs branches: 1.57.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.56 24-Apr-2011  rmind branches: 1.56.4; 1.56.14;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.55 28-Apr-2008  martin branches: 1.55.22; 1.55.28;
Remove clause 3 and 4 from TNF licenses
 1.54 29-Mar-2008  tsutsui branches: 1.54.2; 1.54.4;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.53 19-Nov-2007  ad branches: 1.53.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.52 28-Oct-2007  rjs branches: 1.52.2;
Move prototype for kd_later() before first use.
 1.51 18-Oct-2007  joerg 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.50 04-Mar-2007  christos branches: 1.50.2; 1.50.18; 1.50.20; 1.50.24;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.49 16-Feb-2007  ad branches: 1.49.2;
More spllowersoftclock() fallout.
 1.48 05-Oct-2006  tsutsui Make sun3 use common sun68k/sun68k/isr.c, sun68k/include/cpu.h and
sun68k/include/intr.h.

This also means now sun3 has GENERIC_SOFT_INTERRUPTS support,
so also adapt fd.c and zs.c to MI softintr(9) APIs.

(I'll also update related sources in yamt-splraiseipl branch later)
 1.47 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.46 23-Jul-2006  ad branches: 1.46.4; 1.46.6;
Use the LWP cached credentials where sane.
 1.45 14-May-2006  elad integrate kauth.
 1.44 11-Dec-2005  christos branches: 1.44.4; 1.44.6; 1.44.8; 1.44.10; 1.44.12;
merge ktrace-lwp.
 1.43 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.42 22-Jan-2005  chs branches: 1.42.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.41 15-Jul-2003  lukem branches: 1.41.8;
__KERNEL_RCSID()
 1.40 23-Oct-2002  jdolecek branches: 1.40.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.39 10-Oct-2002  martin Pass a struct cons_channel * to cc_iclose, not a struct kbd_softc *.
This argument has been previously unused, thus undetected due to void*
typing. Mmm, copy & paste. Note that sparc got it right though.

Many thanks to Valeriy E. Ushakov <uwe@netbsd.org> for debugging support.
 1.38 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.37 17-Mar-2002  atatat branches: 1.37.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.36 05-Sep-2001  tsutsui branches: 1.36.2; 1.36.6;
Remove register prefixes.
 1.35 02-May-2001  scw branches: 1.35.2;
Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.34 02-Nov-2000  eeh branches: 1.34.2;
Adapt to new line discipline scheme.
 1.33 21-May-2000  eeh Need to provide a consdev to the cons_attach_input call now.
 1.32 19-May-2000  eeh Fix the sparc64 console.

Unlike the other Sun machines, UltraSPARCs can have consoles run on different
chips than zs, so we need to support them. So, here we go:

Add a new PROM console driver with a major number and everything.
This is the default driver if nothing else attaches. It does not
use the keyboard driver since the PROM translates keystrokes itself.
(Unfortunately it also swallows L1-A).

Have the keyboard driver take over the console when it attaches on a
serial port. When a serial port detects a keyboard and attaches the
keyboard driver, it needs to provide a set of consdev vectors. They
keyboard driver will use those to send I/O to the keyboard and mouse.
 1.31 31-Mar-2000  tsutsui Remove declaration of kd_rom_intr(). It is not needed on sun3.
 1.30 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.29 19-Mar-2000  pk Minimal changes to accomodate the console input channel attachment
changes in the keyboard driver (see /sys/dev/sun/kbd*)
 1.28 06-Mar-2000  thorpej - Implement cnbell() -- ring the console bell. The cn_bell entrypoint
is optional.
- Add cn_bell to statically allocated consdevs as appropriate.
 1.27 05-Aug-1999  thorpej branches: 1.27.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.26 26-Feb-1998  gwr Fix build with NFB=0
 1.25 10-Feb-1997  gwr Make some more things static, and cosmetic stuff.
 1.24 10-Feb-1997  gwr Forgot to initialize cn->cn_dev, cn->cn_pri
 1.23 27-Jan-1997  gwr branches: 1.23.2;
Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.22 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.21 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.20 13-Oct-1996  christos backout previous kprintf change
 1.19 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.18 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.17 15-Jun-1996  gwr branches: 1.17.2;
merge 1.2 changes
 1.16 26-Apr-1996  gwr Remove some hacks that "went around" the linesw[] operations.
 1.15 07-Apr-1996  gwr minor cleanup
 1.14 24-Jan-1996  gwr Update for the new z8530 driver
 1.13 26-Apr-1995  gwr Add xxtty()
 1.12 10-Apr-1995  mycroft Add a dummy kdstop().
 1.11 28-Mar-1995  gwr Avoid passing non-ASCII chars to the PROM.
Call PROM at splsoftclock to avoid missing interrupts.
 1.10 24-Mar-1995  gwr Cleanup, and deal with kd != console
 1.9 10-Mar-1995  gwr Add kdcnpollc so it can call fb_unblank
 1.8 17-Dec-1994  gwr Fix kd (keyboard/display) driver kdcngetc/kdcnputc functions.
 1.7 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.6 01-Dec-1994  gwr Export some headers that X will want, and minor clean-up.
 1.5 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 03-Jun-1994  gwr Fix initialization of keyboard port (works now).
 1.2 05-May-1994  gwr cosmetic
 1.1 04-May-1994  gwr This provides a tty device for dev/cons.c to point at.
 1.17.2.2 15-Jun-1996  gwr merge 1.2 changes
 1.17.2.1 15-Jun-1996  gwr file kd.c was added on branch netbsd-1-2 on 1996-06-15 14:58:03 +0000
 1.23.2.1 12-Mar-1997  is Merge in changes from The Trunk
 1.27.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.27.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.34.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.35.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.35.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.36.6.5 11-Nov-2002  nathanw Catch up to -current
 1.36.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.36.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.36.6.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.36.6.1 05-Sep-2001  nathanw file kd.c was added on branch nathanw_sa on 2002-04-01 07:43:23 +0000
 1.36.2.3 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.36.2.2 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.36.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.37.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.40.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.40.6.5 04-Feb-2005  skrll Adapt to branch.
 1.40.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.40.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.40.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.40.6.1 03-Aug-2004  skrll Sync with HEAD
 1.41.8.1 29-Apr-2005  kent sync with -current
 1.42.8.7 07-Dec-2007  yamt sync with head
 1.42.8.6 15-Nov-2007  yamt sync with head.
 1.42.8.5 27-Oct-2007  yamt sync with head.
 1.42.8.4 03-Sep-2007  yamt sync with head.
 1.42.8.3 26-Feb-2007  yamt sync with head.
 1.42.8.2 30-Dec-2006  yamt sync with head.
 1.42.8.1 21-Jun-2006  yamt sync with head.
 1.44.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.44.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.44.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.44.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.44.8.2 11-Aug-2006  yamt sync with head
 1.44.8.1 24-May-2006  yamt sync with head.
 1.44.6.1 01-Jun-2006  kardel Sync with head.
 1.44.4.1 09-Sep-2006  rpaulo sync with head
 1.46.6.1 22-Oct-2006  yamt sync with head
 1.46.4.1 18-Nov-2006  ad Sync with head.
 1.49.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.50.24.3 21-Nov-2007  bouyer Sync with HEAD
 1.50.24.2 13-Nov-2007  bouyer Sync with HEAD
 1.50.24.1 25-Oct-2007  bouyer Sync with HEAD.
 1.50.20.2 09-Jan-2008  matt sync with HEAD
 1.50.20.1 06-Nov-2007  matt sync with HEAD
 1.50.18.3 21-Nov-2007  joerg Sync with HEAD.
 1.50.18.2 28-Oct-2007  joerg Sync with HEAD.
 1.50.18.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.50.2.2 03-Dec-2007  ad Sync with HEAD.
 1.50.2.1 23-Oct-2007  ad Sync with head.
 1.52.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.53.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.53.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.54.4.1 16-May-2008  yamt sync with head.
 1.54.2.1 18-May-2008  yamt sync with head.
 1.55.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.55.22.1 31-May-2011  rmind sync with head
 1.56.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.56.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.56.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.56.4.1 30-Oct-2012  yamt sync with head
 1.57.2.1 18-May-2014  rmind sync with head
 1.58.2.1 10-Aug-2014  tls Rebase.
 1.59.64.1 02-Aug-2025  perseant Sync with HEAD
 1.13 03-Nov-2000  tsutsui Switch to MI md_root.c. Tested on RAMDISK3X kernel.
 1.12 10-Jun-2000  tsutsui Fix printf message on attachment.
 1.11 08-May-1999  gwr branches: 1.11.2; 1.11.10;
Fix warning
 1.10 17-Mar-1999  sommerfe branches: 1.10.2; 1.10.4;
defopt MINIROOTSIZE
 1.9 27-Jan-1997  gwr Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.8 28-Dec-1996  pk rename: ramdisk => md
 1.7 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.6 13-Oct-1996  christos backout previous kprintf change
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 26-Mar-1996  gwr No longer need rd_match_hook.
 1.3 07-Mar-1996  leo Allow for a machine dependent match function - rd_match_hook()
 1.2 17-Nov-1995  gwr Add copyright
 1.1 08-Oct-1995  gwr branches: 1.1.2;
Machine-dependent part of the new RAM-disk driver.
This module lets one build a stand-alone kernel.
 1.1.2.1 18-Nov-1995  gwr Sync with HEAD: add copyright
 1.10.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.10.2.1 29-Feb-2000  he Apply patch (requested by toddpw):
Fix a compile-time error.
 1.11.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.11.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.11.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.23 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.22 16-Dec-2008  christos branches: 1.22.102;
replace bitmask_snprintf(9) with snprintb(3)
 1.21 28-Jun-2008  tsutsui branches: 1.21.4;
Split softc/device_t, with misc cosmetic changes.
 1.20 11-Dec-2005  christos branches: 1.20.74; 1.20.78; 1.20.80; 1.20.82;
merge ktrace-lwp.
 1.19 19-Jun-2005  thorpej Move common Sun ID PROM definitions into <dev/sun/idprom.h>.
 1.18 03-Jun-2005  tsutsui Constify.
 1.17 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.16 07-Aug-2003  agc branches: 1.16.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.15 15-Jul-2003  lukem __KERNEL_RCSID()
 1.14 02-Oct-2002  thorpej branches: 1.14.6;
Add trailing ; to CFATTACH_DECL.
 1.13 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.11 27-May-2001  chs branches: 1.11.2; 1.11.8;
don't abuse cf_unit.
 1.10 05-Feb-1998  gwr branches: 1.10.26;
Merge arch/sun3x into arch/sun3
 1.9 12-Jan-1998  thorpej branches: 1.9.2;
Update for changes to config.
 1.8 28-Apr-1997  gwr Rename obio_alloc/obio_mapin and check for obio in match functions
for attachments that will use obio_mapin.
 1.7 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.6 13-Nov-1996  thorpej Use bitmask_snprintf().
 1.5 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 07-Apr-1996  gwr minor cleanup
 1.1 26-Mar-1996  gwr New driver for handling the memory error interrupt.
 1.9.2.1 27-Jan-1998  gwr Merged Sun3 and Sun3X kernel sources.
 1.10.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.11.8.1 27-May-2001  nathanw file memerr.c was added on branch nathanw_sa on 2002-10-18 02:40:20 +0000
 1.11.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.6.4 24-Jan-2005  skrll Sync with HEAD.
 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.8.1 29-Apr-2005  kent sync with -current
 1.20.82.1 03-Jul-2008  simonb Sync with head.
 1.20.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.20.78.1 04-May-2009  yamt sync with head.
 1.20.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.20.74.1 29-Jun-2008  mjf Sync with HEAD.
 1.21.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.22.102.1 02-Aug-2025  perseant Sync with HEAD
 1.4 08-Feb-2018  dholland Typos.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 26-Mar-1996  gwr branches: 1.1.66;
New driver for handling the memory error interrupt.
 1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.7 24-Jan-1996  gwr Update for the new z8530 driver
 1.6 08-Oct-1995  gwr Temporary hack to restrict open to root or the
same UID as the session attached to /dev/kd
 1.5 10-Mar-1995  gwr Set speed on open (from Chuck Silvers).
 1.4 01-Dec-1994  gwr Export some headers that X will want, and minor clean-up.
 1.3 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.2 13-Feb-1996  gwr now in sys/dev
 1.1 29-Oct-1995  gwr branches: 1.1.2;
New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.2 29-Oct-1995  gwr New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.1 29-Oct-1995  gwr file ncr5380.doc was added on branch netbsd-1-1 on 1995-10-29 21:19:08 +0000
 1.3 13-Feb-1996  gwr now in sys/dev
 1.2 17-Nov-1995  gwr Latest, greatest version of the new NCR driver.
DMA works! Interrupts work! Disconnect/reselect works!
To be paranoid, leave that all disabled for now...
 1.1 29-Oct-1995  gwr branches: 1.1.2;
New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.2 18-Nov-1995  gwr Sync with HEAD: (latest, greatest NCR driver...)
 1.1.2.1 29-Oct-1995  gwr file ncr5380reg.h was added on branch netbsd-1-1 on 1995-11-18 07:08:23 +0000
 1.3 13-Feb-1996  gwr now in sys/dev
 1.2 17-Nov-1995  gwr Latest, greatest version of the new NCR driver.
DMA works! Interrupts work! Disconnect/reselect works!
To be paranoid, leave that all disabled for now...
 1.1 29-Oct-1995  gwr branches: 1.1.2;
New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.2 18-Nov-1995  gwr Sync with HEAD: (latest, greatest NCR driver...)
 1.1.2.1 29-Oct-1995  gwr file ncr5380sbc.c was added on branch netbsd-1-1 on 1995-11-18 07:08:34 +0000
 1.3 13-Feb-1996  gwr now in sys/dev
 1.2 17-Nov-1995  gwr Latest, greatest version of the new NCR driver.
DMA works! Interrupts work! Disconnect/reselect works!
To be paranoid, leave that all disabled for now...
 1.1 29-Oct-1995  gwr branches: 1.1.2;
New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.2 18-Nov-1995  gwr Sync with HEAD: (latest, greatest NCR driver...)
 1.1.2.1 29-Oct-1995  gwr file ncr5380var.h was added on branch netbsd-1-1 on 1995-11-18 07:08:41 +0000
 1.8 26-Mar-1996  gwr This was carved up and reincarnated as si*
 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 22-Feb-1996  gwr Correct the DMA transfer count when the target disconnects before
the whole transfer is completed. (Affects VME writes)
Reselect now works on the VME si board!
 1.5 16-Feb-1996  gwr Have <sys/param.h> so no need for <sys/types.h>
 1.4 12-Feb-1996  gwr Avoid 3/50 H/W bug (I hope)
 1.3 01-Jan-1996  thorpej It's safe to use <dev/ic/ncr5380*.h> now.
 1.2 17-Nov-1995  gwr Latest, greatest version of the new NCR driver.
DMA works! Interrupts work! Disconnect/reselect works!
To be paranoid, leave that all disabled for now...
 1.1 29-Oct-1995  gwr branches: 1.1.2;
New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.3 12-Feb-1996  gwr Avoid 3/50 H/W bug (I hope)
 1.1.2.2 18-Nov-1995  gwr Sync with HEAD: (latest, greatest NCR driver...)
 1.1.2.1 29-Oct-1995  gwr file ncr_si.c was added on branch netbsd-1-1 on 1995-11-18 07:08:48 +0000
 1.3 26-Mar-1996  gwr This was carved up and reincarnated as si*
 1.2 17-Nov-1995  gwr Latest, greatest version of the new NCR driver.
DMA works! Interrupts work! Disconnect/reselect works!
To be paranoid, leave that all disabled for now...
 1.1 29-Oct-1995  gwr branches: 1.1.2;
New SCSI driver for the NCR5380, by David Jones.
Does DMA with interrupts. Much faster than our old
driver which did only PIO transfers. (Thanks David!)
Could be used on the amiga, and probably others...
 1.1.2.2 18-Nov-1995  gwr Sync with HEAD: (latest, greatest NCR driver...)
 1.1.2.1 29-Oct-1995  gwr file ncr_sireg.h was added on branch netbsd-1-1 on 1995-11-18 07:08:55 +0000
 1.12 14-Dec-1996  gwr No longer used.
 1.11 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.10 13-Oct-1996  christos backout previous kprintf change
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 26-Mar-1996  gwr New autoconfig design that controls attach order.
 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 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.5 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 06-May-1994  gwr Tracking 4.4 integration
 1.2 01-Mar-1994  glass canonicalize includes. cleanup. missing copyrights.
 1.1 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.34 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.33 12-Jan-1998  thorpej branches: 1.33.2;
Update for changes to config.
 1.32 02-Dec-1997  gwr Kill some noise from -DDEBUG
 1.31 04-Oct-1997  gwr Move the call to cninit() up a level (easier to find).
 1.30 28-Apr-1997  gwr branches: 1.30.4;
Fix a bug where OBIO locators were not presented to the children.
Rename obio_alloc to obio_mapin; add comments, etc. (like sun3x)
 1.29 27-Jan-1997  gwr Nuke sunmon.h, add machdep.h
 1.28 27-Jan-1997  gwr Use sunmon_abort() instead of mon_panic(), etc.
 1.27 27-Jan-1997  gwr Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.26 18-Jan-1997  gwr Use the same names (OBIO_ZS_*) as the sun3x port so we can share zs.
 1.25 17-Dec-1996  gwr Add a diagnostic to panic when obio config data has a
default address, which is no longer supported on obio.
 1.24 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.23 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.22 30-Oct-1996  gwr Add a "submatch" function to the obio bus driver so the children
of this driver can get rid of the cruft in their match functions.
 1.21 13-Oct-1996  christos backout previous kprintf change
 1.20 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 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 26-Mar-1996  gwr New autoconfig design that controls attach order.
 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 13-Feb-1995  gwr DVMA slave mapping support.
 1.15 11-Jan-1995  gwr Cleanup
 1.14 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.13 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.12 26-Oct-1994  cgd new RCS ID format.
 1.11 20-Sep-1994  gwr branches: 1.11.2;
Add obio_find_mapping() for use by devices that need mappings before
autoconfiguration is done. It re-uses the PROM's mappings now.
 1.10 06-May-1994  gwr Tracking 4.4 integration
 1.9 05-May-1994  gwr cosmetic
 1.8 04-May-1994  gwr Add zs0_va, zs1_va
 1.7 16-Mar-1994  glass do nothing obio_probe_byte()
 1.6 01-Mar-1994  glass canonicalize includes. cleanup. missing copyrights.
 1.5 12-Oct-1993  glass sun3 port updated. netboot integrated.
 1.4 21-Aug-1993  glass snapshot. for uploading. gets lost in swtch after enablertclock()
 1.3 16-Aug-1993  glass 'clock' is now part of the standard config system instead of being done
early and in a hacked way. the movement of startrtclock() to below
cpu_startup() allows this.
 1.2 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.1 08-Aug-1993  glass lots of changes, too many printfs
 1.11.2.2 20-Sep-1994  gwr Add obio_find_mapping() for use by devices that need mappings before
autoconfiguration is done. It re-uses the PROM's mappings now.
 1.11.2.1 20-Sep-1994  gwr file obio.c was added on branch netbsd-1-0 on 1994-09-20 16:24:46 +0000
 1.30.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.33.2.1 25-Jan-1998  gwr Now in ../sun3 or ../sun3x
 1.15 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.14 12-Jan-1998  thorpej branches: 1.14.2;
Update for changes to config.
 1.13 27-Jan-1997  gwr Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.12 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.11 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.10 13-Oct-1996  christos backout previous kprintf change
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 26-Mar-1996  gwr New autoconfig design that controls attach order.
 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 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.5 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 06-May-1994  gwr Tracking 4.4 integration
 1.2 01-Mar-1994  glass canonicalize includes. cleanup. missing copyrights.
 1.1 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.14.2.1 25-Jan-1998  gwr Now in ../sun3 or ../sun3x
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.76; 1.5.78;
merge ktrace-lwp.
 1.4 10-Dec-2003  agc Modify the licences of code written by Theo De Raadt from a 4-clause
to a 2-clause licence (retaining UCB clauses (1) and (2)), per PR
22409 from Joel Baker, approved by Theo de Raadt, and ratified by
myself - the only discrepancy being the handling of the original
clause 3 in src/usr.sbin/yppoll/yppoll.c.
 1.3 08-Feb-1998  gwr branches: 1.3.48;
cosmetic
 1.2 05-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 09-Apr-1997  jeremy branches: 1.1.4;
Constants for the p4 register.
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.48.1 03-Aug-2004  skrll Sync with HEAD
 1.5.78.1 16-May-2008  yamt sync with head.
 1.5.76.1 18-May-2008  yamt sync with head.
 1.5.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.16 26-Mar-1996  gwr No longer used.
 1.15 10-Apr-1995  mycroft Add promstop(), adjust return types, make sure ttselect() doesn't panic, and
obey standard style conventions.
 1.14 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.13 26-Oct-1994  cgd new RCS ID format.
 1.12 05-May-1994  gwr changes to use generic dev/cons.c
 1.11 17-Apr-1994  glass compiles again. also cleanup of development printfs. and trap stuff
 1.10 06-Mar-1994  glass change receive freq
 1.9 01-Mar-1994  glass canonicalize includes. cleanup. missing copyrights.
 1.8 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.7 23-Nov-1993  glass Now works with current tree, as opposed to the july 8th tree in which it was
written.
Requires magnum infrastructure now, particularly the clock stuff.
Fails to exec init because the /sbin/init binary
is a sunos binary. Next step is to integrate sunos compatibility code
from /sys/compat/sunos, and the amiga port.
Does not yet implement MACHINE_NOCONTIG support.

[from glass Mon Nov 22 21:22:45 PST 1993 home tag: home2]
 1.6 12-Oct-1993  glass sun3 port updated. netboot integrated.
 1.5 15-Aug-1993  glass runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks
 1.4 08-Aug-1993  glass stuff to make them compile properly
 1.3 05-Aug-1993  glass gets to consinit() and blows up
 1.2 27-Jun-1993  glass this mallocing 'struct tty' stuff is bogus as the vm system isn't
up and running yet when consoles are first used. squish.
 1.1 27-Jun-1993  glass theoretically (uncompiled), both a prom tty driver and prom as console
support
 1.8 28-Dec-1996  pk rename: ramdisk => md
 1.7 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.6 13-Oct-1996  christos backout previous kprintf change
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 26-Mar-1996  gwr No longer need rd_match_hook.
 1.3 07-Mar-1996  leo Allow for a machine dependent match function - rd_match_hook()
 1.2 17-Nov-1995  gwr Add copyright
 1.1 08-Oct-1995  gwr branches: 1.1.2;
Machine-dependent part of the new RAM-disk driver.
This module lets one build a stand-alone kernel.
 1.1.2.1 18-Nov-1995  gwr Sync with HEAD: add copyright
 1.5 13-Feb-1996  gwr no longer useful
 1.4 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 01-Mar-1994  glass canonicalize includes. cleanup. missing copyrights.
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.5 13-Feb-1996  gwr no longer useful
 1.4 01-Jun-1995  gwr Better reset code, and reset the chip when it goes comatose.
 1.3 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.3 13-Feb-1996  gwr no longer useful
 1.2 01-Jun-1995  gwr Better reset code, and reset the chip when it goes comatose.
 1.1 24-Jan-1995  gwr Now works on VME as well (or as poorly) as on OBIO.
 1.21 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.20 20-Dec-2023  thorpej branches: 1.20.2;
Remove unnecessary <sys/malloc.h>.
 1.19 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.18 24-Apr-2021  thorpej branches: 1.18.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.17 28-Jun-2008  tsutsui branches: 1.17.98;
Split softc/device_t, with misc cosmetic changes.
 1.16 28-Apr-2008  martin branches: 1.16.2; 1.16.4;
Remove clause 3 and 4 from TNF licenses
 1.15 04-Mar-2007  christos branches: 1.15.40; 1.15.42; 1.15.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 11-Dec-2005  christos branches: 1.14.26;
merge ktrace-lwp.
 1.13 22-Jan-2005  chs branches: 1.13.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.12 15-Jul-2003  lukem branches: 1.12.8;
__KERNEL_RCSID()
 1.11 01-Jan-2003  thorpej branches: 1.11.2;
Use aprint_normal() for cfprint routines.
 1.10 26-Oct-2002  jdolecek g/c local offsetof(), it's defined in libkern.h
 1.9 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.8 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.7 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.6 29-Jun-2000  mrg branches: 1.6.4; 1.6.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.5 09-Apr-1999  gwr branches: 1.5.2; 1.5.8;
Better implementation of driver "match" function,
and warning/error cleanup.
 1.4 12-Jan-1998  thorpej Update for changes to config.
 1.3 08-Dec-1997  gwr Fix missing newline in attach
 1.2 25-Oct-1997  gwr I had the memory map wrong for the SCSI/Ethernet board.
Fixes from Michael Thompson.
 1.1 17-Oct-1997  gwr branches: 1.1.2;
Add support for the Sun3/E "se" (Ethernet/SCSI) board.
Compiles, but NOT YET TESTED.
 1.1.2.2 09-Dec-1997  thorpej Sync w/ trunk: Sun3/E SCSI/Ethernet now works. (gwr)
 1.1.2.1 26-Oct-1997  mellon Pull rev 1.2 up from trunk (gwr)
 1.5.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.2.2 09-Apr-1999  gwr Better implementation of driver "match" function,
and warning/error cleanup.
 1.5.2.1 09-Apr-1999  gwr file sebuf.c was added on branch netbsd-1-4 on 1999-04-09 04:26:28 +0000
 1.6.8.3 03-Jan-2003  thorpej Sync with HEAD.
 1.6.8.2 11-Nov-2002  nathanw Catch up to -current
 1.6.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.6.4.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.11.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.8.1 29-Apr-2005  kent sync with -current
 1.13.8.1 03-Sep-2007  yamt sync with head.
 1.14.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.44.2 04-May-2009  yamt sync with head.
 1.15.44.1 16-May-2008  yamt sync with head.
 1.15.42.1 18-May-2008  yamt sync with head.
 1.15.40.2 29-Jun-2008  mjf Sync with HEAD.
 1.15.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.4.1 03-Jul-2008  simonb Sync with head.
 1.16.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.17.98.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.18.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.20.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 03-May-2003  wiz branches: 1.5.104; 1.5.106; 1.5.108;
DMA, not dma nor Dma.
 1.4 08-Mar-1998  gwr Fix comments
 1.3 08-Dec-1997  gwr Define the interrupt vector registers as 16-bit fields as
shown in the documentation. (Thanks to Michael Thompson)
 1.2 25-Oct-1997  gwr I had the memory map wrong for the SCSI/Ethernet board.
Fixes from Michael Thompson.
 1.1 17-Oct-1997  gwr branches: 1.1.2;
Add support for the Sun3/E "se" (Ethernet/SCSI) board.
Compiles, but NOT YET TESTED.
 1.1.2.2 09-Dec-1997  thorpej Sync w/ trunk: Sun3/E SCSI/Ethernet now works. (gwr)
 1.1.2.1 26-Oct-1997  mellon Pull rev 1.2 up from trunk (gwr)
 1.5.108.1 16-May-2008  yamt sync with head.
 1.5.106.1 18-May-2008  yamt sync with head.
 1.5.104.1 02-Jun-2008  mjf Sync with HEAD.
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.76; 1.3.78;
merge ktrace-lwp.
 1.2 03-Jun-2005  tsutsui Constify.
 1.1 17-Oct-1997  gwr branches: 1.1.52;
Add support for the Sun3/E "se" (Ethernet/SCSI) board.
Compiles, but NOT YET TESTED.
 1.1.52.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.78.1 16-May-2008  yamt sync with head.
 1.3.76.1 18-May-2008  yamt sync with head.
 1.3.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.65 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.64 21-Nov-2020  thorpej branches: 1.64.24;
malloc(9) -> kmem(9)
 1.63 21-Nov-2009  rmind branches: 1.63.76;
Use lwp_getpcb() on sparc{64} and sun2/3 MD code, clean from struct user usage.
 1.62 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.61 04-Apr-2008  tsutsui branches: 1.61.2; 1.61.4;
Split devict_t/softc for ncr5380sbc SCSI, and misc cosmetic changes.
 1.60 04-Feb-2007  tsutsui branches: 1.60.44;
Remove unused dh_addr member from struct si_dma_handle.
 1.59 04-Feb-2007  tsutsui Remove leftover debug stuff which could break si_obio DMA.
 1.58 03-Feb-2007  tsutsui Make si at obio and si at vme on sun3 use bus_dma(9) for data xfer.

XXX1: Only si at vme on TME is tested.
XXX2: No info about DMA on si at sebuf. (bounce buffer required?)
 1.57 11-Dec-2005  christos branches: 1.57.20;
merge ktrace-lwp.
 1.56 22-Jan-2005  chs branches: 1.56.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.55 13-Dec-2004  chs branches: 1.55.2;
adjust for b_bcount changing from long to int.
 1.54 15-Jul-2003  lukem __KERNEL_RCSID()
 1.53 03-May-2003  wiz branches: 1.53.2;
DMA, not dma nor Dma.
 1.52 29-Dec-2002  kristerw Do not try to return a value from void functions.
 1.51 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.50 25-Apr-2001  bouyer branches: 1.50.2; 1.50.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.49 01-Apr-2000  tsutsui branches: 1.49.6;
Fix typo. (s/sc_adapter/sc_link/)
 1.48 25-Mar-2000  tsutsui Add a "sc_rev" member to ncr5380_softc and handle CXD1180 quirk
in MI ncr5380sbc.
 1.47 18-Mar-2000  mycroft Add a ncr5380_attach() routine which does part of the initialization, attaches
the scsibus, and does the addref/delref dance.
 1.46 22-Nov-1999  jdolecek Debugger()/cpu_Debugger() is always available and always defined/prototyped
in <sys/systm.h> for sun3/sun3x, even in non-DDB case
 1.45 03-Nov-1999  jdolecek adapt to latest scsipi changes
XXX this is not actually tested, but should be okay
 1.44 17-Oct-1999  jdolecek branches: 1.44.2; 1.44.4;
include opt_ddb.h, so that symbol DDB actually get's defined appropriately
si_intr(): consmetic change to the code calling Debugger()

First part of fix to PR #8637 by Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>.
 1.43 02-Feb-1999  fair branches: 1.43.8;
Bracket calls to Debugger() with #ifdef DDB (won't compile otherwise;
the prototype isn't there without DDB).
 1.42 23-Dec-1998  fair Make gcc happy by changing %x to %lx hiding in a DEBUG.
 1.41 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.40 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.39 12-Jan-1998  thorpej Update for changes to config.
 1.38 28-Oct-1997  gwr Left DEBUG there by accident. Remove it
 1.37 17-Oct-1997  gwr branches: 1.37.2;
Move si_reset_adapter() from si.c into the bus-specific modules.
Support the Sun3/470 (sun3x). Adapt to the new DVMA interface.
Set the si_xxx_options in the config file (easier for users).
 1.36 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.35 28-Apr-1997  gwr branches: 1.35.2; 1.35.4;
si_intr: if our CSR indicates an interrupt, return 1.
 1.34 26-Feb-1997  gwr Allow per-target control over disconnect/reselect.
 1.33 27-Jan-1997  gwr branches: 1.33.4;
Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.32 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.31 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.30 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.29 13-Oct-1996  christos backout previous kprintf change
 1.28 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.27 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.26 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.25 17-Jun-1996  gwr branches: 1.25.2;
Move some of the DMA engine initialization from the "start" routine
to the "setup" routine. Doing the initialization earlier prevents
nasty race conditions where the 5380 prefetch changes the counter.
 1.24 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
Also move it back to the traditional name (si).
 1.23 13-Feb-1996  gwr no longer useful
 1.22 08-Oct-1995  gwr Minor cleanup.
 1.21 14-Aug-1995  gwr SCSI bus phase not valid until REQ is true (Fix from David Jones).
 1.20 12-Aug-1995  mycroft minphys() functions really should return void.
 1.19 08-Aug-1995  gwr Improve handling of a device that "sits on" the bus (from Jason Thorpe)
 1.18 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.17 01-Jun-1995  gwr Better reset code, and reset the chip when it goes comatose.
 1.16 24-May-1995  gwr Improve probe (should reject "sc" board now)
 1.15 26-Mar-1995  gwr The splbio()/splx(s) is now appropriate even if SCSI_POLL is set.
 1.14 24-Jan-1995  gwr Now works on VME as well (or as poorly) as on OBIO.
 1.13 10-Jan-1995  gwr Fixed to work with the new SCSI code (thanks to Phil Nelson).
 1.12 31-Dec-1994  gwr Update for new SCSI.
 1.11 13-Dec-1994  gwr Have working bus_peek(), and drivers use it.
 1.10 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.9 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.8 26-Oct-1994  cgd new RCS ID format.
 1.7 20-Sep-1994  gwr branches: 1.7.2;
Call obio_alloc with just two args (mappings always writable).
 1.6 06-Jul-1994  gwr Add a fix for slow devices from Phil Nelson.
 1.5 28-May-1994  gwr ...try again...
 1.4 28-May-1994  gwr junk removal
 1.3 16-May-1994  gwr Remove some cruft left over from debugging.
 1.2 13-May-1994  gwr SCSI driver works!
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.7.2.2 20-Sep-1994  gwr Call obio_alloc with just two args (mappings always writable).
 1.7.2.1 20-Sep-1994  gwr file si.c was added on branch netbsd-1-0 on 1994-09-20 16:21:47 +0000
 1.25.2.2 17-Jun-1996  gwr Move some of the DMA engine initialization from the "start" routine
to the "setup" routine. Doing the initialization earlier prevents
nasty race conditions where the 5380 prefetch changes the counter.
 1.25.2.1 17-Jun-1996  gwr file si.c was added on branch netbsd-1-2 on 1996-06-17 23:21:30 +0000
 1.33.4.1 12-Mar-1997  is Merge in changes from The Trunk
 1.35.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.35.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.37.2.1 29-Oct-1997  mellon Pull rev 1.38 up from trunk (gwr)
 1.43.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.44.4.1 15-Nov-1999  fvdl Sync with -current
 1.44.2.3 18-Feb-2001  bouyer Make compile again.
 1.44.2.2 22-Jan-2001  bouyer first cut at converting to thorpej_scsipi
 1.44.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.49.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.50.8.3 29-Dec-2002  thorpej Sync with HEAD.
 1.50.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.50.8.1 25-Apr-2001  nathanw file si.c was added on branch nathanw_sa on 2002-10-18 02:40:20 +0000
 1.50.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.53.2.5 24-Jan-2005  skrll Sync with HEAD.
 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.55.2.1 29-Apr-2005  kent sync with -current
 1.56.8.1 26-Feb-2007  yamt sync with head.
 1.57.20.1 09-Feb-2007  ad Sync with HEAD.
 1.60.44.1 02-Jun-2008  mjf Sync with HEAD.
 1.61.4.2 11-Mar-2010  yamt sync with head
 1.61.4.1 16-May-2008  yamt sync with head.
 1.61.2.1 18-May-2008  yamt sync with head.
 1.63.76.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.64.24.1 02-Aug-2025  perseant Sync with HEAD
 1.39 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.38 20-Dec-2023  thorpej branches: 1.38.2;
Remove unnecessary <sys/malloc.h>.
 1.37 27-Dec-2019  msaitoh s/transfered/transferred/
 1.36 21-Nov-2009  rmind branches: 1.36.64;
Use lwp_getpcb() on sparc{64} and sun2/3 MD code, clean from struct user usage.
 1.35 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.34 04-Apr-2008  tsutsui branches: 1.34.2; 1.34.4;
Split devict_t/softc for ncr5380sbc SCSI, and misc cosmetic changes.
 1.33 03-Feb-2007  tsutsui branches: 1.33.44;
Make si at obio and si at vme on sun3 use bus_dma(9) for data xfer.

XXX1: Only si at vme on TME is tested.
XXX2: No info about DMA on si at sebuf. (bounce buffer required?)
 1.32 29-Mar-2006  thorpej branches: 1.32.8;
Use device_cfdata().
 1.31 24-Dec-2005  perry branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10; 1.31.12;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.30 11-Dec-2005  christos merge ktrace-lwp.
 1.29 22-Jan-2005  chs branches: 1.29.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.28 24-Feb-2004  wiz branches: 1.28.8;
becuase -> because. From Peter Postma.
 1.27 15-Jul-2003  lukem __KERNEL_RCSID()
 1.26 03-May-2003  wiz branches: 1.26.2;
DMA, not dma nor Dma.
 1.25 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.24 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.23 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.22 20-Aug-2001  wiz branches: 1.22.6;
precede, not preceed.
 1.21 22-Nov-1999  jdolecek branches: 1.21.8;
Debugger()/cpu_Debugger() is always available and always defined/prototyped
in <sys/systm.h> for sun3/sun3x, even in non-DDB case
 1.20 17-Oct-1999  jdolecek branches: 1.20.2;
include opt_ddb.h so that symbol DDB gets defined appropriately and right
thing happens WRT Debugger()
call Debugger() only when DDB is defined
 1.19 05-Feb-1998  gwr branches: 1.19.14;
Merge arch/sun3x into arch/sun3
 1.18 09-Dec-1997  gwr branches: 1.18.2;
Remove local definition of DEBUG (left there by accident).
 1.17 21-Oct-1997  gwr Fix a warning
 1.16 17-Oct-1997  gwr branches: 1.16.2;
Move si_reset_adapter() from si.c into the bus-specific modules.
Support the Sun3/470 (sun3x). Adapt to the new DVMA interface.
Set the si_xxx_options in the config file (easier for users).
 1.15 07-Oct-1997  gwr typo
 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 29-Jul-1997  fair branches: 1.13.2;
%x -> 0x%x, fixes for PR#3757
 1.12 28-Apr-1997  gwr branches: 1.12.2;
Rename obio_alloc/obio_mapin and check for obio in match functions
for attachments that will use obio_mapin.
 1.11 26-Feb-1997  gwr Allow per-target control over disconnect/reselect.
 1.10 27-Jan-1997  gwr branches: 1.10.4;
Update comment about si_obio_options
 1.9 27-Jan-1997  gwr Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.8 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.7 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.6 30-Oct-1996  gwr Allow the config line "flags" to set bits in si_options.
Thanks to Jason Thorpe for the fix! (PR#1929)
 1.5 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 17-Jun-1996  gwr branches: 1.2.2;
Move some of the DMA engine initialization from the "start" routine
to the "setup" routine. Doing the initialization earlier prevents
nasty race conditions where the 5380 prefetch changes the counter.
 1.1 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
Also move it back to the traditional name (si).
 1.2.2.2 17-Jun-1996  gwr Move some of the DMA engine initialization from the "start" routine
to the "setup" routine. Doing the initialization earlier prevents
nasty race conditions where the 5380 prefetch changes the counter.
 1.2.2.1 17-Jun-1996  gwr file si_obio.c was added on branch netbsd-1-2 on 1996-06-17 23:21:36 +0000
 1.10.4.1 12-Mar-1997  is Merge in changes from The Trunk
 1.12.2.2 30-Jul-1997  bouyer Sync with trunk.
 1.12.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.13.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.2.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.16.2.1 22-Oct-1997  mellon pull up from main trunk to fix warning
 1.18.2.1 27-Jan-1998  gwr Merged Sun3 and Sun3X kernel sources.
 1.19.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.20.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.21.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.21.8.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.22.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.22.6.1 20-Aug-2001  nathanw file si_obio.c was added on branch nathanw_sa on 2002-10-18 02:40:21 +0000
 1.26.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.26.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.26.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.8.1 29-Apr-2005  kent sync with -current
 1.29.8.2 26-Feb-2007  yamt sync with head.
 1.29.8.1 21-Jun-2006  yamt sync with head.
 1.31.12.1 31-Mar-2006  tron Merge 2006-03-31 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.32.8.1 09-Feb-2007  ad Sync with HEAD.
 1.33.44.1 02-Jun-2008  mjf Sync with HEAD.
 1.34.4.2 11-Mar-2010  yamt sync with head
 1.34.4.1 16-May-2008  yamt sync with head.
 1.34.2.1 18-May-2008  yamt sync with head.
 1.36.64.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.38.2.1 02-Aug-2025  perseant Sync with HEAD
 1.33 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.32 23-Jan-2023  andvar branches: 1.32.6;
s/lager/larger/ in comments.
 1.31 02-Aug-2021  andvar fix various typos in comments and log messages.
 1.30 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.29 07-Nov-2013  christos branches: 1.29.42;
fix unused warnings
 1.28 21-Nov-2009  rmind branches: 1.28.12; 1.28.22; 1.28.26;
Use lwp_getpcb() on sparc{64} and sun2/3 MD code, clean from struct user usage.
 1.27 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.26 04-Apr-2008  tsutsui branches: 1.26.2; 1.26.4;
Split devict_t/softc for ncr5380sbc SCSI, and misc cosmetic changes.
 1.25 04-Mar-2007  christos branches: 1.25.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.24 29-Mar-2006  thorpej branches: 1.24.14;
Use device_cfdata().
 1.23 11-Dec-2005  christos branches: 1.23.4; 1.23.6; 1.23.8; 1.23.10; 1.23.12;
merge ktrace-lwp.
 1.22 22-Jan-2005  chs branches: 1.22.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.21 15-Jul-2003  lukem branches: 1.21.8;
__KERNEL_RCSID()
 1.20 03-May-2003  wiz branches: 1.20.2;
DMA, not dma nor Dma.
 1.19 29-Dec-2002  kristerw Do not try to return a value from void functions.
 1.18 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.17 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.14 20-Aug-2001  wiz branches: 1.14.6;
precede, not preceed.
 1.13 25-Apr-2001  bouyer branches: 1.13.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.12 01-Apr-2000  tsutsui branches: 1.12.6;
Fix typo. (s/sc_adapter/sc_link/)
 1.11 25-Mar-2000  tsutsui Add a "sc_rev" member to ncr5380_softc and handle CXD1180 quirk
in MI ncr5380sbc.
 1.10 18-Mar-2000  mycroft Add a ncr5380_attach() routine which does part of the initialization, attaches
the scsibus, and does the addref/delref dance.
 1.9 03-Nov-1999  jdolecek adapt to latest scsipi changes
XXX this is not tested, but should be okay
 1.8 09-Apr-1999  gwr branches: 1.8.2; 1.8.8; 1.8.10; 1.8.12;
Better implementation of driver "match" function,
and warning/error cleanup.
 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 09-Dec-1997  gwr Remove local definition of DEBUG (left there by accident).
 1.4 08-Nov-1997  gwr Oops...(pasto)
 1.3 07-Nov-1997  gwr Disable DMA and interrupts for now (via se_options).
 1.2 17-Oct-1997  gwr branches: 1.2.2;
Nuke same-unit hack in match.
 1.1 17-Oct-1997  gwr Add support for the Sun3/E "se" (Ethernet/SCSI) board.
Compiles, but NOT YET TESTED.
 1.2.2.2 09-Nov-1997  mellon Pull rev 1.4 up from trunk (gwr)
 1.2.2.1 07-Nov-1997  mellon Pull rev 1.3 up from trunk (gwr)
 1.8.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.10.1 15-Nov-1999  fvdl Sync with -current
 1.8.8.3 29-Mar-2001  bouyer Test-compile on i386.
 1.8.8.2 22-Jan-2001  bouyer first cut at converting to thorpej_scsipi
 1.8.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.2.2 09-Apr-1999  gwr Better implementation of driver "match" function,
and warning/error cleanup.
 1.8.2.1 09-Apr-1999  gwr file si_sebuf.c was added on branch netbsd-1-4 on 1999-04-09 04:26:28 +0000
 1.12.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.13.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.13.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.14.6.3 29-Dec-2002  thorpej Sync with HEAD.
 1.14.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.14.6.1 20-Aug-2001  nathanw file si_sebuf.c was added on branch nathanw_sa on 2002-10-18 02:40:21 +0000
 1.20.2.4 24-Jan-2005  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.21.8.1 29-Apr-2005  kent sync with -current
 1.22.8.2 03-Sep-2007  yamt sync with head.
 1.22.8.1 21-Jun-2006  yamt sync with head.
 1.23.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.23.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.23.8.1 01-Apr-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.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.25.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.26.4.2 11-Mar-2010  yamt sync with head
 1.26.4.1 16-May-2008  yamt sync with head.
 1.26.2.1 18-May-2008  yamt sync with head.
 1.28.26.1 18-May-2014  rmind sync with head
 1.28.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.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.29.42.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.32.6.1 02-Aug-2025  perseant Sync with HEAD
 1.33 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.32 20-Dec-2023  thorpej branches: 1.32.2;
Remove unnecessary <sys/malloc.h>.
 1.31 02-Aug-2021  andvar fix various typos in comments and log messages.
 1.30 21-Nov-2009  rmind Use lwp_getpcb() on sparc{64} and sun2/3 MD code, clean from struct user usage.
 1.29 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.28 04-Apr-2008  tsutsui branches: 1.28.2; 1.28.4;
Split devict_t/softc for ncr5380sbc SCSI, and misc cosmetic changes.
 1.27 12-Mar-2007  tsutsui branches: 1.27.38;
Fix printf formats in #ifdef DEBUG.
 1.26 03-Feb-2007  tsutsui branches: 1.26.2; 1.26.6;
Make si at obio and si at vme on sun3 use bus_dma(9) for data xfer.

XXX1: Only si at vme on TME is tested.
XXX2: No info about DMA on si at sebuf. (bounce buffer required?)
 1.25 29-Mar-2006  thorpej branches: 1.25.8;
Use device_cfdata().
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10; 1.24.12;
merge ktrace-lwp.
 1.23 22-Jan-2005  chs branches: 1.23.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.22 15-Jul-2003  lukem branches: 1.22.8;
__KERNEL_RCSID()
 1.21 03-May-2003  wiz branches: 1.21.2;
DMA, not dma nor Dma.
 1.20 08-Oct-2002  jdolecek fix typo - si_vme, not si_vmw
 1.19 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.18 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.17 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.16 20-Aug-2001  wiz branches: 1.16.6;
precede, not preceed.
 1.15 05-Feb-1998  gwr branches: 1.15.28;
Merge arch/sun3x into arch/sun3
 1.14 09-Dec-1997  gwr branches: 1.14.2;
Remove local definition of DEBUG (left there by accident).
 1.13 17-Oct-1997  gwr Move si_reset_adapter() from si.c into the bus-specific modules.
Support the Sun3/470 (sun3x). Adapt to the new DVMA interface.
Set the si_xxx_options in the config file (easier for users).
 1.12 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.11 29-Jul-1997  fair branches: 1.11.2;
%x -> 0x%x, fixes for PR#3757
 1.10 26-Feb-1997  gwr branches: 1.10.2;
Allow per-target control over disconnect/reselect.
 1.9 27-Jan-1997  gwr branches: 1.9.4;
Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.8 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.7 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.6 30-Oct-1996  gwr Allow the config line "flags" to set bits in si_options.
Thanks to Jason Thorpe for the fix! (PR#1929)
 1.5 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 17-Jun-1996  gwr branches: 1.2.2;
Move some of the DMA engine initialization from the "start" routine
to the "setup" routine. Doing the initialization earlier prevents
nasty race conditions where the 5380 prefetch changes the counter.
 1.1 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
Also move it back to the traditional name (si).
 1.2.2.2 17-Jun-1996  gwr Move some of the DMA engine initialization from the "start" routine
to the "setup" routine. Doing the initialization earlier prevents
nasty race conditions where the 5380 prefetch changes the counter.
 1.2.2.1 17-Jun-1996  gwr file si_vme.c was added on branch netbsd-1-2 on 1996-06-17 23:21:40 +0000
 1.9.4.1 12-Mar-1997  is Merge in changes from The Trunk
 1.10.2.2 30-Jul-1997  bouyer Sync with trunk.
 1.10.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.11.2.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.2.1 26-Jan-1998  gwr s/vmes/vme/g
 1.15.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.15.28.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.16.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.16.6.1 20-Aug-2001  nathanw file si_vme.c was added on branch nathanw_sa on 2002-10-18 02:40:21 +0000
 1.21.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Aug-2004  skrll Sync with HEAD
 1.22.8.1 29-Apr-2005  kent sync with -current
 1.23.8.3 03-Sep-2007  yamt sync with head.
 1.23.8.2 26-Feb-2007  yamt sync with head.
 1.23.8.1 21-Jun-2006  yamt sync with head.
 1.24.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.24.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.24.8.1 01-Apr-2006  yamt sync with head.
 1.24.6.1 22-Apr-2006  simonb Sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.25.8.1 09-Feb-2007  ad Sync with HEAD.
 1.26.6.1 13-Mar-2007  ad Sync with head.
 1.26.2.1 24-Mar-2007  yamt sync with head.
 1.27.38.1 02-Jun-2008  mjf Sync with HEAD.
 1.28.4.2 11-Mar-2010  yamt sync with head
 1.28.4.1 16-May-2008  yamt sync with head.
 1.28.2.1 18-May-2008  yamt sync with head.
 1.32.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.2 03-May-2003  wiz branches: 1.2.230;
DMA, not dma nor Dma.
 1.1 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
Also move it back to the traditional name (si).
 1.2.230.1 02-Aug-2025  perseant Sync with HEAD
 1.12 23-Jan-2023  andvar s/lager/larger/ in comments.
 1.11 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10 04-Feb-2007  tsutsui branches: 1.10.44; 1.10.46; 1.10.48;
Remove unused dh_addr member from struct si_dma_handle.
 1.9 03-Feb-2007  tsutsui Make si at obio and si at vme on sun3 use bus_dma(9) for data xfer.

XXX1: Only si at vme on TME is tested.
XXX2: No info about DMA on si at sebuf. (bounce buffer required?)
 1.8 11-Dec-2005  christos branches: 1.8.20;
merge ktrace-lwp.
 1.7 22-Jan-2005  chs branches: 1.7.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.6 17-Oct-1997  gwr branches: 1.6.52; 1.6.60;
Move si_reset_adapter() from si.c into the bus-specific modules.
Support the Sun3/470 (sun3x). Adapt to the new DVMA interface.
Set the si_xxx_options in the config file (easier for users).
 1.5 26-Feb-1997  gwr Allow per-target control over disconnect/reselect.
 1.4 27-Jan-1997  gwr branches: 1.4.4;
Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.3 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.2 30-Oct-1996  gwr Get rid of some cruft in the match function.
 1.1 26-Mar-1996  gwr Take advantage of the new config attach stuff by
splitting out the obio and vme support code.
Also move it back to the traditional name (si).
 1.4.4.1 12-Mar-1997  is Merge in changes from The Trunk
 1.6.60.1 29-Apr-2005  kent sync with -current
 1.6.52.1 24-Jan-2005  skrll Sync with HEAD.
 1.7.8.1 26-Feb-2007  yamt sync with head.
 1.8.20.1 09-Feb-2007  ad Sync with HEAD.
 1.10.48.1 16-May-2008  yamt sync with head.
 1.10.46.1 18-May-2008  yamt sync with head.
 1.10.44.1 02-Jun-2008  mjf Sync with HEAD.
 1.10 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.9 12-Jan-1998  thorpej branches: 1.9.2;
Update for changes to config.
 1.8 27-Jan-1997  gwr Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.7 17-Dec-1996  gwr Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.6 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.5 13-Oct-1996  christos backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 26-Mar-1996  gwr New autoconfig design that controls attach order.
 1.2 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.1 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.9.2.1 25-Jan-1998  gwr Now in ../sun3 or ../sun3x
 1.4 13-Oct-1995  gwr Remove (again) things accidently revived by cvs tag...
 1.3 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.81 06-Sep-2025  andvar s/Illgal/Illegal/ in error string.
 1.80 21-Dec-2024  tsutsui Make local dev_type_*() functions static.
 1.79 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.78 23-Jan-2023  andvar branches: 1.78.6;
s/cyliner/cylinder/ and s/specturm/spectrum/ in messages.
 1.77 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.76 24-Apr-2021  thorpej branches: 1.76.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.75 21-Nov-2020  thorpej branches: 1.75.2;
malloc(9) -> kmem(9)
 1.74 10-Nov-2019  chs branches: 1.74.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.73 26-Apr-2015  mlelstv branches: 1.73.18;
Use C99-style initializers for struct dkdriver.
 1.72 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.71 25-Jul-2014  dholland branches: 1.71.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.70 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.69 16-Mar-2014  dholland branches: 1.69.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.68 01-Feb-2011  chuck branches: 1.68.4; 1.68.14; 1.68.18;
udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.67 13-Jan-2009  yamt branches: 1.67.6; 1.67.8; 1.67.10;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.66 12-Jan-2009  cegger cast to char to printf DISKPART
XXX Shouldn't sun3 use the MI drivers instead?
 1.65 28-Jun-2008  tsutsui branches: 1.65.4;
Split softc/device_t, with misc cosmetic changes.
 1.64 08-Jun-2008  tsutsui branches: 1.64.2;
Use device_private() and device_lookup_private() to get softc
and to see if device unit is vaild.
 1.63 06-Feb-2008  elad branches: 1.63.6; 1.63.8; 1.63.10; 1.63.12;
It's KAUTH_REQ_DEVICE_RAWIO_PASSTHRU_*.

Noted by dogcow@, thanks!
 1.62 04-Feb-2008  elad Properly classify kauth PASSTHRU requests.

Done with much help from chuck@, thanks!
 1.61 02-Jan-2008  ad Merge vmlocking2 to head.
 1.60 17-Oct-2007  garbled branches: 1.60.2; 1.60.4; 1.60.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.59 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.58 29-Jul-2007  ad branches: 1.58.4; 1.58.6; 1.58.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.57 09-Jul-2007  ad branches: 1.57.2; 1.57.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.56 04-Mar-2007  christos branches: 1.56.2; 1.56.4; 1.56.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.55 04-Jan-2007  elad branches: 1.55.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.54 23-Jul-2006  ad branches: 1.54.4;
Use the LWP cached credentials where sane.
 1.53 14-May-2006  elad integrate kauth.
 1.52 28-Mar-2006  thorpej Use device_unit().
 1.51 11-Dec-2005  christos branches: 1.51.4; 1.51.6; 1.51.8; 1.51.10; 1.51.12;
merge ktrace-lwp.
 1.50 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.49 03-Jun-2005  tsutsui branches: 1.49.2;
- constify
- fix shadowing variables
 1.48 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.47 28-Oct-2004  yamt branches: 1.47.4;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.46 29-Sep-2003  wiz available, not avaliable. From miod@openbsd.
 1.45 15-Jul-2003  lukem __KERNEL_RCSID()
 1.44 10-May-2003  thorpej branches: 1.44.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.43 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.42 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.41 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.40 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.39 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.38 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 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.35 23-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Nathan J. Williams <nathanw@netbsd.org>
 1.34 05-Sep-2001  tsutsui branches: 1.34.2; 1.34.6; 1.34.14;
bcopy() -> memcpy(), bzero() -> memset()
 1.33 22-Jul-2001  wiz seperate -> separate
 1.32 29-Jun-2000  mrg branches: 1.32.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.31 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.30 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.29 27-May-2000  thorpej branches: 1.29.2;
sleep() -> tsleep()
 1.28 19-May-2000  thorpej A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.27 16-May-2000  thorpej Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
 1.26 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.25 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.24 17-Sep-1999  thorpej branches: 1.24.2;
Centralize the declaration and clearing of `cold'.
 1.23 13-Dec-1998  kleink xdc_piodriver: sync function definition with declaration; also eliminates
the use of a char as an array subscript.
 1.22 23-Jul-1998  gwr Print a complaint when no children were specified
in the config file. Better than a link error...
 1.21 30-Jun-1998  mrg <dev/sun/disklabel.h> not <dev/sun/sun_disklabel.h>
 1.20 24-Jun-1998  jeremy Changed to include sun_disklabel.h from its new location in dev/sun.
 1.19 26-Jan-1998  gwr Save the "bustype" from our attach args in the controller "softc"
and use that instead of hard-coding BUS_VME32 everywhere.
(The Sun3X needs a more specific bustype value.)
 1.18 12-Jan-1998  thorpej branches: 1.18.2;
Update for changes to config.
 1.17 17-Oct-1997  gwr Move initialization code from xxattach to xx_init and call that
from both xxattach and xxopen instead of calling xxattach from
xxopen with faked up autoconfig args. Fix warnings.
 1.16 29-Jul-1997  fair %x -> 0x%x, fixes for PR#3757
 1.15 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.14 24-Jun-1997  thorpej foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
 1.13 18-Jun-1997  pk xdsize(): only call xdopen()/xdclose() if not already open, per the
current `openmask'.
 1.12 28-Feb-1997  gwr Add xxc_print functions to pass to config_found() instead of NULL.
(Thanks to Chris Demetriou suggesting the improvement.)
 1.11 17-Dec-1996  gwr branches: 1.11.6;
Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.10 13-Oct-1996  christos backout previous kprintf change
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 12-Aug-1996  chuck sync with sparc version:
repair XDC_HWAIT macro to handle the fact that waithead is now
unsigned. should fix xdc watchdog timeouts noted in port-sparc
by nathanw@mit.edu.
 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 04-Mar-1996  chuck Fix two bugs reported by Don Koch <aardvark@poirot.krl.com> (PR#2168).
[1] check return value from malloc() for NULL before trying to bzero it.
[2] use "=" rather than "|=" when writing to CSR (otherwise you may
ACK something you don't mean to!).
 1.5 22-Feb-1996  thorpej Fixup some RCS ids.
 1.4 08-Feb-1996  chuck [import changes from sparc port]
- moved disk_busy() call from xdstrategy() to xdc_startbuf()
[prevents disk_unbusy panic when disk is loaded (if no
free IOPBs, xdstrategy() would queue the buffer for pickup
by xdcintr() but xdcintr() would never call disk_busy().
xdc_startbuf() is a better place since all bufs are routed
through here] problem detected by girish@dworkin.wustl.edu,
diagnosed and corrected by me.
- move disk_unbusy() call in xdc_remove_iorq() before the call to
XDC_FREE() [don't want to access a data structure that was just put
on a free list]
 1.3 13-Jan-1996  chuck sync with sparc:
- move disk_attach() to before reading the disk label as per Jason.
otherwise we are reading into an unallocated buffer (oops!)
 1.2 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.1 30-Oct-1995  gwr branches: 1.1.2;
New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.2 30-Oct-1995  gwr New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.1 30-Oct-1995  gwr file xd.c was added on branch netbsd-1-1 on 1995-10-30 20:58:18 +0000
 1.11.6.1 12-Mar-1997  is Merge in changes from The Trunk
 1.18.2.1 26-Jan-1998  gwr Merge recent changes on the head onto the gwr-3x3 branch.
 1.24.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.29.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.32.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.32.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.32.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.32.4.1 03-Aug-2001  lukem update to -current
 1.34.14.2 31-Aug-2002  gehenna catch up with -current.
 1.34.14.1 17-May-2002  gehenna Add device switch.
 1.34.6.6 03-Jan-2003  thorpej Sync with HEAD.
 1.34.6.5 11-Nov-2002  nathanw Catch up to -current
 1.34.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.34.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.34.6.2 01-Aug-2002  nathanw Catch up to -current.
 1.34.6.1 05-Sep-2001  nathanw file xd.c was added on branch nathanw_sa on 2002-08-01 02:43:54 +0000
 1.34.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.44.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.44.2.6 04-Feb-2005  skrll Adapt to branch.
 1.44.2.5 24-Jan-2005  skrll Sync with HEAD.
 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.47.4.1 29-Apr-2005  kent sync with -current
 1.49.2.7 11-Feb-2008  yamt sync with head.
 1.49.2.6 21-Jan-2008  yamt sync with head
 1.49.2.5 27-Oct-2007  yamt sync with head.
 1.49.2.4 03-Sep-2007  yamt sync with head.
 1.49.2.3 26-Feb-2007  yamt sync with head.
 1.49.2.2 30-Dec-2006  yamt sync with head.
 1.49.2.1 21-Jun-2006  yamt sync with head.
 1.51.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.51.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.51.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.51.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.51.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.51.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.51.8.3 11-Aug-2006  yamt sync with head
 1.51.8.2 24-May-2006  yamt sync with head.
 1.51.8.1 01-Apr-2006  yamt sync with head.
 1.51.6.2 01-Jun-2006  kardel Sync with head.
 1.51.6.1 22-Apr-2006  simonb Sync with head.
 1.51.4.1 09-Sep-2006  rpaulo sync with head
 1.54.4.1 12-Jan-2007  ad Sync with head.
 1.55.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.56.10.2 16-Oct-2007  garbled Sync with HEAD
 1.56.10.1 03-Oct-2007  garbled Sync with HEAD
 1.56.4.1 11-Jul-2007  mjf Sync with head.
 1.56.2.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.56.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.56.2.1 01-Jul-2007  ad Adapt to callout API change.
 1.57.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.57.2.1 07-Aug-2007  matt Sync with HEAD.
 1.58.8.1 14-Oct-2007  yamt sync with head.
 1.58.6.3 23-Mar-2008  matt sync with HEAD
 1.58.6.2 09-Jan-2008  matt sync with HEAD
 1.58.6.1 06-Nov-2007  matt sync with HEAD
 1.58.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.60.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.60.4.1 31-Dec-2007  ad Catch up with buffer cache changes.
 1.60.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.63.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.63.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.63.10.1 04-May-2009  yamt sync with head.
 1.63.8.1 17-Jun-2008  yamt sync with head.
 1.63.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.63.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.64.2.1 03-Jul-2008  simonb Sync with head.
 1.65.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.67.10.1 08-Feb-2011  bouyer Sync with HEAD
 1.67.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.67.6.1 05-Mar-2011  rmind sync with head
 1.68.18.1 18-May-2014  rmind sync with head
 1.68.14.2 03-Dec-2017  jdolecek update from HEAD
 1.68.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.68.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.69.2.1 10-Aug-2014  tls Rebase.
 1.71.4.2 06-Jun-2015  skrll Sync with HEAD
 1.71.4.1 06-Apr-2015  skrll Sync with HEAD
 1.73.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.74.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.75.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.76.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.78.6.1 02-Aug-2025  perseant Sync with HEAD
 1.9 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.8 24-Oct-2021  andvar branches: 1.8.10;
fix various typos in comments, mainly copypasta.
 1.7 01-Feb-2011  chuck udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.6 11-Dec-2005  christos branches: 1.6.100; 1.6.106; 1.6.108;
merge ktrace-lwp.
 1.5 19-Apr-2004  wiz Spell removable with only two es. Inspired by jmc@openbsd.
 1.4 03-May-2003  wiz branches: 1.4.2;
DMA, not dma nor Dma.
 1.3 06-Jan-2003  wiz interrupt with two rs.
 1.2 22-Feb-1996  thorpej branches: 1.2.50;
Fixup some RCS ids.
 1.1 30-Oct-1995  gwr branches: 1.1.2;
New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.2 30-Oct-1995  gwr New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.1 30-Oct-1995  gwr file xdreg.h was added on branch netbsd-1-1 on 1995-10-30 20:58:19 +0000
 1.2.50.1 07-Jan-2003  thorpej Sync with HEAD.
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.6.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.100.1 05-Mar-2011  rmind sync with head
 1.8.10.1 02-Aug-2025  perseant Sync with HEAD
 1.12 01-Feb-2011  chuck udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.11 28-Jun-2008  tsutsui branches: 1.11.18; 1.11.24; 1.11.26;
Split softc/device_t, with misc cosmetic changes.
 1.10 11-Dec-2005  christos branches: 1.10.74; 1.10.78; 1.10.80; 1.10.82;
merge ktrace-lwp.
 1.9 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.8 23-Jul-2002  hannken branches: 1.8.6; 1.8.22;
Convert to new device buffer queue interface.

Approved by: Nathan J. Williams <nathanw@netbsd.org>
 1.7 23-Mar-2000  thorpej branches: 1.7.8; 1.7.12; 1.7.20;
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.6 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.5 26-Jan-1998  gwr branches: 1.5.14;
Save the "bustype" from our attach args in the controller "softc"
and use that instead of hard-coding BUS_VME32 everywhere.
(The Sun3X needs a more specific bustype value.)
 1.4 17-Oct-1997  gwr branches: 1.4.4;
Move initialization code from xxattach to xx_init and call that
from both xxattach and xxopen instead of calling xxattach from
xxopen with faked up autoconfig args. Fix warnings.
 1.3 22-Feb-1996  thorpej Fixup some RCS ids.
 1.2 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.1 30-Oct-1995  gwr branches: 1.1.2;
New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.2 30-Oct-1995  gwr New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.1 30-Oct-1995  gwr file xdvar.h was added on branch netbsd-1-1 on 1995-10-30 20:58:20 +0000
 1.4.4.1 26-Jan-1998  gwr Merge recent changes on the head onto the gwr-3x3 branch.
 1.5.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.20.1 31-Aug-2002  gehenna catch up with -current.
 1.7.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.7.8.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.8.22.1 21-Jun-2006  yamt sync with head.
 1.8.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.82.1 03-Jul-2008  simonb Sync with head.
 1.10.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.10.78.1 04-May-2009  yamt sync with head.
 1.10.74.1 29-Jun-2008  mjf Sync with HEAD.
 1.11.26.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.24.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.18.1 05-Mar-2011  rmind sync with head
 1.5 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.4 07-Sep-2015  dholland branches: 1.4.54;
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.3 01-Feb-2011  chuck branches: 1.3.14; 1.3.32;
udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.2 04-Mar-2007  christos branches: 1.2.66; 1.2.72; 1.2.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.1 30-Oct-1995  gwr branches: 1.1.2; 1.1.84; 1.1.122;
New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.122.1 12-Mar-2007  rmind Sync with HEAD.
 1.1.84.1 03-Sep-2007  yamt sync with head.
 1.1.2.2 30-Oct-1995  gwr New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.1 30-Oct-1995  gwr file xio.h was added on branch netbsd-1-1 on 1995-10-30 20:58:21 +0000
 1.2.74.1 08-Feb-2011  bouyer Sync with HEAD
 1.2.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.66.1 05-Mar-2011  rmind sync with head
 1.3.32.1 22-Sep-2015  skrll Sync with HEAD
 1.3.14.1 03-Dec-2017  jdolecek update from HEAD
 1.4.54.1 02-Aug-2025  perseant Sync with HEAD
 1.84 21-Dec-2024  tsutsui Make local dev_type_*() functions static.
 1.83 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.82 07-Aug-2021  thorpej branches: 1.82.12;
Merge thorpej-cfargs2.
 1.81 24-Apr-2021  thorpej branches: 1.81.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.80 21-Nov-2020  thorpej branches: 1.80.2;
malloc(9) -> kmem(9)
 1.79 10-Nov-2019  chs branches: 1.79.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.78 26-Apr-2015  mlelstv branches: 1.78.18;
Use C99-style initializers for struct dkdriver.
 1.77 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.76 25-Jul-2014  dholland branches: 1.76.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.75 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.74 16-Mar-2014  dholland branches: 1.74.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.73 07-Nov-2013  christos fix unused warnings
 1.72 01-Feb-2011  chuck branches: 1.72.4; 1.72.14; 1.72.18;
udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.71 13-Jan-2009  yamt branches: 1.71.6; 1.71.8; 1.71.10;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.70 12-Jan-2009  cegger cast to char to printf DISKPART
XXX Shouldn't sun3 use the MI drivers instead?
 1.69 28-Jun-2008  tsutsui branches: 1.69.4;
Split softc/device_t, with misc cosmetic changes.
 1.68 08-Jun-2008  tsutsui branches: 1.68.2;
Use device_private() and device_lookup_private() to get softc
and to see if device unit is vaild.
 1.67 06-Feb-2008  elad branches: 1.67.6; 1.67.8; 1.67.10; 1.67.12;
It's KAUTH_REQ_DEVICE_RAWIO_PASSTHRU_*.

Noted by dogcow@, thanks!
 1.66 06-Feb-2008  elad - There is no XYCMD_WRP -- forgot to remove it along with the XYCMD_RDP :)
- Add missing '}'

Noted by dogcow@, thanks!
 1.65 04-Feb-2008  elad Properly classify kauth PASSTHRU requests.

Done with much help from chuck@, thanks!
 1.64 02-Jan-2008  ad Merge vmlocking2 to head.
 1.63 17-Oct-2007  garbled branches: 1.63.2; 1.63.4; 1.63.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.62 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.61 29-Jul-2007  ad branches: 1.61.4; 1.61.6; 1.61.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.60 09-Jul-2007  ad branches: 1.60.2; 1.60.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.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 04-Jan-2007  elad branches: 1.58.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.57 23-Jul-2006  ad branches: 1.57.4;
Use the LWP cached credentials where sane.
 1.56 14-May-2006  elad integrate kauth.
 1.55 29-Mar-2006  tsutsui Use device_unit(parent), not device_parent(parent).
 1.54 28-Mar-2006  thorpej Use device_unit().
 1.53 11-Dec-2005  christos branches: 1.53.4; 1.53.6; 1.53.8; 1.53.10; 1.53.12;
merge ktrace-lwp.
 1.52 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.51 03-Jun-2005  tsutsui branches: 1.51.2;
Constify.
 1.50 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.49 28-Oct-2004  yamt branches: 1.49.4;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.48 29-Sep-2003  wiz available, not avaliable. From miod@openbsd.
 1.47 15-Jul-2003  lukem __KERNEL_RCSID()
 1.46 10-May-2003  thorpej branches: 1.46.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.45 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.44 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.43 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.42 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.41 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.40 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.39 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.38 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 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 23-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Nathan J. Williams <nathanw@netbsd.org>
 1.35 05-Sep-2001  tsutsui branches: 1.35.2; 1.35.6; 1.35.14;
bcopy() -> memcpy(), bzero() -> memset()
 1.34 22-Jul-2001  wiz seperate -> separate
 1.33 29-Jun-2000  mrg branches: 1.33.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.32 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.31 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.30 27-May-2000  thorpej branches: 1.30.2;
sleep() -> tsleep()
 1.29 19-May-2000  thorpej A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.28 16-May-2000  thorpej Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
 1.27 01-Apr-2000  tsutsui Typo. (callout_rest -> callout_reset)
 1.26 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.25 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.24 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.23 17-Sep-1999  thorpej branches: 1.23.2;
Centralize the declaration and clearing of `cold'.
 1.22 23-Jul-1998  gwr Print a complaint when no children were specified
in the config file. Better than a link error...
 1.21 30-Jun-1998  mrg <dev/sun/disklabel.h> not <dev/sun/sun_disklabel.h>
 1.20 24-Jun-1998  jeremy Changed to include sun_disklabel.h from its new location in dev/sun.
 1.19 26-Jan-1998  gwr Save the "bustype" from our attach args in the controller "softc"
and use that instead of hard-coding BUS_VME32 everywhere.
(The Sun3X needs a more specific bustype value.)
 1.18 12-Jan-1998  thorpej branches: 1.18.2;
Update for changes to config.
 1.17 17-Oct-1997  gwr Move initialization code from xxattach to xx_init and call that
from both xxattach and xxopen instead of calling xxattach from
xxopen with faked up autoconfig args. Fix warnings.
 1.16 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.15 24-Jun-1997  thorpej foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
 1.14 18-Jun-1997  pk xysize(): only call xyopen()/xyclose() if not already open, per the
current `openmask'.
 1.13 28-Feb-1997  gwr Add xxc_print functions to pass to config_found() instead of NULL.
(Thanks to Chris Demetriou suggesting the improvement.)
 1.12 17-Dec-1996  gwr branches: 1.12.6;
Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.11 13-Oct-1996  christos backout previous kprintf change
 1.10 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 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 08-Mar-1996  mycroft Don't call dvma_kvtopa() with a null pointer.
 1.7 04-Mar-1996  chuck Fix two bugs reported by Don Koch <aardvark@poirot.krl.com> (PR#2168).
(the xd bugs also apply to the xy driver...)
[1] check return value from malloc() for NULL before trying to bzero it.
[2] use "=" rather than "|=" when writing to CSR (otherwise you may
ACK something you don't mean to!).
 1.6 28-Feb-1996  thorpej Fixup an RCS id.
 1.5 21-Feb-1996  chuck sync with sparc version:
minor clean up: revise locations of disk_busy/disk_unbusy calls to match xd.c
 1.4 16-Feb-1996  gwr Sync. with sparc version, and fix some cosmetic nits...
 1.3 13-Jan-1996  chuck sync with sparc:
- move disk_attach() to before reading the disk label as per Jason.
otherwise we are reading into an unallocated buffer (oops!)
 1.2 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.1 30-Oct-1995  gwr branches: 1.1.2;
New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.2 30-Oct-1995  gwr New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.1 30-Oct-1995  gwr file xy.c was added on branch netbsd-1-1 on 1995-10-30 20:58:22 +0000
 1.12.6.1 12-Mar-1997  is Merge in changes from The Trunk
 1.18.2.1 26-Jan-1998  gwr Merge recent changes on the head onto the gwr-3x3 branch.
 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.
 1.30.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.33.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.33.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.33.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.33.4.1 03-Aug-2001  lukem update to -current
 1.35.14.2 31-Aug-2002  gehenna catch up with -current.
 1.35.14.1 17-May-2002  gehenna Add device switch.
 1.35.6.6 03-Jan-2003  thorpej Sync with HEAD.
 1.35.6.5 11-Nov-2002  nathanw Catch up to -current
 1.35.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.35.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.35.6.2 01-Aug-2002  nathanw Catch up to -current.
 1.35.6.1 05-Sep-2001  nathanw file xy.c was added on branch nathanw_sa on 2002-08-01 02:43:55 +0000
 1.35.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.46.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.46.2.6 04-Feb-2005  skrll Adapt to branch.
 1.46.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.46.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.46.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.46.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.46.2.1 03-Aug-2004  skrll Sync with HEAD
 1.49.4.1 29-Apr-2005  kent sync with -current
 1.51.2.7 11-Feb-2008  yamt sync with head.
 1.51.2.6 21-Jan-2008  yamt sync with head
 1.51.2.5 27-Oct-2007  yamt sync with head.
 1.51.2.4 03-Sep-2007  yamt sync with head.
 1.51.2.3 26-Feb-2007  yamt sync with head.
 1.51.2.2 30-Dec-2006  yamt sync with head.
 1.51.2.1 21-Jun-2006  yamt sync with head.
 1.53.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.53.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.53.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.53.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.53.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.53.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.53.8.3 11-Aug-2006  yamt sync with head
 1.53.8.2 24-May-2006  yamt sync with head.
 1.53.8.1 01-Apr-2006  yamt sync with head.
 1.53.6.2 01-Jun-2006  kardel 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.57.4.1 12-Jan-2007  ad Sync with head.
 1.58.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.59.10.2 16-Oct-2007  garbled 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.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.59.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.59.2.1 01-Jul-2007  ad Adapt to callout API change.
 1.60.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.60.2.1 07-Aug-2007  matt Sync with HEAD.
 1.61.8.1 14-Oct-2007  yamt sync with head.
 1.61.6.3 23-Mar-2008  matt sync with HEAD
 1.61.6.2 09-Jan-2008  matt sync with HEAD
 1.61.6.1 06-Nov-2007  matt sync with HEAD
 1.61.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.63.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.63.4.1 31-Dec-2007  ad Catch up with buffer cache changes.
 1.63.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.67.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.67.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.67.10.1 04-May-2009  yamt sync with head.
 1.67.8.1 17-Jun-2008  yamt sync with head.
 1.67.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.67.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.68.2.1 03-Jul-2008  simonb Sync with head.
 1.69.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.71.10.1 08-Feb-2011  bouyer Sync with HEAD
 1.71.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.71.6.1 05-Mar-2011  rmind sync with head
 1.72.18.1 18-May-2014  rmind sync with head
 1.72.14.2 03-Dec-2017  jdolecek update from HEAD
 1.72.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.72.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.74.2.1 10-Aug-2014  tls Rebase.
 1.76.4.2 06-Jun-2015  skrll Sync with HEAD
 1.76.4.1 06-Apr-2015  skrll Sync with HEAD
 1.78.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.79.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.80.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.81.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.82.12.1 02-Aug-2025  perseant Sync with HEAD
 1.6 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.5 01-Feb-2011  chuck branches: 1.5.92;
udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106; 1.4.108;
merge ktrace-lwp.
 1.3 19-Apr-2004  wiz Spell removable with only two es. Inspired by jmc@openbsd.
 1.2 03-May-2003  wiz branches: 1.2.2;
DMA, not dma nor Dma.
 1.1 30-Oct-1995  gwr branches: 1.1.2;
New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.2 30-Oct-1995  gwr New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.1 30-Oct-1995  gwr file xyreg.h was added on branch netbsd-1-1 on 1995-10-30 20:58:23 +0000
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.108.1 08-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.92.1 02-Aug-2025  perseant Sync with HEAD
 1.11 01-Feb-2011  chuck udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.10 28-Jun-2008  tsutsui branches: 1.10.18; 1.10.24; 1.10.26;
Split softc/device_t, with misc cosmetic changes.
 1.9 11-Dec-2005  christos branches: 1.9.74; 1.9.78; 1.9.80; 1.9.82;
merge ktrace-lwp.
 1.8 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.7 23-Jul-2002  hannken branches: 1.7.6; 1.7.22;
Convert to new device buffer queue interface.

Approved by: Nathan J. Williams <nathanw@netbsd.org>
 1.6 23-Mar-2000  thorpej branches: 1.6.8; 1.6.12; 1.6.20;
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.5 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.4 26-Jan-1998  gwr branches: 1.4.14;
Save the "bustype" from our attach args in the controller "softc"
and use that instead of hard-coding BUS_VME32 everywhere.
(The Sun3X needs a more specific bustype value.)
 1.3 17-Oct-1997  gwr branches: 1.3.4;
Move initialization code from xxattach to xx_init and call that
from both xxattach and xxopen instead of calling xxattach from
xxopen with faked up autoconfig args. Fix warnings.
 1.2 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.1 30-Oct-1995  gwr branches: 1.1.2;
New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.2 30-Oct-1995  gwr New from Chuck Cranor: drivers for SMD disks!
xd: Xylogics 753/7053 SMD disk controller
xy: Xylogics 450/451 SMD disk controller
These now compile, but have not been tested.
 1.1.2.1 30-Oct-1995  gwr file xyvar.h was added on branch netbsd-1-1 on 1995-10-30 20:58:24 +0000
 1.3.4.1 26-Jan-1998  gwr Merge recent changes on the head onto the gwr-3x3 branch.
 1.4.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.20.1 31-Aug-2002  gehenna catch up with -current.
 1.6.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.6.8.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.7.22.1 21-Jun-2006  yamt sync with head.
 1.7.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.82.1 03-Jul-2008  simonb Sync with head.
 1.9.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.9.78.1 04-May-2009  yamt sync with head.
 1.9.74.1 29-Jun-2008  mjf Sync with HEAD.
 1.10.26.1 08-Feb-2011  bouyer Sync with HEAD
 1.10.24.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.18.1 05-Mar-2011  rmind sync with head
 1.92 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.91 11-Sep-2021  andvar branches: 1.91.10;
Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
 1.90 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.89 24-Apr-2021  thorpej branches: 1.89.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.88 10-Aug-2012  tsutsui branches: 1.88.54;
Appease gcc -fno-common:
- initialize cn_tab in locore2.c:_bootstrap() for early printf calls
Tested on sun3 (3/160 on TME) and sun3x (real 3/80).

XXX: sun3 with >16MB RAM gets "panic: ubc_init: failed to map ubc_object"
 1.87 29-Jul-2012  matt A little constification
 1.86 26-Oct-2011  mrg branches: 1.86.2;
catch up with other zs ports, original commit was:

>add two new functions for z8530tty: zs_chan_lock() and zs_chan_unlock(),
>and use them instead of various spl's in the zs.c's.
>
>reviewed by ad and martin.
 1.85 26-Jun-2010  tsutsui Pull a similar fix from sparc/dev/zs.c rev 1.119:
Establish interrupt handlers with proper softc per each zs device
rather than sharing them among all zs devices and searching softc
in handlers, to avoid possible recursive lock.
 1.84 13-Jun-2008  cegger branches: 1.84.16; 1.84.18;
use device_lookup_private to get softc
 1.83 28-Apr-2008  martin branches: 1.83.2; 1.83.4;
Remove clause 3 and 4 from TNF licenses
 1.82 29-Mar-2008  tsutsui branches: 1.82.2; 1.82.4;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.81 04-Dec-2007  tsutsui branches: 1.81.12;
Adapt sun68k ports to recent interrupt handling changes.

XXX: sun2 (m68010) doesn't have CAS instructions.
 1.80 09-Nov-2007  ad branches: 1.80.2;
Call zs_lock_init() to set up the chanstate's lock.
 1.79 11-Mar-2007  tsutsui branches: 1.79.16; 1.79.18; 1.79.22; 1.79.24;
Call zsc_intr_soft() directly on softintr() since spltty()
will be set by each handler (zstty_softint() or kbd_zs_softint()).
 1.78 05-Oct-2006  tsutsui branches: 1.78.4; 1.78.8;
Make sun3 use common sun68k/sun68k/isr.c, sun68k/include/cpu.h and
sun68k/include/intr.h.

This also means now sun3 has GENERIC_SOFT_INTERRUPTS support,
so also adapt fd.c and zs.c to MI softintr(9) APIs.

(I'll also update related sources in yamt-splraiseipl branch later)
 1.77 03-Oct-2006  tsutsui - change find_prom_map() to take paddr_t and return vaddr_t rather than
bus_space_handle_t since bus space handle without bus space tag looks weird
- replace old sun3 obio_find_mapping() with new common find_prom_map()
- add bus_space_vaddr(), from hp300
 1.76 28-Mar-2006  thorpej branches: 1.76.8; 1.76.10;
Use device_unit().
 1.75 11-Dec-2005  christos branches: 1.75.4; 1.75.6; 1.75.8; 1.75.10; 1.75.12;
merge ktrace-lwp.
 1.74 03-Jun-2005  tsutsui branches: 1.74.2;
Constify.
 1.73 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.72 15-Jul-2003  lukem branches: 1.72.8;
__KERNEL_RCSID()
 1.71 28-Jan-2003  pk branches: 1.71.2;
Provide locking required by the interrupt handlers running at IPL_SERIAL.
 1.70 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.69 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.68 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.67 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.66 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.65 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.64 05-Sep-2001  tsutsui branches: 1.64.6; 1.64.14;
bcopy() -> memcpy(), bzero() -> memset()
 1.63 05-Sep-2001  tsutsui Remove register prefixes.
 1.62 30-May-2001  lukem branches: 1.62.2;
add missing #include "opt_kgdb.h"
 1.61 28-May-2001  chs don't abuse cf_unit.
 1.60 06-Mar-2000  thorpej branches: 1.60.6;
- Implement cnbell() -- ring the console bell. The cn_bell entrypoint
is optional.
- Add cn_bell to statically allocated consdevs as appropriate.
 1.59 22-Nov-1999  jdolecek Debugger()/cpu_Debugger() is always available and always defined/prototyped
in <sys/systm.h> for sun3/sun3x, even in non-DDB case
 1.58 17-Oct-1999  jdolecek branches: 1.58.2;
include opt_ddb.h, so that symbol DDB actually get's defined appropriately
kill local definition of Debugger() - <sys/systm.h> DTRT
don't assume Debugger() is always available and put the call inside #ifdef DDB

Second part of a fix to PR #8637 by Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>.
 1.57 27-Mar-1999  wrstuden branches: 1.57.8;
Add pps support. Only enable pps if CLOCAL & !MDMBUF.
 1.56 11-Feb-1999  mycroft Minor cleanup.
Make the initializer for BAUDLO depend on PCLK directly; it was incorrect on
some ports where PCLK is not 4.9152MHz.
XXX Is the default value actually used?
 1.55 03-Feb-1999  mycroft Don't set DCD_IE in the frontends. KGDB doesn't even use DCD, and the tty
frontends get it from zsparam() anyway.
 1.54 08-Jun-1998  gwr Kill the printf: enabling zs interrupts
 1.53 05-Feb-1998  gwr Merge arch/sun3x into arch/sun3
 1.52 12-Jan-1998  thorpej branches: 1.52.2;
Update for changes to config.
 1.51 02-Nov-1997  mycroft Set rr0_dcd.
Don't set DCD_IE and CTS_IE here; let the MI code do it.
Handle MDMBUF.
 1.50 06-Oct-1997  gwr branches: 1.50.2;
Tweak the console support a little (more like the sparc version).
 1.49 05-Oct-1997  gwr normalize include order
 1.48 11-Mar-1997  gwr branches: 1.48.4;
Call isr_soft_request() at most once per zshard interrupt.
In the softintr, raise to spltty before calling tty code.
 1.47 10-Feb-1997  gwr Export zs_get_chan_addr() for zs_kgdb.c
Print the "console on ..." in cninit(), and
avoid reference to kbd/kd drivers if NKBD==0
 1.46 31-Jan-1997  gwr branches: 1.46.2;
Forgot to initialize cs->cs_rr0_dcd and fiends in attach.
 1.45 18-Jan-1997  gwr Now that interrupts are enabled AFTER autoconfiguration, put in the
cute little trick where the zs interrupts are enabled as soon as the
zs driver has done its attachments. That allows a console break to
enter the debugger during the rest of autoconfiguration.
 1.44 18-Jan-1997  gwr Use the same names (OBIO_ZS_*) as the sun3x port...
 1.43 17-Dec-1996  gwr Adapt to the new definition of struct zsc_softc
(the zsc_cs[2] members are now POINTERS!)
Also fix warnings...
 1.42 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.41 13-Oct-1996  christos backout previous kprintf change
 1.40 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.39 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.38 17-Jun-1996  gwr branches: 1.38.2;
Use the PROM->input_source setting instead of EEPROM to determine
where the console is, because that is correct if, for example, you
boot with the diag/norm switch set for diagnostics and the EEPROM
is set for keyboard/display.
 1.37 17-May-1996  gwr Rename cs_pclk_div16 to cs_brg_clk to clarify the fact that the
Baud Rate Generator (BRG) clock is not necessarily PCLK/16.
 1.36 04-Apr-1996  cgd update for the fact that config_found() and config_rootfound() now
return pointers. (Check vs. NULL, rather than just boolean tests.)
 1.35 26-Mar-1996  gwr New autoconfig design that controls attach order.
 1.34 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.33 16-Feb-1996  gwr No longer need delay2us(), just use delay(2)
 1.32 30-Jan-1996  gwr Eliminate remaining direct references to the z8530 chip
to allow the MD access functions to do delays, etc.
 1.31 24-Jan-1996  gwr Update for the new z8530 driver
 1.30 08-Oct-1995  gwr Minor cleanup.
 1.29 08-Aug-1995  gwr Use old-style function definitions (like the sparc driver).
 1.28 03-Jul-1995  gwr Correct !DDB console abort (thanks to David Brownlee)
 1.27 28-Jun-1995  cgd note that most of dev/ic's contents have changed names
 1.26 27-Jun-1995  gwr Leave modem control lines in correct state on interrupted open.
(From sparc/dev/zs.c)
 1.25 13-Jun-1995  gwr Fix several missing (and REQUIRED) calls to ZS_DELAY()
 1.24 26-Apr-1995  gwr Add xxtty()
 1.23 11-Apr-1995  mycroft Use global 8530 defs.
 1.22 27-Mar-1995  gwr Increase ZSSOFT_PRI from 2 -> 3 now that tty ipl is 4.
 1.21 10-Mar-1995  gwr Synthesize KBD_L1|KBD_UP after return from zsabort.
Simplify PROM mapping stuff, use ee_console.
 1.20 14-Feb-1995  gwr Oops, forgot to lock out interrupts while clearing zssoftpending.
 1.19 11-Jan-1995  gwr Cleanup
 1.18 21-Dec-1994  gwr Fixes for the 110, 160, 260 (leave chip in "vector" mode).
 1.17 17-Dec-1994  gwr Fix kd (keyboard/display) driver kdcngetc/kdcnputc functions.
 1.16 15-Dec-1994  gwr Set params in attach so BREAK works before first real open.
 1.15 13-Dec-1994  gwr Support TIOCGFLAGS, TIOCSFLAGS (from Matthew Green via Theo).
 1.14 13-Dec-1994  gwr Have working bus_peek(), and drivers use it.
 1.13 12-Dec-1994  gwr New autoconfig interface to support VME, etc.
 1.12 01-Dec-1994  gwr Export some headers that X will want, and minor clean-up.
 1.11 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.10 26-Oct-1994  cgd new RCS ID format.
 1.9 20-Sep-1994  gwr branches: 1.9.2;
Call obio_alloc with just two args (mappings always writable).
 1.8 28-Jun-1994  gwr Make initial tty mode the same as the PROM uses
(so you can read the console messages).
 1.7 30-May-1994  glass have typecast, will compile
 1.6 20-May-1994  gwr Add TIOCSBRK/TIOCCBRK support.
 1.5 06-May-1994  gwr Tracking 4.4 integration
 1.4 05-May-1994  gwr put in some cnputc fixes missed last night
 1.3 04-May-1994  gwr Get initial mappings for console routines.
Use the kd device instead of tty rewiring mess
 1.2 15-Mar-1994  glass zs supposedly works
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.9.2.2 20-Sep-1994  gwr Call obio_alloc with just two args (mappings always writable).
 1.9.2.1 20-Sep-1994  gwr file zs.c was added on branch netbsd-1-0 on 1994-09-20 16:21:49 +0000
 1.38.2.2 17-Jun-1996  gwr Use the PROM->input_source setting instead of EEPROM to determine
where the console is, because that is correct if, for example, you
boot with the diag/norm switch set for diagnostics and the EEPROM
is set for keyboard/display.
 1.38.2.1 17-Jun-1996  gwr file zs.c was added on branch netbsd-1-2 on 1996-06-17 15:17:07 +0000
 1.46.2.2 13-Mar-1997  gwr Merge changes from the trunk
 1.46.2.1 12-Mar-1997  is Merge in changes from The Trunk
 1.48.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.50.2.1 04-Nov-1997  mellon Pull rev 1.51 up from trunk (mycroft)
 1.52.2.1 27-Jan-1998  gwr Merged Sun3 and Sun3X kernel sources.
 1.57.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.58.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.60.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.62.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.62.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.64.14.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.64.6.4 03-Jan-2003  thorpej Sync with HEAD.
 1.64.6.3 18-Oct-2002  nathanw Catch up to -current.
 1.64.6.2 17-Sep-2002  nathanw Catch up to -current.
 1.64.6.1 05-Sep-2001  nathanw file zs.c was added on branch nathanw_sa on 2002-09-17 21:18:18 +0000
 1.71.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.71.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.71.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.71.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.71.2.1 03-Aug-2004  skrll Sync with HEAD
 1.72.8.1 29-Apr-2005  kent sync with -current
 1.74.2.5 07-Dec-2007  yamt sync with head
 1.74.2.4 15-Nov-2007  yamt sync with head.
 1.74.2.3 03-Sep-2007  yamt sync with head.
 1.74.2.2 30-Dec-2006  yamt sync with head.
 1.74.2.1 21-Jun-2006  yamt sync with head.
 1.75.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.75.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.75.8.1 01-Apr-2006  yamt sync with head.
 1.75.6.1 22-Apr-2006  simonb Sync with head.
 1.75.4.1 09-Sep-2006  rpaulo sync with head
 1.76.10.1 06-Oct-2006  tsutsui Sync files of recent sun3 and sun68k merge and intersil7170(4) changes
with HEAD to build sun3 kernel on this branch.
 1.76.8.1 18-Nov-2006  ad Sync with head.
 1.78.8.2 03-Dec-2007  ad Sync with HEAD.
 1.78.8.1 13-Mar-2007  ad Sync with head.
 1.78.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.79.24.2 08-Dec-2007  mjf Sync with HEAD.
 1.79.24.1 19-Nov-2007  mjf Sync with HEAD.
 1.79.22.1 13-Nov-2007  bouyer Sync with HEAD
 1.79.18.1 09-Jan-2008  matt sync with HEAD
 1.79.16.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.79.16.1 11-Nov-2007  joerg Sync with HEAD.
 1.80.2.1 08-Dec-2007  ad Sync with head.
 1.81.12.3 29-Jun-2008  mjf Sync with HEAD.
 1.81.12.2 02-Jun-2008  mjf Sync with HEAD.
 1.81.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.82.4.3 11-Aug-2010  yamt sync with head.
 1.82.4.2 04-May-2009  yamt sync with head.
 1.82.4.1 16-May-2008  yamt sync with head.
 1.82.2.2 17-Jun-2008  yamt sync with head.
 1.82.2.1 18-May-2008  yamt sync with head.
 1.83.4.1 18-Jun-2008  simonb Sync with head.
 1.83.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.84.18.1 03-Jul-2010  rmind sync with head
 1.84.16.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.86.2.1 30-Oct-2012  yamt sync with head
 1.88.54.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.89.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.91.10.1 02-Aug-2025  perseant Sync with HEAD
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 22-Jan-2005  chs de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.3 05-Jan-1998  perry branches: 1.3.50; 1.3.58;
RCSID Police.
 1.2 10-Feb-1997  gwr Add zs_get_chan_addr(), zs_kgdb_init()
 1.1 17-Dec-1996  gwr branches: 1.1.4;
Make this compile with -Werror -Wall -Wstrict-prototypes
(finally! yea!) Also get rid of __BROKEN_INDIRECT_CONFIG
 1.1.4.1 12-Mar-1997  is Merge in changes from The Trunk
 1.3.58.1 29-Apr-2005  kent sync with -current
 1.3.50.1 24-Jan-2005  skrll Sync with HEAD.
 1.28 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.27 24-Oct-2023  andvar branches: 1.27.6;
apply similar changes between different archs/machines for zs_kgdb.c:
1) adjust zs_kgdb_init tty attachment message for kgdb_dev type change.
(one arch uses cast to int instead, but kept one approach for consistency)
2) remove unused rr0 declaration and assignment in zs_kgdb_txint()
3) adjust kgdb_dev format specifier to %llx/d if needed.
4) add const for zs_kgdb_devname declaration (macppc only).
should fix zs_kgdb.c build for all these ports.
 1.26 13-Oct-2012  tsutsui branches: 1.26.18; 1.26.28;
Add a cast to print dev_t. (broken since 64bit dev_t change?) from chs@
XXX: probably no one will use this...
 1.25 28-Apr-2008  martin branches: 1.25.34; 1.25.44;
Remove clause 3 and 4 from TNF licenses
 1.24 17-Oct-2007  garbled branches: 1.24.16; 1.24.18; 1.24.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.23 23-Jun-2007  hauke branches: 1.23.10;
Fix a warning from gcc 4 about stripping the volatile qualifier by a cast
by doing the proper __UNVOLATILE() dance.
 1.22 04-Mar-2007  christos branches: 1.22.2; 1.22.4; 1.22.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.21 01-Sep-2006  matt branches: 1.21.8;
Remove an unneeded volatile.
 1.20 11-Dec-2005  christos branches: 1.20.4; 1.20.8;
merge ktrace-lwp.
 1.19 22-Jan-2005  chs branches: 1.19.8;
de-__P, remove register, ansify, b* -> mem*, u_int*_t -> uint*_t.
 1.18 15-Jul-2003  lukem branches: 1.18.8;
__KERNEL_RCSID()
 1.17 30-Mar-2003  kristerw branches: 1.17.2;
#include "opt_kgdb.h"
 1.16 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.15 05-Sep-2001  tsutsui branches: 1.15.6; 1.15.14;
bcopy() -> memcpy(), bzero() -> memset()
 1.14 05-Sep-2001  tsutsui Remove register prefixes.
 1.13 03-Feb-1999  mycroft branches: 1.13.22;
Don't set DCD_IE in the frontends. KGDB doesn't even use DCD, and the tty
frontends get it from zsparam() anyway.
 1.12 05-Oct-1997  gwr read regs in the right order
 1.11 12-Feb-1997  gwr branches: 1.11.6;
Actually works now!
 1.10 27-Jan-1997  gwr branches: 1.10.2;
Fix copyrights (/s/REGENTS/FOUNDATION/)
 1.9 20-Nov-1996  gwr Most files that were copyright Adam Glass and/or Gordon W. Ross
are now copyright The NetBSD Foundation (rights assigned).
 1.8 13-Oct-1996  christos backout previous kprintf change
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.6 17-Jun-1996  gwr branches: 1.6.2;
KGDB support
 1.5 17-May-1996  gwr Add the version line.
 1.4 17-May-1996  gwr Rename cs_pclk_div16 to cs_brg_clk to clarify the fact that the
Baud Rate Generator (BRG) clock is not necessarily PCLK/16.
 1.3 16-Feb-1996  gwr No longer need delay2us(), just use delay(2)
 1.2 30-Jan-1996  gwr Eliminate remaining direct references to the z8530 chip
to allow the MD access functions to do delays, etc.
 1.1 24-Jan-1996  gwr Update for the new z8530 driver
 1.6.2.2 17-Jun-1996  gwr KGDB support
 1.6.2.1 17-Jun-1996  gwr file zs_kgdb.c was added on branch netbsd-1-2 on 1996-06-17 15:40:37 +0000
 1.10.2.1 12-Mar-1997  is Merge in changes from The Trunk
 1.11.6.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.22.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.13.22.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.15.14.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.15.6.2 17-Sep-2002  nathanw Catch up to -current.
 1.15.6.1 05-Sep-2001  nathanw file zs_kgdb.c was added on branch nathanw_sa on 2002-09-17 21:18:19 +0000
 1.17.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.17.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.18.8.1 29-Apr-2005  kent sync with -current
 1.19.8.2 03-Sep-2007  yamt sync with head.
 1.19.8.1 30-Dec-2006  yamt sync with head.
 1.20.8.1 03-Sep-2006  yamt sync with head.
 1.20.4.1 09-Sep-2006  rpaulo sync with head
 1.21.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.22.10.1 26-Jun-2007  garbled Sync with HEAD.
 1.22.4.1 11-Jul-2007  mjf Sync with head.
 1.22.2.1 15-Jul-2007  ad Sync with head.
 1.23.10.1 06-Nov-2007  matt sync with HEAD
 1.24.20.1 16-May-2008  yamt sync with head.
 1.24.18.1 18-May-2008  yamt sync with head.
 1.24.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.25.44.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.25.34.1 30-Oct-2012  yamt sync with head
 1.26.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.26.18.1 20-Jul-2016  pgoyette Adapt the machine/arch dependent code to the new {b,c}devsw reference
counting.

XXX Most of these will require testing by someone other than myself, as
I have a limited selection of hardware!
 1.27.6.1 02-Aug-2025  perseant Sync with HEAD
 1.5 11-Apr-1995  mycroft Use global 8530 defs.
 1.4 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 15-Mar-1994  glass zs supposedly works
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.8 24-Jan-1996  gwr Update for the new z8530 driver
 1.7 11-Apr-1995  mycroft Use global 8530 defs.
 1.6 21-Nov-1994  gwr Lots of changes. Fairly stable now.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 20-Sep-1994  gwr branches: 1.4.2;
Correct some misinformation about recovery time.
 1.3 04-May-1994  gwr Make ZS_DELAY() use the new delay2us() function.
 1.2 15-Mar-1994  glass zs supposedly works
 1.1 23-Feb-1994  glass boots, presents shell prompt, and doesn't crash immediately
 1.4.2.2 20-Sep-1994  gwr Correct some misinformation about recovery time.
 1.4.2.1 20-Sep-1994  gwr file zsvar.h was added on branch netbsd-1-0 on 1994-09-20 16:23:07 +0000

RSS XML Feed