Home | History | Annotate | only in /src/sys/arch/pmax/tc
History log of /src/sys/arch/pmax/tc
RevisionDateAuthorComments
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file asc.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.4 02-Mar-1999  nisimura - An inch towards busified drivers. Needs considerations for TCDS
consolidation.
 1.1.2.3 06-Dec-1998  drochner update for scsipi_adapter changes
 1.1.2.2 15-Oct-1998  nisimura - Updated as recent changes for MI SCSI.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.27 03-May-2022  andvar fix various typos, mainly s/trasfering/transferring/ and s/theese/these/.
 1.26 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.25 13-Oct-2012  tsutsui branches: 1.25.36; 1.25.38;
Fix botch on device_t/softc split in debug printf macro. from chs@
 1.24 09-Jul-2011  matt branches: 1.24.2; 1.24.12;
Cleanu <machine/*> includes
 1.23 14-Dec-2009  matt Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.22 12-Aug-2009  tsutsui Fix a botch in the previous rev 1.21:
We have to mask higher bits on NCR register access via bus_space_read_4(9),
as the previous NCR_READ_REG() does.
Problem reported by Erik Bertelsen on port-pmax@.

I tested a different version on 3MIN and I also tested committed version
on gxemul, but 3MAX doesn't have asc_ioasic but asc_tc..
 1.21 01-Aug-2009  tsutsui Micro optimization around ncr53c9x register accesses.
 1.20 28-Apr-2008  martin branches: 1.20.18;
Remove clause 3 and 4 from TNF licenses
 1.19 13-Apr-2008  tsutsui branches: 1.19.2; 1.19.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.18 06-Mar-2007  simonb branches: 1.18.40;
Fix some caddr_t rototill fallout.

Some from Erik Bertelsen on port-pmax@.
 1.17 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.16 08-Mar-2006  lukem branches: 1.16.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.15 02-Apr-2003  thorpej branches: 1.15.18; 1.15.32; 1.15.34; 1.15.36; 1.15.38;
Use PAGE_SIZE rather than NBPG.
 1.14 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 26-Aug-2001  simonb branches: 1.12.6;
Switch to MI SCSI and drop old pmax MD SCSI support completely.
 1.11 25-Apr-2001  bouyer branches: 1.11.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.10 28-Sep-2000  mhitch branches: 1.10.2;
Set the boundary to NBPG for bus_dmamap_create(). The IOASIC DMA segment
can not cross a page boundary. This fixes a problem when a dump(8) buffer
just crossed a page boundary and bus_dmamap_load() would coalesce the
the overlap onto the first segment. The NEXTPTR value would get set to
-1 when starting the DMA transfer and the residual data for unaligned
transfers would be copied to physical address 0x1ffffffc. On the R3000,
this would result in corrupted data, and on the R4000 would usually result
in a hard system hang.
 1.9 07-Jun-2000  nisimura branches: 1.9.2;
- Take care of dm_segs[].dm_len value whenever the offset is adjusted.
Known not working well for 4MAX+ this moment.
- White spacing.
 1.8 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.7 03-Jun-2000  nisimura Use bus_dma(9) to instruct IOASIC DMA to load transferring addresses,
eliminating MIPS cache machinary exposure here.
 1.6 06-Mar-2000  mhitch branches: 1.6.2;
Get rid of hook for dk_establish() - pmax will now use device_register().
 1.5 04-Mar-2000  nisimura Cosmetic cleanups to hide local objects.
 1.4 04-Mar-2000  mhitch Fix boot device detection. Device probes are not done when adapters are
configured, but after all adapters have been configured. When multiple
adapters are present, only the last configured adapter could be matched
to the boot device slot. The adapter attach routines now check if that
adapter slot matches the boot device slot and saves the softc pointer
for that controller. Then when the disks are configured, dk_establish()
matches the appropriate controller. Also change the rz boot device test
to include a check for the adapter so that it works when booting from a
disk on adapters other than the first one.
 1.3 28-Feb-2000  mhitch Check and clear the appropriate IOASIC SCSI interrupt bits when in polled
I/O mode. Kernel dumps will now work with the IOASIC SCSI devices.
 1.2 19-Feb-2000  nisimura Introduce MI SCSI codes; for DECstation 5000s only this moment.
 1.1 15-Oct-1998  nisimura branches: 1.1.2; 1.1.4;
file asc_ioasic.c was initially added on branch nisimura-pmax-wscons.
 1.1.4.2 29-Mar-2001  bouyer Pass compile-test on i386
 1.1.4.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.1.2.15 14-Mar-2000  nisimura Synchronize with the recent improvements of main trunk. Main trunk
filled gaps toward this, indeed.
 1.1.2.14 19-Nov-1999  nisimura Merge w/ recent changes in main trunk.
 1.1.2.13 10-Sep-1999  nisimura Fix an error in DMAPTR adjustment in unaligned transaction.
 1.1.2.12 09-Sep-1999  nisimura Add more SCR/SDR0/SDR1 improvement. From the analysis on Mach3/pmax codes.
IOASIC SCSI DMA is performed on 8-byte boundary. Unaligned transaction
requires special care managed by these registers. SDR0/SDR1 hold unaligned
data upto 6 bytes in 2 byte increment while SCR indicates the cases. Disk
block I/O operation behaves gracefully and is immune to unaligned transfers.
TODO.1 - introduce bus_dmamap_load(); must be good for either of R3000
cache and R4000 cache.
TODO.2 - handle PTR LOAD interrupt to perform 'chained' DMA spans 3+ page
long.
TODO.3 - tape drive ...
TODO.4 - syncing disks on halt/reboot.
TODO.5 - dumping core memory on panic.
TODO.6 - test ss/uk/ch drives.
 1.1.2.11 06-Sep-1999  nisimura Fix missing shift adjustment of DMAPTR value. Still no luck for tape drive.
 1.1.2.10 05-Sep-1999  nisimura - Add SCR/SDR0/SDR1 register handling supposedly necessary (but failed to
cure any of erroneous behavoiurs I'm experiencing ...)
 1.1.2.9 06-Apr-1999  nisimura - Another bit improvement toward bus_space(9).
 1.1.2.8 05-Apr-1999  nisimura - A bit improvement toward bus_space(9).
 1.1.2.7 30-Mar-1999  nisimura - Restore a local variable mistakenly omitted.
- sc_iswrite -> sc_ispullup (pull up from SCSI device).
 1.1.2.6 29-Mar-1999  drochner use common dev/tc/ioasic code
 1.1.2.5 05-Mar-1999  nisimura - Snailing ahead for bus'ified drivers.
 1.1.2.4 02-Mar-1999  nisimura - An inch towards busified drivers. Needs considerations for TCDS
consolidation.
 1.1.2.3 18-Jan-1999  drochner remove void * arithmetics
 1.1.2.2 06-Dec-1998  drochner update for scsipi_adapter changes
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.2.1 30-Sep-2000  mhitch Pull up rev 1.10 [approved by thorpej].

Set the boundary to NBPG for bus_dmamap_create(). The IOASIC DMA segment
can not cross a page boundary. This fixes a problem when a dump(8) buffer
just crossed a page boundary and bus_dmamap_load() would coalesce the
the overlap onto the first segment. The NEXTPTR value would get set to
-1 when starting the DMA transfer and the residual data for unaligned
transfers would be copied to physical address 0x1ffffffc. On the R3000,
this would result in corrupted data, and on the R4000 would usually result
in a hard system hang.
 1.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.12.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.12.6.1 26-Aug-2001  nathanw file asc_ioasic.c was added on branch nathanw_sa on 2002-10-18 02:39:28 +0000
 1.15.38.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.15.36.1 13-Mar-2006  yamt sync with head.
 1.15.34.1 22-Apr-2006  simonb Sync with head.
 1.15.32.1 09-Sep-2006  rpaulo sync with head
 1.15.18.2 03-Sep-2007  yamt sync with head.
 1.15.18.1 21-Jun-2006  yamt sync with head.
 1.16.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.18.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.19.4.3 11-Mar-2010  yamt sync with head
 1.19.4.2 19-Aug-2009  yamt sync with head.
 1.19.4.1 16-May-2008  yamt sync with head.
 1.19.2.1 18-May-2008  yamt sync with head.
 1.20.18.1 08-Sep-2009  matt Enable building LP64 kernels for 3min, maxine, and 3maxplus.
Fix various LP64 bugs.
XXX still invoked via O32 call args
 1.24.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.2.1 30-Oct-2012  yamt sync with head
 1.25.38.1 10-Jun-2019  christos Sync with HEAD
 1.25.36.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.9 01-Oct-2001  simonb Move MI PMAZ-A SCSI attachment to sys/dev/tc.
 1.8 26-Aug-2001  simonb branches: 1.8.2;
Switch to MI SCSI and drop old pmax MD SCSI support completely.
 1.7 25-Apr-2001  bouyer branches: 1.7.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.6 05-Jun-2000  nisimura branches: 1.6.4;
Have MI ncr53c9x_attach() the 2nd and 3rd arguments for scsipi_adater
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
 1.5 06-Mar-2000  mhitch branches: 1.5.2;
Get rid of hook for dk_establish() - pmax will now use device_register().
 1.4 04-Mar-2000  nisimura Cosmetic cleanups to hide local objects.
 1.3 04-Mar-2000  mhitch Fix boot device detection. Device probes are not done when adapters are
configured, but after all adapters have been configured. When multiple
adapters are present, only the last configured adapter could be matched
to the boot device slot. The adapter attach routines now check if that
adapter slot matches the boot device slot and saves the softc pointer
for that controller. Then when the disks are configured, dk_establish()
matches the appropriate controller. Also change the rz boot device test
to include a check for the adapter so that it works when booting from a
disk on adapters other than the first one.
 1.2 19-Feb-2000  nisimura Introduce MI SCSI codes; for DECstation 5000s only this moment.
 1.1 15-Oct-1998  nisimura branches: 1.1.2; 1.1.4;
file asc_pmaz.c was initially added on branch nisimura-pmax-wscons.
 1.1.4.3 29-Mar-2001  bouyer Pass compile-test on i386
 1.1.4.2 29-Mar-2001  bouyer Port to thorpej_scsipi.
 1.1.4.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.1.2.7 14-Mar-2000  nisimura Synchronize with the recent improvements of main trunk. Main trunk
filled gaps toward this, indeed.
 1.1.2.6 19-Nov-1999  nisimura Merge w/ recent changes in main trunk.
 1.1.2.5 30-Mar-1999  nisimura - Restore a local variable mistakenly omitted.
- sc_iswrite -> sc_ispullup (pull up from SCSI device).
 1.1.2.4 05-Mar-1999  nisimura - Snailing ahead for bus'ified drivers.
 1.1.2.3 02-Mar-1999  nisimura - An inch towards busified drivers. Needs considerations for TCDS
consolidation.
 1.1.2.2 06-Dec-1998  drochner update for scsipi_adapter changes
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.5.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.8.2.1 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file ascvar.h was initially added on branch nisimura-pmax-wscons.
 1.1.2.3 02-Mar-1999  nisimura - An inch towards busified drivers. Needs considerations for TCDS
consolidation.
 1.1.2.2 06-Dec-1998  drochner update for scsipi_adapter changes
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.42 01-Dec-1999  nisimura Replace old asic.c with one imported from a development branch.
 1.41 15-Nov-1999  nisimura Very large scale change to sweep obstracles to remove 3MAX IOASIC disguise.
- Rework ibus device configuration and interrupt handler assignment.
- Remove TC device exposure in 'mainbus.c'
- Squash 'ibus_{3100,5100}.c' into a file; it can not cope with 3max.
- 'struct confargs' -> 'struct mainbus_attach_args'
Now about to remove tc_slot_info[] and tc_enable_interrupt inherited from
4.4BSD.
 1.40 01-Oct-1999  nisimura branches: 1.40.2; 1.40.8;
- Remove defunct codes and arrange consistency between pmax and alpha.
- Reduce 'ioasic_base' expose.
 1.39 28-Sep-1999  nisimura Forgot to commit an important change for bus_space/bus_dma.
 1.38 09-Sep-1999  nisimura Remove now defunct local implementation of ioasic_lance_dma_setup().
 1.37 03-Sep-1999  nisimura - Nuke '#ifdef alpha' which brings little useful, plus a small cleanup.
 1.36 26-Apr-1999  nisimura - Forgot to commit these two.
 1.35 24-Apr-1999  simonb Nuke register and remove trailling white space.
 1.34 18-Mar-1999  simonb branches: 1.34.4;
Don't prototype ioasicprint() - the prototype is now in
dev/tc/ioasicvar.h and we don't use it here anyway.
 1.33 15-Mar-1999  jonathan MI ioasic softc and child-device structs, gc duplicate struct definitions.
Add MI ioasic functions, but dont enable on alpha until tested.
 1.32 14-Mar-1999  jonathan Clean up initializers for pmax ioasic children. Use same struct as alpha.
 1.31 12-Mar-1999  nisimura - Nuke old leftover; round two. XXX Still there 3MAX's IOASIC disguise.
Rework will be done in conf/files.pmax, anyway.
 1.30 05-Sep-1998  nisimura branches: 1.30.2;
- Clearify what ioasic_init() is for. No runtime difference because
NetBSD/pmax does not fully utilize the hardware features.
 1.29 21-May-1998  thorpej Make this build for a 3MAX-only kernel.
 1.28 25-Apr-1998  jonathan Resync 3max (kn02) support.
 1.27 19-Apr-1998  jonathan Rework, based loosely on suggestions from Tohru Nisimura..
 1.26 26-Mar-1998  thorpej It's Just Wrong to configure a KN02 system slot as an IOCTL ASIC, but
since it's currently done that way, nuke the gratuitous printf that
reports the behavior.
 1.25 25-Mar-1998  jonathan * Use new defopt model-specific options and opt files.
Replace all DS5000_* and DS3100 ifdefs with ifdefs on DEC_ options.
* Use MI declarations, not pmax-specific, in model-specific init
that uses baseboard (ioasic) registers.
* Further cleanup of machdep.c. Clock-tick still needs more thought.
* Use 'ibus' names for 3100 baseboard devices in MI code.
 1.24 25-Mar-1998  jonathan Split sys/arch/pmaxpmax/{machdep.c,trap.c} as suggested by Jason Thorpe:
* add "Platform" support inpmax/pmax/sysconf.c and pmax/include/sysconf.h
(based on Alpha cpuconf.[ch], with a namechange to avoid clashes with
support for models of MIPS cpus. They differ more than Alphas).

* For each supported model of DECstation, create a separate file
with the support for that model. Use model codenames, since
support is really baseboard-specific and CPU daugherboards can change.
Move code from machdep.c and pmax_trap.c,
Add sysconf (nee "cpuconf") support.

* Rename model-specific functions to match sysconf names.

* Clean up autoconf.c. Use platform callbacks.

* Retire pmax_trap.c.

Leaves I/O bus configuration and console configuration untouched.
 1.23 12-Jan-1998  thorpej Update for changes to config.
 1.22 21-Jul-1997  jonathan Kill __BROKEN_INDIRECT_CONFIG on pmax.
Based on a patch from Chris G. Demetriou, December 1996.
 1.21 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.20 16-Jun-1997  jonathan Garbage-collect '#include <machine/pte.h>'.
 1.19 16-Jun-1997  jonathan <machine/locore.h> -> <machine/bus.h>
 1.18 16-Jun-1997  jonathan Remove the machConst.h (wrapper for Sprite-derived source), and all
#includes <machine/machConst.h> uses.
Other header files now include <mips/cpuregs.h> where necessary.
 1.17 15-Jun-1997  mhitch DECstation MIPS3 support: wbflush() is cpu-dependent, need declaration from
machine/locore.h.
 1.16 24-May-1997  jonathan Delint debugging-printf() macro.
 1.15 13-Oct-1996  christos backout previous kprintf change
 1.14 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 06-Oct-1996  jonathan Update pmax drivers to use "const" on 2nd arg to cfprint_t:
turbocnhannel: include/tc_machdep.h, tc/tc_subr.c, tc/asic.c
kn01 baseboard: pmax/mainbus.c
 1.12 09-Sep-1996  jonathan Apply diff from the 1.2 release branch, so that ugly IOASIC debugging
is disabled by default:
>revision 1.9.4.2
>date: 1996/09/09 20:19:11; author: thorpej; state: Exp; lines: +2 -18
>Disable IOASIC_DEBUG so that autoconfiguration looks normal, by request
>of Jonathan Stone
 1.11 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.10 29-May-1996  mhitch Fix autoconfiguration stuff to more closely match the alpha - primarily
the IOASIC attached devices. The DS3100 will now configure properly.
Fix the DS5000/25 IOASIC table entry for the RTC so the RTC interrupts
get enabled.
Fix up a moved include file.
 1.9 17-Mar-1996  thorpej branches: 1.9.4;
New device attachment scheme:

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

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.8 31-Jan-1996  jonathan Resolve pmax and alpha IOCTL asic driver differences, pass 1:

Rename the ioctl asic register and slot macros from ASIC_<xxx> to
IOASIC_<xxx>, to be compatible with the machine-indpendent names in
sys/dev/tc/ioasicvar.h. The pmax code still uses
sys/arch/pmax/pmax/asic.h, as some of the registers and offsets
defined there are not yet defined in sys/dev/tc/ioasicvar.h.

Rename the ioctl asic base-address pointer from `asic_base' to `ioasic_base'.
 1.7 29-Jan-1996  jonathan Re-write Decstation turbochannel autoconfiguration code to use the machine-
independent TC support in sys/dev/tc/tc.c and sys/dev/tc/tcvar.h:
* Change the tc autoconfiguration tables to use a struct tc_attach_args
instead of the ad-hoc structure.
* Change all pmax device drivers to use a `struct confargs' that's
assignment-compatible with sys/dev/tc/tcvar.h `struct tcdev_attach_args'.
Devices that can be present on a TC or as ioctl asic/mainbus builtins
use the same `struct confargs'.
* Eliminate the `BUS_CVTADDR()' macros which the pmax port inherited from
an old, now-obsolete sys/arch/alpha snapshot.

* Update the comments and debugging code in interrupt handlers to
be consistent with the machine-independent TC support.

Other commits that overlap the same source files include: re-enabling
clock-tick interrupts earlier, and counting hardclock ticks for vmstat -i.
 1.6 25-Sep-1995  jonathan Update pmax kernel to compile with -Werror:
Update TURBOChannel and ioasic interrupt-establish routines to pass on their
device argument as a "void *", since that's how all the pmax interrupt handlers
are declared.
 1.5 12-Sep-1995  jonathan Change the signature of interrupt-handlers to take a void *
(a pointer to the softc) and return an int (indicating spurious
interrupts or other conditions.)
 1.4 29-Aug-1995  jonathan Fix references to ASIC_SLOT_RTC, which isn't yet defined on DECstations.
 1.3 18-Aug-1995  jonathan Initialize the ioasic slot probe table for the 3MIN (Decstation 5k/1xx)
and MAXINE (Decstation 5k/xx), instead of setting them to NULL.
New-config kernels should work on those machines now.

Rename the definition of the struct cfdriver for the IO ASIC from "asiccd"
to "ioasiccd", as the config-file name changed from "asic" to "ioasic".
 1.2 10-Aug-1995  jonathan Move IO ASIC interrupt-enable outside #ifdef DEBUG, where it had
accidentally snuck in. Clean up debugging messages and explicitly
give a warning on CPUs the code hasn't been tested on.
 1.1 07-Aug-1995  jonathan New-style config (config.new) autoconfiguration code for Decstation
turhsturbochannel machines. Lifted wholesale from cgd's Alpha
turbochannel code, with changes that reflect the slightly different
bus topology and `slot' numbering on Decstations.
 1.9.4.2 09-Sep-1996  thorpej Disable IOASIC_DEBUG so that autoconfiguration looks normal, by request
from Jonathan Stone.
 1.9.4.1 30-May-1996  mhitch Pulled autoconfig fixes up from the trunk
 1.30.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.34.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.40.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.40.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file bt431reg.h was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 30-Oct-1998  nisimura - Migrate to MI TURBOchannel codes.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file bt459reg.h was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 30-Oct-1998  nisimura - Migrate to MI TURBOchannel codes.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file cfb.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 30-Oct-1998  nisimura - Migrate to MI TURBOchannel codes.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.7 19-Apr-1998  jonathan Rework pmax turbochannel config, as suggested by Jason Thorpe.
Also make TC framebuffer-console search table-driven.

Does not yet include "tcasic" layer; there's no such hardware on DECstations
and nothing for a tcasic layer to do.
 1.6 29-May-1996  mhitch Fix autoconfiguration stuff to more closely match the alpha - primarily
the IOASIC attached devices. The DS3100 will now configure properly.
Fix the DS5000/25 IOASIC table entry for the RTC so the RTC interrupts
get enabled.
Fix up a moved include file.
 1.5 29-Jan-1996  jonathan branches: 1.5.4;
Re-write Decstation turbochannel autoconfiguration code to use the machine-
independent TC support in sys/dev/tc/tc.c and sys/dev/tc/tcvar.h:
* Change the tc autoconfiguration tables to use a struct tc_attach_args
instead of the ad-hoc structure.
* Change all pmax device drivers to use a `struct confargs' that's
assignment-compatible with sys/dev/tc/tcvar.h `struct tcdev_attach_args'.
Devices that can be present on a TC or as ioctl asic/mainbus builtins
use the same `struct confargs'.
* Eliminate the `BUS_CVTADDR()' macros which the pmax port inherited from
an old, now-obsolete sys/arch/alpha snapshot.

* Update the comments and debugging code in interrupt handlers to
be consistent with the machine-independent TC support.

Other commits that overlap the same source files include: re-enabling
clock-tick interrupts earlier, and counting hardclock ticks for vmstat -i.
 1.4 03-Jan-1996  jonathan arch/pmax/tc -> dev/tc, pass 1:
Eliminate pmax/tc/tc.h. Use dev/tc headers for pmax port. Change pmax TC
autoconfig tables to use structs (mostly) compatible with dev/tc/tcvar.h.
Move TC console search to tc.c.
 1.3 09-Oct-1995  jonathan Fix bugs in the turbochannel config table for MAXINE (personal decstation).
 1.2 09-Aug-1995  jonathan Add missing "priority" field value in KN02 "asic" configuration entry for
the Dallas-compatible real-time clock. The missing entry caused the offset
to end up in the "priority" field. New-style config now boots cleanly on a
KN02 (3MAX).
 1.1 07-Aug-1995  jonathan New-style config (config.new) autoconfiguration code for Decstation
turhsturbochannel machines. Lifted wholesale from cgd's Alpha
turbochannel code, with changes that reflect the slightly different
bus topology and `slot' numbering on Decstations.
 1.5.4.1 30-May-1996  mhitch Pulled autoconfig fixes up from the trunk
 1.8 27-Feb-1996  jonathan Replace tc.c and ds-tc-conf.c with a re-written tc_subr.c. tc_subr.c
works with the revamped machine-independent TC code in sys/dev/tc.
A name change is necessary to avoid a name clash with sys/dev/tc/tc.c,
which also creates a tc.o.
 1.7 29-Jan-1996  jonathan Re-write Decstation turbochannel autoconfiguration code to use the machine-
independent TC support in sys/dev/tc/tc.c and sys/dev/tc/tcvar.h:
* Change the tc autoconfiguration tables to use a struct tc_attach_args
instead of the ad-hoc structure.
* Change all pmax device drivers to use a `struct confargs' that's
assignment-compatible with sys/dev/tc/tcvar.h `struct tcdev_attach_args'.
Devices that can be present on a TC or as ioctl asic/mainbus builtins
use the same `struct confargs'.
* Eliminate the `BUS_CVTADDR()' macros which the pmax port inherited from
an old, now-obsolete sys/arch/alpha snapshot.

* Update the comments and debugging code in interrupt handlers to
be consistent with the machine-independent TC support.

Other commits that overlap the same source files include: re-enabling
clock-tick interrupts earlier, and counting hardclock ticks for vmstat -i.
 1.6 11-Jan-1996  jonathan Add lots of debugging to the TurboChannel autoconfiguration code.
 1.5 03-Jan-1996  jonathan arch/pmax/tc -> dev/tc, pass 1:
Eliminate pmax/tc/tc.h. Use dev/tc headers for pmax port. Change pmax TC
autoconfig tables to use structs (mostly) compatible with dev/tc/tcvar.h.
Move TC console search to tc.c.
 1.4 09-Oct-1995  jonathan Fix bugs in the turbochannel config table for MAXINE (personal decstation).
 1.3 12-Sep-1995  jonathan Add entry for MAXINE xcfb baseboard framebuffer to the MAXINE
turbochannel configuration table.
 1.2 24-Aug-1995  jonathan Fix autoconfig table initializers for 3MIN (tested) and MAXINE (untested).
 1.1 07-Aug-1995  jonathan New-style config (config.new) autoconfiguration code for Decstation
turhsturbochannel machines. Lifted wholesale from cgd's Alpha
turbochannel code, with changes that reflect the slightly different
bus topology and `slot' numbering on Decstations.
 1.16 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.15 24-Apr-2021  thorpej branches: 1.15.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.14 21-Nov-2020  thorpej branches: 1.14.2;
malloc(9) -> kmem(9)
 1.13 10-Nov-2019  chs branches: 1.13.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.12 28-Jun-2015  maxv branches: 1.12.18;
Use-after-free.

ok christos@

Found by The Brainy Code Scanner.
 1.11 04-Jun-2011  tsutsui branches: 1.11.12; 1.11.28; 1.11.30;
- split device_t/softc
- make sure that *(dtdv_handler)() registered via dt_establish_handler()
takes softc, not device_t as other interrupt handlers

No crash during device attach on GXemul.
 1.10 28-Apr-2008  martin branches: 1.10.22; 1.10.28; 1.10.32;
Remove clause 3 and 4 from TNF licenses
 1.9 17-Oct-2007  garbled branches: 1.9.16; 1.9.18; 1.9.20;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.8 08-Oct-2007  ad Use the softint API.
 1.7 04-Mar-2007  christos branches: 1.7.2; 1.7.10; 1.7.18; 1.7.20; 1.7.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 11-Dec-2005  christos branches: 1.6.26;
merge ktrace-lwp.
 1.5 10-Jun-2005  jmc branches: 1.5.2;
Change max -> max_polls to avoid shadowing.
 1.4 15-Jan-2005  mhitch Detection of mouse packet did not work with my mouse. It only sends 6 bytes
instead of the 8 defined by struct dt_locator_msg. Change the dectection
so we swap the mouse/keyboard addresses only if the packets don't match
what's expected (rather than on every packet). My mouse now works, and
if a different mouse sends an 8 byte packet, it should also work.
 1.3 23-Dec-2003  ad MAXINE keyboard and mouse now works, albeit with some minor issues.
 1.2 13-Dec-2003  ad Add drivers for the desktop bus, DC-7085 and pm display. Make it possible to
select between rcons or wscons at compile time. Ok'ed by simonb.
 1.1 15-Mar-2002  ad branches: 1.1.2; 1.1.12;
file dt.c was initially added on branch ad_pmax_wscons.
 1.1.12.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.12.4 17-Jan-2005  skrll Sync with HEAD.
 1.1.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.12.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 15-Mar-2002  ad More sanity checks.
 1.1.2.1 15-Mar-2002  ad Changes necessary for wscons on NetBSD/pmax. All device support is here,
just needs further testing.
 1.5.2.2 27-Oct-2007  yamt sync with head.
 1.5.2.1 03-Sep-2007  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.22.1 14-Oct-2007  yamt sync with head.
 1.7.20.1 06-Nov-2007  matt sync with HEAD
 1.7.18.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.7.10.1 16-Oct-2007  garbled Sync with HEAD
 1.7.2.1 15-Jul-2007  ad Get pmax working.
 1.9.20.1 16-May-2008  yamt sync with head.
 1.9.18.1 18-May-2008  yamt sync with head.
 1.9.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.32.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.10.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.22.1 12-Jun-2011  rmind sync with head
 1.11.30.1 22-Sep-2015  skrll Sync with HEAD
 1.11.28.1 05-Jul-2015  snj Pull up following revision(s) (requested by maxv in ticket #856):
sys/arch/pmax/tc/dt.c: revision 1.12
Use-after-free.
ok christos@
Found by The Brainy Code Scanner.
 1.11.12.1 03-Dec-2017  jdolecek update from HEAD
 1.12.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.13.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.14.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.15.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.13 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.12 24-Apr-2021  thorpej branches: 1.12.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.11 10-Nov-2013  christos branches: 1.11.44;
fix unused variable warnings
 1.10 09-Jul-2011  matt branches: 1.10.2; 1.10.12; 1.10.16;
Cleanu <machine/*> includes
 1.9 04-Jun-2011  tsutsui - split device_t/softc
- make sure that *(dtdv_handler)() registered via dt_establish_handler()
takes softc, not device_t as other interrupt handlers

No crash during device attach on GXemul.
 1.8 28-Apr-2008  martin branches: 1.8.22; 1.8.28; 1.8.32;
Remove clause 3 and 4 from TNF licenses
 1.7 04-Mar-2007  christos branches: 1.7.40; 1.7.42; 1.7.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 11-Dec-2005  christos branches: 1.6.26;
merge ktrace-lwp.
 1.5 10-Jan-2005  mhitch branches: 1.5.10;
Fix Maxine keyboard and mouse ioctl routines to return EPASSTHROUGH for
unrecognized commands so they can be passed to other handlers.
 1.4 08-Jan-2005  mhitch Fix MAXINE keyboard multi-key press bug. Keyboard sends all currently
depressed keys in each message. Any keys in current message that are
also present in previous message are ignored. However, copying a byte
array into an integer array and comparing entry by entry doesn't have
the desired effect. Change the definition of the save buffer to match
the current message buffer data.
 1.3 23-Dec-2003  ad MAXINE keyboard and mouse now works, albeit with some minor issues.
 1.2 13-Dec-2003  ad Add drivers for the desktop bus, DC-7085 and pm display. Make it possible to
select between rcons or wscons at compile time. Ok'ed by simonb.
 1.1 15-Mar-2002  ad branches: 1.1.2; 1.1.12;
file dtkbd.c was initially added on branch ad_pmax_wscons.
 1.1.12.5 17-Jan-2005  skrll Sync with HEAD.
 1.1.12.4 13-Jan-2005  skrll Adapt to branch
 1.1.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.12.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.4 15-Mar-2002  ad More sanity checks.
 1.1.2.3 15-Mar-2002  ad Bail out if dt_identify() fails.
 1.1.2.2 15-Mar-2002  ad Remove debugging crud.
 1.1.2.1 15-Mar-2002  ad Changes necessary for wscons on NetBSD/pmax. All device support is here,
just needs further testing.
 1.5.10.2 03-Sep-2007  yamt sync with head.
 1.5.10.1 21-Jun-2006  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.44.1 16-May-2008  yamt sync with head.
 1.7.42.1 18-May-2008  yamt sync with head.
 1.7.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.32.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.8.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.22.1 12-Jun-2011  rmind sync with head
 1.10.16.1 18-May-2014  rmind sync with head
 1.10.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11.44.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.12.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.13 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.12 24-Apr-2021  thorpej branches: 1.12.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.11 09-Jul-2011  matt branches: 1.11.68;
Cleanu <machine/*> includes
 1.10 04-Jun-2011  tsutsui - split device_t/softc
- make sure that *(dtdv_handler)() registered via dt_establish_handler()
takes softc, not device_t as other interrupt handlers

No crash during device attach on GXemul.
 1.9 28-Apr-2008  martin branches: 1.9.22; 1.9.28; 1.9.32;
Remove clause 3 and 4 from TNF licenses
 1.8 04-Mar-2007  christos branches: 1.8.40; 1.8.42; 1.8.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 12-Nov-2006  plunky branches: 1.7.4;
Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
 1.6 11-Dec-2005  christos branches: 1.6.20; 1.6.22;
merge ktrace-lwp.
 1.5 10-Jan-2005  mhitch branches: 1.5.10;
Fix Maxine keyboard and mouse ioctl routines to return EPASSTHROUGH for
unrecognized commands so they can be passed to other handlers.
 1.4 10-Jan-2005  mhitch Maxine mouse buttons were being mapped incorrectly (old dtop.c code mapped
them to serial mouse buttons, which were then mapped into events to pass
to the X server).
Also fix bug in mouse motion - putting 2 unsigned bytes into an integer
resulted in a 16-bit unsigned value, so negative mouse motion didn't work.
 1.3 23-Dec-2003  ad MAXINE keyboard and mouse now works, albeit with some minor issues.
 1.2 13-Dec-2003  ad Add drivers for the desktop bus, DC-7085 and pm display. Make it possible to
select between rcons or wscons at compile time. Ok'ed by simonb.
 1.1 15-Mar-2002  ad branches: 1.1.2; 1.1.12;
file dtms.c was initially added on branch ad_pmax_wscons.
 1.1.12.5 17-Jan-2005  skrll Sync with HEAD.
 1.1.12.4 13-Jan-2005  skrll Adapt to branch
 1.1.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.12.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.3 15-Mar-2002  ad More sanity checks.
 1.1.2.2 15-Mar-2002  ad Bail out if dt_identify() fails.
 1.1.2.1 15-Mar-2002  ad Changes necessary for wscons on NetBSD/pmax. All device support is here,
just needs further testing.
 1.5.10.3 03-Sep-2007  yamt sync with head.
 1.5.10.2 30-Dec-2006  yamt sync with head.
 1.5.10.1 21-Jun-2006  yamt sync with head.
 1.6.22.1 10-Dec-2006  yamt sync with head.
 1.6.20.1 18-Nov-2006  ad Sync with head.
 1.7.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.44.1 16-May-2008  yamt sync with head.
 1.8.42.1 18-May-2008  yamt sync with head.
 1.8.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.32.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.9.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.22.1 12-Jun-2011  rmind sync with head
 1.11.68.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.12.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file dtop.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.10 03-Feb-2000  nisimura Catch up to recent changes in main trunk.
 1.1.2.9 03-Feb-2000  nisimura Catch up to recent changes in main trunk.
 1.1.2.8 26-Nov-1999  nisimura Redo the previous makeup.
 1.1.2.7 26-Nov-1999  nisimura Make more realistic this mockup; still no clockwork inside.
 1.1.2.6 19-Nov-1999  nisimura Replace with a more realistic mockup code; still not useful.
 1.1.2.5 11-May-1999  nisimura - Catch up to recent main trunk changes.
- Make target platform files to have TURBOchannel slot definitions and
nuke tc_machdep.c.
- MIPS processor needs not to have tc_mb() before ZS register read ops.
 1.1.2.4 03-Apr-1999  nisimura - Make this compilable. Needs to be rewritten.
 1.1.2.3 23-Oct-1998  nisimura - Fix typos.
 1.1.2.2 23-Oct-1998  nisimura - An inch progress of dtop.c towards NWSCONS. Still useless. As
ACCESS.bus (Digital called this in many ways) runs much faster than
4800bps serial interconnect, smart "packet disassembler" might be
required with the help of DMA circuit. Packet interpretation of LK501 ->
LK201 might be also a pain...
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 13-Dec-2003  ad Add drivers for the desktop bus, DC-7085 and pm display. Make it possible to
select between rcons or wscons at compile time. Ok'ed by simonb.
 1.1 15-Mar-2002  ad branches: 1.1.2; 1.1.12;
file dtreg.h was initially added on branch ad_pmax_wscons.
 1.1.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.12.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 15-Mar-2002  ad Changes necessary for wscons on NetBSD/pmax. All device support is here,
just needs further testing.
 1.6 04-Jun-2011  tsutsui - split device_t/softc
- make sure that *(dtdv_handler)() registered via dt_establish_handler()
takes softc, not device_t as other interrupt handlers

No crash during device attach on GXemul.
 1.5 28-Apr-2008  martin branches: 1.5.22; 1.5.28; 1.5.32;
Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.76; 1.4.78;
merge ktrace-lwp.
 1.3 23-Dec-2003  ad MAXINE keyboard and mouse now works, albeit with some minor issues.
 1.2 13-Dec-2003  ad Add drivers for the desktop bus, DC-7085 and pm display. Make it possible to
select between rcons or wscons at compile time. Ok'ed by simonb.
 1.1 15-Mar-2002  ad branches: 1.1.2; 1.1.12;
file dtvar.h was initially added on branch ad_pmax_wscons.
 1.1.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.12.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 15-Mar-2002  ad Changes necessary for wscons on NetBSD/pmax. All device support is here,
just needs further testing.
 1.4.78.1 16-May-2008  yamt sync with head.
 1.4.76.1 18-May-2008  yamt sync with head.
 1.4.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.32.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.5.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.22.1 12-Jun-2011  rmind sync with head
 1.16 13-Oct-1996  jonathan Remove pmax/tc/if_le.c. Superseded by sys/dev/tc MI TC/ioasic lance drivers.
 1.15 13-Oct-1996  christos backout previous kprintf change
 1.14 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.12 22-Apr-1996  christos Add a hardware dependent initialization function lehwinit()
 1.11 18-Apr-1996  cgd change LANCE copy & zero functions' names to start with amd7990_, and
remove their 'integrate' (usually defined to be 'static') keywords.
when lance drivers are split up by attachment, more than one file will
reference the copy/zero functions (i.e. not just the file that pulls in
am7990.c... and eventually inclusion of am7990.c should go away entirely).
 1.10 18-Mar-1996  jonathan Additional fixes to complete the NetBSD/1.1B config changes:

Add new device-attach struct cfattach le_tc_ca and struct cfdriver le_cd.
Change IOASIC cfdriver references from "ioasiccd" to "ioasic_cd".
Change "mainbuscd" to "mainbus_cd"
 1.9 31-Jan-1996  jonathan Resolve pmax and alpha IOCTL asic driver differences, pass 1:

Rename the ioctl asic register and slot macros from ASIC_<xxx> to
IOASIC_<xxx>, to be compatible with the machine-indpendent names in
sys/dev/tc/ioasicvar.h. The pmax code still uses
sys/arch/pmax/pmax/asic.h, as some of the registers and offsets
defined there are not yet defined in sys/dev/tc/ioasicvar.h.

Rename the ioctl asic base-address pointer from `asic_base' to `ioasic_base'.
 1.8 29-Jan-1996  jonathan Re-write Decstation turbochannel autoconfiguration code to use the machine-
independent TC support in sys/dev/tc/tc.c and sys/dev/tc/tcvar.h:
* Change the tc autoconfiguration tables to use a struct tc_attach_args
instead of the ad-hoc structure.
* Change all pmax device drivers to use a `struct confargs' that's
assignment-compatible with sys/dev/tc/tcvar.h `struct tcdev_attach_args'.
Devices that can be present on a TC or as ioctl asic/mainbus builtins
use the same `struct confargs'.
* Eliminate the `BUS_CVTADDR()' macros which the pmax port inherited from
an old, now-obsolete sys/arch/alpha snapshot.

* Update the comments and debugging code in interrupt handlers to
be consistent with the machine-independent TC support.

Other commits that overlap the same source files include: re-enabling
clock-tick interrupts earlier, and counting hardclock ticks for vmstat -i.
 1.7 28-Dec-1995  jonathan Use machine-independent TurboChannel include files from dev/tc.
Add machine-dependent TC definitions in pmax/include/tc_machdep.h.
 1.6 28-Dec-1995  jonathan *** empty log message ***
 1.5 22-Dec-1995  jonathan Re-apply fix from before the NetBSD/1.1 version: actually write the pointer
to the LANCE's dma region into the IO ASIC after computing it.
 1.4 17-Dec-1995  jonathan Remove LENITR_UNIT and supporting code that allowed passing a unit
number, instead of a softc pointer, to leintr(). Pmaxes don't need it anymore.
 1.3 25-Nov-1995  cgd allow bus-specific lance drivers to use machine-independent buffer/descriptor
copy functions, and convert isa and pmax drivers to do so.
 1.2 17-Aug-1995  jonathan branches: 1.2.2;
Merge back fixes from the merged Decstation/Alpha driver.
Remove all references to #ifdef SPARSE, and use #ifdef alpha instead.
Only initialize ASIC dma on a machine with an ASIC.
 1.1 11-Aug-1995  jonathan Re-port the Alpha versino of NetBSD's machine-independent LANCE driver
back to the DECstation. Boots on 3MAX and 3MAXPLUS. The bug-fixes
applied to this driver since it forked off the Decstation code also
seem to fix long-standing DMA problems with the Decstation SCSI driver.
 1.2.2.1 13-Oct-1995  jonathan Commit a version of the pmax lance driver that's been cleaned up
to compile with -Werror to the NetBSD-1.1 tree.
 1.4 13-Oct-1996  jonathan Remove pmax/tc/if_le.c. Superseded by sys/dev/tc MI TC/ioasic lance drivers.
 1.3 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.2 17-Aug-1995  jonathan Merge back fixes from the merged Decstation/Alpha driver.
Remove all references to #ifdef SPARSE, and use #ifdef alpha instead.
Only initialize ASIC dma on a machine with an ASIC.
 1.1 11-Aug-1995  jonathan Re-port the Alpha versino of NetBSD's machine-independent LANCE driver
back to the DECstation. Boots on 3MAX and 3MAXPLUS. The bug-fixes
applied to this driver since it forked off the Decstation code also
seem to fix long-standing DMA problems with the Decstation SCSI driver.
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file ims332reg.h was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 30-Oct-1998  nisimura - Migrate to MI TURBOchannel codes.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.23 03-Sep-2020  simonb The TC device addresses are defined in KSEG1, but this confuses
bus_space(9) which expects bus addresses and not kernel virtual
addresses. Pull the addresses back to bus addresses with
MIPS_KSEG1_TO_PHYS().

XXX: Fix this properly one day (without storing KSEG1 addrs in
the TC device configuration).

Fixes problem with TURBOchannel pmaxes panicing during
autoconfiguartion.
 1.22 10-Nov-2013  christos fix unused variable warnings
 1.21 09-Jul-2011  matt branches: 1.21.2; 1.21.12; 1.21.16;
Cleanu <machine/*> includes
 1.20 04-Jun-2011  tsutsui Split device_t/softc. pmax is tested on GXemul, compile test only for alpha.
 1.19 16-Mar-2009  dsl branches: 1.19.4; 1.19.6; 1.19.10;
ANSIfy functions with function-pointer arguments
 1.18 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.17 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.16 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.15 02-Oct-2002  thorpej branches: 1.15.112; 1.15.120; 1.15.126;
Use CFATTACH_DECL().
 1.14 11-Jul-2000  nisimura branches: 1.14.4; 1.14.8;
- Use PMAD-BA name for device match logic. It's not a real TURBOchannel
device and the id string is not found in option ROM string, but
ULTRIX/OSF1 call it so anyway.
- Squash IOASIC DMA buffer allocation into device attach() sequence.
 1.13 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.12 15-Mar-2000  nisimura branches: 1.12.2;
Eliminate unused sc_cookie field of struct ioasic_softc.
 1.11 29-Feb-2000  nisimura - Have SYS_DEV_xxx device cookie symbols to select and install proper
interrupt handlers into intrtab[] array, rather than the idea of devices
in 'psuedo' TURBOchannel slots.
- Nuke symbols for psuedo TC slots.
- Abandon never/unlikely used intr_disestablish()s.
 1.10 03-Feb-2000  nisimura Merge IOASIC register definitions.
 1.9 03-Feb-2000  nisimura Not to use (cfdata->cf_unit > 0) conditional in device match() routine.
 1.8 14-Jan-2000  simonb Redo interrupt establishment, based in part on work on the
[nisimura-pmax-wscons] branch and suggestions from Toru Nisimura:
- Remove bogus tc_slot_info[] name for interrupt handling array
and replace with simplified struct intrhand intrtab[] array.
- Add intr_establish() and intr_disestablish() function pointers
to struct platform and initialise this in each model-specific
initialisation, and remove global tc_enable_interrupt function
pointer.
- Remove model-specific function declarations from ibus/ibusvar.h.
This is functionally identical to the current scheme, and doesn't
yet try to commonise interrupt establishment by bus type as the
[nisimura-pmax-wscons] branch does.

Also, move cpuspeed variable from autoconf.c to machdep.c
 1.7 10-Jan-2000  simonb Remove unneeded include files (up to 16 in two files!).
 1.6 10-Jan-2000  simonb Add trailing quote to RCS ID.
 1.5 09-Jan-2000  ad RCS ID police.
 1.4 08-Jan-2000  simonb Function prototype cleanup.
 1.3 06-Dec-1999  simonb branches: 1.3.2;
Fix typo in 3max+ scc1 device declaration - console output on a serial
console 3max+ works again.
 1.2 01-Dec-1999  nisimura Replace old asic.c with one imported from a development branch.
 1.1 15-Oct-1998  nisimura branches: 1.1.2; 1.1.4;
file ioasic.c was initially added on branch nisimura-pmax-wscons.
 1.1.4.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.1.2.17 03-Feb-2000  nisimura Catch up to recent changes in main trunk.
 1.1.2.16 06-Dec-1999  nisimura Sync w/ recent changes in main trunk.
 1.1.2.15 30-Nov-1999  nisimura Synchronize them w/ recent changes in main trunk and sweep bozos I made.
 1.1.2.14 19-Nov-1999  nisimura Merge w/ recent changes in main trunk.
 1.1.2.13 26-Oct-1999  drochner remove ioasic_lance_ether_address(), it's in mi code now
 1.1.2.12 09-Sep-1999  nisimura Follow changes made in main trunk.
 1.1.2.11 13-Aug-1999  nisimura - Resolve code inconsistency.
 1.1.2.10 11-May-1999  nisimura - Catch up to recent main trunk changes.
- Make target platform files to have TURBOchannel slot definitions and
nuke tc_machdep.c.
- MIPS processor needs not to have tc_mb() before ZS register read ops.
 1.1.2.9 06-Apr-1999  nisimura - And more bus_space(9).
 1.1.2.8 05-Apr-1999  nisimura - Correct defined(DS_3MAXPLUS) -> defined(DEC_3MAXPLUS).
 1.1.2.7 31-Mar-1999  nisimura - Fix an error in ioasic_attach_devs() pointed by Matthias Drochner.
 1.1.2.6 30-Mar-1999  nisimura - Restore a local variable mistakenly omitted.
- sc_iswrite -> sc_ispullup (pull up from SCSI device).
 1.1.2.5 30-Mar-1999  nisimura - Track changes in main trunk and sweap codes.
- Make codes a bit descriptive that registers are aligned in 32bit boundary.
 1.1.2.4 29-Mar-1999  drochner use common dev/tc/ioasic code
 1.1.2.3 18-Mar-1999  nisimura - Arrange how IOASIC device interrupts are served.
- Fix a bozo I made in 3MIN TC processing.
- Change 3MAX interrupt processing like as ULTRIX does.
- Clean up IOASIC a bit.
 1.1.2.2 05-Mar-1999  nisimura - A bit improve make these bus_dma(9) friendy.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.3.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.14.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.14.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.15.126.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.120.1 28-Apr-2009  skrll Sync with HEAD.
 1.15.112.1 04-May-2009  yamt sync with head.
 1.19.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.19.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.4.1 12-Jun-2011  rmind sync with head
 1.21.16.1 18-May-2014  rmind sync with head
 1.21.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file ioasicreg.h was initially added on branch nisimura-pmax-wscons.
 1.1.2.3 03-Feb-2000  nisimura Catch up to recent changes in main trunk.
 1.1.2.2 05-Sep-1999  nisimura - Reduce clatters and cleanup.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.4 04-Mar-1999  nisimura - Nuke old leftover. This has no useful information and not used by any
other files.
 1.3 12-Jan-1998  thorpej branches: 1.3.4;
Update for changes to config.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 29-Jan-1996  jonathan Re-write Decstation turbochannel autoconfiguration code to use the machine-
independent TC support in sys/dev/tc/tc.c and sys/dev/tc/tcvar.h:
* Change the tc autoconfiguration tables to use a struct tc_attach_args
instead of the ad-hoc structure.
* Change all pmax device drivers to use a `struct confargs' that's
assignment-compatible with sys/dev/tc/tcvar.h `struct tcdev_attach_args'.
Devices that can be present on a TC or as ioctl asic/mainbus builtins
use the same `struct confargs'.
* Eliminate the `BUS_CVTADDR()' macros which the pmax port inherited from
an old, now-obsolete sys/arch/alpha snapshot.

* Update the comments and debugging code in interrupt handlers to
be consistent with the machine-independent TC support.

Other commits that overlap the same source files include: re-enabling
clock-tick interrupts earlier, and counting hardclock ticks for vmstat -i.
 1.3.4.5 03-Apr-1999  nisimura - This file is no longer used.
 1.3.4.4 18-Mar-1999  nisimura - Arrange how IOASIC device interrupts are served.
- Fix a bozo I made in 3MIN TC processing.
- Change 3MAX interrupt processing like as ULTRIX does.
- Clean up IOASIC a bit.
 1.3.4.3 05-Mar-1999  nisimura - A bit improve make these bus_dma(9) friendy.
 1.3.4.2 15-Oct-1998  nisimura - Mistakenly removed a necessary file.
 1.3.4.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.24 09-Jun-2015  matt #include either <sys/cpu.h> or <mips/cpuregs.h> as needed
 1.23 04-Jun-2011  tsutsui branches: 1.23.12; 1.23.30;
Split device_t/softc. Tested on GXemul.
 1.22 14-Mar-2009  dsl branches: 1.22.4; 1.22.6; 1.22.10;
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.21 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.20 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.19 03-Jan-2008  joerg branches: 1.19.10; 1.19.18; 1.19.24;
Timecounter and generic todr support for pmax. From Garret D'Amore.
 1.18 02-Oct-2002  thorpej branches: 1.18.22; 1.18.84; 1.18.90; 1.18.98;
Use CFATTACH_DECL().
 1.17 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.16 26-Sep-2002  thorpej No need to check that parent's cfdriver is ioasic_cd.
 1.15 08-Jan-2002  chs include sys/systm.h for strcmp() prototype.
 1.14 10-Jan-2000  simonb branches: 1.14.8; 1.14.12;
Remove unneeded include files (up to 16 in two files!).
 1.13 09-Jan-2000  ad RCS ID police.
 1.12 09-Jan-2000  simonb Use the badaddr() prototype in mips/include/cpu.h by including
<machine/cpu.h> in mips/include/mips_param.h. Remove duplicate
badaddr() prototypes from some pmax header files.
 1.11 09-Jan-2000  simonb The clean-up continues:
- Make local-only function and variables static.
- Move function prototypes and extern variable declarations to
header files.
- Delete unused variables.
There's still a handful of extern declaraions that should be fixed up.
 1.10 08-Jan-2000  simonb Function prototype cleanup.
 1.9 15-Nov-1999  nisimura Very large scale change to sweep obstracles to remove 3MAX IOASIC disguise.
- Rework ibus device configuration and interrupt handler assignment.
- Remove TC device exposure in 'mainbus.c'
- Squash 'ibus_{3100,5100}.c' into a file; it can not cope with 3max.
- 'struct confargs' -> 'struct mainbus_attach_args'
Now about to remove tc_slot_info[] and tc_enable_interrupt inherited from
4.4BSD.
 1.8 24-Apr-1999  simonb branches: 1.8.2; 1.8.8;
Nuke register and remove trailling white space.
 1.7 19-Apr-1998  jonathan branches: 1.7.4; 1.7.12;
oops, diffs to use dev/dec/mcclock_pad32 were in a different tree. Fix.
 1.6 19-Apr-1998  jonathan Copy alpha/tc/mcclock_ioasic.c (duplicated in pmax/tc/mcclock_ioasic.c)
into sys/dev/dec and split into a clockfns layer and a "middle" layer
for other DEC systems which use mcclocks with each onchip byte
register padded out to a 32-bit word.

Clone alpha/alpha/mcclock (also duplicated in pmax port) into
sys/dev/dec, and ifdef for default clockrates on pmax and alpha.

Use new machinery on pmax for ibus,ioasic attached mcclocks.
 1.5 01-Feb-1998  jonathan Use correct name ("ioasic") when checking parent bus.
 1.4 06-Aug-1997  jonathan branches: 1.4.4;
Garbage-collect Mach_clock_addr outside of machdep.c.
Use as mcclock_addr inside machdep.c, to disable clock interrupts
until the clock is autoconfigured.
 1.3 22-Jul-1997  jonathan branches: 1.3.2;
Move sys/dev/tc/mcclockvar.h -> sys/dev/dec/mcclockvar.h.
Update pmax clock code.
 1.2 22-Jul-1997  jonathan Include /sys/dev/dec/clockvar.h. Garbage-collect tc/clockvar.h.
 1.1 22-Jun-1997  jonathan Import mcclock from NetBSD/Alpha, mostly replacing the Sprite clock code.
interface. From Toru Nishimura <nisimura@itc.aist-nara.ac.jp>.

Partly merged back with Alpha code by Jonathan Stone. Needs more merging.
 1.3.2.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.4.2 08-May-1998  mycroft Revert pullup of 1.5, per discussion with mhitch.
 1.4.4.1 07-Feb-1998  mellon Pull up 1.5 (jonathan)
 1.7.12.1 21-Jun-1999  thorpej Sync w/ -current.
 1.7.4.1 19-Nov-1999  nisimura Merge w/ recent changes in main trunk.
 1.8.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.12.3 18-Oct-2002  nathanw Catch up to -current.
 1.14.12.2 28-Feb-2002  nathanw Catch up to -current.
 1.14.12.1 11-Jan-2002  nathanw More catchup.
 1.14.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.18.98.1 08-Jan-2008  bouyer Sync with HEAD
 1.18.90.1 18-Feb-2008  mjf Sync with HEAD.
 1.18.84.1 09-Jan-2008  matt sync with HEAD
 1.18.22.1 21-Jan-2008  yamt sync with head
 1.19.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.19.10.1 04-May-2009  yamt sync with head.
 1.22.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.22.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.22.4.1 12-Jun-2011  rmind sync with head
 1.23.30.1 22-Sep-2015  skrll Sync with HEAD
 1.23.12.1 03-Dec-2017  jdolecek update from HEAD
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file mfb.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 30-Oct-1998  nisimura - Migrate to MI TURBOchannel codes.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.95 29-Jul-2006  ad Remove RASTERCONSOLE support from the pmax port.
 1.94 23-Jul-2006  ad Use the LWP cached credentials where sane.
 1.93 14-May-2006  elad integrate kauth.
 1.92 29-Mar-2006  thorpej Use device_cfdata().
 1.91 28-Mar-2006  thorpej Use device_unit().
 1.90 08-Mar-2006  lukem branches: 1.90.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.89 14-Dec-2005  oster branches: 1.89.4; 1.89.6; 1.89.8; 1.89.10;
more proc->lwp changes. (untested, but at least the pmax kernel builds)
 1.88 11-Dec-2005  christos merge ktrace-lwp.
 1.87 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.

Also change this to use the proc argument instead of curproc.
 1.86 01-Jun-2005  drochner branches: 1.86.2;
quell cast-qual and shadow warnings
 1.85 26-Aug-2004  drochner kick out the ioasic offset check which happens in submatch() now
 1.84 25-Apr-2004  matt Constify the speedtab arrays
 1.83 28-Sep-2003  chs avoid hanging during autoconf if no mouse is attached. fixes PR 11111.
based on code from Christian Groessler.
 1.82 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.81 29-Jun-2003  fvdl branches: 1.81.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.80 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.79 21-Mar-2003  drochner make these compile after struct consdev change
 1.78 23-Feb-2003  simonb Fix a tyop in a comment.
 1.77 06-Jan-2003  wiz through, not throught.
 1.76 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.75 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.74 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.73 26-Sep-2002  thorpej No need to check that parent's cfdriver is ioasic_cd.
 1.72 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.71 17-Mar-2002  atatat branches: 1.71.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.70 07-Jul-2001  simonb branches: 1.70.2; 1.70.4; 1.70.8;
b{cmp,copy,zero} -> mem{cmp,cpy,set}
Also remove some unnecessary argument casts.
 1.69 02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.68 31-Mar-2001  enami Remove unnecessary test of tp->t_linesw against NULL; they are results
of confusion while correcting compilation error after t_line is
replaced with t_linesw.
 1.67 03-Nov-2000  simonb branches: 1.67.2;
Fix up line discipline change fallout.
 1.66 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.65 06-Mar-2000  thorpej - Implement cnbell() -- ring the console bell. The cn_bell entrypoint
is optional.
- Add cn_bell to statically allocated consdevs as appropriate.
 1.64 09-Feb-2000  nisimura - Add missing "opt_ddb.h" to dc.c and dtop.c (oh, boy)
- Nuke irrelevant "dcvar.h" and "tc.h" inclusion from dc.c
- Put '#if NRASTERCONSOLE > 0' around scc_lk201_cnattach().
 1.63 03-Feb-2000  nisimura - Massive change of console initialization. Have each model its own
consinit().
- Fix fbconnect() and relatives; 'struct fbinfo' is initialized only once,
making sure no extraneous console resolution message is emitted.
 1.62 18-Jan-2000  simonb Only prototype and include code for scc_kbd_init() and scc_mouse_init()
if NRASTERCONSOLE > 0. Fixes problem reported on port-pmax by Anders
Andersson.
 1.61 10-Jan-2000  simonb Remove unneeded include files (up to 16 in two files!).
 1.60 09-Jan-2000  simonb The clean-up continues:
- Make local-only function and variables static.
- Move function prototypes and extern variable declarations to
header files.
- Delete unused variables.
There's still a handful of extern declaraions that should be fixed up.
 1.59 08-Jan-2000  simonb Function prototype cleanup.
 1.58 07-Jan-2000  simonb Start of the "The Big Cleanup" - remove "ifdef alpha". This has
diverged enough from the alpha scc.c that keeping any pretence of
portability is not worth it.
 1.57 04-Jan-2000  simonb Ick - include pmioctl.h to get the pmEventQueue typedef needed for
qvssvar.h (needed for the mouseInit() prototype). This _will_ be
cleaned up soon!
 1.56 30-Dec-1999  simonb Include qvssvar.h to get mouseInput() prototype.
 1.55 23-Dec-1999  ad Rectify the jumbled naming scheme of routines in lk201.c. Function names
are now lower case and prefixed by 'lk_'. XXX lk_mouseinit() is bogus. It
belongs somewhere else.
 1.54 08-Dec-1999  simonb Don't use our own defines for SCCDEV or RCONSDEV - pull in
<pmax/pmax/cons.h> for these values.
 1.53 29-Nov-1999  ad - When kbdMapChar() was modified to support returning multi-character
mappings, it broke Ctrl-Space; fix that.
- Clean up lk201.c a little.
 1.52 17-Sep-1999  thorpej branches: 1.52.2; 1.52.8;
Centralize the declaration and clearing of `cold'.
 1.51 24-Apr-1999  simonb Nuke register and remove trailling white space.
 1.50 20-Apr-1999  mrg make this compile again with no rcons.
 1.49 12-Apr-1999  pk Quote "AS IS" as in the majority of Carnegy Mellon notices.
 1.48 06-Apr-1999  pk Fix a pasto in copyright text which has been procreating like rabbits..
 1.47 22-Mar-1999  ad branches: 1.47.2;
Added support for cursor keys, function keys and friends. kbdMapChar now
returns 'char *' to do this. Codes returned for the various keys match
what 'rcons' termcap entry expects.
 1.46 29-Jan-1999  kleink Remove an incorrect (but harmless) comment.
 1.45 28-Jan-1999  jonathan Jason Thorpe's changes from PR#6848. Makes 115200 bps work on some systems.
Reverse sense of #ifdef to disable 76.8k and 115.2k until we can verify
it works on all 8530 chips (similar changes didnt work on a /240 in 1996).
 1.44 15-Nov-1998  jonathan * make scc_tty_init() callable when very cold: call scc_coldparam() directly.
Use scc_tty_init() in scc_consinit(). Declare scc_consinit() in sccvar.h.

* Remove last vestige of special-case console handling in sccparam() code.

* Call scc_consinit() from findcons scc_serial() console-setup.
Dont PROM for scc serial console at all.
 1.43 29-Oct-1998  jonathan Use console_debugger() hook to enter DDB.
 1.42 07-Sep-1998  mhitch branches: 1.42.2;
scc_softCAR is a bit array, so set it accordingly for a serial console
port (instead of using the scc line number).
 1.41 04-Jul-1998  jonathan defopt DDB.
 1.40 30-Mar-1998  jonathan * Mouse reset blocks waiting for response for mouse.
Only initialize the mouse if we are using rcons as the console device.
 1.39 24-Mar-1998  jonathan Rewrite pmax console-probing code from scratch
as pmax/dev/findcons.c:
* Follow the same logic: look for the device the PROM is using.
* If it's a framebuffer and we don't have a driver for it, try other
* framebuffers in PROM search order.
* If no match found, warn user and fall over to serial console.
* if no serial console found, go back to PROM.

Rework tc/scc.c attach routine to give cleaner initialization semantics.
Prune out old 'braindamage' code.
 1.38 24-Mar-1998  jonathan Commit snapshot of pmax console rework as basepoint for 1.3.2 pullup:
* Do rcons output properly, using cn_tab->cn_dev which points
at rcons cdevsw entrypoints.

* The pmadx console code was using keyboard (serial) device
(major,minor) for raster consoles with special code in the keyboard
drivers to catch output intended for consoles, pull it off the device
queue, and print them via cnputc().
Ifdef out RCONS_BRAINDAMAGE.

* Other minor cleanup to pmax scc driver.
 1.37 22-Mar-1998  jonathan Clone lk20.h (keycode definitions) to /sys/dev/dec.
Update source pmax files accordingly.
cvs remove old pmax/dev/lk201.h.
 1.36 22-Mar-1998  jonathan Elimiate whitespace KNF botches due to emacs/X cut-and-paste.
 1.35 22-Mar-1998  jonathan oops, forgot more whitespace changs and alpha_mb() -> tc_mb().
 1.34 22-Mar-1998  jonathan Whitespace, cosmetic changes against alpha/tc/scc.c 1.40.
 1.33 22-Mar-1998  jonathan More tty dialin/dialout changes (t_wopen).
NB: dtop is a keyboard/mouse bus and doesn't support dialout.
 1.32 05-Feb-1998  jonathan Add local `extern' declaration of ioasic_cd, as in alpha/tc/scc.c.
Missed here after the removal of ioasic_cd decl from ioasicvar.h.
 1.31 12-Jan-1998  thorpej Update for changes to config.
 1.30 14-Nov-1997  jonathan Back out read-side DELAY() in previous revision added on advice of
tech-kern. Reported by Sean Davidson to cause erroneous doubling of
keyboard input on a 5000/50 under load.

Increasing the DELAY() from 2 to 30 doesn't help. Remove it for the
1.3 release. May cause problems with low-speed serial input, but
console keyboards work properly.
 1.29 08-Nov-1997  jonathan Workaround for port-pmax/4438 (pmax kernel glass-tty console code is broken)
until a proper fix is available:
Perpetuate the 4.4bsd design even further. Change keyboard-driver
open routines to check for an active raster console. If active, set the
keyboard struct tty's t_winsize from the rcons t_winsize on first open.
See pr 4438 for remaining problems and discussion of a complete fix.
 1.28 21-Jul-1997  jonathan branches: 1.28.6;
Kill __BROKEN_INDIRECT_CONFIG on pmax.
Based on a patch from Chris G. Demetriou, December 1996.
 1.27 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.26 07-Jul-1997  jonathan DDB for mips.
Add DDB interface to /sys/arch/mips/mips..
Rework heuristic stack traceback to work with DDB.
Add hooks to print exception log from DDB.
Add hooks from pmax console drivers: call Debugger()
after break from serial console, or 'DO' key from LK-xxx.
 1.25 22-Jun-1997  jonathan * Change Sprite MACH_xxx prefix to MIPS_xxx.

* Use standard mips terminology (xxx_KSEG0, xxx_KSEG1) instead of the
(more meaningful) Sprite names (xxx_CACHED, xxx_UNCACHED).
 1.24 16-Jun-1997  jonathan Garbage-collect <machine/locore.h>
 1.23 15-Jun-1997  mhitch DECstation MIPS3 support: wbflush() is cpu-dependent, need declaration from
machine/locore.h.
 1.22 25-May-1997  jonathan lint: add prototype for pmax serial-console inithook.
 1.21 15-May-1997  mellon Don't do rcons-specific things if no rcons pseudo-device was declared. Clean up probe-time printfs.
 1.20 15-May-1997  jonathan Merge in changes from Alpha scc driver with RCS log message:

> revision 1.33
> date: 1997/05/15 02:15:55; author: thorpej; state: Exp; lines: +8 -4
> - In sccmatch(), check any user-specified offset, allowing scc unit numbers
> to be nailed down. From Ken Hornstein <kenh@cmf.nrl.navy.mil>, PR #3626,
> slightly modified to allow wildcarded offsets.
> - Blow away the cf->cf_unit check in sccmatch(); it's bogus.

Also gc usused references to NSCC and #include "scc.h"
 1.19 26-Apr-1997  jonathan Stop ignoring DCD transitions on ioasic SCC serial lines.
From entropy@zippy.bernstein.com>.
 1.18 16-Oct-1996  jonathan Cleanups, and convergence with the Alpha driver:
* kill scc_tty[] and needs-count.
* Add usable-when-cold version of sccparam().
* Add pre-autconf() console initialization entrypoint.
* remove lint for gcc -Wall
* wbflush() -> tc_mb()
all but the last of which have been fed through cgd and committed to the
Alpha scc driver.
 1.17 13-Oct-1996  christos backout previous kprintf change
 1.16 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.15 07-Sep-1996  mhitch The MAXINE serial console is on scc0 (the only SCC on the MAXINE) instead
of scc1. Fix the check of which scc to initialize the console serial line
so that the MAXINE serial console will work.
 1.14 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.13 16-Jun-1996  mhitch Do tty_attach() for serial lines.
 1.12 29-May-1996  mhitch Fix autoconfiguration stuff to more closely match the alpha - primarily
the IOASIC attached devices. The DS3100 will now configure properly.
Fix the DS5000/25 IOASIC table entry for the RTC so the RTC interrupts
get enabled.
Fix up a moved include file.
 1.11 17-Mar-1996  jonathan branches: 1.11.4;
Additional fixes to complete the NetBSD/1.1B config changes:

change IOASIC cfdriver references from "ioasiccd" to "ioasic_cd"
 1.10 17-Mar-1996  thorpej New device attachment scheme:

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

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9 08-Feb-1996  jonathan Add serial-console support that works with `new-style' (config.new) autconf
code. Substantially the same code tested on a 5k/240. Should work on a
5k/1xx. Not tested on a MAXINE, where the single unit may break the
PROM-channel-number to driver-channel-number mapping.
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 31-Jan-1996  jonathan Resolve pmax and alpha IOCTL asic driver differences, pass 1:

Rename the ioctl asic register and slot macros from ASIC_<xxx> to
IOASIC_<xxx>, to be compatible with the machine-indpendent names in
sys/dev/tc/ioasicvar.h. The pmax code still uses
sys/arch/pmax/pmax/asic.h, as some of the registers and offsets
defined there are not yet defined in sys/dev/tc/ioasicvar.h.

Rename the ioctl asic base-address pointer from `asic_base' to `ioasic_base'.
 1.6 29-Jan-1996  jonathan Re-write Decstation turbochannel autoconfiguration code to use the machine-
independent TC support in sys/dev/tc/tc.c and sys/dev/tc/tcvar.h:
* Change the tc autoconfiguration tables to use a struct tc_attach_args
instead of the ad-hoc structure.
* Change all pmax device drivers to use a `struct confargs' that's
assignment-compatible with sys/dev/tc/tcvar.h `struct tcdev_attach_args'.
Devices that can be present on a TC or as ioctl asic/mainbus builtins
use the same `struct confargs'.
* Eliminate the `BUS_CVTADDR()' macros which the pmax port inherited from
an old, now-obsolete sys/arch/alpha snapshot.

* Update the comments and debugging code in interrupt handlers to
be consistent with the machine-independent TC support.

Other commits that overlap the same source files include: re-enabling
clock-tick interrupts earlier, and counting hardclock ticks for vmstat -i.
 1.5 29-Sep-1995  jonathan Add speed entries for 7200 and multiples.
Add as-yet-unused speed entries for a 1x SCC clock, up to 200 Kbits.

Remove old top-bit-means-delay code, since nothing seems to need it,
and it apparently partially broke lk-201 initialization anyway.
 1.4 25-Sep-1995  jonathan Fix SCC bug that broke getty on pmax SCC lines: if RAW and LITOUT were
both off, haracters with their top bit clear were interpreted as a delay.
This (strange) behaviour is still available if SCC_PARITY_MEANS_DELAY
is defined.
 1.3 25-Sep-1995  jonathan Force a delay after calling SCC_WRITE_DATA() to give the chip
registers time to settle. DELAY(2) is reportedly enough. Without the
delay, output characters are occasionally doubled.
 1.2 11-Sep-1995  jonathan Change pmax rcons and low-level serial drivers to support the
old-style pmax polled input for cn_getc(). Needed because the
input side of rcons is not initialized in time for GENERIC kernels
to use it to read a root/swap devicename from /dev/console.
 1.1 22-Aug-1995  jonathan Move the pmax scc driver from sys/arch/pmax/dev to sys/arch/pmax/tc,
as it's a driver for a device under a TC IOASIC. The Alpha port also
has its scc driver in tc/scc.c, and the pmax driver scc is nearly the same
as the Alpha.
 1.11.4.3 17-Sep-1996  thorpej Pull up changes between revision 1.14 and 1.15 by request from Jonathan
Stone.
 1.11.4.2 16-Jun-1996  mhitch Pull up from trunk: Do tty_attach() on serial lines.
 1.11.4.1 30-May-1996  mhitch Pulled autoconfig fixes up from the trunk
 1.28.6.6 01-Feb-1999  cgd pull up rev 1.45 from trunk (jonathan)
 1.28.6.5 24-Nov-1998  cgd patch to pull up the remainder of 1.39, 1.40, 1.42, 1.44. (jonathan)
 1.28.6.4 24-Nov-1998  cgd pull up a patch consisting of changes which give the effect of revision
1.38 and includes revisions 1.34-1.35, 1.37, 1.41. (jonathan)
 1.28.6.3 30-Oct-1998  cgd patch to allow kernels to compile even if no frame buffer or rconsole
devices are included. (code has changed substantially, and is already
fixed in -current.) (mrg)
 1.28.6.2 15-Nov-1997  mellon Pull rev 1.30 up from trunk (jonathan)
 1.28.6.1 09-Nov-1997  mellon Pull rev 1.29 up from trunk (jonathan)
 1.42.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.47.2.3 26-Sep-2000  he Pull up revision 1.50 (requested by simonb):
Make this compile again with no rcons.
 1.47.2.2 12-Apr-1999  pk branches: 1.47.2.2.2;
Pullup copyright text corrections.
 1.47.2.1 07-Apr-1999  pk Pull up from trunk: copyright text warts.
 1.47.2.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.52.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.52.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.52.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.52.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.67.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.67.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.70.8.10 07-Jan-2003  thorpej Sync with HEAD.
 1.70.8.9 11-Nov-2002  nathanw Catch up to -current
 1.70.8.8 18-Oct-2002  nathanw Catch up to -current.
 1.70.8.7 17-Sep-2002  nathanw Catch up to -current.
 1.70.8.6 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.70.8.5 03-Jul-2002  nathanw Whitespace.
 1.70.8.4 24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.70.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.70.8.2 15-Dec-2001  gmcgarry lwp'ify
 1.70.8.1 07-Jul-2001  gmcgarry file scc.c was added on branch nathanw_sa on 2001-12-15 07:11:00 +0000
 1.70.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.70.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.70.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.70.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.71.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.81.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.81.2.5 13-Jan-2005  skrll Adapt to branch
 1.81.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.81.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.81.2.2 03-Sep-2004  skrll Sync with HEAD
 1.81.2.1 03-Aug-2004  skrll Sync with HEAD
 1.86.2.2 30-Dec-2006  yamt sync with head.
 1.86.2.1 21-Jun-2006  yamt sync with head.
 1.89.10.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.89.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.89.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.89.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.89.8.4 11-Aug-2006  yamt sync with head
 1.89.8.3 24-May-2006  yamt sync with head.
 1.89.8.2 01-Apr-2006  yamt sync with head.
 1.89.8.1 13-Mar-2006  yamt sync with head.
 1.89.6.2 01-Jun-2006  kardel Sync with head.
 1.89.6.1 22-Apr-2006  simonb Sync with head.
 1.89.4.1 09-Sep-2006  rpaulo sync with head
 1.90.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.90.2.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.8 29-Jul-2006  ad Remove RASTERCONSOLE support from the pmax port.
 1.7 03-Feb-2000  nisimura branches: 1.7.44; 1.7.58; 1.7.62;
- Massive change of console initialization. Have each model its own
consinit().
- Fix fbconnect() and relatives; 'struct fbinfo' is initialized only once,
making sure no extraneous console resolution message is emitted.
 1.6 09-Jan-2000  ad - Protect against multiple includes.
- Spacing.
 1.5 09-Jan-2000  simonb The clean-up continues:
- Make local-only function and variables static.
- Move function prototypes and extern variable declarations to
header files.
- Delete unused variables.
There's still a handful of extern declaraions that should be fixed up.
 1.4 08-Jan-2000  simonb Function prototype cleanup.
 1.3 15-Nov-1998  jonathan branches: 1.3.10;
* make scc_tty_init() callable when very cold: call scc_coldparam() directly.
Use scc_tty_init() in scc_consinit(). Declare scc_consinit() in sccvar.h.

* Remove last vestige of special-case console handling in sccparam() code.

* Call scc_consinit() from findcons scc_serial() console-setup.
Dont PROM for scc serial console at all.
 1.2 19-May-1996  jonathan branches: 1.2.16; 1.2.20;
Add port number encodings.
 1.1 04-Aug-1995  jonathan Add header files with prototyped declarations of the serial-chip hooks
used by old-style pmax console configuration.
 1.2.20.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.2.16.1 24-Nov-1998  cgd pull up rev 1.3 from trunk (jonathan)
 1.3.10.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.62.1 11-Aug-2006  yamt sync with head
 1.7.58.1 09-Sep-2006  rpaulo sync with head
 1.7.44.1 30-Dec-2006  yamt sync with head.
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file sfb.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 30-Oct-1998  nisimura - Migrate to MI TURBOchannel codes.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.15 30-Mar-1998  jonathan Remove ancient non-MI pmax/tc/tc.c code.
 1.14 22-Jun-1997  jonathan * Change Sprite MACH_xxx prefix to MIPS_xxx.

* Use standard mips terminology (xxx_KSEG0, xxx_KSEG1) instead of the
(more meaningful) Sprite names (xxx_CACHED, xxx_UNCACHED).
 1.13 16-Jun-1997  jonathan Remove the machConst.h (wrapper for Sprite-derived source), and all
#includes <machine/machConst.h> uses.
Other header files now include <mips/cpuregs.h> where necessary.
 1.12 13-Oct-1996  christos backout previous kprintf change
 1.11 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.10 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.9 02-Feb-1996  mycroft Fix #includes.
 1.8 29-Jan-1996  jonathan Re-write Decstation turbochannel autoconfiguration code to use the machine-
independent TC support in sys/dev/tc/tc.c and sys/dev/tc/tcvar.h:
* Change the tc autoconfiguration tables to use a struct tc_attach_args
instead of the ad-hoc structure.
* Change all pmax device drivers to use a `struct confargs' that's
assignment-compatible with sys/dev/tc/tcvar.h `struct tcdev_attach_args'.
Devices that can be present on a TC or as ioctl asic/mainbus builtins
use the same `struct confargs'.
* Eliminate the `BUS_CVTADDR()' macros which the pmax port inherited from
an old, now-obsolete sys/arch/alpha snapshot.

* Update the comments and debugging code in interrupt handlers to
be consistent with the machine-independent TC support.

Other commits that overlap the same source files include: re-enabling
clock-tick interrupts earlier, and counting hardclock ticks for vmstat -i.
 1.7 03-Jan-1996  jonathan arch/pmax/tc -> dev/tc, pass 1:
Eliminate pmax/tc/tc.h. Use dev/tc headers for pmax port. Change pmax TC
autoconfig tables to use structs (mostly) compatible with dev/tc/tcvar.h.
Move TC console search to tc.c.
 1.6 28-Dec-1995  jonathan Add untested, partial support for Decsystem 5100 (mipsfair).
 1.5 09-Oct-1995  jonathan Fix bugs in the turbochannel config table for MAXINE (personal decstation).
 1.4 25-Sep-1995  jonathan Update pmax kernel to compile with -Werror:
Update TURBOChannel and ioasic interrupt-establish routines to pass on their
device argument as a "void *", since that's how all the pmax interrupt handlers
are declared.
 1.3 12-Sep-1995  jonathan Change the signature of interrupt-handlers to take a void *
(a pointer to the softc) and return an int (indicating spurious
interrupts or other conditions.)
 1.2 10-Aug-1995  jonathan Remove extraneous debugging printf()s when running on processors
this code has been tested on.
 1.1 07-Aug-1995  jonathan New-style config (config.new) autoconfiguration code for Decstation
turhsturbochannel machines. Lifted wholesale from cgd's Alpha
turbochannel code, with changes that reflect the slightly different
bus topology and `slot' numbering on Decstations.
 1.3 03-Jan-1996  jonathan Remove pmax/tc/tc.h; use dev/tc/tcvar.h instead.
 1.2 28-Dec-1995  jonathan Use machine-independent TurboChannel include files from dev/tc.
Add machine-dependent TC definitions in pmax/include/tc_machdep.h.
 1.1 07-Aug-1995  jonathan New-style config (config.new) autoconfiguration code for Decstation
turhsturbochannel machines. Lifted wholesale from cgd's Alpha
turbochannel code, with changes that reflect the slightly different
bus topology and `slot' numbering on Decstations.
 1.7 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.6 29-Feb-2000  nisimura branches: 1.6.2;
- Have SYS_DEV_xxx device cookie symbols to select and install proper
interrupt handlers into intrtab[] array, rather than the idea of devices
in 'psuedo' TURBOchannel slots.
- Nuke symbols for psuedo TC slots.
- Abandon never/unlikely used intr_disestablish()s.
 1.5 09-Jan-2000  ad RCS ID police.
 1.4 01-Dec-1999  nisimura Arrange comment descriptions for internals of TC DECstations.
 1.3 15-Nov-1999  nisimura Very large scale change to sweep obstracles to remove 3MAX IOASIC disguise.
- Rework ibus device configuration and interrupt handler assignment.
- Remove TC device exposure in 'mainbus.c'
- Squash 'ibus_{3100,5100}.c' into a file; it can not cope with 3max.
- 'struct confargs' -> 'struct mainbus_attach_args'
Now about to remove tc_slot_info[] and tc_enable_interrupt inherited from
4.4BSD.
 1.2 12-Mar-1999  nisimura branches: 1.2.8; 1.2.14;
- Nuke old leftover bogocities, round one; externs for non-existent
functions, less-intuitive #define's in inappropriate header files.
 1.1 19-Apr-1998  jonathan branches: 1.1.4;
Rework pmax turbochannel config, as suggested by Jason Thorpe.
Also make TC framebuffer-console search table-driven.

Does not yet include "tcasic" layer; there's no such hardware on DECstations
and nothing for a tcasic layer to do.
 1.1.4.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.2.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.5 29-Feb-2000  nisimura branches: 1.5.2;
- Have SYS_DEV_xxx device cookie symbols to select and install proper
interrupt handlers into intrtab[] array, rather than the idea of devices
in 'psuedo' TURBOchannel slots.
- Nuke symbols for psuedo TC slots.
- Abandon never/unlikely used intr_disestablish()s.
 1.4 01-Dec-1999  nisimura Arrange comment descriptions for internals of TC DECstations.
 1.3 15-Nov-1999  nisimura Very large scale change to sweep obstracles to remove 3MAX IOASIC disguise.
- Rework ibus device configuration and interrupt handler assignment.
- Remove TC device exposure in 'mainbus.c'
- Squash 'ibus_{3100,5100}.c' into a file; it can not cope with 3max.
- 'struct confargs' -> 'struct mainbus_attach_args'
Now about to remove tc_slot_info[] and tc_enable_interrupt inherited from
4.4BSD.
 1.2 24-Apr-1999  simonb branches: 1.2.2; 1.2.8;
Nuke register and remove trailling white space.
 1.1 19-Apr-1998  jonathan branches: 1.1.4; 1.1.12;
Rework pmax turbochannel config, as suggested by Jason Thorpe.
Also make TC framebuffer-console search table-driven.

Does not yet include "tcasic" layer; there's no such hardware on DECstations
and nothing for a tcasic layer to do.
 1.1.12.1 21-Jun-1999  thorpej Sync w/ -current.
 1.1.4.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.2.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.5 29-Feb-2000  nisimura branches: 1.5.2;
- Have SYS_DEV_xxx device cookie symbols to select and install proper
interrupt handlers into intrtab[] array, rather than the idea of devices
in 'psuedo' TURBOchannel slots.
- Nuke symbols for psuedo TC slots.
- Abandon never/unlikely used intr_disestablish()s.
 1.4 01-Dec-1999  nisimura Fix wrong figures in comments.
 1.3 01-Dec-1999  nisimura Arrange comment descriptions for internals of TC DECstations.
 1.2 15-Nov-1999  nisimura Very large scale change to sweep obstracles to remove 3MAX IOASIC disguise.
- Rework ibus device configuration and interrupt handler assignment.
- Remove TC device exposure in 'mainbus.c'
- Squash 'ibus_{3100,5100}.c' into a file; it can not cope with 3max.
- 'struct confargs' -> 'struct mainbus_attach_args'
Now about to remove tc_slot_info[] and tc_enable_interrupt inherited from
4.4BSD.
 1.1 19-Apr-1998  jonathan branches: 1.1.4; 1.1.16; 1.1.22;
Rework pmax turbochannel config, as suggested by Jason Thorpe.
Also make TC framebuffer-console search table-driven.

Does not yet include "tcasic" layer; there's no such hardware on DECstations
and nothing for a tcasic layer to do.
 1.1.22.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.5.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file tc_machdep.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 11-May-1999  nisimura - Catch up to recent main trunk changes.
- Make target platform files to have TURBOchannel slot definitions and
nuke tc_machdep.c.
- MIPS processor needs not to have tc_mb() before ZS register read ops.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 02-Jan-2005  mhitch Fix long-standing error in interrupt index for Maxine built-in graphics
card. It was using the same index as the Ethernet interface, but didn't
cause any problems until the new xcfb.c driver installed an interrupt
handler. Ethernet interrupts went to the xcfb.c interrupt handler and
hung machine.
 1.6 04-Jun-2000  cgd branches: 1.6.28;
Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.5 29-Feb-2000  nisimura branches: 1.5.2;
- Have SYS_DEV_xxx device cookie symbols to select and install proper
interrupt handlers into intrtab[] array, rather than the idea of devices
in 'psuedo' TURBOchannel slots.
- Nuke symbols for psuedo TC slots.
- Abandon never/unlikely used intr_disestablish()s.
 1.4 01-Dec-1999  nisimura Fix wrong figures in comments.
 1.3 01-Dec-1999  nisimura Arrange comment descriptions for internals of TC DECstations.
 1.2 15-Nov-1999  nisimura Very large scale change to sweep obstracles to remove 3MAX IOASIC disguise.
- Rework ibus device configuration and interrupt handler assignment.
- Remove TC device exposure in 'mainbus.c'
- Squash 'ibus_{3100,5100}.c' into a file; it can not cope with 3max.
- 'struct confargs' -> 'struct mainbus_attach_args'
Now about to remove tc_slot_info[] and tc_enable_interrupt inherited from
4.4BSD.
 1.1 19-Apr-1998  jonathan branches: 1.1.4; 1.1.16; 1.1.22;
Rework pmax turbochannel config, as suggested by Jason Thorpe.
Also make TC framebuffer-console search table-driven.

Does not yet include "tcasic" layer; there's no such hardware on DECstations
and nothing for a tcasic layer to do.
 1.1.22.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.5.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.28.1 17-Jan-2005  skrll Sync with HEAD.
 1.27 15-Nov-1999  nisimura Very large scale change to sweep obstracles to remove 3MAX IOASIC disguise.
- Rework ibus device configuration and interrupt handler assignment.
- Remove TC device exposure in 'mainbus.c'
- Squash 'ibus_{3100,5100}.c' into a file; it can not cope with 3max.
- 'struct confargs' -> 'struct mainbus_attach_args'
Now about to remove tc_slot_info[] and tc_enable_interrupt inherited from
4.4BSD.
 1.26 02-Aug-1999  mrg branches: 1.26.2; 1.26.8;
if there are no FB devices, tc_consprobeslot() fails always.
 1.25 25-Jul-1999  ad Change the way fb devices are configured and attached:
- 'struct fbsoftc' created, which points to a 'struct fbinfo'
- 'struct fbinfo' for each device is allocated with fballoc()

This means:
- Console device doesn't get different 'struct fbinfo' at attach
- Console device doesn't get initialized twice
- Color rcons now works
- The current Xserver MUST BE REBUILT.
 1.24 24-Jun-1999  ad Remove a few entries for nonexistant TC graphics boards.
 1.23 24-Apr-1999  simonb Nuke register and remove trailling white space.
 1.22 13-Apr-1999  ad Added console initalization glue to allow `px' device to function as the
console.
 1.21 22-May-1998  thorpej branches: 1.21.4; 1.21.12;
Provide bus_space and bus_dma data structures to the TurboChannel bus.
 1.20 20-Apr-1998  jonathan * Fix typo in ROM name of mfb (PMAG-AA)
* Use TC_ROM_LLEN instead of constant, add space for sentinel.
* Don't print fb dimensions at console-probe time.
 1.19 19-Apr-1998  jonathan Rework pmax turbochannel config, as suggested by Jason Thorpe.
Also make TC framebuffer-console search table-driven.

Does not yet include "tcasic" layer; there's no such hardware on DECstations
and nothing for a tcasic layer to do.
 1.18 30-Mar-1998  mrg <pmax/pmax/trap.h> has been obsoleted...
 1.17 25-Mar-1998  jonathan * Use new defopt model-specific options and opt files.
Replace all DS5000_* and DS3100 ifdefs with ifdefs on DEC_ options.
* Use MI declarations, not pmax-specific, in model-specific init
that uses baseboard (ioasic) registers.
* Further cleanup of machdep.c. Clock-tick still needs more thought.
* Use 'ibus' names for 3100 baseboard devices in MI code.
 1.16 25-Mar-1998  jonathan Split sys/arch/pmaxpmax/{machdep.c,trap.c} as suggested by Jason Thorpe:
* add "Platform" support inpmax/pmax/sysconf.c and pmax/include/sysconf.h
(based on Alpha cpuconf.[ch], with a namechange to avoid clashes with
support for models of MIPS cpus. They differ more than Alphas).

* For each supported model of DECstation, create a separate file
with the support for that model. Use model codenames, since
support is really baseboard-specific and CPU daugherboards can change.
Move code from machdep.c and pmax_trap.c,
Add sysconf (nee "cpuconf") support.

* Rename model-specific functions to match sysconf names.

* Clean up autoconf.c. Use platform callbacks.

* Retire pmax_trap.c.

Leaves I/O bus configuration and console configuration untouched.
 1.15 08-Nov-1997  jonathan Delete ancient warning printf() from when this code hadn't been
tested on 3MIN or MAXINE motherboards. Add __KERNEL_RSID while we're here.
 1.14 24-Sep-1997  mhitch branches: 1.14.2;
Add an entry for the bus_space_tag in the TC attach argument tables. Fixes
PR #4100.
 1.13 22-Jun-1997  jonathan branches: 1.13.4;
* Change Sprite MACH_xxx prefix to MIPS_xxx.

* Use standard mips terminology (xxx_KSEG0, xxx_KSEG1) instead of the
(more meaningful) Sprite names (xxx_CACHED, xxx_UNCACHED).
 1.12 16-Jun-1997  jonathan Remove the machConst.h (wrapper for Sprite-derived source), and all
#includes <machine/machConst.h> uses.
Other header files now include <mips/cpuregs.h> where necessary.
 1.11 15-Jun-1997  mhitch Use TC_SPEED* for turbochannel speed values (keeps me from being confused
more than I am).
 1.10 24-May-1997  jonathan Lint: include prototypes for TurboChannel framebuffer console-init functions.
include prototype for printf() and panic() and delint calls.
 1.9 13-Oct-1996  christos backout previous kprintf change
 1.8 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.7 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.6 27-Aug-1996  jonathan * Add initialization of colourmap array when using mfb as a console.
* Add interrupt handler for 3MIN, where we cannot disable TC slot interrupts.
* Change mfbinit() signature to match other (pmax) TC framebuffer init
routines.
* TODO after 1.2: add {cfb,mbf,sfb}var.h. Declare init functions there.
 1.5 21-Aug-1996  jonathan Fix sfbinit() call to pass four arguments, not three, matching the
signature in sfb.c, which was changed to support multiple sfb devices.
 1.4 17-Jun-1996  jonathan Fix typo, colon instead of semicolon when DS_5000_25 is not defined.
 1.3 15-Jun-1996  jonathan Fix for PR #1828 and partial fix for PR #2548:
* Eliminate the #ifdef DS5000 and kernel config option DS5000 altogether.
option DS5000 was a hangover from 4.4bsd/pmax; it's never been clear
if it means "support for DS5000/200" or "support for any TC machine".
This implictly fixes pr 1828.

* Use the "tc.h" and NTC generated by config for a "tc? at mainbus"
where appropriate, intsead of #ifdef DS5000.


* Canonicalize the spelling of kernel options that enable support
for particular models. Use
DS5000_25 for the Personal Decstation aka MAXINE aka KN02-ca
DS5000_100 for the 5000/1xx series aka KMIN aka KN02-ba
DS5000_200 for the 5000/200 aka 3MAX aka KN02
DS500_240 for the 5000/240 aka 3MAXPLUS aka KN03

and change DS_5000_xxx to DS5000_xxx everywhere.

* Wrap the interrupt handlers for each model in the appropriate #ifdef,
instead of wrapping all of them with "#ifdef DS5000".

* Wrap the TC autoconfig for each model in the appropriate #ifdef.
 1.2 29-May-1996  mhitch Fix autoconfiguration stuff to more closely match the alpha - primarily
the IOASIC attached devices. The DS3100 will now configure properly.
Fix the DS5000/25 IOASIC table entry for the RTC so the RTC interrupts
get enabled.
Fix up a moved include file.
 1.1 27-Feb-1996  jonathan branches: 1.1.4;
TurboChannel bus auto-configuration tables, and TurboChannel pre-autoconfig
probe functions for console framebuffers, rewritten to work with the
machine-independent TC support in sys/dev/tc.
 1.1.4.4 09-Sep-1996  thorpej Pull up diffs between revs 1.4 and 1.6, by request from Jonathan Stone.
Log messages:

revision 1.5
date: 1996/08/21 14:02:48; author: jonathan; state: Exp; lines: +2 -2
Fix sfbinit() call to pass four arguments, not three, matching the
signature in sfb.c, which was changed to support multiple sfb devices.

revision 1.6
date: 1996/08/27 02:32:48; author: jonathan; state: Exp; lines: +2 -2
* Add initialization of colourmap array when using mfb as a console.
* Add interrupt handler for 3MIN, where we cannot disable TC slot interrupts.
* Change mfbinit() signature to match other (pmax) TC framebuffer init
routines.
* TODO after 1.2: add {cfb,mbf,sfb}var.h. Declare init functions there.
 1.1.4.3 17-Jun-1996  jonathan Pull up fix from trunk:
>Fix typo, colon instead of semicolon when DS_5000_25 is not defined.
 1.1.4.2 15-Jun-1996  jonathan Pull up mainbranch fix for kernels configured for a sigle model of DECstation
 1.1.4.1 30-May-1996  mhitch Pulled autoconfig fixes up from the trunk
 1.13.4.1 29-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.2.1 09-Nov-1997  mellon Pull rev 1.15 up from trunk (jonathan)
 1.21.12.3 02-Aug-1999  thorpej Update from trunk.
 1.21.12.2 01-Jul-1999  thorpej Sync w/ -current.
 1.21.12.1 21-Jun-1999  thorpej Sync w/ -current.
 1.21.4.5 14-Mar-2000  nisimura This file has gone long time ago.
 1.21.4.4 21-May-1999  nisimura - typo in a panic message.
 1.21.4.3 15-Mar-1999  nisimura - Sync. w/ main trunk.
- Remove unnecessary includes.
 1.21.4.2 15-Mar-1999  nisimura - Adjustment for 'machine/conf.h' removal.
- A bit cleanup of handcrafted TC device config.
 1.21.4.1 15-Oct-1998  nisimura - codes to probe TURBOchannel framebuffer with NWSCONS driver.
 1.26.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.26.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.33 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.32 12-Dec-2016  flxd branches: 1.32.8;
Clean-up (remove redundant declarations, concentrate checks).
 1.31 16-Nov-2016  macallan switch to common MIPS bus_space and bus_dma
tested by flxd@
 1.30 09-Jun-2015  matt branches: 1.30.2;
#include either <sys/cpu.h> or <mips/cpuregs.h> as needed
 1.29 13-Oct-2012  tsutsui branches: 1.29.14;
struct device * -> device_t, use device_xname() (from chs@)
 1.28 09-Jul-2011  matt branches: 1.28.2; 1.28.12;
Cleanu <machine/*> includes
 1.27 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.26 20-Feb-2011  matt branches: 1.26.2;
Merge forward from matt-nb5-mips64.
New interrupt code.
mips64 support for DS5000/260.
 1.25 16-Mar-2009  dsl branches: 1.25.4; 1.25.6; 1.25.8;
ANSIfy functions with function-pointer arguments
 1.24 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.23 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.22 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.21 26-May-2008  nisimura branches: 1.21.6; 1.21.12; 1.21.16;
- assign 2 clause TNF license to the files cited as my ownership.
- abandon and remove my copyright notice from the three files were
copied in order to adapt HW I don't have; pvr.c, pm.c and stic.c
 1.20 31-Jul-2006  ad branches: 1.20.58; 1.20.60; 1.20.62; 1.20.64;
tcfb_cnattach(): pass the slot address through TC_PHYS_TO_UNCACHED() in
case the PROM hands us a physical or KSEG0 address.
 1.19 29-Jul-2006  ad Remove RASTERCONSOLE support from the pmax port.
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.8;
merge ktrace-lwp.
 1.17 13-Dec-2003  ad branches: 1.17.16;
Add drivers for the desktop bus, DC-7085 and pm display. Make it possible to
select between rcons or wscons at compile time. Ok'ed by simonb.
 1.16 02-Oct-2002  thorpej branches: 1.16.6;
Use CFATTACH_DECL().
 1.15 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.14 19-Sep-2001  thorpej branches: 1.14.4; 1.14.10;
Adjust to use <dev/sun/fbio.h>
 1.13 17-Feb-2001  tsutsui branches: 1.13.2; 1.13.4;
white space nits.
 1.12 06-Jun-2000  nisimura branches: 1.12.4;
Add a missing parenthesis and correct the function return value declaration.
 1.11 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.10 29-Feb-2000  nisimura branches: 1.10.2;
Cleanup warning comment which is now irrelevant. Reorder codes.
 1.9 29-Feb-2000  nisimura - Have SYS_DEV_xxx device cookie symbols to select and install proper
interrupt handlers into intrtab[] array, rather than the idea of devices
in 'psuedo' TURBOchannel slots.
- Nuke symbols for psuedo TC slots.
- Abandon never/unlikely used intr_disestablish()s.
 1.8 03-Feb-2000  nisimura - Massive change of console initialization. Have each model its own
consinit().
- Fix fbconnect() and relatives; 'struct fbinfo' is initialized only once,
making sure no extraneous console resolution message is emitted.
 1.7 14-Jan-2000  simonb Redo interrupt establishment, based in part on work on the
[nisimura-pmax-wscons] branch and suggestions from Toru Nisimura:
- Remove bogus tc_slot_info[] name for interrupt handling array
and replace with simplified struct intrhand intrtab[] array.
- Add intr_establish() and intr_disestablish() function pointers
to struct platform and initialise this in each model-specific
initialisation, and remove global tc_enable_interrupt function
pointer.
- Remove model-specific function declarations from ibus/ibusvar.h.
This is functionally identical to the current scheme, and doesn't
yet try to commonise interrupt establishment by bus type as the
[nisimura-pmax-wscons] branch does.

Also, move cpuspeed variable from autoconf.c to machdep.c
 1.6 09-Jan-2000  ad RCS ID police.
 1.5 09-Jan-2000  simonb The clean-up continues:
- Make local-only function and variables static.
- Move function prototypes and extern variable declarations to
header files.
- Delete unused variables.
There's still a handful of extern declaraions that should be fixed up.
 1.4 08-Jan-2000  simonb Function prototype cleanup.
 1.3 17-Nov-1999  nisimura branches: 1.3.2; 1.3.4;
Consistent panic messages when erroneous kernel configurations are found.
 1.2 16-Nov-1999  nisimura Fix a typo in PX TC device identification case analysis.
 1.1 15-Nov-1999  nisimura Very large scale change to sweep obstracles to remove 3MAX IOASIC disguise.
- Rework ibus device configuration and interrupt handler assignment.
- Remove TC device exposure in 'mainbus.c'
- Squash 'ibus_{3100,5100}.c' into a file; it can not cope with 3max.
- 'struct confargs' -> 'struct mainbus_attach_args'
Now about to remove tc_slot_info[] and tc_enable_interrupt inherited from
4.4BSD.
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.2.2 19-Nov-1999  nisimura Merge w/ recent changes in main trunk.
 1.3.2.1 17-Nov-1999  nisimura file tcbus.c was added on branch nisimura-pmax-wscons on 1999-11-19 11:06:31 +0000
 1.10.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.12.4.3 12-Mar-2001  bouyer Sync with HEAD.
 1.12.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.4.1 06-Jun-2000  bouyer file tcbus.c was added on branch thorpej_scsipi on 2000-11-20 20:20:52 +0000
 1.13.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.13.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.14.10.1 15-Mar-2002  ad Changes necessary for wscons on NetBSD/pmax. All device support is here,
just needs further testing.
 1.14.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.14.4.1 19-Sep-2001  nathanw file tcbus.c was added on branch nathanw_sa on 2002-10-18 02:39:28 +0000
 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 30-Dec-2006  yamt sync with head.
 1.18.8.1 11-Aug-2006  yamt sync with head
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.20.64.2 24-Jun-2008  wrstuden Hand-merge files that didn't merge right in recent sync w/ current.
 1.20.64.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.20.62.1 04-May-2009  yamt sync with head.
 1.20.60.1 04-Jun-2008  yamt sync with head
 1.20.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.21.16.1 29-Dec-2010  matt Use a promcall wrapper function to call the prom. For non O32 systems
this will save and restore the callee saved registers since the 32-bit
prom probably won't be saving all 64bits.
 1.21.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.21.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.25.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.25.4.2 12-Jun-2011  rmind sync with head
 1.25.4.1 05-Mar-2011  rmind sync with head
 1.26.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.28.12.2 03-Dec-2017  jdolecek update from HEAD
 1.28.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.28.2.1 30-Oct-2012  yamt sync with head
 1.29.14.4 28-Aug-2017  skrll Sync with HEAD
 1.29.14.3 05-Feb-2017  skrll Sync with HEAD
 1.29.14.2 05-Dec-2016  skrll Sync with HEAD
 1.29.14.1 22-Sep-2015  skrll Sync with HEAD
 1.30.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.32.8.1 01-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #65):
share/man/man4/tc.4: revision 1.7
sys/arch/alpha/tc/tcasic.c: revision 1.46
sys/arch/pmax/tc/tcbus.c: revision 1.33
sys/arch/vax/conf/files.vax: revision 1.121
sys/arch/vax/vsa/tc_vsbus.c: revision 1.8, 1.9
sys/dev/tc/tc.c: revision 1.55
sys/dev/tc/tcvar.h: revision 1.27
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
--
whitespace
--
Add vax.
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file tfb.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 30-Oct-1998  nisimura - Migrate to MI TURBOchannel codes.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file xcfb.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 30-Oct-1998  nisimura - Migrate to MI TURBOchannel codes.
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file zs_ioasic.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.11 14-Mar-2000  nisimura Synchronize with the recent improvements of main trunk. Main trunk
filled gaps toward this, indeed.
 1.1.2.10 03-Feb-2000  nisimura Manipulate ZS csr/data registers in short quantity as ULTRIX does.
 1.1.2.9 19-Nov-1999  nisimura Merge w/ recent changes in main trunk.
 1.1.2.8 29-Oct-1999  drochner make console keyboard support dependent on NZSKBD
 1.1.2.7 26-Oct-1999  drochner apply the change of 1.1.2.3 again - it got lost
 1.1.2.6 09-Aug-1999  drochner make zs_ioasic_lk201_cnattach() return an errno (and match its prototype)
 1.1.2.5 04-Aug-1999  nisimura - Catch up to recent introduction of wsmux psuedo-device.
- Make sure to assign BRG value early in boot.
- Make ZELMWU comfortable to build.
 1.1.2.4 11-May-1999  nisimura - Catch up to recent main trunk changes.
- Make target platform files to have TURBOchannel slot definitions and
nuke tc_machdep.c.
- MIPS processor needs not to have tc_mb() before ZS register read ops.
 1.1.2.3 26-Jan-1999  drochner Debugger() -> console_debugger() to honour the ddb_fromconsole sysctl
 1.1.2.2 19-Oct-1998  drochner slight cleanup, add support for keyboard attachment
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.1 15-Oct-1998  nisimura branches: 1.1.2;
file zs_ioasicvar.h was initially added on branch nisimura-pmax-wscons.
 1.1.2.3 19-Nov-1999  nisimura Merge w/ recent changes in main trunk.
 1.1.2.2 19-Oct-1998  drochner slight cleanup, add support for keyboard attachment
 1.1.2.1 15-Oct-1998  nisimura - new asc driver combined with MI NCR53C9x and MI SCSI.
- import zs_ioasic.? from NetBSD/alpha.
- NWSCONS drivers for various DECstations.
- squash tc_xxx.c into single tc_machdep.c
 1.1 19-Oct-1998  drochner branches: 1.1.2;
file zskbd.c was initially added on branch nisimura-pmax-wscons.
 1.1.2.2 22-Oct-1998  drochner use common zskbd code in dev/dec
 1.1.2.1 19-Oct-1998  drochner LK201 driver backend for Z8530. Still somehow hackish.
Derived from sun keyboard driver, partly by Takuya Koumoto.
 1.1 19-Oct-1998  drochner branches: 1.1.2;
file zskbdvar.h was initially added on branch nisimura-pmax-wscons.
 1.1.2.1 19-Oct-1998  drochner LK201 driver backend for Z8530. Still somehow hackish.
Derived from sun keyboard driver, partly by Takuya Koumoto.

RSS XML Feed