Home | History | Annotate | only in /src/sys/arch/vax/vsa
History log of /src/sys/arch/vax/vsa
RevisionDateAuthorComments
 1.45 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.44 07-Jul-2016  msaitoh branches: 1.44.16; 1.44.18;
KNF. Remove extra spaces. No functional change.
 1.43 27-Oct-2012  chs branches: 1.43.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.42 14-Dec-2010  matt branches: 1.42.8; 1.42.18;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.41 21-Nov-2009  rmind branches: 1.41.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.40 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.39 13-Apr-2008  tsutsui branches: 1.39.2; 1.39.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.38 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.37 07-Mar-2008  christos Allow KA53 to link, from Hans Rosenfeld. clk_page is used only if VAX46, VAX48
or VAX49 are defined.
 1.36 03-Feb-2008  matt branches: 1.36.2; 1.36.6;
Reorganize a bit to be able to support multiple sgmaps.
 1.35 04-Mar-2007  christos branches: 1.35.20; 1.35.26;
Fix caddr_t fallout.
 1.34 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.33 08-Mar-2006  lukem branches: 1.33.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.32 11-Dec-2005  christos branches: 1.32.4; 1.32.6; 1.32.8; 1.32.10;
merge ktrace-lwp.
 1.31 14-Dec-2004  chs branches: 1.31.10;
use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.30 19-Oct-2003  ragge Fetch SCSI controller ID from nvram for VS4k90 also.
 1.29 03-May-2003  wiz branches: 1.29.2;
DMA, not dma nor Dma.
 1.28 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.27 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.26 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.25 13-Sep-2002  chuck increase sc_maxxfer from 63K to 64K. otherwise fsck fails for
file systems with larger block sizes.
 1.24 16-May-2001  matt branches: 1.24.2; 1.24.8; 1.24.18;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.23 25-Apr-2001  bouyer Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.22 04-Feb-2001  ragge branches: 1.22.2;
Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.21 16-Nov-2000  matt branches: 1.21.2;
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.20 26-Jul-2000  matt Un __P.
 1.19 19-Jul-2000  matt More ELF changes (a.out still works).
 1.18 18-Jun-2000  matt branches: 1.18.2;
We use opt_cputype.h now.
 1.17 05-Jun-2000  nisimura Have MI ncr53c9x_attach() the 2nd and 3rd arguments for scsipi_adater
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
 1.16 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.15 04-Jun-2000  matt Add extra argument to scb_vecalloc (a struct evcnt *)
Move ivec_dsp from trap.h to scb.h
Add interrupt counting to asc, le, ze, ncr, dz interrupts.
add common support for counting interrupts to cnm_idisp so
it can be done very efficiently.
 1.14 23-May-2000  matt branches: 1.14.2;
Add some debug stuff. Disable SCSI on KA49 for now until I can figure out
why it doesn't work.
 1.13 17-May-2000  matt Preliminary support for the VS4000/90 SGMAP. Needed for SCSI. Does not
quite work right yet.
 1.12 24-Apr-2000  matt be a bit more defensive in the probe routines. only allow one attachment.
 1.11 23-Apr-2000  matt Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.10 18-Apr-2000  matt Remove autconf stuff. not needed and wrong.
 1.9 17-Apr-2000  ragge Fetch the SCSI ID out of NVRAM instead, if possible.
 1.8 17-Apr-2000  ragge DEC have the internal SCSI controller as ID6, and CDROM as ID7.
 1.7 10-Apr-2000  matt Add fix for VS4000 SCSI hangs on disk writes. Add a VAX_BUS_DMA_SPILLPAGE
and use it in the asc_vsbus driver.
 1.6 09-Mar-2000  matt disable scsi for ka49 until sgmap is adapted to it.
 1.5 07-Mar-2000  matt Chnage chip freq to 25MHZ. panic if dmaaddr is not in the kernel's
address space. fix some printfs. (reads now work!)
 1.4 05-Mar-2000  matt it is pretty close to working. the scsibus probes now.
 1.3 04-Mar-2000  matt it's closer to working now.
 1.2 04-Mar-2000  matt expunge vm_offset_t and vm_size_t.
add bus_dma support for the vs4000 dma translation map (sgmap).
enhance the vsbus for the lance to work with it.
remove the sgmap init code from ka46/48/49.c
 1.1 04-Mar-2000  matt First pass at NCR53c9x attachment for VS4000. It doesn't work yet.
But I want to save the work.
 1.14.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.18.2.1 16-Nov-2000  tv Pullup 1.21 [matt]:
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.21.2.5 29-Mar-2001  bouyer Make this compile.
 1.21.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.21.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.21.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.21.2.1 16-Nov-2000  bouyer file asc_vsbus.c was added on branch thorpej_scsipi on 2000-11-20 20:33:37 +0000
 1.22.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.24.18.1 18-Sep-2002  thorpej pullup-1-6 ticket #783, chuck@research.att.com.

1.24 -> 1.25 syssrc/sys/arch/vax/vsa/asc_vsbus.c

Original log message:
increase sc_maxxfer from 63K to 64K. otherwise fsck fails for
file systems with larger block sizes.
 1.24.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.24.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.24.8.1 16-May-2001  nathanw file asc_vsbus.c was added on branch nathanw_sa on 2002-09-17 21:18:37 +0000
 1.24.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.29.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.29.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.29.2.1 03-Aug-2004  skrll Sync with HEAD
 1.31.10.4 17-Mar-2008  yamt sync with head.
 1.31.10.3 04-Feb-2008  yamt sync with head.
 1.31.10.2 03-Sep-2007  yamt sync with head.
 1.31.10.1 21-Jun-2006  yamt sync with head.
 1.32.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.32.8.1 13-Mar-2006  yamt sync with head.
 1.32.6.1 22-Apr-2006  simonb Sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.33.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.35.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.35.20.1 23-Mar-2008  matt sync with HEAD
 1.36.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.36.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.36.2.1 24-Mar-2008  keiichi sync with head.
 1.39.4.2 11-Mar-2010  yamt sync with head
 1.39.4.1 16-May-2008  yamt sync with head.
 1.39.2.1 18-May-2008  yamt sync with head.
 1.41.4.1 05-Mar-2011  rmind sync with head
 1.42.18.2 03-Dec-2017  jdolecek update from HEAD
 1.42.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.42.8.1 30-Oct-2012  yamt sync with head
 1.43.14.1 09-Jul-2016  skrll Sync with HEAD
 1.44.18.1 10-Jun-2019  christos Sync with HEAD
 1.44.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.7 20-Jun-1998  ragge These files have never been used; remove them.
 1.6 22-Mar-1998  jonathan use dev/dec/lk201.h, fold back DELAY() changes from pmax lk201.c rev 1.7.
 1.5 12-Jan-1998  thorpej Update for changes to config.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.2 20-Jun-1998  ragge These files have never been used; remove them.
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.35 15-Mar-2008  matt This is not (has never?) being used.
 1.34 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.33 11-Dec-2005  christos branches: 1.33.50; 1.33.70; 1.33.74;
merge ktrace-lwp.
 1.32 13-Dec-2003  ad branches: 1.32.16;
Add write barriers (a no-op on vax).
 1.31 15-Jul-2003  lukem __KERNEL_RCSID()
 1.30 29-Dec-2002  ad branches: 1.30.2;
Block tty interrupts in getc()/putc().
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 24-Sep-2002  ad On pmax, drop into DDB on break.
 1.25 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.24 25-Feb-2002  ad branches: 1.24.8;
Move the dz driver to dev/dec, since it can be shared with pmax.
 1.23 28-Jan-2001  ragge branches: 1.23.4; 1.23.8;
A bunch of new CPUs that are supported, from Michael Kukat
(michael@unixiron.org). Among them are 4000/400, 4000/500 and 4000/105A.
 1.22 30-Dec-2000  matt Make this compile again.
 1.21 02-Dec-2000  ragge Remove lkc, add lkkbd/lkms support.
 1.20 26-Jul-2000  matt Un __P.
 1.19 19-Jul-2000  matt More ELF changes (a.out still works).
 1.18 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.17 04-Jun-2000  matt Add extra argument to scb_vecalloc (a struct evcnt *)
Move ivec_dsp from trap.h to scb.h
Add interrupt counting to asc, le, ze, ncr, dz interrupts.
add common support for counting interrupts to cnm_idisp so
it can be done very efficiently.
 1.16 24-Jan-2000  matt branches: 1.16.2;
Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.15 27-Aug-1999  ragge branches: 1.15.2;
Aupport these on 4000/90.
 1.14 06-Aug-1999  ragge Moved from dz_vsbus.c,v
 1.13 06-Jun-1999  ragge Qbus moved in hierarchy.
 1.12 20-May-1999  ragge Don't detect glass tty if the machine is a workstation.
Hint from Thomas Seidmann.
 1.11 27-Mar-1999  ragge branches: 1.11.4;
Change console detection a little bit.
 1.10 26-Mar-1999  ragge Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.9 13-Mar-1999  ragge Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.8 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.7 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.6 10-Aug-1998  ragge Support for VS4000/60.
 1.5 07-Jun-1998  ragge DDB support on glass tty. Also smarter keyboard decoding.
 1.4 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.3 23-May-1998  ragge Fixed bug with lost characters in DDB output.
 1.2 21-May-1998  ragge Support for DDB on DZ console.
 1.1 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.15.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.15.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.15.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.15.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.16.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.23.8.4 03-Jan-2003  thorpej Sync with HEAD.
 1.23.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.23.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.23.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.23.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.23.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.24.8.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.30.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.30.2.1 03-Aug-2004  skrll Sync with HEAD
 1.32.16.1 17-Mar-2008  yamt sync with head.
 1.33.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.33.70.1 24-Mar-2008  keiichi sync with head.
 1.33.50.1 23-Mar-2008  matt sync with HEAD
 1.51 04-Mar-2025  hans vax/dz(4): fix NULL pointer dereference in dzgetc()

This fixes an immediate reboot situation when booting with -d on a
framebuffer console that utilizes a dz(4)-attached keyboard.
 1.50 04-Mar-2025  hans vax/dz(4): defer configuring children lkkbd and lkms

At least lkkdb (dzkbd, really) wants to not only send data over dz(4),
it also depends on receiving them asynchronously for the keyboard type
detection to work. So defer configuring dz(4) children until all vsbus
children have attached and vsbus interrupts have been unmasked.

This fixes keyboard type detection when running with serial console,
which on most (all?) VAXstations is on dz(4), too.
 1.49 02-Mar-2025  hans vax/dz(4): restore dz_print() to print line number of children
 1.48 02-Mar-2025  hans vax/dz(4): fix console detection when it's not on line 0
 1.47 12-Dec-2022  jakllsch branches: 1.47.2; 1.47.8;
vsbus vax: sprinkle volatile for register accesses
 1.46 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.45 24-Apr-2021  thorpej branches: 1.45.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.44 22-May-2017  ragge branches: 1.44.24;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.43 28-Jun-2012  abs branches: 1.43.2; 1.43.16;
Define and use VS_REGS_KA49 rather than magic numbers. From OpenBSD.
 1.42 14-Dec-2010  matt branches: 1.42.8;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.41 09-May-2010  hans Make console keyboard work on VAXstation 4000/9x. Seems not to break
anything on other VAXstations (tested on 4000 VLC).
 1.40 15-Mar-2008  matt branches: 1.40.4; 1.40.14; 1.40.24; 1.40.26;
Switch dz driver to PRIVALLOC and device_* accessors.
 1.39 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.38 07-Mar-2008  christos Fix KA53 console. From Hans Rosenfeld.
 1.37 12-Mar-2006  matt branches: 1.37.40; 1.37.60; 1.37.64;
Fix various places where assignment happen to casted lvalues.
(t)v = foo; is not legal C.
 1.36 11-Dec-2005  christos branches: 1.36.4; 1.36.6; 1.36.8; 1.36.10;
merge ktrace-lwp.
 1.35 14-Dec-2004  chs branches: 1.35.10;
use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.34 13-Dec-2003  ad Add write barriers (a no-op on vax).
 1.33 18-Oct-2003  ragge Use the vax confdata to determine whether to use serial console.
Do cn_set_magic() for the VAX DDB escape sequence (ESC-D).
 1.32 15-Jul-2003  lukem __KERNEL_RCSID()
 1.31 01-Jan-2003  thorpej branches: 1.31.2;
Use aprint_normal() for cfprint routines.
 1.30 29-Dec-2002  ad Block tty interrupts in getc()/putc().
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 24-Sep-2002  ad On pmax, drop into DDB on break.
 1.25 18-Sep-2002  ad - The VSXXX is an 8-bit device, not 7.
- Obey ls->dz_line in dzputc(), since dzms uses it.
- Remove an odd "circular" reference that doesn't appear to be useful.
 1.24 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.23 10-Jun-2002  ragge Don't try to connect a keyboard to serial line 0 if the serial console
is on line 0; it may destroy line settings.
 1.22 30-Apr-2002  ragge branches: 1.22.2; 1.22.4;
Don't try to probe for dz11 on 4000/90, may corrupt the flash rom (?).
Suggested by Hugh Graham <hugh@openbsd.org>.
 1.21 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.20 16-May-2001  matt branches: 1.20.2; 1.20.8;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.19 25-Feb-2001  mrg branches: 1.19.2;
re-add.
 1.18 25-Feb-2001  mrg delete (again), then add (again) ?
 1.17 25-Feb-2001  mrg try a `cvs ci -f' to make this appear on the trunk again. no changes.
 1.16 04-Feb-2001  ragge Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.15 28-Jan-2001  ragge Rename dz_ibus to dz_vsbus.
 1.14 06-Aug-1999  ragge branches: 1.14.2;
Moved to dz_ibus.c,v
 1.13 06-Jun-1999  ragge Qbus moved in hierarchy.
 1.12 20-May-1999  ragge Don't detect glass tty if the machine is a workstation.
Hint from Thomas Seidmann.
 1.11 27-Mar-1999  ragge branches: 1.11.4;
Change console detection a little bit.
 1.10 26-Mar-1999  ragge Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.9 13-Mar-1999  ragge Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.8 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.7 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.6 10-Aug-1998  ragge Support for VS4000/60.
 1.5 07-Jun-1998  ragge DDB support on glass tty. Also smarter keyboard decoding.
 1.4 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.3 23-May-1998  ragge Fixed bug with lost characters in DDB output.
 1.2 21-May-1998  ragge Support for DDB on DZ console.
 1.1 17-May-1998  ragge branches: 1.1.1;
Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.1.1.1 25-Feb-2001  mrg cvs ci -f did not work, try an import.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.14.2.1 11-Feb-2001  bouyer Sync with HEAD.
 1.19.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.20.8.6 03-Jan-2003  thorpej Sync with HEAD.
 1.20.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.20.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.20.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.20.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.20.8.1 16-May-2001  nathanw file dz_vsbus.c was added on branch nathanw_sa on 2002-02-28 04:12:33 +0000
 1.20.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.20.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.22.4.1 11-Jun-2002  lukem Pull up revision 1.23 (requested by ragge in ticket #239):
Don't try to connect a keyboard to serial line 0 if the serial console
is on line 0; it may destroy line settings.
 1.22.2.3 03-Sep-2002  gehenna fix missing brace.
 1.22.2.2 15-Jul-2002  gehenna catch up with -current.
 1.22.2.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.31.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.31.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.31.2.1 03-Aug-2004  skrll Sync with HEAD
 1.35.10.2 17-Mar-2008  yamt sync with head.
 1.35.10.1 21-Jun-2006  yamt sync with head.
 1.36.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.36.8.1 13-Mar-2006  yamt sync with head.
 1.36.6.1 22-Apr-2006  simonb Sync with head.
 1.36.4.1 09-Sep-2006  rpaulo sync with head
 1.37.64.1 03-Apr-2008  mjf Sync with HEAD.
 1.37.60.1 24-Mar-2008  keiichi sync with head.
 1.37.40.1 23-Mar-2008  matt sync with HEAD
 1.40.26.2 05-Mar-2011  rmind sync with head
 1.40.26.1 30-May-2010  rmind sync with head
 1.40.24.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.40.14.1 21-Nov-2010  riz Pull up following revision(s) (requested by hans in ticket #1459):
sys/arch/vax/vsa/dz_vsbus.c: revision 1.41
sys/dev/dec/dz.c: revision 1.39
sys/arch/vax/vsa/spx.c: revision 1.3
Make SPX work as console device on VAXstation 4000/9x.
Make console keyboard work on VAXstation 4000/9x. Seems not to break
anything on other VAXstations (tested on 4000 VLC).
The interrupt handler uses the softc, so it's probably a good idea to
initialize it before causing interrupts. Prevents a panic on VAXstation
4000/9x with SPX console.
 1.40.4.1 11-Aug-2010  yamt sync with head.
 1.42.8.1 30-Oct-2012  yamt sync with head
 1.43.16.1 28-Aug-2017  skrll Sync with HEAD
 1.43.2.1 03-Dec-2017  jdolecek update from HEAD
 1.44.24.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.45.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.47.8.1 02-Aug-2025  perseant Sync with HEAD
 1.47.2.3 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1083):

sys/arch/vax/vsa/dz_vsbus.c: revision 1.51

vax/dz(4): fix NULL pointer dereference in dzgetc()

This fixes an immediate reboot situation when booting with -d on a
framebuffer console that utilizes a dz(4)-attached keyboard.
 1.47.2.2 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1082):

sys/arch/vax/vsa/dz_vsbus.c: revision 1.50

vax/dz(4): defer configuring children lkkbd and lkms

At least lkkdb (dzkbd, really) wants to not only send data over dz(4),
it also depends on receiving them asynchronously for the keyboard type
detection to work. So defer configuring dz(4) children until all vsbus
children have attached and vsbus interrupts have been unmasked.

This fixes keyboard type detection when running with serial console,
which on most (all?) VAXstations is on dz(4), too.
 1.47.2.1 04-Mar-2025  martin Pull up following revision(s) (requested by hans in ticket #1070):

sys/arch/vax/vsa/dz_vsbus.c: revision 1.48

vax/dz(4): fix console detection when it's not on line 0
 1.4 30-Sep-2024  rin vax/gpx: Stop copy{in,out}(9) from/to 0-length buffers

Found by GCC12 -Wmaybe-uninitialized.

Authored by kalvisd@.
 1.3 03-Feb-2024  tsutsui branches: 1.3.2;
Make local variables static.
 1.2 03-Feb-2024  tsutsui Misc cleanup.

- move function declarations after struct declarations and
before global variables
- sort function declarations per actual implementation
- explicitly denote 'static' for static functions
- some KNF

No functional change (though gcc generates different binary).
 1.1 06-Feb-2023  tsutsui branches: 1.1.2;
Add a support for gpx(4) color framebuffer found on VAXstation 3100.

Poted from OpenBSD/vax. Note smg(4) monochrome onboard framebuffer
driver is also changed attached only if gpx(4) is not installed
or flags 1 is specified in config files, as OpenBSD did.

Tested on my VAXstation 3100/m30 with and without 8bpp gpx(4).
Revied on port-vax@ and "Please go ahead!" from ragge@.
https://mail-index.netbsd.org/port-vax/2023/01/thread1.html#004147

Worth to pullup to netbsd-10.
 1.1.2.2 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #79):

sys/arch/vax/conf/GENERIC: revision 1.217
sys/arch/vax/conf/VAX780: revision 1.34
sys/arch/vax/conf/files.vax: revision 1.126
sys/arch/vax/vsa/smg.c: revision 1.63
sys/arch/vax/include/qdreg.h: revision 1.7
sys/arch/vax/vax/conf.c: revision 1.69
sys/arch/vax/conf/INSTALL: revision 1.76
sys/arch/vax/vsa/gpx.c: revision 1.1

Add a support for gpx(4) color framebuffer found on VAXstation 3100.

Ported from OpenBSD/vax. Note smg(4) monochrome onboard framebuffer
driver is also changed attached only if gpx(4) is not installed
or flags 1 is specified in config files, as OpenBSD did.

Tested on my VAXstation 3100/m30 with and without 8bpp gpx(4).

Revied on port-vax@ and "Please go ahead!" from ragge@.
https://mail-index.netbsd.org/port-vax/2023/01/thread1.html#004147
 1.1.2.1 06-Feb-2023  martin file gpx.c was added on branch netbsd-10 on 2023-02-12 12:27:26 +0000
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.62 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.61 24-Apr-2021  thorpej branches: 1.61.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.60 03-Jun-2019  msaitoh branches: 1.60.12;
Fix typo in comment(s/similiar/similar/).
 1.59 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.58 22-May-2017  ragge branches: 1.58.8; 1.58.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.57 02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.56 31-Dec-2014  christos declare error
 1.55 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.54 25-Jul-2014  dholland branches: 1.54.4;
Add d_discard to all struct cdevsw instances I could find.

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

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.52 25-Oct-2013  martin branches: 1.52.2;
Simplify (and remove now unused variable)
 1.51 14-Dec-2010  matt branches: 1.51.8; 1.51.18; 1.51.22;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.50 21-Nov-2009  rmind branches: 1.50.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.49 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.48 18-Mar-2009  cegger bcopy -> memcpy
 1.47 18-Mar-2009  cegger bzero -> memset
 1.46 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.45 13-Jan-2009  yamt branches: 1.45.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.44 15-Mar-2008  matt branches: 1.44.4; 1.44.12;
Switch to PRIVALLOC and device_* accessors
 1.43 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.42 17-Oct-2007  garbled branches: 1.42.12; 1.42.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.41 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.40 29-Jul-2007  ad branches: 1.40.4; 1.40.6; 1.40.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.39 04-Mar-2007  christos branches: 1.39.2; 1.39.10; 1.39.12; 1.39.14;
Fix caddr_t fallout.
 1.38 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 14-May-2006  elad branches: 1.37.14;
integrate kauth.
 1.36 28-Mar-2006  thorpej Use device_unit().
 1.35 23-Feb-2006  thorpej branches: 1.35.2; 1.35.4; 1.35.6;
Use device_parent().
 1.34 24-Dec-2005  perry branches: 1.34.2; 1.34.4; 1.34.6;
bare asm -> __asm
 1.33 11-Dec-2005  christos merge ktrace-lwp.
 1.32 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.31 28-Oct-2004  yamt branches: 1.31.12;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.30 15-Jul-2003  lukem __KERNEL_RCSID()
 1.29 18-Jun-2003  drochner branches: 1.29.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.28 10-May-2003  thorpej Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.27 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.26 02-Apr-2003  he Change SBSIZE -> SBLOCKSIZE, to track changes brought in with UFS2.
 1.25 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.24 23-Oct-2002  jdolecek merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.22 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.21 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.19 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

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

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.17 09-Nov-2001  matt branches: 1.17.2; 1.17.10;
Make this compile under ELF.
 1.16 26-Jul-2001  wiz branches: 1.16.2; 1.16.4;
Various typos in comments (neccessary, sceme, choise, ...).
 1.15 12-Apr-2001  thorpej branches: 1.15.2;
splimp -> splbio.
 1.14 04-Feb-2001  ragge branches: 1.14.2;
Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.13 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.12 27-Jun-2000  ragge Do 3 retries on a failing sector before giving up.
Clear pending interrupts before starting a DMA transfer. If an interrupt
occurs while the HDC9224 is doing DMA, the transfered data will be
scrambled (without giving any errors, quite bad).
 1.11 27-Jun-2000  mrg remove redundant vm includes.
 1.10 25-Jun-2000  ragge Make the HDC9224 MFM device driver up-to-date; has been not-working
since NetBSD 1.2 (!) It also uses interrupts instead of polling now.
Also fix the DMA area locking between SCSI and MFM disks.
Still missing - floppy support.
 1.9 13-Apr-1998  ragge branches: 1.9.14; 1.9.24;
Wall cleaning.
 1.8 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.7 12-Jan-1998  thorpej Update for changes to config.
 1.6 15-Mar-1997  ragge Change the way boot device is figured out; now only using DEC numbers
and done when the device get attached.
 1.5 09-Mar-1997  ragge Fixed bug that caused d partition being treated as c.
RAW_PART is 2, not 3.
 1.4 13-Oct-1996  christos branches: 1.4.6;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 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.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.4.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.9.24.1 28-Jun-2000  ragge Pull up revision 1.10 + 1.12 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.9.14.3 21-Apr-2001  bouyer Sync with HEAD
 1.9.14.2 11-Feb-2001  bouyer Sync with HEAD.
 1.9.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.14.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.15.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.15.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.1 03-Aug-2001  lukem update to -current
 1.16.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.16.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.17.10.2 31-Aug-2002  gehenna catch up with -current.
 1.17.10.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.17.2.6 03-Jan-2003  thorpej Sync with HEAD.
 1.17.2.5 11-Nov-2002  nathanw Catch up to -current
 1.17.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.17.2.3 17-Sep-2002  nathanw Catch up to -current.
 1.17.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.17.2.1 09-Nov-2001  nathanw file hdc9224.c was added on branch nathanw_sa on 2002-08-01 02:44:02 +0000
 1.29.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.29.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.29.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.29.2.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.29.2.1 03-Aug-2004  skrll Sync with HEAD
 1.31.12.4 17-Mar-2008  yamt sync with head.
 1.31.12.3 27-Oct-2007  yamt sync with head.
 1.31.12.2 03-Sep-2007  yamt sync with head.
 1.31.12.1 21-Jun-2006  yamt sync with head.
 1.34.6.1 22-Apr-2006  simonb Sync with head.
 1.34.4.1 09-Sep-2006  rpaulo sync with head
 1.34.2.1 01-Mar-2006  yamt sync with head.
 1.35.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.35.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.35.2.1 01-Apr-2006  yamt sync with head.
 1.37.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.39.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.39.12.1 07-Aug-2007  matt Sync with HEAD.
 1.39.10.2 16-Oct-2007  garbled Sync with HEAD
 1.39.10.1 03-Oct-2007  garbled Sync with HEAD
 1.39.2.2 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.39.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.40.8.1 14-Oct-2007  yamt sync with head.
 1.40.6.2 23-Mar-2008  matt sync with HEAD
 1.40.6.1 06-Nov-2007  matt sync with HEAD
 1.40.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.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.42.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.42.12.1 24-Mar-2008  keiichi sync with head.
 1.44.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.44.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.44.4.2 11-Mar-2010  yamt sync with head
 1.44.4.1 04-May-2009  yamt sync with head.
 1.45.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.4.1 05-Mar-2011  rmind sync with head
 1.51.22.1 18-May-2014  rmind sync with head
 1.51.18.3 03-Dec-2017  jdolecek update from HEAD
 1.51.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.18.1 02-Dec-2012  tls Don't pass NULL struct dkdriver to disk_init. That's seriously bogus.
 1.51.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.52.2.1 10-Aug-2014  tls Rebase.
 1.54.4.2 28-Aug-2017  skrll Sync with HEAD
 1.54.4.1 06-Apr-2015  skrll Sync with HEAD
 1.58.10.1 10-Jun-2019  christos Sync with HEAD
 1.58.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.60.12.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.61.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.7 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.6 11-Dec-2005  christos branches: 1.6.122; 1.6.142;
merge ktrace-lwp.
 1.5 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.4 26-Jul-2001  wiz branches: 1.4.6; 1.4.22;
Various typos in comments (neccessary, sceme, choise, ...).
 1.3 17-Jul-2000  matt branches: 1.3.4;
Changes so that the kernel can be compiled under __ELF__.
 1.2 25-Jun-2000  ragge Make the HDC9224 MFM device driver up-to-date; has been not-working
since NetBSD 1.2 (!) It also uses interrupts instead of polling now.
Also fix the DMA area locking between SCSI and MFM disks.
Still missing - floppy support.
 1.1 20-Jul-1996  ragge branches: 1.1.28; 1.1.38;
SCSI and ST506 support for the VAXstation architecture.
 1.1.38.2 27-Jul-2000  matt Pullup revision 1.3
needed so 2nd stage bootstap will build
 1.1.38.1 28-Jun-2000  ragge Pull up revision 1.2 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.1.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.4.1 03-Aug-2001  lukem update to -current
 1.4.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.22.1 03-Aug-2004  skrll Sync with HEAD
 1.4.6.2 26-Jul-2001  wiz Various typos in comments (neccessary, sceme, choise, ...).
 1.4.6.1 26-Jul-2001  wiz file hdc9224.h was added on branch nathanw_sa on 2001-07-26 15:05:11 +0000
 1.6.142.1 28-Aug-2017  skrll Sync with HEAD
 1.6.122.1 03-Dec-2017  jdolecek update from HEAD
 1.17 05-Mar-2001  ragge This file hasn't been in use for a long time.
 1.16 15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.15 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.14 26-Jul-2000  matt Un __P.
 1.13 18-May-1999  thorpej branches: 1.13.2;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.12 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.11 13-Mar-1999  ragge branches: 1.11.4;
Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.10 28-Feb-1999  explorer Update to slightly altered rnd_attach_source() api
 1.9 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.8 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.7 10-Aug-1998  ragge Support for VS4000/60.
 1.6 21-Jul-1998  drochner adapt to LANCE driver split
 1.5 05-Jul-1998  jonathan defopt NS, NSIP.
 1.4 05-Jul-1998  jonathan defopt LLC
 1.3 05-Jul-1998  jonathan defopt CCITT.
 1.2 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.1 17-May-1998  ragge Add vax-hacked lance device driver for vaxstations.
XXX - This is temporary; will go away when the troubles with the
MI driver is fixed.
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.13.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.13.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.13.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13 11-Mar-2008  matt This file is no longer used.
 1.12 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.11 11-Dec-2005  christos branches: 1.11.50; 1.11.70; 1.11.74;
merge ktrace-lwp.
 1.10 10-Nov-2003  wiz branches: 1.10.16;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 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 26-Jul-2000  matt branches: 1.5.4; 1.5.8;
Un __P.
 1.4 04-Jun-2000  matt Add extra argument to scb_vecalloc (a struct evcnt *)
Move ivec_dsp from trap.h to scb.h
Add interrupt counting to asc, le, ze, ncr, dz interrupts.
add common support for counting interrupts to cnm_idisp so
it can be done very efficiently.
 1.3 23-Apr-2000  matt branches: 1.3.2;
Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.2 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.1 27-Aug-1999  ragge branches: 1.1.2;
Aupport these on 4000/90.
 1.1.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.3.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.5.4.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.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.10.16.1 17-Mar-2008  yamt sync with head.
 1.11.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.70.1 24-Mar-2008  keiichi sync with head.
 1.11.50.1 23-Mar-2008  matt sync with HEAD
 1.13 28-Feb-2025  hans vax/lcg(4): Check vax_siedata in lcg_match() and lcgcnprobe() as well.

LCG only exists on two specific VAXstation models, but not the MicroVAXen
sharing the same board type.

PR port-vax/59109: Booting 10.1 fails on Microvax 3100 model 80
 1.12 27-Feb-2025  riastradh vax/lcg(4): Fix device_t/softc split straggler.

PR port-vax/59109: Booting 10.1 fails on Microvax 3100 model 80

(Probably won't fix the immediate problem but might fix some related
ones.)
 1.11 10-Dec-2022  jakllsch branches: 1.11.2; 1.11.8;
Don't let compiler optimize out the framebuffer probe in lcg_match() by
using keyword volatile.
 1.10 06-Jul-2022  andvar fix various typos in comments.
 1.9 12-Feb-2022  riastradh sys: Omit vestigial struct devices in softcs after device_t split.
 1.8 12-Feb-2022  riastradh sys: Fix various abuse of struct device internals.

Will help to make struct device opaque later.
 1.7 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.6 24-Apr-2021  thorpej branches: 1.6.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.5 21-Nov-2020  thorpej branches: 1.5.2;
malloc(9) -> kmem(9)
 1.4 06-Jun-2018  maya branches: 1.4.14;
Remove duplicate ;
 1.3 08-Feb-2018  dholland branches: 1.3.2;
Typos.
 1.2 18-Dec-2014  jklos branches: 1.2.2; 1.2.18;
Add small fix from Björn Johannessonwhich makes framebuffer woth with X11.
 1.1 16-Dec-2014  jklos Adds VAXstation VLC and 4000/60 framebuffer support. From Blaz Antonic
and updated by BjörnJohannesson.
 1.2.18.2 03-Dec-2017  jdolecek update from HEAD
 1.2.18.1 18-Dec-2014  jdolecek file lcg.c was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.2.2.2 06-Apr-2015  skrll Sync with HEAD
 1.2.2.1 18-Dec-2014  skrll file lcg.c was added on branch nick-nhusb on 2015-04-06 15:18:04 +0000
 1.3.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.14.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.5.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.6.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.11.8.1 02-Aug-2025  perseant Sync with HEAD
 1.11.2.2 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1081):

sys/arch/vax/vsa/lcg.c: revision 1.12

vax/lcg(4): Fix device_t/softc split straggler.

PR port-vax/59109: Booting 10.1 fails on Microvax 3100 model 80
(Probably won't fix the immediate problem but might fix some related
ones.)
 1.11.2.1 04-Mar-2025  martin Pull up following revision(s) (requested by hans in ticket #1069):

sys/arch/vax/vsa/lcg.c: revision 1.13

vax/lcg(4): Check vax_siedata in lcg_match() and lcgcnprobe() as well.

LCG only exists on two specific VAXstation models, but not the MicroVAXen
sharing the same board type.

PR port-vax/59109: Booting 10.1 fails on Microvax 3100 model 80
 1.11 12-Aug-2008  hans Add new accelerated driver for SPX graphics found in some VAXstations,
remove old broken lcspx driver. This is a bugfixed and refactored
version of the spx driver originally developed by Blaz Antonic in 2005.
OK'ed by mhitch.
 1.10 11-Mar-2008  matt branches: 1.10.4; 1.10.6; 1.10.10;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.9 17-Oct-2007  garbled branches: 1.9.12; 1.9.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.8 09-Jul-2007  ad branches: 1.8.10;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.7 31-Mar-2007  matt branches: 1.7.4;
Don't exceed array bounds (found by gcc 4.3).
XXX not sure if the fix is correct.
 1.6 04-Mar-2007  christos branches: 1.6.2; 1.6.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 12-Apr-2006  jmmv branches: 1.5.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.4 11-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8; 1.4.10; 1.4.12;
merge ktrace-lwp.
 1.3 20-Jul-2005  he Now that the wsfont fonts are made static, we can no longer
reference the fonts directly (which was actually a wrong thing
to try to do). Instead, convert to using the wsfont API to
look for a 8x15 font, and use it if found.

Suggested by thorpej
Reviewed by drochner
 1.2 19-Mar-2004  mhitch branches: 1.2.4; 1.2.18;
Don't map the framebuffer again when attaching the lcspx driver if it was
already mapped in the early console startup.

The software cursor isn't going to blink if we don't start it - set up the
callout when attaching.

Now that the cursor blink routine is actually called, blink the entire cursor
line rather than just the first pixel.

Don't try to clear the current cursor if the pointer to it hasn't been
initialized. This seems to happen when using the display as console, but
not when using a serial console.

On early console startup, use the framebuffer sizes, not the character cell
size to compute how much to clear.

The lcspx display will now initialize when booting with the display console,
but the dz device is not detected and the keyboard will not work yet. I
haven't tracked down why the dz device isn't found (it works fine when
using a serial console).
 1.1 19-Oct-2003  ragge Add console text device driver for the LCSPX framebuffer. Really dump,
cannot change colours, and is really slow; I haven't found how to buffer
writes to the console yet.
 1.2.18.3 17-Mar-2008  yamt sync with head.
 1.2.18.2 03-Sep-2007  yamt sync with head.
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.2.4.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.4.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.4 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.3 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 19-Mar-2004  skrll file lcspx.c was added on branch ktrace-lwp on 2004-08-03 10:42:45 +0000
 1.4.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.4.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.4.8.1 24-May-2006  yamt sync with head.
 1.4.6.1 22-Apr-2006  simonb Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.14.2 15-Apr-2007  yamt sync with head.
 1.5.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.4.1 11-Jul-2007  mjf Sync with head.
 1.6.2.2 15-Jul-2007  ad Sync with head.
 1.6.2.1 10-Apr-2007  ad Sync with head.
 1.7.4.1 03-Oct-2007  garbled Sync with HEAD
 1.8.10.2 23-Mar-2008  matt sync with HEAD
 1.8.10.1 06-Nov-2007  matt sync with HEAD
 1.9.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.9.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.9.12.1 24-Mar-2008  keiichi sync with head.
 1.10.10.1 19-Oct-2008  haad Sync with HEAD.
 1.10.6.1 07-Sep-2008  wrstuden Delete a bunch of things that are now gone in head.
 1.10.4.1 04-May-2009  yamt sync with head.
 1.11 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.10 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.9 14-Dec-2010  matt branches: 1.9.58; 1.9.60;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.8 04-May-2008  jklos branches: 1.8.22;
Fix leds.c to compile.
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 11-Mar-2008  matt branches: 1.6.2; 1.6.4;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.5 04-Mar-2007  christos branches: 1.5.20; 1.5.36; 1.5.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 11-Dec-2005  christos branches: 1.4.26;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem branches: 1.3.16;
__KERNEL_RCSID()
 1.2 16-May-2001  matt branches: 1.2.8; 1.2.24;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.1 18-Feb-2001  ragge branches: 1.1.2; 1.1.4;
Support to control the leds on VAXstations, taken from Sun3 and ported
to vax by Shinmyoh Koji (yesu@rb3.so-net.ne.jp).
 1.1.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.1.4.1 18-Feb-2001  bouyer file leds.c was added on branch thorpej_scsipi on 2001-03-12 13:29:46 +0000
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.2 16-May-2001  matt Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.2.8.1 16-May-2001  matt file leds.c was added on branch nathanw_sa on 2001-05-16 05:36:57 +0000
 1.3.16.2 17-Mar-2008  yamt sync with head.
 1.3.16.1 03-Sep-2007  yamt sync with head.
 1.4.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.5.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.5.36.1 24-Mar-2008  keiichi sync with head.
 1.5.20.1 23-Mar-2008  matt sync with HEAD
 1.6.4.1 16-May-2008  yamt sync with head.
 1.6.2.1 18-May-2008  yamt sync with head.
 1.8.22.1 05-Mar-2011  rmind sync with head
 1.9.60.1 10-Jun-2019  christos Sync with HEAD
 1.9.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.6 20-Jun-1998  ragge These files have never been used; remove them.
 1.5 22-Mar-1998  jonathan use dev/dec/lk201.h, fold back DELAY() changes from pmax lk201.c rev 1.7.
 1.4 05-Jan-1998  perry RCSID Police.
 1.3 13-Oct-1996  christos backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.19 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.18 11-Dec-2005  christos branches: 1.18.50; 1.18.70; 1.18.74;
merge ktrace-lwp.
 1.17 15-Jul-2003  lukem branches: 1.17.16;
__KERNEL_RCSID()
 1.16 02-Oct-2002  thorpej branches: 1.16.6;
Add trailing ; to CFATTACH_DECL.
 1.15 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.12 26-Jul-2000  matt branches: 1.12.4; 1.12.8;
Un __P.
 1.11 06-Jun-1999  ragge branches: 1.11.2;
Qbus moved in hierarchy.
 1.10 29-Apr-1999  ragge Make LK201 arrow keys work again.
 1.9 13-Mar-1999  ragge branches: 1.9.2;
Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.8 10-Aug-1998  ragge Support for VS4000/60.
 1.7 05-Aug-1998  kleink KNF (only include one of <sys/{param,types}.h>).
 1.6 04-Jul-1998  jonathan defopt DDB.
 1.5 20-Jun-1998  ragge Fast fix to make VS keyboard work again after wscons changes.
XXX - This will be done in a better way in the future.
 1.4 08-Jun-1998  ragge Bugfix: use of uninitialised variable that gcc didn't notice.
 1.3 07-Jun-1998  ragge DDB support on glass tty. Also smarter keyboard decoding.
 1.2 05-Jun-1998  ragge Add virtual console support.
 1.1 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.9.2.1 29-Apr-1999  perry branches: 1.9.2.1.2;
pullup 1.9->1.10 (ragge)
 1.9.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.12.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.12.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.12.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.16.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.6.1 03-Aug-2004  skrll Sync with HEAD
 1.17.16.1 17-Mar-2008  yamt sync with head.
 1.18.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.18.70.1 24-Mar-2008  keiichi sync with head.
 1.18.50.1 23-Mar-2008  matt sync with HEAD
 1.1 11-Feb-2023  tsutsui branches: 1.1.2;
Port rasops'fied smg(4) framebuffer driver for VS3100 from OpenBSD/vax.

This allows using more fonts other than 8x15 pixels on smg(4).
Tested on my VAXstation 3100/m30.

Note the bitorder of smg(4) VRAM is LSB first (i.e. LSBit is the
most left side pixel) and this requires more complicated changes
to bitmask ops in MI rasops(9) because several LE machines have
VRAMs whose MSBit is connected to the most left side pixel,
but for now I prepared smg(4) specific putchar and cursor ops
based on old luna68k omrasops.
 1.1.2.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #86):

sys/arch/vax/vsa/smg.c: revision 1.64
sys/arch/vax/vsa/maskbits.h: revision 1.1
sys/dev/ic/dc503reg.h: revision 1.1

Port rasops'fied smg(4) framebuffer driver for VS3100 from OpenBSD/vax.

This allows using more fonts other than 8x15 pixels on smg(4).
Tested on my VAXstation 3100/m30.

Note the bitorder of smg(4) VRAM is LSB first (i.e. LSBit is the
most left side pixel) and this requires more complicated changes
to bitmask ops in MI rasops(9) because several LE machines have
VRAMs whose MSBit is connected to the most left side pixel,
but for now I prepared smg(4) specific putchar and cursor ops
based on old luna68k omrasops.
 1.1.2.1 11-Feb-2023  martin file maskbits.h was added on branch netbsd-10 on 2023-02-15 19:14:50 +0000
 1.52 17-Feb-2024  tsutsui Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@. Should be pulled up to netbsd-10 and -9.
 1.51 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.50 22-Mar-2020  ragge branches: 1.50.22;
Do not expect a struct buf to be present if doing DMA to kernel space.
Fixes bug reported by sadness on port-vax.
 1.49 03-Sep-2018  riastradh branches: 1.49.4;
Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.48 14-Dec-2010  matt branches: 1.48.58; 1.48.60;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.47 21-Nov-2009  rmind branches: 1.47.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.46 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.45 04-Apr-2008  tsutsui branches: 1.45.2; 1.45.4;
Split devict_t/softc for ncr5380sbc SCSI, and misc cosmetic changes.
 1.44 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.43 04-Mar-2007  christos branches: 1.43.20; 1.43.36; 1.43.40;
Fix caddr_t fallout.
 1.42 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.41 11-Dec-2005  christos branches: 1.41.26;
merge ktrace-lwp.
 1.40 15-Jul-2003  lukem branches: 1.40.16;
__KERNEL_RCSID()
 1.39 02-Oct-2002  thorpej branches: 1.39.6;
Add trailing ; to CFATTACH_DECL.
 1.38 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.35 25-Apr-2001  bouyer branches: 1.35.2; 1.35.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.34 04-Feb-2001  ragge branches: 1.34.2;
Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.33 05-Oct-2000  ragge Fix bug that prevented DMA to work on SCSI chain B. This fixes PR#11124
but in a different way than suggested by the submitter.
 1.32 25-Jun-2000  ragge Make the HDC9224 MFM device driver up-to-date; has been not-working
since NetBSD 1.2 (!) It also uses interrupts instead of polling now.
Also fix the DMA area locking between SCSI and MFM disks.
Still missing - floppy support.
 1.31 19-Jun-2000  matt branches: 1.31.2;
Rename ncr[5380] device to si to more consistent with other ports.
Add VAX660 to cputype.h. Remove needs-flag from si & asc entries.
 1.30 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.29 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.28 04-Jun-2000  matt Add extra argument to scb_vecalloc (a struct evcnt *)
Move ivec_dsp from trap.h to scb.h
Add interrupt counting to asc, le, ze, ncr, dz interrupts.
add common support for counting interrupts to cnm_idisp so
it can be done very efficiently.
 1.27 27-May-2000  ragge branches: 1.27.2;
Growel out the SCSI BUS ID from NVRAM instead of hard-code it.
 1.26 25-Mar-2000  tsutsui Add a "sc_rev" member to ncr5380_softc and handle CXD1180 quirk
in MI ncr5380sbc.
 1.25 18-Mar-2000  mycroft Add a ncr5380_attach() routine which does part of the initialization, attaches
the scsibus, and does the addref/delref dance.
 1.24 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.23 22-Oct-1999  ragge DMA support for the NCR 5380-equipped vs3100's.
 1.22 21-Sep-1999  ragge branches: 1.22.2; 1.22.4; 1.22.6;
Fix minphys() on vax. While here, convert to bus.h.
 1.21 27-Aug-1999  ragge Don't try to search for these devices on 4000/90. badaddr() should
be fixed for this arch also.
 1.20 19-Jun-1999  ragge Don't try to disconnect SCSI disks. From Michael Kukat.
Now DEC disks also works in VAXstations :-)
 1.19 26-Mar-1999  ragge branches: 1.19.2; 1.19.4;
Buggfixes for VS 4000/VLC. Basic support for VS4000/90 and MV4000/300.
From Michael Kukat.
 1.18 13-Mar-1999  ragge Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.17 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.16 06-Dec-1998  ragge Simple hack to get at least PIO functionality out of the VS2000/3100 ncr5380.
Fixed by Jens Arvid Nilsson.
 1.15 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.14 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.13 04-Jul-1998  jonathan defopt DDB.
 1.12 13-Apr-1998  ragge Wall cleaning.
 1.11 12-Jan-1998  thorpej Update for changes to config.
 1.10 19-Oct-1997  ragge Add match code to detect more than one SCSI adapter on 3100.
Provided by Bertram Barth.
 1.9 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.8 26-Feb-1997  gwr branches: 1.8.2; 1.8.4;
Minimal changes to adapt to removal of NCR5380_PERMIT_RESELECT.
This driver should be updated to allow per-target control over
disconnect/reselect, but I will leave that to the port masters.
 1.7 26-Feb-1997  ragge Patches to make VS2000 to work. From Ari Suutari.
 1.6 12-Feb-1997  ragge Add a forgotten #ifdef DDB
 1.5 13-Oct-1996  christos branches: 1.5.6;
backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 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.2 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.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.5.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.8.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.19.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.2.1 01-Mar-2000  he Apply patch (requested by toddpw):
Fix bugs in support for VaxStation 2000 and 3100, vax pmap, and
the NCR scsi driver.
 1.22.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.22.4.1 15-Nov-1999  fvdl Sync with -current
 1.22.2.3 29-Mar-2001  bouyer Make this compile.
 1.22.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.22.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.27.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.31.2.2 06-Oct-2000  ragge Pullup of rev. 1.33 (approved by thorpej):
Make SCSI chain B work and fixes PR#11124.
 1.31.2.1 28-Jun-2000  ragge Pull up revision 1.32 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.34.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.35.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.35.8.1 25-Apr-2001  nathanw file ncr.c was added on branch nathanw_sa on 2002-10-18 02:40:38 +0000
 1.35.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.39.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.39.6.1 03-Aug-2004  skrll Sync with HEAD
 1.40.16.2 17-Mar-2008  yamt sync with head.
 1.40.16.1 03-Sep-2007  yamt sync with head.
 1.41.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.43.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.43.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.43.36.1 24-Mar-2008  keiichi sync with head.
 1.43.20.1 23-Mar-2008  matt sync with HEAD
 1.45.4.2 11-Mar-2010  yamt sync with head
 1.45.4.1 16-May-2008  yamt sync with head.
 1.45.2.1 18-May-2008  yamt sync with head.
 1.47.4.1 05-Mar-2011  rmind sync with head
 1.48.60.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.48.60.1 10-Jun-2019  christos Sync with HEAD
 1.48.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.49.4.2 19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1800):

sys/arch/vax/vsa/vsbus.c: revision 1.69 (patch)
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.49.4.1 23-Mar-2020  martin Pull up following revision(s) (requested by ragge in ticket #802):

sys/arch/vax/vsa/ncr.c: revision 1.50

Do not expect a struct buf to be present if doing DMA to kernel space.
Fixes bug reported by sadness on port-vax.
 1.50.22.1 19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #601):

sys/arch/vax/vsa/vsbus.c: revision 1.69
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.2 21-Sep-1999  ragge Nuke unnused file.
 1.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.67 03-Feb-2024  tsutsui Misc cleanup.

- move function declarations after struct declarations and
before global variables
- sort function declarations per actual implementation
- some KNF

No functional change.
 1.66 25-Jan-2024  tsutsui Fix mmap(2) address for smg(4) as other framebuffers.

Now X.org server can render onto framebuffer (but inverted bitorder).
Should be pulled up to netbsd-10 and netbsd-9.
 1.65 26-Mar-2023  andvar s/diplay/display/ and s/DIPPLAY/DISPLAY/ in comments.
 1.64 11-Feb-2023  tsutsui Port rasops'fied smg(4) framebuffer driver for VS3100 from OpenBSD/vax.

This allows using more fonts other than 8x15 pixels on smg(4).
Tested on my VAXstation 3100/m30.

Note the bitorder of smg(4) VRAM is LSB first (i.e. LSBit is the
most left side pixel) and this requires more complicated changes
to bitmask ops in MI rasops(9) because several LE machines have
VRAMs whose MSBit is connected to the most left side pixel,
but for now I prepared smg(4) specific putchar and cursor ops
based on old luna68k omrasops.
 1.63 06-Feb-2023  tsutsui Add a support for gpx(4) color framebuffer found on VAXstation 3100.

Poted from OpenBSD/vax. Note smg(4) monochrome onboard framebuffer
driver is also changed attached only if gpx(4) is not installed
or flags 1 is specified in config files, as OpenBSD did.

Tested on my VAXstation 3100/m30 with and without 8bpp gpx(4).
Revied on port-vax@ and "Please go ahead!" from ragge@.
https://mail-index.netbsd.org/port-vax/2023/01/thread1.html#004147

Worth to pullup to netbsd-10.
 1.62 13-Jan-2023  tsutsui Make sure to call wsfont_init(9) as other framebuffer drivers.

Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
XXX: still no output on the framebuffer console on my VAXstation 3100/m30
 1.61 07-Aug-2021  thorpej branches: 1.61.6;
Merge thorpej-cfargs2.
 1.60 24-Apr-2021  thorpej branches: 1.60.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.59 21-Nov-2020  thorpej branches: 1.59.2;
malloc(9) -> kmem(9)
 1.58 14-Mar-2019  thorpej branches: 1.58.4; 1.58.12;
Use copyin(), not fusword().
 1.57 22-May-2017  ragge branches: 1.57.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.56 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.55 11-Jan-2012  macallan branches: 1.55.6; 1.55.24;
adjust for wsfont_find() change
 1.54 14-Dec-2010  matt branches: 1.54.8; 1.54.12;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.53 26-Oct-2009  cegger branches: 1.53.4;
kill extra whitespaces
reviewed by tsutsui@
 1.52 19-Mar-2009  he Correct a few more bungled bcopy() -> memcpy() conversions.
 1.51 18-Mar-2009  cegger bcopy -> memcpy
 1.50 18-Mar-2009  cegger bzero -> memset
 1.49 19-Dec-2008  cegger branches: 1.49.2;
use M_ZERO on malloc() and remove subsequent bzero().
 1.48 15-Mar-2008  matt branches: 1.48.4; 1.48.12;
Use a 0 sized softc / switch to PRIVALLOC.
 1.47 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.46 17-Oct-2007  garbled branches: 1.46.12; 1.46.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.45 09-Jul-2007  ad branches: 1.45.10;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.44 31-Mar-2007  matt branches: 1.44.4;
Don't exceed array bounds (found by gcc 4.3).
XXX not sure if the fix is correct.
 1.43 04-Mar-2007  christos branches: 1.43.2; 1.43.4;
Fix caddr_t fallout.
 1.42 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.41 12-Apr-2006  jmmv branches: 1.41.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.40 11-Dec-2005  christos branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10; 1.40.12;
merge ktrace-lwp.
 1.39 20-Jul-2005  he Now that the wsfont fonts are made static, we can no longer
reference the fonts directly (which was actually a wrong thing
to try to do). Instead, convert to using the wsfont API to
look for a 8x15 font, and use it if found.

Suggested by thorpej
Reviewed by drochner
 1.38 27-Jun-2005  ragge branches: 1.38.2;
Shadowed variable fix.
 1.37 15-Jul-2003  lukem __KERNEL_RCSID()
 1.36 29-Dec-2002  ad branches: 1.36.2;
- X pads bitmap rows to a word boundary.
- Handle WSDISPLAYIO_GCURMAX.
 1.35 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.34 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.33 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.32 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.31 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.30 10-Jun-2002  ragge Missed to check all possible non-graphics bits on VS2k, causing the
machine to crash during boot. Reported and debugged with help of
Valeriy E. Ushakov.
 1.29 17-Mar-2002  atatat branches: 1.29.4; 1.29.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.28 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.27 04-Feb-2001  ragge branches: 1.27.4; 1.27.8;
Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.26 02-Dec-2000  ragge Use lkkbd. Add hardware cursor support. Use wsfont fonts instead of the
old QDSS fonts (support not finished). KNF cleanup.
 1.25 08-Sep-2000  chs remove extra paren so this compiles again.
 1.24 26-Jul-2000  matt Un __P.
 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 31-Mar-2000  ragge branches: 1.22.4;
Fix spelling error.
 1.21 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.20 12-Dec-1999  ragge CL* discarding.
 1.19 06-Dec-1999  drochner update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.18 27-Oct-1999  ragge Allocate memory for printouts directly instead of (trying to) use the
yes uninitialized VM system.
 1.17 27-Aug-1999  ragge branches: 1.17.2; 1.17.4; 1.17.6;
Don't try to search for these devices on 4000/90. badaddr() should
be fixed for this arch also.
 1.16 20-May-1999  ragge Don't detect glass tty if the machine is a workstation.
Hint from Thomas Seidmann.
 1.15 13-Mar-1999  ragge branches: 1.15.4;
Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.14 09-Mar-1999  ragge unsigned int -> int.
 1.13 12-Feb-1999  drochner change the "mapchar" interface to return a "quality" or "match level"
arguments which allows to find approximations for characters which are
not present in a font
 1.12 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.11 11-Jan-1999  drochner remove dummy "load_font" entries
 1.10 29-Nov-1998  ragge blkclr -> memset.
 1.9 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.8 10-Aug-1998  ragge Support for VS4000/60.
 1.7 05-Aug-1998  kleink KNF (only include one of <sys/{param,types}.h>).
 1.6 30-Jun-1998  ragge Enable use of reversed and underlined text. The DEC Isolatin character
set now also work correctly. Add blinking cursor.
 1.5 26-Jun-1998  drochner add a dummy "mapchar" function (1:1 mapping, hope the font is isolatin)
 1.4 20-Jun-1998  drochner adapt to wscons changes (character output call)
 1.3 07-Jun-1998  ragge Init some variables to not get trash on the screen.
 1.2 05-Jun-1998  ragge Add virtual console support.
 1.1 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.15.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.4.1 15-Nov-1999  fvdl Sync with -current
 1.17.2.3 11-Feb-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.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.27.8.7 03-Jan-2003  thorpej Sync with HEAD.
 1.27.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.27.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.27.8.4 01-Aug-2002  nathanw Catch up to -current.
 1.27.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.27.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.27.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.27.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.27.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.27.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.29.6.1 11-Jun-2002  lukem Pull up revision 1.30 (requested by ragge in ticket #237):
Missed to check all possible non-graphics bits on VS2k, causing the
machine to crash during boot. Reported and debugged with help of
Valeriy E. Ushakov.
 1.29.4.3 17-Jul-2002  gehenna catch up with -current.
 1.29.4.2 15-Jul-2002  gehenna catch up with -current.
 1.29.4.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.36.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.36.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.36.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.36.2.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.36.2.1 03-Aug-2004  skrll Sync with HEAD
 1.38.2.3 17-Mar-2008  yamt sync with head.
 1.38.2.2 03-Sep-2007  yamt sync with head.
 1.38.2.1 21-Jun-2006  yamt sync with head.
 1.40.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.40.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.40.8.1 24-May-2006  yamt sync with head.
 1.40.6.1 22-Apr-2006  simonb Sync with head.
 1.40.4.1 09-Sep-2006  rpaulo sync with head
 1.41.14.2 15-Apr-2007  yamt sync with head.
 1.41.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.43.4.1 11-Jul-2007  mjf Sync with head.
 1.43.2.2 15-Jul-2007  ad Sync with head.
 1.43.2.1 10-Apr-2007  ad Sync with head.
 1.44.4.1 03-Oct-2007  garbled Sync with HEAD
 1.45.10.2 23-Mar-2008  matt sync with HEAD
 1.45.10.1 06-Nov-2007  matt sync with HEAD
 1.46.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.46.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.46.12.1 24-Mar-2008  keiichi sync with head.
 1.48.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.48.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.48.4.2 11-Mar-2010  yamt sync with head
 1.48.4.1 04-May-2009  yamt sync with head.
 1.49.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.53.4.1 05-Mar-2011  rmind 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.55.24.2 28-Aug-2017  skrll Sync with HEAD
 1.55.24.1 09-Jul-2016  skrll Sync with HEAD
 1.55.6.1 03-Dec-2017  jdolecek update from HEAD
 1.57.10.1 10-Jun-2019  christos Sync with HEAD
 1.58.12.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.58.4.1 06-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1585):

sys/arch/vax/vsa/smg.c: revision 1.62

Make sure to call wsfont_init(9) as other framebuffer drivers.

Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
 1.59.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.60.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.61.6.4 03-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #569):

sys/arch/vax/vsa/smg.c: revision 1.66

Fix mmap(2) address for smg(4) as other framebuffers.

Now X.org server can render onto framebuffer (but inverted bitorder).
 1.61.6.3 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #86):

sys/arch/vax/vsa/smg.c: revision 1.64
sys/arch/vax/vsa/maskbits.h: revision 1.1
sys/dev/ic/dc503reg.h: revision 1.1

Port rasops'fied smg(4) framebuffer driver for VS3100 from OpenBSD/vax.

This allows using more fonts other than 8x15 pixels on smg(4).
Tested on my VAXstation 3100/m30.

Note the bitorder of smg(4) VRAM is LSB first (i.e. LSBit is the
most left side pixel) and this requires more complicated changes
to bitmask ops in MI rasops(9) because several LE machines have
VRAMs whose MSBit is connected to the most left side pixel,
but for now I prepared smg(4) specific putchar and cursor ops
based on old luna68k omrasops.
 1.61.6.2 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #79):

sys/arch/vax/conf/GENERIC: revision 1.217
sys/arch/vax/conf/VAX780: revision 1.34
sys/arch/vax/conf/files.vax: revision 1.126
sys/arch/vax/vsa/smg.c: revision 1.63
sys/arch/vax/include/qdreg.h: revision 1.7
sys/arch/vax/vax/conf.c: revision 1.69
sys/arch/vax/conf/INSTALL: revision 1.76
sys/arch/vax/vsa/gpx.c: revision 1.1

Add a support for gpx(4) color framebuffer found on VAXstation 3100.

Ported from OpenBSD/vax. Note smg(4) monochrome onboard framebuffer
driver is also changed attached only if gpx(4) is not installed
or flags 1 is specified in config files, as OpenBSD did.

Tested on my VAXstation 3100/m30 with and without 8bpp gpx(4).

Revied on port-vax@ and "Please go ahead!" from ragge@.
https://mail-index.netbsd.org/port-vax/2023/01/thread1.html#004147
 1.61.6.1 06-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #66):

sys/arch/vax/vsa/smg.c: revision 1.62

Make sure to call wsfont_init(9) as other framebuffer drivers.
Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
 1.13 09-Mar-2025  hans vax/spx(4): fix a few X11-related bugs

- overwriting of saved screen pointer of emulation mode when switching
the framebuffer mode from mapped to dumb or vice-versa
- leaving the cursor on when switching away from emulation mode
- failure to restore the screen when changing back to emulation mode
because the saved screen pointer has been set to NULL
- panic on next VT switch, because now also the current screen pointer
is NULL
 1.12 07-Aug-2021  thorpej branches: 1.12.6; 1.12.12;
Merge thorpej-cfargs2.
 1.11 24-Apr-2021  thorpej branches: 1.11.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.10 21-Nov-2020  thorpej branches: 1.10.2;
malloc(9) -> kmem(9)
 1.9 07-Jul-2016  msaitoh branches: 1.9.30;
KNF. Remove extra spaces. No functional change.
 1.8 28-Mar-2014  ozaki-r branches: 1.8.6;
Use snprintf instead of sprintf
 1.7 24-Oct-2013  martin Mark a potentially unused variable
 1.6 14-May-2012  abs branches: 1.6.2; 1.6.4;
From the "why was this not done before" box:
Implement WSDISPLAYIO_LINEBYTES so xwsfb works
 1.5 11-Jan-2012  macallan branches: 1.5.2;
adjust for wsfont_find() change
 1.4 14-Dec-2010  matt branches: 1.4.8; 1.4.12;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.3 09-May-2010  hans Make SPX work as console device on VAXstation 4000/9x.
 1.2 18-Mar-2009  cegger branches: 1.2.2; 1.2.4; 1.2.6;
bzero -> memset
 1.1 12-Aug-2008  hans branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.10; 1.1.14;
Add new accelerated driver for SPX graphics found in some VAXstations,
remove old broken lcspx driver. This is a bugfixed and refactored
version of the spx driver originally developed by Blaz Antonic in 2005.
OK'ed by mhitch.
 1.1.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.10.1 21-Nov-2010  riz Pull up following revision(s) (requested by hans in ticket #1459):
sys/arch/vax/vsa/dz_vsbus.c: revision 1.41
sys/dev/dec/dz.c: revision 1.39
sys/arch/vax/vsa/spx.c: revision 1.3
Make SPX work as console device on VAXstation 4000/9x.
Make console keyboard work on VAXstation 4000/9x. Seems not to break
anything on other VAXstations (tested on 4000 VLC).
The interrupt handler uses the softc, so it's probably a good idea to
initialize it before causing interrupts. Prevents a panic on VAXstation
4000/9x with SPX console.
 1.1.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.6.1 12-Aug-2008  haad file spx.c was added on branch haad-dm on 2008-10-19 22:16:07 +0000
 1.1.4.2 28-Sep-2008  mjf Sync with HEAD.
 1.1.4.1 12-Aug-2008  mjf file spx.c was added on branch mjf-devfs2 on 2008-09-28 10:40:11 +0000
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 12-Aug-2008  wrstuden file spx.c was added on branch wrstuden-revivesa on 2008-09-18 04:33:36 +0000
 1.2.6.2 05-Mar-2011  rmind sync with head
 1.2.6.1 30-May-2010  rmind sync with head
 1.2.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.2.2.3 11-Aug-2010  yamt sync with head.
 1.2.2.2 04-May-2009  yamt sync with head.
 1.2.2.1 18-Mar-2009  yamt file spx.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:05 +0000
 1.4.12.2 02-Jun-2012  mrg sync to latest -current.
 1.4.12.1 18-Feb-2012  mrg merge to -current.
 1.4.8.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.8.2 23-May-2012  yamt sync with head.
 1.4.8.1 17-Apr-2012  yamt sync with head
 1.5.2.1 11-Jun-2012  riz Pull up following revision(s) (requested by abs in ticket #299):
sys/arch/vax/vsa/spx.c: revision 1.6
From the "why was this not done before" box:
Implement WSDISPLAYIO_LINEBYTES so xwsfb works
 1.6.4.1 18-May-2014  rmind sync with head
 1.6.2.2 03-Dec-2017  jdolecek update from HEAD
 1.6.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.6.1 09-Jul-2016  skrll Sync with HEAD
 1.9.30.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.10.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.11.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.12.12.1 02-Aug-2025  perseant Sync with HEAD
 1.12.6.1 04-Apr-2025  martin Pull up following revision(s) (requested by hans in ticket #1087):

sys/arch/vax/vsa/spx.c: revision 1.13

vax/spx(4): fix a few X11-related bugs
- overwriting of saved screen pointer of emulation mode when switching
the framebuffer mode from mapped to dumb or vice-versa
- leaving the cursor on when switching away from emulation mode
- failure to restore the screen when changing back to emulation mode
because the saved screen pointer has been set to NULL
- panic on next VT switch, because now also the current screen pointer
is NULL
 1.10 08-May-2021  rin Catch up with this commit:

http://www.nerv.org/netbsd/?q=id:20210507T165558Z.d4aba9e0e053181f2a98ee4ee43012b50949921b

by which per slot tcs_used flag was obsoleted.

No need to initialize __BIT(0) of sc_slots_used here; it is zero anyway
before calling tcattach().
 1.9 09-Jun-2017  flxd branches: 1.9.22;
whitespace
 1.8 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.7 05-Jun-2011  christos branches: 1.7.12; 1.7.30; 1.7.46;
assignment to sc_dev is in tcattach, we don't have sc_dev
 1.6 04-Jun-2011  tsutsui 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.5 14-Dec-2010  matt branches: 1.5.2; 1.5.6;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.4 28-Apr-2008  martin branches: 1.4.22;
Remove clause 3 and 4 from TNF licenses
 1.3 15-Mar-2008  matt branches: 1.3.2; 1.3.4; 1.3.6;
Use device_*
 1.2 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.1 03-Feb-2008  matt branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10;
Preliminatry TC support.
 1.1.10.2 02-Jun-2008  mjf Sync with HEAD.
 1.1.10.1 03-Apr-2008  mjf Sync with HEAD.
 1.1.6.1 24-Mar-2008  keiichi sync with head.
 1.1.4.2 18-Feb-2008  mjf Sync with HEAD.
 1.1.4.1 03-Feb-2008  mjf file tc_vsbus.c was added on branch mjf-devfs on 2008-02-18 21:05:16 +0000
 1.1.2.3 17-Mar-2008  yamt sync with head.
 1.1.2.2 04-Feb-2008  yamt sync with head.
 1.1.2.1 03-Feb-2008  yamt file tc_vsbus.c was added on branch yamt-lazymbuf on 2008-02-04 09:22:47 +0000
 1.3.6.1 16-May-2008  yamt sync with head.
 1.3.4.1 18-May-2008  yamt sync with head.
 1.3.2.2 23-Mar-2008  matt sync with HEAD
 1.3.2.1 15-Mar-2008  matt file tc_vsbus.c was added on branch matt-armv6 on 2008-03-23 02:04:27 +0000
 1.4.22.2 12-Jun-2011  rmind sync with head
 1.4.22.1 05-Mar-2011  rmind sync with head
 1.5.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.5.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.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.7.30.1 28-Aug-2017  skrll Sync with HEAD
 1.7.12.1 03-Dec-2017  jdolecek update from HEAD
 1.9.22.1 13-May-2021  thorpej Sync with HEAD.
 1.7 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.6 26-Aug-2020  isaki Fix misuse of device_private(). sc_dev is device_t.
 1.5 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.4 08-Apr-2019  isaki branches: 1.4.2;
White space -> TAB, fix indent, and add RCS Id.
No functional changes intended.
 1.3 16-Mar-2019  isaki Use C99 style struct initializer to audio_hw_if.
 1.2 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.1 19-Dec-2014  jklos branches: 1.1.2; 1.1.18; 1.1.20; 1.1.22;
Add audio support for VAXstation VLC, 60 and 90 machines. Originally rom
Blaz Antonic and ported from OpenBSD by Björn Johannesso. Tested on VLC
and 4000/60.
 1.1.22.1 10-Jun-2019  christos Sync with HEAD
 1.1.20.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 19-Dec-2014  jdolecek file vsaudio.c was added on branch tls-maxphys on 2017-12-03 11:36:48 +0000
 1.1.2.2 06-Apr-2015  skrll Sync with HEAD
 1.1.2.1 19-Dec-2014  skrll file vsaudio.c was added on branch nick-nhusb on 2015-04-06 15:18:04 +0000
 1.4.2.3 08-May-2019  isaki Remove commented out old filters.
 1.4.2.2 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.4.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.69 17-Feb-2024  tsutsui Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@. Should be pulled up to netbsd-10 and -9.
 1.68 12-Dec-2022  jakllsch branches: 1.68.2;
vsbus vax: sprinkle volatile for register accesses
 1.67 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.66 24-Apr-2021  thorpej branches: 1.66.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.65 03-Sep-2018  riastradh branches: 1.65.4; 1.65.14;
Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.64 12-Apr-2018  ragge branches: 1.64.2;
Fix bug causing DMA to/from user space fail. Fixes PR#49517.
This bug has been around since 2003.
Thanks to Martin Husemann for providing hardware to debug on!
 1.63 22-May-2017  ragge branches: 1.63.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.62 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.61 31-May-2015  abs Add missing break - from Felix Deichmann in PR port-vax/49935
 1.60 28-Jun-2012  abs branches: 1.60.2; 1.60.14; 1.60.16;
Define and use VS_REGS_KA49 rather than magic numbers. From OpenBSD.
 1.59 14-Dec-2010  matt branches: 1.59.8; 1.59.14;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.58 21-Nov-2009  rmind branches: 1.58.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.57 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.56 19-Mar-2009  he Correct a few more bungled bcopy() -> memcpy() conversions.
 1.55 18-Mar-2009  cegger bcopy -> memcpy
 1.54 11-Mar-2008  matt branches: 1.54.4; 1.54.12; 1.54.18;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.53 03-Feb-2008  matt branches: 1.53.2; 1.53.6;
Reorganize a bit to be able to support multiple sgmaps.
 1.52 04-Mar-2007  christos branches: 1.52.20; 1.52.26;
Fix caddr_t fallout.
 1.51 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.50 11-Dec-2005  christos branches: 1.50.26;
merge ktrace-lwp.
 1.49 26-Aug-2005  drochner s/locdesc_t/int/g
 1.48 30-Jun-2005  drochner branches: 1.48.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.47 01-Apr-2005  yamt merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.46 14-Dec-2004  chs branches: 1.46.2; 1.46.4;
use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.45 02-May-2004  ragge Fix bug that were introduced together with the merge of nathanw_sa:
SCSI on VS2k/VS3100 stopped working. Spotted and fixed by Anders Hjalmarsson.
This fixes PR#25307.
 1.44 15-Jul-2003  lukem branches: 1.44.2;
__KERNEL_RCSID()
 1.43 18-Jun-2003  drochner branches: 1.43.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.42 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.41 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.40 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.39 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.38 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 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.35 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.34 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.33 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.32 16-May-2001  matt branches: 1.32.2; 1.32.8; 1.32.16;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.31 04-Feb-2001  ragge branches: 1.31.2;
Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.30 21-Nov-2000  chs eliminate TRUNC_PAGE() and ROUND_PAGE() in favor of their
lowercase counterparts. also, a little misc cleanup.
 1.29 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.28 27-Jun-2000  mrg remove redundant vm includes.
 1.27 25-Jun-2000  ragge Make the HDC9224 MFM device driver up-to-date; has been not-working
since NetBSD 1.2 (!) It also uses interrupts instead of polling now.
Also fix the DMA area locking between SCSI and MFM disks.
Still missing - floppy support.
 1.26 18-Jun-2000  matt branches: 1.26.2;
We use opt_cputype.h now.
 1.25 26-May-2000  ragge branches: 1.25.2;
If we panic before the vsbus is found, don't panic again.
 1.24 23-Apr-2000  matt Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.23 08-Mar-2000  matt don't enable sgmap on ka49 yet.
 1.22 04-Mar-2000  matt expunge vm_offset_t and vm_size_t.
add bus_dma support for the vs4000 dma translation map (sgmap).
enhance the vsbus for the lance to work with it.
remove the sgmap init code from ka46/48/49.c
 1.21 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.20 22-Oct-1999  ragge Add routines to copy to/from a user process from/to the vsbus DMA area.
 1.19 27-Aug-1999  ragge branches: 1.19.2; 1.19.4; 1.19.6;
Rearrange the interrupt detection code to work on the (slightly
different) VAXstation 4000/90.
 1.18 07-Aug-1999  ragge Clean up all bus handling stuff, it has become a mess the latest years.
Add a new bus; "ibus" that is the internal MicroVAX bus.
 1.17 14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.16 13-Mar-1999  ragge branches: 1.16.4;
Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.15 09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.14 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.13 06-Dec-1998  ragge Search for NCR controllers, but not on VS4000/60.
 1.12 10-Aug-1998  ragge Support for VS4000/60.
 1.11 04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.10 21-May-1998  ragge Rewrite the autoconf code for VS3000's.
XXX - no support for any disks at all yet.
 1.9 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.8 12-Jan-1998  thorpej Update for changes to config.
 1.7 03-Jan-1998  thorpej Grab the PCB directly from the u-area, not by indirecting through VM
structures.
 1.6 22-Mar-1997  ragge Update address struct to recognize KA420 motherboard.
 1.5 15-Mar-1997  ragge Add a forgotten #ifdef. Remove debug printout.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 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.1 20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.16.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.4.1 15-Nov-1999  fvdl Sync with -current
 1.19.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.19.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.19.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.25.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.26.2.1 31-Jul-2000  ragge Pull up revision 1.26-1.27 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
(Approved a long time ago, but forgot to check it in :-)
 1.31.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.32.16.1 15-Jul-2002  gehenna catch up with -current.
 1.32.8.5 03-Jan-2003  thorpej Sync with HEAD.
 1.32.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.32.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.32.8.2 29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.32.8.1 16-May-2001  ragge file vsbus.c was added on branch nathanw_sa on 2002-03-29 23:32:16 +0000
 1.32.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.32.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.43.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.43.2.5 01-Apr-2005  skrll Sync with HEAD.
 1.43.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.43.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.43.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.43.2.1 03-Aug-2004  skrll Sync with HEAD
 1.44.2.1 05-May-2004  tron Pull up revision 1.45 (requested by ragge in ticket #245):
Fix bug that were introduced together with the merge of nathanw_sa:
SCSI on VS2k/VS3100 stopped working. Spotted and fixed by Anders Hjalmarsson.
This fixes PR#25307.
 1.46.4.1 12-Feb-2005  yamt use new apis.
 1.46.2.1 29-Apr-2005  kent sync with -current
 1.48.2.4 17-Mar-2008  yamt sync with head.
 1.48.2.3 04-Feb-2008  yamt sync with head.
 1.48.2.2 03-Sep-2007  yamt sync with head.
 1.48.2.1 21-Jun-2006  yamt sync with head.
 1.50.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.52.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.52.20.1 23-Mar-2008  matt sync with HEAD
 1.53.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.53.2.1 24-Mar-2008  keiichi sync with head.
 1.54.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.54.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.54.4.2 11-Mar-2010  yamt sync with head
 1.54.4.1 04-May-2009  yamt sync with head.
 1.58.4.1 05-Mar-2011  rmind sync with head
 1.59.14.1 19-Jun-2015  snj Pull up following revision(s) (requested by abs in ticket #1303):
sys/arch/vax/vsa/vsbus.c: revision 1.61
Add missing break - from Felix Deichmann in PR port-vax/49935
 1.59.8.1 30-Oct-2012  yamt sync with head
 1.60.16.3 28-Aug-2017  skrll Sync with HEAD
 1.60.16.2 09-Jul-2016  skrll Sync with HEAD
 1.60.16.1 06-Jun-2015  skrll Sync with HEAD
 1.60.14.1 02-Jun-2015  sborrill Pull up the following revisions(s) (requested by abs in ticket #817):
sys/arch/vax/vsa/vsbus.c: revision 1.61

Fix VAX46 and VAX48 vsbus attach config. Addresses PR port-vax/49935.
 1.60.2.1 03-Dec-2017  jdolecek update from HEAD
 1.63.8.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.63.8.1 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.64.2.1 10-Jun-2019  christos Sync with HEAD
 1.65.14.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.65.14.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.65.14.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.65.14.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

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

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.65.4.1 19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1800):

sys/arch/vax/vsa/vsbus.c: revision 1.69 (patch)
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.66.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.68.2.1 19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #601):

sys/arch/vax/vsa/vsbus.c: revision 1.69
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.18 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.17 12-Dec-2022  jakllsch vsbus vax: sprinkle volatile for register accesses
 1.16 14-Dec-2010  matt Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.15 28-Apr-2008  martin branches: 1.15.22;
Remove clause 3 and 4 from TNF licenses
 1.14 11-Mar-2008  matt branches: 1.14.2; 1.14.4;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.13 03-Feb-2008  matt branches: 1.13.2; 1.13.6;
Reorganize a bit to be able to support multiple sgmaps.
 1.12 04-Mar-2007  christos branches: 1.12.20; 1.12.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 11-Dec-2005  christos branches: 1.11.26;
merge ktrace-lwp.
 1.10 29-Sep-2003  matt branches: 1.10.16;
Fix GCC3'ism's
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 16-Nov-2000  matt branches: 1.8.2; 1.8.26;
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.7 26-Jul-2000  matt Un __P.
 1.6 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.5 17-May-2000  matt branches: 1.5.4;
Preliminary support for the VS4000/90 SGMAP. Needed for SCSI. Does not
quite work right yet.
 1.4 23-Apr-2000  matt Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.3 07-Mar-2000  matt clear the sgmap that was allocated
 1.2 04-Mar-2000  matt it's a bit cleaner now. it also gets rid of the iomap init in
ka4[689].c
 1.1 03-Mar-2000  matt First pass. need to add hw sgmap allocation via bus_dmamem
 1.5.4.1 16-Nov-2000  tv Pullup 1.8 [matt]:
Commit changes to SCSI working on the VS4000/9x. "Don't overthink the
plumbing! Duh!".
 1.8.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.26.1 03-Aug-2004  skrll Sync with HEAD
 1.8.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.8.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.8.2.1 16-Nov-2000  bouyer file vsbus_dma.c was added on branch thorpej_scsipi on 2000-11-20 20:33:40 +0000
 1.10.16.3 17-Mar-2008  yamt sync with head.
 1.10.16.2 04-Feb-2008  yamt sync with head.
 1.10.16.1 03-Sep-2007  yamt sync with head.
 1.11.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.12.20.1 23-Mar-2008  matt sync with HEAD
 1.13.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.13.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.13.2.1 24-Mar-2008  keiichi sync with head.
 1.14.4.1 16-May-2008  yamt sync with head.
 1.14.2.1 18-May-2008  yamt sync with head.
 1.15.22.1 05-Mar-2011  rmind sync with head

RSS XML Feed