Home | History | Annotate | only in /src/sys/dev/tc
History log of /src/sys/dev/tc
RevisionDateAuthorComments
 1.12 18-Sep-2001  ad Beef up the stic X interface, and tighten a few screws here and there.
 1.11 30-Jun-2001  tron branches: 1.11.2; 1.11.4;
Install "dev/tc/sfbreg.h" which is required for building the Alpha X11
server.
 1.10 16-May-2001  ad Put back /usr/include/dev/tc/sticreg.h.
 1.9 11-Apr-2001  jdolecek Put back all header files defining ioctls
 1.8 11-Apr-2001  jdolecek Only install headers which are actually used by our userland. This
saves about 2.2MB under /usr/include/dev/. Discussed on tech-kern@
recently.

I HOPE to get the list right. The headers I left in are ones
used for MI tools and those whose usage I discovered by grep over tree sources.
Feel free to put needed includes back in if you encounter anything which
should not be removed from lists.
 1.7 17-Dec-2000  ad branches: 1.7.2;
Add wscons drivers for the DEC PixelStamp graphics accelerators.
 1.6 04-Jul-2000  nisimura Make sure to settle tcdsreg.h and tcdsvar.h in /usr/include/dev/tc/.
 1.5 24-Sep-1999  nisimura branches: 1.5.2;
Add 'sfbreg.h' to the list of files installed in /usr/include/dev/tc/.
 1.4 13-Apr-1999  ad Remove px driver pending write of fully-functional MI driver.
 1.3 16-Jun-1998  cgd branches: 1.3.10;
Point people to the correct Makefiles to build generated headers.
(Suggested by Manuel Bouyer.)
 1.2 12-Jun-1998  cgd Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.1 02-Mar-1996  cgd add ability to define TCVERBOSE, and get "human names" about "known"
but unconfigured (or unsupported) devices printed at boot time.
The device list is woefully incomplete, because i didn't put much time
in it, and because i don't know good "human names" for many TC devices.
 1.3.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.5.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.2.3 21-Sep-2001  nathanw Catch up to -current.
 1.7.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.11.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2 19-Oct-2008  apb Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.1 12-Jun-1998  cgd branches: 1.1.146; 1.1.150; 1.1.156;
Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.1.156.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.150.1 04-May-2009  yamt sync with head.
 1.1.146.1 17-Jan-2009  mjf Sync with HEAD.
 1.63 26-Aug-2001  simonb Switch to MI SCSI and drop old pmax MD SCSI support completely.
 1.62 25-Apr-2001  bouyer branches: 1.62.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.61 02-Nov-2000  mhitch branches: 1.61.2;
When a read DMA transfer is interrupted by a disconnect on the IOASIC SCSI
and the buffer is not 8-byte aligned, it leaves a partial transfer in the
SDRx registers. This could cause data corruption in dump(8) because the
read-ahead buffers are allocated on a non-aligned address. When the read
DMA transfer is interrupted and the current DMA position is not aligned,
call the dma_end() routine to flush the SDRx register contents to the
buffer.
 1.60 30-Mar-2000  augustss branches: 1.60.4;
Remove register declarations.
 1.59 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.58 14-Mar-2000  nisimura Unnecessary to enclose device driver body with #if NASC > 0.
 1.57 03-Feb-2000  nisimura Merge IOASIC register definitions.
 1.56 15-Nov-1999  nisimura - No need to include '<machine/autoconf.h>'.
- Nuke tc_badaddr() check from asc_tc because the existency check is already
done for real TC devices.
- Nuke tc_badaddr() check from asc_ioasic because it is a builtin device
found in all of IOASIC DECstations.
 1.55 18-Jun-1999  mhitch branches: 1.55.2; 1.55.8;
The extraneous interrupt that seems to occur after a reconnect and a DMA transfer
starts running can occur on both DMA in and DMA out. I missed the little comment
in the Mach driver for the DMA out case. Also, only ignore the interrupt if the
TC is non-zero (to match the Mach driver).
 1.54 13-Jun-1999  mhitch Don't pre-load the identify message into the fifo just just before the command register
is written. This significantly reduces, if not eliminates, the problem reported in
PR#5510. It stops the problem on my 5000/200, and two other people have verified that
it fixes the problem on their 5000/200s. I'm waiting for confirmation from the PR
originator before closing the PR.
 1.53 25-Apr-1999  simonb Shut 'gcc -Wuninitialized' up.
 1.52 12-Apr-1999  pk Quote "AS IS" as in the majority of Carnegy Mellon notices.
 1.51 06-Apr-1999  pk Fix a pasto in copyright text which has been procreating like rabbits..
 1.50 05-Dec-1998  mjacob branches: 1.50.4;
Update HBAs to incorporate the new max_lun property.
 1.49 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.48 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

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

Inspired by PR #6090, from Matt Jacob.
 1.47 13-Aug-1998  eeh Merge paddr_t changes into the main branch.
 1.46 08-May-1998  mhitch branches: 1.46.2;
Fix a problem that will reboot the system with no message as to what the
problem was. A collision between a select and reselect would leave TC
non-zero from the command-out DMA count, which could later be considered
a fatal condition, causing a reboot. The message for that error was
only displayed with DEBUG. Fixed by clearing TC on a reselect. The
non-zero TC detection won't occur in this case, so unconditionally
display the message if it occurs.

Workaround for another problem that resulted from an "Illegal Command"
status from the 53c94 which would get ignored and result in a timeout
(which also reboots the system). Added the missing check for the
illegal command status, and add the workaround of resending the "accept
message" command to the 53c94. Correct fix will be to determine why the
message wasn't sent in the first place. Abort if the resending the
command doesn't work.

Correctly detect a spurious interrupt and ignore it. This was taken
from a newer Mach driver, but did not get the check converted for the
design difference between the current NetBSD driver and the Mach driver.
 1.45 26-Mar-1998  thorpej don't use variables declared _inside_ DEBUG in code _outside_ DEBUG
 1.44 24-Mar-1998  mhitch Enable another error message before the driver reboots the machine. It was
not being printed if not compiled with DEBUG. Now all situtiations where
the driver gives up should display a message before the reboot.
 1.43 12-Jan-1998  thorpej Adjust for changes in config.
 1.42 28-Nov-1997  mhitch Fix driver bug when using an RZ23 (and very likely any other drive that
does a "restore data pointers" when reselected after disconnecting in
the middle of a DMA transfer). The driver needs a different way to know
which script to continue the DMA transfer. The message-in for the "restore
data pointers" loses the original "resume" script, and the driver would
attempt to continue the DMA transfer at the beginning of the current DMA
chunk, rather than at the point the disconnect occured. The result was a
spurious console message, and a trashed filesystem.
 1.41 27-Aug-1997  bouyer branches: 1.41.4;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.40 28-Jul-1997  mhitch branches: 1.40.2;
Use direct DMA with the IOASIC ASC SCSI interface. DMA buffering can be
re-enabled with ASC_IOASIC_BOUNCE.
All DMA buffered processing is now done in the bus-specific DMA routines
in asc_ioasic.c and asc_tc.c.
Disable several informational messages dealing with non-empty FIFO conditions,
but allow enabling with ASC_DIAGNOSTIC for troubleshooting.
 1.39 16-Jun-1997  jonathan branches: 1.39.2;
include <machine/bus.h>.
 1.38 07-Jun-1997  mhitch Fix another weird driver state. After sending the SCSI command to the target
after synch negotation during device probes, the 53C94 stops with the target
reqesting more command data. The fifo appears to still contain a couple of
bytes, so transfer them. If the target still wants command data after that,
do a transfer pad. The target seems to function normally after this. A
much better solution thant simply rebooting!
Also fix a problem when compiling with DIAGNOSTIC - a mismatch between using
DIAGNOSTIC and MACH_DIAGNOSTIC caused the compile to fail.
Try to start another target and a device disconnects.
 1.37 24-May-1997  jonathan lint: fix %x vs pointer and tyops in error-logging printfs.
 1.36 07-Apr-1997  jonathan Print explanatory message before each panic, or "goto abort" (which panics).
 1.35 06-Apr-1997  jonathan Commit message for previous revision (lost due to Ultrix-compat bug):

* Don't print DMA_OUT message in the `normal' case of a 16-byte residual.
* ioasic-connected 53c94 devices are always clocked at 25MHz even on
machines with 12.5MHz TurboChannel.
 1.34 06-Apr-1997  jonathan *** empty log message ***
 1.33 29-Mar-1997  mhitch A couple of missed boot() -> cpu_reboot() changes.
 1.32 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.31 13-Oct-1996  christos backout kprintf changes
 1.30 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.29 29-Sep-1996  jonathan Fix data-corruption bug on async targets:

* When we are transferring in DATA (in asc_dma_in) and the target
is an async device, there is sometimes an extra byte in the FIFO.
If so, we need to drain that byte out of the fifo, but if and only
if the target is async. See also the comments in asc_dma_in()
in the related Mach mk84 asc driver (scsi_53C94_hdw.c), which
has an identical fix but applied in more restrictive conditions
than we need, with async *disk* targets, as well as async tapes.

* Add a watchdog and timeout active SCSI requests, to eliminate any
potential for deadlock due to applying the fix above on newer
silicon versions of the 53c94 which may not have the above problem.
Should use the MI scsi per-target timeout instead, when available.
 1.28 25-Sep-1996  jonathan * Rewrite asc driver with ``mi'' backend and parent-specific front-end
cfattach code for TC SCSI option cards and ioasic 53c94 baseboard SCSI.
ascvar.h: shared softc declarations
asc_ioasic.c: ioasic front-end code.
asc_tc.c: Turbochannel option (and 5000/200 basebard) front-end code.
* ioasic_attach meeds more work to eliminate pmax_type dependency
and to verify the clocks speed passed to 53c94.
* Add prototypes for asc script entry points; should compile with
-Wstrict-prototypes -Wmissing-prototypes.
* Use tcvar.h interface. The usage of tc_syncbus() and tc_mb() may
not be quite stylistically on an Alhpa, but it apparently makes no
difference on the eerly-generation Alpha CPUs in TC Alphas.
 1.27 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.26 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.25 09-Aug-1996  mrg Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.
 1.24 30-Jul-1996  mhitch Remove the "goto abort" (which currently reboots the machine) when the
FIFO is non-empty when the message-in phase occurs before the DMA output
starts. This showed up on a Micropolis drive.
 1.23 16-Jul-1996  mhitch Don't flush the 53C94 fifo when starting dma_in. The fifo data is valid
at that point, and flushing the fifo will hang the system.
 1.22 11-Jun-1996  mhitch Try to avoid collisions with reselection when starting a new selection.
Enable reselections as soon as possible after a disconnect - prevents
losing a reselecting device.
Check for and ignore a spurious interrupt during a DMA input (from the
Mach driver).
 1.21 04-Jun-1996  mhitch Fix the oversight that the ASC SCSI adapter can also be on the
Turbochannel as well as the IOASIC. It should now work on the 5000/200.
Removed the "aborts" which could leave the disk trashed when the abort
rebooted the system. Fix the data corruption problem by clearing the
FIFO before starting a data transfer.
 1.20 29-May-1996  mhitch Fix the DECstation ASC SCSI driver autoconfiguration to more closely
match the alpha. The DS3100 will now configure properly. Also fix
the name in the cfdriver structure - somewhere it got changed from
"asc" to "as".
 1.19 20-May-1996  jonathan branches: 1.19.2;
* Fix formatstr/argument mismatches in diagnostic printf()s.
* Change MachEmptyWriteBuffer() to wbflush(). Should use TC mi names tc_mb(),
tc_wmb, tc_syncbus() but I'm not sure which each wbflush() should be.
* Add prototyped forward decl for asc_Dumplog() and add an explicit void
return type.
* Remove unused variables.
 1.18 18-Mar-1996  jonathan Additional fixes to complete the NetBSD/1.1B config changes:

Add new device-attach struct cfattach asc_ca and struct cfdriver asc_cd.
Change cfdriver references from "XXXcd" to "XXX_cd".
 1.17 02-Feb-1996  jonathan Resolve pmax and alpha IOCTL asic driver differences, pass 1:

Rename the ioctl asic register and slot macros from ASIC_<xxx> to
IOASIC_<xxx>, to be compatible with the machine-indpendent names in
sys/dev/tc/ioasicvar.h. The pmax code still uses
sys/arch/pmax/pmax/asic.h, as some of the registers and offsets
defined there are not yet defined in sys/dev/tc/ioasicvar.h.
Rename the ioctl asic base-address pointer from `asic_base' to `ioasic_base'.
Use the device address in the attach_args structure, instead of
using the deprecated BUS_CVTADDR macro.

Change the Mach derived asc driver to use "SCSI_PHASE_xxx" instead of
"ASC_PHASE_xxx", as the latest version of the Mach driver does.
 1.16 04-Jan-1996  jonathan Commit trivial changes from Mach MK84 to force sup'ables source to be updated:
Drop spurious interrupts in asc_intr(). Read back the pending SCSI command
so asc_intr() can add it to the asc SCSI log.
 1.15 13-Sep-1995  jonathan Rename the old pmax SCSI driver's "struct scsi_device" to
"struct pmax_scsi_device", to avoid name conflicts with the sys/dev/scsi
SCSI driver.
 1.14 11-Sep-1995  jonathan Rename the old 4.4bsd/pmax old-style config "struct device" to
"struct pmax_device" to avoid conflict with <sys/device.h>.

Change the signature of interrupt-handlers to take a void *
(a pointer to the softc) and return an int (indicating spurious
interrupts or other conditions.)
 1.13 21-Aug-1995  jonathan Change pmax ASC driver to use dynamically-allocated softc structures.
Concomitant changes to code that prints driver/unit name: use dv_xname
and dv_unit, instead of doing pointer arithmetic on elements of the static
softc array.

Remove support for old config. The old-config "driver" structure
is still present, because the pmax non-MI SCSI driver needs it.

Merge some off Per Fogelstrom's changes for the Pica driver,
which uses the machine-independent SCSI code. This is #ifdef'ed
out until the DMA is fixed to work on Decstations, too.
 1.12 10-Aug-1995  jonathan Update DECstation drivers to use new-style config, removing
old-style config support, except for SCSI disks and tapes.
 1.11 04-Aug-1995  jonathan Add preliminary support for new-style configuration: struct cfdriver,
and match and attach code. Still use the static softc so that drivers
work with kernels configured with either new or old config.
 1.10 05-Dec-1994  dean fix problem with disconnects (Ralph Campbell)
 1.9 01-Dec-1994  dean added missing #ifdef DEBUG
 1.8 28-Nov-1994  dean new asc.c from Ralph Campbell
 1.7 15-Nov-1994  dean Surrounded call to debug routine with #ifdef DEBUG
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 27-May-1994  glass bsd 4.4-lite pmax port as ported to NetBSD
 1.4 27-May-1994  glass upgrade to bsd 4.4-lite code base. only mod is rcsids
 1.3 15-Oct-1993  deraadt update from rick, tarfile of Oct 11 10:46
 1.2 12-Oct-1993  deraadt fixed two icky rcs-log's.
 1.1 12-Oct-1993  deraadt branches: 1.1.1;
Initial revision
 1.1.1.1 12-Oct-1993  deraadt pmax code from <ralphc@pyramid.com> & <rick@snowhite.cis.uoguelph.ca>
 1.19.2.6 05-Dec-1996  rat Apply 1.28 -> 1.29 plus tweaks for NetBSD 1.2 by request
from Jonathan Stone <jonathan@DSG.Stanford.EDU>
>. . . it fixes a serious data corruption bug . . .
 1.19.2.5 02-Aug-1996  jtc Pulled up from rev 1.24 by request from Jonathan Stone and Michael Hitch
 1.19.2.4 17-Jul-1996  jtc Pulled up from rev 1.23 by request from Michael Hitch
 1.19.2.3 11-Jun-1996  mhitch Pull up version 1.22 from trunk. Fix for a possible hang, and a reboot.
>Try to avoid collisions with reselection when starting a new selection.
>Enable reselections as soon as possible after a disconnect - prevents
>losing a reselecting device.
>Check for and ignore a spurious interrupt during a DMA input (from the
>Mach driver).
 1.19.2.2 04-Jun-1996  mhitch Pulled version 1.21 up from the trunk.
>Fix the oversight that the ASC SCSI adapter can also be on the
>Turbochannel as well as the IOASIC. It should now work on the 5000/200.
>Removed the "aborts" which could leave the disk trashed when the abort
>rebooted the system. Fix the data corruption problem by clearing the
>FIFO before starting a data transfer.
 1.19.2.1 30-May-1996  mhitch Pulled autoconfig fixes up from the trunk
 1.39.2.2 30-Jul-1997  bouyer Sync with trunk.
 1.39.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.40.2.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.41.4.2 31-Oct-1998  cgd pull up rev 1.46 from trunk (mhitch)
 1.41.4.1 28-Nov-1997  mellon Pull rev 1.42 up fromt runk (mhitch)
 1.46.2.1 30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.50.4.4 24-Jun-1999  perry pullup 1.54->1.55 (mhitch)
 1.50.4.3 23-Jun-1999  perry pullup 1.53->1.54 (mhitch)
 1.50.4.2 12-Apr-1999  pk branches: 1.50.4.2.2; 1.50.4.2.4;
Pullup copyright text corrections.
 1.50.4.1 07-Apr-1999  pk Pull up from trunk: copyright text warts.
 1.50.4.2.4.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

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

synchronization to latest KAME will take place on HEAD branch soon.
 1.50.4.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.55.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.55.2.3 29-Mar-2001  bouyer Port to thorpej_scsipi. This didn't compile with MI scsi anyway, but I prefer
to remove all references to sc_link/scsipi_link.
 1.55.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.55.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.60.4.1 02-Nov-2000  tv Pullup 1.61 [mhitch]:
When a read DMA transfer is interrupted by a disconnect on the IOASIC SCSI
and the buffer is not 8-byte aligned, it leaves a partial transfer in the
SDRx registers. This could cause data corruption in dump(8) because the
read-ahead buffers are allocated on a non-aligned address. When the read
DMA transfer is interrupted and the current DMA position is not aligned,
call the dma_end() routine to flush the SDRx register contents to the
buffer.
 1.61.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.61.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.62.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.24 26-Aug-2001  simonb Switch to MI SCSI and drop old pmax MD SCSI support completely.
 1.23 05-Nov-2000  mhitch branches: 1.23.2; 1.23.4;
When doing the cacheflush for MIPS1, adjust the length to account for
an unaligned buffer. The last word of the buffer was not getting flushed
if the buffer was unaligned and fit in a single DMA segment. Now dump(8)
works on both MIPS1 and MIPS3 DECstations.
 1.22 28-Sep-2000  mhitch Set up the physical addresses for DMAPTR/NEXTPTR before adjusting for
unaligned transfers and adjust the physical address to align the transfer.
If the buffer end just crossed the page boundary, the computation of the
NEXTPTR physical address resulted in using -1. The cleanup at the end of
the DMA transfer would try to copy the residual data to physical address
0x1ffffffc. This would silently corrupt data on the R3000 and usually
would hang the R4000.
 1.21 06-Mar-2000  mhitch branches: 1.21.4;
Get rid of hook for dk_establish() - pmax will now use device_register().
 1.20 04-Mar-2000  mhitch Fix boot device detection. Device probes are not done when adapters are
configured, but after all adapters have been configured. When multiple
adapters are present, only the last configured adapter could be matched
to the boot device slot. The adapter attach routines now check if that
adapter slot matches the boot device slot and saves the softc pointer
for that controller. Then when the disks are configured, dk_establish()
matches the appropriate controller.
 1.19 03-Feb-2000  nisimura Use bus_space_{write,read} for IOASIC register access.
 1.18 03-Dec-1999  mhitch Fix IOASIC DMA alignment problems. Buffers not aligned on doubleword (8
byte) boundaries don't work correctly. Make use of the SDR0/SDR1 registers
to adjust the buffer alignment when starting the DMA transfer. Block device
I/O done by the filesystems will usually be aligned correctly, but character
device I/O may not be aligned correctly. This should fix the problems with
dump(8) failing randomly on DECstations.
 1.17 15-Nov-1999  nisimura - No need to include '<machine/autoconf.h>'.
- Nuke tc_badaddr() check from asc_tc because the existency check is already
done for real TC devices.
- Nuke tc_badaddr() check from asc_ioasic because it is a builtin device
found in all of IOASIC DECstations.
 1.16 20-Apr-1999  mrg branches: 1.16.2; 1.16.8;
KNF nits.
 1.15 16-Jan-1999  nisimura branches: 1.15.2; 1.15.4;
- Don't use void pointer for arithmetic.
 1.14 13-Aug-1998  eeh Merge paddr_t changes into the main branch.
 1.13 27-May-1998  thorpej branches: 1.13.2;
We're the only driver that currently needs direct access to ioasic registers.
 1.12 12-Jan-1998  thorpej Adjust for changes in config.
 1.11 28-Jul-1997  mhitch Use direct DMA with the IOASIC ASC SCSI interface. DMA buffering can be
re-enabled with ASC_IOASIC_BOUNCE.
All DMA buffered processing is now done in the bus-specific DMA routines
in asc_ioasic.c and asc_tc.c.
Disable several informational messages dealing with non-empty FIFO conditions,
but allow enabling with ASC_DIAGNOSTIC for troubleshooting.
 1.10 21-Jul-1997  jonathan Kill __BROKEN_INDIRECT_CONFIG on pmax.
Based on a patch from Chris G. Demetriou, December 1996.
 1.9 22-Jun-1997  jonathan * Change Sprite MACH_xxx prefix to MIPS_xxx.

* Use standard mips terminology (xxx_KSEG0, xxx_KSEG1) instead of the
(more meaningful) Sprite names (xxx_CACHED, xxx_UNCACHED).
 1.8 21-Jun-1997  mhitch Changes for merged mips1/mips3.
Replace MachHitFlushDCache with mips3_HitFlushDCache.
 1.7 15-Jun-1997  mhitch More merged MIPS1/MIPS3 support.
 1.6 25-May-1997  jonathan lint: delete unused variables.
 1.5 06-Apr-1997  jonathan Commit message for previous revision (lost due to Ultrix-compat bug):

* Don't print DMA_OUT message in the `normal' case of a 16-byte residual.
* ioasic-connected 53c94 devices are always clocked at 25MHz even on
machines with 12.5MHz TurboChannel.
 1.4 06-Apr-1997  jonathan *** empty log message ***
 1.3 13-Oct-1996  christos backout kprintf changes
 1.2 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 25-Sep-1996  jonathan * Rewrite asc driver with ``mi'' backend and parent-specific front-end
cfattach code for TC SCSI option cards and ioasic 53c94 baseboard SCSI.
ascvar.h: shared softc declarations
asc_ioasic.c: ioasic front-end code.
asc_tc.c: Turbochannel option (and 5000/200 basebard) front-end code.
* ioasic_attach meeds more work to eliminate pmax_type dependency
and to verify the clocks speed passed to 53c94.
* Add prototypes for asc script entry points; should compile with
-Wstrict-prototypes -Wmissing-prototypes.
* Use tcvar.h interface. The usage of tc_syncbus() and tc_mb() may
not be quite stylistically on an Alhpa, but it apparently makes no
difference on the eerly-generation Alpha CPUs in TC Alphas.
 1.13.2.1 30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.15.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.15.2.1 04-Dec-1999  he Pull up revision 1.18 (requested by mhitch):
Fix IOASIC DMA alignment problems. This should fix the problems
with dump(8) failing randomly on DECstations.
 1.16.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.16.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.16.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.21.4.2 05-Nov-2000  tv Pullup 1.23 [mhitch]:
When doing the cacheflush for MIPS1, adjust the length to account for
an unaligned buffer. The last word of the buffer was not getting flushed
if the buffer was unaligned and fit in a single DMA segment. Now dump(8)
works on both MIPS1 and MIPS3 DECstations.
 1.21.4.1 30-Sep-2000  mhitch Pull up rev 1.22 [approved by thorpej.

Set up the physical addresses for DMAPTR/NEXTPTR before adjusting for
unaligned transfers and adjust the physical address to align the transfer.
If the buffer end just crossed the page boundary, the computation of the
NEXTPTR physical address resulted in using -1. The cleanup at the end of
the DMA transfer would try to copy the residual data to physical address
0x1ffffffc. This would silently corrupt data on the R3000 and usually
would hang the R4000.
 1.23.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.23.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.34 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.33 13-Apr-2008  tsutsui branches: 1.33.2; 1.33.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.32 05-Apr-2008  cegger use aprint_*_dev and device_xname
 1.31 19-Oct-2007  ad branches: 1.31.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.30 04-Mar-2007  yamt branches: 1.30.2; 1.30.14; 1.30.16; 1.30.20;
fix fallout from caddr_t changes.

XXX what "volatile caddr_t" in if_le_ioasic.c was for?
 1.29 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.28 31-Mar-2006  thorpej branches: 1.28.14;
Use ANSI function decls, apply static.
 1.27 30-Mar-2006  thorpej Use device_private().
 1.26 11-Dec-2005  christos branches: 1.26.4; 1.26.6; 1.26.8; 1.26.10; 1.26.12;
merge ktrace-lwp.
 1.25 27-Feb-2005  perry branches: 1.25.4;
nuke trailing whitespace
 1.24 04-Feb-2005  perry de-__P
 1.23 22-Feb-2003  tsutsui branches: 1.23.2; 1.23.10; 1.23.12;
hz -> Hz
 1.22 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.21 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.20 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.19 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.18 13-Nov-2001  lukem add/cleanup RCSIDs
 1.17 01-Oct-2001  simonb s/asc_pmaz/asc_tc/g
 1.16 01-Oct-2001  simonb Move MI PMAZ-A SCSI attachment to sys/dev/tc.
 1.15 26-Aug-2001  simonb branches: 1.15.2;
Switch to MI SCSI and drop old pmax MD SCSI support completely.
 1.14 06-Mar-2000  mhitch branches: 1.14.6; 1.14.8;
Get rid of hook for dk_establish() - pmax will now use device_register().
 1.13 04-Mar-2000  mhitch Fix boot device detection. Device probes are not done when adapters are
configured, but after all adapters have been configured. When multiple
adapters are present, only the last configured adapter could be matched
to the boot device slot. The adapter attach routines now check if that
adapter slot matches the boot device slot and saves the softc pointer
for that controller. Then when the disks are configured, dk_establish()
matches the appropriate controller.
 1.12 11-Feb-2000  thorpej We're given a K1SEG address already.
 1.11 15-Nov-1999  nisimura - No need to include '<machine/autoconf.h>'.
- Nuke tc_badaddr() check from asc_tc because the existency check is already
done for real TC devices.
- Nuke tc_badaddr() check from asc_ioasic because it is a builtin device
found in all of IOASIC DECstations.
 1.10 20-Apr-1999  mrg branches: 1.10.2; 1.10.8;
KNF nits.
 1.9 16-Jan-1999  nisimura branches: 1.9.4;
- Don't use void pointer for arithmetic.
 1.8 31-Oct-1997  jonathan Print TC bus speed properly when attaching device, since the SCSI
clock is taken (and computed) from the TC bus clock. See PR 4380.
 1.7 28-Jul-1997  mhitch branches: 1.7.6;
Use direct DMA with the IOASIC ASC SCSI interface. DMA buffering can be
re-enabled with ASC_IOASIC_BOUNCE.
All DMA buffered processing is now done in the bus-specific DMA routines
in asc_ioasic.c and asc_tc.c.
Disable several informational messages dealing with non-empty FIFO conditions,
but allow enabling with ASC_DIAGNOSTIC for troubleshooting.
 1.6 21-Jul-1997  jonathan Kill __BROKEN_INDIRECT_CONFIG on pmax.
Based on a patch from Chris G. Demetriou, December 1996.
 1.5 22-Jun-1997  jonathan * Change Sprite MACH_xxx prefix to MIPS_xxx.

* Use standard mips terminology (xxx_KSEG0, xxx_KSEG1) instead of the
(more meaningful) Sprite names (xxx_CACHED, xxx_UNCACHED).
 1.4 13-Oct-1996  christos backout kprintf changes
 1.3 12-Oct-1996  mhitch Remove extraneous output - ascattach() already did it.
 1.2 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 25-Sep-1996  jonathan * Rewrite asc driver with ``mi'' backend and parent-specific front-end
cfattach code for TC SCSI option cards and ioasic 53c94 baseboard SCSI.
ascvar.h: shared softc declarations
asc_ioasic.c: ioasic front-end code.
asc_tc.c: Turbochannel option (and 5000/200 basebard) front-end code.
* ioasic_attach meeds more work to eliminate pmax_type dependency
and to verify the clocks speed passed to 53c94.
* Add prototypes for asc script entry points; should compile with
-Wstrict-prototypes -Wmissing-prototypes.
* Use tcvar.h interface. The usage of tc_syncbus() and tc_mb() may
not be quite stylistically on an Alhpa, but it apparently makes no
difference on the eerly-generation Alpha CPUs in TC Alphas.
 1.7.6.1 31-Oct-1997  mellon Pull rev 1.8 up from trunk (jonathan)
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.10.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.8.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.8.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.14.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.14.6.3 08-Jan-2002  nathanw Catch up to -current.
 1.14.6.2 14-Nov-2001  nathanw Catch up to -current.
 1.14.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.15.2.1 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.23.12.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.23.12.1 12-Feb-2005  yamt sync with head.
 1.23.10.1 29-Apr-2005  kent sync with -current
 1.23.2.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.23.2.1 04-Feb-2005  skrll Sync with HEAD.
 1.25.4.3 27-Oct-2007  yamt sync with head.
 1.25.4.2 03-Sep-2007  yamt sync with head.
 1.25.4.1 21-Jun-2006  yamt sync with head.
 1.26.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.26.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.26.10.1 19-Apr-2006  elad sync with head.
 1.26.8.1 01-Apr-2006  yamt sync with head.
 1.26.6.1 22-Apr-2006  simonb Sync with head.
 1.26.4.1 09-Sep-2006  rpaulo sync with head
 1.28.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.30.16.1 06-Nov-2007  matt sync with HEAD
 1.30.14.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.30.2.1 23-Oct-2007  ad Sync with head.
 1.31.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.33.4.1 16-May-2008  yamt sync with head.
 1.33.2.1 18-May-2008  yamt sync with head.
 1.26 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.25 13-Nov-2010  uebayasi branches: 1.25.58; 1.25.60;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.24 28-Apr-2008  martin branches: 1.24.22;
Remove clause 3 and 4 from TNF licenses
 1.23 13-Apr-2008  tsutsui branches: 1.23.2; 1.23.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.22 20-Feb-2008  matt branches: 1.22.6;
Use the VAX_PHYS_TO_S0 macro from vax/tc_machdep.h
 1.21 19-Feb-2008  matt Fix TC on VAX. (missed committing these earlier)
 1.20 19-Oct-2007  ad machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.19 04-Mar-2007  yamt branches: 1.19.2; 1.19.14; 1.19.16; 1.19.20;
fix fallout from caddr_t changes.

XXX what "volatile caddr_t" in if_le_ioasic.c was for?
 1.18 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.17 14-May-2006  elad branches: 1.17.14;
integrate kauth.
 1.16 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.15 30-Mar-2006  thorpej Use device_private().
 1.14 11-Dec-2005  christos branches: 1.14.4; 1.14.6; 1.14.8; 1.14.10; 1.14.12;
merge ktrace-lwp.
 1.13 22-May-2005  christos branches: 1.13.2;
No 0x in front of %p...
 1.12 04-Feb-2005  perry de-__P
 1.11 03-May-2003  wiz branches: 1.11.2; 1.11.10; 1.11.12;
DMA, not dma nor Dma.
 1.10 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.9 22-Feb-2003  tsutsui hz -> Hz
 1.8 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.7 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.4 13-Nov-2001  lukem add/cleanup RCSIDs
 1.3 19-Jul-2001  thorpej Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places.
 1.2 25-Apr-2001  bouyer branches: 1.2.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.1 04-Jul-2000  nisimura branches: 1.1.2; 1.1.4;
Repopulate TCDS dual channel SCSI adapter to MI dev/tc, squashing
internals for better layering between TCDS DMA ASIC and ASC SCSI
controller.
 1.1.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.4 08-Jan-2002  nathanw Catch up to -current.
 1.1.4.3 14-Nov-2001  nathanw Catch up to -current.
 1.1.4.2 24-Aug-2001  nathanw Catch up with -current.
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.3 28-Mar-2001  bouyer Make this compile.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 04-Jul-2000  bouyer file asc_tcds.c was added on branch thorpej_scsipi on 2000-11-20 11:43:13 +0000
 1.2.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 03-Aug-2001  lukem update to -current
 1.11.12.1 12-Feb-2005  yamt sync with head.
 1.11.10.1 29-Apr-2005  kent sync with -current
 1.11.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.1 04-Feb-2005  skrll Sync with HEAD.
 1.13.2.4 27-Feb-2008  yamt sync with head.
 1.13.2.3 27-Oct-2007  yamt sync with head.
 1.13.2.2 03-Sep-2007  yamt sync with head.
 1.13.2.1 21-Jun-2006  yamt sync with head.
 1.14.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.14.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.14.10.1 19-Apr-2006  elad sync with head.
 1.14.8.1 01-Apr-2006  yamt sync with head.
 1.14.6.1 22-Apr-2006  simonb Sync with head.
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.17.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.19.16.2 23-Mar-2008  matt sync with HEAD
 1.19.16.1 06-Nov-2007  matt sync with HEAD
 1.19.14.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.19.2.1 23-Oct-2007  ad Sync with head.
 1.22.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.4.1 16-May-2008  yamt sync with head.
 1.23.2.1 18-May-2008  yamt sync with head.
 1.24.22.1 05-Mar-2011  rmind sync with head
 1.25.60.1 10-Jun-2019  christos Sync with HEAD
 1.25.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.13 29-Oct-2012  chs remove unused file.
 1.12 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.11 04-Mar-2007  christos branches: 1.11.76; 1.11.86;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 11-Dec-2005  christos branches: 1.10.26;
merge ktrace-lwp.
 1.9 04-Feb-2005  perry branches: 1.9.6;
de-__P
 1.8 03-May-2003  wiz branches: 1.8.2; 1.8.10; 1.8.12;
DMA, not dma nor Dma.
 1.7 31-Oct-2000  simonb Line up columns in #define list.
 1.6 08-Feb-2000  nisimura Add the missing piece of previous mod.
 1.5 19-Nov-1998  thorpej branches: 1.5.10;
Adapt to the new scsipi_adapter interface.
 1.4 28-Nov-1997  mhitch Fix driver bug when using an RZ23 (and very likely any other drive that
does a "restore data pointers" when reselected after disconnecting in
the middle of a DMA transfer). The driver needs a different way to know
which script to continue the DMA transfer. The message-in for the "restore
data pointers" loses the original "resume" script, and the driver would
attempt to continue the DMA transfer at the beginning of the current DMA
chunk, rather than at the point the disconnect occured. The result was a
spurious console message, and a trashed filesystem.
 1.3 27-Aug-1997  bouyer branches: 1.3.4;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.2 28-Jul-1997  mhitch branches: 1.2.2;
Use direct DMA with the IOASIC ASC SCSI interface. DMA buffering can be
re-enabled with ASC_IOASIC_BOUNCE.
All DMA buffered processing is now done in the bus-specific DMA routines
in asc_ioasic.c and asc_tc.c.
Disable several informational messages dealing with non-empty FIFO conditions,
but allow enabling with ASC_DIAGNOSTIC for troubleshooting.
 1.1 25-Sep-1996  jonathan branches: 1.1.8;
* Rewrite asc driver with ``mi'' backend and parent-specific front-end
cfattach code for TC SCSI option cards and ioasic 53c94 baseboard SCSI.
ascvar.h: shared softc declarations
asc_ioasic.c: ioasic front-end code.
asc_tc.c: Turbochannel option (and 5000/200 basebard) front-end code.
* ioasic_attach meeds more work to eliminate pmax_type dependency
and to verify the clocks speed passed to 53c94.
* Add prototypes for asc script entry points; should compile with
-Wstrict-prototypes -Wmissing-prototypes.
* Use tcvar.h interface. The usage of tc_syncbus() and tc_mb() may
not be quite stylistically on an Alhpa, but it apparently makes no
difference on the eerly-generation Alpha CPUs in TC Alphas.
 1.1.8.2 30-Jul-1997  bouyer Sync with trunk.
 1.1.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.2.2.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.4.1 28-Nov-1997  mellon Pull rev 1.4 up from trunk (mhitch)
 1.5.10.2 22-Nov-2000  bouyer Sync with HEAD.
 1.5.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.12.1 12-Feb-2005  yamt sync with head.
 1.8.10.1 29-Apr-2005  kent sync with -current
 1.8.2.1 04-Feb-2005  skrll Sync with HEAD.
 1.9.6.1 03-Sep-2007  yamt sync with head.
 1.10.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.86.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.11.76.1 30-Oct-2012  yamt sync with head
 1.46 12-Sep-2020  isaki Improve am7930 family drivers to share more code.
audioamd(4) on sparc, vsaudio(4) on vax, and bba(4) are.
- Remove complex and useless callbacks: onopen, onclose, and
indirect_{read,write}. This makes audioamd and vsaudio almost the same.
- Remove (already disabled) assembly fast interrupt path from audioamd(4).
cf. http://mail-index.netbsd.org/source-changes/2009/12/19/msg004585.html
- Use trigger_* method rather than start_* method. It's more suitable.
vsaudio(4) was tested by naru@, bba(4) was tested by tsutsui@.
 1.45 29-Aug-2020  isaki Fix white space and indent.
 1.44 08-Jun-2019  isaki Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.
 1.43 08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.42 16-Mar-2019  isaki branches: 1.42.2;
Use C99 style struct initializer to audio_hw_if.
 1.41 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.40 01-Jun-2017  chs branches: 1.40.8; 1.40.10;
remove checks for failure after memory allocation calls that cannot fail:

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

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.39 23-Nov-2011  jmcneill branches: 1.39.8; 1.39.26;
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.38 04-Jun-2011  tsutsui branches: 1.38.2; 1.38.4;
Split device_t/softc of am7930. No crash on TME and GXemul.
 1.37 22-Aug-2009  tsutsui branches: 1.37.4; 1.37.6; 1.37.10;
u_intNN_t -> uintNN_t
 1.36 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.35 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.34 28-Apr-2008  martin branches: 1.34.14;
Remove clause 3 and 4 from TNF licenses
 1.33 05-Apr-2008  cegger branches: 1.33.2; 1.33.4;
use aprint_*_dev and device_xname
 1.32 19-Oct-2007  ad branches: 1.32.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.31 04-Mar-2007  christos branches: 1.31.2; 1.31.14; 1.31.16; 1.31.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30 31-Mar-2006  he branches: 1.30.14; 1.30.16;
Correct typo.
 1.29 30-Mar-2006  thorpej Use device_private() more.
 1.28 30-Mar-2006  thorpej Liberally apply static.
 1.27 30-Mar-2006  thorpej Use device_private().
 1.26 02-Dec-2005  kleink branches: 1.26.4; 1.26.6; 1.26.8; 1.26.10; 1.26.12;
Fix AUDIO_DEBUG printf formatting of size_t; from Pavel Cahyna in
PR kern/32207.
 1.25 01-Jun-2005  drochner branches: 1.25.2;
fix cast-qual fallout
 1.24 15-Jan-2005  kent branches: 1.24.8;
ansify and KNF
 1.23 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.22 29-Oct-2004  yamt branches: 1.22.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.21 09-Jul-2004  mycroft Clean up open/close.
 1.20 03-May-2003  wiz branches: 1.20.2;
DMA, not dma nor Dma.
 1.19 04-Feb-2003  matt deal with malloc_type fallout.
 1.18 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.17 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15 13-Nov-2001  lukem add/cleanup RCSIDs
 1.14 03-Oct-2001  augustss Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
 1.13 19-Jul-2001  thorpej branches: 1.13.2;
Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places.
 1.12 18-Jul-2000  thorpej branches: 1.12.2; 1.12.4; 1.12.6;
PAGE_SIZE -> IOASIC_DMA_BLOCKSIZE in one last place. From Izumi Tsutsui.
 1.11 18-Jul-2000  thorpej Back out previous. It is no longer needed, as both the Alpha
and DECstation IOASIC drivers clear the appropriate interrupts
in the dispatch routine.
 1.10 17-Jul-2000  thorpej Clear the DMA pointer reload interrupt bits in the IOASIC_INTR
register to prevent interrups from looping on the Alpha.

From Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>.
 1.9 17-Jul-2000  thorpej - Write the registers 7930 registers properly on the Alpha (it's
different than on the DECstation).
- Use IOASIC_DMA_BLOCKSIZE instead of PAGE_SIZE.

Should make this work on the Alpha. From discussion with
Izumi Tsutsui, Gregory McGarry, and Chris Demetriou, and
much reading of EK-D3SYS-PM.
 1.8 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.7 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.6 12-Jun-2000  gmcgarry branches: 1.6.2;
- add mmap support
- correct bug which wouldn't free allocated DMA segments
 1.5 05-Jun-2000  gmcgarry - remove conditional compilation on NAUDIO
- use preprocessor for constants
 1.4 04-Jun-2000  gmcgarry Cleanup #if 0 cruft.
 1.3 01-Jun-2000  gmcgarry Remove wbflush(). These are not necessary with the new IOASIC bus_space
framework. From Tohru Nishimura.
 1.2 28-May-2000  gmcgarry Merge pmax and alpha ISDN register definitions.
 1.1 02-May-2000  augustss branches: 1.1.2;
Add am7930 audio driver.
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.2.3 18-Jul-2000  thorpej Pull up rev. 1.12:
PAGE_SIZE -> IOASIC_DMA_BLOCKSIZE in one last place. From Izumi Tsutsui.
 1.6.2.2 18-Jul-2000  thorpej Pull up revs. 1.9-1.11:
Changes to make 7930 ISDN/Audio work on TurboChannel Alphas.
 1.6.2.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.12.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.12.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.6.1 03-Aug-2001  lukem update to -current
 1.12.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.12.4.3 14-Nov-2001  nathanw Catch up to -current.
 1.12.4.2 08-Oct-2001  nathanw Catch up to -current.
 1.12.4.1 24-Aug-2001  nathanw Catch up with -current.
 1.12.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.2.1 18-Jul-2000  bouyer file bba.c was added on branch thorpej_scsipi on 2000-11-20 11:43:13 +0000
 1.13.2.1 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.20.2.7 11-Dec-2005  christos Sync with head.
 1.20.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.20.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.22.2.3 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.22.2.2 05-Jan-2005  kent introduce FILTER_LOOP_PROLOGUE() and FILTER_LOOP_EPILOGUE() macros, and
simplify filter implementations by the macros.
 1.22.2.1 03-Jan-2005  kent adopt the filter pipeline framework
 1.24.8.1 06-Dec-2005  riz Pull up following revision(s) (requested by kleink in ticket #1019):
sys/dev/tc/bba.c: revision 1.26
Fix AUDIO_DEBUG printf formatting of size_t; from Pavel Cahyna in
PR kern/32207.
 1.25.2.3 27-Oct-2007  yamt sync with head.
 1.25.2.2 03-Sep-2007  yamt sync with head.
 1.25.2.1 21-Jun-2006  yamt sync with head.
 1.26.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.26.10.1 19-Apr-2006  elad sync with head.
 1.26.8.1 01-Apr-2006  yamt sync with head.
 1.26.6.1 22-Apr-2006  simonb Sync with head.
 1.26.4.1 09-Sep-2006  rpaulo sync with head
 1.30.16.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.30.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.31.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.31.16.1 06-Nov-2007  matt sync with HEAD
 1.31.14.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.31.2.1 23-Oct-2007  ad Sync with head.
 1.32.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.33.4.3 16-Sep-2009  yamt sync with head
 1.33.4.2 16-May-2009  yamt sync with head
 1.33.4.1 16-May-2008  yamt sync with head.
 1.33.2.1 18-May-2008  yamt sync with head.
 1.34.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.37.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.37.4.1 12-Jun-2011  rmind sync with head
 1.38.4.2 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.38.4.1 20-Nov-2011  mrg port the am7930 drivers to audiomp. sparc and pmax GENERIC builds,
but i am unable to test these drivers.
 1.38.2.1 17-Apr-2012  yamt sync with head
 1.39.26.1 28-Aug-2017  skrll Sync with HEAD
 1.39.8.1 03-Dec-2017  jdolecek update from HEAD
 1.40.10.1 10-Jun-2019  christos Sync with HEAD
 1.40.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.42.2.2 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.42.2.1 22-Apr-2019  isaki Adapt am7930 families to audio2.
- Remove {input/output}_conv stuff from am7930_glue.
Filter pipelines for user encoding are not necessary in audio2
so the driver only needs to handle its hardware encoding.
- audioamd/vsaudio use an ordinal linear-mulaw conversion filter
and bba requires special one. dev/audio/mulaw.c supports this
variant just for bba. It might not a good way for bba but it
keeps all other drivers simple.
- Tested on vsaudio(4) by naru@, bba(4) by tsutsui@ (a few months ago).
Thanks!
 1.66 06-Dec-2021  abs Add WSDISPLAYIO_GET_FBINFO support to most TURBOchannel framebuffers

This adds WSDISPLAYIO_GET_FBINFO to cfb, mfb, sfb, tfb and xcfb
TURBOchannel framebuffers as used by pmax and alpha

It does not add support to px and pxg (they handle ioctls in common
code in stic.c and more careful wiring is required)

These changes allow an Xswfb X server to use the framebuffer
directly, albeit without any special acceleration

A subsequent change will re-enable X server building on pmax, and
also hopefully switch alpha from Xorg 1.10 to 1.20
 1.65 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.64 24-Apr-2021  thorpej branches: 1.64.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.63 10-Nov-2019  chs branches: 1.63.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.62 24-Jan-2018  riastradh branches: 1.62.4;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.61 11-Jan-2012  macallan adjust wsfont_find()
 1.60 13-Nov-2010  uebayasi branches: 1.60.8; 1.60.12;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.59 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.58 15-May-2010  tsutsui Set RI_NO_AUTO in ri_flg if *fb_common_init() is invoked from cnattach.
Untested.
 1.57 22-Aug-2009  tsutsui branches: 1.57.2; 1.57.4;
u_intNN_t -> uintNN_t
 1.56 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.55 09-Jul-2008  joerg branches: 1.55.2;
- device/softc split
- make sfbplus at least compilable
 1.54 26-May-2008  nisimura branches: 1.54.2; 1.54.4;
- 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.53 19-Oct-2007  ad branches: 1.53.16; 1.53.18; 1.53.20; 1.53.22;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.52 04-Mar-2007  yamt branches: 1.52.2; 1.52.14; 1.52.16; 1.52.20;
fix fallout from caddr_t changes.

XXX what "volatile caddr_t" in if_le_ioasic.c was for?
 1.51 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.50 12-Apr-2006  jmmv branches: 1.50.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.49 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.48 30-Mar-2006  thorpej Use device_private().
 1.47 11-Dec-2005  christos branches: 1.47.4; 1.47.6; 1.47.8; 1.47.10; 1.47.12;
merge ktrace-lwp.
 1.46 27-Feb-2005  perry branches: 1.46.4;
nuke trailing whitespace
 1.45 02-Jan-2005  mhitch branches: 1.45.2; 1.45.4;
Fix and simplify incorrect check for screen blanking in WSDISPLAYIO_SVIDEO.
 1.44 20-Dec-2003  nisimura - Minor coding modifications for VDAC register access.
- De-__P() this time.
Tested valid with 4MAXINE.
 1.43 17-Dec-2003  ad - Restore the display to a sane state when leaving mapped mode.
- OR updates into sc_changed, and protect with spltty()/splx().
 1.42 13-Nov-2003  chs eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.41 27-Oct-2003  chs uninitialized variables
 1.40 29-Jun-2003  fvdl branches: 1.40.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.39 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.38 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.37 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.36 19-Aug-2002  itohy Leaving overflow-sensitive code, very similar to what was fixed
in the previous changes to cfb.c / sfb.c / xcfb.c, would not be clever.
Just modify in the similar way.
 1.35 19-Aug-2002  itohy Make it compile again.
Hi, itojun!
 1.34 06-Aug-2002  itojun integer overflow. from silvio@qualys.com
 1.33 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.32 17-Mar-2002  atatat branches: 1.32.4; 1.32.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.31 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.30 13-Nov-2001  lukem add/cleanup RCSIDs
 1.29 22-Aug-2001  nisimura Nuke fb_devconfig data structure which was found unnecessary to have.
 1.28 05-Aug-2001  jdolecek use unsigned variable types as appropriate
 1.27 20-Apr-2001  reinoud branches: 1.27.2;
Fix a few race conditions ... the VSYNC update flag could be cleared
resulting in a blank screen when f.e. a setcursor ioctl was called
after the screenblanker had enabled the screen again ... the actual
switching on was then never performed at VSYNC.

A simple |= instead of = does the trick ... just leave the other bits
on please :)
 1.26 16-Jan-2001  nisimura branches: 1.26.2;
- relocate the code to place sprite cursor inside interrupt handlers
called on every virtical replace.
- efforts to make the code strucutures similar across TC framebuffers.
 1.25 21-Nov-2000  nisimura Fix errors in color lookup table initialization. Glyph is rendered
in visible color now.
 1.24 27-Oct-2000  nisimura Fix errors in initializing the software copy of 256 entry colormap
stored in device softc. rasops_cmap[] array is orginazed in 256
iteration of 3 byte long RBG triplet, which does not match with
struct wsdisplay_cmap design.
 1.23 13-Sep-2000  nisimura Found glyph pixel order inverted on screen.
 1.22 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.21 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.20 16-Mar-2000  nisimura branches: 1.20.4;
Place 34 by 80 console at the center of screen.
 1.19 14-Mar-2000  nisimura Respect video console colour designation by configration file.
 1.18 14-Mar-2000  nisimura Switch to improved flexible video console text rasterizer provided by
rasops and wsfont.
 1.17 15-Dec-1999  ad - Change prefix for Bt459 register defs to BT459_IREG to indicate that
these are indirectly accessed registers.
- Add defs for directly accessed registers to bt459reg.h.
 1.16 08-Dec-1999  nisimura One small mod. escaped from the last commit.
 1.15 06-Dec-1999  drochner update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.14 29-Nov-1999  nisimura Const poisoning.
 1.13 19-Oct-1999  nisimura branches: 1.13.2;
Enable 'WSSCREEN_REVERSE' scr-capability.
 1.12 02-Aug-1999  nisimura branches: 1.12.2; 1.12.4;
- Fix TX 8bpp framebuffer size, which occupies 2MB.
- Rework CX RAMDAC register access like as other TC framebuffers.
 1.11 07-May-1999  nisimura - Sweep abit preparing for code merge to have common 'vdacops' across
various graphics cards.
 1.10 29-Mar-1999  nisimura branches: 1.10.4;
- Unnecessary to have '#include <machine/autoconf.h>' for those.
 1.9 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.8 01-Mar-1999  nisimura - Fix cursor image validity check error in set_cursor().
 1.7 15-Jan-1999  thorpej __pmax__ -> pmax, like other ports.
 1.6 11-Jan-1999  drochner remove dummy "load_font" entries
 1.5 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


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

by someone!
 1.4 18-Nov-1998  nisimura - Fix cursor image handling bugs escaped in last commit.
 1.3 09-Nov-1998  nisimura - Fix many errors in cursor image manipulation. Hardware expect 2
bit/pixel format, not planer format. Assign MSB for cursor mask and
LSB for cursor image, where 10 means mask color and 11 for image color.
Image bit order of Bt431 and Bt459 are opposite to MIPS/Alpha processors
while IMS G332 and DC503 (PCC) are indentical.
- Assume that cursor images are 32 pixel padded as ULTRIX/DU ws interface
do. It's natural to X server.
- XXX Vast majority of codes are duplicated between mfb<->tfb and cfb<->sfb.
Code sharing might be achieved in the context of TGA/SFB+ merge.
 1.2 30-Oct-1998  nisimura - Assign copyright terms.
 1.1 29-Oct-1998  nisimura - Introduce MI NWSCONS drivers for TURBOchannel framebuffer option cards.

N.B., Digital UNIX never supports neither PMAG-AA (mfb) nor PMAG-BA (cfb)
for TC Alphas. PMAG-DV (xcfb) is Personal DECstation built in. All should
be good for console, but need much works for cursor/colormap completeness.
 1.10.4.2 02-Aug-1999  thorpej Update from trunk.
 1.10.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.5 23-Apr-2001  bouyer Sync with HEAD.
 1.12.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.12.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.2.1 20-Oct-1999  thorpej Sync w/ trunk.
 1.13.2.2 19-Oct-1999  nisimura Enable 'WSSCREEN_REVERSE' scr-capability.
 1.13.2.1 19-Oct-1999  nisimura file cfb.c was added on branch fvdl-softdep on 1999-10-19 00:49:35 +0000
 1.20.4.3 04-Sep-2002  itojun pullup (itojun)

sys/arch/amiga/dev/grf_cv3d.c 1.11
sys/arch/hpcmips/dev/mq200.c 1.21
sys/arch/i386/i386/sys_machdep.c 1.64
sys/arch/luna68k/dev/lunafb.c 1.9
sys/arch/sparc/dev/bt_subr.c via patch
sys/arch/sparc64/dev/bt_subr.c via patch
sys/arch/sun3/dev/bt_subr.c via patch
sys/compat/ibcs2/ibcs2_stat.c 1.21-1.23
sys/dev/sun/bt_subr.c 1.3
sys/dev/tc/cfb.c 1.34
sys/dev/tc/sfb.c 1.53
sys/dev/tc/xcfb.c 1.29
integer overflow. reported by silvio@qualys.com
 1.20.4.2 16-Aug-2001  tv Pullup [jdolecek]:

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

Use unsigned variable types to make bounds checking more correct.
 1.20.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.26.2.9 18-Oct-2002  nathanw Catch up to -current.
 1.26.2.8 27-Aug-2002  nathanw Catch up to -current.
 1.26.2.7 13-Aug-2002  nathanw Catch up to -current.
 1.26.2.6 01-Aug-2002  nathanw Catch up to -current.
 1.26.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.26.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.26.2.3 21-Sep-2001  nathanw Catch up to -current.
 1.26.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.26.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.27.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.27.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.27.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.27.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.27.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.32.6.2 23-Aug-2002  lukem Pull up revision 1.35 (requested by enami in ticket #616):
Make it compile again.
Hi, itojun!
 1.32.6.1 07-Aug-2002  lukem Pull up revision 1.34 (requested by itojun in ticket #616):
integer overflow. from silvio@qualys.com
 1.32.4.2 29-Aug-2002  gehenna catch up with -current.
 1.32.4.1 15-Jul-2002  gehenna catch up with -current.
 1.40.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.40.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.40.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.40.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.40.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.40.2.1 03-Aug-2004  skrll Sync with HEAD
 1.45.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.45.2.1 29-Apr-2005  kent sync with -current
 1.46.4.3 27-Oct-2007  yamt sync with head.
 1.46.4.2 03-Sep-2007  yamt sync with head.
 1.46.4.1 21-Jun-2006  yamt sync with head.
 1.47.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.47.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.47.10.1 19-Apr-2006  elad sync with head.
 1.47.8.2 24-May-2006  yamt sync with head.
 1.47.8.1 01-Apr-2006  yamt sync with head.
 1.47.6.1 22-Apr-2006  simonb Sync with head.
 1.47.4.1 09-Sep-2006  rpaulo sync with head
 1.50.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.52.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.52.16.1 06-Nov-2007  matt sync with HEAD
 1.52.14.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.52.2.1 23-Oct-2007  ad Sync with head.
 1.53.22.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.53.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.53.20.3 11-Aug-2010  yamt sync with head.
 1.53.20.2 16-Sep-2009  yamt sync with head
 1.53.20.1 04-May-2009  yamt sync with head.
 1.53.18.1 04-Jun-2008  yamt sync with head
 1.53.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.53.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.53.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.54.4.1 19-Oct-2008  haad Sync with HEAD.
 1.54.2.1 18-Jul-2008  simonb Sync with head.
 1.55.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.57.4.2 05-Mar-2011  rmind sync with head
 1.57.4.1 30-May-2010  rmind sync with head
 1.57.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.60.12.1 18-Feb-2012  mrg merge to -current.
 1.60.8.1 17-Apr-2012  yamt sync with head
 1.62.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.63.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.64.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 19-Apr-1998  jonathan Remove duplicate of sys/dev/dec/clockvar.h.
 1.4 22-Jun-1997  jonathan Clone Alpha ``cpu-independent'' clock API headers into sys/dev/tc/,
to share them with pmax.
 1.3 07-Apr-1997  cgd clean up NetBSD RCS ID strings
 1.2 17-Apr-1996  cgd branches: 1.2.2;
clean up clock handling: clock drivers are now seperate from the
chip-independent clock code. 'clock' has been renamed 'mcclock' 'clock'
has been renamed 'mcclock' (since it's a driver for that particular
clock, and since eventually there may be another clock chip driver),
and now attaches via seperate match/attach functions to both TC and ISA.
This removes a whole lot of #ifdefs...
 1.1 28-Jun-1995  cgd sync with my current Alpha sources
 1.2.2.1 01-Jun-1997  cgd sync the nwscons branch up with yesterday's version of the trunk.
Lots of conflicts/changes because of the RCS Id format changes.
Also, a few cleanups and corrections.
 1.10 12-Apr-2007  matt Make tc_knowndevs const.
 1.9 11-Dec-2005  christos branches: 1.9.26; 1.9.30; 1.9.32;
merge ktrace-lwp.
 1.8 27-Feb-2005  perry branches: 1.8.4;
do not leave spaces at the end of stripped RCS Ids
 1.7 15-Dec-2003  jmc branches: 1.7.8; 1.7.10;
Fixes from PR#23177. Various lint/logic fixes:
Fix some non-initialized variables
close the output files when done
Redo the printing for RCS strings so they don't expand in the awk script too
Do proper tests for variables existance before accessing

Verified output from all scripts is identical to original versions
 1.6 09-Jan-1998  thorpej branches: 1.6.48;
Put RCS IDs into generated files, in the correct place.
 1.5 08-Jan-1998  thorpej Back out RCS ID related changes.
 1.4 05-Jan-1998  perry make script insert RCS ids into generated files
 1.3 05-Jun-1996  cgd fix bogus comment pointed out by Mike Grupenhoff <kashmir@umiacs.UMD.EDU>.
C-style comments aren't legal in awk (except in gawk, apparently).
 1.2 05-Mar-1996  cgd branches: 1.2.4;
split device info into driver name and human readable description.
 1.1 02-Mar-1996  cgd add ability to define TCVERBOSE, and get "human names" about "known"
but unconfigured (or unsupported) devices printed at boot time.
The device list is woefully incomplete, because i didn't put much time
in it, and because i don't know good "human names" for many TC devices.
 1.2.4.1 05-Jun-1996  cgd pull up from trunk:
>fix bogus comment pointed out by Mike Grupenhoff <kashmir@umiacs.UMD.EDU>.
>C-style comments aren't legal in awk (except in gawk, apparently).
 1.6.48.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.4.1 03-Sep-2007  yamt sync with head.
 1.9.32.1 11-Jul-2007  mjf Sync with head.
 1.9.30.1 27-May-2007  ad Sync with head.
 1.9.26.1 15-Apr-2007  yamt sync with head.
 1.36 20-Jan-2020  thorpej Remove FDDI support.
 1.35 08-May-2019  isaki branches: 1.35.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.34 11-Aug-2016  christos branches: 1.34.16; 1.34.20;
TURBOchannel usb/gpio driver from Felix Deichmann
 1.33 27-Feb-2008  matt branches: 1.33.48; 1.33.68;
Add the bus devclass to tc
 1.32 13-Nov-2007  cube branches: 1.32.10; 1.32.14;
Remove some whitespace.
 1.31 17-Aug-2006  bjh21 branches: 1.31.26; 1.31.28; 1.31.32; 1.31.34;
There seems to be no good reason for sfbp(4) to be commented out here, and its
state is breaking alpha builds. I'll uncomment it and see what breaks.
 1.30 29-Jul-2006  ad branches: 1.30.2;
Remove RASTERCONSOLE support from the pmax port.
 1.29 11-Dec-2005  christos branches: 1.29.4; 1.29.8;
merge ktrace-lwp.
 1.28 10-Jan-2005  kent branches: 1.28.10;
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.27 22-Apr-2002  augustss branches: 1.27.10; 1.27.14;
Rename the audio "bus" attribute audiobus to avoid confusion with audio
device.
 1.26 28-Nov-2001  lukem - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
"options FOO=xxx"). options that take a value were converted to
defparam recently.
- minor whitespace & formatting cleanups
 1.25 01-Oct-2001  simonb Move asc_tc and asc_tcds config info to dev/tc/files.tc now that pmax
uses MI SCSI.
 1.24 18-Sep-2001  ad Beef up the stic X interface, and tighten a few screws here and there.
 1.23 26-Aug-2001  simonb branches: 1.23.2;
Switch to MI SCSI and drop old pmax MD SCSI support completely.
 1.22 16-Jan-2001  nisimura branches: 1.22.2; 1.22.4;
Add a definition for PMAGD which should cover all (three?) variations of
it. Left commented out until DECstation switchs to WSCONS.
 1.21 01-Jan-2001  mrg the tcds cards work in pmaxen. move tcds attachment to files.tc. leave asc
at tcds in files.alpha for now, and add a new `xasc at tcds' to files.pmax.
after pmax has moved fully to MI scsi (and `asc' is MI scsi), we should move
the device asc, etc., lines to files.tc.
 1.20 17-Dec-2000  ad Add wscons drivers for the DEC PixelStamp graphics accelerators.
 1.19 24-Nov-2000  nisimura Add TC option card descriptions, which are commented out before NetBSD/pmax
yields local implementations to them.
 1.18 02-May-2000  augustss Add am7930 audio driver.
 1.17 09-Sep-1999  nisimura branches: 1.17.2;
Use bus_dmamap_load() to obtain 128KB chunk for LANCE merging codes from
NetBSD/alpha. Tested ok with DEC3000 and DECstation.
 1.16 13-Apr-1999  ad Removed pending write of fully-functional MI driver.
 1.15 16-Mar-1999  simonb branches: 1.15.4;
Uncomment ioasic_subr.c.
 1.14 15-Mar-1999  jonathan MI ioasic softc and child-device structs, gc duplicate struct definitions.
Add MI ioasic functions, but dont enable on alpha until tested.
 1.13 21-Jul-1998  drochner adapt to LANCE driver split
 1.12 16-Feb-1998  thorpej Remove "class" declarations, and add "devclass" declarations where
appropriate. Fix several inconsistencies between device class and
attributes. Mostly from Chris Demetriou.
 1.11 12-Jan-1998  thorpej Adjust for changes in config.
 1.10 08-Nov-1997  jonathan Commit `pacifier' driver for turbochannel PMAG-C option card:n
just acknowledge interrupts from the PMAG-C.
 1.9 13-Sep-1997  enami branches: 1.9.2;
Declare TCVERBOSE by defopt in files.tc. Include opt_tcverbose.h in tc.c.
 1.8 22-Jul-1997  jonathan branches: 1.8.2;
Create sys/dev/dec and cleanup sys/dev/tc:

* Move clockvar.h (header file for generic clock code) to sys/dev/dec.
* Move if_le_dec.c with DEC padded LANCE-dma (pmax/pmax, ioasic, vax 3400)
to sys/dev/dec. Remove from sys/dev/tc.
* Declare attribute le_dec_subr in /sys/dev/dec/files.dec,
use if_le_dec.c when it's defined.
* Move IOCTL asic declaration from pmax and Alpha MD machine
files to sys/dev/tc/files.tc.
* move TurboChannel and ioasic if_le attachments from pmax and Alpha machine
config files to /sys/dev/tc/files.tc. Add le_dec_subr attribute.
* Add if_le_dec attribute to if_le_ibus (pmax ds3100 pmax) LANCE attachment.
 1.7 20-Jul-1997  pk config.new => config
 1.6 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.5 20-May-1996  thorpej branches: 1.5.8;
Add the DEFTA FDDI controller.
 1.4 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
 1.3 17-Mar-1996  thorpej New device attachment scheme:

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

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.2 27-Feb-1996  cgd tcbus attribute moved to conf/files
 1.1 20-Dec-1995  cgd files file to define 'tcbus' attribute, to which 'tc's attach.
also defines tc device. does _not_ define le driver, because
of conflicts with other (e.g. ISA) le drivers. (Alpha kernel
configuration files include files.isa and files.tc.)
 1.5.8.1 09-Mar-1997  is netinet/if_ether.h -> netinet/if_inarp.h
 1.8.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.2.1 15-Nov-1997  mellon Pull rev 1.10 up from trunk (jonathan)
 1.15.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.17.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.17.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.17.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.22.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.22.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.22.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.22.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.22.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.22.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.22.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.23.2.2 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.23.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.27.14.1 03-Jan-2005  kent adopt the filter pipeline framework
 1.27.10.1 17-Jan-2005  skrll Sync with HEAD.
 1.28.10.3 17-Mar-2008  yamt sync with head.
 1.28.10.2 15-Nov-2007  yamt sync with head.
 1.28.10.1 30-Dec-2006  yamt sync with head.
 1.29.8.2 03-Sep-2006  yamt sync with head.
 1.29.8.1 11-Aug-2006  yamt sync with head
 1.29.4.1 09-Sep-2006  rpaulo sync with head
 1.30.2.1 24-Aug-2006  riz Pull up following revision(s) (requested by bjh21 in ticket #38):
sys/dev/tc/files.tc: revision 1.31
There seems to be no good reason for sfbp(4) to be commented out here, and its
state is breaking alpha builds. I'll uncomment it and see what breaks.
 1.31.34.1 19-Nov-2007  mjf Sync with HEAD.
 1.31.32.1 13-Nov-2007  bouyer Sync with HEAD
 1.31.28.2 23-Mar-2008  matt sync with HEAD
 1.31.28.1 09-Jan-2008  matt sync with HEAD
 1.31.26.1 14-Nov-2007  joerg Sync with HEAD.
 1.32.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.32.10.1 24-Mar-2008  keiichi sync with head.
 1.33.68.1 05-Oct-2016  skrll Sync with HEAD
 1.33.48.1 03-Dec-2017  jdolecek update from HEAD
 1.34.20.1 05-May-2019  isaki Remove obsoleted au{,rate,vol}conv and mulaw attributes.
audio provides the equivalent of them inseparably.
 1.34.16.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.34.16.1 10-Jun-2019  christos Sync with HEAD
 1.35.4.1 25-Jan-2020  ad Sync with head.
 1.30 20-Jan-2020  thorpej Remove FDDI support.
 1.29 22-Jun-2017  flxd branches: 1.29.6; 1.29.14;
spelling (DEC called it "TURBOchannel")
 1.28 27-Oct-2012  chs branches: 1.28.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.27 12-May-2009  cegger branches: 1.27.12; 1.27.22;
struct device * -> device_t, no functional changes intended.
 1.26 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.25 05-Apr-2008  cegger branches: 1.25.4; 1.25.18;
use aprint_*_dev and device_xname
 1.24 04-Mar-2007  christos branches: 1.24.36;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.23 30-Mar-2006  thorpej branches: 1.23.14;
Use device_private().
 1.22 02-Oct-2002  thorpej branches: 1.22.22; 1.22.36; 1.22.38; 1.22.40; 1.22.42; 1.22.44;
Add trailing ; to CFATTACH_DECL.
 1.21 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.20 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.19 13-Nov-2001  lukem add/cleanup RCSIDs
 1.18 13-Jun-2001  wiz branches: 1.18.2;
withough -> without
 1.17 28-Jun-2000  mrg branches: 1.17.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.16 26-Jun-2000  mrg remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.15 05-Jul-1998  jonathan branches: 1.15.14;
defopt INET, NETATALK.
 1.14 21-May-1998  matt Add bus_dma(9) support for the DEFxA FDDI driver
 1.13 12-Jan-1998  thorpej Adjust for changes in config.
 1.12 22-Jul-1997  jonathan Garbage-collect __BROKEN_INDIRECT_CONFIG from /sys/dev/tc
 1.11 24-Mar-1997  thorpej Resolve conflicts from merge.
 1.10 15-Mar-1997  cgd fix botches in is's new ARP changes
 1.9 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.8 05-Dec-1996  cgd branches: 1.8.6;
update these so they compile whether or not __BROKEN_INDIRECT_CONFIG
is defined.
 1.7 22-Oct-1996  cgd update for new bus.h
 1.6 13-Oct-1996  christos backout kprintf changes
 1.5 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 20-May-1996  thorpej Remove some extra printfs, now that Matt has lessened my confusion.
 1.3 20-May-1996  cgd fix first argument to tc_intr_establish()... it's still the pointer
to the parent device.
 1.2 20-May-1996  thorpej Display model string during attach.
 1.1 20-May-1996  thorpej branches: 1.1.1;
Initial revision
 1.1.1.2 24-Mar-1997  thorpej Update from Matt Thomas <matt@3am-software.com>. Notable highlight:
the DEFTA (TurboChannel) card now works on the Alpha!
 1.1.1.1 20-May-1996  thorpej Update to the Digital Equipment PDQ-based FDDI controllers, from
Matt Thomas. Now includes support for EISA (DEFEA) and first-cut of
support for TurboChannel (DEFTA) cards.
 1.8.6.2 09-Mar-1997  is netinet/if_ether.h -> netinet/if_inarp.h
 1.8.6.1 27-Feb-1997  is Changing to the new world order.
 1.15.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.17.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.17.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.17.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.18.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.18.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.22.44.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.22.42.1 19-Apr-2006  elad sync with head.
 1.22.40.1 01-Apr-2006  yamt sync with head.
 1.22.38.1 22-Apr-2006  simonb Sync with head.
 1.22.36.1 09-Sep-2006  rpaulo sync with head
 1.22.22.2 03-Sep-2007  yamt sync with head.
 1.22.22.1 21-Jun-2006  yamt sync with head.
 1.23.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.36.1 02-Jun-2008  mjf Sync with HEAD.
 1.25.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.4.1 16-May-2009  yamt sync with head
 1.27.22.2 03-Dec-2017  jdolecek update from HEAD
 1.27.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.27.12.1 30-Oct-2012  yamt sync with head
 1.28.14.1 28-Aug-2017  skrll Sync with HEAD
 1.29.14.1 25-Jan-2020  ad Sync with head.
 1.29.6.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.10 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
 1.9 22-Apr-1996  christos Add a hardware dependent initialization function lehwinit()
 1.8 18-Apr-1996  cgd restructure to take advantage of config's (relatively) new 'attach'
specifiers. Many #ifdefs and much other nastiness removed.
 1.7 18-Apr-1996  cgd change LANCE copy & zero functions' names to start with amd7990_, and
remove their 'integrate' (usually defined to be 'static') keywords.
when lance drivers are split up by attachment, more than one file will
reference the copy/zero functions (i.e. not just the file that pulls in
am7990.c... and eventually inclusion of am7990.c should go away entirely).
 1.6 08-Apr-1996  jonathan fixes for -Wall -Wmissing-prototypes:
prototype the forward declaration of lewritereg().
 1.5 26-Mar-1996  jonathan Fixup after the "New device attachment scheme": change {mainbus,tc,ioasic}cd
to {mainbus,tc,ioasic}_cd.

Change ioasic config name from "lance " to "lance". Correct for
pmaxes, perhaps not for Alphas.

Boots and runs under load on a 5000/200. Hangs during boot on an ioasic
decstation; pmax autoconfig needs fixing.

Add Decstation-3100 baseboard support (untested).
 1.4 17-Mar-1996  thorpej New device attachment scheme:

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

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.3 26-Feb-1996  cgd (1) rename some structures & structure members, for consistency with
planned changes in other sections of code.
(2) expands the use of config_found() in tcattach() in-line, so that
tcsubmatch can be invoked there, rather than being invoked by
individual drivers.
(3) tcbus_attach_args now includes a turbochannel speed flag.
(4) compare a string in tcbus_attach_args against tc bus driver name,
to better allow attachment of multiple busses to the same parent.
 1.2 01-Feb-1996  jonathan Set sc->sc_cookie appropriately for the ioasic and TC option cases.
Tested on Decstation: ioasic, kn02 baseboard, and TC option card.

Add untested for pmax 3100/5100 baseboard ethernet.
 1.1 20-Dec-1995  cgd Machine-independent TurboChannel LANCE driver. As-is, this driver
should work properly with:
(1) LANCE chips hanging off the system IOCTL asic,
(2) LANCE chips TurboChannel option boards.
Support for various PMAX-family baseboard options isn't yet in this
file, but should be easy to add.
 1.8 22-Jul-1997  jonathan Create sys/dev/dec and cleanup sys/dev/tc:

* Move clockvar.h (header file for generic clock code) to sys/dev/dec.
* Move if_le_dec.c with DEC padded LANCE-dma (pmax/pmax, ioasic, vax 3400)
to sys/dev/dec. Remove from sys/dev/tc.
* Declare attribute le_dec_subr in /sys/dev/dec/files.dec,
use if_le_dec.c when it's defined.
* Move IOCTL asic declaration from pmax and Alpha MD machine
files to sys/dev/tc/files.tc.
* move TurboChannel and ioasic if_le attachments from pmax and Alpha machine
config files to /sys/dev/tc/files.tc. Add le_dec_subr attribute.
* Add if_le_dec attribute to if_le_ibus (pmax ds3100 pmax) LANCE attachment.
 1.7 16-Jun-1997  jonathan include <machine/bus.h>.
 1.6 15-Jun-1997  mhitch DECstation MIPS3 support: wbflush() is cpu-dependent, need declaration from
machine/locore.h.
 1.5 17-Mar-1997  thorpej #include <net/if_media.h>
 1.4 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.3 13-Oct-1996  christos branches: 1.3.6;
backout kprintf changes
 1.2 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
 1.3.6.2 09-Mar-1997  is netinet/if_ether.h -> netinet/if_inarp.h
 1.3.6.1 27-Feb-1997  is Changing to the new world order.
 1.18 01-Oct-2001  simonb Move pmax-only if_le_ibus.c from dev/tc to arch/pmax/ibus.
 1.17 18-Sep-2001  simonb General cleanup: ANSIfy, white-space, remove unused #includes.
XXX: should be moved to arch/pmax/ibus - this is pmax specific.
 1.16 30-May-2001  mrg branches: 1.16.2; 1.16.4;
use _KERNEL_OPT
 1.15 30-Mar-2000  augustss branches: 1.15.6;
Remove register declarations.
 1.14 10-Jan-2000  simonb Don't use magic number for lance buffer address.
 1.13 15-Nov-1999  nisimura - Reflect changes in ibus_intr_establish() definition.
- More concise way to initialize TC framebuffer device for console.
 1.12 15-Nov-1999  nisimura - No need to include '<machine/autoconf.h>'.
- Nuke tc_badaddr() check from asc_tc because the existency check is already
done for real TC devices.
- Nuke tc_badaddr() check from asc_ioasic because it is a builtin device
found in all of IOASIC DECstations.
 1.11 21-Jul-1998  drochner branches: 1.11.14; 1.11.20;
adapt to LANCE driver split
 1.10 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.9 19-Apr-1998  jonathan pmax has IPL_ constants; Define TC_IPL_ using them until all tc
drivers are converted to use IPL_.

Commit changes to if_le_ibus.c as a child of ibus.
 1.8 12-Jan-1998  thorpej Adjust for changes in config.
 1.7 21-Jul-1997  jonathan Kill __BROKEN_INDIRECT_CONFIG on pmax.
Based on a patch from Chris G. Demetriou, December 1996.
 1.6 17-Mar-1997  thorpej #include <net/if_media.h>
 1.5 15-Mar-1997  cgd fix botches in is's new ARP changes
 1.4 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.3 20-May-1996  jonathan branches: 1.3.8;
Add #include of pmax/kn01var.h, remove unused variables, and close
hanging block comment in copyright to satisfy -Wall.
 1.2 20-May-1996  jonathan Fix braino in initialization of confargs pointer in le_pmax_attach().
 1.1 20-May-1996  jonathan Decstation 3100/2100 baseboard configuration stub for the LANCE driver
for DEC TURBOchannel and IOCTL ASIC machines.
 1.3.8.1 09-Mar-1997  is netinet/if_ether.h -> netinet/if_inarp.h
 1.11.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.15.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.15.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.15.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.16.4.2 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.16.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.16.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.35 29-May-2022  rin Audit unload/unmap v.s. free against DMA buffer for sys/dev;
make sure that bus_dmamap_unload(9) [or bus_dmamap_destroy(9)] or
bus_dmamem_unmap(9) are preceding to freeing DMA buffer, if it is
loaded or mapped, respectively.

This is mandatory for some archs. See, e.g.:

http://www.nerv.org/netbsd/?q=id:20210511T013030Z.013443cc790088147e4beed43f53dedabeaf9312
http://www.nerv.org/netbsd/?q=id:20220511T172220Z.561179f0b6fcc5b9cd73e274f69d74e2ce9e4c93

For some drivers, resource leaks for error paths are fixed at
the same time.

XXX XXX XXX
Compile test only (at least one arch per driver).
 1.34 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.33 18-Apr-2009  tsutsui branches: 1.33.62; 1.33.64;
Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.32 18-Mar-2009  cegger bcopy -> memcpy
 1.31 18-Mar-2009  cegger bzero -> memset
 1.30 04-Apr-2008  tsutsui branches: 1.30.4; 1.30.12; 1.30.18;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.29 04-Mar-2007  yamt branches: 1.29.36;
fix fallout from caddr_t changes.

XXX what "volatile caddr_t" in if_le_ioasic.c was for?
 1.28 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.27 31-Mar-2006  thorpej branches: 1.27.14;
Use ANSI function decls, apply static.
 1.26 30-Mar-2006  thorpej Use device_private() more.
 1.25 30-Mar-2006  thorpej Use device_private().
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10; 1.24.12;
merge ktrace-lwp.
 1.23 27-Feb-2005  perry branches: 1.23.4;
nuke trailing whitespace
 1.22 04-Feb-2005  perry de-__P
 1.21 02-Oct-2002  thorpej branches: 1.21.6; 1.21.14; 1.21.16;
Add trailing ; to CFATTACH_DECL.
 1.20 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.19 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.18 13-Nov-2001  lukem add/cleanup RCSIDs
 1.17 17-Jul-2000  thorpej branches: 1.17.2; 1.17.4;
Use the IOASIC_DMA_ADDR() macro now that it is fixed.
 1.16 11-Jul-2000  nisimura - Use PMAD-BA name for device match logic. It's not a real TURBOchannel
device and the id string is not found in option ROM string, but
ULTRIX/OSF1 call it so anyway.
- Squash IOASIC DMA buffer allocation into device attach() sequence.
 1.15 30-Mar-2000  augustss Remove register declarations.
 1.14 01-Oct-1999  nisimura branches: 1.14.2;
- Remove defunct codes and arrange consistency between pmax and alpha.
- Reduce 'ioasic_base' expose.
 1.13 09-Sep-1999  nisimura Use bus_dmamap_load() to obtain 128KB chunk for LANCE merging codes from
NetBSD/alpha. Tested ok with DEC3000 and DECstation.
 1.12 21-Jul-1998  drochner adapt to LANCE driver split
 1.11 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.10 19-Jan-1998  thorpej Make sure the LANCE DMA area has been allocated, and don't call
ioasic_lance_dma_setup() on the Alpha; the DMA area is allocated differently
on that platform now.
 1.9 26-Aug-1997  jonathan Set KERNEL_RCSID to identify previous change.
 1.8 26-Aug-1997  jonathan rewrite and hand-tune copy_gap16 loops:
* hoist code to deal with fragments of a 16-byte chunk outside
main copy loop.
* over 98% of dynamic calls are 2-byte-algnied but not 4-byte-aligned
(due to 14-byte Ether headers). kernel bcopy is poorly tune for this.
Replace bcopy() with inline code tuned to minimize accesses
to DMA buffers, which aren't uncached on mips.

Tested on 5000/240 (3MAXPLUS) and 3000/700 (sandpiper) (mjacob@feral.com)
 1.7 22-Jul-1997  jonathan branches: 1.7.2;
Garbage-collect __BROKEN_INDIRECT_CONFIG from /sys/dev/tc
 1.6 17-Mar-1997  thorpej #include <net/if_media.h>
 1.5 15-Mar-1997  cgd fix botches in is's new ARP changes
 1.4 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.3 05-Dec-1996  cgd branches: 1.3.6;
update these so they compile whether or not __BROKEN_INDIRECT_CONFIG
is defined.
 1.2 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
 1.1 18-Apr-1996  cgd restructure to take advantage of config's (relatively) new 'attach'
specifiers. Many #ifdefs and much other nastiness removed.
 1.3.6.1 09-Mar-1997  is netinet/if_ether.h -> netinet/if_inarp.h
 1.7.2.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.17.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.17.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.17.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.17.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.21.16.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.21.16.1 12-Feb-2005  yamt sync with head.
 1.21.14.1 29-Apr-2005  kent sync with -current
 1.21.6.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.6.1 04-Feb-2005  skrll Sync with HEAD.
 1.23.4.2 03-Sep-2007  yamt sync with head.
 1.23.4.1 21-Jun-2006  yamt sync with head.
 1.24.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.24.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.24.10.1 19-Apr-2006  elad sync with head.
 1.24.8.1 01-Apr-2006  yamt sync with head.
 1.24.6.1 22-Apr-2006  simonb Sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.27.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.29.36.1 02-Jun-2008  mjf Sync with HEAD.
 1.30.18.1 13-May-2009  jym Sync with HEAD.

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

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.23 23-Feb-2022  andvar fix various typos in comments, mainly immediatly/immediately/,
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.
 1.22 22-Jun-2017  flxd spelling (DEC called it "TURBOchannel")
 1.21 04-Apr-2008  tsutsui branches: 1.21.48; 1.21.68;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.20 31-Mar-2006  thorpej branches: 1.20.58;
Use ANSI function decls, apply static.
 1.19 30-Mar-2006  thorpej Use device_private().
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10; 1.18.12;
merge ktrace-lwp.
 1.17 04-Feb-2005  perry branches: 1.17.6;
de-__P
 1.16 22-Jan-2003  mhitch branches: 1.16.2; 1.16.10; 1.16.12;
Lance chip needs to be accessed in sparse address space for alpha. Fixes
Turbochannel Ethernet card on Alpha 3000 systems.
 1.15 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.14 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 13-Nov-2001  lukem branches: 1.12.10;
add/cleanup RCSIDs
 1.11 30-Mar-2000  augustss branches: 1.11.6; 1.11.8;
Remove register declarations.
 1.10 04-Mar-1999  nisimura branches: 1.10.8;
- Nuke "PMAD-BA " match string because it is an internal name of IOASIC
assisted LANCE circuit found only in IOASIC DECstations. This file is
for 3MAX builtin and PMAD-AA TURBOchannel option card.
 1.9 21-Jul-1998  drochner adapt to LANCE driver split
 1.8 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.7 22-Jul-1997  jonathan Garbage-collect __BROKEN_INDIRECT_CONFIG from /sys/dev/tc
 1.6 17-Mar-1997  thorpej #include <net/if_media.h>
 1.5 15-Mar-1997  cgd fix botches in is's new ARP changes
 1.4 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.3 05-Dec-1996  cgd branches: 1.3.6;
update these so they compile whether or not __BROKEN_INDIRECT_CONFIG
is defined.
 1.2 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
 1.1 18-Apr-1996  cgd restructure to take advantage of config's (relatively) new 'attach'
specifiers. Many #ifdefs and much other nastiness removed.
 1.3.6.1 09-Mar-1997  is netinet/if_ether.h -> netinet/if_inarp.h
 1.10.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.11.6.1 14-Nov-2001  nathanw Catch up to -current.
 1.12.10.1 27-Jan-2003  jmc Pullup revisions 1.15-1.16 (requested by mhitch in ticket #1118)
Lance chip needs to be accessed in sparse address space for alpha.
Fixes Turbochannel Ethernet card on Alpha 3000 systems.
 1.16.12.1 12-Feb-2005  yamt sync with head.
 1.16.10.1 29-Apr-2005  kent sync with -current
 1.16.2.1 04-Feb-2005  skrll Sync with HEAD.
 1.17.6.1 21-Jun-2006  yamt sync with head.
 1.18.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.18.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.18.10.1 19-Apr-2006  elad sync with head.
 1.18.8.1 01-Apr-2006  yamt sync with head.
 1.18.6.1 22-Apr-2006  simonb Sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.20.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.21.68.1 28-Aug-2017  skrll Sync with HEAD
 1.21.48.1 03-Dec-2017  jdolecek update from HEAD
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 04-Feb-2005  perry de-__P
 1.5 07-Aug-2003  agc branches: 1.5.8; 1.5.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 15-Mar-1997  is branches: 1.4.56;
New ARP system, supports IPv4 over any hardware link.

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

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

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
 1.2 18-Apr-1996  cgd restructure to take advantage of config's (relatively) new 'attach'
specifiers. Many #ifdefs and much other nastiness removed.
 1.1 20-Dec-1995  cgd Machine-independent TurboChannel LANCE driver. As-is, this driver
should work properly with:
(1) LANCE chips hanging off the system IOCTL asic,
(2) LANCE chips TurboChannel option boards.
Support for various PMAX-family baseboard options isn't yet in this
file, but should be easy to add.
 1.3.8.1 09-Mar-1997  is netinet/if_ether.h -> netinet/if_inarp.h
 1.4.56.4 04-Feb-2005  skrll Sync with HEAD.
 1.4.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.56.1 03-Aug-2004  skrll Sync with HEAD
 1.5.10.1 12-Feb-2005  yamt sync with head.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.16 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.15 07-May-2021  thorpej branches: 1.15.6;
A small bit of const poisoning.
 1.14 24-Apr-2021  thorpej branches: 1.14.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.13 04-Jun-2011  tsutsui branches: 1.13.70;
Split device_t/softc. pmax is tested on GXemul, compile test only for alpha.
 1.12 31-Mar-2006  thorpej branches: 1.12.86; 1.12.92; 1.12.96;
Use ANSI function decls, apply static.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.6; 1.11.8; 1.11.10; 1.11.12;
merge ktrace-lwp.
 1.10 26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.9 25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.8 27-Feb-2005  perry branches: 1.8.4;
nuke trailing whitespace
 1.7 26-Aug-2004  drochner branches: 1.7.4; 1.7.6;
turn the (unused) ioasic_submatch() function into something useful, use
the locator passing variant of config_found(), get rid of the macros
hiding cfdata accesses and include "locators.h" from the .c file only
 1.6 27-Sep-2003  tsutsui Use strlcpy() rather than strncpy() + `\0' termination.
 1.5 26-Sep-2003  tsutsui Remove casts and use %x in printf for tc_offset_t,
which is int32_t on both alpha and pmax.
 1.4 01-Jan-2003  thorpej branches: 1.4.2;
Use aprint_normal() in cfprint routines.
 1.3 13-Nov-2001  lukem add/cleanup RCSIDs
 1.2 16-Mar-1999  simonb branches: 1.2.20; 1.2.22;
Add NetBSD RCS id on first line.
 1.1 15-Mar-1999  jonathan MI ioasic softc and child-device structs, gc duplicate struct definitions.
Add MI ioasic functions, but dont enable on alpha until tested.
 1.2.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.20.2 03-Jan-2003  thorpej Sync with HEAD.
 1.2.20.1 14-Nov-2001  nathanw Catch up to -current.
 1.4.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.2 03-Sep-2004  skrll Sync with HEAD
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.8.4.1 21-Jun-2006  yamt sync with head.
 1.11.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.11.10.1 19-Apr-2006  elad sync with head.
 1.11.8.1 01-Apr-2006  yamt sync with head.
 1.11.6.1 22-Apr-2006  simonb Sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.96.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.12.92.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.86.1 12-Jun-2011  rmind sync with head
 1.13.70.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.13.70.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.14.2.1 13-May-2021  thorpej Sync with HEAD.
 1.15.6.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 27-Feb-2005  perry nuke trailing whitespace
 1.7 07-Aug-2003  agc branches: 1.7.8; 1.7.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 17-Jul-2000  thorpej branches: 1.6.24;
Define IOASIC_DMA_BLOCKSIZE (4096 bytes).
 1.5 17-Jul-2000  thorpej G/c some unused (and incorrect, for our usage) definitions.
 1.4 17-Jul-2000  thorpej Make sure to get the upper 5 bits of the page address mixed in
in IOASIC_DMA_ADDR(), as the le_ioasic attachment does. Noted
by Gregory McGarry.
 1.3 28-May-2000  gmcgarry branches: 1.3.2;
Merge pmax and alpha ISDN register definitions.
 1.2 03-Feb-2000  nisimura branches: 1.2.2;
Merge IOASIC register definitions.
 1.1 27-May-1998  thorpej branches: 1.1.14;
Add a placeholder file to be used until the Alpha and DECstation ioasic
register descriptions can be sanely merged.
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.2.3 18-Jul-2000  thorpej Pull up rev. 1.6:
Define IOASIC_DMA_BLOCKSIZE (4096 bytes).
 1.3.2.2 18-Jul-2000  thorpej Pull up rev. 1.5:
G/c some unused (and incorrect, for our usage) definitions.
 1.3.2.1 18-Jul-2000  thorpej Pull up rev. 1.4:
Make sure to get the upper 5 bits of the page address mixed in
in IOASIC_DMA_ADDR(), as the le_ioasic attachment does. Noted
by Gregory McGarry.
 1.6.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.24.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.23 07-May-2021  thorpej A small bit of const poisoning.
 1.22 04-Jun-2011  tsutsui branches: 1.22.72;
Split device_t/softc. pmax is tested on GXemul, compile test only for alpha.
 1.21 20-Feb-2011  matt branches: 1.21.2;
Add some missing includes of <sys/device.h>
 1.20 12-May-2009  cegger branches: 1.20.4; 1.20.6; 1.20.8;
struct device * -> device_t, no functional changes intended.
 1.19 11-Dec-2005  christos branches: 1.19.74; 1.19.90;
merge ktrace-lwp.
 1.18 01-Jun-2005  drochner fix cast-qual fallout
 1.17 04-Feb-2005  perry de-__P
 1.16 26-Aug-2004  drochner branches: 1.16.4; 1.16.6;
turn the (unused) ioasic_submatch() function into something useful, use
the locator passing variant of config_found(), get rid of the macros
hiding cfdata accesses and include "locators.h" from the .c file only
 1.15 26-Sep-2003  mycroft Fix off-by-one problem in array size.
 1.14 17-Oct-2000  nisimura branches: 1.14.24;
Remove sc_lance_dmam field from ioasic_softc structure. It was obsoluted
by the removal of ioasic_lance_dma_setup() made in if_le_ioasic.c 1.15.
 1.13 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.12 15-Mar-2000  nisimura branches: 1.12.2;
Eliminate unused sc_cookie field of struct ioasic_softc.
 1.11 15-Nov-1999  nisimura Make sure TC_IPL_xxx synonymous with IPL_xxx.
 1.10 01-Oct-1999  nisimura branches: 1.10.2; 1.10.8;
- Remove defunct codes and arrange consistency between pmax and alpha.
- Reduce 'ioasic_base' expose.
 1.9 09-Sep-1999  nisimura Use bus_dmamap_load() to obtain 128KB chunk for LANCE merging codes from
NetBSD/alpha. Tested ok with DEC3000 and DECstation.
 1.8 28-Mar-1999  drochner add fields for bus_apace tag and handle to ioasic_softc
 1.7 17-Mar-1999  ross prototype ioasicprint
XXX pmax XXX I think someone is using the MD proto and the MI func on pmax
 1.6 15-Mar-1999  jonathan MI ioasic softc and child-device structs, gc duplicate struct definitions.
Add MI ioasic functions, but dont enable on alpha until tested.
 1.5 19-Jan-1998  thorpej Don't prototype ioasic_lance_dma_setup() on the Alpha.
 1.4 12-Jan-1998  thorpej Adjust for changes in config.
 1.3 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all
TCCF_*_UNKNOWN uses in tc code with the native names from locators.h
 1.2 17-Mar-1996  jonathan Additional fixes to complete the NetBSD/1.1B config changes:

Rename the extern declaration of `tccd' and `ioasiccd' in
src/sys/dev/tc/{tvar.h,ioasicvar.h", respectively, to be
`tc_cd' and `ioasic_cd', to match the 1.1B-style definitions.
 1.1 20-Dec-1995  cgd autoconfiguration information for the TurboChannels System ("IOCTL") ASIC
found in many DECstations and all of the TC-bus Alphas. This is
provided so that the machine-independent TC if_le driver will be able
to use it.
 1.10.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.14.24.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.24.5 04-Feb-2005  skrll Sync with HEAD.
 1.14.24.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.24.3 18-Sep-2004  skrll Sync with HEAD.
 1.14.24.2 03-Sep-2004  skrll Sync with HEAD
 1.14.24.1 03-Aug-2004  skrll Sync with HEAD
 1.16.6.1 12-Feb-2005  yamt sync with head.
 1.16.4.1 29-Apr-2005  kent sync with -current
 1.19.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.74.1 16-May-2009  yamt sync with head
 1.20.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.20.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.4.2 12-Jun-2011  rmind sync with head
 1.20.4.1 05-Mar-2011  rmind sync with head
 1.21.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.22.72.1 13-May-2021  thorpej Sync with HEAD.
 1.5 22-Jul-1997  jonathan Move sys/dev/tc/mcclockvar.h -> sys/dev/dec/mcclockvar.h.
Update pmax clock code.
 1.4 22-Jun-1997  jonathan Clone Alpha ``cpu-independent'' clock API headers into sys/dev/tc/,
to share them with pmax.
 1.3 07-Apr-1997  cgd clean up NetBSD RCS ID strings
 1.2 17-Apr-1996  cgd branches: 1.2.2;
fix copyrights
 1.1 17-Apr-1996  cgd clean up clock handling: clock drivers are now seperate from the
chip-independent clock code. 'clock' has been renamed 'mcclock' 'clock'
has been renamed 'mcclock' (since it's a driver for that particular
clock, and since eventually there may be another clock chip driver),
and now attaches via seperate match/attach functions to both TC and ISA.
This removes a whole lot of #ifdefs...
 1.2.2.1 01-Jun-1997  cgd sync the nwscons branch up with yesterday's version of the trunk.
Lots of conflicts/changes because of the RCS Id format changes.
Also, a few cleanups and corrections.
 1.64 06-Dec-2021  abs Add WSDISPLAYIO_GET_FBINFO support to most TURBOchannel framebuffers

This adds WSDISPLAYIO_GET_FBINFO to cfb, mfb, sfb, tfb and xcfb
TURBOchannel framebuffers as used by pmax and alpha

It does not add support to px and pxg (they handle ioctls in common
code in stic.c and more careful wiring is required)

These changes allow an Xswfb X server to use the framebuffer
directly, albeit without any special acceleration

A subsequent change will re-enable X server building on pmax, and
also hopefully switch alpha from Xorg 1.10 to 1.20
 1.63 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.62 24-Apr-2021  thorpej branches: 1.62.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.61 10-Nov-2019  chs branches: 1.61.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.60 24-Jan-2018  riastradh branches: 1.60.4;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.59 04-Nov-2013  christos add __USE() for unused volatile variables, so that we generate the same code.
 1.58 11-Jan-2012  macallan branches: 1.58.6; 1.58.10;
adjust wsfont_find()
 1.57 13-Nov-2010  uebayasi branches: 1.57.8; 1.57.12;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.56 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.55 15-May-2010  tsutsui Set RI_NO_AUTO in ri_flg if *fb_common_init() is invoked from cnattach.
Untested.
 1.54 22-Aug-2009  tsutsui branches: 1.54.2; 1.54.4;
u_intNN_t -> uintNN_t
 1.53 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.52 09-Jul-2008  joerg branches: 1.52.2;
- device/softc split
- make sfbplus at least compilable
 1.51 26-May-2008  nisimura branches: 1.51.2; 1.51.4;
- 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.50 19-Oct-2007  ad branches: 1.50.16; 1.50.18; 1.50.20; 1.50.22;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.49 04-Mar-2007  yamt branches: 1.49.2; 1.49.14; 1.49.16; 1.49.20;
fix fallout from caddr_t changes.
 1.48 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.47 12-Apr-2006  jmmv branches: 1.47.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.46 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.45 30-Mar-2006  thorpej Use device_private().
 1.44 11-Dec-2005  christos branches: 1.44.4; 1.44.6; 1.44.8; 1.44.10; 1.44.12;
merge ktrace-lwp.
 1.43 27-Feb-2005  perry branches: 1.43.4;
nuke trailing whitespace
 1.42 02-Jan-2005  mhitch branches: 1.42.2; 1.42.4;
Fix and simplify incorrect check for screen blanking in WSDISPLAYIO_SVIDEO.
 1.41 20-Dec-2003  nisimura - Minor coding modifications for VDAC register access.
- De-__P() this time.
Tested valid with 4MAXINE.
 1.40 17-Dec-2003  ad - Restore the display to a sane state when leaving mapped mode.
- OR updates into sc_changed, and protect with spltty()/splx().
 1.39 13-Nov-2003  chs eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.38 27-Oct-2003  chs uninitialized variables
 1.37 29-Jun-2003  fvdl branches: 1.37.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.36 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.35 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.34 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.33 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.32 17-Mar-2002  atatat branches: 1.32.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.31 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.30 13-Mar-2002  ad Set RI_FORCEMONO so that wscons doesn't try to use colors (mfb is an 8-bpp
device with a depth of 1).
 1.29 13-Nov-2001  lukem add/cleanup RCSIDs
 1.28 22-Aug-2001  nisimura Nuke fb_devconfig data structure which was found unnecessary to have.
 1.27 05-Aug-2001  jdolecek use unsigned variable types as appropriate
 1.26 16-Jan-2001  nisimura branches: 1.26.2; 1.26.4;
- relocate the code to place sprite cursor inside interrupt handlers
called on every virtical replace.
- efforts to make the code strucutures similar across TC framebuffers.
 1.25 13-Sep-2000  nisimura Found glyph pixel order inverted on screen.
 1.24 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.23 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.22 16-Mar-2000  nisimura branches: 1.22.4;
Place 34 by 80 console at the center of screen.
 1.21 14-Mar-2000  nisimura Switch to improved flexible video console text rasterizer provided by
rasops and wsfont.
 1.20 06-Dec-1999  drochner update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.19 29-Nov-1999  nisimura Const poisoning.
 1.18 19-Oct-1999  nisimura branches: 1.18.2;
Enable 'WSSCREEN_REVERSE' scr-capability.
 1.17 02-Aug-1999  nisimura branches: 1.17.2; 1.17.4;
- Fix MX framebuffer size which should occupy 2MB in address range.
- Restore 72Hz interrupt service mistakenly ruined in the previous commit.
 1.16 30-Jul-1999  nisimura - Fix TX 66Hz interrupt handling. Verified ok with PMAG-JA as an 8bpp
console. XXX troubles in cursor color.
- Typo in comments of MX.
 1.15 25-Jun-1999  nisimura - Show 1bpp for MX during configuration stage.
- Replace memory layout 'struct' with array/pointer access.
 1.14 24-Jun-1999  nisimura - Hide memory mapped VDAC hardware register layouts using the array
element access instead of C bitfield (hello, BCPL).
- XXX Some TURBOchannel framebuffers might need shutdownhooks(). It
seems not necessarily hardware sprite cursor images are re-initialized
by DECstation PROMs upon exits from kernel.
- XXX It'd be an arguable point to allow user programs to change the
shade of gray freely for pixel value 0 and 1.
 1.13 23-Jun-1999  nisimura - Allow to choose the 'color' of sprite cursor. Only red cmap makes sense.
- Drop TC Alpha support (OSF/1 and Digital UNIX never supports PMAG-AA).
 1.12 23-Jun-1999  nisimura - Fix an error in the depth of PMAG-AA MX. This driver can take 72Hz
virtical video retrace interrupt and was verified ok on Nanao grayscale
monitor. XXX seems still confusion/mistake on Bt431 cursor image
manipulation.
 1.11 07-May-1999  nisimura - Sweep abit preparing for code merge to have common 'vdacops' across
various graphics cards.
 1.10 29-Mar-1999  nisimura branches: 1.10.4;
- Unnecessary to have '#include <machine/autoconf.h>' for those.
 1.9 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.8 15-Jan-1999  thorpej __pmax__ -> pmax, like other ports.
 1.7 11-Jan-1999  drochner remove dummy "load_font" entries
 1.6 14-Dec-1998  nisimura - Fix typos in commentary description.
 1.5 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


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

by someone!
 1.4 18-Nov-1998  nisimura - Fix cursor image handling bugs escaped in last commit.
 1.3 09-Nov-1998  nisimura - Fix many errors in cursor image manipulation. Hardware expect 2
bit/pixel format, not planer format. Assign MSB for cursor mask and
LSB for cursor image, where 10 means mask color and 11 for image color.
Image bit order of Bt431 and Bt459 are opposite to MIPS/Alpha processors
while IMS G332 and DC503 (PCC) are indentical.
- Assume that cursor images are 32 pixel padded as ULTRIX/DU ws interface
do. It's natural to X server.
- XXX Vast majority of codes are duplicated between mfb<->tfb and cfb<->sfb.
Code sharing might be achieved in the context of TGA/SFB+ merge.
 1.2 30-Oct-1998  nisimura - Assign copyright terms.
 1.1 29-Oct-1998  nisimura - Introduce MI NWSCONS drivers for TURBOchannel framebuffer option cards.

N.B., Digital UNIX never supports neither PMAG-AA (mfb) nor PMAG-BA (cfb)
for TC Alphas. PMAG-DV (xcfb) is Personal DECstation built in. All should
be good for console, but need much works for cursor/colormap completeness.
 1.10.4.3 02-Aug-1999  thorpej Update from trunk.
 1.10.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.10.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.17.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.17.2.1 20-Oct-1999  thorpej Sync w/ trunk.
 1.18.2.2 19-Oct-1999  nisimura Enable 'WSSCREEN_REVERSE' scr-capability.
 1.18.2.1 19-Oct-1999  nisimura file mfb.c was added on branch fvdl-softdep on 1999-10-19 00:49:35 +0000
 1.22.4.2 16-Aug-2001  tv Pullup [jdolecek]:

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

Use unsigned variable types to make bounds checking more correct.
 1.22.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.26.4.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.26.4.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.26.4.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.26.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.26.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.26.4.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.26.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.26.2.5 01-Aug-2002  nathanw Catch up to -current.
 1.26.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.26.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.26.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.26.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.32.4.1 15-Jul-2002  gehenna catch up with -current.
 1.37.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.37.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.37.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.37.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.37.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.37.2.1 03-Aug-2004  skrll Sync with HEAD
 1.42.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.42.2.1 29-Apr-2005  kent sync with -current
 1.43.4.3 27-Oct-2007  yamt sync with head.
 1.43.4.2 03-Sep-2007  yamt sync with head.
 1.43.4.1 21-Jun-2006  yamt sync with head.
 1.44.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.44.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.44.10.1 19-Apr-2006  elad sync with head.
 1.44.8.2 24-May-2006  yamt sync with head.
 1.44.8.1 01-Apr-2006  yamt sync with head.
 1.44.6.1 22-Apr-2006  simonb Sync with head.
 1.44.4.1 09-Sep-2006  rpaulo sync with head
 1.47.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.49.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.49.16.1 06-Nov-2007  matt sync with HEAD
 1.49.14.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.49.2.1 23-Oct-2007  ad Sync with head.
 1.50.22.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.50.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.50.20.3 11-Aug-2010  yamt sync with head.
 1.50.20.2 16-Sep-2009  yamt sync with head
 1.50.20.1 04-May-2009  yamt sync with head.
 1.50.18.1 04-Jun-2008  yamt sync with head
 1.50.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.50.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.50.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.51.4.1 19-Oct-2008  haad Sync with HEAD.
 1.51.2.1 18-Jul-2008  simonb Sync with head.
 1.52.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.54.4.2 05-Mar-2011  rmind sync with head
 1.54.4.1 30-May-2010  rmind sync with head
 1.54.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.57.12.1 18-Feb-2012  mrg merge to -current.
 1.57.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.57.8.1 17-Apr-2012  yamt sync with head
 1.58.10.1 18-May-2014  rmind sync with head
 1.58.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.60.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.61.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.62.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 27-Feb-2005  perry nuke trailing whitespace
 1.2 07-Jan-2000  ad branches: 1.2.6; 1.2.30; 1.2.38; 1.2.40;
s/NVRCSR/NVR_CSR/
 1.1 29-Nov-1999  ad branches: 1.1.2;
Register definitions for the PrestoServe option board (I've had this for
months and if it doesn't go here it'll die).
 1.1.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.40.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.38.1 29-Apr-2005  kent sync with -current
 1.2.30.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.6.1 07-Jan-2000  bouyer file nvrreg.h was added on branch thorpej_scsipi on 2000-11-20 11:43:15 +0000
 1.41 10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.40 04-Nov-2013  christos branches: 1.40.30;
add __USE() for unused volatile variables, so that we generate the same code.
 1.39 27-Oct-2012  chs branches: 1.39.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.38 06-Nov-2010  uebayasi branches: 1.38.8; 1.38.18;
Include uvm/uvm.h to access UVM internal.
 1.37 22-Aug-2009  tsutsui branches: 1.37.2; 1.37.4;
u_intNN_t -> uintNN_t
 1.36 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.35 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.34 09-Jul-2008  joerg branches: 1.34.8;
- device/softc split
- make sfbplus at least compilable
 1.33 28-Apr-2008  martin branches: 1.33.2; 1.33.4; 1.33.6;
Remove clause 3 and 4 from TNF licenses
 1.32 05-Apr-2008  cegger branches: 1.32.2; 1.32.4;
use aprint_*_dev and device_xname
 1.31 19-Oct-2007  ad branches: 1.31.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.30 04-Mar-2007  yamt branches: 1.30.2; 1.30.14; 1.30.16; 1.30.20;
fix fallout from caddr_t changes.
 1.29 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.28 31-Mar-2006  thorpej branches: 1.28.14;
Use ANSI function decls, apply static.
 1.27 30-Mar-2006  thorpej Use device_private().
 1.26 11-Dec-2005  christos branches: 1.26.4; 1.26.6; 1.26.8; 1.26.10; 1.26.12;
merge ktrace-lwp.
 1.25 08-Dec-2005  yamt use VM_PAGE_TO_PHYS macro.
 1.24 08-Jun-2005  he branches: 1.24.2;
Add __UNVOLATILE() to a cast when calling memset() to appease -Wcast-qual.
 1.23 27-Feb-2005  perry nuke trailing whitespace
 1.22 02-Jan-2005  mhitch branches: 1.22.2; 1.22.4;
Fix a 3 year old error which caused px_init() to fail. Fixes PR 28798.
 1.21 27-Oct-2003  chs branches: 1.21.2; 1.21.6;
uninitialized variables
 1.20 23-Oct-2003  mycroft NULL -> 0
 1.19 29-Jun-2003  fvdl branches: 1.19.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.18 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.17 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.16 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.15 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.14 02-Jun-2002  drochner move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
 1.13 17-Mar-2002  atatat branches: 1.13.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.12 12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.11 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.10 13-Nov-2001  lukem add/cleanup RCSIDs
 1.9 18-Sep-2001  ad Beef up the stic X interface, and tighten a few screws here and there.
 1.8 18-Sep-2001  wiz Give initiali[sz]e all the "i"s it deserves.
 1.7 04-Jul-2001  ad branches: 1.7.2; 1.7.4;
Don't print the module description, since it doesn't mean much.
 1.6 22-Apr-2001  thorpej Use uvm_pageboot_alloc() rather than pmap_steal_memory().
 1.5 04-Mar-2001  ad branches: 1.5.2;
Make this work on alpha, and fix some other bogons.
 1.4 17-Dec-2000  ad Add wscons drivers for the DEC PixelStamp graphics accelerators.
 1.3 13-Apr-1999  ad branches: 1.3.2;
Removed pending write of fully-functional MI driver.
 1.2 12-Jan-1998  thorpej branches: 1.2.10;
Adjust for changes in config.
 1.1 08-Nov-1997  jonathan branches: 1.1.2;
Commit `pacifier' driver for turbochannel PMAG-C option card:n
just acknowledge interrupts from the PMAG-C.
 1.1.2.2 08-Nov-1997  jonathan Commit `pacifier' driver for turbochannel PMAG-C option card:n
just acknowledge interrupts from the PMAG-C.
 1.1.2.1 08-Nov-1997  jonathan file px.c was added on branch netbsd-1-3 on 1997-11-08 07:27:50 +0000
 1.2.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.3 23-Apr-2001  bouyer Sync with HEAD.
 1.3.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.3.2.1 05-Jan-2001  bouyer Sync with HEAD
 1.5.2.9 18-Oct-2002  nathanw Catch up to -current.
 1.5.2.8 20-Jun-2002  nathanw Catch up to -current.
 1.5.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.5.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.5.2.5 08-Jan-2002  nathanw Catch up to -current.
 1.5.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.5.2.3 21-Sep-2001  nathanw Catch up to -current.
 1.5.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.5.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.7.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.7.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.4.1 20-Jun-2002  gehenna catch up with -current.
 1.19.2.8 11-Dec-2005  christos Sync with head.
 1.19.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.19.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.19.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.19.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.19.2.1 03-Aug-2004  skrll Sync with HEAD
 1.21.6.1 16-Mar-2005  tron Pull up revision 1.22 (requested by mhitch in ticket #1063):
Fix a 3 year old error which caused px_init() to fail. Fixes PR 28798.
 1.21.2.1 16-Mar-2005  tron Pull up revision 1.22 (requested by mhitch in ticket #1063):
Fix a 3 year old error which caused px_init() to fail. Fixes PR 28798.
 1.22.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.22.2.1 29-Apr-2005  kent sync with -current
 1.24.2.3 27-Oct-2007  yamt sync with head.
 1.24.2.2 03-Sep-2007  yamt sync with head.
 1.24.2.1 21-Jun-2006  yamt sync with head.
 1.26.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.26.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.26.10.1 19-Apr-2006  elad sync with head.
 1.26.8.1 01-Apr-2006  yamt sync with head.
 1.26.6.1 22-Apr-2006  simonb Sync with head.
 1.26.4.1 09-Sep-2006  rpaulo sync with head
 1.28.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.30.16.1 06-Nov-2007  matt sync with HEAD
 1.30.14.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.30.2.1 23-Oct-2007  ad Sync with head.
 1.31.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.31.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.32.4.4 16-Sep-2009  yamt sync with head
 1.32.4.3 16-May-2009  yamt sync with head
 1.32.4.2 04-May-2009  yamt sync with head.
 1.32.4.1 16-May-2008  yamt sync with head.
 1.32.2.1 18-May-2008  yamt sync with head.
 1.33.6.1 19-Oct-2008  haad Sync with HEAD.
 1.33.4.1 18-Jul-2008  simonb Sync with head.
 1.33.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.34.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.4.1 05-Mar-2011  rmind sync with head
 1.37.2.2 09-Nov-2010  uebayasi Reduce diff from trunk.
 1.37.2.1 28-May-2010  uebayasi Fix build.
 1.38.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.38.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.38.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.38.8.1 30-Oct-2012  yamt sync with head
 1.39.2.1 18-May-2014  rmind sync with head
 1.40.30.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.37 20-Jul-2022  thorpej In the Alpha tc_syncbus(), we need to issue a MB because WMB does not
order reads with respect to writes. Remove now-redundant tc_wmb()
calls before tc_syncbus().

NFC on MIPS other than removing a redundant wbflush() (tc_wmb() followed
by tc_syncbus()).
 1.36 10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.35 04-Nov-2013  christos branches: 1.35.30;
add __USE() for unused volatile variables, so that we generate the same code.
 1.34 13-Mar-2012  elad branches: 1.34.2; 1.34.4;
Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

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

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

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

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.33 22-Aug-2009  tsutsui branches: 1.33.12; 1.33.16;
u_intNN_t -> uintNN_t
 1.32 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.31 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.30 09-Jul-2008  joerg branches: 1.30.8;
- device/softc split
- make sfbplus at least compilable
 1.29 28-Apr-2008  martin branches: 1.29.2; 1.29.4; 1.29.6;
Remove clause 3 and 4 from TNF licenses
 1.28 19-Oct-2007  ad branches: 1.28.16; 1.28.18; 1.28.20;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.27 04-Mar-2007  yamt branches: 1.27.2; 1.27.14; 1.27.16; 1.27.20;
fix fallout from caddr_t changes.
 1.26 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.25 04-Jan-2007  elad branches: 1.25.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.24 21-Jul-2006  ad branches: 1.24.4;
- Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.23 15-May-2006  yamt - include kauth.h for kauth_authorize_generic.
- wrap a long line.
 1.22 14-May-2006  elad integrate kauth.
 1.21 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.20 30-Mar-2006  thorpej Use device_private().
 1.19 11-Dec-2005  christos branches: 1.19.4; 1.19.6; 1.19.8; 1.19.10; 1.19.12;
merge ktrace-lwp.
 1.18 27-Feb-2005  perry branches: 1.18.4;
nuke trailing whitespace
 1.17 27-Oct-2003  chs branches: 1.17.8; 1.17.10;
uninitialized variables
 1.16 23-Oct-2003  mycroft NULL -> 0
 1.15 29-Jun-2003  fvdl branches: 1.15.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.14 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.13 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.12 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.11 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.10 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 12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.8 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.7 13-Nov-2001  lukem add/cleanup RCSIDs
 1.6 18-Sep-2001  ad Beef up the stic X interface, and tighten a few screws here and there.
 1.5 04-Jul-2001  ad branches: 1.5.2; 1.5.4;
Don't print the module description, since it doesn't mean much.
 1.4 04-Mar-2001  ad branches: 1.4.2;
Make this work on alpha, and fix some other bogons.
 1.3 09-Jan-2001  ad - Make VDAC state per-board.
- Add an ioctl to reset the STIC.
- Add an ioctl to restore the screen contents from backing.
- Other tweaks.
 1.2 22-Dec-2000  ad branches: 1.2.2;
- Fix bugs, make this useful.
- Add ioctls to start and stop the co-processor (if present).
 1.1 17-Dec-2000  ad Add wscons drivers for the DEC PixelStamp graphics accelerators.
 1.2.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.2.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.2.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.2.2.1 22-Dec-2000  bouyer file pxg.c was added on branch thorpej_scsipi on 2001-01-05 17:36:28 +0000
 1.4.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.4.2.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.2.5 28-Feb-2002  nathanw Catch up to -current.
 1.4.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.4.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.4.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.4.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.5.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.5.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.5.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.17.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.17.8.1 29-Apr-2005  kent sync with -current
 1.18.4.5 27-Oct-2007  yamt sync with head.
 1.18.4.4 03-Sep-2007  yamt sync with head.
 1.18.4.3 26-Feb-2007  yamt sync with head.
 1.18.4.2 30-Dec-2006  yamt sync with head.
 1.18.4.1 21-Jun-2006  yamt sync with head.
 1.19.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.19.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.19.10.3 19-Apr-2006  elad sync with head.
 1.19.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.19.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.19.8.3 11-Aug-2006  yamt sync with head
 1.19.8.2 24-May-2006  yamt sync with head.
 1.19.8.1 01-Apr-2006  yamt sync with head.
 1.19.6.2 01-Jun-2006  kardel Sync with head.
 1.19.6.1 22-Apr-2006  simonb Sync with head.
 1.19.4.1 09-Sep-2006  rpaulo sync with head
 1.24.4.1 12-Jan-2007  ad Sync with head.
 1.25.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.27.16.1 06-Nov-2007  matt sync with HEAD
 1.27.14.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.27.2.1 23-Oct-2007  ad Sync with head.
 1.28.20.4 16-Sep-2009  yamt sync with head
 1.28.20.3 16-May-2009  yamt sync with head
 1.28.20.2 04-May-2009  yamt sync with head.
 1.28.20.1 16-May-2008  yamt sync with head.
 1.28.18.1 18-May-2008  yamt sync with head.
 1.28.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.28.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.29.6.1 19-Oct-2008  haad Sync with HEAD.
 1.29.4.1 18-Jul-2008  simonb Sync with head.
 1.29.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.30.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.33.16.1 05-Apr-2012  mrg sync to latest -current.
 1.33.12.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.33.12.1 17-Apr-2012  yamt sync with head
 1.34.4.1 18-May-2014  rmind sync with head
 1.34.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.35.30.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 27-Feb-2005  perry nuke trailing whitespace
 1.1 18-Sep-2001  ad branches: 1.1.2; 1.1.4; 1.1.8; 1.1.24; 1.1.32; 1.1.34;
Beef up the stic X interface, and tighten a few screws here and there.
 1.1.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.32.1 29-Apr-2005  kent sync with -current
 1.1.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 18-Sep-2001  thorpej file pxgvar.h was added on branch kqueue on 2002-01-10 19:58:41 +0000
 1.1.4.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.4.1 18-Sep-2001  fvdl file pxgvar.h was added on branch thorpej-devvp on 2001-10-01 12:46:26 +0000
 1.1.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.1.2.1 18-Sep-2001  nathanw file pxgvar.h was added on branch nathanw_sa on 2001-09-21 22:36:16 +0000
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.89 06-Dec-2021  abs Add WSDISPLAYIO_GET_FBINFO support to most TURBOchannel framebuffers

This adds WSDISPLAYIO_GET_FBINFO to cfb, mfb, sfb, tfb and xcfb
TURBOchannel framebuffers as used by pmax and alpha

It does not add support to px and pxg (they handle ioctls in common
code in stic.c and more careful wiring is required)

These changes allow an Xswfb X server to use the framebuffer
directly, albeit without any special acceleration

A subsequent change will re-enable X server building on pmax, and
also hopefully switch alpha from Xorg 1.10 to 1.20
 1.88 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.87 24-Apr-2021  thorpej branches: 1.87.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.86 10-Nov-2019  chs branches: 1.86.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.85 24-Jan-2018  riastradh branches: 1.85.4;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.84 11-Jan-2012  macallan adjust wsfont_find()
 1.83 13-Nov-2010  uebayasi branches: 1.83.8; 1.83.12;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.82 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.81 15-May-2010  tsutsui Set RI_NO_AUTO in ri_flg if *fb_common_init() is invoked from cnattach.
Untested.
 1.80 22-Aug-2009  tsutsui branches: 1.80.2; 1.80.4;
u_intNN_t -> uintNN_t
 1.79 20-Aug-2009  tsutsui Use volatile on device register access.
 1.78 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.77 09-Jul-2008  joerg branches: 1.77.2;
- device/softc split
- make sfbplus at least compilable
 1.76 26-May-2008  nisimura branches: 1.76.2; 1.76.4;
- 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.75 19-Oct-2007  ad branches: 1.75.16; 1.75.18; 1.75.20; 1.75.22;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.74 05-Mar-2007  dogcow branches: 1.74.2; 1.74.14; 1.74.16; 1.74.20;
semimechanically convert 'void foo' -> 'void *foo', as part of the continuing
caddr_t fallout.
 1.73 04-Mar-2007  yamt fix fallout from caddr_t changes.
 1.72 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.71 12-Apr-2006  jmmv branches: 1.71.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.70 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.69 30-Mar-2006  thorpej Use device_private().
 1.68 11-Dec-2005  christos branches: 1.68.4; 1.68.6; 1.68.8; 1.68.10; 1.68.12;
merge ktrace-lwp.
 1.67 27-Feb-2005  perry branches: 1.67.4;
nuke trailing whitespace
 1.66 26-Feb-2005  simonb Remove some erroneous semicolons.
 1.65 02-Jan-2005  mhitch branches: 1.65.2; 1.65.4;
Change screen blanking to be like other *fb.c drivers (and to not call
sfb_screenblank() needlessly).
 1.64 20-Dec-2003  tsutsui - Add /* CONSTCOND */ where appropriate.
- Use SFBWRITE32() in recently added sfb_screenblank() too.
 1.63 20-Dec-2003  nisimura - Use volatile designations for memory writes to prevent compiler
change fallouts.
- De-__P() this time.
Tested valid with DEC3000/300 and 4MAXINE.
 1.62 17-Dec-2003  ad - Restore the display to a sane state when leaving mapped mode.
- OR updates into sc_changed, and protect with spltty()/splx().
 1.61 13-Nov-2003  chs eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.60 27-Oct-2003  chs uninitialized variables
 1.59 29-Jun-2003  fvdl branches: 1.59.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.58 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.57 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.56 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.55 19-Aug-2002  itohy Leaving overflow-sensitive code, very similar to what was fixed
in the previous changes to cfb.c / sfb.c / xcfb.c, would not be clever.
Just modify in the similar way.
 1.54 19-Aug-2002  itohy Make it compile again.
Hi, itojun!
 1.53 06-Aug-2002  itojun integer overflow. from silvio@qualys.com
 1.52 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.51 17-Mar-2002  atatat branches: 1.51.4; 1.51.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.50 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.49 13-Nov-2001  lukem add/cleanup RCSIDs
 1.48 22-Aug-2001  nisimura Use ri->ri_hw field for TC module base address.
 1.47 20-Aug-2001  nisimura Nuke fb_devconfig data structure which was found unnecessary to have.
224 byte saving in text+bss, and runtime.
 1.46 05-Aug-2001  jdolecek use unsigned variable types as appropriate
 1.45 20-Apr-2001  reinoud branches: 1.45.2;
Fix a few race conditions ... the VSYNC update flag could be cleared
resulting in a blank screen when f.e. a setcursor ioctl was called
after the screenblanker had enabled the screen again ... the actual
switching on was then never performed at VSYNC.

A simple |= instead of = does the trick ... just leave the other bits
on please :)
 1.44 19-Feb-2001  nisimura branches: 1.44.2;
Void-filling to honour SVIDEO ioctl call.
 1.43 19-Jan-2001  nisimura - paint underline on text honouring WSSCREEN_UNDERLINE.
- use accellerated painting for text cursor, should improve speed.
 1.42 16-Jan-2001  nisimura - relocate the code to place sprite cursor inside interrupt handlers
called on every virtical replace.
- efforts to make the code strucutures similar across TC framebuffers.
 1.41 15-Jan-2001  nisimura fix a typo and rearrange a comment about SFB register aliasing effect.
 1.40 15-Jan-2001  nisimura use ri_devcmap[] values directly, instead of calling rasops_unpack_attr().
-
 1.39 25-Nov-2000  nisimura Replace sfb_copycols() which can run better job in some degree.
It still fails on certain conditions, thus is left commented out.
copycols() is done by a generic routine which works correctly.
 1.38 27-Oct-2000  nisimura Fix errors in initializing the software copy of 256 entry colormap
stored in device softc. rasops_cmap[] array is orginazed in 256
iteration of 3 byte long RBG triplet, which does not match with
struct wsdisplay_cmap design.
 1.37 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.36 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.35 16-Mar-2000  nisimura branches: 1.35.4;
Retain rendering performance lossage by rasops, but suffering
flexibility in turn; this renderer is 2B stroke (less than 16 pixel
width) font only. If 1B stroke (less than 8 pixel width) font is
ever supported, the font data should be converted into 2B stroke
during font initialization process. 'wsfont_realize()' is to be
proposed in order to have 'CPU and/or accelerator hardware friendly'
format to squeeze maxinum performance.
 1.34 18-Feb-2000  nisimura Improvement on SFB enabled copycol(); still yet under development,
it miserably fails on corner cases.
 1.33 07-Jan-2000  enami Replace WSFONT_L2R/R2L with WSDISPLAY_FONTORDER_L2R/R2L.
 1.32 16-Dec-1999  ad Remove part of a bogus comment and put it in a more appropiate spot.
 1.31 15-Dec-1999  ad - Change prefix for Bt459 register defs to BT459_IREG to indicate that
these are indirectly accessed registers.
- Add defs for directly accessed registers to bt459reg.h.
 1.30 06-Dec-1999  drochner update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.29 04-Dec-1999  drochner some cleanup:
-don't set capabilities at compile time
-since our accelerated putchar() doesn't underline, don't claim so
-remove bogus character range check - fonts are not limited to ASCII
-use rasops_unpack_attr() instead of relying on rasops internals
 1.28 02-Dec-1999  drochner Convert to use rasops/wsfont, enabling colors.
For now, only the "putchar" and "copyrows" accelerations are used.
 1.27 29-Nov-1999  nisimura Const poisoning.
 1.26 09-Nov-1999  nisimura Fix errors in sfb_copycols() of the forward (left-to-right) case.
 1.25 05-Nov-1999  nisimura - Remove temporary hack to recognize PMAGD since SFB+ rendering function
is found not fully upward compatible to its predecessor. sfbp.c is now
under development.
- Reduce copycols() malfunction, but has still lot of troubles.
 1.24 27-Oct-1999  nisimura Add a temporary kludge to recognize PMAGD (HX+) as 'sfb' hoping 8bpp
configration of it is compatible enough with PMAGB-BA.
 1.23 26-Oct-1999  nisimura - Fix bogus cursor drawn by sfb_cursor(). From eye-opening input from R.C.
Dowdeswell.
- Remove write memory barriers in sfb_copyrows() as dst. is always distant
enough from src. for copying rows.
 1.22 22-Oct-1999  nisimura Fill always erased regions with bg color. Fix an issue revealed by
"print -n '\033[7m'; ls".
 1.21 19-Oct-1999  nisimura branches: 1.21.2;
Preliminary import of 'SFB enhanced' text renderer with many caveats
to be corrected. Text drawing is now improved significantly, but;
cursor is drawn incorrectly, copycols() trashes a screen, 'standout
(\033[7m)' results in lines reversed entirely until '\033[0m', and
possibly more issues. Not multi-colour, 8bpp only this moment. Costly
write memory barrier instrunctions should be eliminated using framebuffer
address aliasing technique for NetBSD/alpha.
 1.20 08-Oct-1999  nisimura branches: 1.20.2;
Arrange loop invariants and fix comment description error.
 1.19 05-Oct-1999  nisimura branches: 1.19.2;
SFB video base register is assigned with an inialial value before use;
according to ULTRIX/OSF1 code.
 1.18 25-Jun-1999  nisimura - Show 1bpp for MX during configuration stage.
- Replace memory layout 'struct' with array/pointer access.
 1.17 11-Jun-1999  nisimura - Errors in case analysis...
 1.16 11-Jun-1999  nisimura - Rework copycols() with SFB ASIC calls.
 1.15 07-May-1999  nisimura - Sweep abit preparing for code merge to have common 'vdacops' across
various graphics cards.
 1.14 29-Mar-1999  nisimura branches: 1.14.4;
- Unnecessary to have '#include <machine/autoconf.h>' for those.
 1.13 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.12 02-Mar-1999  nisimura - Make sfb_emulops standard feature of sfb wscons. Scrolling is now
acceptable. Still lacks of horizontal copy and glyph rendering with
SFB ASIC assistance. TGA could be benefitted in the similiar way.
 1.11 01-Mar-1999  nisimura - Fix cursor image validity check error in set_cursor().
 1.10 23-Feb-1999  nisimura - Introduce the first cut of faster wsdisplay_emulops exploiting SFB
accelerator potential. Need more work to finish replacing rcons.
Premilinary tests were done with DECstation and TC Alpha.
 1.9 19-Feb-1999  nisimura - Make sure SFB ROP register initialized with value 3.
- Turn off video signal during hardware initialization.
 1.8 15-Jan-1999  thorpej __pmax__ -> pmax, like other ports.
 1.7 11-Jan-1999  drochner remove dummy "load_font" entries
 1.6 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


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

by someone!
 1.5 18-Nov-1998  nisimura - Fix cursor image handling bugs escaped in last commit.
 1.4 14-Nov-1998  drochner use mi register definitions
 1.3 09-Nov-1998  nisimura - Fix many errors in cursor image manipulation. Hardware expect 2
bit/pixel format, not planer format. Assign MSB for cursor mask and
LSB for cursor image, where 10 means mask color and 11 for image color.
Image bit order of Bt431 and Bt459 are opposite to MIPS/Alpha processors
while IMS G332 and DC503 (PCC) are indentical.
- Assume that cursor images are 32 pixel padded as ULTRIX/DU ws interface
do. It's natural to X server.
- XXX Vast majority of codes are duplicated between mfb<->tfb and cfb<->sfb.
Code sharing might be achieved in the context of TGA/SFB+ merge.
 1.2 30-Oct-1998  nisimura - Assign copyright terms.
 1.1 29-Oct-1998  nisimura - Introduce MI NWSCONS drivers for TURBOchannel framebuffer option cards.

N.B., Digital UNIX never supports neither PMAG-AA (mfb) nor PMAG-BA (cfb)
for TC Alphas. PMAG-DV (xcfb) is Personal DECstation built in. All should
be good for console, but need much works for cursor/colormap completeness.
 1.14.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.14.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.20.2.8 23-Apr-2001  bouyer Sync with HEAD.
 1.20.2.7 12-Mar-2001  bouyer Sync with HEAD.
 1.20.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.20.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.20.2.4 08-Dec-2000  bouyer Sync with HEAD.
 1.20.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.20.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.20.2.1 20-Oct-1999  thorpej Sync w/ trunk.
 1.21.2.2 15-Nov-1999  fvdl Sync with -current
 1.21.2.1 19-Oct-1999  fvdl file sfb.c was added on branch fvdl-softdep on 1999-11-15 00:41:28 +0000
 1.35.4.3 04-Sep-2002  itojun pullup (itojun)

sys/arch/amiga/dev/grf_cv3d.c 1.11
sys/arch/hpcmips/dev/mq200.c 1.21
sys/arch/i386/i386/sys_machdep.c 1.64
sys/arch/luna68k/dev/lunafb.c 1.9
sys/arch/sparc/dev/bt_subr.c via patch
sys/arch/sparc64/dev/bt_subr.c via patch
sys/arch/sun3/dev/bt_subr.c via patch
sys/compat/ibcs2/ibcs2_stat.c 1.21-1.23
sys/dev/sun/bt_subr.c 1.3
sys/dev/tc/cfb.c 1.34
sys/dev/tc/sfb.c 1.53
sys/dev/tc/xcfb.c 1.29
integer overflow. reported by silvio@qualys.com
 1.35.4.2 16-Aug-2001  tv Pullup [jdolecek]:

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

Use unsigned variable types to make bounds checking more correct.
 1.35.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.44.2.9 18-Oct-2002  nathanw Catch up to -current.
 1.44.2.8 27-Aug-2002  nathanw Catch up to -current.
 1.44.2.7 13-Aug-2002  nathanw Catch up to -current.
 1.44.2.6 01-Aug-2002  nathanw Catch up to -current.
 1.44.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.44.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.44.2.3 21-Sep-2001  nathanw Catch up to -current.
 1.44.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.44.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.45.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.45.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.45.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.45.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.45.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.45.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.51.6.2 23-Aug-2002  lukem Pull up revision 1.54 (requested by enami in ticket #616):
Make it compile again.
Hi, itojun!
 1.51.6.1 07-Aug-2002  lukem Pull up revision 1.53 (requested by itojun in ticket #616):
integer overflow. from silvio@qualys.com
 1.51.4.2 29-Aug-2002  gehenna catch up with -current.
 1.51.4.1 15-Jul-2002  gehenna catch up with -current.
 1.59.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.59.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.59.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.59.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.59.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.59.2.1 03-Aug-2004  skrll Sync with HEAD
 1.65.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.65.2.1 29-Apr-2005  kent sync with -current
 1.67.4.3 27-Oct-2007  yamt sync with head.
 1.67.4.2 03-Sep-2007  yamt sync with head.
 1.67.4.1 21-Jun-2006  yamt sync with head.
 1.68.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.68.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.68.10.1 19-Apr-2006  elad sync with head.
 1.68.8.2 24-May-2006  yamt sync with head.
 1.68.8.1 01-Apr-2006  yamt sync with head.
 1.68.6.1 22-Apr-2006  simonb Sync with head.
 1.68.4.1 09-Sep-2006  rpaulo sync with head
 1.71.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.74.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.74.16.1 06-Nov-2007  matt sync with HEAD
 1.74.14.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.74.2.1 23-Oct-2007  ad Sync with head.
 1.75.22.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.75.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.75.20.3 11-Aug-2010  yamt sync with head.
 1.75.20.2 16-Sep-2009  yamt sync with head
 1.75.20.1 04-May-2009  yamt sync with head.
 1.75.18.1 04-Jun-2008  yamt sync with head
 1.75.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.75.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.75.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.76.4.1 19-Oct-2008  haad Sync with HEAD.
 1.76.2.1 18-Jul-2008  simonb Sync with head.
 1.77.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.80.4.2 05-Mar-2011  rmind sync with head
 1.80.4.1 30-May-2010  rmind sync with head
 1.80.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.83.12.1 18-Feb-2012  mrg merge to -current.
 1.83.8.1 17-Apr-2012  yamt sync with head
 1.85.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.86.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.87.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.42 06-Dec-2021  abs Add WSDISPLAYIO_GET_FBINFO support to sfbplus TURBOchannel framebuffer

Missed in previous change to cfb, mfb, sfb, tfb and xcfb
 1.41 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.40 24-Apr-2021  thorpej branches: 1.40.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.39 10-Nov-2019  chs branches: 1.39.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.38 24-Jan-2018  riastradh branches: 1.38.4;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.37 11-Jan-2012  macallan adjust wsfont_find()
 1.36 13-Nov-2010  uebayasi branches: 1.36.8; 1.36.12;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.35 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.34 15-May-2010  tsutsui Set RI_NO_AUTO in ri_flg if *fb_common_init() is invoked from cnattach.
Untested.
 1.33 22-Aug-2009  tsutsui branches: 1.33.2; 1.33.4;
u_intNN_t -> uintNN_t
 1.32 22-Aug-2009  tsutsui MALLOC() -> malloc()
 1.31 09-Jul-2008  joerg - device/softc split
- make sfbplus at least compilable
 1.30 26-May-2008  nisimura branches: 1.30.2; 1.30.4;
- 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.29 19-Oct-2007  ad branches: 1.29.16; 1.29.18; 1.29.20; 1.29.22;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.28 05-Mar-2007  dogcow branches: 1.28.2; 1.28.14; 1.28.16; 1.28.20;
semimechanically convert 'void foo' -> 'void *foo', as part of the continuing
caddr_t fallout.
 1.27 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 12-Apr-2006  jmmv branches: 1.26.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.25 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.24 30-Mar-2006  thorpej Use device_private().
 1.23 11-Dec-2005  christos branches: 1.23.4; 1.23.6; 1.23.8; 1.23.10; 1.23.12;
merge ktrace-lwp.
 1.22 27-Feb-2005  perry branches: 1.22.4;
nuke trailing whitespace
 1.21 04-Feb-2005  perry de-__P
 1.20 17-Dec-2003  ad branches: 1.20.8; 1.20.10;
- Restore the display to a sane state when leaving mapped mode.
- OR updates into sc_changed, and protect with spltty()/splx().
 1.19 13-Nov-2003  chs eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.18 02-Oct-2002  thorpej branches: 1.18.6;
Add trailing ; to CFATTACH_DECL.
 1.17 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16 19-Aug-2002  itohy Leaving overflow-sensitive code, very similar to what was fixed
in the previous changes to cfb.c / sfb.c / xcfb.c, would not be clever.
Just modify in the similar way.
 1.15 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.14 17-Mar-2002  atatat branches: 1.14.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.13 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.12 13-Nov-2001  lukem add/cleanup RCSIDs
 1.11 22-Aug-2001  nisimura Nuke fb_devconfig data structure which was found unnecessary to have.
 1.10 05-Aug-2001  jdolecek use unsigned variable types as appropriate
 1.9 27-Feb-2001  nisimura branches: 1.9.2; 1.9.4;
Change to exclude TC identification string PMAGD-AA because 8bpp can not
be handled with current implementation. sfbplus.c should be capable of
doing the right things for multiple depths by ultilizing SFB+ design.
 1.8 17-Jan-2001  nisimura managed to make this useful enough for screen editor.
- video base register value brings different scanline starting address
of framebuffer depending on VRAM chip column size.
many other issues left unsolved.
- text rendered in incorrect colours.
- acceleration codes should be reimplemented from scratch.
 1.7 16-Jan-2001  nisimura - make this more senseful 32bpp TC framebuffer. This is far less broken
than the preivous code. It can show readable characters on screen.
Tested only with 32bpp model of PMAGD opion card. Need more work for 8bpp.
- 2D accelleration will be revamped to ultilize SFBplus features.
- there seems much mulfunctionness in 32bpp codes of /sys/dev/rasops/.
Need to rectify every corners.
 1.6 09-Sep-2000  nisimura branches: 1.6.2;
Use dev/{rasops,wsfont} instead of awesome dev/rcons. Still much to do
before being useful.
 1.5 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.4 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.3 15-Dec-1999  ad branches: 1.3.2; 1.3.6;
- Change prefix for Bt459 register defs to BT459_IREG to indicate that
these are indirectly accessed registers.
- Add defs for directly accessed registers to bt459reg.h.
 1.2 06-Dec-1999  drochner update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.1 03-Dec-1999  nisimura The first order approximation of PMAGD SFB+ framebuffer. Proven not
working with 32bit PMAGD TURBOchannel option card (I got rainbow
colour virtical stripes on screen).
 1.3.6.2 16-Aug-2001  tv Pullup [jdolecek]:

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

Use unsigned variable types to make bounds checking more correct.
 1.3.6.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.3.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.6.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.6.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.2.1 09-Sep-2000  bouyer file sfbplus.c was added on branch thorpej_scsipi on 2000-11-20 11:43:15 +0000
 1.9.4.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.4.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.4.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.9.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.4.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.9.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.9.2.6 27-Aug-2002  nathanw Catch up to -current.
 1.9.2.5 01-Aug-2002  nathanw Catch up to -current.
 1.9.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.9.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.9.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.14.4.2 29-Aug-2002  gehenna catch up with -current.
 1.14.4.1 15-Jul-2002  gehenna catch up with -current.
 1.18.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.18.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.18.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.6.1 03-Aug-2004  skrll Sync with HEAD
 1.20.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.10.1 12-Feb-2005  yamt sync with head.
 1.20.8.1 29-Apr-2005  kent sync with -current
 1.22.4.3 27-Oct-2007  yamt sync with head.
 1.22.4.2 03-Sep-2007  yamt sync with head.
 1.22.4.1 21-Jun-2006  yamt sync with head.
 1.23.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.23.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.23.10.1 19-Apr-2006  elad sync with head.
 1.23.8.2 24-May-2006  yamt sync with head.
 1.23.8.1 01-Apr-2006  yamt sync with head.
 1.23.6.1 22-Apr-2006  simonb Sync with head.
 1.23.4.1 09-Sep-2006  rpaulo sync with head
 1.26.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.28.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.28.16.1 06-Nov-2007  matt sync with HEAD
 1.28.14.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.28.2.1 23-Oct-2007  ad Sync with head.
 1.29.22.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.29.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.29.20.3 11-Aug-2010  yamt sync with head.
 1.29.20.2 16-Sep-2009  yamt sync with head
 1.29.20.1 04-May-2009  yamt sync with head.
 1.29.18.1 04-Jun-2008  yamt sync with head
 1.29.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.29.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.30.4.1 19-Oct-2008  haad Sync with HEAD.
 1.30.2.1 18-Jul-2008  simonb Sync with head.
 1.33.4.2 05-Mar-2011  rmind sync with head
 1.33.4.1 30-May-2010  rmind sync with head
 1.33.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.36.12.1 18-Feb-2012  mrg merge to -current.
 1.36.8.1 17-Apr-2012  yamt sync with head
 1.38.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.39.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.40.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 15-Jan-2001  nisimura abandon an attempt to have 8bpp textop and 32bpp textop parallelly.
Pursuade a unified logic effective for both depths.
 1.1 03-Dec-1999  nisimura branches: 1.1.2; 1.1.8;
The first order approximation of PMAGD SFB+ framebuffer. Proven not
working with 32bit PMAGD TURBOchannel option card (I got rainbow
colour virtical stripes on screen).
 1.1.8.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.1.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1 03-Dec-1999  bouyer file sfbptextops.c was added on branch thorpej_scsipi on 2000-11-20 11:43:15 +0000
 1.1.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 15-Jan-2001  nisimura abandon an attempt to have 8bpp textop and 32bpp textop parallelly.
Pursuade a unified logic effective for both depths.
 1.1 03-Dec-1999  nisimura branches: 1.1.2; 1.1.8;
The first order approximation of PMAGD SFB+ framebuffer. Proven not
working with 32bit PMAGD TURBOchannel option card (I got rainbow
colour virtical stripes on screen).
 1.1.8.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.1.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1 03-Dec-1999  bouyer file sfbptextops32.c was added on branch thorpej_scsipi on 2000-11-20 11:43:16 +0000
 1.1.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4 03-Feb-2025  andvar fix various typos in comments.
 1.3 19-Dec-2000  perseant branches: 1.3.250;
Add register #defines similar to those in <dev/pci/tgareg.h>, referring to
a 32-bit sfb_reg_t, for easy comparison between tga and sfb Xservers.
 1.2 20-Oct-1999  nisimura branches: 1.2.6;
Remove Bt459 register layout exposure. XXX Needs consideration about
possible merger of SFB+ ASIC and TGA(2)/PCI register definitions.
 1.1 14-Nov-1998  drochner branches: 1.1.10; 1.1.12; 1.1.14;
use mi register definitions
 1.1.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.12.1 15-Nov-1999  fvdl Sync with -current
 1.1.10.3 05-Jan-2001  bouyer Sync with HEAD
 1.1.10.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.10.1 20-Oct-1999  thorpej Sync w/ trunk.
 1.2.6.1 26-Dec-2000  jhawk Pull up revision 1.3 (requested by perseant):
Make XalphaNetBSD compile with SFB support.
 1.3.250.1 02-Aug-2025  perseant Sync with HEAD
 1.2 15-Jan-2001  nisimura abandon an attempt to have 8bpp textop and 32bpp textop parallelly.
Pursuade a unified logic effective for both depths.
 1.1 03-Dec-1999  nisimura branches: 1.1.2; 1.1.8;
The first order approximation of PMAGD SFB+ framebuffer. Proven not
working with 32bit PMAGD TURBOchannel option card (I got rainbow
colour virtical stripes on screen).
 1.1.8.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.1.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1 03-Dec-1999  bouyer file sfbtextops.i was added on branch thorpej_scsipi on 2000-11-20 11:43:16 +0000
 1.1.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1 11-Aug-2016  christos branches: 1.1.2; 1.1.4; 1.1.18;
TURBOchannel usb/gpio driver from Felix Deichmann
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 11-Aug-2016  jdolecek file slhci_tcu.c was added on branch tls-maxphys on 2017-12-03 11:37:33 +0000
 1.1.4.2 05-Oct-2016  skrll Sync with HEAD
 1.1.4.1 11-Aug-2016  skrll file slhci_tcu.c was added on branch nick-nhusb on 2016-10-05 20:55:57 +0000
 1.1.2.2 14-Sep-2016  pgoyette Sync with HEAD
 1.1.2.1 11-Aug-2016  pgoyette file slhci_tcu.c was added on branch pgoyette-localcount on 2016-09-14 03:04:17 +0000
 1.59 20-Jul-2022  thorpej In the Alpha tc_syncbus(), we need to issue a MB because WMB does not
order reads with respect to writes. Remove now-redundant tc_wmb()
calls before tc_syncbus().

NFC on MIPS other than removing a redundant wbflush() (tc_wmb() followed
by tc_syncbus()).
 1.58 18-May-2022  andvar fix typos in word "access" and it derivatives, mainly in comments.
 1.57 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.56 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.55 24-Apr-2021  thorpej branches: 1.55.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.54 10-Nov-2019  chs branches: 1.54.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.53 30-Mar-2018  maya branches: 1.53.2;
correct typo: and and -> and (comments only)

heads up on this being a common typo from chris28.
 1.52 24-Jan-2018  riastradh branches: 1.52.2;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.51 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.50 16-Mar-2014  dholland branches: 1.50.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.49 11-Jan-2012  macallan branches: 1.49.6; 1.49.10;
adjust wsfont_find()
 1.48 13-Nov-2010  uebayasi branches: 1.48.8; 1.48.12;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.47 02-Nov-2010  skrll Spell immediately correctly.
 1.46 22-Aug-2009  tsutsui branches: 1.46.2; 1.46.4;
u_intNN_t -> uintNN_t
 1.45 09-Jul-2008  joerg - device/softc split
- make sfbplus at least compilable
 1.44 26-May-2008  nisimura branches: 1.44.2; 1.44.4;
- 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.43 28-Apr-2008  martin branches: 1.43.2;
Remove clause 3 and 4 from TNF licenses
 1.42 19-Oct-2007  ad branches: 1.42.16; 1.42.18; 1.42.20;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.41 21-Jul-2007  ad branches: 1.41.4; 1.41.6; 1.41.10; 1.41.12;
Don't depend on uvm_extern.h pulling in proc.h.
 1.40 09-Jul-2007  ad branches: 1.40.2;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.39 04-Mar-2007  yamt branches: 1.39.2; 1.39.4;
fix fallout from caddr_t changes.
 1.38 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 02-Dec-2006  elad branches: 1.37.2;
Change kauth(9) KPI for kauth_authorize_device_passthru() to add another
argument, u_long, serving as a bit-mask of generic requests for the
passthru request.

Discussed on tech-security@ and tech-kern@. Okay tls@.
 1.36 08-Nov-2006  dogcow branches: 1.36.2;
remove extraneous kauth check; since open already does the auth - and
mmap doesn't even get passed the lwp - the check here neither compiles
nor does anything terribly useful.
 1.35 08-Nov-2006  elad Replace securelevel checks with kauth(9) calls.
 1.34 23-Aug-2006  christos branches: 1.34.2; 1.34.4;
Acting as Elad's keyboard:

Place the securelevel checks in their logical locations.
This will be clearer in the future when code changes to use kauth(9) calls.

input and okay ad@
 1.33 14-May-2006  elad integrate kauth.
 1.32 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.31 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.30 11-Dec-2005  christos branches: 1.30.4; 1.30.6; 1.30.8; 1.30.10; 1.30.12;
merge ktrace-lwp.
 1.29 02-Jun-2005  drochner branches: 1.29.2;
avoid "volatile" cast-aways
 1.28 27-Feb-2005  perry nuke trailing whitespace
 1.27 17-Dec-2003  ad branches: 1.27.8; 1.27.10;
- Restore the display to a sane state when leaving mapped mode.
- OR updates into sc_changed, and protect with spltty()/splx().
 1.26 13-Nov-2003  chs eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.25 27-Oct-2003  chs uninitialized variables
 1.24 29-Jun-2003  fvdl branches: 1.24.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.23 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.22 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.21 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.20 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.19 19-Aug-2002  itohy Leaving overflow-sensitive code, very similar to what was fixed
in the previous changes to cfb.c / sfb.c / xcfb.c, would not be clever.
Just modify in the similar way.
 1.18 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.17 17-Mar-2002  atatat branches: 1.17.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.16 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.15 22-Feb-2002  ad Replace one of two divide ops with an AND when calculating the XYMASK
address.
 1.14 11-Feb-2002  wiz s/seperate/separate/
 1.13 12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.12 13-Nov-2001  lukem add/cleanup RCSIDs
 1.11 18-Sep-2001  ad Beef up the stic X interface, and tighten a few screws here and there.
 1.10 18-Sep-2001  wiz Give initiali[sz]e all the "i"s it deserves.
 1.9 05-Aug-2001  jdolecek branches: 1.9.2;
use unsigned variable types as appropriate
 1.8 04-Mar-2001  ad branches: 1.8.2; 1.8.4;
Make this work on alpha, and fix some other bogons.
 1.7 09-Jan-2001  ad - Make VDAC state per-board.
- Add an ioctl to reset the STIC.
- Add an ioctl to restore the screen contents from backing.
- Other tweaks.
 1.6 22-Dec-2000  ad - Fix bugs, make this useful.
- Add ioctls to start and stop the co-processor (if present).
 1.5 17-Dec-2000  ad Thinko.
 1.4 17-Dec-2000  ad Add wscons drivers for the DEC PixelStamp graphics accelerators.
 1.3 13-Apr-1999  ad branches: 1.3.2;
Removed pending write of fully-functional MI driver.
 1.2 16-Jan-1999  nisimura branches: 1.2.4;
- Don't use void pointer for arithmetic.
 1.1 11-Nov-1997  jonathan branches: 1.1.2;
chipset driver for DEC pixelstamp and STIC (stamp Interface chip).
 1.1.2.2 11-Nov-1997  jonathan chipset driver for DEC pixelstamp and STIC (stamp Interface chip).
 1.1.2.1 11-Nov-1997  jonathan file stic.c was added on branch netbsd-1-3 on 1997-11-11 04:47:58 +0000
 1.2.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.3.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.3.2.1 05-Jan-2001  bouyer Sync with HEAD
 1.8.4.7 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.6 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.8.4.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.4.4 16-Mar-2002  jdolecek Catch up with -current.
 1.8.4.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.8.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.4.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.8.2.10 11-Nov-2002  nathanw Catch up to -current
 1.8.2.9 18-Oct-2002  nathanw Catch up to -current.
 1.8.2.8 17-Sep-2002  nathanw Catch up to -current.
 1.8.2.7 27-Aug-2002  nathanw Catch up to -current.
 1.8.2.6 01-Aug-2002  nathanw Catch up to -current.
 1.8.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.8.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.8.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.9.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.9.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.17.4.3 29-Aug-2002  gehenna catch up with -current.
 1.17.4.2 15-Jul-2002  gehenna catch up with -current.
 1.17.4.1 16-May-2002  gehenna Add the character device switch.
 1.24.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.24.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.24.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.27.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.27.8.1 29-Apr-2005  kent sync with -current
 1.29.2.4 27-Oct-2007  yamt sync with head.
 1.29.2.3 03-Sep-2007  yamt sync with head.
 1.29.2.2 30-Dec-2006  yamt sync with head.
 1.29.2.1 21-Jun-2006  yamt sync with head.
 1.30.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.30.10.1 19-Apr-2006  elad sync with head.
 1.30.8.3 03-Sep-2006  yamt sync with head.
 1.30.8.2 24-May-2006  yamt sync with head.
 1.30.8.1 01-Apr-2006  yamt sync with head.
 1.30.6.1 22-Apr-2006  simonb Sync with head.
 1.30.4.1 09-Sep-2006  rpaulo sync with head
 1.34.4.1 10-Dec-2006  yamt sync with head.
 1.34.2.2 12-Jan-2007  ad Sync with head.
 1.34.2.1 18-Nov-2006  ad Sync with head.
 1.36.2.1 04-Dec-2006  tron Pull up following revision(s) (requested by elad in ticket #247):
sys/dev/ic/dpt.c: revision 1.55
sys/dev/pci/amr.c: revision 1.43
sys/secmodel/bsd44/secmodel_bsd44_securelevel.c: revision 1.19
sys/dev/pci/mly.c: revision 1.33
share/man/man9/kauth.9: revision 1.37
sys/dev/ic/mlx.c: revision 1.49
sys/dev/ic/icp_ioctl.c: revision 1.14
sys/dev/i2o/iop.c: revision 1.62
sys/dev/pci/twe.c: revision 1.82
sys/sys/kauth.h: revision 1.25
sys/dev/i2o/dpti.c: revision 1.31
sys/kern/kern_auth.c: revision 1.33
sys/dev/tc/stic.c: revision 1.37
Change kauth(9) KPI for kauth_authorize_device_passthru() to add another
argument, u_long, serving as a bit-mask of generic requests for the
passthru request.
Discussed on tech-security@ and tech-kern@. Okay tls@.
 1.37.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.39.4.1 11-Jul-2007  mjf Sync with head.
 1.39.2.4 23-Oct-2007  ad Sync with head.
 1.39.2.3 09-Oct-2007  ad Sync with head.
 1.39.2.2 15-Jul-2007  ad Get pmax working.
 1.39.2.1 01-Jul-2007  ad Adapt to callout API change.
 1.40.2.1 15-Aug-2007  skrll Sync with HEAD.
 1.41.12.2 21-Jul-2007  ad Don't depend on uvm_extern.h pulling in proc.h.
 1.41.12.1 21-Jul-2007  ad file stic.c was added on branch matt-mips64 on 2007-07-21 19:06:22 +0000
 1.41.10.1 25-Oct-2007  bouyer Sync with HEAD.
 1.41.6.1 06-Nov-2007  matt sync with HEAD
 1.41.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.42.20.3 16-Sep-2009  yamt sync with head
 1.42.20.2 04-May-2009  yamt sync with head.
 1.42.20.1 16-May-2008  yamt sync with head.
 1.42.18.2 04-Jun-2008  yamt sync with head
 1.42.18.1 18-May-2008  yamt sync with head.
 1.42.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.42.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.43.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.43.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.44.4.1 19-Oct-2008  haad Sync with HEAD.
 1.44.2.1 18-Jul-2008  simonb Sync with head.
 1.46.4.1 05-Mar-2011  rmind sync with head
 1.46.2.1 06-Nov-2010  uebayasi Sync with HEAD.
 1.48.12.1 18-Feb-2012  mrg merge to -current.
 1.48.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.48.8.1 17-Apr-2012  yamt sync with head
 1.49.10.1 18-May-2014  rmind sync with head
 1.49.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.50.2.1 10-Aug-2014  tls Rebase.
 1.52.2.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.53.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.54.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.55.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.7 09-Feb-2024  andvar fix spelling mistakes, mainly in comments and log messages.
 1.6 12-Sep-2020  kamil Restrict stic_xmap to the kernel namespace

Otherwise this header is not includable on ports without the definition
of NBPG. This fixes build of sanitizers. In practice only pmax might be
interested in using this device driver.
 1.5 06-Sep-2015  dholland More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
 1.4 28-Apr-2008  martin branches: 1.4.18; 1.4.44; 1.4.64;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 27-Feb-2005  perry nuke trailing whitespace
 1.1 18-Sep-2001  ad branches: 1.1.2; 1.1.4; 1.1.8; 1.1.24; 1.1.32; 1.1.34;
Beef up the stic X interface, and tighten a few screws here and there.
 1.1.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.32.1 29-Apr-2005  kent sync with -current
 1.1.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 18-Sep-2001  thorpej file sticio.h was added on branch kqueue on 2002-01-10 19:58:43 +0000
 1.1.4.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.4.1 18-Sep-2001  fvdl file sticio.h was added on branch thorpej-devvp on 2001-10-01 12:46:28 +0000
 1.1.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.1.2.1 18-Sep-2001  nathanw file sticio.h was added on branch nathanw_sa on 2001-09-21 22:36:17 +0000
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.64.1 22-Sep-2015  skrll Sync with HEAD
 1.4.44.1 03-Dec-2017  jdolecek update from HEAD
 1.4.18.1 27-Dec-2011  matt Don't use NBPG since it can vary.
 1.9 08-Sep-2008  gmcgarry Replace most gcc-specific __attribute__ uses with BSD-style sys/cdef.h
preprocessor macros.
 1.8 28-Apr-2008  martin branches: 1.8.2; 1.8.6;
Remove clause 3 and 4 from TNF licenses
 1.7 23-Feb-2002  ad branches: 1.7.114; 1.7.116; 1.7.118;
Fix typo in previous.
 1.6 22-Feb-2002  ad Replace one of two divide ops with an AND when calculating the XYMASK
address.
 1.5 18-Sep-2001  ad Beef up the stic X interface, and tighten a few screws here and there.
 1.4 04-Mar-2001  ad branches: 1.4.2; 1.4.4; 1.4.6;
Make this work on alpha, and fix some other bogons.
 1.3 17-Dec-2000  ad Add wscons drivers for the DEC PixelStamp graphics accelerators.
 1.2 13-Apr-1999  ad branches: 1.2.2;
Removed pending write of fully-functional MI driver.
 1.1 08-Nov-1997  jonathan branches: 1.1.2; 1.1.12;
Commit `pacifier' driver for turbochannel PMAG-C option card:n
just acknowledge interrupts from the PMAG-C.
 1.1.12.1 21-Jun-1999  thorpej Sync w/ -current.
 1.1.2.2 08-Nov-1997  jonathan Commit `pacifier' driver for turbochannel PMAG-C option card:n
just acknowledge interrupts from the PMAG-C.
 1.1.2.1 08-Nov-1997  jonathan file sticreg.h was added on branch netbsd-1-3 on 1997-11-08 07:27:51 +0000
 1.2.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.2.2.1 05-Jan-2001  bouyer Sync with HEAD
 1.4.6.1 01-Oct-2001  fvdl Catch up with -current.
 1.4.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.7.118.2 04-May-2009  yamt sync with head.
 1.7.118.1 16-May-2008  yamt sync with head.
 1.7.116.1 18-May-2008  yamt sync with head.
 1.7.114.2 28-Sep-2008  mjf Sync with HEAD.
 1.7.114.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.6.1 19-Oct-2008  haad Sync with HEAD.
 1.8.2.1 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.19 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.18 09-Jul-2008  joerg branches: 1.18.28; 1.18.38;
- device/softc split
- make sfbplus at least compilable
 1.17 28-Apr-2008  martin branches: 1.17.2; 1.17.4; 1.17.6;
Remove clause 3 and 4 from TNF licenses
 1.16 04-Mar-2007  christos branches: 1.16.36; 1.16.38; 1.16.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 11-Dec-2005  christos branches: 1.15.26;
merge ktrace-lwp.
 1.14 13-Nov-2003  chs branches: 1.14.16;
eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.13 29-Jun-2003  fvdl branches: 1.13.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.12 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.11 17-May-2002  wiz Tokens after #else are ignored, which is not the intention here.
 1.10 22-Feb-2002  ad branches: 1.10.8;
Replace one of two divide ops with an AND when calculating the XYMASK
address.
 1.9 18-Sep-2001  ad Beef up the stic X interface, and tighten a few screws here and there.
 1.8 04-Mar-2001  ad branches: 1.8.2; 1.8.4; 1.8.6;
Make this work on alpha, and fix some other bogons.
 1.7 09-Jan-2001  ad - Make VDAC state per-board.
- Add an ioctl to reset the STIC.
- Add an ioctl to restore the screen contents from backing.
- Other tweaks.
 1.6 22-Dec-2000  ad - Fix bugs, make this useful.
- Add ioctls to start and stop the co-processor (if present).
 1.5 17-Dec-2000  ad Thinko.
 1.4 17-Dec-2000  ad Add wscons drivers for the DEC PixelStamp graphics accelerators.
 1.3 13-Apr-1999  ad branches: 1.3.2;
Removed pending write of fully-functional MI driver.
 1.2 16-Jan-1999  nisimura branches: 1.2.4;
- Don't use void pointer for arithmetic.
 1.1 08-Nov-1997  jonathan branches: 1.1.2;
Commit `pacifier' driver for turbochannel PMAG-C option card:n
just acknowledge interrupts from the PMAG-C.
 1.1.2.2 08-Nov-1997  jonathan Commit `pacifier' driver for turbochannel PMAG-C option card:n
just acknowledge interrupts from the PMAG-C.
 1.1.2.1 08-Nov-1997  jonathan file sticvar.h was added on branch netbsd-1-3 on 1997-11-08 07:27:52 +0000
 1.2.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.3.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.3.2.1 05-Jan-2001  bouyer Sync with HEAD
 1.8.6.1 01-Oct-2001  fvdl Catch up with -current.
 1.8.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.8.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.10.8.1 30-May-2002  gehenna Catch up with -current.
 1.13.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.13.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.14.16.2 03-Sep-2007  yamt sync with head.
 1.14.16.1 21-Jun-2006  yamt sync with head.
 1.15.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.40.2 04-May-2009  yamt sync with head.
 1.16.40.1 16-May-2008  yamt sync with head.
 1.16.38.1 18-May-2008  yamt sync with head.
 1.16.36.2 28-Sep-2008  mjf Sync with HEAD.
 1.16.36.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.6.1 19-Oct-2008  haad Sync with HEAD.
 1.17.4.1 18-Jul-2008  simonb Sync with head.
 1.17.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.18.38.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.28.1 30-Oct-2012  yamt sync with head
 1.60 13-May-2024  msaitoh s/of of/of/ in comment.
 1.59 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.58 07-May-2021  thorpej branches: 1.58.6;
A small bit of const poisoning.
 1.57 24-Apr-2021  thorpej branches: 1.57.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.56 10-Jun-2017  flxd branches: 1.56.22;
Fix missing TC bus speed.
 1.55 09-Jun-2017  flxd Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
 1.54 12-Dec-2016  flxd branches: 1.54.8;
Clean-up (remove redundant declarations, concentrate checks).
 1.53 19-Jul-2016  christos make the check work with widths other than 4, Felix Deichmann
 1.52 19-Jul-2016  christos PR/50849: Felix Deichmann: Relax TC option ROM header check for ROM widths < 4
 1.51 04-Jun-2011  tsutsui branches: 1.51.12; 1.51.30; 1.51.34;
Split device_t/softc. pmax is tested on GXemul.
Compile test only for alpha and vax.

XXX: alpha/tc/tcasic.c calls tcattach() via config_found(9), but
XXX: pmax/tc/tcbus.c and vax/vsa/tc_vsbus.c calls tcattach() directly.
XXX: It looks horrible...
 1.50 12-May-2009  cegger branches: 1.50.4; 1.50.6; 1.50.10;
struct device * -> device_t, no functional changes intended.
 1.49 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.48 11-Jun-2008  tsutsui branches: 1.48.10;
Use device_lookup_private() to get softc.
XXX this driver assumes cf_unit is always zero
 1.47 19-Feb-2008  matt branches: 1.47.6; 1.47.8; 1.47.10; 1.47.12; 1.47.14;
Fix TC on VAX. (missed committing these earlier)
 1.46 12-Apr-2007  matt branches: 1.46.8;
Make tc_knowndevs const.
 1.45 31-Mar-2006  thorpej branches: 1.45.14; 1.45.18; 1.45.20;
Use ANSI function decls, apply static.
 1.44 30-Mar-2006  thorpej Use device_private().
 1.43 11-Dec-2005  christos branches: 1.43.4; 1.43.6; 1.43.8; 1.43.10; 1.43.12;
merge ktrace-lwp.
 1.42 26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.41 25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.40 04-Feb-2005  perry branches: 1.40.6;
de-__P
 1.39 26-Aug-2004  drochner branches: 1.39.4; 1.39.6;
some cleanup: use the locator-passing variant of config_found(), get
the macros just hiding cfdata members out of tcvar.h and include
"locators.h" only in the .c file
 1.38 27-Apr-2004  yamt remove redundant function prototypes to make this compilable after
snprintf changes.
 1.37 22-Apr-2004  itojun sprintf -> snprintf
 1.36 26-Sep-2003  tsutsui Remove casts and use %x in printf for tc_offset_t,
which is int32_t on both alpha and pmax.
 1.35 01-Jan-2003  thorpej branches: 1.35.2;
Use aprint_normal() in cfprint routines.
 1.34 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.33 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 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.30 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.29 13-Nov-2001  lukem add/cleanup RCSIDs
 1.28 04-Jun-2000  cgd branches: 1.28.4; 1.28.6;
Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.27 15-Nov-1999  nisimura branches: 1.27.2;
Relocate 'struct tc_softc' and several function declarations useful
to outsides of 'tc.c' into 'tcvar.h'.
 1.26 22-May-1998  thorpej branches: 1.26.14; 1.26.20;
DECstation now provides bus_space and bus_dma data structures to us.
 1.25 19-Jan-1998  thorpej On the Alpha, pass down per-slot DMA tags to children.
 1.24 12-Jan-1998  thorpej Adjust for changes in config.
 1.23 13-Sep-1997  enami Declare TCVERBOSE by defopt in files.tc. Include opt_tcverbose.h in tc.c.
 1.22 22-Jul-1997  jonathan branches: 1.22.2;
Garbage-collect __BROKEN_INDIRECT_CONFIG from /sys/dev/tc
 1.21 05-Dec-1996  cgd update these so they compile whether or not __BROKEN_INDIRECT_CONFIG
is defined.
 1.20 22-Oct-1996  cgd update for new bus.h
 1.19 13-Oct-1996  christos backout kprintf changes
 1.18 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.17 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.16 17-May-1996  cgd (on the alpha) pass the bus_chipset_tag_t given to the bus down to the
devices.
 1.15 29-Apr-1996  cgd fix printf bogon (need : and space)
 1.14 18-Apr-1996  cgd remove unnecessary header inclusion (machine/autoconf.h) and now-bogus comment.
also, trim spaces at ends of lines, etc.
 1.13 09-Apr-1996  jonathan Fixes for -Wall -Wmissing-prototypes:
include <sys/systm.h> to get a prototyped declaration of printf().
include <machine/autoconf.h> for port-specific typedefs.
Remove unused variables.
 1.12 17-Mar-1996  jonathan Additional fixes to complete the NetBSD/1.1B config changes:

change tc_submatch() to compile with the new device-attach scheme:
the TC bus uses a 'submatch' function which checks device locators
and then calls a match function.
Instead of calling cf->cf_driver->cd_match(), we now need to call
cf->cf_attach->ca_match().
 1.11 17-Mar-1996  thorpej New device attachment scheme:

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

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.10 05-Mar-1996  cgd split device info into driver name and human readable description.
 1.9 02-Mar-1996  cgd change printing of unknown device names when not (BUS)VERBOSE slightly
 1.8 02-Mar-1996  cgd add ability to define TCVERBOSE, and get "human names" about "known"
but unconfigured (or unsupported) devices printed at boot time.
The device list is woefully incomplete, because i didn't put much time
in it, and because i don't know good "human names" for many TC devices.
 1.7 27-Feb-1996  cgd use config_found_sm(), rather than config_search+config_attach()+glue, to
attach subdevices.
 1.6 27-Feb-1996  cgd fix first args in tcprint() invocations. Fix for this (and several previous
commits) from Jonathan. This is why one (I) shouldn't commit code w/o
having any sane way to test it.
 1.5 27-Feb-1996  cgd one more minor oops; print our name, not parent's, when doing unconfigured dev
 1.4 27-Feb-1996  cgd fix bug in previous commits. also, do submatch checking for all devices,
not just option slot devices.
 1.3 27-Feb-1996  cgd use #defines for bus speed constants, print speed on attach
 1.2 26-Feb-1996  cgd (1) rename some structures & structure members, for consistency with
planned changes in other sections of code.
(2) expands the use of config_found() in tcattach() in-line, so that
tcsubmatch can be invoked there, rather than being invoked by
individual drivers.
(3) tcbus_attach_args now includes a turbochannel speed flag.
(4) compare a string in tcbus_attach_args against tc bus driver name,
to better allow attachment of multiple busses to the same parent.
 1.1 20-Dec-1995  cgd machine-independent TurboChannel bus configuration. These files
deal with stuff like:
(1) configuring built-in devices,
(2) looking at TC slots configuring any devices found.
The lists of slots, slot locations, etc. and built-in devices
are provided by machine-dependent code. Interrupt handling
is also provided by machine-dependent code, but the MD code provides
hooks so that standard names for 'establish' and 'disestablish'
can be used in drivers.

This code requires <machine/tc_machdep.h>, which defines some
portability types specific to the TurboChannel bus code.
 1.22.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.26.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.26.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.27.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.28.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.28.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.4.3 03-Jan-2003  thorpej Sync with HEAD.
 1.28.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.28.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.35.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.5 04-Feb-2005  skrll Sync with HEAD.
 1.35.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.2 03-Sep-2004  skrll Sync with HEAD
 1.35.2.1 03-Aug-2004  skrll Sync with HEAD
 1.39.6.1 12-Feb-2005  yamt sync with head.
 1.39.4.1 29-Apr-2005  kent sync with -current
 1.40.6.3 27-Feb-2008  yamt sync with head.
 1.40.6.2 03-Sep-2007  yamt sync with head.
 1.40.6.1 21-Jun-2006  yamt sync with head.
 1.43.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.43.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.43.10.1 19-Apr-2006  elad sync with head.
 1.43.8.1 01-Apr-2006  yamt sync with head.
 1.43.6.1 22-Apr-2006  simonb Sync with head.
 1.43.4.1 09-Sep-2006  rpaulo sync with head
 1.45.20.1 11-Jul-2007  mjf Sync with head.
 1.45.18.1 27-May-2007  ad Sync with head.
 1.45.14.1 15-Apr-2007  yamt sync with head.
 1.46.8.1 23-Mar-2008  matt sync with HEAD
 1.47.14.1 18-Jun-2008  simonb Sync with head.
 1.47.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.47.10.2 16-May-2009  yamt sync with head
 1.47.10.1 04-May-2009  yamt sync with head.
 1.47.8.1 17-Jun-2008  yamt sync with head.
 1.47.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.48.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.50.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.50.4.1 12-Jun-2011  rmind sync with head
 1.51.34.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.51.34.1 26-Jul-2016  pgoyette Sync with HEAD
 1.51.30.3 28-Aug-2017  skrll Sync with HEAD
 1.51.30.2 05-Feb-2017  skrll Sync with HEAD
 1.51.30.1 05-Oct-2016  skrll Sync with HEAD
 1.51.12.1 03-Dec-2017  jdolecek update from HEAD
 1.54.8.2 01-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #66):
sys/dev/tc/tc.c: revision 1.56
Fix missing TC bus speed.
 1.54.8.1 01-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #65):
share/man/man4/tc.4: revision 1.7
sys/arch/alpha/tc/tcasic.c: revision 1.46
sys/arch/pmax/tc/tcbus.c: revision 1.33
sys/arch/vax/conf/files.vax: revision 1.121
sys/arch/vax/vsa/tc_vsbus.c: revision 1.8, 1.9
sys/dev/tc/tc.c: revision 1.55
sys/dev/tc/tcvar.h: revision 1.27
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
--
whitespace
--
Add vax.
 1.56.22.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.56.22.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.57.2.1 13-May-2021  thorpej Sync with HEAD.
 1.58.6.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.23 22-Jun-2017  flxd spelling (DEC called it "TURBOchannel")
 1.22 11-Aug-2016  christos TURBOchannel usb/gpio driver from Felix Deichmann
 1.21 21-Jan-2009  jnemeth branches: 1.21.24; 1.21.42;
add a comment explaining how to regenerate tcdevs.h and tcdevs_data.h
 1.20 11-Dec-2005  christos branches: 1.20.74; 1.20.84;
merge ktrace-lwp.
 1.19 25-Oct-2003  chs add some missing. uncomment some. alphabetize.
 1.18 04-Oct-2003  tsutsui - Move PMAGB-BA and PMAG-JA (which I have) out of "may be incorrect" entries.
- Put driver name "tfb" for PMAG-JA (which will appear in future pmax-wscons).
 1.17 17-Dec-2000  ad branches: 1.17.24;
Sync with PixelStamp drivers.
 1.16 20-Jul-2000  tsutsui Add PMAG-JA framebuffer.
 1.15 05-Jan-2000  drochner add Kubota Denali
 1.14 26-Oct-1999  drochner remove duplicate entry
 1.13 26-Oct-1999  drochner change PMAF-F to PMAF-FA for consistency, add some more stuff
 1.12 26-Sep-1999  mrg branches: 1.12.2; 1.12.4; 1.12.6;
add AV300-AA video capture card & PNTNV-AA NV-RAM card.
 1.11 18-Sep-1999  ad Ammend some entries.
 1.10 18-Jun-1998  jonathan Add entry for DecAudio LoFi (AV01B-AA) product.
NB: prototype boards have "Lofi " ROM ident.
 1.9 27-May-1998  matt Add DETRA (Token Ring) Controller
 1.8 30-Jan-1998  thorpej Add entries for the PMAZ-DS and PMAZ-FS (Flamingo Turbochannel Dual SCSI
baseboard devices, normal and fast), and the PMAZB-AA and PMAZC-AA
(Turbochannel Dual SCSI option cards, normal and fast).
 1.7 05-Feb-1997  cgd add a bunch of commented-out, unconfirmed entries, based on data from
a "Smart Frame Buffer TURBOchannel Module" user's manual(?), and from
some "DECstation 5000 Model 240 Options and Upgrades" guides found
while cleaning out my office.
 1.6 26-Aug-1996  cgd add entries for DGLTA-FA and OTTO ATM boards, alphabetize and clean up
other entries.
 1.5 20-May-1996  cgd add entry for DEFTA FDDI, clean up entry for DEFZA FDDI.
 1.4 09-May-1996  cgd add some entries for the sfb+
 1.3 05-Mar-1996  cgd add a bunch of device IDs & driver names & descriptions, thanks to
Jonathan Stone.
 1.2 02-Mar-1996  cgd typo in KZTSA-AA
 1.1 02-Mar-1996  cgd add ability to define TCVERBOSE, and get "human names" about "known"
but unconfigured (or unsupported) devices printed at boot time.
The device list is woefully incomplete, because i didn't put much time
in it, and because i don't know good "human names" for many TC devices.
 1.12.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.4.1 15-Nov-1999  fvdl Sync with -current
 1.12.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.17.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.24.1 03-Aug-2004  skrll Sync with HEAD
 1.20.84.1 03-Mar-2009  skrll Sync with HEAD.
 1.20.74.1 04-May-2009  yamt sync with head.
 1.21.42.2 28-Aug-2017  skrll Sync with HEAD
 1.21.42.1 05-Oct-2016  skrll Sync with HEAD
 1.21.24.1 03-Dec-2017  jdolecek update from HEAD
 1.25 22-Jun-2017  flxd regen
 1.24 14-Oct-2016  flxd regen
 1.23 12-Apr-2007  matt branches: 1.23.78; 1.23.98; 1.23.102;
Make tc_knowndevs const.
 1.22 11-Dec-2005  christos branches: 1.22.26; 1.22.30; 1.22.32;
merge ktrace-lwp.
 1.21 27-Feb-2005  perry branches: 1.21.4;
regen
 1.20 25-Oct-2003  chs branches: 1.20.8; 1.20.10;
regen
 1.19 04-Oct-2003  tsutsui Regen from tcdevs rev 1.18:
>- Move PMAGB-BA and PMAG-JA (which I have) out of "may be incorrect" entries.
>- Put driver name "tfb" for PMAG-JA (which will appear in future pmax-wscons).
 1.18 17-Dec-2000  ad branches: 1.18.24;
Regen.
 1.17 20-Jul-2000  tsutsui Regen.
 1.16 05-Jan-2000  drochner regen
 1.15 26-Oct-1999  drochner regen
 1.14 26-Sep-1999  mrg branches: 1.14.2; 1.14.4; 1.14.6;
regen
 1.13 18-Sep-1999  ad Regen.
 1.12 18-Jun-1998  jonathan Regen from sys/dev/tc/tcdevs rev 1.10.
 1.11 27-May-1998  matt Add DETRA (Token Ring) Controller
 1.10 30-Jan-1998  thorpej Regen.
 1.9 09-Jan-1998  thorpej Regen.
 1.8 08-Jan-1998  thorpej Regen: back out RCS ID related changes.
 1.7 05-Jan-1998  perry regened with RCSIDs in place
 1.6 26-Aug-1996  cgd regen for new tcdevs
 1.5 20-May-1996  cgd regen for new tcdevs file
 1.4 09-May-1996  cgd regen for new tcdevs
 1.3 05-Mar-1996  cgd regen
 1.2 02-Mar-1996  cgd regen for changed tcdevs
 1.1 02-Mar-1996  cgd generated files
 1.14.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.14.4.1 15-Nov-1999  fvdl Sync with -current
 1.14.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.14.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.18.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.18.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.24.1 03-Aug-2004  skrll Sync with HEAD
 1.20.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.8.1 29-Apr-2005  kent sync with -current
 1.21.4.1 03-Sep-2007  yamt sync with head.
 1.22.32.1 11-Jul-2007  mjf Sync with head.
 1.22.30.1 27-May-2007  ad Sync with head.
 1.22.26.1 15-Apr-2007  yamt sync with head.
 1.23.102.1 04-Nov-2016  pgoyette Sync with HEAD
 1.23.98.2 28-Aug-2017  skrll Sync with HEAD
 1.23.98.1 05-Dec-2016  skrll Sync with HEAD
 1.23.78.1 03-Dec-2017  jdolecek update from HEAD
 1.25 22-Jun-2017  flxd regen
 1.24 14-Oct-2016  flxd regen
 1.23 12-Apr-2007  matt branches: 1.23.78; 1.23.98; 1.23.102;
Make tc_knowndevs const.
 1.22 11-Dec-2005  christos branches: 1.22.26; 1.22.30; 1.22.32;
merge ktrace-lwp.
 1.21 27-Feb-2005  perry branches: 1.21.4;
regen
 1.20 25-Oct-2003  chs branches: 1.20.8; 1.20.10;
regen
 1.19 04-Oct-2003  tsutsui Regen from tcdevs rev 1.18:
>- Move PMAGB-BA and PMAG-JA (which I have) out of "may be incorrect" entries.
>- Put driver name "tfb" for PMAG-JA (which will appear in future pmax-wscons).
 1.18 17-Dec-2000  ad branches: 1.18.24;
Regen.
 1.17 20-Jul-2000  tsutsui Regen.
 1.16 05-Jan-2000  drochner regen
 1.15 26-Oct-1999  drochner regen
 1.14 26-Sep-1999  mrg branches: 1.14.2; 1.14.4; 1.14.6;
regen
 1.13 18-Sep-1999  ad Regen.
 1.12 18-Jun-1998  jonathan Regen from sys/dev/tc/tcdevs rev 1.10.
 1.11 27-May-1998  matt Add DETRA (Token Ring) Controller
 1.10 30-Jan-1998  thorpej Regen.
 1.9 09-Jan-1998  thorpej Regen.
 1.8 08-Jan-1998  thorpej Regen: back out RCS ID related changes.
 1.7 05-Jan-1998  perry regened with RCSIDs in place
 1.6 26-Aug-1996  cgd regen for new tcdevs
 1.5 20-May-1996  cgd regen for new tcdevs file
 1.4 09-May-1996  cgd regen for new tcdevs
 1.3 05-Mar-1996  cgd regen
 1.2 02-Mar-1996  cgd regen for changed tcdevs
 1.1 02-Mar-1996  cgd generated files
 1.14.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.14.4.1 15-Nov-1999  fvdl Sync with -current
 1.14.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.14.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.18.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.18.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.24.1 03-Aug-2004  skrll Sync with HEAD
 1.20.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.8.1 29-Apr-2005  kent sync with -current
 1.21.4.1 03-Sep-2007  yamt sync with head.
 1.22.32.1 11-Jul-2007  mjf Sync with head.
 1.22.30.1 27-May-2007  ad Sync with head.
 1.22.26.1 15-Apr-2007  yamt sync with head.
 1.23.102.1 04-Nov-2016  pgoyette Sync with HEAD
 1.23.98.2 28-Aug-2017  skrll Sync with HEAD
 1.23.98.1 05-Dec-2016  skrll Sync with HEAD
 1.23.78.1 03-Dec-2017  jdolecek update from HEAD
 1.29 25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.28 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.27 24-Apr-2021  thorpej branches: 1.27.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.26 22-Jun-2017  flxd branches: 1.26.22;
spelling (DEC called it "TURBOchannel")
 1.25 22-Aug-2009  tsutsui branches: 1.25.22; 1.25.40;
u_intNN_t -> uintNN_t
 1.24 18-Mar-2009  cegger bzero -> memset
 1.23 09-Jul-2008  joerg branches: 1.23.2; 1.23.8;
- device/softc split
- make sfbplus at least compilable
 1.22 28-Apr-2008  martin branches: 1.22.2; 1.22.4; 1.22.6;
Remove clause 3 and 4 from TNF licenses
 1.21 05-Apr-2008  cegger branches: 1.21.2; 1.21.4;
use aprint_*_dev and device_xname
 1.20 19-Oct-2007  ad branches: 1.20.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.19 31-Mar-2006  thorpej branches: 1.19.18; 1.19.32; 1.19.34; 1.19.38;
Use ANSI function decls, apply static.
 1.18 30-Mar-2006  thorpej Use device_private().
 1.17 11-Dec-2005  christos branches: 1.17.4; 1.17.6; 1.17.8; 1.17.10; 1.17.12;
merge ktrace-lwp.
 1.16 26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.15 25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.14 27-Feb-2005  perry branches: 1.14.4;
nuke trailing whitespace
 1.13 04-Feb-2005  perry de-__P
 1.12 13-Sep-2004  drochner branches: 1.12.4; 1.12.6;
remove unused variable
 1.11 13-Sep-2004  drochner a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
on "locators.h"
 1.10 01-Jan-2003  thorpej branches: 1.10.2;
Use aprint_normal() in cfprint routines.
 1.9 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.8 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.7 29-Sep-2002  wiz "definitions" has lots of 'i's, but that's not reason to leave one out.
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 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 13-Nov-2001  lukem add/cleanup RCSIDs
 1.2 22-Aug-2001  nisimura Move small storage for ev_name string into tcds_softc.
 1.1 04-Jul-2000  nisimura branches: 1.1.2; 1.1.4; 1.1.6;
Repopulate TCDS dual channel SCSI adapter to MI dev/tc, squashing
internals for better layering between TCDS DMA ASIC and ASC SCSI
controller.
 1.1.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.4.4 03-Jan-2003  thorpej Sync with HEAD.
 1.1.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.4.1 21-Sep-2001  nathanw Catch up to -current.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 04-Jul-2000  bouyer file tcds.c was added on branch thorpej_scsipi on 2000-11-20 11:43:17 +0000
 1.10.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.2.3 04-Feb-2005  skrll Sync with HEAD.
 1.10.2.2 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.1 18-Sep-2004  skrll Sync with HEAD.
 1.12.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.6.1 12-Feb-2005  yamt sync with head.
 1.12.4.1 29-Apr-2005  kent sync with -current
 1.14.4.2 27-Oct-2007  yamt sync with head.
 1.14.4.1 21-Jun-2006  yamt sync with head.
 1.17.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.17.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.17.10.1 19-Apr-2006  elad sync with head.
 1.17.8.1 01-Apr-2006  yamt sync with head.
 1.17.6.1 22-Apr-2006  simonb Sync with head.
 1.17.4.1 09-Sep-2006  rpaulo sync with head
 1.19.38.1 25-Oct-2007  bouyer Sync with HEAD.
 1.19.34.1 06-Nov-2007  matt sync with HEAD
 1.19.32.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.19.18.1 23-Oct-2007  ad Sync with head.
 1.20.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.20.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.21.4.3 16-Sep-2009  yamt sync with head
 1.21.4.2 04-May-2009  yamt sync with head.
 1.21.4.1 16-May-2008  yamt sync with head.
 1.21.2.1 18-May-2008  yamt sync with head.
 1.22.6.1 19-Oct-2008  haad Sync with HEAD.
 1.22.4.1 18-Jul-2008  simonb Sync with head.
 1.22.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.23.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.23.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.40.1 28-Aug-2017  skrll Sync with HEAD
 1.25.22.1 03-Dec-2017  jdolecek update from HEAD
 1.26.22.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.26.22.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.27.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.9 05-Dec-2021  msaitoh s/funtion/function/ in comment.
 1.8 06-Nov-2021  msaitoh s/allign/align/
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 27-Feb-2005  perry nuke trailing whitespace
 1.5 04-Feb-2005  perry de-__P
 1.4 24-Feb-2004  wiz branches: 1.4.8; 1.4.10;
Spell interrupt with two rs. From Peter Postma.
 1.3 03-May-2003  wiz branches: 1.3.2;
DMA, not dma nor Dma.
 1.2 06-Jan-2003  wiz interrupt with two rs.
 1.1 04-Jul-2000  nisimura branches: 1.1.2; 1.1.4;
Repopulate TCDS dual channel SCSI adapter to MI dev/tc, squashing
internals for better layering between TCDS DMA ASIC and ASC SCSI
controller.
 1.1.4.1 07-Jan-2003  thorpej Sync with HEAD.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 04-Jul-2000  bouyer file tcdsreg.h was added on branch thorpej_scsipi on 2000-11-20 11:43:17 +0000
 1.3.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.10.1 12-Feb-2005  yamt sync with head.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.6 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.90;
merge ktrace-lwp.
 1.4 27-Feb-2005  perry nuke trailing whitespace
 1.3 04-Feb-2005  perry de-__P
 1.2 22-Aug-2001  nisimura branches: 1.2.20; 1.2.28; 1.2.30;
Move small storage for ev_name string into tcds_softc.
 1.1 04-Jul-2000  nisimura branches: 1.1.2; 1.1.4; 1.1.6;
Repopulate TCDS dual channel SCSI adapter to MI dev/tc, squashing
internals for better layering between TCDS DMA ASIC and ASC SCSI
controller.
 1.1.6.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.4.1 21-Sep-2001  nathanw Catch up to -current.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 04-Jul-2000  bouyer file tcdsvar.h was added on branch thorpej_scsipi on 2000-11-20 11:43:17 +0000
 1.2.30.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.30.1 12-Feb-2005  yamt sync with head.
 1.2.28.1 29-Apr-2005  kent sync with -current
 1.2.20.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.20.1 04-Feb-2005  skrll Sync with HEAD.
 1.5.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.74.1 16-May-2009  yamt sync with head
 1.4 22-Jun-2017  flxd spelling (DEC called it "TURBOchannel")
 1.3 11-Dec-2005  christos branches: 1.3.120; 1.3.140;
merge ktrace-lwp.
 1.2 27-Feb-2005  perry nuke trailing whitespace
 1.1 20-Dec-1995  cgd branches: 1.1.64; 1.1.72; 1.1.74;
machine-independent TurboChannel bus configuration. These files
deal with stuff like:
(1) configuring built-in devices,
(2) looking at TC slots configuring any devices found.
The lists of slots, slot locations, etc. and built-in devices
are provided by machine-dependent code. Interrupt handling
is also provided by machine-dependent code, but the MD code provides
hooks so that standard names for 'establish' and 'disestablish'
can be used in drivers.

This code requires <machine/tc_machdep.h>, which defines some
portability types specific to the TurboChannel bus code.
 1.1.74.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.72.1 29-Apr-2005  kent sync with -current
 1.1.64.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.140.1 28-Aug-2017  skrll Sync with HEAD
 1.3.120.1 03-Dec-2017  jdolecek update from HEAD
 1.6 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.5 24-Apr-2021  thorpej branches: 1.5.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.4 03-Dec-2016  flxd branches: 1.4.14; 1.4.34;
newline
 1.3 03-Dec-2016  flxd Print warning for problematic switch configuration.
 1.2 13-Sep-2016  christos branches: 1.2.2; 1.2.4;
Adapt driver to final CPLD implementation. (Felix Deichmann)
 1.1 11-Aug-2016  christos TURBOchannel usb/gpio driver from Felix Deichmann
 1.2.4.3 05-Dec-2016  skrll Sync with HEAD
 1.2.4.2 05-Oct-2016  skrll Sync with HEAD
 1.2.4.1 13-Sep-2016  skrll file tcu.c was added on branch nick-nhusb on 2016-10-05 20:55:57 +0000
 1.2.2.3 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.2.2.2 14-Sep-2016  pgoyette Sync with HEAD
 1.2.2.1 13-Sep-2016  pgoyette file tcu.c was added on branch pgoyette-localcount on 2016-09-14 03:04:17 +0000
 1.4.34.1 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.4.14.2 03-Dec-2017  jdolecek update from HEAD
 1.4.14.1 03-Dec-2016  jdolecek file tcu.c was added on branch tls-maxphys on 2017-12-03 11:37:33 +0000
 1.5.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.28 07-May-2021  thorpej A small bit of const poisoning.
 1.27 09-Jun-2017  flxd branches: 1.27.24;
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
 1.26 04-Jun-2011  tsutsui branches: 1.26.12; 1.26.30; 1.26.46;
Split device_t/softc. pmax is tested on GXemul.
Compile test only for alpha and vax.

XXX: alpha/tc/tcasic.c calls tcattach() via config_found(9), but
XXX: pmax/tc/tcbus.c and vax/vsa/tc_vsbus.c calls tcattach() directly.
XXX: It looks horrible...
 1.25 20-Feb-2011  matt branches: 1.25.2;
Add some missing includes of <sys/device.h>
 1.24 12-May-2009  cegger branches: 1.24.4; 1.24.6; 1.24.8;
struct device * -> device_t, no functional changes intended.
 1.23 19-Oct-2007  ad branches: 1.23.20; 1.23.34;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.22 11-Dec-2005  christos branches: 1.22.30; 1.22.44; 1.22.46; 1.22.50;
merge ktrace-lwp.
 1.21 01-Jun-2005  drochner branches: 1.21.2;
fix cast-qual fallout
 1.20 27-Feb-2005  perry nuke trailing whitespace
 1.19 26-Aug-2004  drochner branches: 1.19.4; 1.19.6;
some cleanup: use the locator-passing variant of config_found(), get
the macros just hiding cfdata members out of tcvar.h and include
"locators.h" only in the .c file
 1.18 27-Apr-2004  yamt remove redundant function prototypes to make this compilable after
snprintf changes.
 1.17 04-Jun-2000  cgd branches: 1.17.26;
Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.16 01-Jun-2000  cgd kill __P in these files. (I had to look at them anyway with an eye for
adding some protos... and adding them with __P seems wrong, but mixing
__P and not __P in the same file seems wrong too, so...)
 1.15 15-Nov-1999  nisimura branches: 1.15.2;
Relocate 'struct tc_softc' and several function declarations useful
to outsides of 'tc.c' into 'tcvar.h'.
 1.14 19-Mar-1999  cgd branches: 1.14.8; 1.14.14;
pull tc_machdep.h in from machine/
 1.13 22-May-1998  thorpej DECstation now provides bus_space and bus_dma data structures to us.
 1.12 19-Apr-1998  jonathan pmax has IPL_ constants; Define TC_IPL_ using them until all tc
drivers are converted to use IPL_.

Commit changes to if_le_ibus.c as a child of ibus.
 1.11 19-Jan-1998  thorpej Add "get this slot's DMA tag" function pointer on the Alpha.
 1.10 12-Jan-1998  thorpej Adjust for changes in config.
 1.9 01-Sep-1997  jonathan Remove '#ifdef alpha' around bus_space_tag_t uses and includes.
 1.8 17-Jul-1997  jtk branches: 1.8.2;
use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all
TCCF_*_UNKNOWN uses in tc code with the native names from locators.h
 1.7 22-Oct-1996  cgd update for new bus.h
 1.6 09-Sep-1996  cgd add missing underscore to __alpha_, to map interrupt names properly.
It worked right before because of happy coincidence.
 1.5 17-May-1996  cgd Update for new includes (<machine/bus.h> & <machine/intr.h>) on the
alpha. At some point in the future, those headers should be provided
on the pmax, but until then, things are #ifdef'd so that the old
headers and definitions are still used. Pass a bus_chipset_tag_t
to the TC bus attach code and to devices, on the alpha.
 1.4 17-Mar-1996  jonathan Additional fixes to complete the NetBSD/1.1B config changes:

Rename the extern declaration of `tccd' and `ioasiccd' in
src/sys/dev/tc/{tvar.h,ioasicvar.h", respectively, to be
`tc_cd' and `ioasic_cd', to match the 1.1B-style definitions.
 1.3 27-Feb-1996  cgd use #defines for bus speed constants, print speed on attach
 1.2 26-Feb-1996  cgd (1) rename some structures & structure members, for consistency with
planned changes in other sections of code.
(2) expands the use of config_found() in tcattach() in-line, so that
tcsubmatch can be invoked there, rather than being invoked by
individual drivers.
(3) tcbus_attach_args now includes a turbochannel speed flag.
(4) compare a string in tcbus_attach_args against tc bus driver name,
to better allow attachment of multiple busses to the same parent.
 1.1 20-Dec-1995  cgd machine-independent TurboChannel bus configuration. These files
deal with stuff like:
(1) configuring built-in devices,
(2) looking at TC slots configuring any devices found.
The lists of slots, slot locations, etc. and built-in devices
are provided by machine-dependent code. Interrupt handling
is also provided by machine-dependent code, but the MD code provides
hooks so that standard names for 'establish' and 'disestablish'
can be used in drivers.

This code requires <machine/tc_machdep.h>, which defines some
portability types specific to the TurboChannel bus code.
 1.8.2.1 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.14.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.15.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.17.26.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.26.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.17.26.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.26.3 18-Sep-2004  skrll Sync with HEAD.
 1.17.26.2 03-Sep-2004  skrll Sync with HEAD
 1.17.26.1 03-Aug-2004  skrll Sync with HEAD
 1.19.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.4.1 29-Apr-2005  kent sync with -current
 1.21.2.1 27-Oct-2007  yamt sync with head.
 1.22.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.22.46.1 06-Nov-2007  matt sync with HEAD
 1.22.44.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.22.30.1 23-Oct-2007  ad Sync with head.
 1.23.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.23.20.1 16-May-2009  yamt sync with head
 1.24.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.24.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.24.4.2 12-Jun-2011  rmind sync with head
 1.24.4.1 05-Mar-2011  rmind sync with head
 1.25.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.26.46.1 01-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #65):
share/man/man4/tc.4: revision 1.7
sys/arch/alpha/tc/tcasic.c: revision 1.46
sys/arch/pmax/tc/tcbus.c: revision 1.33
sys/arch/vax/conf/files.vax: revision 1.121
sys/arch/vax/vsa/tc_vsbus.c: revision 1.8, 1.9
sys/dev/tc/tc.c: revision 1.55
sys/dev/tc/tcvar.h: revision 1.27
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
--
whitespace
--
Add vax.
 1.26.30.1 28-Aug-2017  skrll Sync with HEAD
 1.26.12.1 03-Dec-2017  jdolecek update from HEAD
 1.27.24.1 13-May-2021  thorpej Sync with HEAD.
 1.66 06-Dec-2021  abs Add WSDISPLAYIO_GET_FBINFO support to most TURBOchannel framebuffers

This adds WSDISPLAYIO_GET_FBINFO to cfb, mfb, sfb, tfb and xcfb
TURBOchannel framebuffers as used by pmax and alpha

It does not add support to px and pxg (they handle ioctls in common
code in stic.c and more careful wiring is required)

These changes allow an Xswfb X server to use the framebuffer
directly, albeit without any special acceleration

A subsequent change will re-enable X server building on pmax, and
also hopefully switch alpha from Xorg 1.10 to 1.20
 1.65 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.64 24-Apr-2021  thorpej branches: 1.64.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.63 10-Nov-2019  chs branches: 1.63.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.62 24-Jan-2018  riastradh branches: 1.62.4;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.61 11-Jan-2012  macallan adjust wsfont_find()
 1.60 13-Nov-2010  uebayasi branches: 1.60.8; 1.60.12;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.59 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.58 15-May-2010  tsutsui Set RI_NO_AUTO in ri_flg if *fb_common_init() is invoked from cnattach.
Untested.
 1.57 22-Aug-2009  tsutsui branches: 1.57.2; 1.57.4;
u_intNN_t -> uintNN_t
 1.56 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.55 09-Jul-2008  joerg branches: 1.55.2;
- device/softc split
- make sfbplus at least compilable
 1.54 26-May-2008  nisimura branches: 1.54.2; 1.54.4;
- 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.53 19-Oct-2007  ad branches: 1.53.16; 1.53.18; 1.53.20; 1.53.22;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.52 04-Mar-2007  yamt branches: 1.52.2; 1.52.14; 1.52.16; 1.52.20;
fix fallout from caddr_t changes.
 1.51 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.50 12-Apr-2006  jmmv branches: 1.50.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.49 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.48 30-Mar-2006  thorpej Use device_private().
 1.47 11-Dec-2005  christos branches: 1.47.4; 1.47.6; 1.47.8; 1.47.10; 1.47.12;
merge ktrace-lwp.
 1.46 27-Feb-2005  perry branches: 1.46.4;
nuke trailing whitespace
 1.45 02-Jan-2005  mhitch branches: 1.45.2; 1.45.4;
Fix and simplify incorrect check for screen blanking in WSDISPLAYIO_SVIDEO.
 1.44 20-Dec-2003  nisimura - Minor coding modifications for VDAC register access.
- De-__P() this time.
Tested valid with 4MAXINE.
 1.43 17-Dec-2003  ad - Restore the display to a sane state when leaving mapped mode.
- OR updates into sc_changed, and protect with spltty()/splx().
 1.42 13-Nov-2003  chs eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.41 27-Oct-2003  chs uninitialized variables
 1.40 29-Jun-2003  fvdl branches: 1.40.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.39 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.38 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.37 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.36 19-Aug-2002  itohy Leaving overflow-sensitive code, very similar to what was fixed
in the previous changes to cfb.c / sfb.c / xcfb.c, would not be clever.
Just modify in the similar way.
 1.35 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.34 17-Mar-2002  atatat branches: 1.34.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.33 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.32 13-Nov-2001  lukem add/cleanup RCSIDs
 1.31 22-Aug-2001  nisimura Nuke fb_devconfig data structure which was found unnecessary to have.
 1.30 05-Aug-2001  jdolecek use unsigned variable types as appropriate
 1.29 16-Jan-2001  nisimura branches: 1.29.2; 1.29.4;
- relocate the code to place sprite cursor inside interrupt handlers
called on every virtical replace.
- efforts to make the code strucutures similar across TC framebuffers.
 1.28 27-Oct-2000  nisimura Fix errors in initializing the software copy of 256 entry colormap
stored in device softc. rasops_cmap[] array is orginazed in 256
iteration of 3 byte long RBG triplet, which does not match with
struct wsdisplay_cmap design.
 1.27 13-Sep-2000  nisimura Found glyph pixel order inverted on screen.
 1.26 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.25 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.24 16-Mar-2000  nisimura branches: 1.24.4;
Place 34 by 80 console at the center of screen.
 1.23 14-Mar-2000  nisimura Respect video console colour designation by configration file.
 1.22 14-Mar-2000  nisimura Switch to improved flexible video console text rasterizer provided by
rasops and wsfont.
 1.21 06-Dec-1999  drochner update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.20 29-Nov-1999  nisimura Const poisoning.
 1.19 19-Oct-1999  nisimura branches: 1.19.2;
Enable 'WSSCREEN_REVERSE' scr-capability.
 1.18 20-Sep-1999  nisimura branches: 1.18.2; 1.18.4;
Add one new dispaly type for DEC TC TX 8/24bpp framebuffer. Currently acts
as an 8bpp pseudo color device.
 1.17 25-Aug-1999  nisimura - Fix an error in cursor image manipulation. I learned a pair of Bt431
were populated in reverse order from PMAG-A MX ...
 1.16 25-Aug-1999  nisimura - 24bit per pixel TX framebuffer occupies 0x600000.
 1.15 02-Aug-1999  nisimura - Fix TX 8bpp framebuffer size, which occupies 2MB.
- Rework CX RAMDAC register access like as other TC framebuffers.
 1.14 30-Jul-1999  nisimura - Fix TX 66Hz interrupt handling. Verified ok with PMAG-JA as an 8bpp
console. XXX troubles in cursor color.
- Typo in comments of MX.
 1.13 25-Jun-1999  nisimura - Show 1bpp for MX during configuration stage.
- Replace memory layout 'struct' with array/pointer access.
 1.12 07-May-1999  nisimura - Sweep abit preparing for code merge to have common 'vdacops' across
various graphics cards.
 1.11 29-Mar-1999  nisimura branches: 1.11.4;
- Unnecessary to have '#include <machine/autoconf.h>' for those.
 1.10 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.9 01-Mar-1999  nisimura - Fix cursor image validity check error in set_cursor().
 1.8 15-Jan-1999  thorpej __pmax__ -> pmax, like other ports.
 1.7 11-Jan-1999  drochner remove dummy "load_font" entries
 1.6 14-Dec-1998  nisimura - Fix typos in commentary description.
 1.5 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


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

by someone!
 1.4 18-Nov-1998  nisimura - Fix cursor image handling bugs escaped in last commit.
 1.3 09-Nov-1998  nisimura - Fix many errors in cursor image manipulation. Hardware expect 2
bit/pixel format, not planer format. Assign MSB for cursor mask and
LSB for cursor image, where 10 means mask color and 11 for image color.
Image bit order of Bt431 and Bt459 are opposite to MIPS/Alpha processors
while IMS G332 and DC503 (PCC) are indentical.
- Assume that cursor images are 32 pixel padded as ULTRIX/DU ws interface
do. It's natural to X server.
- XXX Vast majority of codes are duplicated between mfb<->tfb and cfb<->sfb.
Code sharing might be achieved in the context of TGA/SFB+ merge.
 1.2 30-Oct-1998  nisimura - Assign copyright terms.
 1.1 29-Oct-1998  nisimura - Introduce MI NWSCONS drivers for TURBOchannel framebuffer option cards.

N.B., Digital UNIX never supports neither PMAG-AA (mfb) nor PMAG-BA (cfb)
for TC Alphas. PMAG-DV (xcfb) is Personal DECstation built in. All should
be good for console, but need much works for cursor/colormap completeness.
 1.11.4.3 02-Aug-1999  thorpej Update from trunk.
 1.11.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.18.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.18.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.18.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.18.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.18.2.1 20-Oct-1999  thorpej Sync w/ trunk.
 1.19.2.2 19-Oct-1999  nisimura Enable 'WSSCREEN_REVERSE' scr-capability.
 1.19.2.1 19-Oct-1999  nisimura file tfb.c was added on branch fvdl-softdep on 1999-10-19 00:49:34 +0000
 1.24.4.2 16-Aug-2001  tv Pullup [jdolecek]:

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

Use unsigned variable types to make bounds checking more correct.
 1.24.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.29.4.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.29.4.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.29.4.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.29.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.29.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.29.4.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.29.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.29.2.6 27-Aug-2002  nathanw Catch up to -current.
 1.29.2.5 01-Aug-2002  nathanw Catch up to -current.
 1.29.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.29.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.29.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.29.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.34.4.2 29-Aug-2002  gehenna catch up with -current.
 1.34.4.1 15-Jul-2002  gehenna catch up with -current.
 1.40.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.40.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.40.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.40.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.40.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.40.2.1 03-Aug-2004  skrll Sync with HEAD
 1.45.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.45.2.1 29-Apr-2005  kent sync with -current
 1.46.4.3 27-Oct-2007  yamt sync with head.
 1.46.4.2 03-Sep-2007  yamt sync with head.
 1.46.4.1 21-Jun-2006  yamt sync with head.
 1.47.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.47.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.47.10.1 19-Apr-2006  elad sync with head.
 1.47.8.2 24-May-2006  yamt sync with head.
 1.47.8.1 01-Apr-2006  yamt sync with head.
 1.47.6.1 22-Apr-2006  simonb Sync with head.
 1.47.4.1 09-Sep-2006  rpaulo sync with head
 1.50.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.52.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.52.16.1 06-Nov-2007  matt sync with HEAD
 1.52.14.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.52.2.1 23-Oct-2007  ad Sync with head.
 1.53.22.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.53.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.53.20.3 11-Aug-2010  yamt sync with head.
 1.53.20.2 16-Sep-2009  yamt sync with head
 1.53.20.1 04-May-2009  yamt sync with head.
 1.53.18.1 04-Jun-2008  yamt sync with head
 1.53.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.53.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.53.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.54.4.1 19-Oct-2008  haad Sync with HEAD.
 1.54.2.1 18-Jul-2008  simonb Sync with head.
 1.55.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.57.4.2 05-Mar-2011  rmind sync with head
 1.57.4.1 30-May-2010  rmind sync with head
 1.57.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.60.12.1 18-Feb-2012  mrg merge to -current.
 1.60.8.1 17-Apr-2012  yamt sync with head
 1.62.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.63.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.64.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.60 06-Dec-2021  abs Add WSDISPLAYIO_GET_FBINFO support to most TURBOchannel framebuffers

This adds WSDISPLAYIO_GET_FBINFO to cfb, mfb, sfb, tfb and xcfb
TURBOchannel framebuffers as used by pmax and alpha

It does not add support to px and pxg (they handle ioctls in common
code in stic.c and more careful wiring is required)

These changes allow an Xswfb X server to use the framebuffer
directly, albeit without any special acceleration

A subsequent change will re-enable X server building on pmax, and
also hopefully switch alpha from Xorg 1.10 to 1.20
 1.59 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.58 24-Apr-2021  thorpej branches: 1.58.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.57 10-Nov-2019  chs branches: 1.57.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.56 24-Jan-2018  riastradh branches: 1.56.4;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.55 11-Jan-2012  macallan adjust wsfont_find()
 1.54 13-Nov-2010  uebayasi branches: 1.54.8; 1.54.12;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.53 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.52 15-May-2010  tsutsui Set RI_NO_AUTO in ri_flg if *fb_common_init() is invoked from cnattach.
Untested.
 1.51 22-Aug-2009  tsutsui branches: 1.51.2; 1.51.4;
u_intNN_t -> uintNN_t
 1.50 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.49 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.48 27-Dec-2008  he branches: 1.48.2;
Follow up on the removal of MALLOC(), use malloc() instead.
 1.47 09-Jul-2008  joerg branches: 1.47.2;
- device/softc split
- make sfbplus at least compilable
 1.46 26-May-2008  nisimura branches: 1.46.2; 1.46.4;
- 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.45 19-Oct-2007  ad branches: 1.45.16; 1.45.18; 1.45.20; 1.45.22;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.44 06-Mar-2007  simonb branches: 1.44.2; 1.44.14; 1.44.16; 1.44.20;
Fix some caddr_t rototill fallout.
 1.43 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.42 12-Apr-2006  jmmv branches: 1.42.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.41 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.40 30-Mar-2006  thorpej Use device_private().
 1.39 11-Dec-2005  christos branches: 1.39.4; 1.39.6; 1.39.8; 1.39.10; 1.39.12;
merge ktrace-lwp.
 1.38 27-Feb-2005  perry branches: 1.38.4;
nuke trailing whitespace
 1.37 02-Jan-2005  mhitch branches: 1.37.2; 1.37.4;
Fix and simplify incorrect check for screen blanking in WSDISPLAYIO_SVIDEO.
 1.36 20-Dec-2003  nisimura - Minor coding modifications for VDAC register access.
- De-__P() this time.
Tested valid with 4MAXINE.
 1.35 17-Dec-2003  ad - Restore the display to a sane state when leaving mapped mode.
- OR updates into sc_changed, and protect with spltty()/splx().
 1.34 13-Dec-2003  ad Make this compile again.
 1.33 13-Nov-2003  chs eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.32 02-Oct-2002  thorpej branches: 1.32.6;
Add trailing ; to CFATTACH_DECL.
 1.31 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 19-Aug-2002  itohy Leaving overflow-sensitive code, very similar to what was fixed
in the previous changes to cfb.c / sfb.c / xcfb.c, would not be clever.
Just modify in the similar way.
 1.29 06-Aug-2002  itojun integer overflow. from silvio@qualys.com
 1.28 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.27 17-Mar-2002  atatat branches: 1.27.4; 1.27.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.26 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.25 13-Nov-2001  lukem add/cleanup RCSIDs
 1.24 22-Aug-2001  nisimura Nuke fb_devconfig data structure which was found unnecessary to have.
 1.23 05-Aug-2001  jdolecek use unsigned variable types as appropriate
 1.22 09-Apr-2001  nathanw branches: 1.22.2;
Fix spelling errors in comments.
 1.21 27-Oct-2000  nisimura branches: 1.21.2;
Fix errors in initializing the software copy of 256 entry colormap
stored in device softc. rasops_cmap[] array is orginazed in 256
iteration of 3 byte long RBG triplet, which does not match with
struct wsdisplay_cmap design.
 1.20 12-Sep-2000  nisimura Found glyph pixel order inverted on screen.
 1.19 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.18 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.17 16-Mar-2000  nisimura branches: 1.17.4;
Place 34 by 80 console at the center of screen.
 1.16 14-Mar-2000  nisimura Respect video console colour designation by configration file.
 1.15 14-Mar-2000  nisimura Switch to improved flexible video console text rasterizer provided by
rasops and wsfont.
 1.14 06-Dec-1999  drochner update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.13 29-Nov-1999  nisimura Const poisoning.
 1.12 19-Oct-1999  nisimura branches: 1.12.2;
Enable 'WSSCREEN_REVERSE' scr-capability.
 1.11 07-May-1999  nisimura branches: 1.11.2; 1.11.4;
- Sweep abit preparing for code merge to have common 'vdacops' across
various graphics cards.
 1.10 30-Apr-1999  nisimura - Nuke debugging aids mistakenly committed.
 1.9 30-Apr-1999  nisimura - I finally learned CSR_A register of IMS G332 VDAC must be treated as
write only. Read-motify-write operation breaks its video mode.
- VDAC regiters are now initialized as ULTRIX does.
 1.8 29-Mar-1999  nisimura branches: 1.8.4;
- Unnecessary to have '#include <machine/autoconf.h>' for those.
 1.7 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.6 11-Jan-1999  drochner remove dummy "load_font" entries
 1.5 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


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

by someone!
 1.4 19-Nov-1998  nisimura - Fix an error in cursor color manipulation. 24bit RGB value was mistakenly
assigned to unsigned short variable.
- XXX PMAG-DV is supposed to emit virtical retrace interrupt, which can be
used for colormap/cursor update just like other TURBOchannel framebuffers.
 1.3 09-Nov-1998  nisimura - Fix many errors in cursor image manipulation. Hardware expect 2
bit/pixel format, not planer format. Assign MSB for cursor mask and
LSB for cursor image, where 10 means mask color and 11 for image color.
Image bit order of Bt431 and Bt459 are opposite to MIPS/Alpha processors
while IMS G332 and DC503 (PCC) are indentical.
- Assume that cursor images are 32 pixel padded as ULTRIX/DU ws interface
do. It's natural to X server.
- XXX Vast majority of codes are duplicated between mfb<->tfb and cfb<->sfb.
Code sharing might be achieved in the context of TGA/SFB+ merge.
 1.2 30-Oct-1998  nisimura - Assign copyright terms.
 1.1 29-Oct-1998  nisimura - Introduce MI NWSCONS drivers for TURBOchannel framebuffer option cards.

N.B., Digital UNIX never supports neither PMAG-AA (mfb) nor PMAG-BA (cfb)
for TC Alphas. PMAG-DV (xcfb) is Personal DECstation built in. All should
be good for console, but need much works for cursor/colormap completeness.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.2.4 21-Apr-2001  bouyer Sync with HEAD
 1.11.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.11.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.2.1 20-Oct-1999  thorpej Sync w/ trunk.
 1.12.2.2 19-Oct-1999  nisimura Enable 'WSSCREEN_REVERSE' scr-capability.
 1.12.2.1 19-Oct-1999  nisimura file xcfb.c was added on branch fvdl-softdep on 1999-10-19 00:49:34 +0000
 1.17.4.3 04-Sep-2002  itojun pullup (itojun)

sys/arch/amiga/dev/grf_cv3d.c 1.11
sys/arch/hpcmips/dev/mq200.c 1.21
sys/arch/i386/i386/sys_machdep.c 1.64
sys/arch/luna68k/dev/lunafb.c 1.9
sys/arch/sparc/dev/bt_subr.c via patch
sys/arch/sparc64/dev/bt_subr.c via patch
sys/arch/sun3/dev/bt_subr.c via patch
sys/compat/ibcs2/ibcs2_stat.c 1.21-1.23
sys/dev/sun/bt_subr.c 1.3
sys/dev/tc/cfb.c 1.34
sys/dev/tc/sfb.c 1.53
sys/dev/tc/xcfb.c 1.29
integer overflow. reported by silvio@qualys.com
 1.17.4.2 16-Aug-2001  tv Pullup [jdolecek]:

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

Use unsigned variable types to make bounds checking more correct.
 1.17.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.21.2.9 18-Oct-2002  nathanw Catch up to -current.
 1.21.2.8 27-Aug-2002  nathanw Catch up to -current.
 1.21.2.7 13-Aug-2002  nathanw Catch up to -current.
 1.21.2.6 01-Aug-2002  nathanw Catch up to -current.
 1.21.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.21.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.21.2.3 21-Sep-2001  nathanw Catch up to -current.
 1.21.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.21.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.22.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.22.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.22.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.22.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.22.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.22.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.27.6.1 07-Aug-2002  lukem Pull up revision 1.29 (requested by itojun in ticket #616):
integer overflow. from silvio@qualys.com
 1.27.4.2 29-Aug-2002  gehenna catch up with -current.
 1.27.4.1 15-Jul-2002  gehenna catch up with -current.
 1.32.6.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.32.6.5 17-Jan-2005  skrll Sync with HEAD.
 1.32.6.4 13-Jan-2005  skrll Adapt to branch
 1.32.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.6.1 03-Aug-2004  skrll Sync with HEAD
 1.37.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.37.2.1 29-Apr-2005  kent sync with -current
 1.38.4.3 27-Oct-2007  yamt sync with head.
 1.38.4.2 03-Sep-2007  yamt sync with head.
 1.38.4.1 21-Jun-2006  yamt sync with head.
 1.39.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.39.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.39.10.1 19-Apr-2006  elad sync with head.
 1.39.8.2 24-May-2006  yamt sync with head.
 1.39.8.1 01-Apr-2006  yamt sync with head.
 1.39.6.1 22-Apr-2006  simonb Sync with head.
 1.39.4.1 09-Sep-2006  rpaulo sync with head
 1.42.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.44.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.44.16.1 06-Nov-2007  matt sync with HEAD
 1.44.14.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.44.2.1 23-Oct-2007  ad Sync with head.
 1.45.22.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.45.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.45.20.4 11-Aug-2010  yamt sync with head.
 1.45.20.3 16-Sep-2009  yamt sync with head
 1.45.20.2 16-May-2009  yamt sync with head
 1.45.20.1 04-May-2009  yamt sync with head.
 1.45.18.1 04-Jun-2008  yamt sync with head
 1.45.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.45.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.45.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.46.4.1 19-Oct-2008  haad Sync with HEAD.
 1.46.2.1 18-Jul-2008  simonb Sync with head.
 1.47.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.48.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.51.4.2 05-Mar-2011  rmind sync with head
 1.51.4.1 30-May-2010  rmind sync with head
 1.51.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.54.12.1 18-Feb-2012  mrg merge to -current.
 1.54.8.1 17-Apr-2012  yamt sync with head
 1.56.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.57.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.58.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.46 20-Jul-2022  thorpej No need to test for __alpha__ || alpha ... just one will suffice.
 1.45 28-May-2022  andvar fix various typos, mainly in comments.
 1.44 11-Sep-2021  andvar Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
 1.43 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42 24-Apr-2021  thorpej branches: 1.42.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.41 10-Nov-2019  chs branches: 1.41.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.40 12-May-2009  cegger branches: 1.40.64;
struct cfdata * -> cfdata_t, no functional changes intended.
 1.39 18-Apr-2009  tsutsui Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.38 18-Mar-2009  cegger bcopy -> memcpy
 1.37 28-Apr-2008  martin branches: 1.37.8; 1.37.14;
Remove clause 3 and 4 from TNF licenses
 1.36 29-Mar-2008  tsutsui branches: 1.36.2; 1.36.4;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.35 09-Nov-2007  ad branches: 1.35.14;
Use zs_lock_init() to set up the chanstate's lock.
 1.34 07-Nov-2007  ad Merge tty changes from the vmlocking branch.
 1.33 08-Oct-2007  ad branches: 1.33.2; 1.33.4;
Use the softint API.
 1.32 10-May-2006  skrll branches: 1.32.18; 1.32.32; 1.32.34; 1.32.36;
Fix a bunch of cast lvalues.
 1.31 31-Mar-2006  thorpej Use ANSI function decls, apply static.
 1.30 30-Mar-2006  thorpej Use device_private().
 1.29 11-Dec-2005  christos branches: 1.29.4; 1.29.6; 1.29.8; 1.29.10; 1.29.12;
merge ktrace-lwp.
 1.28 26-Aug-2005  drochner s/locdesc_t/int/g
 1.27 25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.26 02-Jun-2005  drochner branches: 1.26.2;
avoid "volatile" cast-aways
 1.25 27-Feb-2005  perry nuke trailing whitespace
 1.24 04-Feb-2005  perry de-__P
 1.23 13-Sep-2004  drochner branches: 1.23.4; 1.23.6;
a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
on "locators.h"
 1.22 26-Aug-2004  drochner kick out the ioasic offset check which happens in submatch() now
 1.21 06-Mar-2003  matt branches: 1.21.2;
Add cn_halt and cn_flush entries to consdevs. (needed for dma-only console
devices).
 1.20 01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 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 Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.14 26-Sep-2002  thorpej G/c extern reference to ioasic_cd.
 1.13 26-Sep-2002  thorpej No need to make sure parent's cfdriver == &ioasic_cd.
 1.12 24-Sep-2002  ad Deal with the strange SCC wiring on TC IOASIC machines. Thanks to Bill
Studenmund and Jonathan Stone for useful comments.
 1.11 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.10 12-Jan-2002  tsutsui branches: 1.10.8;
Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.9 13-Nov-2001  lukem add/cleanup RCSIDs
 1.8 14-Sep-2001  ad Zero out uninitalized fields in the freshly allocated zs_chanstate.
 1.7 30-May-2001  lukem branches: 1.7.2; 1.7.4;
add missing #include "opt_kgdb.h"
 1.6 22-Nov-2000  nisimura branches: 1.6.2;
- fix an error in uninitialized variable reference.
- add a missing function argument declaration.
- minor comment adjustments.
 1.5 17-Oct-2000  nisimura branches: 1.5.2;
Have consistent #if's for machine dependent clauses.
 1.4 17-Oct-2000  nisimura - efforts to merge TC Alpha and IOASIC DECstation, derived from Mattias
Drochner's work made in nisimura-pmax-wscons branch. Still a little
to do before useful for DECstation. MI softintr required.
- allow wildcard matchs to have zstty/zskbd/zsms in default hardware
configuration.
- abandon to check zs_ioasic_cnattach() return value; it doesn't fail.
- have zs_ioasic_cnattach() serial line parameters hardcoded inside, in
symmetry with zs_ioasic_lk201_cnattach().
 1.3 09-Sep-2000  nisimura u_char -> u_int for function argument and return of Zilog register
manipulation helper functions; no loss, no gain, for Alpha processor.
 1.2 05-Jul-2000  nisimura - Withdraw ZS_IOASIC_DMA conditional which has never been useful.
- Sanitize ZS register access.
 1.1 05-Jul-2000  nisimura Repopulate 4 files, zs_ioasic.c and zs_ioasicvar.h from arch/alpha/tc,
zskbd.c and zsms.c from dev/dec/, respectively. No functionality
change this time.
 1.5.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.5.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.2.1 17-Oct-2000  bouyer file zs_ioasic.c was added on branch thorpej_scsipi on 2000-11-20 11:43:18 +0000
 1.6.2.7 03-Jan-2003  thorpej Sync with HEAD.
 1.6.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.6.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.6.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.6.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.6.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.6.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.7.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.7.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.8.1 16-May-2002  gehenna Replace the hard-coded major with devsw API.
 1.21.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Sep-2004  skrll Sync with HEAD
 1.23.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.23.6.1 12-Feb-2005  yamt sync with head.
 1.23.4.1 29-Apr-2005  kent sync with -current
 1.26.2.3 15-Nov-2007  yamt sync with head.
 1.26.2.2 27-Oct-2007  yamt sync with head.
 1.26.2.1 21-Jun-2006  yamt sync with head.
 1.29.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.29.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.29.10.2 11-May-2006  elad sync with head
 1.29.10.1 19-Apr-2006  elad sync with head.
 1.29.8.2 24-May-2006  yamt sync with head.
 1.29.8.1 01-Apr-2006  yamt sync with head.
 1.29.6.2 01-Jun-2006  kardel Sync with head.
 1.29.6.1 22-Apr-2006  simonb Sync with head.
 1.29.4.1 09-Sep-2006  rpaulo sync with head
 1.32.36.1 14-Oct-2007  yamt sync with head.
 1.32.34.3 09-Jan-2008  matt sync with HEAD
 1.32.34.2 08-Nov-2007  matt sync with -HEAD
 1.32.34.1 06-Nov-2007  matt sync with HEAD
 1.32.32.2 11-Nov-2007  joerg Sync with HEAD.
 1.32.32.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.32.18.2 15-Jul-2007  ad Get pmax working.
 1.32.18.1 17-Jun-2007  ad - Increase the number of thread priorities from 128 to 256. How the space
is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
is provided, with hooks for fast-path MD code that can run the interrupt
threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.
 1.33.4.1 19-Nov-2007  mjf Sync with HEAD.
 1.33.2.1 13-Nov-2007  bouyer Sync with HEAD
 1.35.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.35.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.36.4.3 16-May-2009  yamt sync with head
 1.36.4.2 04-May-2009  yamt sync with head.
 1.36.4.1 16-May-2008  yamt sync with head.
 1.36.2.1 18-May-2008  yamt sync with head.
 1.37.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.40.64.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.41.10.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.41.10.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.42.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.70; 1.5.72; 1.5.74;
merge ktrace-lwp.
 1.4 04-Feb-2005  perry de-__P
 1.3 24-Sep-2002  ad branches: 1.3.6; 1.3.14; 1.3.16;
Deal with the strange SCC wiring on TC IOASIC machines. Thanks to Bill
Studenmund and Jonathan Stone for useful comments.
 1.2 17-Oct-2000  nisimura branches: 1.2.2; 1.2.4; 1.2.6;
- efforts to merge TC Alpha and IOASIC DECstation, derived from Mattias
Drochner's work made in nisimura-pmax-wscons branch. Still a little
to do before useful for DECstation. MI softintr required.
- allow wildcard matchs to have zstty/zskbd/zsms in default hardware
configuration.
- abandon to check zs_ioasic_cnattach() return value; it doesn't fail.
- have zs_ioasic_cnattach() serial line parameters hardcoded inside, in
symmetry with zs_ioasic_lk201_cnattach().
 1.1 05-Jul-2000  nisimura Repopulate 4 files, zs_ioasic.c and zs_ioasicvar.h from arch/alpha/tc,
zskbd.c and zsms.c from dev/dec/, respectively. No functionality
change this time.
 1.2.6.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.4.1 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 17-Oct-2000  bouyer file zs_ioasicvar.h was added on branch thorpej_scsipi on 2000-11-20 11:43:18 +0000
 1.3.16.1 12-Feb-2005  yamt sync with head.
 1.3.14.1 29-Apr-2005  kent sync with -current
 1.3.6.1 04-Feb-2005  skrll Sync with HEAD.
 1.5.74.1 16-May-2008  yamt sync with head.
 1.5.72.1 18-May-2008  yamt sync with head.
 1.5.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.22 17-Feb-2024  tsutsui Fix another fatal typo that causes zskbd_cngetc() to stall as dzkbd.

Tested on my DEC 3000/300 and LK421.
Should be pulled up to netbsd-10 and netbsd-9.

XXX: sys/arch/vax/uba/qvkbd.c seems missed in the following lk201 changes:
https://mail-index.netbsd.org/source-changes/2015/01/02/msg062024.html
 1.21 07-Aug-2021  thorpej branches: 1.21.6;
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 10-Nov-2019  chs branches: 1.19.10;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.18 02-Jan-2015  jklos branches: 1.18.18; 1.18.24;
Patches from Björ Johannesson to fix DEC LK201 keyboards, this time
applied to correct tree.
 1.17 12-May-2009  cegger branches: 1.17.22; 1.17.38; 1.17.40;
struct device * -> device_t, no functional changes intended.
 1.16 29-Mar-2008  tsutsui branches: 1.16.4; 1.16.18;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.15 04-Mar-2007  christos branches: 1.15.36;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 31-Mar-2006  thorpej branches: 1.14.14;
Use ANSI function decls, apply static.
 1.13 30-Mar-2006  thorpej Use device_private().
 1.12 11-Dec-2005  christos branches: 1.12.4; 1.12.6; 1.12.8; 1.12.10; 1.12.12;
merge ktrace-lwp.
 1.11 27-Feb-2005  perry branches: 1.11.4;
nuke trailing whitespace
 1.10 04-Feb-2005  perry de-__P
 1.9 07-Aug-2003  agc branches: 1.9.8; 1.9.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 02-Oct-2002  thorpej branches: 1.8.6;
Add trailing ; to CFATTACH_DECL.
 1.7 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 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.4 13-Mar-2002  ad zskbd_keydesctab -> lkkbd_keydesctab
 1.3 13-Nov-2001  lukem add/cleanup RCSIDs
 1.2 18-Sep-2001  ad Get/set keyclick volume.
 1.1 05-Jul-2000  nisimura branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Repopulate 4 files, zs_ioasic.c and zs_ioasicvar.h from arch/alpha/tc,
zskbd.c and zsms.c from dev/dec/, respectively. No functionality
change this time.
 1.1.8.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.6.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.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.4.1 21-Sep-2001  nathanw Catch up to -current.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 05-Jul-2000  bouyer file zskbd.c was added on branch thorpej_scsipi on 2000-11-20 11:43:18 +0000
 1.8.6.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.6.5 04-Feb-2005  skrll Sync with HEAD.
 1.8.6.4 13-Jan-2005  skrll Adapt to branch
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.10.1 12-Feb-2005  yamt sync with head.
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.11.4.2 03-Sep-2007  yamt sync with head.
 1.11.4.1 21-Jun-2006  yamt sync with head.
 1.12.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.12.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.12.10.1 19-Apr-2006  elad sync with head.
 1.12.8.1 01-Apr-2006  yamt sync with head.
 1.12.6.1 22-Apr-2006  simonb Sync with head.
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.14.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.36.1 03-Apr-2008  mjf Sync with HEAD.
 1.16.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.16.4.1 16-May-2009  yamt sync with head
 1.17.40.1 06-Apr-2015  skrll Sync with HEAD
 1.17.38.2 02-Jan-2015  snj Revert changes that were presumably intended for HEAD. Hi jklos!
 1.17.38.1 02-Jan-2015  jklos Patches from Björn Johannessonto fix DEC LK201 keyboards.
 1.17.22.1 03-Dec-2017  jdolecek update from HEAD
 1.18.24.1 18-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1799):

sys/dev/tc/zskbd.c: revision 1.22

Fix another fatal typo that causes zskbd_cngetc() to stall as dzkbd.
Tested on my DEC 3000/300 and LK421.
 1.18.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.19.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.20.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.21.6.1 18-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #600):

sys/dev/tc/zskbd.c: revision 1.22

Fix another fatal typo that causes zskbd_cngetc() to stall as dzkbd.
Tested on my DEC 3000/300 and LK421.
 1.20 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.19 24-Apr-2021  thorpej branches: 1.19.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.18 12-May-2009  cegger branches: 1.18.80;
struct device * -> device_t, no functional changes intended.
 1.17 29-Mar-2008  tsutsui branches: 1.17.4; 1.17.18;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.16 04-Mar-2007  christos branches: 1.16.36;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 12-Nov-2006  plunky branches: 1.15.4;
Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
 1.14 31-Mar-2006  thorpej branches: 1.14.8; 1.14.10;
Use ANSI function decls, apply static.
 1.13 30-Mar-2006  thorpej Use device_private().
 1.12 11-Dec-2005  christos branches: 1.12.4; 1.12.6; 1.12.8; 1.12.10; 1.12.12;
merge ktrace-lwp.
 1.11 04-Feb-2005  perry branches: 1.11.6;
de-__P
 1.10 07-Aug-2003  agc branches: 1.10.8; 1.10.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 02-Oct-2002  thorpej branches: 1.9.6;
Add trailing ; to CFATTACH_DECL.
 1.8 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.7 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.6 06-May-2002  ad Put back a missing brace.
 1.5 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.4 13-Nov-2001  lukem add/cleanup RCSIDs
 1.3 19-Oct-2000  nisimura branches: 1.3.2; 1.3.4; 1.3.6;
- Put comment about wsevent structure counts 0 for the left most mouse
button with a bit coding improvement.
- signed char -> int to hold integer values. Contributed 16 insn savings.
 1.2 14-Oct-2000  nisimura Make sure wsmouseopen() returns ENXIO when no VSXXX mouse is attached.
 1.1 05-Jul-2000  nisimura Repopulate 4 files, zs_ioasic.c and zs_ioasicvar.h from arch/alpha/tc,
zskbd.c and zsms.c from dev/dec/, respectively. No functionality
change this time.
 1.3.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.3.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.3.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.2.1 19-Oct-2000  bouyer file zsms.c was added on branch thorpej_scsipi on 2000-11-20 11:43:18 +0000
 1.9.6.5 04-Feb-2005  skrll Sync with HEAD.
 1.9.6.4 13-Jan-2005  skrll Adapt to branch
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.10.1 12-Feb-2005  yamt sync with head.
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.11.6.3 03-Sep-2007  yamt sync with head.
 1.11.6.2 30-Dec-2006  yamt sync with head.
 1.11.6.1 21-Jun-2006  yamt sync with head.
 1.12.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.12.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.12.10.1 19-Apr-2006  elad sync with head.
 1.12.8.1 01-Apr-2006  yamt sync with head.
 1.12.6.1 22-Apr-2006  simonb Sync with head.
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.14.10.1 10-Dec-2006  yamt sync with head.
 1.14.8.1 18-Nov-2006  ad Sync with head.
 1.15.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.36.1 03-Apr-2008  mjf Sync with HEAD.
 1.17.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.4.1 16-May-2009  yamt sync with head
 1.18.80.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.19.8.1 04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed