Home | History | Annotate | only in /src/sys/arch/dreamcast/dev
History log of /src/sys/arch/dreamcast/dev
RevisionDateAuthorComments
 1.42 13-Mar-2016  christos PR/50964: David Binderman: Avoid signed overflow warning
 1.41 26-Apr-2015  mlelstv Use C99-style initializers for struct dkdriver.
 1.40 25-Jul-2014  dholland branches: 1.40.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.39 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.38 18-Mar-2014  martin branches: 1.38.2;
Fix typo
 1.37 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.36 14-Mar-2014  martin Remove an unused variable
 1.35 27-Jul-2012  abs branches: 1.35.2; 1.35.4;
- Adjust the TOC parsing to reject an TOC with invalid (zero) track ids.
Avoids dereferencing off the start of the TOC track array.
- Add #ifdef GDROMDEBUGTOC for dumping out the gdrom TOC values
 1.34 01-Sep-2010  tsutsui branches: 1.34.8; 1.34.14;
- misc KNF and cosmetics
- use DPRINTF() style debug printf macro
 1.33 01-Sep-2010  tsutsui Make local functions static, and comment out an unused function.
 1.32 01-Sep-2010  tsutsui Use appropriate variable data types.
 1.31 01-Sep-2010  tsutsui Replace an empty for() loop (which would be optimized out) with DELAY(1).
No visible performance difference.
 1.30 01-Sep-2010  tsutsui - use bufq(9)
- account busy counter of disk(9)
 1.29 01-Sep-2010  tsutsui Return ENOTTY rather than EINVAL for unhandled ioctl(2)s.
 1.28 31-Aug-2010  tsutsui - split device_t/softc
- include "ioconf.h" for struct cfdriver
 1.27 31-Aug-2010  tsutsui Set bp->b_resid properly after data transfer is complete.
Fixes unexpected "Bad address" errors on file read ops since January 2006.

The problem is reported and tracked by Yasushi Oshima.
 1.26 01-Aug-2008  marcus branches: 1.26.4; 1.26.14; 1.26.16;
sysasic_intr_string() takes an IRL, not an IPL.
 1.25 11-Jun-2008  tsutsui branches: 1.25.2;
Use device_lookup_private() to get softc.
 1.24 17-Oct-2007  garbled branches: 1.24.16; 1.24.18; 1.24.20; 1.24.22; 1.24.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.23 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.22 29-Jul-2007  ad branches: 1.22.4; 1.22.6; 1.22.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.21 12-Mar-2007  tsutsui branches: 1.21.8; 1.21.10; 1.21.12;
IRL line connected to each device on sysasic is not always corresponding
with MI IPL_* definitions, so add an independent arg to pass IRL lines
to sysasic_intr_establish() and use appropriate macro for them.
 1.20 04-Mar-2007  christos branches: 1.20.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 24-Dec-2005  perry branches: 1.19.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.18 11-Dec-2005  christos merge ktrace-lwp.
 1.17 19-Feb-2005  tsutsui branches: 1.17.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.16 15-Jul-2003  lukem branches: 1.16.8; 1.16.10;
__KERNEL_RCSID()
 1.15 15-Nov-2002  itohy branches: 1.15.6;
Allow multiple event handlers to be installed to an IRL.
The IRL is specified as IPL (2nd arg of sysasic_intr_establish()).
Current mapping:
IRL9 IPL_BIO
IRL11 IPL_NET
IRL13 IPL_TTY
 1.14 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.13 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.11 27-Sep-2002  thorpej When in a match routine, the cfdata we're passed always references
our own cfdriver, so don't bother comparing the names, since they
will always match.
 1.10 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.9 27-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Marcus Comstedt <marcus@netbsd.org>
 1.8 25-Mar-2002  uch branches: 1.8.2; 1.8.6;
ANSIfy, KNF
 1.7 24-Mar-2002  uch adapted to new interrupt code and shb changes.
 1.6 04-Dec-2001  atatat Fixes to eliminate some compiler complaints, such as:

suggest explicit braces to avoid ambiguous `else'
suggest parentheses around assignment used as truth value
 1.5 22-Jul-2001  wiz branches: 1.5.2;
bcopy -> memcpy, bzero -> memset
 1.4 24-Apr-2001  marcus branches: 1.4.2;
Abstracted handling of System ASIC controlled IRQ:s a little.
Three different IRQ:s can be selected for each event, 9, 11, or 13
(which selects hardware priority). More events to be added as they
are discovered. Do not use shb_intr_establish() to register IRQ 9, 11
or 13 anymore.
 1.3 20-Feb-2001  marcus branches: 1.3.2;
New, interrupt-driven implementation.
 1.2 25-Jan-2001  marcus branches: 1.2.2;
Changed implementation of partitions, multisession discs now work better.
 1.1 21-Jan-2001  marcus Primitive GDROM support.
 1.2.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 25-Jan-2001  bouyer file gdrom.c was added on branch thorpej_scsipi on 2001-02-11 19:09:14 +0000
 1.3.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.4.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 03-Aug-2001  lukem update to -current
 1.5.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.8.6.6 11-Dec-2002  thorpej Sync with HEAD.
 1.8.6.5 11-Nov-2002  nathanw Catch up to -current
 1.8.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.8.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.8.6.2 01-Aug-2002  nathanw Catch up to -current.
 1.8.6.1 25-Mar-2002  nathanw file gdrom.c was added on branch nathanw_sa on 2002-08-01 02:41:29 +0000
 1.8.2.3 30-Aug-2002  gehenna catch up with -current.
 1.8.2.2 06-Jun-2002  gehenna fix missing #include <sys/conf.h>
 1.8.2.1 17-May-2002  gehenna Add device switch.
 1.15.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.6.4 17-Jan-2005  skrll Adapt to branch.
 1.15.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.6.1 03-Aug-2004  skrll Sync with HEAD
 1.16.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.16.8.1 29-Apr-2005  kent sync with -current
 1.17.6.3 27-Oct-2007  yamt sync with head.
 1.17.6.2 03-Sep-2007  yamt sync with head.
 1.17.6.1 21-Jun-2006  yamt sync with head.
 1.19.26.2 24-Mar-2007  yamt sync with head.
 1.19.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.20.2.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.20.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.20.2.1 13-Mar-2007  ad Sync with head.
 1.21.12.1 15-Aug-2007  skrll Sync with HEAD.
 1.21.10.1 07-Aug-2007  matt Sync with HEAD.
 1.21.8.2 16-Oct-2007  garbled Sync with HEAD
 1.21.8.1 03-Oct-2007  garbled Sync with HEAD
 1.22.8.1 14-Oct-2007  yamt sync with head.
 1.22.6.1 06-Nov-2007  matt sync with HEAD
 1.22.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.24.24.1 18-Jun-2008  simonb Sync with head.
 1.24.22.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.24.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.24.20.2 09-Oct-2010  yamt sync with head
 1.24.20.1 04-May-2009  yamt sync with head.
 1.24.18.1 17-Jun-2008  yamt sync with head.
 1.24.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.24.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.25.2.1 19-Oct-2008  haad Sync with HEAD.
 1.26.16.1 05-Mar-2011  rmind sync with head
 1.26.14.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.26.4.1 26-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1483):
sys/arch/dreamcast/dev/gdrom.c: revision 1.27
Set bp->b_resid properly after data transfer is complete.
Fixes unexpected "Bad address" errors on file read ops since January 2006.
The problem is reported and tracked by Yasushi Oshima.
 1.34.14.1 30-Jul-2012  martin Pull up following revision(s) (requested by abs in ticket #451):
sys/arch/dreamcast/dev/gdrom.c: revision 1.35
- Adjust the TOC parsing to reject an TOC with invalid (zero) track ids.
Avoids dereferencing off the start of the TOC track array.
- Add #ifdef GDROMDEBUGTOC for dumping out the gdrom TOC values
 1.34.8.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.34.8.1 30-Oct-2012  yamt sync with head
 1.35.4.1 18-May-2014  rmind sync with head
 1.35.2.2 03-Dec-2017  jdolecek update from HEAD
 1.35.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.38.2.1 10-Aug-2014  tls Rebase.
 1.40.4.2 19-Mar-2016  skrll Sync with HEAD
 1.40.4.1 06-Jun-2015  skrll Sync with HEAD
 1.39 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.38 31-Jul-2021  andvar branches: 1.38.2;
fix more typos in style found one in file - check/fix them all.
 1.37 24-Apr-2021  thorpej branches: 1.37.2;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.36 11-Mar-2016  tsutsui branches: 1.36.32;
Properly zero out struct fb_devconfig, including rasops_info.

Fix panic after wsconscfg(8) from serial console, caused by
a junk function pointer.
 1.35 26-Mar-2014  christos branches: 1.35.4; 1.35.6; 1.35.10;
kill sprintf
 1.34 11-Jan-2012  macallan branches: 1.34.6; 1.34.10;
adjust for wsfont_find() change
 1.33 19-Jul-2011  dyoung branches: 1.33.2; 1.33.6;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.32 21-May-2011  tsutsui Move several static wsdisplay variables into proper device specific structures
to resolve XXX comments. Tested on GXemul.
 1.31 26-Jan-2011  tsutsui Add proper prefix to structures.
 1.30 24-Oct-2010  tsutsui branches: 1.30.2; 1.30.4;
- make local functions/variables static
- export more cons(9) functions in pvrvar.h
 1.29 20-Oct-2010  tsutsui Split device_t/softc.
 1.28 19-Jun-2010  tsutsui Add WSDISPLAYIO_LINEBYTES, required by Xorg wsfb server.
 1.27 15-May-2010  tsutsui Clear RI_NO_AUTO in actual attach functions during autoconf(9)
for console devices that set the flag during consinit().
 1.26 15-May-2010  tsutsui Set RI_NO_AUTO in ri_flg if pvr_getdevconfig() is invoked from cninit.
Tested on gxemul.
 1.25 26-May-2008  nisimura branches: 1.25.18; 1.25.20;
- assign 2 clause TNF license to the files cited as my ownership.
- abandon and remove my copyright notice from the three files were
copied in order to adapt HW I don't have; pvr.c, pm.c and stic.c
 1.24 04-Mar-2007  christos branches: 1.24.40; 1.24.42; 1.24.44; 1.24.46;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.23 14-May-2006  elad branches: 1.23.14;
integrate kauth.
 1.22 12-Apr-2006  jmmv Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.21 24-Dec-2005  perry branches: 1.21.4; 1.21.6; 1.21.8; 1.21.10; 1.21.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.20 11-Dec-2005  christos merge ktrace-lwp.
 1.19 19-Feb-2005  tsutsui branches: 1.19.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.18 10-Dec-2003  tsutsui branches: 1.18.8; 1.18.10;
Add WSDISPLAYIO_VIDEO_{ON,OFF} support for WSDISPLAYIO_SVIDEO ioctl.
Patch from Yasushi Oshima.
 1.17 02-Oct-2002  thorpej branches: 1.17.6;
Use CFATTACH_DECL().
 1.16 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15 27-Sep-2002  thorpej When in a match routine, the cfdata we're passed always references
our own cfdriver, so don't bother comparing the names, since they
will always match.
 1.14 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.13 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.12 03-May-2002  thorpej branches: 1.12.2; 1.12.6;
De-obfuscate somewhat; define and use register bit constants, etc.
 1.11 24-Mar-2002  uch adapted to new interrupt code and shb changes.
 1.10 17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.9 13-Mar-2002  ad Reorganise the wsfont stuff slightly so that multiple display adapters
with different bit/byte order requirements can co-exist happily.
 1.8 05-Mar-2001  marcus branches: 1.8.4;
Off-by-one error on v_absolute_size fixed.
 1.7 04-Mar-2001  marcus Made it possible to mmap the frame buffer.
 1.6 19-Feb-2001  marcus PAL support...
 1.5 02-Feb-2001  thorpej branches: 1.5.2;
Report the VGA/NTSC RGB/composite mode of the display.
 1.4 01-Feb-2001  thorpej New PowerVR display driver, based on the TURBOchannel "cfb"
driver by Tohru Nisimura (a very good framework for a FB driver,
BTW!), using bits of Marcus's original driver for the hardware
access.

The main advantage of this version is that is uses rasops (which
is faster than the rcons stuff) and wsfont, so you can select the
console font in the kernel config file. Using the BOLD8x16 font,
you get an 80x30 console (vast improvement compared to the Gallant12x22
font).
 1.3 21-Jan-2001  marcus Corrected license text.
 1.2 21-Jan-2001  christos knf, some symbolic constants would be nice [pvrreg.h]

christos
 1.1 16-Jan-2001  marcus PowerVR display driver.
 1.5.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.5.2.1 02-Feb-2001  bouyer file pvr.c was added on branch thorpej_scsipi on 2001-03-12 13:28:07 +0000
 1.8.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.8.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.8.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.12.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.12.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.12.6.2 01-Aug-2002  nathanw Catch up to -current.
 1.12.6.1 03-May-2002  nathanw file pvr.c was added on branch nathanw_sa on 2002-08-01 02:41:29 +0000
 1.12.2.2 16-Jul-2002  gehenna catch up with -current.
 1.12.2.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.17.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.17.6.4 17-Jan-2005  skrll Adapt to branch.
 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.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.18.8.1 29-Apr-2005  kent sync with -current
 1.19.6.2 03-Sep-2007  yamt sync with head.
 1.19.6.1 21-Jun-2006  yamt sync with head.
 1.21.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.21.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.21.8.1 24-May-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.23.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.46.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.24.44.2 11-Aug-2010  yamt sync with head.
 1.24.44.1 04-May-2009  yamt sync with head.
 1.24.42.1 04-Jun-2008  yamt sync with head
 1.24.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.25.20.4 31-May-2011  rmind sync with head
 1.25.20.3 05-Mar-2011  rmind sync with head
 1.25.20.2 03-Jul-2010  rmind sync with head
 1.25.20.1 30-May-2010  rmind sync with head
 1.25.18.3 06-Nov-2010  uebayasi Sync with HEAD.
 1.25.18.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.25.18.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.30.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.30.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.33.6.1 18-Feb-2012  mrg merge to -current.
 1.33.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.33.2.1 17-Apr-2012  yamt sync with head
 1.34.10.1 18-May-2014  rmind sync with head
 1.34.6.2 03-Dec-2017  jdolecek update from HEAD
 1.34.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.35.10.1 18-Jan-2017  skrll Sync with netbsd-5
 1.35.6.1 19-Mar-2016  skrll Sync with HEAD
 1.35.4.1 06-Dec-2016  snj Pull up following revision(s) (requested by tsutsui in ticket #1284):
sys/arch/dreamcast/dev/pvr.c: revision 1.36
Properly zero out struct fb_devconfig, including rasops_info.
Fix panic after wsconscfg(8) from serial console, caused by
a junk function pointer.
 1.36.32.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.37.2.1 01-Aug-2021  thorpej Sync with HEAD.
 1.38.2.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.4 24-Oct-2010  tsutsui - make local functions/variables static
- export more cons(9) functions in pvrvar.h
 1.3 01-Feb-2001  thorpej branches: 1.3.2; 1.3.152; 1.3.154;
New PowerVR display driver, based on the TURBOchannel "cfb"
driver by Tohru Nisimura (a very good framework for a FB driver,
BTW!), using bits of Marcus's original driver for the hardware
access.

The main advantage of this version is that is uses rasops (which
is faster than the rcons stuff) and wsfont, so you can select the
console font in the kernel config file. Using the BOLD8x16 font,
you get an 80x30 console (vast improvement compared to the Gallant12x22
font).
 1.2 21-Jan-2001  marcus Corrected license text.
 1.1 16-Jan-2001  marcus PowerVR display driver.
 1.3.154.1 05-Mar-2011  rmind sync with head
 1.3.152.1 06-Nov-2010  uebayasi Sync with HEAD.
 1.3.2.2 01-Feb-2001  thorpej New PowerVR display driver, based on the TURBOchannel "cfb"
driver by Tohru Nisimura (a very good framework for a FB driver,
BTW!), using bits of Marcus's original driver for the hardware
access.

The main advantage of this version is that is uses rasops (which
is faster than the rcons stuff) and wsfont, so you can select the
console font in the kernel config file. Using the BOLD8x16 font,
you get an 80x30 console (vast improvement compared to the Gallant12x22
font).
 1.3.2.1 01-Feb-2001  thorpej file pvrvar.h was added on branch thorpej_scsipi on 2001-02-01 01:25:57 +0000
 1.4 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.3 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.2 24-Apr-2021  thorpej branches: 1.2.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.1 29-Dec-2016  tsutsui branches: 1.1.2; 1.1.6; 1.1.18; 1.1.36;
WIP "G1-ATA" IDE HDD support. Not enabled by default.

Demonstrated on NetBSD booth at Open Source Conference 2016 Tokyo Fall
and Kansai Open Source 2016:
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/09/msg000721.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/16/msg000722.html

See my port-dreamcast@ post for more details:
http://mail-index.netbsd.org/port-dreamcast/2016/12/18/msg000295.html
 1.1.36.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.1.36.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.1.36.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.1.36.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.1.36.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.1.36.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 29-Dec-2016  jdolecek file g1bus.c was added on branch tls-maxphys on 2017-12-03 11:36:00 +0000
 1.1.6.2 05-Feb-2017  skrll Sync with HEAD
 1.1.6.1 29-Dec-2016  skrll file g1bus.c was added on branch nick-nhusb on 2017-02-05 13:40:06 +0000
 1.1.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.1 29-Dec-2016  pgoyette file g1bus.c was added on branch pgoyette-localcount on 2017-01-07 08:56:12 +0000
 1.2.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 29-Dec-2016  tsutsui branches: 1.1.2; 1.1.6; 1.1.18;
WIP "G1-ATA" IDE HDD support. Not enabled by default.

Demonstrated on NetBSD booth at Open Source Conference 2016 Tokyo Fall
and Kansai Open Source 2016:
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/09/msg000721.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/16/msg000722.html

See my port-dreamcast@ post for more details:
http://mail-index.netbsd.org/port-dreamcast/2016/12/18/msg000295.html
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 29-Dec-2016  jdolecek file g1bus_bus_mem.c was added on branch tls-maxphys on 2017-12-03 11:36:00 +0000
 1.1.6.2 05-Feb-2017  skrll Sync with HEAD
 1.1.6.1 29-Dec-2016  skrll file g1bus_bus_mem.c was added on branch nick-nhusb on 2017-02-05 13:40:06 +0000
 1.1.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.1 29-Dec-2016  pgoyette file g1bus_bus_mem.c was added on branch pgoyette-localcount on 2017-01-07 08:56:12 +0000
 1.1 29-Dec-2016  tsutsui branches: 1.1.2; 1.1.6; 1.1.18;
WIP "G1-ATA" IDE HDD support. Not enabled by default.

Demonstrated on NetBSD booth at Open Source Conference 2016 Tokyo Fall
and Kansai Open Source 2016:
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/09/msg000721.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/16/msg000722.html

See my port-dreamcast@ post for more details:
http://mail-index.netbsd.org/port-dreamcast/2016/12/18/msg000295.html
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 29-Dec-2016  jdolecek file g1busvar.h was added on branch tls-maxphys on 2017-12-03 11:36:00 +0000
 1.1.6.2 05-Feb-2017  skrll Sync with HEAD
 1.1.6.1 29-Dec-2016  skrll file g1busvar.h was added on branch nick-nhusb on 2017-02-05 13:40:06 +0000
 1.1.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.1 29-Dec-2016  pgoyette file g1busvar.h was added on branch pgoyette-localcount on 2017-01-07 08:56:12 +0000
 1.1 29-Dec-2016  tsutsui branches: 1.1.2; 1.1.6; 1.1.18;
WIP "G1-ATA" IDE HDD support. Not enabled by default.

Demonstrated on NetBSD booth at Open Source Conference 2016 Tokyo Fall
and Kansai Open Source 2016:
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/09/msg000721.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/16/msg000722.html

See my port-dreamcast@ post for more details:
http://mail-index.netbsd.org/port-dreamcast/2016/12/18/msg000295.html
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 29-Dec-2016  jdolecek file gdrom.c was added on branch tls-maxphys on 2017-12-03 11:36:00 +0000
 1.1.6.2 05-Feb-2017  skrll Sync with HEAD
 1.1.6.1 29-Dec-2016  skrll file gdrom.c was added on branch nick-nhusb on 2017-02-05 13:40:06 +0000
 1.1.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.1 29-Dec-2016  pgoyette file gdrom.c was added on branch pgoyette-localcount on 2017-01-07 08:56:12 +0000
 1.6 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.5 14-Sep-2019  tsutsui Restore interface to pass a MD reset function to MI wdcprobe().

Fixes silent hang on G1IDE on Dreamcast. PR kern/54538
Should be pulled up to netbsd-9 with the previous changes.
 1.4 09-Sep-2019  jdolecek adjust several missed drivers for wdcprobe() changes of ATA NCQ branch

for dreamcast g1 just drop the custom reset function, it doesn't seem to do
anything useful over the generic variant

PR kern/54538 by Izumi Tsutsui
 1.3 20-Oct-2017  jdolecek branches: 1.3.2; 1.3.6; 1.3.10;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.2 07-Oct-2017  jdolecek adapt the rest of wdc attachments for NCQ branch merge
 1.1 29-Dec-2016  tsutsui branches: 1.1.2; 1.1.6;
WIP "G1-ATA" IDE HDD support. Not enabled by default.

Demonstrated on NetBSD booth at Open Source Conference 2016 Tokyo Fall
and Kansai Open Source 2016:
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/09/msg000721.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/16/msg000722.html

See my port-dreamcast@ post for more details:
http://mail-index.netbsd.org/port-dreamcast/2016/12/18/msg000295.html
 1.1.6.2 05-Feb-2017  skrll Sync with HEAD
 1.1.6.1 29-Dec-2016  skrll file wdc_g1.c was added on branch nick-nhusb on 2017-02-05 13:40:06 +0000
 1.1.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.2.1 29-Dec-2016  pgoyette file wdc_g1.c was added on branch pgoyette-localcount on 2017-01-07 08:56:12 +0000
 1.3.10.1 23-Sep-2019  martin Pull up following revision(s) (requested by tsutsui in ticket #232):

sys/arch/evbppc/mpc85xx/wdc_obio.c: revision 1.7
sys/arch/dreamcast/dev/g1/wdc_g1.c: revision 1.4
sys/arch/dreamcast/dev/g1/wdc_g1.c: revision 1.5
sys/arch/mmeye/dev/wdc_mainbus.c: revision 1.7
sys/dev/ic/wdcvar.h: revision 1.99
sys/dev/ic/wdc.c: revision 1.292
sys/arch/mips/adm5120/dev/wdc_extio.c: revision 1.11

adjust several missed drivers for wdcprobe() changes of ATA NCQ branch
for dreamcast g1 just drop the custom reset function, it doesn't seem to do
anything useful over the generic variant

PR kern/54538 by Izumi Tsutsui

Restore interface to pass a MD reset function to MI wdcprobe().

Fixes silent hang on G1IDE on Dreamcast. PR kern/54538
Should be pulled up to netbsd-9 with the previous changes.
 1.3.6.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3.2.2 03-Dec-2017  jdolecek update from HEAD
 1.3.2.1 20-Oct-2017  jdolecek file wdc_g1.c was added on branch tls-maxphys on 2017-12-03 11:36:00 +0000
 1.31 07-Feb-2024  msaitoh Remove ryo@'s mail addresses.
 1.30 09-Feb-2021  isaki Update function name in a comment.
 1.29 06-Feb-2021  isaki Remove sc_open flag.
Counting {open,close} is done by the MI audio layer.
 1.28 23-Feb-2020  isaki branches: 1.28.6;
Make start_input/halt_input optional if the driver has no recording,
make start_output/halt_output optional if the driver has no playback.
And remove such never called functions.
 1.27 08-May-2019  isaki branches: 1.27.4;
Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.26 06-May-2019  ryo don't use tsleep() in interrupt context.
when the audio starts playing, initialization is performed on the aica arm driver side.
 1.25 16-Mar-2019  isaki branches: 1.25.2;
Use C99 style struct initializer to audio_hw_if.
 1.24 03-Mar-2018  christos branches: 1.24.4;
this ain't python, thanks gcc6.
 1.23 25-Jul-2017  nat Dreamcast audio only supports playback so set it in the props.
This makes dreamcast audio work again.

Tested by Bjorn Johannesson.
cvs: ----------------------------------------------------------------------
 1.22 23-Nov-2011  jmcneill branches: 1.22.8; 1.22.26; 1.22.42;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

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

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

Welcome to 5.99.57.
 1.21 19-Jul-2011  dyoung branches: 1.21.2; 1.21.4;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.20 21-Nov-2010  tsutsui Split softc/device_t.
 1.19 20-Nov-2010  tsutsui Make aica_round_blocksize() always return a fixed buffer size.

I'm not sure if this is correct, but audio playback doesn't work
on dreamcast without this workaround. (since kent-audio1 merge?)
 1.18 01-Aug-2008  marcus branches: 1.18.4; 1.18.16;
sysasic_intr_string() takes an IRL, not an IPL.
 1.17 06-Jan-2008  he branches: 1.17.6; 1.17.10; 1.17.12; 1.17.16;
Include <sys/device.h> explicitly to pull in needed definitions.
 1.16 17-Oct-2007  garbled branches: 1.16.2; 1.16.8;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.15 16-Jul-2007  marcus branches: 1.15.10;
Clear the correct amount of audio RAM in AICA driver (fixes port-dreamcast/35022).
 1.14 12-Mar-2007  tsutsui branches: 1.14.8;
IRL line connected to each device on sysasic is not always corresponding
with MI IPL_* definitions, so add an independent arg to pass IRL lines
to sysasic_intr_establish() and use appropriate macro for them.
 1.13 22-Feb-2007  thorpej branches: 1.13.4;
TRUE -> true, FALSE -> false
 1.12 10-May-2006  skrll branches: 1.12.14;
Fix a bunch of cast lvalues.
 1.11 24-Dec-2005  perry branches: 1.11.4; 1.11.6; 1.11.8; 1.11.10; 1.11.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 02-Jun-2005  he branches: 1.9.2;
Fix const fallout.
 1.8 19-Feb-2005  tsutsui - u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.7 15-Jan-2005  kent branches: 1.7.2; 1.7.4;
ansify and KNF
 1.6 10-Jan-2005  kent merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

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

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

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

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

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

* all of audio HW drivers follow audio_hw_if and ac97 changes
 1.5 29-Oct-2004  yamt branches: 1.5.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.4 25-Aug-2003  marcus branches: 1.4.4;
mulaw/alaw timing bugfix from Izumi Tsutsui.
 1.3 24-Aug-2003  marcus LINEAR and LINEAR_LE need to be interchangeable (fixes 8bit unsigned bug).
 1.2 24-Aug-2003  marcus Added some encodings which were supported but not listed.
 1.1 24-Aug-2003  marcus Added AICA sound driver contributed by Ryo Shimizu.
 1.4.4.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.4.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.4.6 17-Jan-2005  skrll Sync with HEAD.
 1.4.4.5 02-Nov-2004  skrll Sync with HEAD.
 1.4.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.4.2 03-Aug-2004  skrll Sync with HEAD
 1.4.4.1 25-Aug-2003  skrll file aica.c was added on branch ktrace-lwp on 2004-08-03 10:33:53 +0000
 1.5.2.2 09-Jan-2005  kent audio_hw_if change
* make open() and close() optional
* add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
 1.5.2.1 03-Jan-2005  kent adopt the filter pipeline framework
 1.7.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.2.1 29-Apr-2005  kent sync with -current
 1.9.2.4 21-Jan-2008  yamt sync with head
 1.9.2.3 03-Sep-2007  yamt sync with head.
 1.9.2.2 26-Feb-2007  yamt sync with head.
 1.9.2.1 21-Jun-2006  yamt sync with head.
 1.11.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.11.10.1 11-May-2006  elad sync with head
 1.11.8.1 24-May-2006  yamt sync with head.
 1.11.6.1 01-Jun-2006  kardel Sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.14.2 24-Mar-2007  yamt sync with head.
 1.12.14.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.13.4.2 20-Aug-2007  ad Sync with HEAD.
 1.13.4.1 13-Mar-2007  ad Sync with head.
 1.14.8.1 03-Oct-2007  garbled Sync with HEAD
 1.15.10.2 09-Jan-2008  matt sync with HEAD
 1.15.10.1 06-Nov-2007  matt sync with HEAD
 1.16.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.16.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.17.16.1 19-Oct-2008  haad Sync with HEAD.
 1.17.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.17.10.1 04-May-2009  yamt sync with head.
 1.17.6.1 28-Sep-2008  mjf Sync with HEAD.
 1.18.16.1 05-Mar-2011  rmind sync with head
 1.18.4.1 21-Dec-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1497):
sys/arch/dreamcast/dev/g2/aica.c: revision 1.19
Make aica_round_blocksize() always return a fixed buffer size.
I'm not sure if this is correct, but audio playback doesn't work
on dreamcast without this workaround. (since kent-audio1 merge?)
 1.21.4.2 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.21.4.1 20-Nov-2011  jmcneill adapt to audiomp api changes
 1.21.2.1 17-Apr-2012  yamt sync with head
 1.22.42.1 26-Jul-2017  martin Pull up following revision(s) (requested by nat in ticket #160):
sys/arch/dreamcast/conf/G1IDE: revision 1.2
sys/arch/dreamcast/conf/GENERIC: revision 1.126
sys/arch/dreamcast/dev/g2/aica.c: revision 1.23
Dreamcast audio only supports playback so set it in the props.
This makes dreamcast audio work again.
Tested by Bjorn Johannesson.
cvs: ----------------------------------------------------------------------
Use the correct attachment for dreamcast audio.
Found and tested by Bjorn Johannesson on port-dreamcast.
 1.22.26.1 28-Aug-2017  skrll Sync with HEAD
 1.22.8.1 03-Dec-2017  jdolecek update from HEAD
 1.24.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.24.4.1 10-Jun-2019  christos Sync with HEAD
 1.25.2.3 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.25.2.2 03-May-2019  isaki Adapt to audio2.
- audio2 limits the lowest frequency.
- Remove unused sc_encodings.
- In audio2, round_buffersize(RECORD) will not be called if the
driver does not support recording.
 1.25.2.1 21-Apr-2019  isaki Use C99 style struct initializer to audio_format.
 1.27.4.1 29-Feb-2020  ad Sync with head.
 1.28.6.1 03-Apr-2021  thorpej Sync with HEAD.
 1.4 07-Feb-2024  msaitoh Remove ryo@'s mail addresses.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 15-Jan-2005  kent ansify and KNF
 1.1 24-Aug-2003  marcus branches: 1.1.4;
Added AICA sound driver contributed by Ryo Shimizu.
 1.1.4.5 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 24-Aug-2003  skrll file aicavar.h was added on branch ktrace-lwp on 2004-08-03 10:33:53 +0000
 1.17 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.16 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.15 24-Apr-2021  thorpej branches: 1.15.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.14 21-Nov-2010  tsutsui branches: 1.14.74;
Split softc/device_t.
 1.13 07-Aug-2006  tsutsui branches: 1.13.84;
KNF, TAB/space cosmetics
 1.12 11-Dec-2005  christos branches: 1.12.4; 1.12.8;
merge ktrace-lwp.
 1.11 26-Aug-2005  drochner s/locdesc_t/int/g
 1.10 30-Jun-2005  drochner branches: 1.10.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.9 19-Feb-2005  tsutsui - u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.8 15-Jul-2003  lukem branches: 1.8.8; 1.8.10;
__KERNEL_RCSID()
 1.7 02-Oct-2002  thorpej branches: 1.7.6;
Add trailing ; to CFATTACH_DECL
 1.6 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.3 27-Sep-2002  thorpej When in a match routine, the cfdata we're passed always references
our own cfdriver, so don't bother comparing the names, since they
will always match.
 1.2 24-Mar-2002  uch branches: 1.2.6;
adapted to new interrupt code and shb changes.
 1.1 31-Jan-2001  thorpej branches: 1.1.2; 1.1.6;
G2 bus support. Low level stuff by Marcus, bus_space stuff by me.
 1.1.6.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 31-Jan-2001  bouyer file g2bus.c was added on branch thorpej_scsipi on 2001-02-11 19:09:15 +0000
 1.2.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.6.1 24-Mar-2002  nathanw file g2bus.c was added on branch nathanw_sa on 2002-10-18 02:36:20 +0000
 1.7.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 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.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.8.1 29-Apr-2005  kent sync with -current
 1.10.2.2 30-Dec-2006  yamt sync with head.
 1.10.2.1 21-Jun-2006  yamt sync with head.
 1.12.8.1 11-Aug-2006  yamt sync with head
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.13.84.1 05-Mar-2011  rmind sync with head
 1.14.74.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.14.74.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.14.74.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.14.74.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.14.74.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.14.74.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.15.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.16 19-Jul-2011  dyoung Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.15 23-Aug-2009  tsutsui Add an empty bus_space_mmap(9) function as temporary workaround
for MI pci(4) mmap function in sys/dev/pci/pci_usrreq.c.

XXX: no bus_space_subregion(9) for g2bus.
 1.14 28-Apr-2008  martin branches: 1.14.10; 1.14.18;
Remove clause 3 and 4 from TNF licenses
 1.13 07-Aug-2006  tsutsui branches: 1.13.58; 1.13.60; 1.13.62;
KNF, TAB/space cosmetics
 1.12 24-Dec-2005  perry branches: 1.12.4; 1.12.8;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 19-Feb-2005  tsutsui branches: 1.10.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.9 24-Aug-2003  marcus branches: 1.9.8; 1.9.10;
Added AICA sound driver contributed by Ryo Shimizu.
 1.8 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 02-Mar-2003  tsutsui branches: 1.7.2;
Cleanup G2_LOCK/G2_UNLOCK macros per discussion on port-dreamcast:
- Use _cpu_intr_suspend()/_cpu_intr_resume() in G2_LOCK/G2_UNLOCK macros
rather than _cpu_exception_suspend()/_cpu_exception_resume().
TLB miss exceptions could happen on accessing buffer, but it will never
block G2bus cycle anyway.
- Restore the previous SR.IMASK value in G2_UNLOCK().
- some misc cosmetics.

Should fix spontaneous reboots by "ping -s 8192 host" on the LAN Adapter.
 1.6 27-Dec-2002  tsutsui Add a set of bus_space(9) functions for g2bus devices with
sparse address space. This is required for SEGA LAN adapter support.
 1.5 03-Mar-2002  uch branches: 1.5.10;
SR related parts moved to psl.h. cpufunc.h segments.h are removed.
kernel mode checking is only SR.MD. no check stack pointer.
 1.4 19-Feb-2002  uch Clean up functions
disable_intr, enable_intr, disable_interrupt, enable_interrupt,
disable_ext_intr, enable_ext_intr.
New functions:
for external interrupt:
_cpu_intr_suspend and _cpu_intr_resume.
for exception:
_cpu_exception_suspend and _cpu_exception_resume.
 1.3 01-Feb-2001  thorpej branches: 1.3.2; 1.3.6;
Implement {read,write}_region_1, and sprinkle some __volatile
around for sanity.
 1.2 31-Jan-2001  marcus Basic G2 locking implemented.
 1.1 31-Jan-2001  thorpej G2 bus support. Low level stuff by Marcus, bus_space stuff by me.
 1.3.6.1 16-Mar-2002  jdolecek Catch up with -current.
 1.3.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.3.2.1 01-Feb-2001  bouyer file g2bus_bus_mem.c was added on branch thorpej_scsipi on 2001-02-11 19:09:15 +0000
 1.5.10.2 29-Dec-2002  thorpej Sync with HEAD.
 1.5.10.1 03-Mar-2002  thorpej file g2bus_bus_mem.c was added on branch nathanw_sa on 2002-12-29 19:21:38 +0000
 1.7.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.6.2 30-Dec-2006  yamt sync with head.
 1.10.6.1 21-Jun-2006  yamt sync with head.
 1.12.8.1 11-Aug-2006  yamt sync with head
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.13.62.2 16-Sep-2009  yamt sync with head
 1.13.62.1 16-May-2008  yamt sync with head.
 1.13.60.1 18-May-2008  yamt sync with head.
 1.13.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.18.1 21-Apr-2010  matt sync to netbsd-5
 1.14.10.1 16-Sep-2009  snj Pull up following revision(s) (requested by mrg in ticket #952):
sys/arch/dreamcast/dev/g2/g2bus_bus_mem.c: revision 1.15
sys/arch/dreamcast/include/bus.h: revision 1.15
Add an empty bus_space_mmap(9) function as a workaround
for MI pci(4) mmap function in sys/dev/pci/pci_usrreq.c.
XXX: no bus_space_subregion(9) for g2bus.
 1.7 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.6 19-Jul-2011  dyoung branches: 1.6.2; 1.6.12;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.5 21-Nov-2010  tsutsui Split softc/device_t.
 1.4 27-Dec-2002  tsutsui branches: 1.4.130;
Add a set of bus_space(9) functions for g2bus devices with
sparse address space. This is required for SEGA LAN adapter support.
 1.3 23-Dec-2002  tsutsui Fix pasto in comment.
 1.2 24-Mar-2002  uch branches: 1.2.6;
adapted to new interrupt code and shb changes.
 1.1 31-Jan-2001  thorpej branches: 1.1.2; 1.1.6;
G2 bus support. Low level stuff by Marcus, bus_space stuff by me.
 1.1.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 31-Jan-2001  bouyer file g2busvar.h was added on branch thorpej_scsipi on 2001-02-11 19:09:15 +0000
 1.2.6.2 29-Dec-2002  thorpej Sync with HEAD.
 1.2.6.1 24-Mar-2002  thorpej file g2busvar.h was added on branch nathanw_sa on 2002-12-29 19:21:38 +0000
 1.4.130.1 05-Mar-2011  rmind sync with head
 1.6.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.2.1 30-Oct-2012  yamt sync with head
 1.9 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

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

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.8 09-Oct-2016  christos PR/51540: Henning Petersen: replace , with ;
 1.7 17-Nov-2014  christos branches: 1.7.2; 1.7.4;
PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.
 1.6 19-Jul-2011  dyoung branches: 1.6.12;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.5 01-Sep-2010  tsutsui - split device_t/softc
- allocate struct todr_chip_handle in per-device softc
- some cosmetics
 1.4 12-Dec-2009  tsutsui branches: 1.4.2; 1.4.4;
Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 06-Jan-2008  he branches: 1.2.6; 1.2.8; 1.2.10;
Include <sys/device.h> explicitly to pull in needed definitions.
 1.1 05-Sep-2006  uwe branches: 1.1.4; 1.1.6; 1.1.12; 1.1.38; 1.1.44; 1.1.52;
Switch dreamcast to MI todr(9).

Dreamcast does not use SuperH on-chip RTC, so do it seprately from
other sh3 ports. Convert dreamcast rtc code into a real device
instead of searching/attaching it manually.

Tested by Nick Hudson.
 1.1.52.1 08-Jan-2008  bouyer Sync with HEAD
 1.1.44.1 18-Feb-2008  mjf Sync with HEAD.
 1.1.38.1 09-Jan-2008  matt sync with HEAD
 1.1.12.3 21-Jan-2008  yamt sync with head
 1.1.12.2 30-Dec-2006  yamt sync with head.
 1.1.12.1 05-Sep-2006  yamt file g2rtc.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:46 +0000
 1.1.6.2 14-Sep-2006  yamt sync with head.
 1.1.6.1 05-Sep-2006  yamt file g2rtc.c was added on branch yamt-pdpolicy on 2006-09-14 12:31:09 +0000
 1.1.4.2 09-Sep-2006  rpaulo sync with head
 1.1.4.1 05-Sep-2006  rpaulo file g2rtc.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:38:29 +0000
 1.2.10.3 09-Oct-2010  yamt sync with head
 1.2.10.2 11-Mar-2010  yamt sync with head
 1.2.10.1 16-May-2008  yamt sync with head.
 1.2.8.1 18-May-2008  yamt sync with head.
 1.2.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.4.1 05-Mar-2011  rmind sync with head
 1.4.2.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.6.12.1 03-Dec-2017  jdolecek update from HEAD
 1.7.4.1 04-Nov-2016  pgoyette Sync with HEAD
 1.7.2.1 05-Dec-2016  skrll Sync with HEAD
 1.22 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.21 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.20 24-Apr-2021  thorpej branches: 1.20.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.19 19-Jul-2011  dyoung branches: 1.19.68;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.18 17-May-2011  dyoung PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name. Correct that.

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

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

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
 1.17 21-Nov-2010  tsutsui branches: 1.17.2;
Split softc/device_t.
 1.16 01-Aug-2008  marcus branches: 1.16.16;
Fixed a compilation warning.
 1.15 07-Aug-2006  tsutsui branches: 1.15.58; 1.15.62; 1.15.64; 1.15.68;
KNF, TAB/space cosmetics
 1.14 11-Dec-2005  christos branches: 1.14.4; 1.14.8;
merge ktrace-lwp.
 1.13 19-Feb-2005  tsutsui branches: 1.13.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.12 30-Aug-2004  drochner branches: 1.12.4; 1.12.6;
Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.11 15-Jul-2003  lukem __KERNEL_RCSID()
 1.10 15-Jun-2003  fvdl branches: 1.10.2;
Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
 1.9 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.8 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL
 1.7 02-Oct-2002  itohy ../../../../arch/dreamcast/dev/g2/gapspci.c:62: macro `CFATTACH_DECL' used with only 5 args
 1.6 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 27-Sep-2002  thorpej When in a match routine, the cfdata we're passed always references
our own cfdriver, so don't bother comparing the names, since they
will always match.
 1.3 16-May-2002  thorpej branches: 1.3.2; 1.3.6;
* Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses. For busses behind a bridge, it points to
a persistent copy of the bridge's pcitag_t. This can be very useful
for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
uses OFW device nodes to enumerate the bus. When a PCI bus that is
behind a bridge is attached, pci_attach_hook() allocates a new PCI
chipset tag for the new bus and sets it's "curnode" to the OFW node
of the bridge. This is used as a starting point when enumerating
that bus. Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
 1.2 01-Feb-2001  marcus branches: 1.2.2; 1.2.6;
Fixed the last raw accesses to use bus_space. Also added DMA mem size field.
 1.1 01-Feb-2001  thorpej GAPS PCI bridge support. Low-level stuff from Marcus, bus_dma
implementation from me.
 1.2.6.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 01-Feb-2001  bouyer file gapspci.c was added on branch thorpej_scsipi on 2001-02-11 19:09:15 +0000
 1.3.6.3 03-Jan-2003  thorpej Sync with HEAD.
 1.3.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.3.6.1 16-May-2002  nathanw file gapspci.c was added on branch nathanw_sa on 2002-10-18 02:36:21 +0000
 1.3.2.2 16-May-2002  thorpej * Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses. For busses behind a bridge, it points to
a persistent copy of the bridge's pcitag_t. This can be very useful
for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
uses OFW device nodes to enumerate the bus. When a PCI bus that is
behind a bridge is attached, pci_attach_hook() allocates a new PCI
chipset tag for the new bus and sets it's "curnode" to the OFW node
of the bridge. This is used as a starting point when enumerating
that bus. Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
 1.3.2.1 16-May-2002  thorpej file gapspci.c was added on branch gehenna-devsw on 2002-05-16 01:01:36 +0000
 1.10.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.2 03-Sep-2004  skrll Sync with HEAD
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.4.1 29-Apr-2005  kent sync with -current
 1.13.6.1 30-Dec-2006  yamt sync with head.
 1.14.8.1 11-Aug-2006  yamt sync with head
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.15.68.1 19-Oct-2008  haad Sync with HEAD.
 1.15.64.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.15.62.1 04-May-2009  yamt sync with head.
 1.15.58.1 28-Sep-2008  mjf Sync with HEAD.
 1.16.16.2 31-May-2011  rmind sync with head
 1.16.16.1 05-Mar-2011  rmind sync with head
 1.17.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.68.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.20.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.21 02-Dec-2023  thorpej Use vmem(9) rather than extent(9) to manage the GAPS PCI DMA buffer.
 1.20 27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.19 19-Jul-2011  dyoung branches: 1.19.2; 1.19.6;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.18 12-Nov-2010  uebayasi Pull in uvm/uvm.h where UVM's page level interface is used.
 1.17 07-Nov-2009  cegger branches: 1.17.4;
Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
 1.16 04-Jun-2008  ad vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.
 1.15 28-Apr-2008  martin branches: 1.15.2;
Remove clause 3 and 4 from TNF licenses
 1.14 04-Mar-2007  christos branches: 1.14.40; 1.14.42; 1.14.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 07-Aug-2006  tsutsui branches: 1.13.10;
KNF, TAB/space cosmetics
 1.12 24-Nov-2005  yamt branches: 1.12.4; 1.12.8;
bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.11 01-Apr-2005  yamt branches: 1.11.2; 1.11.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.10 09-Mar-2005  matt Add a dm_maxsegsz public member to bus_dmamap_t. This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create). dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.
 1.9 19-Feb-2005  tsutsui - u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.8 15-Jul-2003  lukem branches: 1.8.8; 1.8.10;
__KERNEL_RCSID()
 1.7 02-Jun-2002  drochner branches: 1.7.2; 1.7.8;
move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
 1.6 10-Sep-2001  chris branches: 1.6.10;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.
 1.5 26-May-2001  chs branches: 1.5.2; 1.5.4;
replace vm_page_t with struct vm_page *.
 1.4 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.3 01-Feb-2001  thorpej branches: 1.3.2; 1.3.4;
Add some info to the dmamap_sync assertion messages.
 1.2 01-Feb-2001  marcus Fixed the last raw accesses to use bus_space. Also added DMA mem size field.
 1.1 01-Feb-2001  thorpej GAPS PCI bridge support. Low-level stuff from Marcus, bus_dma
implementation from me.
 1.3.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.3.2.1 01-Feb-2001  bouyer file gapspci_dma.c was added on branch thorpej_scsipi on 2001-02-11 19:09:16 +0000
 1.5.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.5.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.6.10.1 14-Jul-2002  gehenna catch up with -current.
 1.7.8.6 11-Dec-2005  christos Sync with head.
 1.7.8.5 01-Apr-2005  skrll Sync with HEAD.
 1.7.8.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.8.1 03-Aug-2004  skrll Sync with HEAD
 1.7.2.2 02-Jun-2002  drochner move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
 1.7.2.1 02-Jun-2002  drochner file gapspci_dma.c was added on branch nathanw_sa on 2002-06-02 14:44:45 +0000
 1.8.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.10.1 26-Jan-2005  yamt convert arch/dreamcast to new apis.
 1.8.8.1 29-Apr-2005  kent sync with -current
 1.11.8.1 29-Nov-2005  yamt sync with head.
 1.11.2.3 03-Sep-2007  yamt sync with head.
 1.11.2.2 30-Dec-2006  yamt sync with head.
 1.11.2.1 21-Jun-2006  yamt sync with head.
 1.12.8.1 11-Aug-2006  yamt sync with head
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.13.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.44.3 11-Mar-2010  yamt 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.2 17-Jun-2008  yamt sync with head.
 1.14.42.1 18-May-2008  yamt sync with head.
 1.14.40.2 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.14.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.17.4.1 05-Mar-2011  rmind sync with head
 1.19.6.1 18-Feb-2012  mrg merge to -current.
 1.19.2.1 17-Apr-2012  yamt sync with head
 1.18 07-Aug-2021  andvar s/configuraiton/configuration/ in comments and man pages.
 1.17 23-Oct-2015  knakahara fix build failure on dreamcast.
 1.16 02-Oct-2015  msaitoh PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.15 31-Mar-2014  christos branches: 1.15.6;
make a copy of the interrupt string in buf.
 1.14 31-Mar-2014  martin Adapt intr_string signature
 1.13 19-Jul-2011  dyoung branches: 1.13.2; 1.13.12; 1.13.16;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.12 21-Nov-2010  tsutsui Split softc/device_t.
 1.11 01-Aug-2008  marcus branches: 1.11.16;
sysasic_intr_string() takes an IRL, not an IPL.
 1.10 12-Mar-2007  tsutsui branches: 1.10.38; 1.10.42; 1.10.44; 1.10.48;
IRL line connected to each device on sysasic is not always corresponding
with MI IPL_* definitions, so add an independent arg to pass IRL lines
to sysasic_intr_establish() and use appropriate macro for them.
 1.9 07-Aug-2006  tsutsui branches: 1.9.10; 1.9.14;
KNF, TAB/space cosmetics
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.8;
merge ktrace-lwp.
 1.7 19-Feb-2005  tsutsui branches: 1.7.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.6 15-Jul-2003  lukem branches: 1.6.8; 1.6.10;
__KERNEL_RCSID()
 1.5 15-Nov-2002  itohy branches: 1.5.6;
Allow multiple event handlers to be installed to an IRL.
The IRL is specified as IPL (2nd arg of sysasic_intr_establish()).
Current mapping:
IRL9 IPL_BIO
IRL11 IPL_NET
IRL13 IPL_TTY
 1.4 15-May-2002  thorpej branches: 1.4.6;
Implement pci_decompose_tag().
 1.3 24-Mar-2002  uch adapted to new interrupt code and shb changes.
 1.2 24-Apr-2001  marcus branches: 1.2.2;
Abstracted handling of System ASIC controlled IRQ:s a little.
Three different IRQ:s can be selected for each event, 9, 11, or 13
(which selects hardware priority). More events to be added as they
are discovered. Do not use shb_intr_establish() to register IRQ 9, 11
or 13 anymore.
 1.1 01-Feb-2001  thorpej branches: 1.1.2; 1.1.4;
GAPS PCI bridge support. Low-level stuff from Marcus, bus_dma
implementation from me.
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 01-Feb-2001  bouyer file gapspci_pci.c was added on branch thorpej_scsipi on 2001-02-11 19:09:16 +0000
 1.2.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.6.2 11-Dec-2002  thorpej Sync with HEAD.
 1.4.6.1 15-May-2002  thorpej file gapspci_pci.c was added on branch nathanw_sa on 2002-12-11 05:58:26 +0000
 1.5.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.7.6.2 03-Sep-2007  yamt sync with head.
 1.7.6.1 30-Dec-2006  yamt sync with head.
 1.8.8.1 11-Aug-2006  yamt sync with head
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.14.1 13-Mar-2007  ad Sync with head.
 1.9.10.1 24-Mar-2007  yamt sync with head.
 1.10.48.1 19-Oct-2008  haad Sync with HEAD.
 1.10.44.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.10.42.1 04-May-2009  yamt sync with head.
 1.10.38.1 28-Sep-2008  mjf Sync with HEAD.
 1.11.16.1 05-Mar-2011  rmind sync with head
 1.13.16.1 18-May-2014  rmind sync with head
 1.13.12.2 03-Dec-2017  jdolecek update from HEAD
 1.13.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.4 02-Dec-2023  thorpej Use vmem(9) rather than extent(9) to manage the GAPS PCI DMA buffer.
 1.3 21-Nov-2010  tsutsui Split softc/device_t.
 1.2 01-Feb-2001  marcus branches: 1.2.2; 1.2.154;
Fixed the last raw accesses to use bus_space. Also added DMA mem size field.
 1.1 01-Feb-2001  thorpej GAPS PCI bridge support. Low-level stuff from Marcus, bus_dma
implementation from me.
 1.2.154.1 05-Mar-2011  rmind sync with head
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 01-Feb-2001  bouyer file gapspcivar.h was added on branch thorpej_scsipi on 2001-02-11 19:09:16 +0000
 1.9 18-Jul-2018  sevan Be consistent among ethernet drivers on the convention for printing ethernet
addresses.

NFC
 1.8 19-Jul-2011  dyoung branches: 1.8.52; 1.8.54;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.7 12-Apr-2008  tsutsui Split device_t/softc for MI mb86960, with misc cosmetics.
 1.6 12-Mar-2007  tsutsui branches: 1.6.38;
IRL line connected to each device on sysasic is not always corresponding
with MI IPL_* definitions, so add an independent arg to pass IRL lines
to sysasic_intr_establish() and use appropriate macro for them.
 1.5 11-Dec-2005  christos branches: 1.5.26; 1.5.30;
merge ktrace-lwp.
 1.4 19-Feb-2005  tsutsui branches: 1.4.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.3 05-Feb-2003  tsutsui branches: 1.3.2; 1.3.10; 1.3.12;
It seems the LAN Adapter on dreamcast actually uses slow 150ns SRAM,
so handle it properly by an additional quirk flag in sc_flags.

The problem was reported by Pat Wendorf on port-dreamcast, and
the fix was suggested and confirmed by Christian Groessler.
 1.2 04-Jan-2003  tsutsui Check chip type first in mbe_g2_detect() to reduce unexpected device access
in mbe_g2_match() when the device does not exist.
 1.1 27-Dec-2002  tsutsui branches: 1.1.2;
Add support for SEGA LAN Adapter, MB86967 based Ethernet adapter.
Based on the patches in port-dreamcast/17493 by Christian Groessler,
with several modification by me.
 1.1.2.3 07-Jan-2003  thorpej Sync with HEAD.
 1.1.2.2 29-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 27-Dec-2002  thorpej file if_mbe_g2.c was added on branch nathanw_sa on 2002-12-29 19:21:39 +0000
 1.3.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.10.1 29-Apr-2005  kent sync with -current
 1.3.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.6.1 03-Sep-2007  yamt sync with head.
 1.5.30.1 13-Mar-2007  ad Sync with head.
 1.5.26.1 24-Mar-2007  yamt sync with head.
 1.6.38.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.54.1 10-Jun-2019  christos Sync with HEAD
 1.8.52.1 28-Jul-2018  pgoyette Sync with HEAD
 1.57 05-Jul-2022  andvar s/retrys/retries/ in comments.
 1.56 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

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

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.55 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.54 24-Apr-2021  thorpej branches: 1.54.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.53 06-May-2019  ryo branches: 1.53.12;
cv_init() must be done before calling maple_scanbus().
ok tsutsui@
 1.52 06-Dec-2015  tsutsui branches: 1.52.18;
Convert tsleep(9)/wakeup(9) pairs to condvar(9) with mutex(9).

Briefly tested with mkbd(4).
 1.51 25-Jul-2014  dholland branches: 1.51.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.50 27-Mar-2014  christos branches: 1.50.2;
correct/add protection against snprintf overflow.
 1.49 26-Mar-2014  christos kill sprintf
 1.48 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.47 14-Mar-2014  martin Remove unused variables
 1.46 13-Oct-2013  riz Catch up to recent changes in config_pending_{incr,decr}().
 1.45 27-Oct-2012  chs branches: 1.45.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.44 19-Jul-2011  dyoung branches: 1.44.2; 1.44.12;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.43 12-Nov-2010  uebayasi Pull in uvm/uvm.h where UVM's page level interface is used.
 1.42 17-Oct-2010  tsutsui Include "ioconf.h" for struct cfdriver.
 1.41 17-Oct-2010  tsutsui Split device_t/softc.
 1.40 19-Oct-2008  mjf branches: 1.40.14; 1.40.16;
Fix debug code that had bitrotted. This allows the maple(4) driver to
be compiled with MAPLE_DEBUG defined.

o line 798: variable buf shadows previous local
o line 1425: event_thread is no longer a struct proc but now is
a lwp_t. Use the correct p_pid member.
 1.39 01-Aug-2008  marcus sysasic_intr_string() takes an IRL, not an IPL.
 1.38 08-Jun-2008  tsutsui branches: 1.38.4;
Use device_lookup_private() to get softc.
 1.37 04-Jun-2008  ad vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.
 1.36 28-Apr-2008  martin branches: 1.36.2;
Remove clause 3 and 4 from TNF licenses
 1.35 17-Oct-2007  garbled branches: 1.35.16; 1.35.18; 1.35.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.34 09-Jul-2007  ad branches: 1.34.10;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.33 12-Mar-2007  tsutsui branches: 1.33.2; 1.33.8;
IRL line connected to each device on sysasic is not always corresponding
with MI IPL_* definitions, so add an independent arg to pass IRL lines
to sysasic_intr_establish() and use appropriate macro for them.
 1.32 04-Mar-2007  christos branches: 1.32.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.31 11-Dec-2005  christos branches: 1.31.26;
merge ktrace-lwp.
 1.30 26-Aug-2005  drochner s/locdesc_t/int/g
 1.29 03-Jul-2005  he branches: 1.29.2;
Make the prototype declaration of maplesubmatch() match the function decl.
 1.28 28-Jun-2005  drochner convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)
 1.27 19-Feb-2005  tsutsui - u_intNN_t -> uintNN_t
- ANSI function decls
- ntohl -> be32toh, htonl -> htobe32, htons -> htobe16
- bcopy -> memcpy, bcmp -> memcmp, bzero -> memset
- some KNF
 1.26 15-Jul-2003  lukem branches: 1.26.8; 1.26.10;
__KERNEL_RCSID()
 1.25 15-Feb-2003  itohy branches: 1.25.2;
constify command buffer
 1.24 11-Feb-2003  itohy Tweak unit ping (removal detect) code to work around problems
with some 3rd party memory cards.
 1.23 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.22 06-Dec-2002  itohy Pass devinfo of the base device (subunit == 0 of the same port)
to sub-drivers.
 1.21 15-Nov-2002  itohy New Maple Bus driver
- interrupt driven
- support hot swapping
- sub-drivers can send commands
 1.20 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.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 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.15 27-Sep-2002  thorpej When in a match routine, the cfdata we're passed always references
our own cfdriver, so don't bother comparing the names, since they
will always match.
 1.14 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.13 02-Jun-2002  drochner branches: 1.13.2;
move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
 1.12 25-Mar-2002  uch branches: 1.12.2;
ANSIfy, KNF
 1.11 24-Mar-2002  uch adapted to new interrupt code and shb changes.
 1.10 04-Dec-2001  atatat Fixes to eliminate some compiler complaints, such as:

suggest explicit braces to avoid ambiguous `else'
suggest parentheses around assignment used as truth value
 1.9 22-Jul-2001  wiz branches: 1.9.2;
bcopy -> memcpy, bzero -> memset
 1.8 26-May-2001  chs branches: 1.8.2;
replace vm_page_t with struct vm_page *.
 1.7 26-May-2001  marcus Changed maple device to attach per function instead of per unit.
Raw maple unit access is now possible through /dev/maple*.
 1.6 16-Mar-2001  marcus sc_port_units was set incorrectly at probe time.
 1.5 03-Feb-2001  marcus branches: 1.5.2; 1.5.4;
Added subunit scan.
 1.4 31-Jan-2001  thorpej Make the "maple" bus a direct config bus. Now, when a device is
not configured into the kernel, you know about it, e.g.:

Dreamcast Controller at maple0 port 0 not configured
 1.3 21-Jan-2001  marcus Corrected license text.
 1.2 19-Jan-2001  marcus Better DMA allocator (thanks to Jason R. Thorpe).
 1.1 16-Jan-2001  marcus Maple bus driver.
 1.5.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.5.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.5.2.2 27-Mar-2001  bouyer Sync with HEAD.
 1.5.2.1 03-Feb-2001  bouyer file maple.c was added on branch thorpej_scsipi on 2001-03-27 15:30:39 +0000
 1.8.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.8.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.1 03-Aug-2001  lukem update to -current
 1.9.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.12.2.2 14-Jul-2002  gehenna catch up with -current.
 1.12.2.1 17-May-2002  gehenna Add device switch.
 1.13.2.6 03-Jan-2003  thorpej Sync with HEAD.
 1.13.2.5 11-Dec-2002  thorpej Sync with HEAD.
 1.13.2.4 11-Nov-2002  nathanw Catch up to -current
 1.13.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.13.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.13.2.1 02-Jun-2002  nathanw file maple.c was added on branch nathanw_sa on 2002-09-17 21:14:12 +0000
 1.25.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.25.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.25.2.4 17-Jan-2005  skrll Adapt to branch.
 1.25.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.26.8.1 29-Apr-2005  kent sync with -current
 1.29.2.2 03-Sep-2007  yamt sync with head.
 1.29.2.1 21-Jun-2006  yamt sync with head.
 1.31.26.2 24-Mar-2007  yamt sync with head.
 1.31.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.32.2.2 15-Jul-2007  ad Sync with head.
 1.32.2.1 13-Mar-2007  ad Sync with head.
 1.33.8.1 03-Oct-2007  garbled Sync with HEAD
 1.33.2.1 11-Jul-2007  mjf Sync with head.
 1.34.10.1 06-Nov-2007  matt sync with HEAD
 1.35.20.2 04-May-2009  yamt sync with head.
 1.35.20.1 16-May-2008  yamt sync with head.
 1.35.18.2 17-Jun-2008  yamt sync with head.
 1.35.18.1 18-May-2008  yamt sync with head.
 1.35.16.5 17-Jan-2009  mjf Sync with HEAD.
 1.35.16.4 28-Sep-2008  mjf Sync with HEAD.
 1.35.16.3 29-Jun-2008  mjf Sync with HEAD.
 1.35.16.2 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.35.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.36.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.36.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.38.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.38.4.1 19-Oct-2008  haad Sync with HEAD.
 1.40.16.1 05-Mar-2011  rmind sync with head
 1.40.14.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.44.12.3 03-Dec-2017  jdolecek update from HEAD
 1.44.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.44.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.44.2.1 30-Oct-2012  yamt sync with head
 1.45.2.1 18-May-2014  rmind sync with head
 1.50.2.1 10-Aug-2014  tls Rebase.
 1.51.4.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.52.18.1 10-Jun-2019  christos Sync with HEAD
 1.53.12.2 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.53.12.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.54.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.12 17-Oct-2010  tsutsui Split device_t/softc.
 1.11 28-Apr-2008  martin branches: 1.11.20; 1.11.22;
Remove clause 3 and 4 from TNF licenses
 1.10 04-Mar-2007  christos branches: 1.10.40; 1.10.42; 1.10.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 11-Dec-2005  christos branches: 1.9.26;
merge ktrace-lwp.
 1.8 19-Feb-2005  tsutsui branches: 1.8.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.7 15-Feb-2003  itohy branches: 1.7.2; 1.7.10; 1.7.12;
constify command buffer
 1.6 06-Dec-2002  itohy The value of di_connector_direction is 1 for Dreamcast Gun, 0 for
other devices. It looks like that the value represents the direction
of expansion units (Visual Memory, etc.).
Add definition of the directions.
 1.5 15-Nov-2002  itohy New Maple Bus driver
- interrupt driven
- support hot swapping
- sub-drivers can send commands
 1.4 25-Mar-2002  uch branches: 1.4.6;
ANSIfy, KNF
 1.3 26-May-2001  marcus branches: 1.3.2;
Changed maple device to attach per function instead of per unit.
Raw maple unit access is now possible through /dev/maple*.
 1.2 21-Jan-2001  marcus branches: 1.2.2; 1.2.4;
Corrected license text.
 1.1 16-Jan-2001  marcus Maple bus driver.
 1.2.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.2 21-Jan-2001  marcus Corrected license text.
 1.2.2.1 21-Jan-2001  marcus file maple.h was added on branch thorpej_scsipi on 2001-01-21 22:45:58 +0000
 1.3.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.6.2 11-Dec-2002  thorpej Sync with HEAD.
 1.4.6.1 25-Mar-2002  thorpej file maple.h was added on branch nathanw_sa on 2002-12-11 05:58:27 +0000
 1.7.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.10.1 29-Apr-2005  kent sync with -current
 1.7.2.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.2.1 17-Jan-2005  skrll Adapt to branch.
 1.8.6.2 03-Sep-2007  yamt sync with head.
 1.8.6.1 21-Jun-2006  yamt sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.44.1 16-May-2008  yamt sync with head.
 1.10.42.1 18-May-2008  yamt sync with head.
 1.10.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.22.1 05-Mar-2011  rmind sync with head
 1.11.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.6 06-Dec-2002  itohy Pass devinfo of the base device (subunit == 0 of the same port)
to sub-drivers.
 1.5 15-Nov-2002  itohy New Maple Bus driver
- interrupt driven
- support hot swapping
- sub-drivers can send commands
 1.4 25-Mar-2002  uch branches: 1.4.6;
ANSIfy, KNF
 1.3 26-May-2001  marcus branches: 1.3.2;
Changed maple device to attach per function instead of per unit.
Raw maple unit access is now possible through /dev/maple*.
 1.2 21-Jan-2001  marcus branches: 1.2.2; 1.2.4;
Corrected license text.
 1.1 16-Jan-2001  marcus Maple bus driver.
 1.2.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.2 21-Jan-2001  marcus Corrected license text.
 1.2.2.1 21-Jan-2001  marcus file mapleconf.h was added on branch thorpej_scsipi on 2001-01-21 22:45:59 +0000
 1.3.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.6.2 11-Dec-2002  thorpej Sync with HEAD.
 1.4.6.1 25-Mar-2002  thorpej file mapleconf.h was added on branch nathanw_sa on 2002-12-11 05:58:27 +0000
 1.1 26-May-2001  marcus branches: 1.1.2; 1.1.20;
Changed maple device to attach per function instead of per unit.
Raw maple unit access is now possible through /dev/maple*.
 1.1.20.2 26-May-2001  marcus Changed maple device to attach per function instead of per unit.
Raw maple unit access is now possible through /dev/maple*.
 1.1.20.1 26-May-2001  marcus file mapleio.h was added on branch nathanw_sa on 2001-05-26 19:04:40 +0000
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 19-Feb-2005  tsutsui - u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.3 25-Mar-2002  uch branches: 1.3.6; 1.3.12; 1.3.20; 1.3.22;
ANSIfy, KNF
 1.2 21-Jan-2001  marcus branches: 1.2.2; 1.2.6;
Corrected license text.
 1.1 16-Jan-2001  marcus Maple bus driver.
 1.2.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 21-Jan-2001  marcus Corrected license text.
 1.2.2.1 21-Jan-2001  marcus file maplereg.h was added on branch thorpej_scsipi on 2001-01-21 22:45:59 +0000
 1.3.22.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.20.1 29-Apr-2005  kent sync with -current
 1.3.12.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.6.2 25-Mar-2002  uch ANSIfy, KNF
 1.3.6.1 25-Mar-2002  uch file maplereg.h was added on branch nathanw_sa on 2002-03-25 18:59:41 +0000
 1.15 06-Dec-2015  tsutsui Convert tsleep(9)/wakeup(9) pairs to condvar(9) with mutex(9).

Briefly tested with mkbd(4).
 1.14 27-Oct-2012  chs branches: 1.14.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.13 17-Oct-2010  tsutsui branches: 1.13.8; 1.13.18;
Split device_t/softc.
 1.12 28-Apr-2008  martin branches: 1.12.20; 1.12.22;
Remove clause 3 and 4 from TNF licenses
 1.11 17-Oct-2007  garbled branches: 1.11.16; 1.11.18; 1.11.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.10 09-Jul-2007  ad branches: 1.10.10;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.9 11-Dec-2005  christos branches: 1.9.30; 1.9.32; 1.9.38;
merge ktrace-lwp.
 1.8 19-Feb-2005  tsutsui branches: 1.8.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.7 15-Feb-2003  itohy branches: 1.7.2; 1.7.10; 1.7.12;
constify command buffer
 1.6 11-Feb-2003  itohy Tweak unit ping (removal detect) code to work around problems
with some 3rd party memory cards.
 1.5 15-Nov-2002  itohy New Maple Bus driver
- interrupt driven
- support hot swapping
- sub-drivers can send commands
 1.4 26-May-2001  marcus branches: 1.4.18;
Changed maple device to attach per function instead of per unit.
Raw maple unit access is now possible through /dev/maple*.
 1.3 03-Feb-2001  marcus branches: 1.3.2; 1.3.4;
Added subunit scan.
 1.2 21-Jan-2001  marcus Corrected license text.
 1.1 16-Jan-2001  marcus Maple bus driver.
 1.3.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.2.2 03-Feb-2001  marcus Added subunit scan.
 1.3.2.1 03-Feb-2001  marcus file maplevar.h was added on branch thorpej_scsipi on 2001-02-03 23:25:52 +0000
 1.4.18.2 11-Dec-2002  thorpej Sync with HEAD.
 1.4.18.1 26-May-2001  thorpej file maplevar.h was added on branch nathanw_sa on 2002-12-11 05:58:27 +0000
 1.7.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.10.1 29-Apr-2005  kent sync with -current
 1.7.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.6.1 03-Sep-2007  yamt sync with head.
 1.9.38.1 03-Oct-2007  garbled Sync with HEAD
 1.9.32.1 11-Jul-2007  mjf Sync with head.
 1.9.30.1 15-Jul-2007  ad Sync with head.
 1.10.10.1 06-Nov-2007  matt sync with HEAD
 1.11.20.1 16-May-2008  yamt sync with head.
 1.11.18.1 18-May-2008  yamt sync with head.
 1.11.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.22.1 05-Mar-2011  rmind sync with head
 1.12.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.13.18.2 03-Dec-2017  jdolecek update from HEAD
 1.13.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.13.8.1 30-Oct-2012  yamt sync with head
 1.14.14.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.32 18-Sep-2021  tsutsui Remove unnecessary (and unimplemented) WSKBD_*BELL ioctls in kbd drivers.

It looks the only ioctl(4) to be implemented for WSKBDIO_*BELL in
the backend keyboard driver is WSKBDIO_COMPLEXBELL.
All other BELL ioctls (WSKBDIO_BELL, WSKBDIO_SETBELL, WSKBDIO_GETBELL,
WSKBDIO_SETDEFAULTBELL, and WSKBDIO_GETDEFAULTBELL) are handled in the
MI wskbd driver (in wskbd_displayioctl() in src/sys/dev/wscons/wskbd.c).
 1.31 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.30 24-Apr-2021  thorpej branches: 1.30.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.29 19-Jul-2011  dyoung branches: 1.29.68;
Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark dreamcast/bus.h obsolete.
 1.28 17-Oct-2010  tsutsui Split device_t/softc.
 1.27 19-Oct-2008  marcus branches: 1.27.14; 1.27.16;
Removed a local variable that is no longer needed (should have been removed in last commit...)
 1.26 19-Oct-2008  marcus Replaced funky delay loop with a call to DELAY (fixed problems with newer GCCs).
 1.25 17-Oct-2007  garbled branches: 1.25.16; 1.25.20; 1.25.26;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.24 16-Jul-2007  marcus branches: 1.24.10;
Fixed incorrect logic in mkbd_cngetc() (fixes port-dreamcast/28711).
 1.23 04-Mar-2007  christos branches: 1.23.2; 1.23.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 11-Dec-2005  christos branches: 1.22.26;
merge ktrace-lwp.
 1.21 06-Mar-2005  tsutsui branches: 1.21.4;
Add two options to change the default keymap:
- options MKBD_LAYOUT="KB_xx"
allow user to override the default keymap
- options MKBD_SWAPCTRLCAPS
allow user to specify swapctrlcaps with the default (probed) keymap
 1.20 19-Feb-2005  tsutsui - u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.19 15-Jul-2003  lukem branches: 1.19.8; 1.19.10;
__KERNEL_RCSID()
 1.18 10-Dec-2002  itohy branches: 1.18.6;
Use WSKBD_TYPE_MAPLE.
 1.17 15-Nov-2002  itohy New Maple Bus driver
- interrupt driven
- support hot swapping
- sub-drivers can send commands
 1.16 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL
 1.15 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 25-Mar-2002  uch branches: 1.13.6;
ANSIfy, KNF
 1.12 17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.11 04-Dec-2001  atatat Fixes to eliminate some compiler complaints, such as:

suggest explicit braces to avoid ambiguous `else'
suggest parentheses around assignment used as truth value
 1.10 06-Sep-2001  thorpej Indent.
 1.9 22-Jul-2001  wiz bcopy -> memcpy, bzero -> memset
 1.8 26-May-2001  marcus branches: 1.8.2;
Changed maple device to attach per function instead of per unit.
Raw maple unit access is now possible through /dev/maple*.
 1.7 02-Mar-2001  marcus branches: 1.7.2;
Harmonized keycodes with USB.
 1.6 22-Feb-2001  msaitoh fix a check code whether mkbs is console or not
 1.5 02-Feb-2001  thorpej branches: 1.5.2;
Don't make the reporting of the keyboard type a parenthetical.
 1.4 31-Jan-2001  thorpej Set the keyboard layout based on what type of keyboard
we probe, defaulting to Japanese if we don't know what
kind of keyboard we have.

XXX This should be done differently, if we ever want to
support multiple keyboards.
 1.3 31-Jan-2001  thorpej Recognize the US keyboard.
 1.2 21-Jan-2001  marcus Fixed double-stroke bug.
 1.1 16-Jan-2001  marcus Maple bus keyboard driver.
 1.5.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.5.2.1 02-Feb-2001  bouyer file mkbd.c was added on branch thorpej_scsipi on 2001-03-12 13:28:07 +0000
 1.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.2.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.8.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.8.2.1 03-Aug-2001  lukem update to -current
 1.13.6.3 11-Dec-2002  thorpej Sync with HEAD.
 1.13.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.13.6.1 25-Mar-2002  nathanw file mkbd.c was added on branch nathanw_sa on 2002-10-18 02:36:22 +0000
 1.18.6.6 08-Mar-2005  skrll Sync with HEAD.
 1.18.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.18.6.4 17-Jan-2005  skrll Adapt to branch.
 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.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.8.1 29-Apr-2005  kent sync with -current
 1.21.4.2 03-Sep-2007  yamt sync with head.
 1.21.4.1 21-Jun-2006  yamt sync with head.
 1.22.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.10.1 03-Oct-2007  garbled Sync with HEAD
 1.23.2.1 20-Aug-2007  ad Sync with HEAD.
 1.24.10.1 06-Nov-2007  matt sync with HEAD
 1.25.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.25.20.1 04-May-2009  yamt sync with head.
 1.25.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.27.16.1 05-Mar-2011  rmind sync with head
 1.27.14.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.29.68.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.30.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 05-Jul-2002  tsutsui Add keydescs for swapctrlcaps, and clean up formating.
 1.5 02-Mar-2001  marcus branches: 1.5.4; 1.5.14; 1.5.18;
Harmonized keycodes with USB.
 1.4 31-Jan-2001  thorpej branches: 1.4.2;
Add a US keyboard map. This may need to be reworked, as this
uses the Japanese keyboard map as the base.
 1.3 21-Jan-2001  marcus Corrected license text.
 1.2 16-Jan-2001  marcus Added keymap for European keyboards.
 1.1 16-Jan-2001  marcus Maple bus keyboard driver.
 1.4.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.4.2.1 31-Jan-2001  bouyer file mkbdmap.h was added on branch thorpej_scsipi on 2001-03-12 13:28:07 +0000
 1.5.18.1 01-Aug-2002  nathanw Catch up to -current.
 1.5.14.1 16-Jul-2002  gehenna catch up with -current.
 1.5.4.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.7 17-Oct-2010  tsutsui Split device_t/softc.
 1.6 11-Dec-2005  christos branches: 1.6.98; 1.6.100;
merge ktrace-lwp.
 1.5 19-Feb-2005  tsutsui - u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.4 15-Nov-2002  itohy branches: 1.4.6; 1.4.14; 1.4.16;
New Maple Bus driver
- interrupt driven
- support hot swapping
- sub-drivers can send commands
 1.3 25-Mar-2002  uch branches: 1.3.6;
ANSIfy, KNF
 1.2 21-Jan-2001  marcus branches: 1.2.2; 1.2.6;
Corrected license text.
 1.1 16-Jan-2001  marcus Maple bus keyboard driver.
 1.2.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 21-Jan-2001  marcus Corrected license text.
 1.2.2.1 21-Jan-2001  marcus file mkbdvar.h was added on branch thorpej_scsipi on 2001-01-21 22:45:59 +0000
 1.3.6.2 11-Dec-2002  thorpej Sync with HEAD.
 1.3.6.1 25-Mar-2002  thorpej file mkbdvar.h was added on branch nathanw_sa on 2002-12-11 05:58:28 +0000
 1.4.16.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.14.1 29-Apr-2005  kent sync with -current
 1.4.6.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.100.1 05-Mar-2011  rmind sync with head
 1.6.98.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.18 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.17 26-Mar-2014  christos branches: 1.17.2;
kill sprintf
 1.16 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.15 14-Mar-2014  martin Remove unused variables
 1.14 17-Oct-2010  tsutsui branches: 1.14.8; 1.14.18; 1.14.22;
Include "ioconf.h" for struct cfdriver.
 1.13 17-Oct-2010  tsutsui Split device_t/softc.
 1.12 24-Feb-2010  dyoung branches: 1.12.2;
Use device_t, device_private().
 1.11 11-Jun-2008  tsutsui branches: 1.11.16;
Use device_lookup_private() to get softc.
 1.10 08-Jun-2008  tsutsui branches: 1.10.2;
Use device_lookup_private() to get softc.
 1.9 28-Apr-2008  martin branches: 1.9.2;
Remove clause 3 and 4 from TNF licenses
 1.8 04-Mar-2007  christos branches: 1.8.40; 1.8.42; 1.8.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 28-Mar-2006  thorpej branches: 1.7.14;
Use device_unit().
 1.6 24-Dec-2005  perry branches: 1.6.4; 1.6.6; 1.6.8; 1.6.10; 1.6.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 19-Feb-2005  tsutsui branches: 1.4.6;
- u_intNN_t -> uintNN_t
- ANSI function decls
- ntohl -> be32toh, htonl -> htobe32, htons -> htobe16
- bcopy -> memcpy, bcmp -> memcmp, bzero -> memset
- some KNF
 1.3 15-Jul-2003  lukem branches: 1.3.8; 1.3.10;
__KERNEL_RCSID()
 1.2 06-Dec-2002  itohy branches: 1.2.2; 1.2.8;
The buf structure (<sys/buf.h>) is not flexible since it is designed for disks,
and use home-grown buffer structure.

Handle display orientation (normal or upside-down) appropriately
by making use of devinfo of base device.
If the LCD is at an expansion slot of a base unit
whose di_connector_direction == MAPLE_CONN_TOP,
the driver automatically rotates the bitmap.
You need not rotate the bitmap before passing to the driver (spec change).
 1.1 15-Nov-2002  itohy Maple Bus monochrome LCD device driver
Reference: US Patent 6,338,105
 1.2.8.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.8.4 17-Jan-2005  skrll Adapt to branch.
 1.2.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.8.1 03-Aug-2004  skrll Sync with HEAD
 1.2.2.2 11-Dec-2002  thorpej Sync with HEAD.
 1.2.2.1 06-Dec-2002  thorpej file mlcd.c was added on branch nathanw_sa on 2002-12-11 05:58:28 +0000
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.6.2 03-Sep-2007  yamt sync with head.
 1.4.6.1 21-Jun-2006  yamt sync with head.
 1.6.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.6.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.6.8.1 01-Apr-2006  yamt sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.44.3 11-Mar-2010  yamt sync with head
 1.8.44.2 04-May-2009  yamt sync with head.
 1.8.44.1 16-May-2008  yamt sync with head.
 1.8.42.2 17-Jun-2008  yamt sync with head.
 1.8.42.1 18-May-2008  yamt sync with head.
 1.8.40.2 29-Jun-2008  mjf Sync with HEAD.
 1.8.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.10.2.1 18-Jun-2008  simonb Sync with head.
 1.11.16.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.11.16.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.12.2.1 05-Mar-2011  rmind sync with head
 1.14.22.1 18-May-2014  rmind sync with head
 1.14.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.2.1 10-Aug-2014  tls Rebase.
 1.26 26-Apr-2015  mlelstv Use C99-style initializers for struct dkdriver.
 1.25 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.24 25-Jul-2014  dholland branches: 1.24.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.23 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.22 26-Mar-2014  christos branches: 1.22.2;
kill sprintf
 1.21 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.20 17-Oct-2010  tsutsui branches: 1.20.8; 1.20.18; 1.20.22;
Include "ioconf.h" for struct cfdriver.
 1.19 17-Oct-2010  tsutsui Split device_t/softc.
 1.18 13-Jan-2009  yamt branches: 1.18.4; 1.18.6;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.17 11-Jun-2008  tsutsui branches: 1.17.4;
Use device_lookup_private() to get softc.
 1.16 08-Jun-2008  tsutsui branches: 1.16.2;
Use device_lookup_private() to get softc.
 1.15 28-Apr-2008  martin branches: 1.15.2;
Remove clause 3 and 4 from TNF licenses
 1.14 17-Oct-2007  garbled branches: 1.14.16; 1.14.18; 1.14.20;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.13 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.12 29-Jul-2007  ad branches: 1.12.4; 1.12.6; 1.12.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.11 29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.10 06-Mar-2007  he branches: 1.10.2; 1.10.10; 1.10.12; 1.10.14;
Cast to char* before doing pointer arithmetic.
 1.9 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 28-Mar-2006  thorpej branches: 1.8.14;
Use device_unit().
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
merge ktrace-lwp.
 1.6 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.5 19-Feb-2005  tsutsui branches: 1.5.6;
- u_intNN_t -> uintNN_t
- ANSI function decls
- ntohl -> be32toh, htonl -> htobe32, htons -> htobe16
- bcopy -> memcpy, bcmp -> memcmp, bzero -> memset
- some KNF
 1.4 28-Oct-2004  yamt branches: 1.4.4; 1.4.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 06-Dec-2002  itohy branches: 1.2.2; 1.2.8;
minor changes
fix typo
 1.1 15-Nov-2002  itohy Maple Bus storage device driver
Reference: US Patent 6,338,105
 1.2.8.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.8.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.8.5 17-Jan-2005  skrll Adapt to branch.
 1.2.8.4 02-Nov-2004  skrll Sync with HEAD.
 1.2.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.8.1 03-Aug-2004  skrll Sync with HEAD
 1.2.2.2 11-Dec-2002  thorpej Sync with HEAD.
 1.2.2.1 06-Dec-2002  thorpej file mmemcard.c was added on branch nathanw_sa on 2002-12-11 05:58:28 +0000
 1.4.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.4.1 29-Apr-2005  kent sync with -current
 1.5.6.3 27-Oct-2007  yamt sync with head.
 1.5.6.2 03-Sep-2007  yamt sync with head.
 1.5.6.1 21-Jun-2006  yamt sync with head.
 1.7.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.7.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.8.1 01-Apr-2006  yamt sync with head.
 1.7.6.1 22-Apr-2006  simonb Sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.10.12.1 07-Aug-2007  matt Sync with HEAD.
 1.10.10.2 16-Oct-2007  garbled Sync with HEAD
 1.10.10.1 03-Oct-2007  garbled Sync with HEAD
 1.10.2.3 09-Oct-2007  ad Sync with head.
 1.10.2.2 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.10.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.12.8.1 14-Oct-2007  yamt sync with head.
 1.12.6.1 06-Nov-2007  matt sync with HEAD
 1.12.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.14.20.2 04-May-2009  yamt sync with head.
 1.14.20.1 16-May-2008  yamt sync with head.
 1.14.18.2 17-Jun-2008  yamt sync with head.
 1.14.18.1 18-May-2008  yamt sync with head.
 1.14.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.14.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.14.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.16.2.1 18-Jun-2008  simonb Sync with head.
 1.17.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.18.6.1 05-Mar-2011  rmind sync with head
 1.18.4.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.20.22.1 18-May-2014  rmind sync with head
 1.20.18.2 03-Dec-2017  jdolecek update from HEAD
 1.20.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.22.2.1 10-Aug-2014  tls Rebase.
 1.24.4.2 06-Jun-2015  skrll Sync with HEAD
 1.24.4.1 06-Apr-2015  skrll Sync with HEAD
 1.19 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.18 24-Apr-2021  thorpej branches: 1.18.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.17 27-Oct-2012  chs branches: 1.17.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.16 17-Oct-2010  tsutsui branches: 1.16.8; 1.16.18;
Make local functions static.
 1.15 17-Oct-2010  tsutsui Split device_t/softc.
 1.14 28-Apr-2008  martin branches: 1.14.20; 1.14.22;
Remove clause 3 and 4 from TNF licenses
 1.13 04-Mar-2007  christos branches: 1.13.40; 1.13.42; 1.13.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.12 12-Nov-2006  plunky branches: 1.12.4;
Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
 1.11 11-Dec-2005  christos branches: 1.11.20; 1.11.22;
merge ktrace-lwp.
 1.10 19-Feb-2005  tsutsui branches: 1.10.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.9 10-Dec-2003  tsutsui branches: 1.9.8; 1.9.10;
Invert Y-axis value for mms(4). From Yasushi Oshima on port-dreamcast.
 1.8 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 10-Dec-2002  itohy branches: 1.7.6;
Use use WSMOUSE_TYPE_MAPLE.
Enable periodic GETCOND only if the mouse is enabled.
 1.6 15-Nov-2002  itohy New Maple Bus driver
- interrupt driven
- support hot swapping
- sub-drivers can send commands
 1.5 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL
 1.4 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 17-Mar-2002  atatat branches: 1.2.8;
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.1 06-Sep-2001  thorpej branches: 1.1.4;
Driver for the Dreamcast mouse, based on the programming info
on Marcus's web site.

Not yet thoroughly tested, but does appear to generate events
that look okay.
 1.1.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.1.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 06-Sep-2001  thorpej file mms.c was added on branch kqueue on 2001-09-13 01:13:34 +0000
 1.2.8.3 11-Dec-2002  thorpej Sync with HEAD.
 1.2.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.8.1 17-Mar-2002  nathanw file mms.c was added on branch nathanw_sa on 2002-10-18 02:36:22 +0000
 1.7.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.6.4 17-Jan-2005  skrll Adapt to branch.
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.6.3 03-Sep-2007  yamt sync with head.
 1.10.6.2 30-Dec-2006  yamt sync with head.
 1.10.6.1 21-Jun-2006  yamt sync with head.
 1.11.22.1 10-Dec-2006  yamt sync with head.
 1.11.20.1 18-Nov-2006  ad Sync with head.
 1.12.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.13.44.1 16-May-2008  yamt sync with head.
 1.13.42.1 18-May-2008  yamt sync with head.
 1.13.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.22.1 05-Mar-2011  rmind sync with head
 1.14.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.16.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.16.8.1 30-Oct-2012  yamt sync with head
 1.17.52.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.18.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 25-Sep-2022  ryo arm side of aica(4) sometimes became unresponsive when audioplay was performed several times.

- disabled data cache at startup.
- compiled with cross-arm-none-eabi-gcc-8.3.0nb4 of pkg.
- added memset() in asm because gcc8 (and later) detects the zero clear part in
own bzero function and calls memset internally, and bzero were replaced with memset.
 1.5 06-May-2019  ryo branches: 1.5.2;
don't use tsleep() in interrupt context.
when the audio starts playing, initialization is performed on the aica arm driver side.
 1.4 04-Mar-2006  uwe branches: 1.4.160;
s/u_intN_t/uintN_t/
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.6;
merge ktrace-lwp.
 1.2 18-Sep-2004  itohy branches: 1.2.12;
Make sure the string dollar NetBSD doller is stored literally.
 1.1 24-Aug-2003  marcus branches: 1.1.4;
Added AICA sound driver contributed by Ryo Shimizu.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 24-Aug-2003  skrll file Makefile was added on branch ktrace-lwp on 2004-08-03 10:33:53 +0000
 1.2.12.1 21-Jun-2006  yamt sync with head.
 1.3.6.1 22-Apr-2006  simonb Sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.160.1 10-Jun-2019  christos Sync with HEAD
 1.5.2.1 20-Apr-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1628):

sys/arch/dreamcast/dev/microcode/aica_armcode.h: revision 1.5
sys/arch/dreamcast/dev/microcode/aica_arm_locore.S: revision 1.4
sys/arch/dreamcast/dev/microcode/aica_arm_locore.S: revision 1.5
sys/arch/dreamcast/dev/microcode/Makefile: revision 1.6
sys/arch/dreamcast/dev/microcode/aica_arm.c: revision 1.7
sys/arch/dreamcast/dev/microcode/aica_arm.c: revision 1.8

arm side of aica(4) sometimes became unresponsive when audioplay was performed several times.
- disabled data cache at startup.
- compiled with cross-arm-none-eabi-gcc-8.3.0nb4 of pkg.
- added memset() in asm because gcc8 (and later) detects the zero clear part in
own bzero function and calls memset internally, and bzero were replaced with memset.
improve comment, update mailaddr, and remove clause 3 from my licenses.
 1.9 07-Feb-2024  msaitoh Remove ryo@'s mail addresses.
 1.8 25-Sep-2022  ryo improve comment, update mailaddr, and remove clause 3 from my licenses.
 1.7 25-Sep-2022  ryo arm side of aica(4) sometimes became unresponsive when audioplay was performed several times.

- disabled data cache at startup.
- compiled with cross-arm-none-eabi-gcc-8.3.0nb4 of pkg.
- added memset() in asm because gcc8 (and later) detects the zero clear part in
own bzero function and calls memset internally, and bzero were replaced with memset.
 1.6 06-May-2019  ryo branches: 1.6.2;
don't use tsleep() in interrupt context.
when the audio starts playing, initialization is performed on the aica arm driver side.
 1.5 18-Mar-2009  cegger branches: 1.5.64;
Ansify function definitions w/o arguments. Generated with sed.
 1.4 24-Dec-2005  perry branches: 1.4.78; 1.4.86; 1.4.92;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 19-Feb-2005  tsutsui branches: 1.2.6;
- u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.1 24-Aug-2003  marcus branches: 1.1.4; 1.1.10; 1.1.12;
Added AICA sound driver contributed by Ryo Shimizu.
 1.1.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.10.1 29-Apr-2005  kent sync with -current
 1.1.4.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 24-Aug-2003  skrll file aica_arm.c was added on branch ktrace-lwp on 2004-08-03 10:33:53 +0000
 1.2.6.1 21-Jun-2006  yamt sync with head.
 1.4.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.5.64.1 10-Jun-2019  christos Sync with HEAD
 1.6.2.1 20-Apr-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1628):

sys/arch/dreamcast/dev/microcode/aica_armcode.h: revision 1.5
sys/arch/dreamcast/dev/microcode/aica_arm_locore.S: revision 1.4
sys/arch/dreamcast/dev/microcode/aica_arm_locore.S: revision 1.5
sys/arch/dreamcast/dev/microcode/Makefile: revision 1.6
sys/arch/dreamcast/dev/microcode/aica_arm.c: revision 1.7
sys/arch/dreamcast/dev/microcode/aica_arm.c: revision 1.8

arm side of aica(4) sometimes became unresponsive when audioplay was performed several times.
- disabled data cache at startup.
- compiled with cross-arm-none-eabi-gcc-8.3.0nb4 of pkg.
- added memset() in asm because gcc8 (and later) detects the zero clear part in
own bzero function and calls memset internally, and bzero were replaced with memset.
improve comment, update mailaddr, and remove clause 3 from my licenses.
 1.7 09-Feb-2024  andvar fix spelling mistakes, mainly in comments and log messages.
 1.6 07-Feb-2024  msaitoh Remove ryo@'s mail addresses.
 1.5 25-Sep-2022  ryo improve comment, update mailaddr, and remove clause 3 from my licenses.
 1.4 25-Sep-2022  ryo arm side of aica(4) sometimes became unresponsive when audioplay was performed several times.

- disabled data cache at startup.
- compiled with cross-arm-none-eabi-gcc-8.3.0nb4 of pkg.
- added memset() in asm because gcc8 (and later) detects the zero clear part in
own bzero function and calls memset internally, and bzero were replaced with memset.
 1.3 06-May-2019  ryo branches: 1.3.2;
don't use tsleep() in interrupt context.
when the audio starts playing, initialization is performed on the aica arm driver side.
 1.2 11-Dec-2005  christos branches: 1.2.166;
merge ktrace-lwp.
 1.1 24-Aug-2003  marcus branches: 1.1.4;
Added AICA sound driver contributed by Ryo Shimizu.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 24-Aug-2003  skrll file aica_arm_locore.S was added on branch ktrace-lwp on 2004-08-03 10:33:53 +0000
 1.2.166.1 10-Jun-2019  christos Sync with HEAD
 1.3.2.1 20-Apr-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1628):

sys/arch/dreamcast/dev/microcode/aica_armcode.h: revision 1.5
sys/arch/dreamcast/dev/microcode/aica_arm_locore.S: revision 1.4
sys/arch/dreamcast/dev/microcode/aica_arm_locore.S: revision 1.5
sys/arch/dreamcast/dev/microcode/Makefile: revision 1.6
sys/arch/dreamcast/dev/microcode/aica_arm.c: revision 1.7
sys/arch/dreamcast/dev/microcode/aica_arm.c: revision 1.8

arm side of aica(4) sometimes became unresponsive when audioplay was performed several times.
- disabled data cache at startup.
- compiled with cross-arm-none-eabi-gcc-8.3.0nb4 of pkg.
- added memset() in asm because gcc8 (and later) detects the zero clear part in
own bzero function and calls memset internally, and bzero were replaced with memset.
improve comment, update mailaddr, and remove clause 3 from my licenses.
 1.5 25-Sep-2022  ryo arm side of aica(4) sometimes became unresponsive when audioplay was performed several times.

- disabled data cache at startup.
- compiled with cross-arm-none-eabi-gcc-8.3.0nb4 of pkg.
- added memset() in asm because gcc8 (and later) detects the zero clear part in
own bzero function and calls memset internally, and bzero were replaced with memset.
 1.4 06-May-2019  ryo branches: 1.4.2;
don't use tsleep() in interrupt context.
when the audio starts playing, initialization is performed on the aica arm driver side.
 1.3 11-Dec-2005  christos branches: 1.3.166;
merge ktrace-lwp.
 1.2 19-Feb-2005  tsutsui - u_intNN_t -> uintNN_t
- more ANSI function decls
- sone KNF
 1.1 24-Aug-2003  marcus branches: 1.1.4; 1.1.10; 1.1.12;
Added AICA sound driver contributed by Ryo Shimizu.
 1.1.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.10.1 29-Apr-2005  kent sync with -current
 1.1.4.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 24-Aug-2003  skrll file aica_armcode.h was added on branch ktrace-lwp on 2004-08-03 10:33:53 +0000
 1.3.166.1 10-Jun-2019  christos Sync with HEAD
 1.4.2.1 20-Apr-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1628):

sys/arch/dreamcast/dev/microcode/aica_armcode.h: revision 1.5
sys/arch/dreamcast/dev/microcode/aica_arm_locore.S: revision 1.4
sys/arch/dreamcast/dev/microcode/aica_arm_locore.S: revision 1.5
sys/arch/dreamcast/dev/microcode/Makefile: revision 1.6
sys/arch/dreamcast/dev/microcode/aica_arm.c: revision 1.7
sys/arch/dreamcast/dev/microcode/aica_arm.c: revision 1.8

arm side of aica(4) sometimes became unresponsive when audioplay was performed several times.
- disabled data cache at startup.
- compiled with cross-arm-none-eabi-gcc-8.3.0nb4 of pkg.
- added memset() in asm because gcc8 (and later) detects the zero clear part in
own bzero function and calls memset internally, and bzero were replaced with memset.
improve comment, update mailaddr, and remove clause 3 from my licenses.
 1.1 24-Aug-2003  marcus branches: 1.1.4;
Added AICA sound driver contributed by Ryo Shimizu.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 24-Aug-2003  skrll file ldscript was added on branch ktrace-lwp on 2004-08-03 10:33:53 +0000

RSS XML Feed