Home | History | Annotate | only in /src/sys/arch/i386/isa
History log of /src/sys/arch/i386/isa
RevisionDateAuthorComments
 1.2 29-Jan-1995  mycroft Clean up deleted files.
 1.1 03-Nov-1994  mycroft Commit this, though it really does need work.
 1.4 23-Nov-1994  mycroft Clean up deleted files.
 1.3 27-Oct-1994  cgd new RCS ID format.
 1.2 22-May-1993  cgd branches: 1.2.4;
add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.2.4.1 14-Sep-1993  mycroft New i386 code.
 1.4 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.3 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.2 25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.1 21-Feb-1995  brezak Driver for ad1848 codec
 1.2 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.1 21-Feb-1995  brezak Driver for ad1848 codec
 1.5 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.4 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.3 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.2 25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.1 21-Feb-1995  brezak Driver for ad1848 codec
 1.42 29-Jan-1995  mycroft Clean up deleted files.
 1.41 13-Jan-1995  mycroft Simplify some sanity checks.
 1.40 03-Jan-1995  mycroft Add interrupt sharing types.
 1.39 28-Dec-1994  mycroft Numerous changes. Many bugs fixed, better autoconfig, a few new features.
 1.38 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.37 04-Nov-1994  mycroft No longer needs icu.h.
 1.36 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.35 03-Nov-1994  mycroft Update to match autoconfig code.
 1.34 27-Oct-1994  cgd new RCS ID format.
 1.33 27-Jul-1994  mycroft Fix the DMA setup.
 1.32 27-Jul-1994  mycroft Enable IRQ probing.
 1.31 13-Jun-1994  mycroft branches: 1.31.2;
Fix unimportant typos.
 1.30 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.29 03-May-1994  mycroft Really fix the Buslogic/DTC problem.
 1.28 29-Apr-1994  cgd change timeout/untimeout/wakeup/sleep/tsleep args to void *
 1.27 21-Apr-1994  mycroft Clean up the TUNE_1542 code.
 1.26 08-Apr-1994  mycroft Fix return values from some interrupt routines.
 1.25 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.24 29-Mar-1994  mycroft New SCSI system, based on Julian's more recent work.
 1.23 25-Mar-1994  mycroft Put controller target in scsi_switch.
 1.22 12-Mar-1994  mycroft Fix bug in last change.
 1.21 12-Mar-1994  mycroft Update to match config(8).
 1.20 10-Mar-1994  mycroft Updates to match config(8).
 1.19 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.18 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.17 03-Jan-1994  mycroft Use KERNBASE, not 0xfe000000.
 1.16 20-Dec-1993  davidb Fixed bug where with two or more SCSI controllers of the same type, you
could not have devices at the same ID on each bus.
This patch not directly applicable to magnum branch, which is using Julian's
new SCSI code.
 1.15 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.14 23-Aug-1993  cgd branches: 1.14.2;
changes from 0.9-ALPHA2 to 0.9-BETA
 1.13 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.12 06-Jul-1993  deraadt branches: 1.12.2;
clean up code for timeout/untimeout/wakeup prototypes.
 1.11 14-Jun-1993  andrew Reduced bus-on time from the default of 11ms -> 9ms, to prevent floppy from
becoming data-starved during simultaneous fd & scsi activity.
 1.10 09-Jun-1993  deraadt minor silliness related to two or more controllers
 1.9 22-May-1993  cgd add rcsids to everything and clean up headers
 1.8 04-May-1993  deraadt support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
 1.7 19-Apr-1993  mycroft Fix subtle word-size error.
 1.6 15-Apr-1993  deraadt ioconf changes, see previous cvs's that dumped core
 1.5 15-Apr-1993  glass NDDB made a re-appearance....
 1.4 12-Apr-1993  deraadt new scsi subsystem.
changes also in config/mkioconf.c & sys/scsi/*
 1.3 10-Apr-1993  glass fixed to be compliant, subservient, and to take advantage of the newly
hacked config(8)
 1.2 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.1 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.12.2.2 13-Aug-1993  cgd from chmr@edvz.tu-graz.ac.at (Christoph Robitschko):
it seems that the bustek needs a little more time to settle down after a
reset command than the adaptecs. Up to PK-0.2.3 there was a printf there
that did the job quite well.
 1.12.2.1 29-Jul-1993  deraadt reliability fudge for dealing with drives that do scsi resets very slowly
(or so it seems)
 1.14.2.11 25-Mar-1994  mycroft Stylistic changes.
 1.14.2.10 02-Feb-1994  mycroft Change some structure names.
 1.14.2.9 02-Feb-1994  mycroft Change second arg of probe to self.
 1.14.2.8 02-Feb-1994  mycroft Add another board ID for 1542CF.
 1.14.2.7 29-Nov-1993  mycroft Add some bzero()s before it bites me.
 1.14.2.6 28-Nov-1993  mycroft Remove some unused variables.
 1.14.2.5 28-Nov-1993  mycroft No significant changes.
 1.14.2.4 27-Nov-1993  mycroft Correct argment type to aha_adapter_info().
 1.14.2.3 24-Nov-1993  mycroft Final tweaks to get it all working.
 1.14.2.2 24-Nov-1993  mycroft Still under construction...
 1.14.2.1 24-Nov-1993  mycroft Under construction...
 1.31.2.2 28-Jul-1994  cgd from trunk.
 1.31.2.1 27-Jul-1994  cgd from trunk, per mycroft
 1.39 03-Nov-1994  mycroft Clean up deleted files.
 1.38 27-Oct-1994  cgd new RCS ID format.
 1.37 22-Aug-1994  mycroft Disable EISA reset, for now.
 1.36 07-Aug-1994  mycroft Remove diagnostic.
 1.35 28-Jul-1994  mycroft Redo some of the EISA config stuff.
 1.34 27-Jul-1994  mycroft Normalize.
 1.33 27-Jul-1994  mycroft Enable IRQ probing.
 1.32 05-May-1994  mycroft branches: 1.32.2;
Remove now-bogus cast.
 1.31 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.30 29-Apr-1994  cgd change timeout/untimeout/wakeup/sleep/tsleep args to void *
 1.29 20-Apr-1994  mycroft Change structure member names.
 1.28 08-Apr-1994  mycroft Fix return values from some interrupt routines.
 1.27 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.26 05-Apr-1994  mycroft Increase ahb_send_mbox timeout.
 1.25 02-Apr-1994  mycroft Minor code cleanup.
 1.24 30-Mar-1994  mycroft Print out board revision info.
 1.23 29-Mar-1994  mycroft New SCSI system, based on Julian's more recent work.
 1.22 25-Mar-1994  mycroft Put controller target in scsi_switch.
 1.21 12-Mar-1994  mycroft Fix bug in last change.
 1.20 12-Mar-1994  mycroft Update to match config(8).
 1.19 10-Mar-1994  mycroft Updates to match config(8).
 1.18 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.17 03-Jan-1994  mycroft Use KERNBASE, not 0xfe000000.
 1.16 20-Dec-1993  davidb Fixed bug where with two or more SCSI controllers of the same type, you
could not have devices at the same ID on each bus.
This patch not directly applicable to magnum branch, which is using Julian's
new SCSI code.
 1.15 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.14 28-Jul-1993  cgd branches: 1.14.2;
incorporate changes from 0-9-base to 0-9-ALPHA
 1.13 17-Jul-1993  mycroft branches: 1.13.2;
Make these files GCC 2 happy.
 1.12 09-Jun-1993  deraadt minor silliness related to two or more controllers
 1.11 22-May-1993  cgd add rcsids to everything and clean up headers
 1.10 04-May-1993  deraadt support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
 1.9 02-May-1993  deraadt fixed silly typo.
 1.8 26-Apr-1993  cgd id for scsi_attach must be an int.
 1.7 15-Apr-1993  deraadt ioconf changes, see previous cvs's that dumped core
 1.6 15-Apr-1993  glass NDDB made a re-appearance....
 1.5 12-Apr-1993  deraadt new scsi subsystem.
changes also in config/mkioconf.c & sys/scsi/*
 1.4 10-Apr-1993  glass fixed to be compliant, subservient, and to take advantage of the newly
hacked config(8)
 1.3 09-Apr-1993  cgd have probe return size of io space on successful return, rather
than simply 1.
 1.2 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.1 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.13.2.1 27-Jul-1993  deraadt two extra splx()'s noticed by <hd@world.std.com> go away.
 1.14.2.7 25-Mar-1994  mycroft Stylistic changes.
 1.14.2.6 02-Feb-1994  mycroft Change some structure names.
 1.14.2.5 02-Feb-1994  mycroft Change second arg of probe to self.
 1.14.2.4 02-Feb-1994  mycroft Fix potential bogon if card is in last slot.
 1.14.2.3 29-Nov-1993  mycroft Add some bzero()s before it bites me.
 1.14.2.2 29-Nov-1993  mycroft Converted. Needs testing.
 1.14.2.1 25-Nov-1993  mycroft New code from Julian, not yet converted.
 1.32.2.4 22-Aug-1994  mycroft update from trunk
 1.32.2.3 07-Aug-1994  mycroft update from trunk
 1.32.2.2 28-Jul-1994  cgd from trunk.
 1.32.2.1 27-Jul-1994  cgd from trunk, per mycroft
 1.42 10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.41 11-Jul-2016  msaitoh branches: 1.41.18;
KNF. No functional change.
 1.40 18-Oct-2014  snj branches: 1.40.2;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.39 01-Jul-2011  dyoung branches: 1.39.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.38 28-Feb-2010  snj Fight the ever-increasing size of src checkouts by spelling "useful"
without an extra l.
 1.37 05-May-2009  cegger branches: 1.37.2;
device_t/softc split
 1.36 04-May-2009  cegger struct device * -> device_t
No functional changes intended.
 1.35 28-Apr-2008  martin branches: 1.35.14;
Remove clause 3 and 4 from TNF licenses
 1.34 04-Apr-2008  cegger branches: 1.34.2; 1.34.4;
use aprint_*_dev and device_xname
OK joerg
 1.33 07-Mar-2007  thorpej branches: 1.33.40;
TRUE -> true, FALSE -> false
 1.32 16-Nov-2006  christos branches: 1.32.4;
__unused removal on arguments; approved by core.
 1.31 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.30 28-Mar-2006  thorpej branches: 1.30.8; 1.30.10;
Use device_unit().
 1.29 19-Feb-2006  thorpej branches: 1.29.2; 1.29.4; 1.29.6;
Use aprint_*().
 1.28 26-Dec-2005  perry branches: 1.28.2; 1.28.4; 1.28.6;
u_intN_t -> uintN_t
 1.27 11-Dec-2005  christos merge ktrace-lwp.
 1.26 03-Feb-2005  perry branches: 1.26.6;
de-__P, partially ANSIfy
 1.25 14-Sep-2004  drochner branches: 1.25.4; 1.25.6;
adapt to ISA "unknown address" namespace separation
 1.24 04-Dec-2003  keihan NetBSD.ORG -> NetBSD.org

Now all "NetBSD.ORG" are gone from src/sys.
 1.23 03-May-2003  wiz branches: 1.23.2;
DMA, not dma nor Dma.
 1.22 20-Apr-2003  fvdl Initialize name and dma tag.
 1.21 20-Apr-2003  fvdl Call ahc_softc_init in attach function.
 1.20 19-Apr-2003  fvdl Adapt to new backend. Needs testing.
 1.19 02-Oct-2002  thorpej Tidy up CFATTACH_DECL() formatting.
 1.18 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.17 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.16 07-Jan-2002  thorpej branches: 1.16.2;
Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.15 15-Nov-2001  lukem add RCSID
 1.14 24-Sep-2000  jdolecek branches: 1.14.2; 1.14.6;
use new generic bootverbose instead of local definition
 1.13 15-Mar-2000  fvdl Update ISA/VL frontend for new ahc driver (done by Noriyuki Soda).
 1.12 22-Mar-1998  drochner branches: 1.12.14;
switch to non-BROKEN_INDIRECT_CONFIG
 1.11 16-Mar-1998  leo Use bus-dma functions. Also make sure that dma will not use the bounce
buffers (Tested & requested by Noriyuki Soda).
 1.10 09-Mar-1998  mikel print proper invalid IRQ, from Heiko Rupp in PR 5128
 1.9 20-Oct-1997  thorpej Don't panic if we fail to remap i/o or mem space in the attach function.
Instead, print a diagnostic and return. (Some drivers do this already.)

Also, normalize the diagnostic message, and fix some places where the
printfs were getting ugly.
 1.8 04-Oct-1997  thorpej Fix some license confusion.
 1.7 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.6 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.5 21-Oct-1996  thorpej branches: 1.5.8; 1.5.10;
New bus.h implementation/interface:
- No more distinction between i/o-mapped and memory-mapped
devices. It's all "bus space" now, and space tags
differentiate the space with finer grain than the
bus chipset tag.
- Add memory barrier methods.
- Implement space alloc/free methods.
- Implement region read/write methods (like memcpy to/from
bus space).
This interface provides a better abstraction for dealing with
machine-independent chipset drivers.
 1.4 13-Oct-1996  christos backout previous kprintf changes
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 28-Aug-1996  thorpej Quiet the ahc driver down a bit by only enabling some of less useful
messages #if defined(DEBUG) in the NetBSD case.
 1.1 05-Aug-1996  soda branches: 1.1.2;
AHA-284x VL front-end to ahc driver by Jason Thorpe.
This is tested under both netbsd-1-2 branch and main trunk.
 1.1.2.2 05-Aug-1996  soda AHA-284x VL front-end to ahc driver by Jason Thorpe.
This is tested under both netbsd-1-2 branch and main trunk.
 1.1.2.1 05-Aug-1996  soda file ahc_isa.c was added on branch netbsd-1-2 on 1996-08-05 21:14:30 +0000
 1.5.10.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.12.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.6.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.14.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.14.2.2 11-Jan-2002  nathanw More catchup.
 1.14.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.16.2.2 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.16.2.1 07-Jan-2002  thorpej file ahc_isa.c was added on branch sommerfeld_i386mp_1 on 2002-01-07 21:47:02 +0000
 1.23.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.23.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.23.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.6.1 12-Feb-2005  yamt sync with head.
 1.25.4.1 29-Apr-2005  kent sync with -current
 1.26.6.2 03-Sep-2007  yamt sync with head.
 1.26.6.1 21-Jun-2006  yamt sync with head.
 1.28.6.1 22-Apr-2006  simonb Sync with head.
 1.28.4.1 09-Sep-2006  rpaulo sync with head
 1.28.2.1 01-Mar-2006  yamt sync with head.
 1.29.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.29.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.29.2.1 01-Apr-2006  yamt sync with head.
 1.30.10.2 10-Dec-2006  yamt sync with head.
 1.30.10.1 22-Oct-2006  yamt sync with head
 1.30.8.1 18-Nov-2006  ad Sync with head.
 1.32.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.33.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.34.4.3 11-Mar-2010  yamt sync with head
 1.34.4.2 16-May-2009  yamt sync with head
 1.34.4.1 16-May-2008  yamt sync with head.
 1.34.2.1 18-May-2008  yamt sync with head.
 1.35.14.4 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.35.14.3 24-Oct-2010  jym Sync with HEAD
 1.35.14.2 01-Nov-2009  jym Sync with HEAD.
 1.35.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.39.12.1 03-Dec-2017  jdolecek update from HEAD
 1.40.2.1 05-Oct-2016  skrll Sync with HEAD
 1.41.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.27 29-Jan-1995  mycroft Clean up deleted files.
 1.26 13-Jan-1995  mycroft Simplify some sanity checks.
 1.25 07-Jan-1995  mycroft Don't print line numbers in most of the diagnostics.
 1.24 07-Jan-1995  mycroft Cosmetic changes, to look more like the new esp.c will.
 1.23 03-Jan-1995  mycroft Add interrupt sharing types.
 1.22 31-Dec-1994  mycroft Fix non-serious typo.
 1.21 28-Dec-1994  mycroft Numerous changes. Many bugs fixed, better autoconfig, a few new features.
 1.20 30-Nov-1994  mycroft Don't stall the queue on CHECK SENSE if we get a reselect while selecting.
 1.19 29-Nov-1994  mycroft Fix a null pointer reference.
 1.18 29-Nov-1994  mycroft Add an assertion mechanism to check for more abnormal conditions.
 1.17 29-Nov-1994  mycroft For consistency...
 1.16 29-Nov-1994  mycroft Handle BUS FREE phase a little differently, to get better error detection. Other
cleanup.
 1.15 29-Nov-1994  mycroft Disable debugging breakpoints by default.
 1.14 29-Nov-1994  mycroft * Redo most of the message and phase state machines. Multiple pending
message outs should now work correctly (including retransmissions).
Multiple messages ins should be more efficient. Missing REQ after
reselection phase should now (correctly) cause a wait with ENREQINIT
set.

* Abstract out the reselection out sequence, and use it directly to
get sense info. (This is somewhat faster than the generic done/sched
sequence.)

* If there are no ACBs available, wait interruptibly for one.

* Leave the interrupt registers alone during message in/out; just
watch for phase change. Don't (incorrectly) reenable interrupts
during data in/out; defer that to aicintr().

* Handle command pointer per SCSI 2 spec.

* Other minor coding improvements.
 1.13 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.12 04-Nov-1994  mycroft No longer needs icu.h.
 1.11 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.10 03-Nov-1994  mycroft Update to match autoconfig code.
 1.9 27-Oct-1994  cgd new RCS ID format.
 1.8 17-Oct-1994  cgd change, requested by Jarle Greipsland
 1.7 08-Aug-1994  mycroft Minor update.
 1.6 07-Aug-1994  mycroft Avoid using DFIFOHF, which doesn't exist on 6260 chips. Turn off
AIC_USE_DWORDS by default.
 1.5 05-May-1994  cgd branches: 1.5.2;
lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.4 03-May-1994  mycroft Fix argument to aic_sched_msgout() is several places, and condense some code.
 1.3 29-Apr-1994  cgd change timeout/untimeout/wakeup/sleep/tsleep args to void *
 1.2 26-Apr-1994  mycroft Style nits.
 1.1 26-Apr-1994  mycroft Add Adaptec 6360 driver from Jarle Greipsland, with some changes by me.
 1.5.2.3 17-Oct-1994  cgd from trunk
 1.5.2.2 08-Aug-1994  mycroft update from trunk
 1.5.2.1 07-Aug-1994  mycroft update from trunk
 1.4 06-Jun-1993  mycroft Clean up deleted files.
 1.3 22-May-1993  cgd add rcsids to everything and clean up headers
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3 06-Jun-1993  mycroft Clean up deleted files.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.17 29-Jan-1995  mycroft Clean up deleted files.
 1.16 04-Jan-1995  mycroft Fix oversight in previous.
 1.15 03-Jan-1995  mycroft \
These files have been 99% rewritten from the original ast driver. Add an
appropriate copyright notice.
 1.14 03-Jan-1995  mycroft Add interrupt sharing types.
 1.13 02-Jan-1995  mycroft Use direct config for subdevices.
 1.12 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.11 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.10 07-Nov-1994  mycroft Update for new autoconfig.
 1.9 27-Oct-1994  cgd new RCS ID format.
 1.8 14-Aug-1994  mycroft Slight optimization, and don't go bonkers if one of the sub-devices is not
configured.
 1.7 07-Apr-1994  mycroft branches: 1.7.2;
Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.6 29-Mar-1994  mycroft astprobe(): Set ia_iosize.
 1.5 29-Mar-1994  mycroft Updates for new autoconfig.
 1.4 23-Mar-1994  cgd copyright foo
 1.3 23-Mar-1994  mycroft Don't poll more than 4 ports.
 1.2 23-Mar-1994  mycroft Some stylistic cleanup, and a very minor speedup.
 1.1 23-Mar-1994  cgd add AST-style serial multiport support, from Roland McGrath
<roland@frob.com>. Needs light clean by Mr. I386, but mostly
OK.
 1.7.2.1 14-Aug-1994  mycroft update from trunk
 1.4 29-Jan-1995  mycroft Clean up deleted files.
 1.3 04-Jan-1995  mycroft Fix oversight in previous.
 1.2 03-Jan-1995  mycroft \
These files have been 99% rewritten from the original ast driver. Add an
appropriate copyright notice.
 1.1 03-Jan-1995  mycroft Add a multiplexer for BOCA serial boards.
 1.4 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.3 27-Oct-1994  cgd new RCS ID format.
 1.2 24-Apr-1994  mycroft Don't need isa.h.
 1.1 09-Jan-1994  cgd LBL /dev/audio and soundblaster drivers, as ported by brad@fcr.com.
both should work with both old- and new-config i386 trees.
Some notes:
bsd_audio.c has dependencies on the soundblaster. This should
be fixed, so that it can be used for the PC speaker
(when its driver has been modified), as well.
sb.c needs some cleanup, and will have sections trimmed, eventually
(when new config becomse standard for i386). additionally,
the SBPro support needs some cleanup.
 1.3 17-Apr-1995  cgd useless, as of the new sound drivers.
 1.2 27-Oct-1994  cgd new RCS ID format.
 1.1 09-Jan-1994  cgd LBL /dev/audio and soundblaster drivers, as ported by brad@fcr.com.
both should work with both old- and new-config i386 trees.
Some notes:
bsd_audio.c has dependencies on the soundblaster. This should
be fixed, so that it can be used for the PC speaker
(when its driver has been modified), as well.
sb.c needs some cleanup, and will have sections trimmed, eventually
(when new config becomse standard for i386). additionally,
the SBPro support needs some cleanup.
 1.39 29-Jan-1995  mycroft Clean up deleted files.
 1.38 13-Jan-1995  mycroft Simplify some sanity checks.
 1.37 03-Jan-1995  mycroft Add interrupt sharing types.
 1.36 28-Dec-1994  mycroft Numerous changes. Many bugs fixed, better autoconfig, a few new features.
 1.35 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.34 04-Nov-1994  mycroft No longer needs icu.h.
 1.33 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.32 03-Nov-1994  mycroft Update to match autoconfig code.
 1.31 27-Oct-1994  cgd new RCS ID format.
 1.30 31-Jul-1994  mycroft Add some missing newlines in the attach messages.
 1.29 27-Jul-1994  mycroft Enable IRQ probing, and fix the DMA setup.
 1.28 03-Jun-1994  mycroft branches: 1.28.2;
Allow the probe to succeed again on 445S cards.
 1.27 24-May-1994  mycroft Check the bus type, and don't attempt to enable the round-robin algorithm
on early boards. As suggested by Atsushi Murai.
 1.26 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.25 29-Apr-1994  cgd change timeout/untimeout/wakeup/sleep/tsleep args to void *
 1.24 08-Apr-1994  mycroft Fix return values from some interrupt routines.
 1.23 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.22 06-Apr-1994  mycroft Remove spurious arg to printf(), per JT Conklin.
 1.21 29-Mar-1994  mycroft New SCSI system, based on Julian's more recent work.
 1.20 25-Mar-1994  mycroft Put controller target in scsi_switch.
 1.19 12-Mar-1994  mycroft Fix bug in last change.
 1.18 12-Mar-1994  mycroft Update to match config(8).
 1.17 10-Mar-1994  mycroft Updates to match config(8).
 1.16 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.15 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.14 01-Mar-1994  deraadt Driver should now work on new & old bt742/747/445 versions of the
BusTech cards. Fixes from Michael VanLoon <michaelv@iastate.edu>
KNF'd too.
 1.13 05-Jan-1994  deraadt small cleanup
 1.12 03-Jan-1994  mycroft Use KERNBASE, not 0xfe000000.
 1.11 20-Dec-1993  davidb Fixed bug where with two or more SCSI controllers of the same type, you
could not have devices at the same ID on each bus.
This patch not directly applicable to magnum branch, which is using Julian's
new SCSI code.
 1.10 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.9 07-Dec-1993  deraadt __386BSD__ -> __NetBSD__
 1.8 17-Jul-1993  deraadt branches: 1.8.4;
scsi_switch had wrong entries for these controllers...
 1.7 09-Jun-1993  deraadt minor silliness related to two or more controllers
 1.6 22-May-1993  cgd add rcsids to everything and clean up headers
 1.5 04-May-1993  deraadt support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
 1.4 15-Apr-1993  deraadt ioconf changes, see previous cvs's that dumped core
 1.3 12-Apr-1993  deraadt new scsi subsystem.
changes also in config/mkioconf.c & sys/scsi/*
 1.2 10-Apr-1993  glass fixed to be compliant, subservient, and to take advantage of the newly
hacked config(8)
 1.1 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.8.4.9 25-Mar-1994  mycroft Stylistic changes.
 1.8.4.8 02-Feb-1994  mycroft Change some structure names.
 1.8.4.7 02-Feb-1994  mycroft Change second arg of probe to self.
 1.8.4.6 29-Nov-1993  mycroft Add some bzero()s before it bites me.
 1.8.4.5 29-Nov-1993  mycroft Change format of attach message, as suggested by Julian.
 1.8.4.4 28-Nov-1993  mycroft Remove some unused variables.
 1.8.4.3 28-Nov-1993  mycroft Remove redundant decl.
 1.8.4.2 28-Nov-1993  mycroft Should work.
 1.8.4.1 25-Nov-1993  mycroft New code from Julian, not yet converted.
 1.28.2.2 01-Aug-1994  cgd From trunk.
 1.28.2.1 28-Jul-1994  cgd from trunk.
 1.102 04-Sep-2006  perry switch to a common clock.c
 1.101 04-Sep-2006  perry The i386 and amd64 versions are now identical. They'll get moved to
arch/x86 soon. Ultimately the functionality should be split
into different files for i8254, mc146818 and pcppi.
 1.100 04-Sep-2006  perry The amd64 and i386 versions of this file both got some variables
renamed to avoid shadowing. The amd64 names are a bit easier to
understand, so switch to them here.
 1.99 04-Sep-2006  perry Fix static function declarations.
 1.98 03-Sep-2006  perry remove the "clkintr_pending" stuff.

The variable was used but never set. Kardel says it is a remnant from
the freebsd code he ported, and may be safely discarded.
 1.97 03-Sep-2006  perry add an #ifndef __x86_64__ around #include "mca.h"
reduces diffs with the amd64 port
We'll soon merge these entirely
 1.96 03-Sep-2006  perry fix declaration of tickle_tc() -> tickle_tc(void)
 1.95 03-Sep-2006  christos make this compile again (thanks gdamore)
 1.94 03-Sep-2006  gdamore Convert i386 to use common TODR code. Not tested, but Christos says he'll
test it for me right now. :-)
 1.93 09-Jul-2006  christos Fix a bit of debugging code (from Arnaud Lacombe)
 1.92 07-Jun-2006  kardel branches: 1.92.2;
convert to timecounters (from branch simonb-timecounters)
 1.91 11-Mar-2006  kleink branches: 1.91.4;
Provide BCD<->binary conversion in libkern and turn <dev/clock_subr.h>'s
FROMBCD()/TOBCD() macros into wrappers around it, resulting in both
smaller code footprint and elimination of possible issues due to
multiple evaluation of macro arguments.

Suggested by Simon Burge and Anders Gavare on tech-kern.
 1.90 19-Feb-2006  thorpej branches: 1.90.2; 1.90.4;
Use aprint_*().
 1.89 24-Dec-2005  perry branches: 1.89.2; 1.89.4; 1.89.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.88 11-Dec-2005  christos merge ktrace-lwp.
 1.87 29-May-2005  christos branches: 1.87.2;
avoid variable shadowing.
 1.86 03-Feb-2005  perry move a prototype back inside an #ifdef -- my GENERIC kernels worked
fine with it in the new place, but compiling another kernel found that
it wasn't a good idea.
 1.85 03-Feb-2005  perry de-__P, partially ANSIfy
 1.84 03-Jul-2004  yamt branches: 1.84.4; 1.84.6;
i8254_initclocks: fix an integer overflow problem in rev.1.83.
a patch provided by FUKAUMI Naoki. PR/26152.
 1.83 01-Jul-2004  yamt {i8254,lapic}_initclocks: try to be more precise using fixtick.
 1.82 24-Apr-2004  minoura Move misplaced debug code.
This should make it compile w/o pcppi and w/ CLOCKDEBUG.
 1.81 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.80 23-Jun-2003  martin branches: 1.80.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.79 26-Feb-2003  fvdl Adapt for i386/x86 change.
 1.78 05-Feb-2003  nakayama Share i386/tsc_microtime.c with alpha and sparc64 as kern_microtime.c.
(approved by martin)
 1.77 10-Dec-2002  perry Change from a hardcoded sanity check date that has to be updated by
hand every few years to code that uses the automatically generated
time value from config_time.h
Fixes an ancient XXX in the code.
 1.76 03-Dec-2002  kenh The day-of-week register in the MC146818 has the value 1-7, but
clock_secs_to_ymdhms() returns dt_wday with a range of 0-6. Make sure
the DOW register has the correct range.
 1.75 22-Nov-2002  fvdl New interrupt code. The basic idea behind it is to hide the differences
in interrupt controllers in struct pic, and try to keep as much
common code as possible. At the lowest (asm) level, this is done
with CPP macros.

The main structure is now struct intrsource, describing an established
interrupt line, of any kind (soft/hard local apic/legacy apic/IO apic).
For quick masking, there may be a maximum of 32 sources per CPU.
Sources can be assigned to any CPU in the MP case, though currently they
all go to the boot CPU.
 1.74 02-Oct-2002  thorpej Tidy up CFATTACH_DECL() formatting.
 1.73 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.72 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.71 13-Aug-2002  thorpej No need for two copies of the i8253 register definitions. Remove the
i386-specific copy, and adjust its users to add in the timer i/o base
as necessary.
 1.70 01-Jan-2002  perry branches: 1.70.8;
boost up default times for when clocks are insane (as we do every few years.)
 1.69 15-Nov-2001  lukem add RCSID
 1.68 03-Nov-2001  jdolecek Don't print any warning if the time base was not provided (i.e. given as zero).
Fixes port-i386/1413 by David Carrel.
 1.67 23-Apr-2001  jdolecek branches: 1.67.2; 1.67.6;
Move the inclusion of 'mca.h' so that it doesn't depend on pcppi. The clock
interrupts are properly reset on PS/2 now.

Handle the slighly different PS/2 CMOS layout and get/set century
byte as appropriate. The check for valid CMOS CRC checksum is not implemented
yet; I don't currently know algorithm they use.

The info about PS/2 CMOS was taken from the Padgett Peterson's
x86/MSDOS Interrupt List, release 60.
 1.66 12-Mar-2001  wiz Fix typo in comment reported by Yuji Yamano in kern/12391.
 1.65 11-May-2000  jdolecek branches: 1.65.6;
Add i386-specific part of MicroChannel Architecture bus support, as
found in some older IBM PS/2 machines.

This code is based upon work by Scott D. Telford, with some minor bits
in arch/i386/mca/mca_machdep.c taken from FreeBSD.

XXX this is still very experimental and development version; use at your
XXX own risk
 1.64 03-May-2000  mycroft Adjust asm statement for newer GCCs.
 1.63 02-Feb-2000  minoura branches: 1.63.2;
Take care of National Geode (Cyrix MediaGX) built-in clock module bug.
Patch supplied by INOUE Yoshinari <pf5y-inue@asahi-net.or.jp>, kern/8654.
 1.62 06-Nov-1999  enami branches: 1.62.2;
- Export initrtclock().
- Call it from apm_resume().

This fixes timer problem on some laptop after hybernation (PR#4808).
Reviewd by: fvdl@netbsd.org
 1.61 29-Mar-1999  mycroft branches: 1.61.2; 1.61.8; 1.61.10; 1.61.12;
Recalculate delaytab[]. We need to round up in case we were on the edge of a
tick and the hardware mysteriously responds fast enough that the delay ends
up being 1 tick short. An unlikely event, but just in case anything actually
relies on this...
 1.60 29-Mar-1999  mycroft delay(): For small values of n, use a fixed lookup table. Also use
rtclock_tval as the limit, since this is what we actually programmed the chip
for.
 1.59 13-Feb-1999  christos noise reduction.
 1.58 07-Feb-1999  drochner use mi data conversion functions, simplify inittodr() and resettodr()
 1.57 07-Feb-1999  drochner put all century related code into an own function clock_expandyear(),
touch the CMOS century byte only if the CMOS contents passes a
checksum test which qualifies it as "known compliant"
 1.56 18-Jan-1999  drochner Be more cautious about writing to the CMOS century byte. Update it only
if it contained a "19" before. There are machines (in particular PS/2
descendants) which have a checksum at this place.
Introduce a patchable kernel variable "rtc_update_century" to modify
the behaviour: 1="always update" (for testing and if one wants to set
the clock back) or -1="never touch".
 1.55 13-Oct-1998  perry Fix a stupid bug -- an if that was supposed to be nested but wasn't.
 1.54 12-Oct-1998  perry 1) Change "dectohexdec" and "hexdectodec" to "bintobcd" and
"bcdtobin". The old names were bogus.
2) Make the code grok the NVRAM's century field. This code is, to say
the least, poorly tested. It should make NetBSD play nicer with other
OSes that care about the century field, however.
 1.53 06-Oct-1998  perry Fix a potential Y2K bug on some clock chips: we were loading invalid
BCD into the year field of the RTC in years > 1999. It seems to have
worked just fine on my old broken down test machine, but apparently
some others actually get hurt. Suckage. We now make sure that we load
valid BCD.

Other ports should check for variations on this theme.
 1.52 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.51 05-Aug-1998  perry bzero->memset, bcopy->memcpy
 1.50 05-Aug-1998  perry Fix a problem first noticed by a user with a screwed up real time
clock past the End of Time.

If time_t is 32 bits, then the "End of Time" is Jan 18/19 2038
(depending on time zone).

This code copes with RTC's past the end of time if time_t is an int32
or less. It just forces the time back to 2037. This will let users
with screwed up clocks to at least boot and function long enough to
set their clocks to something sane.

This kludge is conditioned on an
if (sizeof(time_t) <= sizeof(int32_t))
which will automatically optimize the code out once we switch time_t
to a 64 bit quantity, which should happen well before 2037.

Patch based on code from Michael C. Richardson, with help from
Allen Briggs who pointed out a fencepost error.
 1.49 27-Jun-1998  perry Tweak more.
 1.48 27-Jun-1998  perry Oops. fix typo.
 1.47 27-Jun-1998  perry Boost base year to 1995. 1985 was over 12 years ago.
 1.46 16-Apr-1998  drochner Make sysbeep() use dev/isa/pcppi. (sysbeep0 at pcppi?)
Remove findcpuspeed() - it's useless and was commented out for a while.
 1.45 05-Feb-1998  drochner Allow DELAY() to be called anytime:
-don't enable interrupts at the end of gettick(), restore the previous
state instead
-start timer/counter 0 from delay() if necessary
-comment out "findcpuspeed()", it would clobber the timer again, and it
is unused anyway
 1.44 13-Feb-1997  jonathan branches: 1.44.8;
Import Dennis Ferguson's i386 clock change request from PR 2785:
* Add table-driven assembly-coded microtime().

* add boot-time computation of the interpolation table,
allowing the hand-coded microtime() to work with locally-tuned
nonstandard values of HZ or TIMER_FREQ.

* delete old C version of microtime().
 1.43 15-Jan-1997  perry branches: 1.43.4;
Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.42 13-Nov-1996  thorpej branches: 1.42.2;
Use bitmask_snprintf().
 1.41 13-Oct-1996  christos backout previous kprintf changes
 1.40 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.39 12-May-1996  mycroft Use intr.h.
 1.38 03-May-1996  christos - Add missing prototypes.
- Fix gcc warnings
 1.37 11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.36 03-Apr-1996  mycroft Add explicit return types.
 1.35 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.34 13-Aug-1995  mycroft Fix sysbeep() for the case of pitch == 0, and garbage collect a useless
variable.
 1.33 28-Jun-1995  cgd note that most of dev/ic's contents have changed names
 1.32 26-Jun-1995  cgd check CMOS time against base time, for sanity. if CMOS time invalid,
warn user and user base time. if base time < 1985, warn the user.
if base time 5 or more years different than clock time, warn user,
and if it's base time that's greater, use it. (The latter case is
handy if one has a machine in which the CMOS battery is dead... I do.)
 1.31 04-May-1995  cgd use the machine-independent definitions for the mc146818.
wrap the various uses of the chip (including the uses of the NVRAM on it)
around the new defintions, structures, and functions specified in the header.
 1.30 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.29 03-Jan-1995  mycroft Add interrupt sharing types.
 1.28 04-Nov-1994  mycroft No longer needs icu.h.
 1.27 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.26 27-Oct-1994  cgd new RCS ID format.
 1.25 25-Jul-1994  mycroft Don't allow the clock chip to be reset if the time hasn't been initialized.
 1.24 05-May-1994  cgd branches: 1.24.2;
lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.23 03-May-1994  mycroft Forgot to munge the #includes in last commit.
 1.22 03-May-1994  mycroft Move beep junk to clock.c.
 1.21 24-Apr-1994  mycroft Rename two files.
 1.20 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.19 29-Mar-1994  mycroft Updates for new autoconfig.
 1.18 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.17 08-Feb-1994  mycroft Don't try to clear the diag register in NVRAM; it's used for other purposes
by some BIOSes, and mysterious lossage results.
 1.16 01-Feb-1994  deraadt clockintr() calls hardclock with a clockframe *
 1.15 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.14 21-Sep-1993  brezak In resettodr() handle rtcget() failure.
 1.13 04-Aug-1993  mycroft branches: 1.13.2;
Put RCS ids back...
 1.12 03-Aug-1993  brezak Bring to rtc clock code from Mach. Provides resettodr().
 1.11 06-Jul-1993  deraadt clean up code for timeout/untimeout/wakeup prototypes.
 1.10 03-Jul-1993  cgd change interrupt vector names to begin with "X" rather than "V", so we're
like every other BSD system on the planet...
 1.9 27-Jun-1993  andrew ANSIfications.
 1.8 15-Jun-1993  mycroft Move definitions of TIMER_FREQ to timerreg.h, and fix value of CF for DELAY().
 1.7 06-Jun-1993  cgd incorporate Bruce Evans' interrupt changes, as hacked by Rod grimes,
for patchkit patch 158. it appears to work well.
 1.6 22-May-1993  cgd add rcsids to everything and clean up headers
 1.5 07-May-1993  cgd add some explanatory comments from 386bsd patchkit patch 113
 1.4 22-Apr-1993  mycroft Round to nearest when generating 8259 clock frequency (from 386BSD path 113).
 1.3 23-Mar-1993  cgd added support for microtime routines by Steve McCanne (mccanne@ee.lbl.gov)
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.13.2.22 08-Feb-1994  mycroft Don't try to clear the diag register in NVRAM; it's used for other purposes
by some BIOSes, and mysterious lossage results.
 1.13.2.21 16-Dec-1993  davidb Moved RTC code from inittodr() to readtodr().
inittodr() now does something sensible with the time passed to it.
 1.13.2.20 08-Nov-1993  mycroft Correct a panic message to display the name of the right function.
 1.13.2.19 29-Oct-1993  mycroft delay(): Don't overflow if the value is small.
 1.13.2.18 27-Oct-1993  mycroft Use a null interrupt routine between timerattach() and cpu_initclocks(), to
avoid calling hardclock(), but still allow the timer to be running without
getting `stray interrupt' messages.
 1.13.2.17 26-Oct-1993  mycroft Use fixed I/O address for nvram(). Rearrange clockattach() and )
cpu_initclocks() to initialize interrupt handler early. Use a real spin
loop in spinwait().
 1.13.2.16 18-Oct-1993  mycroft Add dummy setstateclockrate(). We don't need it.
 1.13.2.15 17-Oct-1993  mycroft Minor cleanup.
 1.13.2.14 15-Oct-1993  mycroft Fix some off-by-one errors reading and setting the timer chip.
 1.13.2.13 15-Oct-1993  mycroft Change `limit' variables to u_int as it generates smaller code.
 1.13.2.12 12-Oct-1993  mycroft Oops! Was installing the timer interrupt twice.
 1.13.2.11 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.13.2.10 09-Oct-1993  mycroft Slight rearrangement.
 1.13.2.9 09-Oct-1993  mycroft #include cpufunc.h
 1.13.2.8 09-Oct-1993  mycroft DELAY() --> delay(), to match other ports.
 1.13.2.7 09-Oct-1993  mycroft #include cpu.h
 1.13.2.6 07-Oct-1993  mycroft Finish implementing timerintr().
 1.13.2.5 06-Oct-1993  mycroft Change attach message.
 1.13.2.4 30-Sep-1993  mycroft Change some uses of IRQUNK to IRQNONE. #include isa.h and icu.h.
 1.13.2.3 30-Sep-1993  mycroft clock.c: Remove unnecessary casts.
com.c: Update for new config. Add bis() and bic() macros like BSDI's.
Add comspeed() and tiocm_xxx2mcr() from BSDI.
comreg.h: Add COM_FREQ, COM_TOLERANCE, and COM_NPORTS.
fd.c: Remove casts and clean up fdioctl().
[lm]ms.c: Add necessary gunk to [lm]ms_softc and remove casts.
 1.13.2.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.13.2.1 14-Sep-1993  mycroft New i386 code.
 1.24.2.1 25-Jul-1994  cgd from trunk.
 1.42.2.1 18-Jan-1997  thorpej Update from trunk.
 1.43.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.44.8.1 10-Nov-1998  cgd pull up revs 1.47-1.50 and 1.53-1.55 from trunk (perry)
 1.61.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.61.10.1 15-Nov-1999  fvdl Sync with -current
 1.61.8.2 27-Mar-2001  bouyer Sync with HEAD.
 1.61.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.61.2.2 27-Jun-2000  he Pull up revision 1.62 (via patch, requested by mjl):
Reinitialize clock after hibernation, something which seems to be
required on some laptops. Fixes PR#4808.
 1.61.2.1 04-Feb-2000  he Pull up revision 1.63 (requested by minoura):
Detect and handle National Geode (Cyrix MediaGX) built-in clock
module bug. Fixes PR#8654.
 1.62.2.2 06-Nov-1999  enami - Export initrtclock().
- Call it from apm_resume().

This fixes timer problem on some laptop after hybernation (PR#4808).
Reviewd by: fvdl@netbsd.org
 1.62.2.1 06-Nov-1999  enami file clock.c was added on branch comdex-fall-1999 on 1999-11-06 01:14:02 +0000
 1.63.2.9 19-Aug-2002  sommerfeld merged with -current as of today.
rearranged gdt init to deal with KVM86 changes; however, KVM86 has no
chance of working yet; good thing it's not part of GENERIC
 1.63.2.8 28-Jan-2002  sommerfeld Yet Another mergeup with -current.
 1.63.2.7 29-Dec-2001  sommerfeld Yet another mergeup.

New work:
- Frank van der Linden's tlb shootdown fix.
Mainline functionality merged:
- IrDA
- Kernel RCSID's
- Transmeta CPU support
- ACPI
- XMM register access through procfs
 1.63.2.6 27-May-2001  sommerfeld Call tsc_microset() on each cpu early in boot, so that microtime()
doesn't generate spurious crud the first time it's invoked.
 1.63.2.5 26-May-2001  sommerfeld Implement MP-synchronzed microtime(), based on Jason Thorpe's port of
Dave Mills's cycle-counter-based microtime.

XXX We need to figure out how to deal with processors where the cycle
counter speed varies. We don't have a whole lot of alternatives; we
could only use this on multiprocessors, which are less likely to
throttle the clock to save power.

The local apic timer runs at a fixed frequency, but it's
count-down-to-zero, not the count-up-forever type of timer which the
Mills code expects.

This also does not solve the problem of microtime on 486-based
multiprocessors..
 1.63.2.4 30-Apr-2001  sommerfeld Merge sommerfeld_i386mp_1 branch with -current as of today.
GENERIC.MP kernel boots and runs multiuser on my ABIT BP6
 1.63.2.3 10-Jan-2001  sommerfeld Significant rewrite of slave CPU attach and initialization, centering
on identifycpu() and spreading outward.

Separate feature probes (cpuid invocation), which runs on the cpu
being attached, from the display of this information, which runs on
the boot cpu; remove some of the probe code from locore as it doesn't
need to run that early.

We now spin up secondary cpu's during cpu_attach, have them do a cpu
feature probe, and then have them spin waiting for a "go" signal.

We no longer pay attention to the cpu signature and cpuid features
reported by the MP BIOS since those are known to be truncated for at
least some bioses.

We now do npx initialization (including FDIV bug detection) on all
cpus.

XXX Change some of the cyrix bug workarounds to fit the new
identifycpu() system; this is untested.
 1.63.2.2 25-Jun-2000  sommerfeld Merge up to just-post-1.5 -current
 1.63.2.1 20-Feb-2000  sommerfeld Rename some functions to allow local apic to also be used for DELAY
 1.65.6.8 19-Dec-2002  thorpej Sync with HEAD.
 1.65.6.7 11-Dec-2002  thorpej Sync with HEAD.
 1.65.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.65.6.5 27-Aug-2002  nathanw Catch up to -current.
 1.65.6.4 08-Jan-2002  nathanw Catch up to -current.
 1.65.6.3 14-Nov-2001  nathanw Catch up to -current.
 1.65.6.2 21-Jun-2001  nathanw Catch up to -current.
 1.65.6.1 09-Apr-2001  nathanw Catch up with -current.
 1.67.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.67.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.67.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.67.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.70.8.1 31-Aug-2002  gehenna catch up with -current.
 1.80.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.80.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.80.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.80.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.80.2.1 03-Aug-2004  skrll Sync with HEAD
 1.84.6.1 12-Feb-2005  yamt sync with head.
 1.84.4.1 29-Apr-2005  kent sync with -current
 1.87.2.2 30-Dec-2006  yamt sync with head.
 1.87.2.1 21-Jun-2006  yamt sync with head.
 1.89.6.6 03-Jun-2006  kardel adjust quality to 100 for interpolation capable counter implementations
0 would be used for interupt based counters
 1.89.6.5 30-Apr-2006  kardel - clock.h only contained TSC timecounter initialization
declarations that now live in x86/x86/tsc.h
- make i8254_gettimecount visiable for peridic calls
to avoid missed counter wraps
 1.89.6.4 22-Apr-2006  simonb Sync with head.
 1.89.6.3 28-Feb-2006  kardel fix i8254_get_timecounter for MP operation
initrtclock() gets frequency as parameter
remove old microtime table initialization
 1.89.6.2 04-Feb-2006  simonb Only call init_TSC() if i586 or i686.
XXX: should be called from a better place?
 1.89.6.1 04-Feb-2006  simonb Add FreeBSD i8254 timecounter support, and remove old cc_microset and
NTP code.
 1.89.4.1 09-Sep-2006  rpaulo sync with head
 1.89.2.1 01-Mar-2006  yamt sync with head.
 1.90.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.90.2.5 14-Sep-2006  yamt sync with head.
 1.90.2.4 03-Sep-2006  yamt sync with head.
 1.90.2.3 11-Aug-2006  yamt sync with head
 1.90.2.2 26-Jun-2006  yamt sync with head.
 1.90.2.1 13-Mar-2006  yamt sync with head.
 1.91.4.1 19-Jun-2006  chap Sync with head.
 1.92.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.5 04-May-1995  cgd use the machine-independent definitions for the mc146818.
wrap the various uses of the chip (including the uses of the NVRAM on it)
around the new defintions, structures, and functions specified in the header.
 1.4 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.3 27-Oct-1994  cgd new RCS ID format.
 1.2 04-Aug-1993  mycroft Put RCS ids back...
 1.1 03-Aug-1993  brezak Bring to rtc clock code from Mach. Provides resettodr().
 1.4 04-May-1995  cgd use the machine-independent definitions for the mc146818.
wrap the various uses of the chip (including the uses of the NVRAM on it)
around the new defintions, structures, and functions specified in the header.
 1.3 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.2 27-Oct-1994  cgd new RCS ID format.
 1.1 24-Sep-1993  mycroft branches: 1.1.2;
Renamed from clock.h.
 1.1.2.2 24-Sep-1993  mycroft Renamed from clock.h.
 1.1.2.1 24-Sep-1993  mycroft file clockreg.h was added on branch magnum on 1993-09-24 09:04:57 +0000
 1.14 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.13 21-Sep-2021  christos use l->l_cred since it is available.
 1.12 20-Aug-2015  christos include "ioconf.h" to get the 'void <driver>attach(int count);' prototype.
 1.11 25-Jul-2014  dholland branches: 1.11.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.10 16-Mar-2014  dholland branches: 1.10.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.9 01-Jul-2011  dyoung branches: 1.9.2; 1.9.12; 1.9.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.8 19-Oct-2009  rmind Drop 3rd and 4th clauses from David Young's license.
Reviewed and approved by dyoung@ (copyright holder).
 1.7 15-Apr-2009  elad Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
 1.6 28-Jun-2008  ad branches: 1.6.4; 1.6.10;
A few more.
 1.5 28-Jun-2008  ad Fix numerous bugs.
 1.4 28-Jun-2008  ad Noisy printf.
 1.3 31-May-2008  taca branches: 1.3.2;
Kill license clause 3 of original license part, behalf of the original
license holder.
 1.2 11-Dec-2007  lukem branches: 1.2.8; 1.2.10; 1.2.12; 1.2.14;
use __KERNEL_RCSID()
 1.1 06-Feb-2007  dyoung branches: 1.1.2; 1.1.6; 1.1.28; 1.1.36; 1.1.38; 1.1.40;
Add cmos(4) for reading/writing CMOS RAM on x86 boxes. This driver
comes from Takahiro Kambe, with some mods by me.
 1.1.40.1 13-Dec-2007  bouyer Sync with HEAD
 1.1.38.1 11-Dec-2007  yamt sync with head.
 1.1.36.1 26-Dec-2007  ad Sync with head.
 1.1.28.1 09-Jan-2008  matt sync with HEAD
 1.1.6.3 21-Jan-2008  yamt sync with head
 1.1.6.2 26-Feb-2007  yamt sync with head.
 1.1.6.1 06-Feb-2007  yamt file cmos.c was added on branch yamt-lazymbuf on 2007-02-26 09:07:03 +0000
 1.1.2.2 09-Feb-2007  ad Sync with HEAD.
 1.1.2.1 06-Feb-2007  ad file cmos.c was added on branch newlock2 on 2007-02-09 21:03:49 +0000
 1.2.14.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.14.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2.12.2 11-Mar-2010  yamt sync with head
 1.2.12.1 04-May-2009  yamt sync with head.
 1.2.10.1 04-Jun-2008  yamt sync with head
 1.2.8.2 29-Jun-2008  mjf Sync with HEAD.
 1.2.8.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.2.1 03-Jul-2008  simonb Sync with head.
 1.6.10.3 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.6.10.2 01-Nov-2009  jym Sync with HEAD.
 1.6.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.16.1 18-May-2014  rmind sync with head
 1.9.12.2 03-Dec-2017  jdolecek update from HEAD
 1.9.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.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.10.2.1 10-Aug-2014  tls Rebase.
 1.11.4.1 22-Sep-2015  skrll Sync with HEAD
 1.47 29-Jan-1995  mycroft Clean up deleted files.
 1.46 29-Jan-1995  cgd use chip headers in /dev/ic
 1.45 11-Jan-1995  pk Explicitly test the RXRDY status bit on incoming characters.
 1.44 04-Jan-1995  mycroft Fix oversight in previous.
 1.43 03-Jan-1995  mycroft Add interrupt sharing types.
 1.42 25-Nov-1994  mycroft Minor update for new autoconfig.
 1.41 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.40 03-Nov-1994  mycroft Update to match autoconfig code.
 1.39 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.38 27-Oct-1994  cgd new RCS ID format.
 1.37 26-Oct-1994  mycroft Implement *cnpollc().
 1.36 16-Sep-1994  mycroft Only reset FIFO if changing baud rate. From John Kohl (slightly edited).
 1.35 24-Aug-1994  mycroft Set the FIFO threshold based on the receive speed, per Mark Weaver.
 1.34 21-Aug-1994  mycroft Look for MDMBUF in cflag, not lflag.
 1.33 07-Aug-1994  mycroft Count up the silo overflows and only log a warning at most once per minute.
 1.32 31-Jul-1994  mycroft Bug fixes from Mark Weaver.
 1.31 10-Apr-1994  cgd branches: 1.31.2;
allow MDMBUF flags to be set (oops)
 1.30 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.29 29-Mar-1994  mycroft Updates for new autoconfig.
 1.28 25-Mar-1994  mycroft Fix off-by-one error in comopen() unit number sanity check. From Brian de
Alwis.
 1.27 23-Mar-1994  mycroft Some stylistic cleanup, and a very minor speedup.
 1.26 23-Mar-1994  cgd add AST-style serial multiport support, from Roland McGrath
<roland@@frob.com>. Needs light clean by Mr. I386, but mostly
OK. For some reason, Bad Things (TM) happened on the last cvs commit.
 1.25 18-Mar-1994  cgd add reasonable support for MDMBUF output flow control. input to be done later
 1.24 12-Mar-1994  cgd copy appropriate hardware config bits from config's flags
 1.23 12-Mar-1994  cgd fix some of the last; thanks to charles for looking it over...
 1.22 12-Mar-1994  cgd support new ioctls. fix the way CRTSCTS is used, etc. Seperate 'hardware'
and 'software' flags. beginnings of multiport support.
 1.21 08-Mar-1994  mycroft Major cleanup and many bugs fixed; based in part on Brad Huntting's version
for BSD/386. More to be done when the low-level interrupt system is replaced.
 1.20 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.19 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.18 01-Feb-1994  cgd oops
 1.17 01-Feb-1994  cgd new cons.h location, etc.
 1.16 30-Jan-1994  ws Traditional behaviour is to reset all modes if device isn't open already
 1.15 13-Jan-1994  mycroft Junk comselect(); it's the same at ttselect().
 1.14 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.13 29-Sep-1993  cgd ifdef out the ttyfree()'s, so that fill_eproc doesn't panic when
a process's session still holds a ref to a tty which has been deallocated
and reused.
 1.12 29-Aug-1993  deraadt branches: 1.12.2;
tty XXstart() routines return void
 1.11 12-Jul-1993  mycroft Change tty code to use clist interface, but with ring buffer implementation.
Also, fix a couple of bugs in tty.c and pccons.c, and some gross kluginess
in the hp300 stuff.
 1.10 07-Jul-1993  deraadt pccons.c now dynamically allocates it's "struct tty"
cons.c's "struct tty *cn_tty" wasn't used by any of the kernel, and goes away.
 1.9 06-Jun-1993  cgd make getc() and ungetc() be rb{un,}getc(), so getc() and ungetc()
don't conflict w/ansi prototypes...
 1.8 26-May-1993  deraadt tty dynamic allocation
 1.7 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.6 10-Apr-1993  glass fixed to be compliant, subservient, and to take advantage of the newly
hacked config(8)
 1.5 09-Apr-1993  cgd have probe return size of io space on successful return, rather
than simply 1.
 1.4 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.3 27-Mar-1993  cgd moved closing #endif to include comselect
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.12.2.17 01-Feb-1994  mycroft Updates from main branch.
 1.12.2.16 29-Oct-1993  mycroft Minor cleanup.
 1.12.2.15 29-Oct-1993  mycroft c_cflag is a tcflag_t, not a u_char. (Duh.)
 1.12.2.14 18-Oct-1993  mycroft Fix a small typo.
 1.12.2.13 18-Oct-1993  mycroft Check bits in the fifo reg during probe to make sure they are on.
 1.12.2.12 17-Oct-1993  mycroft Minor cleanup.
 1.12.2.11 16-Oct-1993  mycroft Add missing dv_class entry to cfdrivers, and use dv_xname where appropriate.
 1.12.2.10 15-Oct-1993  mycroft Nuke a wakeup() I left in accidentally.
 1.12.2.9 15-Oct-1993  mycroft Flush any pending I/O on open. After a transmit interrupt, don't call
comstart() if TS_FLUSH is set.
 1.12.2.8 13-Oct-1993  mycroft Use stupid indirection to avoid a compiler warning.
 1.12.2.7 12-Oct-1993  mycroft Minor cleanup.
 1.12.2.6 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.12.2.5 07-Oct-1993  mycroft Don't #include isa.h.
 1.12.2.4 06-Oct-1993  mycroft Change comforceintr() to not use loopback. Change attach messages.
 1.12.2.3 30-Sep-1993  mycroft Change some uses of IRQUNK to IRQNONE. #include isa.h and icu.h.
 1.12.2.2 30-Sep-1993  mycroft clock.c: Remove unnecessary casts.
com.c: Update for new config. Add bis() and bic() macros like BSDI's.
Add comspeed() and tiocm_xxx2mcr() from BSDI.
comreg.h: Add COM_FREQ, COM_TOLERANCE, and COM_NPORTS.
fd.c: Remove casts and clean up fdioctl().
[lm]ms.c: Add necessary gunk to [lm]ms_softc and remove casts.
 1.12.2.1 14-Sep-1993  mycroft New i386 code.
 1.31.2.5 16-Sep-1994  cgd from trunk.
 1.31.2.4 24-Aug-1994  mycroft update from trunk
 1.31.2.3 21-Aug-1994  mycroft update from trunk
 1.31.2.2 07-Aug-1994  mycroft update from trunk
 1.31.2.1 01-Aug-1994  cgd From trunk.
 1.6 01-Mar-1995  mycroft Clean up deleted files.
 1.5 29-Jan-1995  cgd use chip headers in /dev/ic
 1.4 27-Oct-1994  cgd new RCS ID format.
 1.3 08-Mar-1994  mycroft Major cleanup and many bugs fixed; based in part on Brad Huntting's version
for BSD/386. More to be done when the low-level interrupt system is replaced.
 1.2 22-May-1993  cgd branches: 1.2.4;
add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.2.4.2 17-Oct-1993  mycroft Minor cleanup.
 1.2.4.1 30-Sep-1993  mycroft clock.c: Remove unnecessary casts.
com.c: Update for new config. Add bis() and bic() macros like BSDI's.
Add comspeed() and tiocm_xxx2mcr() from BSDI.
comreg.h: Add COM_FREQ, COM_TOLERANCE, and COM_NPORTS.
fd.c: Remove casts and clean up fdioctl().
[lm]ms.c: Add necessary gunk to [lm]ms_softc and remove casts.
 1.11 01-Mar-1995  mycroft Clean up deleted files.
 1.10 29-Jan-1995  cgd use chip headers in /dev/ic
 1.9 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.8 27-Oct-1994  cgd new RCS ID format.
 1.7 24-May-1994  mycroft MIN --> min
 1.6 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.5 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.4 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.3 20-Dec-1993  mycroft branches: 1.3.2;
Canonicalize all #includes, and add pio.h where appropriate.
 1.2 29-Oct-1993  andrew ttyfree() bugfix edition, plus various minor tweaks.
 1.1 06-Oct-1993  andrew Cyclades Cyclom-{4/8/16}Y multiport async serial board driver.
 1.3.2.2 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.3.2.1 20-Dec-1993  mycroft file cy.c was added on branch magnum on 1993-12-20 09:05:36 +0000
 1.7 09-Sep-1997  mycroft Remove some vestiges of BDB.
 1.6 27-Oct-1994  cgd branches: 1.6.16;
new RCS ID format.
 1.5 02-Apr-1994  mycroft Minor code cleanup.
 1.4 02-Aug-1993  mycroft branches: 1.4.2;
Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.3 03-Jul-1993  cgd Unless INTR_DEBUG is set, don't report all of the "random" event types.
also, unless INTR_DEBUG is set, make the internal branch labels for
the interrupt code be local labels, so profiling works OK.
 1.2 27-Jun-1993  andrew Replace SHOW_A_LOT_NOT with a more meaningful commented-out SHOW_A_LOT.
 1.1 06-Jun-1993  cgd incorporate Bruce Evans' interrupt changes, as hacked by Rod grimes,
for patchkit patch 158. it appears to work well.
 1.4.2.3 11-Nov-1993  mycroft Make the rest of BDB handling #ifdef BDB. Maybe some day the rest of the
world will see this debugger.
 1.4.2.2 11-Nov-1993  mycroft Disable most of the BDB handling by default.
 1.4.2.1 09-Oct-1993  mycroft Remove SHOW_XXX() code.
 1.6.16.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.11 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.10 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.9 04-Nov-1994  mycroft Rearrange slightly.
 1.8 27-Oct-1994  cgd new RCS ID format.
 1.7 23-May-1994  cgd quiet compiler warnings
 1.6 24-Apr-1994  mycroft Rename two files.
 1.5 22-Apr-1994  mycroft Separate DMA functions.
 1.4 22-Oct-1993  mycroft Add at_setup_dmachan(). Minor cleanup.
 1.3 17-Oct-1993  mycroft Minor cleanup.
 1.2 16-Oct-1993  mycroft Panic if DMA with odd length attempted on a 16-bit channel.
 1.1 14-Oct-1993  mycroft New file with DMA code from isa.c, modified to check for some errors.
 1.4 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.3 29-Jan-1995  cgd use chip headers in /dev/ic
 1.2 27-Oct-1994  cgd new RCS ID format.
 1.1 22-Apr-1994  mycroft Separate DMA functions.
 1.3 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.2 27-Oct-1994  cgd new RCS ID format.
 1.1 22-Apr-1994  mycroft Separate DMA functions.
 1.7 01-Mar-1995  mycroft Clean up deleted files.
 1.6 07-Jan-1995  mycroft Actually, do the ID reset in elink_reset().
 1.5 06-Jan-1995  mycroft Do the reset in the individual drivers, not in elink_idseq().
 1.4 03-Jan-1995  hpeyerl This is correct according to the docs on both cards.
Doesn't seem to make any difference to the known problems though.
 1.3 27-Oct-1994  cgd new RCS ID format.
 1.2 16-Feb-1994  mycroft Add copyright notices.
 1.1 16-Feb-1994  mycroft Move elink_reset() into a separate file, and add a generic elink_idseq().
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 27-Oct-1994  cgd new RCS ID format.
 1.2 16-Feb-1994  mycroft Add copyright notices.
 1.1 16-Feb-1994  mycroft Move elink_reset() into a separate file, and add a generic elink_idseq().
 1.133 07-Apr-2000  thorpej Use dev/isa/fd.c.
 1.132 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.131 07-Feb-2000  thorpej branches: 1.131.2;
Add a new function call to the ISA DMA API: isa_dmamaxsize(), which returns
the maximum transfer size for the specified DMA channel. Make all clients
of ISA DMA use this call to determine their maximum transfer size.
 1.130 07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.129 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.128 24-Mar-1999  mrg branches: 1.128.8; 1.128.14;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.127 28-Feb-1999  explorer Update to slightly altered rnd_attach_source() api
 1.126 22-Feb-1999  mycroft Use DMAMODE_DEMAND. Not tested, but presumed to work.
 1.125 19-Feb-1999  mycroft Kill vestiges of isa_establish().
 1.124 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.123 05-Aug-1998  perry bzero->memset, bcopy->memcpy
 1.122 04-Jul-1998  jonathan defopt DDB.
 1.121 09-Jun-1998  thorpej Adjust for changes to the ISA DMA API.
 1.120 03-May-1998  drochner Set console to polling mode before calling cngetc().
 1.119 22-Mar-1998  drochner switch to non-BROKEN_INDIRECT_CONFIG
 1.118 10-Feb-1998  mrg - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
 1.117 06-Feb-1998  mrg add the i386 MD portions for UVM.
 1.116 15-Jan-1998  thorpej Kludge around i/o port overlap w/ the "wdc" driver.
 1.115 12-Jan-1998  thorpej Update for changes to config.
 1.114 16-Dec-1997  mikel fix format string in FD_DEBUG printf(); from Eric Haszlakiewicz in PR 4692
 1.113 20-Oct-1997  thorpej Don't panic if we fail to remap i/o or mem space in the attach function.
Instead, print a diagnostic and return. (Some drivers do this already.)

Also, normalize the diagnostic message, and fix some places where the
printfs were getting ugly.
 1.112 19-Oct-1997  thorpej Make sure the i/o and/or mem addresses aren't wildcarded (i.e. -1) before
using the address in a bus_space_map() call.
 1.111 13-Oct-1997  explorer o Make usage of /dev/random dependant on
pseudo-device rnd # /dev/random and in-kernel generator
in config files.

o Add declaration to all architectures.

o Clean up copyright message in rnd.c, rnd.h, and rndpool.c to include
that this code is derived in part from Ted Tyso's linux code.
 1.110 10-Oct-1997  explorer Add hooks to insert timing info into the random system
 1.109 07-Sep-1997  mycroft GC a bunch of NEWCONFIG stuff.
 1.108 17-Jul-1997  jtk branches: 1.108.2;
use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all *UNK uses in
isa code with the native names from locators.h
 1.107 23-Jun-1997  fvdl Turn some bus_space_write_2s back to bus_space_write1s, like they should
be. Seemingly leftover from bus_io -> bus_space transition.

Fixes PR 3780, from Thorsten Frueauf
 1.106 06-Jun-1997  thorpej Pull thorpej-bus-dma branch into mainline.
 1.105 15-Mar-1997  thorpej branches: 1.105.2;
Add a mountroothook that prompts the operator to insert a file system
floppy, a'la the SPARC port.
 1.104 09-Jan-1997  mycroft s/soft error/soft error (corrected)/, to avoid confusion.
 1.103 20-Dec-1996  jtk repair fdopen() to allow multiple opens at same density (was broken with fdformat)
 1.102 01-Dec-1996  jonathan Fix #ifdef DEBUG prinf() lint: bp->b_bcount is long, not int.
 1.101 30-Nov-1996  jtk tabstop corrections, thanks to Paul Kranenburg
 1.100 29-Nov-1996  jtk Add floppy formatting facility.
i386 floppy controller code came from FreeBSD, as worked on by:
jc@irbs.UUCP (John Capo)
vak@zebub.msk.su (Serge Vakulenko)
ache@astral.msk.su (Andrew A. Chernov)
joerg_wunsch@uriah.sax.de (Joerg Wunsch)
dufault@hda.com (Peter Dufault)

formatting ioctl interface is generalized to an MI interface. see fdc(4)
and fdformat(1)
 1.99 27-Nov-1996  thorpej In fdcresult(), the loop that pulls status off the controller is treated
as a "timeout", yet there's no specific delay in each iteration. Add
a small delay (10 usec... pretty arbitrary) in each iteration. This
fixes the "fdcresult: timeout" problems I've been having on my 200MHz P6.
 1.98 13-Nov-1996  thorpej Use bitmask_snprintf().
 1.97 21-Oct-1996  thorpej New bus.h implementation/interface:
- No more distinction between i/o-mapped and memory-mapped
devices. It's all "bus space" now, and space tags
differentiate the space with finer grain than the
bus chipset tag.
- Add memory barrier methods.
- Implement space alloc/free methods.
- Implement region read/write methods (like memcpy to/from
bus space).
This interface provides a better abstraction for dealing with
machine-independent chipset drivers.
 1.96 13-Oct-1996  christos backout previous kprintf changes
 1.95 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.94 09-Oct-1996  explorer turn off floppy motor (and light) even if the drive isn't found. This fixes
some laptop indicator lights which would be stuck on after the probe
 1.93 31-Aug-1996  mycroft Oops; fix typo.
 1.92 30-Aug-1996  mycroft Make sure b_resid is always set before biodone().
 1.91 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.90 12-May-1996  mycroft branches: 1.90.4;
Use intr.h.
 1.89 12-May-1996  thorpej Use <machine/bus.h> ... on the right track to making this an MI driver.
 1.88 03-May-1996  christos - Add missing prototypes.
- Fix gcc warnings
 1.87 11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.86 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.85 04-Mar-1996  mycroft Update for changed DMA interface.
 1.84 10-Feb-1996  thorpej In fdcretry(), set the state to DOSEEK rather than SEEKCOMPLETE before
retrying the operation. Fixes disk_unbusy() imbalance and really seems
like the right thing to do in case it was the seek that failed. Takes
care of PR #1985. Patch from John F. Woods <jfw@jfwhome.funhouse.com>
 1.83 12-Jan-1996  thorpej Balance calls to disk_busy() and disk_unbusy() properly to avoid
dk_busy < 0 panics. Count seeks.
 1.82 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.81 28-Dec-1995  perry fixed my own pr 1758 -- the floppy drive motor was not being turned off
at halt time, especially if a floppy was mounted. Added a shutdown hook
to turn off the motor. Per a request by mycroft, the cookie from the hook
is saved in a new member I added to the fd_softc structure.
 1.80 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.79 21-Aug-1995  mycroft Require drives 2 and 3 to be explicitly configured.
 1.78 04-Jul-1995  mycroft Make each disk and tape driver define its own read and write functions.
Deprecate rawread() and rawwrite() completely. Remove d_strategy from cdevsw to
force the abstraction barrier.
 1.77 28-Jun-1995  cgd note that most of dev/ic's contents have changed names
 1.76 26-Jun-1995  cgd DEBUG -> FD_DEBUG, so this thing doesn't spew when used with options DEBUG
 1.75 26-Jun-1995  cgd make dump stubs consistent. fix other piece of code to compile
properly with DEBUG; used bogus variable.
 1.74 04-May-1995  cgd use the machine-independent definitions for the mc146818.
wrap the various uses of the chip (including the uses of the NVRAM on it)
around the new defintions, structures, and functions specified in the header.
 1.73 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.72 10-Apr-1995  mycroft Fdclose --> fdclose; no longer conflicts.
 1.71 13-Jan-1995  mycroft Oops.
 1.70 13-Jan-1995  mycroft Avoid some repeated multiplications.
 1.69 13-Jan-1995  mycroft Add a sc_bcount, similar to wd.c.
 1.68 13-Jan-1995  mycroft Fix typos.
 1.67 13-Jan-1995  mycroft Only allow opening one density at a time.
 1.66 13-Jan-1995  mycroft Change the way b_cylin and sc_track (now sc_cylin) are used slightly.
If transfer goes past end of disk, truncate it.
 1.65 03-Jan-1995  mycroft Add interrupt sharing types.
 1.64 14-Dec-1994  mycroft Remove dkbad.h.
 1.63 03-Dec-1994  mycroft fdclose -> Fdclose
 1.62 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.61 04-Nov-1994  mycroft Don't need cd_indirect.
 1.60 04-Nov-1994  mycroft No longer needs icu.h.
 1.59 03-Nov-1994  mycroft *intr() arg does not need to be void*.
 1.58 03-Nov-1994  mycroft Use indirect config for subdevices, and add dkdrivers where missing.
 1.57 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.56 27-Oct-1994  cgd new RCS ID format.
 1.55 20-Oct-1994  mycroft Print a single `soft error' message when an operation was retried and
eventually completed successfully. Also fix fsbn numbers in diskerr() calls.
 1.54 20-Oct-1994  mycroft Make another printf() #ifdef FD_DEBUG.
 1.53 20-Oct-1994  mycroft Make the verbose diagnostics #ifdef FD_DEBUG.
 1.52 18-Oct-1994  mycroft Fix up some printfs and make them consistent.
 1.51 31-Jul-1994  mycroft Patch from Onno var der Linden to fix reading and writing of 360K floppies
in 1.2MB drives.
 1.50 31-Jul-1994  mycroft Remove DIOCSDINFO completely; disklabel(8) will deal.
 1.49 26-Jul-1994  mycroft Normalize label handling.
 1.48 16-Jun-1994  mycroft branches: 1.48.2;
b_un.b_addr -> b_data
 1.47 27-May-1994  cgd remember, DDB isn't necessarily in if DIAGNOSTIC is on
 1.46 11-May-1994  mycroft Add dummy *dump() routines.
 1.45 11-May-1994  mycroft Add dummy fdsize().
 1.44 05-May-1994  mycroft Remove now-bogus casts.
 1.43 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.42 22-Apr-1994  mycroft Separate DMA functions.
 1.41 20-Apr-1994  mycroft Implement a simple `fairness' algorithm which doesn't cost too much in
performance.
 1.40 20-Apr-1994  mycroft Use TAILQ_*() to maintain the drive activation queues.
 1.39 09-Apr-1994  mycroft Deal with 2.88MB disk drives, but pretend they are 1.44MB for now.
 1.38 08-Apr-1994  mycroft Get rid of the extra hop between fdcintr() and fdcstate(), and fdcretry()
doesn't need to return a value.
 1.37 08-Apr-1994  mycroft Fix return values from some interrupt routines.
 1.36 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.35 29-Mar-1994  mycroft New version from me.
 1.34 12-Mar-1994  mycroft Remove backward compatibility hacks for config(8), as they are no longer
useful.
 1.33 12-Mar-1994  mycroft Update to match config(8).
 1.32 10-Mar-1994  mycroft Add a heuristic for detecting old config(8)s. This is very temporary.
 1.31 10-Mar-1994  mycroft Now that the disk probe routines are actually called, they need to return
something.
 1.30 10-Mar-1994  mycroft Oops. Forgot two prototypes.
 1.29 10-Mar-1994  mycroft More updates for new config.
 1.28 10-Mar-1994  mycroft Update for new config.
 1.27 10-Mar-1994  mycroft Fix some constants in preparation for my new driver.
 1.26 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.25 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.24 06-Feb-1994  mycroft Use b_actf, not av_forw.
 1.23 27-Jan-1994  cgd pg() -> panic()
 1.22 20-Dec-1993  mycroft Use cpufunc.h only where (currently) needed.
 1.21 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.20 01-Aug-1993  mycroft branches: 1.20.2;
Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.19 16-Jul-1993  mycroft branches: 1.19.2;
#include cpufunc,h so inb() and outb() are inlined.
 1.18 06-Jul-1993  deraadt clean up code for timeout/untimeout/wakeup prototypes.
 1.17 29-Jun-1993  deraadt uninitialized variable reported by <jfw@ksr.com>
 1.16 21-Jun-1993  deraadt I don't know what I did that was so critical, but now the floppy driver
works on my machine (it did not before). Big voodoo.
 1.15 20-Jun-1993  deraadt if the floppy does not exist, say nothing.
 1.14 18-Jun-1993  cgd new floppy driver, merged from patchkit patch #153
 1.13 22-May-1993  cgd add rcsids to everything and clean up headers
 1.12 20-May-1993  deraadt "slave" -> "targ"
consistant at least..
 1.11 13-May-1993  deraadt error message reporting fixed. patch from Gordon Burditt <gordon@sneaky.lonestar.org>
see also 386BSD-0.1.2.3/sys.386bsd/8.
 1.10 10-May-1993  deraadt Floppy drives now print the same information as wd controllers
and scsi disks. See?
fd0 at fdc0 slave 0: 1.44MB 80 cyl, 2 head, 18 sec
Also, added a define for 720K disks, probably incorrect..
Note: the CMOS is used to find out what type the drive is.
 1.9 04-May-1993  deraadt support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
 1.8 15-Apr-1993  deraadt ioconf changes, see previous cvs's that dumped core
 1.7 12-Apr-1993  deraadt new scsi subsystem.
changes also in config/mkioconf.c & sys/scsi/*
 1.6 09-Apr-1993  cgd have probe return size of io space on successful return, rather
than simply 1.
 1.5 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.4 06-Apr-1993  deraadt <no drive> message gone.
 1.3 06-Apr-1993  deraadt fd.c -- changed type=0 to correspond to "drive not found"
 1.2 06-Apr-1993  deraadt Mod-barsoom wd additions. config program + kernel config files changed too.
fd support had to change slightly too.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.19.2.1 28-Jul-1993  deraadt wd.c: fixes 1 drive systems
fd.c: improves reliability
changes from wolfgang
 1.20.2.34 06-Feb-1994  mycroft Use b_actf, not av_forw.
 1.20.2.33 13-Dec-1993  mycroft Fix some more old comments.
 1.20.2.32 13-Dec-1993  mycroft Fix outdated comment.
 1.20.2.31 29-Nov-1993  mycroft Record disk type in buf. Other minor cleanup.
 1.20.2.30 29-Nov-1993  mycroft Use dk_establish().
 1.20.2.29 27-Nov-1993  mycroft Fix uninitialized variable in fdcretry().
 1.20.2.28 08-Nov-1993  mycroft Make the buffer queues per-drive. Don't panic when it's possible to clean up.
Other minor cleanup.
 1.20.2.27 03-Nov-1993  mycroft Only turn the motor off when we're done with it.
 1.20.2.26 29-Oct-1993  mycroft Make some debugging code in the probe routines #ifdef DEBUG.
 1.20.2.25 29-Oct-1993  mycroft Don't print `drive X not configured' if it isn't.
 1.20.2.24 28-Oct-1993  mycroft Make fdprobe() work correctly for drive > 0.
 1.20.2.23 28-Oct-1993  mycroft Take a stab at 4 disks per controller. Try a different tactic for fdprobe().
Check `not ready' bit in ST0 after each command.
 1.20.2.22 28-Oct-1993  mycroft Make sure we don't deselect the `active' drive while doing the asynchronous
motor shutoff.
 1.20.2.21 28-Oct-1993  mycroft Remove FINDWORK; use DEVIDLE in its place.
 1.20.2.20 28-Oct-1993  mycroft Reset the controller again after irq probing. Set the step rate before every
seek, and the transfer rate before every transfer. Add a timeout for resets.
 1.20.2.19 28-Oct-1993  mycroft Transfer multiple blocks when possible.
 1.20.2.18 27-Oct-1993  mycroft A real, but highly experimental, fdprobe().
 1.20.2.17 27-Oct-1993  mycroft Increase seek timeout. Allow recalibrate to time out. Retry the operation
a couple of times before recalibrating.
 1.20.2.16 27-Oct-1993  mycroft Remove some debugging code. (Actually, make it #ifdef DEBUG.)
 1.20.2.15 27-Oct-1993  mycroft Majorly rework error handling. Add some debugging code.
 1.20.2.14 27-Oct-1993  mycroft Make local data static only if !DIAGNOSTIC. Also, remove a small bogon in
the setup of fdcstate().
 1.20.2.13 17-Oct-1993  mycroft Minor cleanup.
 1.20.2.12 16-Oct-1993  mycroft Overhaul of seeking and error handling.
 1.20.2.11 16-Oct-1993  mycroft Add dkdriver weirdness. Not complete, but good enough for now.
 1.20.2.10 12-Oct-1993  mycroft Minor cleanup.
 1.20.2.9 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.20.2.8 09-Oct-1993  mycroft Gratuitous formatting change.
 1.20.2.7 07-Oct-1993  mycroft Don't #include isa.h.
 1.20.2.6 06-Oct-1993  mycroft Fix 720KB stuff (I think).
 1.20.2.5 01-Oct-1993  mycroft #include "machine/cpu.h"
 1.20.2.4 30-Sep-1993  mycroft Change some uses of IRQUNK to IRQNONE. #include isa.h and icu.h.
 1.20.2.3 30-Sep-1993  mycroft clock.c: Remove unnecessary casts.
com.c: Update for new config. Add bis() and bic() macros like BSDI's.
Add comspeed() and tiocm_xxx2mcr() from BSDI.
comreg.h: Add COM_FREQ, COM_TOLERANCE, and COM_NPORTS.
fd.c: Remove casts and clean up fdioctl().
[lm]ms.c: Add necessary gunk to [lm]ms_softc and remove casts.
 1.20.2.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.20.2.1 14-Sep-1993  mycroft New i386 code.
 1.48.2.3 23-Oct-1994  cgd from trunk, per mycroft.
 1.48.2.2 01-Aug-1994  cgd From trunk.
 1.48.2.1 26-Jul-1994  cgd update from trunk.
 1.90.4.3 26-Jan-1997  rat Pullup 1.98 -> 1.99 (fix timing bug in fdcresult()).
 1.90.4.2 31-Aug-1996  mycroft Oops; fix typo.
 1.90.4.1 30-Aug-1996  mycroft Make sure b_resid is always set before biodone().
 1.105.2.1 13-May-1997  thorpej Adapt to the new software interface to the on-board ISA DMA controller.
 1.108.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.108.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.128.14.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.128.8.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.131.2.1 17-Apr-2000  sommerfeld Garbage collect.
 1.12 07-Apr-2000  thorpej Use dev/isa/fd.c.
 1.11 07-Feb-2000  thorpej branches: 1.11.2;
Add a new function call to the ISA DMA API: isa_dmamaxsize(), which returns
the maximum transfer size for the specified DMA channel. Make all clients
of ISA DMA use this call to determine their maximum transfer size.
 1.10 07-Sep-1997  mycroft branches: 1.10.18; 1.10.24;
Increase FDC_MAXIOSIZE to MAXBSIZE, now that we can handle it.
 1.9 29-Nov-1996  jtk branches: 1.9.10;
Add floppy formatting facility.
i386 floppy controller code came from FreeBSD, as worked on by:
jc@irbs.UUCP (John Capo)
vak@zebub.msk.su (Serge Vakulenko)
ache@astral.msk.su (Andrew A. Chernov)
joerg_wunsch@uriah.sax.de (Joerg Wunsch)
dufault@hda.com (Peter Dufault)

formatting ioctl interface is generalized to an MI interface. see fdc(4)
and fdformat(1)
 1.8 28-Jun-1995  cgd note that most of dev/ic's contents have changed names
 1.7 29-Jan-1995  cgd use chip headers in /dev/ic
 1.6 27-Oct-1994  cgd new RCS ID format.
 1.5 10-Mar-1994  mycroft Fix some constants in preparation for my new driver.
 1.4 18-Jun-1993  cgd branches: 1.4.4;
new floppy driver, merged from patchkit patch #153
 1.3 22-May-1993  cgd add rcsids to everything and clean up headers
 1.2 18-May-1993  cgd changes for 'arch'
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.4.3 28-Oct-1993  mycroft Take a stab at 4 disks per controller. Try a different tactic for fdprobe().
Check `not ready' bit in ST0 after each command.
 1.4.4.2 28-Oct-1993  mycroft Increase FDC_MAXIOSIZE to NBPG.
 1.4.4.1 14-Sep-1993  mycroft New i386 code.
 1.9.10.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.24.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.10.18.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.11.2.1 17-Apr-2000  sommerfeld Garbage collect.
 1.2 07-Apr-1994  mycroft Clean up deleted files.
 1.1 14-Sep-1993  mycroft branches: 1.1.2;
New i386 code.
 1.1.2.2 14-Sep-1993  mycroft New i386 code.
 1.1.2.1 14-Sep-1993  mycroft file icu.c.old was added on branch magnum on 1993-09-14 17:32:27 +0000
 1.20 22-Nov-2002  fvdl Removed, no longer needed. Defines were either dupilcates, or have been
moved to other files.
 1.19 01-Feb-1996  mycroft branches: 1.19.44;
LOCORE -> _LOCORE
 1.18 07-Jan-1996  mycroft Remove unused macros.
 1.17 04-Nov-1994  mycroft Make IRQ_SLAVE a plain number, too, and remove IRQ{0-15}.
 1.16 27-Oct-1994  cgd new RCS ID format.
 1.15 01-Oct-1994  mycroft Clean up a little.
 1.14 01-Oct-1994  mycroft Add INTRUNMASK().
 1.13 07-Apr-1994  mycroft branches: 1.13.2;
Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.12 13-Mar-1994  cgd need highmask to be extern'd.
 1.11 09-Mar-1994  mycroft Back out previous change for now.
 1.10 08-Mar-1994  mycroft Inline spl*() calls.
 1.9 22-Feb-1994  mycroft Add clockmask.
 1.8 17-Dec-1993  mycroft From magnum branch:
Remove Jolitz's netisr kluge. Make sure cpl == 0 really means base priority.
Other minor cleanup.
 1.7 09-Sep-1993  mycroft branches: 1.7.2;
Make various macros work if outb() is being inlined.
 1.6 19-Jul-1993  cgd branches: 1.6.2;
disable all AUTO_EOI's, at bde's suggestion--
they don't gain much, and on old chips it doesn't work properly
 1.5 11-Jul-1993  mycroft Make splimp = splnet | spltty, and get rid of SLIP kluge for splnet and
spltty.
 1.4 27-Jun-1993  andrew Enable AUTO_EOI_1 by default; leave AUT_EOI_2 alone, even if it does seem
to work very well, to avoid any potential troubal.
 1.3 06-Jun-1993  cgd incorporate Bruce Evans' interrupt changes, as hacked by Rod grimes,
for patchkit patch 158. it appears to work well.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.2.2 19-Jul-1993  cgd disable all AUTO_EOI's, at bde's suggestion--
they don't gain much, and on old chips it doesn't work properly
 1.6.2.1 19-Jul-1993  cgd file icu.h was added on branch netbsd-0-9 on 1993-07-19 08:27:07 +0000
 1.7.2.5 31-Oct-1993  mycroft Change `imen' to `imask'.
 1.7.2.4 09-Oct-1993  mycroft Make ICU_OFFSET explicitly 32, for locore, which can't #include segments.h.
 1.7.2.3 30-Sep-1993  mycroft Add IRQNONE and IRQUNK.
 1.7.2.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.7.2.1 14-Sep-1993  mycroft New i386 code.
 1.13.2.1 06-Oct-1994  mycroft Update from trunk.
 1.19.44.1 11-Dec-2002  thorpej Sync with HEAD.
 1.68 22-Nov-2002  fvdl Removed in the new intr world.
 1.67 10-Nov-2002  itohy delete reference to astpending, which does not exist any longer
 1.66 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.65 21-Sep-2001  fvdl branches: 1.65.12;
Make the newer gas happy by explicitly adding '*' to indirect calls, and
matching mov extensions with register names.
 1.64 14-Apr-2001  thorpej branches: 1.64.2; 1.64.4;
Generic soft interrupt implementation for NetBSD/i386. This could
probably be tuned somewhat, but this is a stop-gap measure to hold
us until Bill Sommerfeld's new interrupt code comes in from the
MP branch.
 1.63 02-Jul-2000  cgd branches: 1.63.2;
Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.
 1.62 21-Feb-2000  erh Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.
 1.61 01-Jul-1999  thorpej branches: 1.61.2; 1.61.10;
Fix IPv6 software interrupt vector label.
 1.60 28-Jun-1999  itojun - Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.
 1.59 26-Jan-1999  christos branches: 1.59.4; 1.59.6;
Add a missing _C_LABEL(). Now an ELF kernel builds (if one removes the
-z flag from the ld line, in the Makefile)
 1.58 01-Dec-1998  thorpej Use _C_LABEL() to generate C labels in assembly code, don't prepend an
underscore (_) directly. (XXX Except in a few places, where traditional
CPP's macro evaluation semantics break things, so we test for __ELF__
directly in those places).
 1.57 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.56 05-Jul-1998  jonathan defopt NS, NSIP.
 1.55 05-Jul-1998  jonathan defopt ISO TPIP.
 1.54 05-Jul-1998  jonathan defopt CCITT.
 1.53 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.52 15-Jan-1998  thorpej Generate dependencies on the VM86 option.
 1.51 16-Nov-1997  mycroft Fix a condition where we might keep interrupts blocked while servicing a soft
interrupt.
Fixes serial port silo overflow problems.
 1.50 02-Apr-1997  christos branches: 1.50.8;
Add netatalk netisr
 1.49 19-Mar-1997  mycroft ether.h -> arp.h
NETHER -> NARP
 1.48 28-Feb-1997  mycroft Import interrupt priority changes from com patches:
* Make it a strict hierarchy. (It was close anyway).
* Add `serial' and rename `softtty' to `softserial'.
* Make soft interrupts a bit less special-case.
 1.47 15-Aug-1996  mycroft branches: 1.47.6;
After processing an AST, check for another one. Pointed out by ws.
 1.46 04-Jul-1996  chuck add softnet interrupt for native mode atm
 1.45 07-Jan-1996  mycroft branches: 1.45.4;
Deal with GCC's dead code elimination being suboptimal.
 1.44 07-Jan-1996  mycroft Make sure interrupts are disabled before jumping to a resume point, to prevent
races.
 1.43 11-Oct-1995  mycroft Various changes from John Kohl and me:
Map kernel stacks only at unique addresses.
Use one TSS per process.
Add sysarch calls for modifying IOPL and the I/O permission bitmap.
Add a compacting GDT entry allocator, for TSS and LDT selectors.
Enable modifying %fs and %gs with PT_SETREGS.
Sanitize various bits of code.
 1.42 04-Jul-1995  paulus Add call to pppintr in softnet.
 1.41 01-May-1995  mycroft Update to match include files. Eliminate _ucodesel, _udatasel, and IdlePTD.
 1.40 22-Apr-1995  mycroft Fix an oversight.
 1.39 22-Apr-1995  mycroft Fix some outdated comments.
 1.38 22-Apr-1995  mycroft Replace btl with testl.
 1.37 15-Jan-1995  mycroft Avoid using btrl, and check astpending before the return cs, because it's
faster and usually false.
 1.36 27-Oct-1994  cgd new RCS ID format.
 1.35 22-Jul-1994  mycroft Change a btrl to btl. The use of btrl is no longer necessary.
 1.34 13-May-1994  mycroft branches: 1.34.2;
Need non-inlined splhigh() and splx() for new profiling gunk.
 1.33 05-May-1994  mycroft Mostly fix an obscure condition where an AST could be delayed by as much as a
clock tick. And softclock() no longer takes an argument.
 1.32 25-Apr-1994  mycroft Don't barf on inet without ether.
 1.31 18-Apr-1994  mycroft NETISR_RAW is defunct.
 1.30 18-Apr-1994  mycroft NETISR_ARP.
 1.29 08-Apr-1994  mycroft Small performance tweaks.
 1.28 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.27 25-Mar-1994  mycroft Reorder AST check.
 1.26 25-Mar-1994  mycroft Actually finish this change from three months ago.
 1.25 09-Mar-1994  mycroft Back out previous change for now.
 1.24 08-Mar-1994  mycroft Inline spl*() calls.
 1.23 22-Feb-1994  mycroft Add clockmask.
 1.22 01-Feb-1994  deraadt pass around a `clockframe *' instead of a `clockframe'
 1.21 17-Dec-1993  mycroft From magnum branch:
Remove Jolitz's netisr kluge. Make sure cpl == 0 really means base priority.
Other minor cleanup.
 1.20 14-Dec-1993  mycroft Fold in most of the magnum vm changes.
 1.19 11-Jul-1993  mycroft branches: 1.19.4;
Make splimp = splnet | spltty, and get rid of SLIP kluge for splnet and
spltty.
 1.18 11-Jul-1993  mycroft Make splimp = splnet | spltty, and get rid of SLIP kluge for splnet and
spltty.
 1.17 11-Jul-1993  cgd kill an extraneous # which was annoying cpp
 1.16 03-Jul-1993  cgd kernel profiling says that i should make "over_net_stuff_for_spl0" a local
label! (i.e. i missed this one before...)
 1.15 03-Jul-1993  cgd Unless INTR_DEBUG is set, don't report all of the "random" event types.
also, unless INTR_DEBUG is set, make the internal branch labels for
the interrupt code be local labels, so profiling works OK.
 1.14 27-Jun-1993  andrew Don't try to include "sio.h" just yet.
 1.13 14-Jun-1993  mycroft Sigh. Save a few cycles occasionally.
 1.12 14-Jun-1993  mycroft Oops. Wrong name for ISO interrupt routine.
 1.11 14-Jun-1993  mycroft Add support for other networks than INET.
 1.10 06-Jun-1993  cgd apply patch 167, to fix some interrupt system bogosities
 1.9 06-Jun-1993  cgd incorporate Bruce Evans' interrupt changes, as hacked by Rod grimes,
for patchkit patch 158. it appears to work well.
 1.8 22-May-1993  cgd add rcsids to everything and clean up headers
 1.7 21-May-1993  cgd Add reception of multicasts for if_we when using ISO, and add soft
interrupt handler for ISO.
(from Havard Eidnes <Havard.Eidnes@runit.sintef.no>)
 1.6 10-May-1993  deraadt interrupt counters increasted from 16 to 18.
 1.5 09-May-1993  deraadt npx patches from Bruce Evans. patchkit 10002
 1.4 03-May-1993  glass necesssary fix before the ISO, and NS stuff has even a prayer of working.
Jolitz while garbage-collecting the ISO shit, also garbage collected the
DO_NET(NETISR_XXX.... support for them. CCITT is still broken, i think
because this snapshot's version is hosed.
 1.3 09-Apr-1993  cgd from Rodney W. Grimes (rgrimes@agora.rain.com) (patchkit patch 117):

This patch adds the symbol names to icu.s that vmstat expects
the interrupt counters to be called. It also adds code to config
so that the names of the interrupts are written at the end of vectors.s
so vmstat can report real device names. It also cleans up and enables
the logging of stray interrupts. The counters for false interrupts
are added but the fix for them is not (the fix I have is not done
very good.) A false interrupt is when a device asserts it's interrupt
signal, then removes it before the 8259 can latch it. This is the number
one cause of stray IRQ7's and IRQ15's.

Additional device probe information is now printed. This includes
ending I/O address (many drivers do not return the correct value from a
probe this still needs to be fixed), memory address and size, driver
flags passed in by config.
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.19.4.17 01-Feb-1994  mycroft SIR_GENERIC --> SIR_AST
 1.19.4.16 11-Nov-1993  mycroft Disable most of the BDB handling by default.
 1.19.4.15 11-Nov-1993  mycroft Macroize interrupt entry and exit code.
 1.19.4.14 31-Oct-1993  mycroft Minor cleanup.
 1.19.4.13 26-Oct-1993  mycroft TRAPF_CS_OFF -> TF_CS
 1.19.4.12 18-Oct-1993  mycroft Forgot to #include netisr.h.
 1.19.4.11 18-Oct-1993  mycroft New soft interrupt mechanism.
 1.19.4.10 15-Oct-1993  mycroft No need to create an intrframe for softclock().
 1.19.4.9 15-Oct-1993  mycroft Vresume --> _Xresume
 1.19.4.8 13-Oct-1993  mycroft Remove a spurious stack pop entering doreti which is no longer needed.
Put pending AST flag back in netisr. Other minor cleanup.
 1.19.4.7 12-Oct-1993  mycroft Remove sio cruft.
 1.19.4.6 09-Oct-1993  mycroft Remove old SHOW_XXX() code.
 1.19.4.5 09-Oct-1993  mycroft Wrap a reference to unpend_V_next in INTRLOCAL().
 1.19.4.4 09-Oct-1993  mycroft Remove the last GENSPL(), splsoftclock(), and fix up some FASTSPL() cruft.
 1.19.4.3 09-Oct-1993  mycroft Add ASTMASK for splast() (and splsoftclock()). Include ASTMASK in each spl
level.
 1.19.4.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.19.4.1 14-Sep-1993  mycroft New i386 code.
 1.34.2.1 14-Aug-1994  mycroft update from trunk (minor)
 1.45.4.1 10-Dec-1996  mycroft From trunk:
After processing an AST, check for another one.
 1.47.6.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.50.8.1 18-Nov-1997  mellon Pull rev 1.51 up from trunk (mycroft)
 1.59.6.3 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

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

synchronization to latest KAME will take place on HEAD branch soon.
 1.59.6.2 06-Jul-1999  itojun KAME/NetBSD 1.4, SNAP kit 1999/07/05.
NOTE: this branch is just for reference purposes (i.e. for taking cvs diff).
do not touch anything on the branch. actual work must be done on HEAD branch.
 1.59.6.1 28-Jun-1999  itojun KAME/NetBSD 1.4 SNAP kit, dated 19990628.

NOTE: this branch (kame) is used just for refernce. this may not compile
due to multiple reasons.
 1.59.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.61.10.8 25-Jun-2002  fvdl Use a lock prefix to protect manipulation of the 'ipending' variable. Fixes
'softclock stops being called' AKA 'processes entering nanosleep do not
return' problem.
 1.61.10.7 29-Dec-2001  sommerfeld Set up per-cpu GDT.
Use %fs for per-cpu data access.
 1.61.10.6 22-Sep-2001  sommerfeld Merge branch with current, post ubcperf, MTRR, etc., etc.,
with the recent fifo_putpages fix to the trunk, GENERIC.MPDEBUG config
boots multiuser on my BP6.
 1.61.10.5 30-Apr-2001  sommerfeld Merge sommerfeld_i386mp_1 branch with -current as of today.
GENERIC.MP kernel boots and runs multiuser on my ABIT BP6
 1.61.10.4 18-Aug-2000  sommerfeld MULTIPROCESSOR: lock kernel before entering softint routines
 1.61.10.3 07-Aug-2000  sommerfeld Merge sommerfeld_i386mp_1 branch forward to 20000806 sources
 1.61.10.2 21-Feb-2000  sommerfeld Merge in icu.s 1.62
 1.61.10.1 20-Feb-2000  sommerfeld MP: Weave level-based rather than mask-based representation of current
interrupt priority level into the mesh of interrupt stub and return
path..

XXX the flow of control between these two files could be better
documented, but I didn't really change much...

XXX could use some tuning.
 1.61.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.61.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.63.2.6 11-Dec-2002  thorpej Sync with HEAD.
 1.63.2.5 25-Nov-2002  nathanw Make ASTs per-proc rather than per-cpu; per-proc makes more sense when
a process that needs a trap can be running on multiple CPUs.
 1.63.2.4 11-Nov-2002  nathanw Catch up to -current
 1.63.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.63.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.63.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.64.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.64.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.64.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.65.12.1 08-Feb-2003  jmc Hand patches (requested by yamt in ticket #1153)
Fix kernel stack overflow on i386. PR#20180
 1.2 23-Apr-1994  mycroft Clean up deleted files.
 1.1 14-Sep-1993  mycroft branches: 1.1.2;
New i386 code.
 1.1.2.2 14-Sep-1993  mycroft New i386 code.
 1.1.2.1 14-Sep-1993  mycroft file icureg.h was added on branch magnum on 1993-09-14 17:32:30 +0000
 1.2 23-Apr-1994  mycroft Clean up deleted files.
 1.1 14-Sep-1993  mycroft branches: 1.1.2;
New i386 code.
 1.1.2.2 14-Sep-1993  mycroft New i386 code.
 1.1.2.1 14-Sep-1993  mycroft file icuvar.h was added on branch magnum on 1993-09-14 17:32:32 +0000
 1.14 25-Jan-1994  mycroft Clean up deleted files.
 1.13 24-Jan-1994  deraadt ether_input() takes a network byte order ether_type now
 1.12 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.11 10-Dec-1993  cgd IF_LLC0 -> IF_LINK0
 1.10 14-Jun-1993  mycroft 8390-based boards use 16 ports, not 8.
 1.9 22-May-1993  cgd add rcsids to everything and clean up headers
 1.8 21-May-1993  davidb Cleaned up some #defines and my earlier mods.
Fixed incoming packet counter, as noted by mike@sarah.lerc.nasa.gov
 1.7 16-May-1993  davidb Changed named of ECNTRL_THIN to ECNTRL_ONBOARD as the name isn't as
applicable to the UTP version of the card.
Fixed selection of the internal/external transceiver to use the driver flags.
 1.6 28-Apr-1993  mycroft Fix silly compilation error.
 1.5 20-Apr-1993  deraadt deleted old comments at behest of original author :-)
 1.4 18-Apr-1993  mycroft Return correct value for new probe sequence.
 1.3 17-Apr-1993  mycroft Use new format for attach message.
 1.2 10-Apr-1993  glass Fixed so they are useable when compiled with options NS. Not that I know
anyone who will.....
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5 25-Jan-1994  mycroft Clean up deleted files.
 1.4 22-May-1993  cgd add rcsids to everything and clean up headers
 1.3 21-May-1993  davidb Cleaned up some #defines and my earlier mods.
Fixed incoming packet counter, as noted by mike@sarah.lerc.nasa.gov
 1.2 16-May-1993  davidb Changed named of ECNTRL_THIN to ECNTRL_ONBOARD as the name isn't as
applicable to the UTP version of the card.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.67 01-Mar-1995  mycroft Clean up deleted files.
 1.66 03-Jan-1995  mycroft Add interrupt sharing types.
 1.65 02-Jan-1995  mycroft Use soft configuration where possible.
 1.64 18-Nov-1994  mycroft Stylistic changes.
 1.63 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.62 04-Nov-1994  mycroft Remove outdated comment.
 1.61 04-Nov-1994  mycroft No longer needs icu.h.
 1.60 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.59 03-Nov-1994  mycroft Update to match autoconfig code.
 1.58 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.57 27-Oct-1994  cgd new RCS ID format.
 1.56 23-Oct-1994  mycroft Rearrange ed_init() slightly, to better correspond to the National manual.
Optimize ed_rint() slightly in the case of multiple packets. (Avoid an outb
and an inb for each packet).
 1.55 23-Oct-1994  mycroft Slight optimization.
 1.54 23-Oct-1994  mycroft Fix the packet length correction for buggy chips so that it actually works,
and always use it (otherwise short packets could still be corrupted). Also
produce a diagnostic message if DIAGNOSTIC, since it *is* a hardware bug.
Add an ED_PAGE_SHIFT constant, and use it, to avoid GCC doing horrendous
things with divides and multiplies.
 1.53 14-Oct-1994  mycroft Fix bugs in dealing with odd-length mbufs in ed_pio_write_mbufs(). From
John Hood.
 1.52 12-Oct-1994  mycroft Changes from DG to deal with some old chips that corrupt the packet length.
 1.51 01-Oct-1994  mycroft Make some comments more clear.
 1.50 01-Oct-1994  mycroft Various minor changes to sync better with DG's version.
 1.49 24-May-1994  cgd branches: 1.49.2;
MIN -> min, MAX -> max
 1.48 19-May-1994  mycroft Reverse the order of disabling shared memory and turning off 16-bit mode
where necessary, per Steve Wallace.
 1.47 13-May-1994  mycroft Use ether_ifattach() rather than doing the same thing in each driver.
 1.46 11-May-1994  mycroft Fill in some more struct ifnet fields.
 1.45 05-May-1994  mycroft Don't frob the connector type if the card doesn't grok soft config.
 1.44 28-Apr-1994  mycroft Enable/disable shared memory access on all WD/SMC boards. Add support for
software selection of AUI or BNC connectors using LINK0.
 1.43 24-Apr-1994  mycroft Don't need isa.h.
 1.42 14-Apr-1994  mycroft Patches from David Greenman to eliminate magic constants and add delays when
switching to and fro 16-bit access for 790s.
 1.41 08-Apr-1994  mycroft Return correct values from edintr().
 1.40 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.39 29-Mar-1994  mycroft Updates for new autoconfig.
 1.38 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.37 06-Mar-1994  ws Don't let uninitialized variable slip by
 1.36 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.35 02-Mar-1994  mycroft Add 8003W and 8003EB, per David Greenman.
 1.34 02-Mar-1994  mycroft Fix the 790 interrupt table, per Christoph Robitschko.
 1.33 25-Feb-1994  hpeyerl Remove backwoods compatibility.
 1.32 20-Feb-1994  mycroft Forgot to enable the interrupt on Ultras.
 1.31 17-Feb-1994  mycroft Simplify a couple of bits, since IFF_MULTICAST is always set.
 1.30 16-Feb-1994  mycroft Fix typo.
 1.29 16-Feb-1994  mycroft Use IFF_ALLMULTI correctly.
 1.28 16-Feb-1994  mycroft Remove some dead code.
 1.27 15-Feb-1994  mycroft Hack to make this closer to new config.
 1.26 14-Feb-1994  mycroft Make the multicast filter calculation identical to what will be in if_is.c.
 1.25 13-Feb-1994  mycroft Don't save runt or errored packets. These are almost always `normal', and we
really can't deal with them anyway.
 1.24 13-Feb-1994  mycroft Correct spelling errors.
 1.23 12-Feb-1994  mycroft Support for several new cards pulled from magnum branch.
Format police.
 1.22 10-Feb-1994  mycroft Nuke if_init.
 1.21 08-Feb-1994  mycroft Clean up multicast code; part from magnum branch, and part from Brad Parker
<brad@fcr.com>. A couple of other nits.
 1.20 02-Feb-1994  hpeyerl Multicast is no longer optional.
 1.19 01-Feb-1994  ws Better (explicitly) return something from probe when nothing found
 1.18 24-Jan-1994  deraadt ether_input() takes a network byte order ether_type now
 1.17 12-Jan-1994  mycroft We are simply not ready to use pkthdr.len yet.
 1.16 12-Jan-1994  mycroft Use the pkthdr.len field rather than traversing the mbuf chain. Also put some
sanity checking code in, #ifdef DEBUG, just in case.
 1.15 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.14 15-Dec-1993  mycroft Rearrange some tests to improve efficiency a little when using BPF and
multicast at the same time.
 1.13 12-Dec-1993  hpeyerl ie. also pass up any packet with the multicast bit set in the ethernet
>From: Havard Eidnes <Havard.Eidnes@runit.sintef.no>
 1.12 10-Dec-1993  cgd IF_LLC0 -> IF_LINK0
 1.11 10-Dec-1993  hpeyerl More multicast stuff
>From cmaeda@cs.washington.edu
These patches are derived from the IP Multicast patches for BSDI.
 1.10 23-Oct-1993  davidg * Revision 2.11 1993/10/23 04:21:03 davidg
* Novell probe changed to be invasive because of too many complaints
* about some clone boards not being reset properly and thus not
* found on a warmboot. Yuck.
*
* Revision 2.10 1993/10/23 04:07:12 davidg
* increment output errors if the device times out (done via watchdog)
*
* Revision 2.9 1993/10/23 04:01:45 davidg
* increment input error counter if a packet with a bad length is
* detected.
*
* Revision 2.8 1993/10/15 10:59:56 davidg
* increase maximum time to wait for transmit DMA to complete to 120us.
* call ed_reset() if the time limit is reached instead of trying
* to abort the remote DMA.
*
* Revision 2.7 1993/10/15 10:49:10 davidg
* minor change to way the mbuf pointer temp variable is assigned in
* ed_start (slightly improves code readability)
*
* Revision 2.6 93/10/02 01:12:20 davidg
* use ETHER_ADDR_LEN in NE probe rather than '6'.
 1.9 01-Oct-1993  davidg * Revision 2.5 93/09/30 17:44:14 davidg
* patch from vak@zebub.msk.su (Serge V.Vakulenko) to work around
* a hardware bug in cheap WD clone boards where the PROM checksum
* byte is always zero
*
* Revision 2.4 93/09/29 21:24:30 davidg
* Added software NIC reset in NE probe to work around a problem
* with some NE boards where the 8390 doesn't reset properly on
* power-up. Remove initialization of IMR/ISR in the NE probe
* because this is inherent in the reset.
*
* Revision 2.3 93/09/29 15:10:16 davidg
* credit Charles Hannum
*
* Revision 2.2 93/09/29 13:23:25 davidg
* added no multi-buffer override for 3c503
*
* Revision 2.1 93/09/29 12:32:12 davidg
* changed multi-buffer count for 16bit 3c503's from 5 to 2 after
* noticing that the transmitter becomes idle because of so many
* packets to load.
*
* Revision 2.0 93/09/29 00:00:19 davidg
* many changes, rewrites, additions, etc. Now supports the
* NE1000, NE2000, WD8003, WD8013, 3C503, 16bit 3C503, and
* a variety of similar clones. 16bit 3c503 now does multi
* transmit buffers. Nearly every part of the driver has
* changed in some way since rev 1.30.
 1.8 09-Sep-1993  davidg branches: 1.8.2;
As of this revision, all known bugs have been fixed. Some of the fixes include:

1) fixed 3c503 lock-up if the thinwire cable was disconnected at boot time
2) 8013EBT boards now work (quite well!) in 16bit/16k mode
3) ED_NO_DOUBLE_BUFFERING flag now works
4) slightly higer performance (about 3%) with 16bit WD/SMC boards
5) support for WD8013WC (10BaseT) boards

Additionally, the probe code has been reorganized to be much cleaner. This
revision of the driver is 1.25. The release notes have been updated as well.
 1.7 04-Sep-1993  jtc Include systm.h to get prototypes (and possibly inlines) of *max functions.
 1.6 26-Aug-1993  cgd 0.9 "official" patch 001:
(1) added support for ed1 in both generic kernels at:
device ed1 at isa? port 0x250 net irq 9 iomem 0xd8000 vector edintr
(2) brought if_ed.c up to DG's 1.19 rev.
 1.5 03-Aug-1993  glass with -Wall would bomb, on incomplete type 'selinfo'. bpfilter.h include
moved down, and select.h included.
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 28-Jul-1993  cgd incorporate changes from 0-9-base to 0-9-ALPHA
 1.2 12-Jul-1993  deraadt branches: 1.2.2;
moved bfdttach point to same place as other drivers, from greenman
 1.1 03-Jul-1993  cgd add support for David Greenman's "ed" driver.
 1.2.2.6 25-Aug-1993  cgd PATCH 1:
add device ed1 so people with 3c503's can use them:
> device ed1 at isa? port 0x250 net irq 9 iomem 0xd8000 vector edintr
also, bring if_ed to DG's 1.19 rev.
 1.2.2.5 27-Jul-1993  cgd oops; forgot select.h
 1.2.2.4 27-Jul-1993  cgd most recent if_ed, with some important bug fixes
 1.2.2.3 26-Jul-1993  cgd Fixed logic problem which caused a bogus value to be written to the 3c503
asic register even if the board isn't a 3c503. This caused old 8003E's not
to work because they ignore IO address bits >10bits and the 3c503 asic is
located at +0x400....the offset was ignored by the 8003E and so the
value was written to one of the NIC registers. The bug was discovered by
Wolfgang Solfrank.
 1.2.2.2 21-Jul-1993  cgd from davidg:
Added config file override for memory size and added flags to force
8bit or 16bit operation, and a flag to disable transmitter double buffering.
See the updated "ed.relnotes" file for information about how to set
the flags.
This should be considered the first "production" release. It still
needs a manual page, though.
 1.2.2.1 20-Jul-1993  cgd Fixed to allow iosiz config parameter to override what was (for jkh,
incorrectly) probed. This allows you more flexibility in getting weird
WD 80x3 clones to work.
 1.8.2.21 10-Feb-1994  mycroft Forgot to convert a couple of bits in the multicast code.
 1.8.2.20 10-Feb-1994  mycroft Typod a constant name in the last change.
 1.8.2.19 10-Feb-1994  mycroft Format police.
 1.8.2.18 10-Feb-1994  mycroft Avoid lots of unneeded ifs.
 1.8.2.17 08-Feb-1994  mycroft Changes to some flags were not being picked up. Part of a patch but Brad
Parker <brad@fcr.com>.
 1.8.2.16 02-Feb-1994  mycroft Add support for more cards, from Andreas Schulz, Thomas Sandford, and Glen
Lowe.
 1.8.2.15 02-Feb-1994  mycroft Change second arg of probe to self, and undo kluges to work around this stupid
deficiency in autoconfig. Also, make the multicast code that nobody ever
compiled actually compile.
 1.8.2.14 02-Feb-1994  mycroft A few nits.
 1.8.2.13 02-Feb-1994  mycroft Clean up cruft in multicast code.
 1.8.2.12 01-Feb-1994  mycroft Fix a couple of bogons.
 1.8.2.11 01-Feb-1994  mycroft Add multicast stuff.
 1.8.2.10 10-Dec-1993  cgd LLC -> LINK
 1.8.2.9 03-Dec-1993  mycroft Implement SIOCGIFADDR.
 1.8.2.8 03-Dec-1993  mycroft Implement SIOCGIFADDR.
 1.8.2.7 02-Dec-1993  mycroft Various minor cleanup.
 1.8.2.6 03-Nov-1993  mycroft Update to reflect global changes, and some other cleanup.
 1.8.2.5 29-Oct-1993  mycroft Prototype everything.
 1.8.2.4 29-Oct-1993  mycroft Fix typo in last change.
 1.8.2.3 29-Oct-1993  mycroft Return a proper value from edintr(). Remove some debugging code.
 1.8.2.2 29-Oct-1993  mycroft Initial version for new config. Could use some cleanup.
 1.8.2.1 14-Sep-1993  mycroft New i386 code.
 1.49.2.3 14-Oct-1994  mycroft Update from trunk.
 1.49.2.2 12-Oct-1994  mycroft Update from trunk.
 1.49.2.1 06-Oct-1994  mycroft Update from trunk.
 1.14 01-Mar-1995  mycroft Clean up deleted files.
 1.13 02-Jan-1995  mycroft Use soft configuration where possible.
 1.12 27-Oct-1994  cgd new RCS ID format.
 1.11 23-Oct-1994  mycroft Fix the packet length correction for buggy chips so that it actually works,
and always use it (otherwise short packets could still be corrupted). Also
produce a diagnostic message if DIAGNOSTIC, since it *is* a hardware bug.
Add an ED_PAGE_SHIFT constant, and use it, to avoid GCC doing horrendous
things with divides and multiplies.
 1.10 01-Oct-1994  mycroft Various minor changes to sync better with DG's version.
 1.9 14-Apr-1994  mycroft branches: 1.9.2;
Patches from David Greenman to eliminate magic constants and add delays when
switching to and fro 16-bit access for 790s.
 1.8 02-Mar-1994  mycroft Add 8003W and 8003EB, per David Greenman.
 1.7 13-Feb-1994  mycroft Format police.
 1.6 12-Feb-1994  mycroft Support for several new cards pulled from magnum branch.
Format police.
 1.5 01-Oct-1993  davidg * Revision 2.5 93/09/30 17:44:14 davidg
* patch from vak@zebub.msk.su (Serge V.Vakulenko) to work around
* a hardware bug in cheap WD clone boards where the PROM checksum
* byte is always zero
*
* Revision 2.4 93/09/29 21:24:30 davidg
* Added software NIC reset in NE probe to work around a problem
* with some NE boards where the 8390 doesn't reset properly on
* power-up. Remove initialization of IMR/ISR in the NE probe
* because this is inherent in the reset.
*
* Revision 2.3 93/09/29 15:10:16 davidg
* credit Charles Hannum
*
* Revision 2.2 93/09/29 13:23:25 davidg
* added no multi-buffer override for 3c503
*
* Revision 2.1 93/09/29 12:32:12 davidg
* changed multi-buffer count for 16bit 3c503's from 5 to 2 after
* noticing that the transmitter becomes idle because of so many
* packets to load.
*
* Revision 2.0 93/09/29 00:00:19 davidg
* many changes, rewrites, additions, etc. Now supports the
* NE1000, NE2000, WD8003, WD8013, 3C503, 16bit 3C503, and
* a variety of similar clones. 16bit 3c503 now does multi
* transmit buffers. Nearly every part of the driver has
* changed in some way since rev 1.30.
 1.4 09-Sep-1993  davidg branches: 1.4.2;
As of this revision, all known bugs have been fixed. Some of the fixes include:

1) fixed 3c503 lock-up if the thinwire cable was disconnected at boot time
2) 8013EBT boards now work (quite well!) in 16bit/16k mode
3) ED_NO_DOUBLE_BUFFERING flag now works
4) slightly higer performance (about 3%) with 16bit WD/SMC boards
5) support for WD8013WC (10BaseT) boards

Additionally, the probe code has been reorganized to be much cleaner. This
revision of the driver is 1.25. The release notes have been updated as well.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 28-Jul-1993  cgd incorporate changes from 0-9-base to 0-9-ALPHA
 1.1 03-Jul-1993  cgd branches: 1.1.2;
add support for David Greenman "ed" driver
 1.1.2.1 21-Jul-1993  cgd from davidg:
Added config file override for memory size and added flags to force
8bit or 16bit operation, and a flag to disable transmitter double buffering.
See the updated "ed.relnotes" file for information about how to set
the flags.
This should be considered the first "production" release. It still
needs a manual page, though.
 1.4.2.3 02-Feb-1994  mycroft Add support for more cards, from Andreas Schulz, Thomas Sandford, and Glen
Lowe.
 1.4.2.2 29-Oct-1993  mycroft Initial version for new config. Could use some cleanup.
 1.4.2.1 14-Sep-1993  mycroft New i386 code.
 1.9.2.1 06-Oct-1994  mycroft Update from trunk.
 1.10 01-Mar-1995  mycroft Clean up deleted files.
 1.9 03-Jan-1995  mycroft Add interrupt sharing types.
 1.8 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.7 04-Nov-1994  mycroft Trivial stylistic changes.
 1.6 03-Nov-1994  mycroft Update to match autoconfig code.
 1.5 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.4 27-Oct-1994  cgd new RCS ID format.
 1.3 25-Aug-1994  deraadt fix debugging stuff, from dean
 1.2 23-Aug-1994  mycroft branches: 1.2.2;
Some cleanup, checked by Dean.
 1.1 23-Aug-1994  deraadt add `eg' driver for the 3c505 by <dean@fsa.ca>
 1.2.2.2 26-Aug-1994  mycroft update from trunk
 1.2.2.1 23-Aug-1994  mycroft file if_eg.c was added on branch netbsd-1-0 on 1994-08-26 12:44:09 +0000
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 27-Oct-1994  cgd new RCS ID format.
 1.1 23-Aug-1994  deraadt branches: 1.1.2;
add `eg' driver for the 3c505 by <dean@fsa.ca>
 1.1.2.2 23-Aug-1994  deraadt add `eg' driver for the 3c505 by <dean@fsa.ca>
 1.1.2.1 23-Aug-1994  deraadt file if_egreg.h was added on branch netbsd-1-0 on 1994-08-23 18:00:11 +0000
 1.21 01-Mar-1995  mycroft Clean up deleted files.
 1.20 03-Jan-1995  mycroft Add interrupt sharing types.
 1.19 10-Dec-1994  mycroft Fix format of attach message.
 1.18 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.17 04-Nov-1994  mycroft No longer needs icu.h.
 1.16 03-Nov-1994  mycroft Update to match autoconfig code.
 1.15 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.14 27-Oct-1994  cgd new RCS ID format.
 1.13 13-May-1994  mycroft Use ether_ifattach() rather than doing the same thing in each driver.
 1.12 11-May-1994  mycroft Fill in some more struct ifnet fields.
 1.11 24-Apr-1994  mycroft Don't need isa.h.
 1.10 08-Apr-1994  mycroft Fix return values from some interrupt routines.
 1.9 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.8 29-Mar-1994  mycroft Updates for new autoconfig.
 1.7 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.6 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.5 03-Mar-1994  mycroft Upload the ether address to the card after a reset, per Matt Kimmel.
 1.4 02-Mar-1994  mycroft Increment outbound packet count, per Matt Kimmel.
 1.3 01-Mar-1994  mycroft Clean up a bit more; make it look like other drivers. Remove SIOCGIFADDR.
 1.2 01-Mar-1994  cgd format cop, plus fix up ether_type byte order difference.
things that i think look bogus are marked "XXX" with "cgd" in the
same line; some enet-savvy person should look through them.
 1.1 01-Mar-1994  hpeyerl Driver for 3Com Etherlink (3c501)
>From Matthew E. Kimmel (kimmel@cs.umass.edu)
 1.5 01-Mar-1995  mycroft Clean up deleted files.
 1.4 27-Oct-1994  cgd new RCS ID format.
 1.3 01-Mar-1994  mycroft Clean up a bit more; make it look like other drivers. Remove SIOCGIFADDR.
 1.2 01-Mar-1994  cgd format cop, plus fix up ether_type byte order difference.
things that i think look bogus are marked "XXX" with "cgd" in the
same line; some enet-savvy person should look through them.
 1.1 01-Mar-1994  hpeyerl Driver for 3Com Etherlink (3c501)
>From Matthew E. Kimmel (kimmel@cs.umass.edu)
 1.69 01-Mar-1995  mycroft Clean up deleted files.
 1.68 22-Jan-1995  mycroft Fix the problem with identifying cards on warm boot. Partly from Greg Hudson.
 1.67 07-Jan-1995  mycroft Actually, do the ID reset in elink_reset().
 1.66 06-Jan-1995  mycroft Do the reset in the individual drivers, not in elink_idseq().
 1.65 03-Jan-1995  mycroft Add interrupt sharing types.
 1.64 28-Dec-1994  hpeyerl temporary warning until I get new docs.
 1.63 10-Dec-1994  christos 3c509 fixes to avoid adapter getting stuck in high traffic conditions.
I don't particularly like the fixes, but at least now the 3c509 never
gets stuck. On the other hand, performance still sucks in some cases.
 1.62 25-Nov-1994  christos fix unary plus typo :-)
 1.61 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.60 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.59 03-Nov-1994  mycroft Update to match autoconfig code.
 1.58 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.57 27-Oct-1994  cgd new RCS ID format.
 1.56 05-Sep-1994  mycroft Missed an iobase that should be u_short.
 1.55 26-Aug-1994  mycroft Minor.
 1.54 26-Aug-1994  deraadt Re-enable EISA reset code -- definately needed now. do RX_DISCARD_TOP_PACK
before leaving splhigh(), to give incoming packets a better chance.
 1.53 23-Aug-1994  mycroft Various code cleanup.
 1.52 17-Aug-1994  deraadt multicast
 1.51 14-Aug-1994  mycroft Re-enable EISA reset.
 1.50 06-Aug-1994  deraadt cleanup
 1.49 05-Aug-1994  deraadt cleanup, working 32 bit IO on the 3c579, and memory alignment of insl/insw
for better performance.
 1.48 28-Jul-1994  mycroft Redux.
 1.47 28-Jul-1994  mycroft port --> iobase
 1.46 28-Jul-1994  mycroft Make the EISA reset code like the other drivers.
 1.45 21-Jul-1994  mycroft Remove something which cannot possibly be correct.
 1.44 21-Jul-1994  mycroft Do the EISA probing a little differently.
 1.43 21-Jul-1994  deraadt check if eisa card exists before tromping on dma
 1.42 01-Jul-1994  deraadt branches: 1.42.2;
modifications to the threshold and nicer error checking from christos
and .. splhigh() around insw/outsw code.. yetch
 1.41 04-Jun-1994  deraadt two fixes from christos
 1.40 25-May-1994  hpeyerl Copyright foo.
 1.39 24-May-1994  mycroft MIN --> min
 1.38 21-May-1994  deraadt 32bit eisa does not work now, do not even try
 1.37 13-May-1994  mycroft Use ether_ifattach() rather than doing the same thing in each driver.
 1.36 11-May-1994  mycroft Fill in some more struct ifnet fields.
 1.35 02-May-1994  deraadt insw takes a word count
 1.34 24-Apr-1994  deraadt bit better now, fixes from me & charles. squishy squishy squishy. HI ADAM!
 1.33 23-Apr-1994  hpeyerl Some changes from Charles, Adam and Christos Zoulas.
 1.32 18-Apr-1994  deraadt queue up 8 mbuf chains once again, perhaps this will help?
read packets of the card before attempting to transmit (should improve speed)
 1.31 16-Apr-1994  deraadt first attempt at EISA 32bit IO support. it still doesn't work so it's
disabled.
 1.30 15-Apr-1994  deraadt support multicast and promiscious mode
correct mbuf queue bugs, cleanup some extra symbols
try to let link0/link1 change while running, will this work?
 1.29 13-Apr-1994  deraadt deallocate mbuf cache on ifconfig down.
 1.28 11-Apr-1994  deraadt support multiple eisa/isa cards.
 1.27 08-Apr-1994  mycroft Fix return fro isa_epprobe().
 1.26 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.25 29-Mar-1994  mycroft Updates for new autoconfig.
 1.24 14-Mar-1994  hpeyerl Fix for trailer support reported by <sommerfeld@orchard.medford.ma.us>
 1.23 09-Mar-1994  mycroft Fix NS handling.
 1.22 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.21 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.20 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.19 04-Mar-1994  hpeyerl New probe for 3c579's (EISA). EISA cards still don't work but I
have no idea when I'll be able to work on this next.
 1.18 16-Feb-1994  mycroft Move elink_reset() into a separate file, and add a generic elink_idseq().
 1.17 16-Feb-1994  hpeyerl Add common reset function so if_ep and if_ie don't reset each-other.
(this is a 3commonality)
 1.16 15-Feb-1994  mycroft Make epsendidseq() look less like it was transliterated from assembler.
 1.15 14-Feb-1994  hpeyerl Pedantism. Should delay after stopping Coax xcvr.
 1.14 14-Feb-1994  deraadt missing spl's
 1.13 10-Feb-1994  mycroft Nuke if_init.
 1.12 04-Feb-1994  hpeyerl Fix UTP enabling/disabling.
 1.11 28-Jan-1994  jtc branches: 1.11.2;
Fix spelling error in Copyright notice
 1.10 28-Jan-1994  deraadt cleanup
 1.9 25-Jan-1994  deraadt can't use m_pkthdr.len yet, *sigh*
 1.8 24-Jan-1994  deraadt ether_input() takes a network byte order ether_type now
 1.7 23-Jan-1994  deraadt protos, cleanup spl's, bpf receive side code, check for large packets,
various other fixes.
 1.6 21-Jan-1994  hpeyerl From the knights that go "nit".(Tom Bishop <bishop@lear.bos.locus.com>)
 1.5 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.4 16-Dec-1993  hpeyerl IFF_LLC0->IFF_LINK0
 1.3 16-Dec-1993  hpeyerl oh my... make NS work.
(mental note to check more thoroughly in future)
 1.2 16-Dec-1993  hpeyerl Octal; Hex... It's all the same... :-)
>From deaven@ishmael.ameslab.gov
 1.1 14-Dec-1993  hpeyerl Driver for 3Com Etherlink-III (3c509) written by me. Kudos to Charles
and Theo for help and optimizations. (without which this driver would
never have achieved speeds of 1010KB/sec)
 1.11.2.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.11.2.1 28-Jan-1994  jtc file if_ep.c was added on branch magnum on 1994-01-28 23:44:37 +0000
 1.42.2.7 06-Oct-1994  mycroft Update from trunk.
 1.42.2.6 26-Aug-1994  mycroft update from trunk
 1.42.2.5 23-Aug-1994  mycroft update from trunk
 1.42.2.4 14-Aug-1994  mycroft update from trunk (minor)
 1.42.2.3 05-Aug-1994  mycroft update from trunk
 1.42.2.2 29-Jul-1994  cgd from trunk.
 1.42.2.1 21-Jul-1994  cgd updates from trunk.
 1.13 01-Mar-1995  mycroft Clean up deleted files.
 1.12 22-Jan-1995  mycroft Fix the problem with identifying cards on warm boot. Partly from Greg Hudson.
 1.11 10-Dec-1994  christos 3c509 fixes to avoid adapter getting stuck in high traffic conditions.
I don't particularly like the fixes, but at least now the 3c509 never
gets stuck. On the other hand, performance still sucks in some cases.
 1.10 27-Oct-1994  cgd new RCS ID format.
 1.9 28-Jul-1994  mycroft Make the EISA reset code like the other drivers.
 1.8 21-Jul-1994  mycroft Fix a typo.
 1.7 21-Jul-1994  mycroft Do the EISA probing a little differently.
 1.6 21-Jul-1994  deraadt check if eisa card exists before tromping on dma
 1.5 01-Jul-1994  deraadt branches: 1.5.2;
modifications to the threshold and nicer error checking from christos
and .. splhigh() around insw/outsw code.. yetch
 1.4 15-Apr-1994  deraadt support multicast and promiscious mode
correct mbuf queue bugs, cleanup some extra symbols
try to let link0/link1 change while running, will this work?
 1.3 29-Mar-1994  mycroft Updates for new autoconfig.
 1.2 28-Jan-1994  jtc branches: 1.2.2;
Fix spelling error in Copyright notice
 1.1 14-Dec-1993  hpeyerl Driver for 3Com Etherlink-III (3c509) written by me. Kudos to Charles
and Theo for help and optimizations. (without which this driver would
never have achieved speeds of 1010KB/sec)
 1.2.2.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.2.2.1 28-Jan-1994  jtc file if_epreg.h was added on branch magnum on 1994-01-28 23:44:42 +0000
 1.5.2.2 29-Jul-1994  cgd from trunk.
 1.5.2.1 21-Jul-1994  cgd updates from trunk.
 1.19 01-Mar-1995  mycroft Clean up deleted files.
 1.18 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.17 27-Oct-1994  cgd new RCS ID format.
 1.16 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.15 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.14 10-Feb-1994  mycroft Nuke if_init.
 1.13 24-Jan-1994  deraadt ether_input() takes a network byte order ether_type now
 1.12 12-Jan-1994  mycroft Use pkthdr.len field.
 1.11 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.10 06-Sep-1993  mycroft Avoid clash of struct ns_addr with #define ns_addr.
 1.9 13-Jul-1993  mycroft Use splnet, not splimp.
 1.8 01-Jul-1993  mycroft Fix a bunch of things.
 1.7 22-May-1993  cgd add rcsids to everything and clean up headers
 1.6 01-May-1993  mycroft Fix error in last change. B-P
 1.5 30-Apr-1993  mycroft Move bpfattach() call into hpattach().
 1.4 28-Apr-1993  mycroft HP cards use 32 I/O ports, not 16.
 1.3 18-Apr-1993  mycroft Return correct value for new probe sequence.
 1.2 17-Apr-1993  mycroft Use new format for attach message.
 1.1 17-Apr-1993  mycroft Add driver for HP ISA and EISA ethernet adapters.
 1.32 01-Mar-1995  mycroft Clean up deleted files.
 1.31 29-Jan-1995  cgd use chip headers in /dev/ic
 1.30 26-Jan-1995  mycroft Initialize the new xmit state correctly. From Rafal Boni.
 1.29 23-Jan-1995  mycroft Various changes from Rafal Boni to improve performance and reliability. Also,
clean up the formatting a little more.
 1.28 07-Jan-1995  mycroft Actually, do the ID reset in elink_reset().
 1.27 06-Jan-1995  mycroft Do the reset in the individual drivers, not in elink_idseq().
 1.26 03-Jan-1995  mycroft Add interrupt sharing types.
 1.25 02-Jan-1995  mycroft Move setting of sc_maddr so soft config works.
 1.24 02-Jan-1995  mycroft Use soft configuration when possible.
 1.23 02-Jan-1995  mycroft More cleanup.
 1.22 02-Jan-1995  mycroft Various cleanup.
 1.21 02-Jan-1995  mycroft Need isareg.h.
 1.20 02-Jan-1995  mycroft Don't assume ia_maddr is in the hole.
 1.19 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.18 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.17 03-Nov-1994  mycroft Update to match autoconfig code.
 1.16 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.15 27-Oct-1994  cgd new RCS ID format.
 1.14 18-Oct-1994  mycroft Bug fixes from Rafal Boni:
* Set promiscuous mode flag before configuring card, so it actually works.
* Handle failed TDR commands correctly.
* Remove some apparently defunct and bogus code.
(This driver needs more work.)
 1.13 14-Aug-1994  mycroft Clean up a little.
 1.12 16-Jul-1994  mycroft Fix failed probe message.
 1.11 13-May-1994  mycroft branches: 1.11.2;
Use ether_ifattach() rather than doing the same thing in each driver.
 1.10 11-May-1994  mycroft Fill in some more struct ifnet fields.
 1.9 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.8 31-Mar-1994  mycroft Some patches from Rafal Boni to fix egregious 3C507 mistakes.
 1.7 29-Mar-1994  mycroft Updates for new autoconfig.
 1.6 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.5 16-Feb-1994  mycroft Fix the credits.
 1.4 16-Feb-1994  mycroft Finish 507 probe routine.
 1.3 15-Feb-1994  mycroft Pull from magnum branch. The way this driver does multicast is somewhat
bogus.
 1.2 24-Jan-1994  deraadt ether_input() takes a network byte order ether_type now
 1.1 08-Nov-1993  mycroft branches: 1.1.2;
A slightly unfinished i82586 driver, based on Garrett Wollman's.
 1.1.2.4 02-Feb-1994  mycroft Deal with new byte order of ether_type.
 1.1.2.3 02-Feb-1994  mycroft Change second arg of probe to self.
 1.1.2.2 03-Dec-1993  mycroft Implement SIOCGIFADDR.
 1.1.2.1 08-Nov-1993  mycroft file if_ie.c was added on branch magnum on 1993-12-03 03:56:21 +0000
 1.11.2.2 18-Oct-1994  cgd from trunk.
 1.11.2.1 14-Aug-1994  mycroft update from trunk
 1.6 01-Mar-1995  mycroft Clean up deleted files.
 1.5 23-Jan-1995  mycroft Various changes from Rafal Boni to improve performance and reliability. Also,
clean up the formatting a little more.
 1.4 27-Oct-1994  cgd new RCS ID format.
 1.3 31-Mar-1994  mycroft Some patches from Rafal Boni to fix egregious 3C507 mistakes.
 1.2 16-Feb-1994  mycroft Finish 507 probe routine.
 1.1 08-Nov-1993  mycroft branches: 1.1.2;
A slightly unfinished i82586 driver, based on Garrett Wollman's.
 1.1.2.2 08-Nov-1993  mycroft A slightly unfinished i82586 driver, based on Garrett Wollman's.
 1.1.2.1 08-Nov-1993  mycroft file if_ie507.h was added on branch magnum on 1993-11-08 20:15:58 +0000
 1.3 01-Mar-1995  mycroft Clean up deleted files.
 1.2 27-Oct-1994  cgd new RCS ID format.
 1.1 08-Nov-1993  mycroft branches: 1.1.2;
A slightly unfinished i82586 driver, based on Garrett Wollman's.
 1.1.2.2 08-Nov-1993  mycroft A slightly unfinished i82586 driver, based on Garrett Wollman's.
 1.1.2.1 08-Nov-1993  mycroft file if_ieatt.h was added on branch magnum on 1993-11-08 20:16:00 +0000
 1.32 01-Jul-1994  mycroft Clean up deleted files.
 1.31 13-May-1994  mycroft Fix prototype.
 1.30 13-May-1994  mycroft Use ether_ifattach() rather than doing the same thing in each driver.
 1.29 11-May-1994  mycroft Fill in some more struct ifnet fields.
 1.28 22-Apr-1994  mycroft Separate DMA functions.
 1.27 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.26 29-Mar-1994  mycroft Updates for new autoconfig.
 1.25 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.24 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.23 16-Feb-1994  mycroft Fix typo.
 1.22 16-Feb-1994  mycroft Use IFF_ALLMULTI correctly.
 1.21 15-Feb-1994  mycroft Hack to make this closer to new config.
 1.20 15-Feb-1994  mycroft Forgot a break.
 1.19 15-Feb-1994  mycroft Shorten the todo list.
 1.18 15-Feb-1994  mycroft Add NE2100 and multicast support, and clean up some formatting.
 1.17 10-Feb-1994  mycroft Nuke if_init.
 1.16 24-Jan-1994  deraadt ether_input() takes a network byte order ether_type now
 1.15 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.14 25-Oct-1993  paul Latest version of isolan driver.

Replaced all static arrays with malloc'ed memory.
Added code so that debug ioctl actually does something.
 1.13 06-Sep-1993  mycroft branches: 1.13.2;
Move the `#include "bpfilter.h"' to a more logical and easy to find place.
 1.12 06-Sep-1993  mycroft Update for new select(), and fix another `struct arpcom.ac_enaddr'.
 1.11 03-Aug-1993  mycroft Fix bogus use of splx() in is_reset().
 1.10 02-Aug-1993  mycroft Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.9 28-Jul-1993  cgd incorporate changes from 0-9-base to 0-9-ALPHA
 1.8 21-Jul-1993  paul Added arpcom counters ipackets, opackets etc.
 1.7 11-Jul-1993  paul branches: 1.7.2;
Made boot up messages cleaner
 1.6 11-Jul-1993  paul New isolan driver. Multiple card and bpf support added.
 1.5 22-May-1993  cgd add rcsids to everything and clean up headers
 1.4 18-Apr-1993  mycroft Return correct value for new probe sequence.
 1.3 10-Apr-1993  glass Fixed so they are useable when compiled with options NS. Not that I know
anyone who will.....
 1.2 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.2.1 21-Jul-1993  cgd update for counter additions by paul, and fix printfs (me)
 1.13.2.8 02-Feb-1994  mycroft Various cleanup.
 1.13.2.7 02-Feb-1994  mycroft Fix one small glitch...
 1.13.2.6 02-Feb-1994  mycroft NE2100 changes from Paul, plus some other cleanup.
 1.13.2.5 02-Feb-1994  mycroft Deal with new byte order of ether_type.
 1.13.2.4 03-Dec-1993  mycroft Implement SIOCGIFADDR.
 1.13.2.3 09-Nov-1993  mycroft Fix promiscuous mode handling.
 1.13.2.2 04-Nov-1993  mycroft Experimental is_forceintr().
 1.13.2.1 03-Nov-1993  mycroft Update for new config, and some cleanup.
 1.7 01-Jul-1994  mycroft Clean up deleted files.
 1.6 15-Feb-1994  mycroft Add NE2100 and multicast support, and clean up some formatting.
 1.5 25-Oct-1993  paul Latest version of isolan driver.

Replaced all static arrays with malloc'ed memory.
Added code so that debug ioctl actually does something.
 1.4 02-Aug-1993  mycroft branches: 1.4.2;
Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.3 11-Jul-1993  paul New isolan driver. Multiple card and bpf support added.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.2.2 02-Feb-1994  mycroft Add board a chip #defines, per Paul.
 1.4.2.1 03-Nov-1993  mycroft Update for new config, and some cleanup.
 1.23 01-Mar-1995  mycroft Clean up deleted files.
 1.22 03-Jan-1995  mycroft Add interrupt sharing types.
 1.21 02-Jan-1995  mycroft Need isareg.h.
 1.20 02-Jan-1995  mycroft Don't assume ia_maddr is in the hole.
 1.19 12-Dec-1994  mycroft Make the diagnostics less cryptic.
 1.18 12-Dec-1994  mycroft Patch from Thomas Eberhardt to make PCnet-32 chips work.
 1.17 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.16 04-Nov-1994  mycroft No longer needs icu.h.
 1.15 03-Nov-1994  mycroft Update to match autoconfig code.
 1.14 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.13 27-Oct-1994  cgd new RCS ID format.
 1.12 09-Oct-1994  mycroft Correct multicast filter calculation.
 1.11 07-Aug-1994  mycroft Simplify the DEPCA memory test, and fix a problem with using the alternate
PROM address.
 1.10 25-Jul-1994  mycroft Look for errors in the right place in a transmit descriptor, and count
collisions.
 1.9 15-Jul-1994  mycroft Fix a bogon relating to >16-bit addresses that I introduced. Fix up BPF
support for received packets.
 1.8 10-Jul-1994  mycroft Clean up a bit.
 1.7 05-Jul-1994  mycroft branches: 1.7.2;
Rename flags; clean up a bit.
 1.6 02-Jul-1994  mycroft ISDEBUG --> LEDEBUG, and fix some ugly code.
 1.5 01-Jul-1994  mycroft Make sure we don't leave the interrupt masked after some errors.
 1.4 01-Jul-1994  mycroft Inline le{rd,wr}csr().
 1.3 01-Jul-1994  mycroft Add prototype.
 1.2 01-Jul-1994  mycroft Correct some comments.
 1.1 01-Jul-1994  mycroft Rename is to le, and add support for some models of DEPCA.
 1.7.2.5 09-Oct-1994  mycroft Update from trunk.
 1.7.2.4 07-Aug-1994  mycroft update from trunk
 1.7.2.3 26-Jul-1994  cgd from trunk.
 1.7.2.2 15-Jul-1994  cgd update from trunk.
 1.7.2.1 13-Jul-1994  cgd from trunk, per mycroft
 1.4 01-Mar-1995  mycroft Clean up deleted files.
 1.3 27-Oct-1994  cgd new RCS ID format.
 1.2 05-Jul-1994  mycroft Rename flags; clean up a bit.
 1.1 01-Jul-1994  mycroft Rename is to le, and add support for some models of DEPCA.
 1.17 26-Jan-1994  mycroft Clean up deleted files.
 1.16 24-Jan-1994  deraadt ether_input() takes a network byte order ether_type now
 1.15 15-Jan-1994  briggs undefined variable defined.
 1.14 12-Jan-1994  mycroft Use pkthdr.len field.
 1.13 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.12 01-Oct-1993  mycroft Display a less cryptic message when the ring buffer overflows.
 1.11 01-Oct-1993  mycroft Fix probe routine to work for multiple controllers.
 1.10 01-Oct-1993  mycroft Read ethernet address correctly on NE1000 boards.
 1.9 17-Jul-1993  mycroft Stylistic change to attach message to match others.
 1.8 15-Jul-1993  deraadt patch from <ache@astral.msk.su> to fix problems:
nestart() logic totally rewriten, neput() code moved out of loop.
Fixed error in rxend buffer size: assing 32768 to short.
nerecv() fixed for correct buffer sizes for NE1000.
Detected card type displayed at autoconf time.
 1.7 14-Jun-1993  mycroft Rework neread(), and add BPF hooks for receiving. (Still need BPF hook
for transmitting.)
 1.6 14-Jun-1993  mycroft 8390-based boards use 16 ports, not 8.
 1.5 22-May-1993  cgd add rcsids to everything and clean up headers
 1.4 18-Apr-1993  mycroft Return correct value for new probe sequence.
 1.3 17-Apr-1993  mycroft Use new format for attach message.
 1.2 10-Apr-1993  glass Fixed so they are useable when compiled with options NS. Not that I know
anyone who will.....
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3 26-Jan-1994  mycroft Clean up deleted files.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.14 25-Jan-1994  mycroft Clean up deleted files.
 1.13 24-Jan-1994  deraadt ether_input() takes a network byte order ether_type now
 1.12 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.11 03-Aug-1993  mycroft Nuke RCS log.
 1.10 20-May-1993  deraadt we driver prints same ethernet address message as other drivers
 1.9 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.8 01-May-1993  mycroft Fix error in last change. B-P
 1.7 30-Apr-1993  mycroft Move bpfattach() call into weattach().
 1.6 29-Apr-1993  mycroft Fix total bogosity in the receiver code.
 1.5 10-Apr-1993  glass Fixed so they are useable when compiled with options NS. Not that I know
anyone who will.....
 1.4 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.3 24-Mar-1993  cgd brought in drivers from David Greenman's (davidg@implode.rain.com)
BPF package
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6 25-Jan-1994  mycroft Clean up deleted files.
 1.5 22-May-1993  cgd add rcsids to everything and clean up headers
 1.4 21-May-1993  cgd Add reception of multicasts for if_we when using ISO, and add soft
interrupt handler for ISO.
(from Havard Eidnes <Havard.Eidnes@runit.sintef.no>)
 1.3 24-Mar-1993  cgd brought in drivers from David Greenman's (davidg@implode.rain.com)
BPF package
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.28 17-Apr-1995  cgd oops; forgot to delete this with my ISA autoconfig changes earlier
 1.27 03-Jan-1995  mycroft Add interrupt sharing types.
 1.26 18-Nov-1994  mycroft Remove Xwild; it's no longer used.
 1.25 04-Nov-1994  mycroft Make IRQ_SLAVE a plain number, too, and remove IRQ{0-15}.
 1.24 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.23 27-Oct-1994  cgd new RCS ID format.
 1.22 26-Oct-1994  mycroft Implement new system call entry method. Clean up all of the IDT frobnication
code.
 1.21 05-May-1994  mycroft Completely redo the way masks are calculated, and make splimp() correct in the
presence of SLIP or PPP.
 1.20 28-Apr-1994  mycroft Set ICUs to read IRR by default.
 1.19 25-Apr-1994  mycroft Implement intr_disestablish().
 1.18 24-Apr-1994  mycroft Rename two files.
 1.17 07-Apr-1994  mycroft splbio() should also block timeouts.
 1.16 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.15 05-Dec-1993  mycroft Turn off special mask mode by default. It is clearly not supported enough.
 1.14 01-Nov-1993  mycroft Take advantage of special mask mode by leaving interrupts masked in ISR until
they are serviced. No need to frob IMR.
 1.13 01-Nov-1993  mycroft Enable chaining IRQ only if we're using an IRQ on the slave. Other minor
cleanup.
 1.12 31-Oct-1993  mycroft Grumble. Just set the blasted ICU mode before every read. Also, send the EOIs
to the right port in isa_flushintrs().
 1.11 31-Oct-1993  mycroft Need to change to reading ISR in isa_discoverintr().
 1.10 31-Oct-1993  mycroft Read ISR by default. If DIAGNOSTIC, display ISR and IRR status for stray
interrupts.
 1.9 31-Oct-1993  mycroft Rearrange IDT initialization so it's easier to change ICU_OFFSET.
 1.8 27-Oct-1993  mycroft isa_discoverintr(): Also check ipending, in case the interrupt is being shared.
Use delay() for timeout rather than timer channel 2.
 1.7 27-Oct-1993  mycroft Reenable interrupts in ipending before resetting it.
 1.6 27-Oct-1993  mycroft Arrange that IF is on but we are at splhigh() during autoconfig. Clear
ipending in isa_flushintrs().
 1.5 26-Oct-1993  mycroft Stylistic change to IDT initialization.
 1.4 26-Oct-1993  mycroft Replace a %s with %x.
 1.3 26-Oct-1993  mycroft Fix IDT initialization bug. Don't allow IRQ 0 to be autoconfigured.
 1.2 22-Oct-1993  mycroft It does not make sense to mask a fastintr.
 1.1 22-Oct-1993  mycroft New file with interrupt-handling code. Add intr_fasttrap().
 1.72 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.71 16-Jan-1995  mycroft Remove outdated comment.
 1.70 02-Jan-1995  mycroft Don't assume ia_maddr is in the hole.
 1.69 18-Nov-1994  mycroft Stylistic changes.
 1.68 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.67 14-Nov-1994  mycroft Map IRQ 2 to IRQ 9.
 1.66 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.65 04-Nov-1994  mycroft Use kvtop() rather than address arithmetic in a couple of places.
 1.64 04-Nov-1994  mycroft Add a new function config_scan(), which just calls a particular function
with each plausibly cfdata, ignoring the priority mechanism completely.
 1.63 04-Nov-1994  mycroft Commit incest with the config system for this one specific case.
 1.62 04-Nov-1994  mycroft Set ia_irq correctly.
 1.61 04-Nov-1994  mycroft Correct an oversight.
 1.60 04-Nov-1994  mycroft Oops; forgot isacd.
 1.59 03-Nov-1994  mycroft New version using standard config_*() functions.
 1.58 27-Oct-1994  cgd new RCS ID format.
 1.57 09-Oct-1994  mycroft Remove unneeded #includes.
 1.56 07-Oct-1994  mycroft Fix initial allocation of dev array, and simplify the code
slightly.
 1.55 05-May-1994  cgd branches: 1.55.2;
lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.54 03-May-1994  mycroft Forgot to munge the #includes in last commit.
 1.53 03-May-1994  mycroft Move beep junk to clock.c.
 1.52 24-Apr-1994  mycroft Rename two files.
 1.51 22-Apr-1994  mycroft Separate DMA functions.
 1.50 21-Apr-1994  mycroft Fix typo.
 1.49 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.48 03-Apr-1994  mycroft Clean up #includes.
 1.47 31-Mar-1994  mycroft Remove an old hack that now just causes a small memory leak during autoconfig.
 1.46 29-Mar-1994  mycroft New autoconfig mechanism. Hacked at the moment to use old config(8), but
look mostly like config.new to drivers.
 1.45 12-Mar-1994  mycroft Rearrange top-level configuration to be more consistent.
 1.44 10-Mar-1994  mycroft Update for new config; handles subdevices differently.
 1.43 10-Mar-1994  mycroft Add isa_dmaabort().
 1.42 09-Mar-1994  mycroft Back out previous change for now.
 1.41 08-Mar-1994  mycroft Inline spl*() calls.
 1.40 06-Mar-1994  mycroft Better delay() from magnum branch.
 1.39 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.38 01-Mar-1994  mycroft Remove some dead code.
 1.37 01-Mar-1994  mycroft Clean up DMA code. Mask and unmask channels. Warn if terminal count not
reached.
 1.36 22-Feb-1994  mycroft Add clockmask.
 1.35 22-Feb-1994  mycroft Add clockmask.
 1.34 16-Feb-1994  mycroft Move elink_reset() into a separate file, and add a generic elink_idseq().
 1.33 16-Feb-1994  hpeyerl Add common reset function so if_ep and if_ie don't reset each-other.
(this is a 3commonality)
 1.32 20-Dec-1993  mycroft Use cpufunc.h only where (currently) needed.
 1.31 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.30 17-Dec-1993  mycroft From magnum branch:
Remove Jolitz's netisr kluge. Make sure cpl == 0 really means base priority.
Other minor cleanup.
 1.29 05-Nov-1993  cgd note that use of splnone() is prolly bogus; splnone() itself is bogus,
so it's use is. 8-)
 1.28 28-Aug-1993  brezak branches: 1.28.2;
Add find_isadev() and have sysbeep() use common defines.
 1.27 08-Aug-1993  cgd there are some devices out there which use... NO I/O PORTS!
 1.26 11-Jul-1993  mycroft Make splimp = splnet | spltty, and get rid of SLIP kluge for splnet and
spltty.
 1.25 07-Jul-1993  cgd delete inclusion of rlist.h again. grr.
 1.24 06-Jul-1993  deraadt clean up code for timeout/untimeout/wakeup prototypes.
 1.23 06-Jul-1993  cgd get rid of extraneous inclusion of rlist.h
 1.22 30-Jun-1993  andrew Updated comments.
 1.21 27-Jun-1993  andrew ANSIfications.
 1.20 20-Jun-1993  deraadt print "maddr 0xd0000 msize 65536" as "maddr 0xd0000-0xdffff" instead.
 1.19 16-Jun-1993  mycroft Fix typo.
 1.18 16-Jun-1993  mycroft Make sysbeep() take a frequency, not a timer count, and add constants
BEEP_FREQ and BEEP_TIME which can be overridden in the config file.
 1.17 15-Jun-1993  mycroft Move definitions of TIMER_FREQ to timerreg.h, and fix value of CF for DELAY().
 1.16 15-Jun-1993  mycroft Clean up beep code a miniscule amount, add interrupt protection, and
make multiple beeps generate a continuous tone.
 1.15 06-Jun-1993  cgd incorporate Bruce Evans' interrupt changes, as hacked by Rod grimes,
for patchkit patch 158. it appears to work well.
 1.14 28-May-1993  deraadt 1. It is now possible to build a kernel that does not have a pc0 device driver.
2. "press any key to reboot" reads the key from the console.
3. wddump() still needs a non-blocking getc() routine (or flush)
 1.13 22-May-1993  cgd add rcsids to everything and clean up headers
 1.12 11-May-1993  deraadt Whoops. One more 0x0ffff to expunge..
 1.11 11-May-1993  deraadt 1. id_irq is a u_short
2. "irq ?" sets it to (u_short)-1
3. "irq #" sets it to (1<<#)
4. not specifying an interrupt sets it to 0.

Until someone else comes up with a better scheme, that's the way it is.
If you have a driver that turns the interrupt off, set it to ZERO.

If, after calling XXprobe(), id_irq is still (u_short)-1, that is the same
as if probe() failed.
 1.10 08-May-1993  deraadt multiple master controllers would probe tthe first one N times instead of
once each. never mind not worth worrying about what i;m talking about.
 1.9 07-May-1993  cgd no irq == -1, or, actually, 0x0ffff (f*ing unsigned short...).
this would break devices w/o interrupts (like lpa).
 1.8 04-May-1993  deraadt support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
 1.7 04-May-1993  cgd fixed loopback == nuke problem.
This fix is probably not optimal, but it works.
 1.6 15-Apr-1993  deraadt ioconf changes, see previous cvs's that dumped core
 1.5 09-Apr-1993  cgd make printing of i/o addresses a bit prettier, and fix off-by-one error.
 1.4 09-Apr-1993  cgd from Rodney W. Grimes (rgrimes@agora.rain.com) (patchkit patch 117):

This patch adds the symbol names to icu.s that vmstat expects
the interrupt counters to be called. It also adds code to config
so that the names of the interrupts are written at the end of vectors.s
so vmstat can report real device names. It also cleans up and enables
the logging of stray interrupts. The counters for false interrupts
are added but the fix for them is not (the fix I have is not done
very good.) A false interrupt is when a device asserts it's interrupt
signal, then removes it before the 8259 can latch it. This is the number
one cause of stray IRQ7's and IRQ15's.

Additional device probe information is now printed. This includes
ending I/O address (many drivers do not return the correct value from a
probe this still needs to be fixed), memory address and size, driver
flags passed in by config.
 1.3 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.28.2.22 01-Dec-1993  mycroft Remove silly hack to force a delay between beeps.
 1.28.2.21 08-Nov-1993  mycroft Minor cleanup.
 1.28.2.20 31-Oct-1993  mycroft IRQ_SLAVE should not be enabled here.
 1.28.2.19 27-Oct-1993  mycroft Arrange that IF is on but we are at splhigh() during autoconfig. Clear
ipending in isa_flushintrs().
 1.28.2.18 22-Oct-1993  mycroft Remove isa_nmi().
 1.28.2.17 22-Oct-1993  mycroft Remove interrupt handling code.
 1.28.2.16 18-Oct-1993  mycroft Preserve the order in which interrupt handlers on a particular are registered.
 1.28.2.15 17-Oct-1993  mycroft Minor cleanup.
 1.28.2.14 16-Oct-1993  mycroft Add isa_establish(), for all it's worth (which is to say, nothing).
 1.28.2.13 16-Oct-1993  mycroft Don't forget to enable the interrupt line when registering a handler.
Change the first argument to isa_mem{check,alloc}() to a caddr_t.
 1.28.2.12 16-Oct-1993  mycroft Add intr_establish(), and isa_intrmaskwickedness() to set up interrupt masks
after device configuration.
 1.28.2.11 15-Oct-1993  mycroft Rename some functions to match BSDI.
 1.28.2.10 15-Oct-1993  mycroft isa_discoverintr(): Ignore IRQ_SLAVE bit in ICU1.
 1.28.2.9 15-Oct-1993  mycroft Flush any pending interrupts at the end of autoconfig. Make isa_defaultirq
static.
 1.28.2.8 15-Oct-1993  mycroft Add isa_discoverintr().
 1.28.2.7 14-Oct-1993  mycroft Remove DMA gunk. Rewrite IDT initialization to use a table from locore.
Remove some defunct configuration code. Don't splhigh() in sysbeep() and
sysbeepstop().
 1.28.2.6 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.28.2.5 09-Oct-1993  mycroft Remove netmask kluge.
 1.28.2.4 06-Oct-1993  mycroft Announce quite clearly if ia_irq is still IRQUNK in isaprint() (if DIAGNOSTIC).
 1.28.2.3 30-Sep-1993  mycroft Print a warning if probe function leaves irq as IRQUNK with option DIAGNOSTIC.
 1.28.2.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.28.2.1 14-Sep-1993  mycroft New i386 code.
 1.55.2.2 11-Oct-1994  mycroft Update from trunk.
 1.55.2.1 07-Oct-1994  mycroft Update from trunk.
 1.20 04-Nov-1994  mycroft Clean up deleted files.
 1.19 27-Oct-1994  cgd new RCS ID format.
 1.18 24-Apr-1994  mycroft Still need this for config for now.
 1.17 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.16 29-Mar-1994  mycroft New autoconfig mechanism. Hacked at the moment to use old config(8), but
look mostly like config.new to drivers.
 1.15 16-Feb-1994  mycroft Move elink_reset() into a separate file, and add a generic elink_idseq().
 1.14 16-Feb-1994  hpeyerl Add common reset function so if_ep and if_ie don't reset each-other.
(this is a 3commonality)
 1.13 03-Jan-1994  mycroft Use KERNBASE, not 0xfe000000.
 1.12 16-Dec-1993  mycroft Remove an `#ifdef MACHINE_NONCONTIG', as it is now required.
 1.11 28-Aug-1993  brezak branches: 1.11.2;
i386 Machine dependant changes to handle non-contiguous memory.
 1.10 03-Aug-1993  glass more /* in comment warning fixes. in this case it looks like something
was cut and pasted badly :)
 1.9 30-Jun-1993  andrew Noted that IO_TIMER2 was an EISA-specific feature.
 1.8 13-Jun-1993  andrew Added IO_BMS1, IO_BMS2 bus mouse entries.
 1.7 06-Jun-1993  cgd incorporate Bruce Evans' interrupt changes, as hacked by Rod grimes,
for patchkit patch 158. it appears to work well.
 1.6 28-May-1993  deraadt 1. It is now possible to build a kernel that does not have a pc0 device driver.
2. "press any key to reboot" reads the key from the console.
3. wddump() still needs a non-blocking getc() routine (or flush)
 1.5 22-May-1993  cgd add rcsids to everything and clean up headers
 1.4 07-May-1993  cgd add defs for com3 and com4, and add device sizes
 1.3 06-Apr-1993  deraadt wd7000 device driver, put in IO_WDS entry in isa.h. You can now build a
kernel with it. Hope your dma works better than mine <grr>
 1.2 26-Mar-1993  cgd added default addresses for SCSI board I/O ports
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.11.2.8 16-Oct-1993  mycroft Don't forget to enable the interrupt line when registering a handler.
Change the first argument to isa_mem{check,alloc}() to a caddr_t.
 1.11.2.7 16-Oct-1993  mycroft Add prototypes for isa_{port,mem}{check,alloc}().
 1.11.2.6 15-Oct-1993  mycroft Add IO_TIMER1.
 1.11.2.5 09-Oct-1993  mycroft Remove stuff for pccons.
 1.11.2.4 06-Oct-1993  mycroft Remove IOBASEUNK.
 1.11.2.3 30-Sep-1993  mycroft Add IOBASEUNK.
 1.11.2.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.11.2.1 14-Sep-1993  mycroft New i386 code.
 1.12 04-Nov-1994  mycroft Clean up deleted files.
 1.11 27-Oct-1994  cgd new RCS ID format.
 1.10 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.9 29-Mar-1994  mycroft New autoconfig mechanism. Hacked at the moment to use old config(8), but
look mostly like config.new to drivers.
 1.8 12-Mar-1994  mycroft Update for new config(8).
 1.7 28-Aug-1993  brezak Declare find_isadev() function.
 1.6 22-May-1993  cgd add rcsids to everything and clean up headers
 1.5 18-May-1993  cgd add isa_subdev to the list of device tables...
 1.4 12-Apr-1993  deraadt new scsi subsystem.
changes also in config/mkioconf.c & sys/scsi/*
 1.3 06-Apr-1993  deraadt Mod-barsoom wd additions. config program + kernel config files changed too.
fd support had to change slightly too.
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.60 27-Feb-2003  fvdl Moved to x86/isa.
 1.59 26-Feb-2003  fvdl Adapt for i386/x86 change.
 1.58 22-Nov-2002  fvdl New interrupt code. The basic idea behind it is to hide the differences
in interrupt controllers in struct pic, and try to keep as much
common code as possible. At the lowest (asm) level, this is done
with CPP macros.

The main structure is now struct intrsource, describing an established
interrupt line, of any kind (soft/hard local apic/legacy apic/IO apic).
For quick masking, there may be a maximum of 32 sources per CPU.
Sources can be assigned to any CPU in the MP case, though currently they
all go to the boot CPU.
 1.57 05-Oct-2002  fvdl Adjust callers to setgate() to match new extra parameter.
 1.56 03-Oct-2002  fvdl Make shared IRQs for the normal PIC case work again as they did before
the MP merge (i.e. treat them as having the lowest level of all registered
handlers in the chain for the IRQ).
 1.55 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.54 18-Jun-2002  tshiozak add MD support for ACPI sleep/wakeup.
 1.53 18-Nov-2001  jdolecek branches: 1.53.4; 1.53.8;
fix typo
 1.52 15-Nov-2001  lukem add RCSID
 1.51 10-Jan-2001  thorpej branches: 1.51.2; 1.51.4;
Don't panic if we detect an IRQ combination that can't be shared,
just return NULL.
 1.50 14-Nov-2000  thorpej NBPG -> PAGE_SIZE.
 1.49 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.48 04-Jun-2000  mycroft Implement CLKF_INTR(), to count interrupt time separately.
 1.47 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.46 11-May-2000  jdolecek branches: 1.46.2;
Add i386-specific part of MicroChannel Architecture bus support, as
found in some older IBM PS/2 machines.

This code is based upon work by Scott D. Telford, with some minor bits
in arch/i386/mca/mca_machdep.c taken from FreeBSD.

XXX this is still very experimental and development version; use at your
XXX own risk
 1.45 12-Nov-1999  drochner branches: 1.45.2;
make "i386_isa_chipset" globally visible so it can be used from outside
the "isa" bus, attach "pnpbios" pseudo-bus if configured
 1.44 25-Oct-1999  drochner -mask interrupts w/o a handler
-update PIC _after_ the interrupt handler is linked into the chain
This fixes problems with dynamically installed interrupt handlers:
Interrupts were enabled before the handler was installed under some
circumstances (esp. on faster machines), leading to endless interrupt
handling.
 1.43 17-Sep-1999  thorpej branches: 1.43.2; 1.43.4; 1.43.6;
Centralize the declaration and clearing of `cold'.
 1.42 19-Mar-1999  cgd if you pull in isavar.h, you don't need isa_machdep.h.
 1.41 08-Jan-1999  augustss Avoid arithmetic on `void *' since that's not ANSI C.
 1.40 03-Oct-1998  thorpej If the memory range of the machine is such that no bouncing is necessary,
or if the device is capable of 32-bit DMA (specified by ISABUS_DMA_32BIT),
clear the map's bounce threshold at map creation time.
 1.39 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.38 13-Aug-1998  thorpej vm_offset_t -> {vaddr_t,paddr_t}, vm_size_t -> vsize_t
 1.37 05-Aug-1998  augustss Make panic message a little more explicit.
 1.36 05-Aug-1998  perry bzero->memset, bcopy->memcpy
 1.35 09-Jun-1998  thorpej Provide an isa_chipset_tag_t to the ISA bus device.
 1.34 03-Jun-1998  thorpej Implement bounce buffers for mbufs.
 1.33 03-Jun-1998  thorpej Optimize the ISA DMA map load somewhat; don't traverse the buffer twice.
Instead, just attempt to do a normal load first. If we exceed the bounce
threshold or the number of segments, then we bounce the transfer.
 1.32 27-Apr-1998  thorpej Eliminate some needless indirection through ISA DMA front-end functions.
 1.31 26-Apr-1998  thorpej Garbage-collect the DMA tag's "_cookie" member; it's not used for anything.
 1.30 30-Mar-1998  mycroft Add explicit int types for egcs, and nuke register.
 1.29 11-Feb-1998  thorpej Use M_DMAMAP where appropriate.
 1.28 04-Feb-1998  thorpej Add offset and length parameters to bus_dmamap_sync(), used for specifiying
partial syncs of a DMA mapping.
 1.27 04-Feb-1998  thorpej Change the last argument of bus_dmamap_sync() from bus_dmasync_op_t to int,
and allow more than one synchronization operation to be specified in
a single call. Dissallow mixing of PRE and POST operations.
 1.26 04-Feb-1998  thorpej Add dm_mapsize to bus_dmamap_t and rename BUS_DMAMEM_NOSYNC to
BUS_DMA_COHERENT.
 1.25 23-Jan-1998  mycroft Some rearrangement of the startup code:
* Move some of the memory bootstrapping and the DDB startup earlier.
* Always put the IDT and the initial GDT and LDT in a separate page.
* Various minor changes.
 1.24 13-Nov-1997  mycroft Some general cleanup:
* Call gdt_init() earlier on.
* Don't bother to check for TSS and LDT descriptors in verr_gdt().
* Nuke the sti special case for trace and breakpoint traps.
* Move some variable declarations into more appropriate locations.
 1.23 14-Oct-1997  thorpej branches: 1.23.2;
Pull down from marc-pcmcia branch:

Implement new ISA interface functions:
* isa_intr_alloc() - allocate an ISA IRQ
* isa_mem_alloc() - allocate ISA memory space
* isa_mem_free() - free ISA memory space
 1.22 12-Jun-1997  thorpej branches: 1.22.4;
Nuke __VM_PMAP_HACK.
 1.21 06-Jun-1997  thorpej Pull thorpej-bus-dma branch into mainline.
 1.20 19-May-1997  mycroft Make sure intrtype[] is set. (Curious where this got lost...)
 1.19 21-Mar-1997  mycroft branches: 1.19.2;
Add IPL_AUDIO.
 1.18 28-Feb-1997  mycroft Import interrupt priority changes from com patches:
* Make it a strict hierarchy. (It was close anyway).
* Add `serial' and rename `softtty' to `softserial'.
* Make soft interrupts a bit less special-case.
 1.17 28-Nov-1996  thorpej branches: 1.17.6;
In isa_attach_hook(), set a variable to indicate that an ISA bus has
been attached to the system. If, by the time mainbus wants to attach
an ISA an ISA has not yet been attached to the system, attempt to attach
an ISA to mainbus.
 1.16 20-Nov-1996  mycroft Remove incomplete and unused `fast' vector code.
 1.15 30-Aug-1996  mycroft clock >= tty | net | bio
 1.14 12-May-1996  mycroft branches: 1.14.4;
Implement IPL_HIGH.
 1.13 03-May-1996  christos - Add missing prototypes.
- Fix gcc warnings
 1.12 11-Apr-1996  cgd add an isa_attach_hook() function which currently does nothing, and update
isa_intr_establish() and isa_intr_disestablish() to take an opaque cookie
as their (new) first argument.
 1.11 28-Feb-1996  cgd make ISA bus match/attach and sub-device attachment machine-independent.
(remove that code from this file.)
 1.10 09-Feb-1996  mycroft Enforce the hierarchy: imp > tty > net > bio, to cater to lame PC devices.
 1.9 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.8 09-Oct-1995  mycroft Eliminate soft segment descriptors; instead use a functional interface for
creating segment descriptors. Add the duplicate system call gate used by
BSD/OS 2.0 executables. Prototype setsegment() and setgate(), and fix a bogon
caught by this.
 1.7 09-Aug-1995  mycroft Fix oversight in previous change; spl*() must also block
software interrupts.
 1.6 04-Jul-1995  mycroft Make hardware interrupts always block all software interrupts.
 1.5 07-Jun-1995  cgd make match/attach routines and cfdriver struct mi
 1.4 04-Jun-1995  mycroft IPL_IMP includes IPL_NET, IPL_BIO, and possibly IPL_TTY.
 1.3 21-Apr-1995  mycroft Remove relocation of Crtat from locore.
 1.2 19-Apr-1995  cgd fix my IPL level off-by-one. also, rename intr_disestablish to
isa_intr_disestablish like i meant to before.
 1.1 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.14.4.1 30-Aug-1996  mycroft clock >= tty | net | bio
 1.17.6.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.19.2.4 24-May-1997  thorpej Update from trunk.
 1.19.2.3 18-May-1997  thorpej Don't provide the bus dma tag in isa_attach_hook().
 1.19.2.2 17-May-1997  thorpej Update for bus_dmamem_alloc() changes.
 1.19.2.1 13-May-1997  thorpej Implement ISA-specific bus dma methods, and provide the bus dma tag
to children via isa_attach_hook(). These bus dma methods are mostly
wrappers around the generic i386 bus dma methods, but include support
for DMA bounce buffers where required.
 1.22.4.4 14-Oct-1997  thorpej KNF.
 1.22.4.3 29-Aug-1997  thorpej Make isa_mem_alloc() and isa_mem_free() functions, not macros, so that
IOM_* constants don't have to be in scope in order to call these.

Also, fix a fencepost in isa_mem_alloc().
 1.22.4.2 11-Aug-1997  thorpej Make isa_intr_alloc() return non-zero on IRQ allocation failure, rather
than panicing.
 1.22.4.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.23.2.1 13-Nov-1997  mellon Pull rev 1.24 up from trunk (mycroft)
 1.43.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.43.4.1 15-Nov-1999  fvdl Sync with -current
 1.43.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.43.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.43.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.45.2.9 25-Jun-2002  sommerfeld Resynch with -current.
 1.45.2.8 29-Dec-2001  sommerfeld Yet another mergeup.

New work:
- Frank van der Linden's tlb shootdown fix.
Mainline functionality merged:
- IrDA
- Kernel RCSID's
- Transmeta CPU support
- ACPI
- XMM register access through procfs
 1.45.2.7 23-Jan-2001  thorpej Sync with the trunk.
 1.45.2.6 07-Jan-2001  sommerfeld Snapshot of merge-in-progress with -current.

[Not expected to build]. Catch up with the last N months worth of
changes to -current.
 1.45.2.5 02-Dec-2000  sommerfeld MP interrupt routing bugfix: Don't trip over nonexistant ISA bus
before we get to the EISA fallback code..
 1.45.2.4 21-Aug-2000  sommerfeld Give systems reporting EISA interrupts in the mpbios tables a prayer
of working.
 1.45.2.3 07-Aug-2000  sommerfeld Merge sommerfeld_i386mp_1 branch forward to 20000806 sources
 1.45.2.2 25-Jun-2000  sommerfeld Merge up to just-post-1.5 -current
 1.45.2.1 20-Feb-2000  sommerfeld Use level-based rather than mask-based interrupt masking.
Compute interrupt masks differently.

In isa_intr_establish, use the apic instead if we have an interrupt
mapping.
 1.46.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.51.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.51.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.51.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.51.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.51.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.51.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.51.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.53.8.1 16-Jul-2002  gehenna catch up with -current.
 1.53.4.1 17-Mar-2002  thorpej IPL_IMP -> IPL_VM
 1.13 19-Mar-1999  cgd Moved to arch/i386/include/isa_machdep.h,v
 1.12 13-Aug-1998  thorpej vm_offset_t -> {vaddr_t,paddr_t}, vm_size_t -> vsize_t
 1.11 09-Jun-1998  thorpej Add isa_dma{freeze,thaw}(), used to temporarily stop and then restart
all ISA DMA. Needed by e.g. the SmartCard reader for Sharks.
 1.10 09-Jun-1998  thorpej Change the ISA DMA API to take an isa_chipset_tag_t rather than
a struct device * corresponding to the ISA bus device. The ISA DMA
controller driver functions have been renamed and now take a struct
isa_dma_state *, and are called indirectly by machine-dependent code
which provides the DMA state.

These changes allow e.g. `ofisa' (the OpenFirmware configuration
mechanism for the ISA bus, used by e.g. Sharks) to use the MI ISA
DMA controller code.
 1.9 03-Jun-1998  thorpej Implement bounce buffers for mbufs.
 1.8 14-Oct-1997  thorpej Pull down from marc-pcmcia branch:

Implement new ISA interface functions:
* isa_intr_alloc() - allocate an ISA IRQ
* isa_mem_alloc() - allocate ISA memory space
* isa_mem_free() - free ISA memory space
 1.7 06-Jun-1997  thorpej branches: 1.7.4;
Pull thorpej-bus-dma branch into mainline.
 1.6 03-May-1996  christos branches: 1.6.10;
- Add missing prototypes.
- Fix gcc warnings
 1.5 11-Apr-1996  cgd prototype MD functions for use by MI ISA code (isa_attach_hook(),
isa_intr_{,dis}establish()) here. Make this file safely includable by
<dev/isa/isavar.h> and by all of the places in the i386 that are currently
including it, which means multiple inclusion protection and a few
otherwise-extraneous 'forward' structure declarations. isa_intr_establish()
and isa_intr_disestablish() now take as their first argument a
machine-dependent cookie of type isa_chipset_tag_t, which is also defined
here.
 1.4 04-May-1995  cgd use the machine-independent definitions for the mc146818.
wrap the various uses of the chip (including the uses of the NVRAM on it)
around the new defintions, structures, and functions specified in the header.
 1.3 21-Apr-1995  mycroft Clean up hole conversion functions a little.
 1.2 21-Apr-1995  mycroft Remove relocation of Crtat from locore.
 1.1 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.6.10.2 18-May-1997  thorpej Add an external declaration for the isa dma tag.
 1.6.10.1 13-May-1997  thorpej Implement ISA-specific bus dma methods, and provide the bus dma tag
to children via isa_attach_hook(). These bus dma methods are mostly
wrappers around the generic i386 bus dma methods, but include support
for DMA bounce buffers where required.
 1.7.4.3 29-Aug-1997  thorpej Make isa_mem_alloc() and isa_mem_free() functions, not macros, so that
IOM_* constants don't have to be in scope in order to call these.

Also, fix a fencepost in isa_mem_alloc().
 1.7.4.2 11-Aug-1997  thorpej Make isa_intr_alloc() return non-zero on IRQ allocation failure, rather
than panicing.
 1.7.4.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.18 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.17 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.16 28-Apr-2010  dyoung On x86, change the bus_space_tag_t to a pointer to a struct
bus_space_tag. For now, bus_space_tag's only member is
bst_type, the type of space, which is either X86_BUS_SPACE_IO
or X86_BUS_SPACE_MEM. In the future, new bus_space_tag members
will refer to override-functions installed by a new function,
bus_space_tag_create(9).

Add pointers to constant struct bus_space_tag, x86_bus_space_io and
x86_bus_space_mem. Use them to replace most uses of X86_BUS_SPACE_IO
and X86_BUS_SPACE_MEM.

Add an x86-specific bus_space_is_equal(9) implementation that compares
the two tags' bst_type.
 1.15 20-Apr-2010  dyoung Re-uppercase x86_bus_space_io.
 1.14 19-Apr-2010  dyoung Add default implementations for bus_space_is_equal(9),
bus_space_tag_create(9), and bus_space_tag_destroy(9). Use
bus_space_is_equal(9) throughout the kernel to compare
bus_space_tag_t's. Tested on i386 and on sparc64.
 1.13 28-Apr-2008  martin branches: 1.13.14; 1.13.20; 1.13.22;
Remove clause 3 and 4 from TNF licenses
 1.12 16-Nov-2006  christos branches: 1.12.52; 1.12.54; 1.12.56;
__unused removal on arguments; approved by core.
 1.11 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.10 11-Dec-2005  christos branches: 1.10.20; 1.10.22;
merge ktrace-lwp.
 1.9 03-Feb-2005  perry de-__P, partially ANSIfy
 1.8 26-Feb-2003  fvdl branches: 1.8.2; 1.8.10; 1.8.12;
Adapt for i386/x86 change.
 1.7 15-Nov-2001  lukem branches: 1.7.2;
add RCSID
 1.6 05-Sep-1998  christos branches: 1.6.26; 1.6.28;
Assign copyright to TNF.
 1.5 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.4 15-Aug-1997  mikel wrap bus_space I/O tag checks with #ifdef DIAGNOSTIC.
wrap actual read port map/unmap with #ifdef _KERNEL, so userland probe
code will still work.
 1.3 07-Aug-1997  christos Check if we can map the read port, but don't really allocate it because it
will cause a conflict with the SoundBlaster Joysticks that say that they
require 200/8 and 207 is usually the read port. XXX: This is a hack.
 1.2 24-Feb-1997  christos branches: 1.2.4;
Fix PR/3253: Don't try to probe the isapnp port in ioports already claimed
by other devices.
 1.1 16-Jan-1997  christos branches: 1.1.2; 1.1.6;
i386 plug and play glue
 1.1.6.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.1.2.2 18-Jan-1997  thorpej Update from trunk.
 1.1.2.1 16-Jan-1997  thorpej file isapnp_machdep.c was added on branch thorpej-setroot on 1997-01-18 04:15:42 +0000
 1.2.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.7.2.2 15-Nov-2001  lukem add RCSID
 1.7.2.1 15-Nov-2001  lukem file isapnp_machdep.c was added on branch sommerfeld_i386mp_1 on 2001-11-15 07:03:33 +0000
 1.8.12.1 12-Feb-2005  yamt sync with head.
 1.8.10.1 29-Apr-2005  kent sync with -current
 1.8.2.1 04-Feb-2005  skrll Sync with HEAD.
 1.10.22.2 10-Dec-2006  yamt sync with head.
 1.10.22.1 22-Oct-2006  yamt sync with head
 1.10.20.1 18-Nov-2006  ad Sync with head.
 1.12.56.2 11-Aug-2010  yamt sync with head.
 1.12.56.1 16-May-2008  yamt sync with head.
 1.12.54.1 18-May-2008  yamt sync with head.
 1.12.52.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.22.1 30-May-2010  rmind sync with head
 1.13.20.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.13.14.2 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.13.14.1 24-Oct-2010  jym Sync with HEAD
 1.4 19-Mar-1999  cgd Moved to arch/i386/include/isapnp_machdep.h,v
 1.3 05-Sep-1998  christos Assign copyright to TNF.
 1.2 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 16-Jan-1997  christos branches: 1.1.2; 1.1.10;
i386 plug and play glue
 1.1.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.2 18-Jan-1997  thorpej Update from trunk.
 1.1.2.1 16-Jan-1997  thorpej file isapnp_machdep.h was added on branch thorpej-setroot on 1997-01-18 04:15:43 +0000
 1.5 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.4 27-Oct-1994  cgd new RCS ID format.
 1.3 01-Oct-1994  mycroft Add IO_PPI.
 1.2 01-Oct-1994  mycroft Add IO_PMP[12] and IO_PMPSIZE.
 1.1 24-Apr-1994  mycroft branches: 1.1.2;
Rename two files.
 1.1.2.1 06-Oct-1994  mycroft Update from trunk.
 1.15 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.14 03-Jan-1995  mycroft Update intr_establish() prototype.
 1.13 02-Jan-1995  mycroft Don't assume ia_maddr is in the hole.
 1.12 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.11 27-Oct-1994  cgd new RCS ID format.
 1.10 27-Jul-1994  mycroft Add IRQUNK.
 1.9 07-Apr-1994  mycroft branches: 1.9.2;
Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.8 30-Mar-1994  mycroft Minor changes.
 1.7 29-Mar-1994  mycroft New autoconfig mechanism. Hacked at the moment to use old config(8), but
look mostly like config.new to drivers.
 1.6 21-Jan-1994  cgd delete contents; can't appear in trunk until copyright is fixed.
 1.5 26-Oct-1993  mycroft branches: 1.5.2;
Add MADDRUNK.
 1.4 17-Oct-1993  mycroft Make atdevbase an int.
 1.3 16-Oct-1993  mycroft Add isa_establish(), for all it's worth (which is to say, nothing).
 1.2 06-Oct-1993  mycroft Add DRQUNK and IOBASEUNK.
 1.1 14-Sep-1993  mycroft New i386 code.
 1.5.2.2 11-Feb-1994  cgd new copyright, per Mike Karels
 1.5.2.1 26-Oct-1993  cgd file isavar.h was added on branch magnum on 1994-02-11 23:29:55 +0000
 1.9.2.1 27-Jul-1994  cgd from trunk, per mycroft
 1.13 02-Feb-2002  jdolecek Reduce the massive code duplication regarding joy(4). Split it into
MI and MD parts, and make ISA/ISAPNP/PCI joy(4) attachments MI.
 1.12 15-Nov-2001  lukem branches: 1.12.2;
add RCSID
 1.11 13-Jun-2001  wiz branches: 1.11.4; 1.11.6;
withough -> without
 1.10 12-Jan-1998  thorpej branches: 1.10.28;
Update for changes to config.
 1.9 05-Nov-1997  mycroft Fix spacing of `not connected' message.
 1.8 31-Oct-1997  mycroft Format police.
 1.7 14-Jun-1997  mycroft branches: 1.7.8;
Make sure we can't open a device that doesn't exist.
 1.6 16-Jan-1997  christos - conversion to bus_space_* macros
- split the isa and pnp attachments
 1.5 13-Oct-1996  christos branches: 1.5.2;
backout previous kprintf changes
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 05-May-1996  christos Fix gcc -Wall warnings
 1.2 01-Apr-1996  scottr Clean up, primarily KNF.
 1.1 27-Mar-1996  perry add joystick driver from Matthieu Herrb (pr #2267)
 1.5.2.2 30-Jan-1997  thorpej update from trunk
 1.5.2.1 18-Jan-1997  thorpej Update from trunk.
 1.7.8.2 05-Nov-1997  mellon Pull rev 1.9 up from trunk (mycroft)
 1.7.8.1 31-Oct-1997  mellon Pull rev 1.8 up from trunk (mycroft)
 1.10.28.3 28-Feb-2002  nathanw Catch up to -current.
 1.10.28.2 08-Jan-2002  nathanw Catch up to -current.
 1.10.28.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.6.2 26-Sep-2001  fvdl * add a VCLONED vnode flag that indicates a vnode representing a cloned
device.
* rename REVOKEALL to REVOKEALIAS, and add a REVOKECLONE flag, to pass
to VOP_REVOKE
* the revoke system call will revoke all aliases, as before, but not the
clones
* vdevgone is called when detaching a device, so make it use REVOKECLONE
to get rid of all clones as well
* clean up all uses of VOP_OPEN wrt. locking.
* add a few VOPS to spec_vnops that need to do something when it's a
clone vnode (access and getattr)
* add a copy of the vnode vattr structure of the original 'master' vnode
to the specinfo of a cloned vnode. could possibly redirect getattr to
the 'master' vnode, but this has issues with revoke
* add a vdev_reassignvp function that disassociates a vnode from its
original device, and reassociates it with the specified dev_t. to be
used by cloning devices only, in case a new minor is allocated.
* change all direct references in drivers to v_devcookie and v_rdev
to vdev_privdata(vp) and vdev_rdev(vp). for diagnostic purposes
when debugging race conditions that still exist wrt. locking and
revoking vnodes.
* make the locking state of a vnode consistent when passed to
d_open and d_close (unlocked). locked would be better, but has
some deadlock issues
 1.11.6.1 07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.11.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.11.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.2.2 15-Nov-2001  lukem add RCSID
 1.12.2.1 15-Nov-2001  lukem file joy.c was added on branch sommerfeld_i386mp_1 on 2001-11-15 07:03:33 +0000
 1.7 02-Feb-2002  jdolecek Reduce the massive code duplication regarding joy(4). Split it into
MI and MD parts, and make ISA/ISAPNP/PCI joy(4) attachments MI.
 1.6 07-Jan-2002  thorpej branches: 1.6.2;
Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.5 15-Nov-2001  lukem add RCSID
 1.4 13-Jun-2001  wiz branches: 1.4.4;
withough -> without
 1.3 22-Mar-1998  drochner branches: 1.3.28;
switch to non-BROKEN_INDIRECT_CONFIG
 1.2 31-Oct-1997  mycroft Format police.
 1.1 16-Jan-1997  christos branches: 1.1.2; 1.1.14;
- conversion to bus_space_* macros
- split the isa and pnp attachments
 1.1.14.1 31-Oct-1997  mellon Pull rev 1.2 up from trunk (mycroft)
 1.1.2.2 18-Jan-1997  thorpej Update from trunk.
 1.1.2.1 16-Jan-1997  thorpej file joy_isa.c was added on branch thorpej-setroot on 1997-01-18 04:15:45 +0000
 1.3.28.4 28-Feb-2002  nathanw Catch up to -current.
 1.3.28.3 11-Jan-2002  nathanw More catchup.
 1.3.28.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.28.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.2 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.6.2.1 07-Jan-2002  thorpej file joy_isa.c was added on branch sommerfeld_i386mp_1 on 2002-01-07 21:47:02 +0000
 1.18 02-Feb-2002  jdolecek Reduce the massive code duplication regarding joy(4). Split it into
MI and MD parts, and make ISA/ISAPNP/PCI joy(4) attachments MI.
 1.17 15-Nov-2001  lukem branches: 1.17.2;
add RCSID
 1.16 22-Mar-1999  mycroft branches: 1.16.22; 1.16.24;
Reject variant numbers which are too large (so that a new version of isapnpdevs
with an old driver will not lose mysteriously).
 1.15 22-Mar-1999  mycroft Update callers of isapnp_devmatch().
 1.14 23-Jul-1998  christos Utilize the centralized probe function.
 1.13 08-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.12 22-Mar-1998  drochner switch to non-BROKEN_INDIRECT_CONFIG
 1.11 21-Feb-1998  christos PR/4950: Rene Hexel: Add id for Terratec EWS64 joystick
 1.10 20-Nov-1997  mikel add ID for (brain-damaged) GUS PnP, and add comments describing what
hardware each ID describes.
 1.9 18-Nov-1997  augustss Add another PnP id.
 1.8 31-Oct-1997  mycroft Format police.
 1.7 29-Oct-1997  wrstuden Add pnp support for the OPTi Audio 16's joystick port.
 1.6 09-Oct-1997  jtc branches: 1.6.2;
Fix tipo inherited from old version of TNF copyright template.
 1.5 30-Sep-1997  mycroft Only use a subregion if the region we got was of length 8.
 1.4 07-Aug-1997  christos PR/3954: Izumi Tsutsui: Add id for the ESS1868 joystick.
 1.3 03-Aug-1997  mikel use compatID to find P&P joysticks; isapnp drivers should never use
ipa_devident or ipa_devclass to match devices, those strings are
informational only!
 1.2 14-Jun-1997  mycroft branches: 1.2.4;
Pass only a subregion of the I/O space to the joy driver, which covers the
normal single port.
 1.1 16-Jan-1997  christos branches: 1.1.2;
- conversion to bus_space_* macros
- split the isa and pnp attachments
 1.1.2.2 18-Jan-1997  thorpej Update from trunk.
 1.1.2.1 16-Jan-1997  thorpej file joy_isapnp.c was added on branch thorpej-setroot on 1997-01-18 04:15:46 +0000
 1.2.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.2.3 26-Nov-1997  mellon Pull rev 1.10 up from trunk (mikel)
 1.6.2.2 31-Oct-1997  mellon Pull rev 1.8 up from trunk (mycroft)
 1.6.2.1 30-Oct-1997  mellon Pull rev 1.7 up from trunk (wrstuden)
 1.16.24.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.16.24.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.22.2 28-Feb-2002  nathanw Catch up to -current.
 1.16.22.1 08-Jan-2002  nathanw Catch up to -current.
 1.17.2.2 15-Nov-2001  lukem add RCSID
 1.17.2.1 15-Nov-2001  lukem file joy_isapnp.c was added on branch sommerfeld_i386mp_1 on 2001-11-15 07:03:33 +0000
 1.8 18-Feb-2005  drochner The joystick driver is using mi timing code for many months.
Noone complained, so we can remove the unused md versions.
 1.7 03-Feb-2005  perry de-__P, partially ANSIfy
 1.6 01-Oct-2002  fvdl branches: 1.6.6; 1.6.14; 1.6.16;
Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.5 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.4 13-Aug-2002  itojun branches: 1.4.2;
minor KNF
 1.3 13-Aug-2002  thorpej Fix previous (need to add IO_TIMER1 to the register offsets).
 1.2 13-Aug-2002  itojun fix includes (use dev/ic/i8253reg.h)
 1.1 02-Feb-2002  jdolecek branches: 1.1.2; 1.1.6; 1.1.14;
Reduce the massive code duplication regarding joy(4). Split it into
MI and MD parts, and make ISA/ISAPNP/PCI joy(4) attachments MI.
 1.1.14.2 31-Aug-2002  gehenna catch up with -current.
 1.1.14.1 19-May-2002  gehenna Remove unnecessary #include
 1.1.6.4 17-Sep-2002  nathanw Catch up to -current.
 1.1.6.3 27-Aug-2002  nathanw Catch up to -current.
 1.1.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.6.1 02-Feb-2002  nathanw file joy_timer.c was added on branch nathanw_sa on 2002-02-28 04:10:20 +0000
 1.1.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 02-Feb-2002  jdolecek file joy_timer.c was added on branch kqueue on 2002-02-11 20:08:28 +0000
 1.4.2.2 13-Aug-2002  itojun minor KNF
 1.4.2.1 13-Aug-2002  itojun file joy_timer.c was added on branch sommerfeld_i386mp_1 on 2002-08-13 05:33:52 +0000
 1.6.16.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.16.1 12-Feb-2005  yamt sync with head.
 1.6.14.1 29-Apr-2005  kent sync with -current
 1.6.6.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.6.1 04-Feb-2005  skrll Sync with HEAD.
 1.3 02-Feb-2002  jdolecek Reduce the massive code duplication regarding joy(4). Split it into
MI and MD parts, and make ISA/ISAPNP/PCI joy(4) attachments MI.
 1.2 13-Jun-2001  wiz branches: 1.2.2; 1.2.4;
withough -> without
 1.1 16-Jan-1997  christos branches: 1.1.2; 1.1.42;
- conversion to bus_space_* macros
- split the isa and pnp attachments
 1.1.42.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.42.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 18-Jan-1997  thorpej Update from trunk.
 1.1.2.1 16-Jan-1997  thorpej file joyvar.h was added on branch thorpej-setroot on 1997-01-18 04:15:47 +0000
 1.2.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.2 13-Jun-2001  wiz withough -> without
 1.2.2.1 13-Jun-2001  wiz file joyvar.h was added on branch sommerfeld_i386mp_1 on 2001-06-13 10:46:02 +0000
 1.4 02-Mar-1994  mycroft Clean up deleted files.
 1.3 28-Sep-1993  andrew Added keyboard typematic rate adjustment ioctl. Rudimentary support for
entering DDB from X11 by means of the F12 key (when XSERVER_DDB is
defined).
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8 17-Apr-1998  drochner use the mi header (dev/pckbc/pckbdreg.h)
 1.7 28-Jun-1995  cgd note that most of dev/ic's contents have changed names
 1.6 29-Jan-1995  cgd use chip headers in /dev/ic
 1.5 27-Oct-1994  cgd new RCS ID format.
 1.4 02-Mar-1994  mycroft Add code to set the translation table number, but disabled for now.
 1.3 17-Oct-1993  mycroft branches: 1.3.2;
Add KBR_EXTENDED.
 1.2 06-Oct-1993  mycroft Merge changes from trunk.
 1.1 14-Sep-1993  mycroft New i386 code.
 1.3.2.2 17-Oct-1993  mycroft Add KBR_EXTENDED.
 1.3.2.1 17-Oct-1993  mycroft file kbdreg.h was added on branch magnum on 1993-10-17 14:04:16 +0000
 1.58 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.57 24-Apr-2021  thorpej branches: 1.57.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.56 01-Jul-2011  dyoung branches: 1.56.68;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.55 04-May-2009  cegger struct device * -> device_t
No functional changes intended.
 1.54 09-Jul-2008  joerg branches: 1.54.8;
device/softc split.
 1.53 04-Apr-2008  cegger branches: 1.53.4; 1.53.6; 1.53.8; 1.53.10;
use aprint_*_dev and device_xname
OK joerg
 1.52 04-Mar-2007  christos branches: 1.52.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.51 16-Nov-2006  christos branches: 1.51.4;
__unused removal on arguments; approved by core.
 1.50 12-Nov-2006  plunky Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
 1.49 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.48 19-Feb-2006  thorpej branches: 1.48.14; 1.48.16;
Use aprint_*().
 1.47 11-Dec-2005  christos branches: 1.47.2; 1.47.4; 1.47.6;
merge ktrace-lwp.
 1.46 03-Feb-2005  perry branches: 1.46.6;
de-__P, partially ANSIfy
 1.45 14-Sep-2004  drochner branches: 1.45.4; 1.45.6;
adapt to ISA "unknown address" namespace separation
 1.44 02-Oct-2002  thorpej branches: 1.44.6;
Tidy up CFATTACH_DECL() formatting.
 1.43 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.42 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.41 17-Mar-2002  atatat branches: 1.41.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.40 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.39 15-Nov-2001  lukem add RCSID
 1.38 08-Jan-2000  takemura branches: 1.38.8; 1.38.10;
Absolute pointing device support.
- Wsmouse_input() get new argument 'flag', which indicates whether x/y/z are
relative or absolute.
- Wsmouse get new io controls, WSMOUSEIO_SCALIBCOORDS and
WSMOUSEIO_GCALIBCOORDS.
 1.37 23-Jan-1999  drochner branches: 1.37.8;
make the busmice work with wscons
 1.36 25-Aug-1998  thorpej Add some braces to make egcs happy.
 1.35 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.34 22-Mar-1998  drochner switch to non-BROKEN_INDIRECT_CONFIG
 1.33 12-Jan-1998  thorpej Update for changes to config.
 1.32 19-Oct-1997  mycroft Minor changes to make these more similar again.
 1.31 19-Oct-1997  thorpej Make sure the i/o and/or mem addresses aren't wildcarded (i.e. -1) before
using the address in a bus_space_map() call.
 1.30 21-Oct-1996  thorpej New bus.h implementation/interface:
- No more distinction between i/o-mapped and memory-mapped
devices. It's all "bus space" now, and space tags
differentiate the space with finer grain than the
bus chipset tag.
- Add memory barrier methods.
- Implement space alloc/free methods.
- Implement region read/write methods (like memcpy to/from
bus space).
This interface provides a better abstraction for dealing with
machine-independent chipset drivers.
 1.29 13-Oct-1996  christos backout previous kprintf changes
 1.28 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.27 07-Sep-1996  mycroft Implement poll(2).
 1.26 12-May-1996  mycroft Use intr.h.
 1.25 03-May-1996  christos Prototype fixes.
 1.24 11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.23 09-Apr-1996  thorpej Convert to use <machine/bus.h>.
 1.22 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.21 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.20 05-Oct-1995  mycroft Use ISA_IPL_TTY, to fix race conditions.
 1.19 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.18 03-Jan-1995  mycroft Add interrupt sharing types.
 1.17 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.16 03-Nov-1994  mycroft Update to match autoconfig code.
 1.15 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.14 27-Oct-1994  cgd new RCS ID format.
 1.13 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.12 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.11 30-Mar-1994  mycroft Minor fix to attach messages.
 1.10 29-Mar-1994  mycroft Updates for new autoconfig.
 1.9 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.8 17-Feb-1994  mycroft New versions from magnum branch.
 1.7 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.6 02-Aug-1993  mycroft branches: 1.6.2;
Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.5 27-Jun-1993  andrew Replaced 386BSD conditionals with a NetBSD ones. Fixed a bug in 386BSD
support. Cast arguments to tsleep() and wakeup() to avoid compiler
warnings.
 1.4 14-Jun-1993  mycroft These mice use 4 ports.
 1.3 14-Jun-1993  mycroft Work around a bug in XFree86.
 1.2 14-Jun-1993  mycroft Return EBUSY if device already open.
 1.1 13-Jun-1993  andrew Logitech busmouse driver.
 1.6.2.14 31-Oct-1993  mycroft Turn off interrupts before *forceintr to insure we get an edge.
 1.6.2.13 17-Oct-1993  mycroft No need to stay at spltty() while transferring event data.
 1.6.2.12 16-Oct-1993  mycroft Add missing dv_class entry to cfdrivers, and use dv_xname where appropriate.
 1.6.2.11 12-Oct-1993  mycroft Minor cleanup.
 1.6.2.10 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.6.2.9 07-Oct-1993  mycroft Don't #include isa.h.
 1.6.2.8 06-Oct-1993  mycroft Use standard ring buffer implementation. Use normal read() flag rather than
bit in minor number for non-blocking mode.
 1.6.2.7 01-Oct-1993  mycroft #include "machine/cpu.h"
 1.6.2.6 30-Sep-1993  mycroft Change some uses of IRQUNK to IRQNONE. #include isa.h and icu.h.
 1.6.2.5 30-Sep-1993  mycroft clock.c: Remove unnecessary casts.
com.c: Update for new config. Add bis() and bic() macros like BSDI's.
Add comspeed() and tiocm_xxx2mcr() from BSDI.
comreg.h: Add COM_FREQ, COM_TOLERANCE, and COM_NPORTS.
fd.c: Remove casts and clean up fdioctl().
[lm]ms.c: Add necessary gunk to [lm]ms_softc and remove casts.
 1.6.2.4 29-Sep-1993  mycroft lms.c: Remove sc_button.
mms.c: Reclone from lms.c.
 1.6.2.3 29-Sep-1993  mycroft BLOCK --> NOBLOCK.
 1.6.2.2 29-Sep-1993  mycroft Reset ASLP flag if we get a signal while sleeping in lmsread().
 1.6.2.1 29-Sep-1993  mycroft lms.c: Update for new config.
lpa.c: Defunct.
lpt.c: Update for new config. Fix handling of interrupted writes. Merge code
from lpa driver. Make all operations interruptible. Remove a few other
bogons.
lptreg.h: Add LPT_NPORTS.
pccons.c: Merge changes from trunk.
 1.37.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.38.10.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.38.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.38.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.38.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.38.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.38.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.38.8.2 11-Jan-2002  nathanw More catchup.
 1.38.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.41.4.2 17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.41.4.1 17-Mar-2002  atatat file lms.c was added on branch sommerfeld_i386mp_1 on 2002-03-17 19:40:42 +0000
 1.44.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.44.6.3 18-Dec-2004  skrll Sync with HEAD.
 1.44.6.2 21-Sep-2004  skrll Fix the sync with head I botched.
 1.44.6.1 18-Sep-2004  skrll Sync with HEAD.
 1.45.6.1 12-Feb-2005  yamt sync with head.
 1.45.4.1 29-Apr-2005  kent sync with -current
 1.46.6.3 03-Sep-2007  yamt sync with head.
 1.46.6.2 30-Dec-2006  yamt sync with head.
 1.46.6.1 21-Jun-2006  yamt sync with head.
 1.47.6.1 22-Apr-2006  simonb Sync with head.
 1.47.4.1 09-Sep-2006  rpaulo sync with head
 1.47.2.1 01-Mar-2006  yamt sync with head.
 1.48.16.2 10-Dec-2006  yamt sync with head.
 1.48.16.1 22-Oct-2006  yamt sync with head
 1.48.14.1 18-Nov-2006  ad Sync with head.
 1.51.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.52.40.2 28-Sep-2008  mjf Sync with HEAD.
 1.52.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.53.10.1 19-Oct-2008  haad Sync with HEAD.
 1.53.8.1 18-Jul-2008  simonb Sync with head.
 1.53.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.53.4.2 16-May-2009  yamt sync with head
 1.53.4.1 04-May-2009  yamt sync with head.
 1.54.8.3 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.54.8.2 01-Nov-2009  jym Sync with HEAD.
 1.54.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.56.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.57.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.8 18-Feb-1994  mycroft Clean up deleted files.
 1.7 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.6 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.5 28-Aug-1993  brezak branches: 1.5.2;
Remove warnings.
 1.4 05-Jun-1993  cgd patch from rgrimes to add delay to let data port stabilize, also
make "lpflag" unique to each driver
 1.3 22-May-1993  cgd add include of select.h if necessary for protos, or delete if extraneous
 1.2 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.1 07-May-1993  cgd fix lpt driver and add lpa driver. from 386bsd pk patch 133
 1.5.2.1 14-Sep-1993  mycroft New i386 code.
 1.29 01-Mar-1995  mycroft Clean up deleted files.
 1.28 26-Jan-1995  mycroft Don't check the control port at all; too unreliable.
 1.27 22-Jan-1995  mycroft Rearrange tests so `offline' has higher priority than `out of paper'.
 1.26 03-Jan-1995  mycroft Add interrupt sharing types.
 1.25 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.24 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.23 27-Oct-1994  cgd new RCS ID format.
 1.22 16-Jun-1994  mycroft branches: 1.22.2;
b_un.b_addr -> b_data
 1.21 27-May-1994  mycroft Only print the blasted messages *once* per error.
 1.20 23-May-1994  cgd turn off spontaneous printing of messages when DEBUG turned on
 1.19 05-May-1994  mycroft Remove now-bogus cast.
 1.18 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.17 22-Apr-1994  mycroft Don't need isa.h.
 1.16 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.15 29-Mar-1994  mycroft Updates for new autoconfig.
 1.14 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.13 19-Feb-1994  mycroft Speed it up a little...
 1.12 19-Feb-1994  mycroft Minor tweak of no importance.
 1.11 18-Feb-1994  mycroft Combined version from magnum branch. Somewhat faster and less buggy.
 1.10 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.9 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.8 28-Sep-1993  cgd get rid of stray printfs (turn them into "lprintf"s)
 1.7 17-Jul-1993  mycroft branches: 1.7.4;
Make these files GCC 2 happy.
 1.6 15-Jun-1993  mycroft Ignore interrupts if the device isn't open. This prevents stray interrupts
from hosing the works. What a stupid architecture.
 1.5 05-Jun-1993  cgd patch from rgrimes to add delay to let data port stabilize, also
make "lpflag" unique to each driver
 1.4 22-May-1993  cgd add include of select.h if necessary for protos, or delete if extraneous
 1.3 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.2 07-May-1993  cgd fix lpt driver and add lpa driver. from 386bsd pk patch 133
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.4.18 16-Feb-1994  mycroft Avoid two minor race conditions; no real differences.
 1.7.4.17 29-Oct-1993  mycroft Force the printer closed even if the final pushbytes() fails.
 1.7.4.16 29-Oct-1993  mycroft Make sure pushbytes() returns 0 on success.
 1.7.4.15 29-Oct-1993  mycroft Ignore the bottom 3 bits when checking for printer ready.
 1.7.4.14 29-Oct-1993  mycroft Make some debugging code in the probe routines #ifdef DEBUG.
 1.7.4.13 27-Oct-1993  mycroft Add lptforceintr(), but disabled for now. Add some debugging code.
 1.7.4.12 18-Oct-1993  mycroft We can't determine lpt interrupts dynamically.
 1.7.4.11 17-Oct-1993  mycroft When an error occurs, at least say what it is before hanging.
 1.7.4.10 16-Oct-1993  mycroft Add missing dv_class entry to cfdrivers, and use dv_xname where appropriate.
 1.7.4.9 12-Oct-1993  mycroft Minor cleanup.
 1.7.4.8 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.7.4.7 07-Oct-1993  mycroft Don't #include isa.h.
 1.7.4.6 06-Oct-1993  mycroft Finish reformatting. Turn interrupt on or off as appropriate in lptopen().
 1.7.4.5 01-Oct-1993  mycroft #include "machine/cpu.h"
 1.7.4.4 30-Sep-1993  mycroft Change some uses of IRQUNK to IRQNONE. #include isa.h and icu.h.
 1.7.4.3 30-Sep-1993  mycroft clock.c: Remove unnecessary casts.
com.c: Update for new config. Add bis() and bic() macros like BSDI's.
Add comspeed() and tiocm_xxx2mcr() from BSDI.
comreg.h: Add COM_FREQ, COM_TOLERANCE, and COM_NPORTS.
fd.c: Remove casts and clean up fdioctl().
[lm]ms.c: Add necessary gunk to [lm]ms_softc and remove casts.
 1.7.4.2 29-Sep-1993  mycroft lms.c: Update for new config.
lpa.c: Defunct.
lpt.c: Update for new config. Fix handling of interrupted writes. Merge code
from lpa driver. Make all operations interruptible. Remove a few other
bogons.
lptreg.h: Add LPT_NPORTS.
pccons.c: Merge changes from trunk.
 1.7.4.1 14-Sep-1993  mycroft New i386 code.
 1.22.2.1 23-Nov-1994  cgd make sure to do an untimeout. for patch_04
 1.5 01-Mar-1995  mycroft Clean up deleted files.
 1.4 27-Oct-1994  cgd new RCS ID format.
 1.3 18-Feb-1994  mycroft Combined version from magnum branch. Somewhat faster and less buggy.
 1.2 22-May-1993  cgd branches: 1.2.4;
add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.2.4.2 06-Oct-1993  mycroft Give #defines more mnemonic names, and fix comment for LPC_IENABLE.
 1.2.4.1 29-Sep-1993  mycroft lms.c: Update for new config.
lpa.c: Defunct.
lpt.c: Update for new config. Fix handling of interrupted writes. Merge code
from lpa driver. Make all operations interruptible. Remove a few other
bogons.
lptreg.h: Add LPT_NPORTS.
pccons.c: Merge changes from trunk.
 1.27 01-Mar-1995  mycroft Clean up deleted files.
 1.26 03-Jan-1995  mycroft Add interrupt sharing types.
 1.25 14-Dec-1994  mycroft Remove dkbad.h.
 1.24 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.23 03-Nov-1994  mycroft Use indirect config for subdevices, and add dkdrivers where missing.
 1.22 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.21 28-Oct-1994  mycroft Various:
* Forget all cached info when opening a new disc.
* If the disc is removed, flush the buffer queue rather than stalling it.
* Set the default label after getting the disc size, and fill in the info
for RAW_PART also.
* Change another use of the unit number to a softc pointer.
* Use a dkdevice to hold the label and open partition masks.
* Force the partition offset to 0 for RAW_PART, regardless of the label.
* Nuke MCDPHYS() and MCDREADRAW; they had a silly bug that caused the code
to not work, and they aren't useful anyway.
Some other minor cleanup.
 1.20 27-Oct-1994  cgd new RCS ID format.
 1.19 14-Oct-1994  cgd move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS.
 1.18 05-Aug-1994  mycroft Fix spelling of `STEREO'.
 1.17 03-Aug-1994  mycroft Add a missing splx() and increase the reset delay during probe, as suggested
by Juergen Keil. Add a diagnostic message if the controller info is not what
we expect.
 1.16 16-Jun-1994  mycroft branches: 1.16.2;
b_un.b_addr -> b_data
 1.15 11-May-1994  mycroft Add dummy *dump() routines.
 1.14 05-May-1994  mycroft Retool the state machine is a sane way.
 1.13 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.12 22-Apr-1994  mycroft Don't need isa.h.
 1.11 08-Apr-1994  mycroft Small fix to attach message.
 1.10 08-Apr-1994  mycroft Fix return values from some interrupt routines.
 1.9 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.8 29-Mar-1994  mycroft Updates for new autoconfig.
 1.7 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.6 21-Feb-1994  mycroft Fixed probe routine from Holger Veit; lots of other cleanup by me.
 1.5 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.4 06-Feb-1994  mycroft Use b_actf, not av_forw.
 1.3 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.2 17-Nov-1993  cgd added two copyright strings at the request of Gary Clark II
<gclarkii@freefall.cdrom.com>, because he hacked and is in the process
of hacking the code significantly.
 1.1 04-Nov-1993  cgd branches: 1.1.2;
add mcd: Mitsumi CD driver by Holger Veit and Brian Moore
 1.1.2.8 06-Feb-1994  mycroft Use b_actf, not av_forw.
 1.1.2.7 02-Feb-1994  mycroft Various cleanup.
 1.1.2.6 02-Feb-1994  mycroft Change second arg of probe to self, in preparation of changing subr_autoconf.
 1.1.2.5 02-Feb-1994  mycroft Updates from Gary Clark II; may need more work.
 1.1.2.4 01-Feb-1994  mycroft Updates from main branch.
 1.1.2.3 29-Nov-1993  mycroft Forgot to #include pio.h and cpu.h.
 1.1.2.2 29-Nov-1993  mycroft Converted. Needs testing.
 1.1.2.1 04-Nov-1993  mycroft file mcd.c was added on branch magnum on 1993-11-29 18:19:12 +0000
 1.16.2.2 05-Aug-1994  mycroft update from trunk
 1.16.2.1 03-Aug-1994  cgd from trunk
 1.6 01-Mar-1995  mycroft Clean up deleted files.
 1.5 27-Oct-1994  cgd new RCS ID format.
 1.4 21-Feb-1994  mycroft Fix copyright. No code by G. Clark left.
 1.3 21-Feb-1994  mycroft Fixed probe routine from Holger Veit; lots of other cleanup by me.
 1.2 17-Nov-1993  cgd branches: 1.2.2;
added two copyright strings at the request of Gary Clark II
<gclarkii@freefall.cdrom.com>, because he hacked and is in the process
of hacking the code significantly.
 1.1 04-Nov-1993  cgd add mcd: Mitsumi CD driver by Holger Veit and Brian Moore
 1.2.2.2 02-Feb-1994  mycroft Updates from Gary Clark II; may need more work.
 1.2.2.1 17-Nov-1993  mycroft file mcdreg.h was added on branch magnum on 1994-02-02 07:00:20 +0000
 1.55 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.54 24-Apr-2021  thorpej branches: 1.54.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.53 01-Jul-2011  dyoung branches: 1.53.68;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.52 04-May-2009  cegger struct device * -> device_t
No functional changes intended.
 1.51 09-Jul-2008  joerg branches: 1.51.8;
Device/softc split.
 1.50 04-Apr-2008  cegger branches: 1.50.4; 1.50.6; 1.50.8; 1.50.10;
use aprint_*_dev and device_xname
OK joerg
 1.49 04-Mar-2007  christos branches: 1.49.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.48 16-Nov-2006  christos branches: 1.48.4;
__unused removal on arguments; approved by core.
 1.47 12-Nov-2006  plunky Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
 1.46 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.45 19-Feb-2006  thorpej branches: 1.45.14; 1.45.16;
Use aprint_*().
 1.44 11-Dec-2005  christos branches: 1.44.2; 1.44.4; 1.44.6;
merge ktrace-lwp.
 1.43 03-Feb-2005  perry branches: 1.43.6;
de-__P, partially ANSIfy
 1.42 14-Sep-2004  drochner branches: 1.42.4; 1.42.6;
adapt to ISA "unknown address" namespace separation
 1.41 02-Oct-2002  thorpej branches: 1.41.6;
Tidy up CFATTACH_DECL() formatting.
 1.40 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.39 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.38 17-Mar-2002  atatat branches: 1.38.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.37 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.36 15-Nov-2001  lukem add RCSID
 1.35 08-Jan-2000  takemura branches: 1.35.8; 1.35.10;
Absolute pointing device support.
- Wsmouse_input() get new argument 'flag', which indicates whether x/y/z are
relative or absolute.
- Wsmouse get new io controls, WSMOUSEIO_SCALIBCOORDS and
WSMOUSEIO_GCALIBCOORDS.
 1.34 23-Jan-1999  drochner branches: 1.34.8;
make the busmice work with wscons
 1.33 25-Aug-1998  thorpej Add some braces to make egcs happy.
 1.32 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.31 22-Mar-1998  drochner switch to non-BROKEN_INDIRECT_CONFIG
 1.30 12-Jan-1998  thorpej Update for changes to config.
 1.29 19-Oct-1997  mycroft Minor changes to make these more similar again.
 1.28 19-Oct-1997  thorpej Use bus.h
 1.27 13-Oct-1996  christos backout previous kprintf changes
 1.26 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.25 07-Sep-1996  mycroft Implement poll(2).
 1.24 12-May-1996  mycroft Use intr.h.
 1.23 03-May-1996  christos Prototype fixes.
 1.22 11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.21 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.20 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.19 05-Oct-1995  mycroft Use ISA_IPL_TTY, to fix race conditions.
 1.18 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.17 03-Jan-1995  mycroft Add interrupt sharing types.
 1.16 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.15 03-Nov-1994  mycroft Update to match autoconfig code.
 1.14 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.13 27-Oct-1994  cgd new RCS ID format.
 1.12 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.11 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.10 30-Mar-1994  mycroft Minor fix to attach messages.
 1.9 29-Mar-1994  mycroft Updates for new autoconfig.
 1.8 17-Feb-1994  mycroft New versions from magnum branch.
 1.7 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.6 02-Aug-1993  mycroft branches: 1.6.2;
Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.5 27-Jun-1993  andrew Replaced 386BSD conditionals with a NetBSD ones. Fixed a bug in 386BSD
support. Cast arguments to tsleep() and wakeup() to avoid compiler
warnings.
 1.4 14-Jun-1993  mycroft These mice use 4 ports.
 1.3 14-Jun-1993  mycroft Return EBUSY if device already open.
 1.2 14-Jun-1993  andrew Name change from bms -> mms.
 1.1 13-Jun-1993  andrew Microsoft & Logitech busmouse drivers.
 1.6.2.12 31-Oct-1993  mycroft Trivial stylistic change (to match lms).
 1.6.2.11 31-Oct-1993  mycroft Turn off interrupts before *forceintr to insure we get an edge.
 1.6.2.10 17-Oct-1993  mycroft No need to stay at spltty() while transferring event data.
 1.6.2.9 16-Oct-1993  mycroft Add missing dv_class entry to cfdrivers, and use dv_xname where appropriate.
 1.6.2.8 12-Oct-1993  mycroft Minor cleanup.
 1.6.2.7 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.6.2.6 07-Oct-1993  mycroft Don't #include isa.h.
 1.6.2.5 06-Oct-1993  mycroft Use standard ring buffer implementation. Use normal read() flag rather than
bit in minor number for non-blocking mode.
 1.6.2.4 01-Oct-1993  mycroft #include "machine/cpu.h"
 1.6.2.3 30-Sep-1993  mycroft Change some uses of IRQUNK to IRQNONE. #include isa.h and icu.h.
 1.6.2.2 30-Sep-1993  mycroft clock.c: Remove unnecessary casts.
com.c: Update for new config. Add bis() and bic() macros like BSDI's.
Add comspeed() and tiocm_xxx2mcr() from BSDI.
comreg.h: Add COM_FREQ, COM_TOLERANCE, and COM_NPORTS.
fd.c: Remove casts and clean up fdioctl().
[lm]ms.c: Add necessary gunk to [lm]ms_softc and remove casts.
 1.6.2.1 29-Sep-1993  mycroft lms.c: Remove sc_button.
mms.c: Reclone from lms.c.
 1.34.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.35.10.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.35.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.35.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.35.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.35.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.35.8.2 11-Jan-2002  nathanw More catchup.
 1.35.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.38.4.2 17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.38.4.1 17-Mar-2002  atatat file mms.c was added on branch sommerfeld_i386mp_1 on 2002-03-17 19:40:43 +0000
 1.41.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.41.6.3 18-Dec-2004  skrll Sync with HEAD.
 1.41.6.2 21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.6.1 18-Sep-2004  skrll Sync with HEAD.
 1.42.6.1 12-Feb-2005  yamt sync with head.
 1.42.4.1 29-Apr-2005  kent sync with -current
 1.43.6.3 03-Sep-2007  yamt sync with head.
 1.43.6.2 30-Dec-2006  yamt sync with head.
 1.43.6.1 21-Jun-2006  yamt sync with head.
 1.44.6.1 22-Apr-2006  simonb Sync with head.
 1.44.4.1 09-Sep-2006  rpaulo sync with head
 1.44.2.1 01-Mar-2006  yamt sync with head.
 1.45.16.2 10-Dec-2006  yamt sync with head.
 1.45.16.1 22-Oct-2006  yamt sync with head
 1.45.14.1 18-Nov-2006  ad Sync with head.
 1.48.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.49.40.2 28-Sep-2008  mjf Sync with HEAD.
 1.49.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.50.10.1 19-Oct-2008  haad Sync with HEAD.
 1.50.8.1 18-Jul-2008  simonb Sync with head.
 1.50.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.50.4.2 16-May-2009  yamt sync with head
 1.50.4.1 04-May-2009  yamt sync with head.
 1.51.8.3 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.51.8.2 01-Nov-2009  jym Sync with HEAD.
 1.51.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.53.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.54.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.154 12-Feb-2014  dsl Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).
 1.153 09-Feb-2014  dsl Tidy up and correct some comments.
Replace the hand generated 28 lines that initialised fpetable[]
with some pre-processor expressions.
The latter was verified to give the same table entries.
 1.152 04-Feb-2014  dsl There is no need to check for recursive calls into fpudna().
Rename the associated ci_fpsaving field to 'unused'.
I'm not sure they could ever happen, you could get unwanted calls into
the fpu trap code while saving state when using INT13 - but these are
different.
The return value from the i386 fpudna() was always 1 - possibly a historic
relic of the kernel fp emulation. Remove and don't check in trap.S.
The amd64 and i386 fpudna() code is now almost identical.
 1.151 03-Feb-2014  dsl Since we always run with CR0.NE set (internal fpu using vector 0x10)
npxintr() is only generated when a process executes an FP instruction
and the TS set interrupt takes precedence - so we know the current lwp
owns the fp registers.
It is also then impossible to get a splurious error while saving
the registers.
Ths lets the npxintr() code be simplified somewhat.
XXX: I'm not at all sure it really DTRT if the process actually wished
to fixup anything in the signal handler (or even if the signal is masked).
 1.150 02-Feb-2014  dsl Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!
 1.149 26-Jan-2014  dsl Remove support for 'external' floating point units and the MS-DOS
compatible method of handling floating point exceptions.
Make kernel support for teh fpu non-optional (486SX should still work).
Only 386 cpus support external fpu, and i386 support was removed years ago.
This means that the npx code no longer uses port 0xf0 or interupt 13.
All the "npx at isa" lines go from the configs, arch/i386/isa/npx.c
is now mandatory for all i386 kernels.
I've renamed npxinit() to fpuinit() and npxinit_cpu() to fpuinit_cpu()
to match the very similar amd64 functions.
The fpu of the boot cpu is now initialised by a direct call from
cpu_configure(), this enables FP emulation for a 486SX.
(for amd64 the cr0 values are set in locore.S and similar).
This fixes a long-standing bug in linux_setregs() - which did not
save the fpu regsiters if they were active.
I've test booted a single cpu i386 kernel (using anita).
amd64 builds - none of teh changes should affect it.
The i386 XEN kernels build, but I'm not sure where they set cr0, and
it might have got lost!
 1.148 19-Jan-2014  dsl Flatten the floating point register structures bu moving the
'environment' registers into the main strcuture.
There are x87 instructions that only affect the environment, but that
is no real excuse for all the sub-structures.
Rename fields so that there are far fewer collisions between the two
sets of field names.
 1.147 08-Dec-2013  dsl Rename the fields of 'struct envxmm' (itself badly named) so that they
are different from those used for the x87 fpu.
Use a union to describe the 64bit 'address' field so that it correctly
spilt for 32bit binaries.
The freebsd emulation defined its own 'struct freebsd_env87' that the
code just assumed matched the netbsd one.
Since this is a hardware structure, just use the netbsd one.
This shouldn't change the binaries except that 'en_fos' used to be
incorrectly a 32bit field.
 1.146 01-Dec-2013  christos revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes
 1.145 08-Nov-2013  christos Fix unused variable warnings
 1.144 23-Oct-2013  drochner Use the MI "pcu" framework for bookkeeping of npx/fpu states on x86.
This reduces the amount of MD code enormously, and makes it easier
to implement support for newer CPU features which require more fpu
state, or for fpu usage by the kernel.
For access to FPU state across CPUs, an xcall kthread is used now
rather than a dedicated IPI.
No user visible changes intended.
 1.143 11-Aug-2011  cherry branches: 1.143.2; 1.143.12; 1.143.16;
unbreak the build. #include <sys/cpu.h>
 1.142 11-Aug-2011  cherry More appropriate use of xen_send_ipi().
 1.141 10-Aug-2011  cherry xen ipi infrastructure
 1.140 07-Jun-2011  bouyer Don't call psignal() without holding proc_lock. This is the cause of
the reboot of PR port-xen/45028
Now that Xen2 is gone, handle FPU context switches the same way as
amd64. This makes all tests in /usr/tests/lib/libc/ieeefp pass.
 1.139 20-Dec-2010  matt branches: 1.139.6;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.138 25-Jul-2010  christos map npx control/status codes into siginfo codes.
 1.137 17-Jun-2010  christos Only clear the interrupt latch if we are using interrupts!
 1.136 18-Apr-2010  jym This patch fixes the NX regression issue observed on amd64 kernels, where
per-page execution right was disabled (therefore leading to the inability
of the kernel to detect fraudulent use of memory mappings marked as not
being executable).

- replace cpu_feature and ci_feature_flags variables by cpu_feature and
ci_feat_val arrays. This makes it cleaner and brings kernel code closer
to the design of cpuctl(8). A warning will be raised for each CPU that
does not expose the same features as the Boot Processor (BP).

- the blacklist of CPU features is now a macro defined in the
specialreg.h header, instead of hardcoding it inside MD initialization
code; fix comments.

- replace checks against CPUID_TSC with the cpu_hascounter() function.

- clean up the code in init_x86_64(), as cpu_feature variables are set
inside cpu_probe().

- use cpu_init_msrs() for i386. It will be eventually used later for NX
feature under i386 PAE kernels.

- remove code that checks for CPUID_NOX in amd64 mptramp.S, this is already
performed by cpu_hatch() through cpu_init_msrs().

- remove cpu_signature and feature_flags members from struct mpbios_proc
(they were never used).

This patch was tested with i386 MONOLITHIC, XEN3PAE_DOM0 and XEN3_DOM0 under
a native i386 host, and amd64 GENERIC, XEN3_DOM0 via QEMU virtual machines.

XXX Should kernel rev be bumped?

XXX A similar patch should be pulled-up for NetBSD-5, hopefully tomorrow.
 1.135 21-Nov-2009  rmind branches: 1.135.2; 1.135.4;
Use lwp_getpcb() on x86 MD code, clean from struct user usage.
 1.134 25-Nov-2008  bouyer branches: 1.134.4;
npxdna(): even if there's no effective FPU context switch set ci_fpused;
FPU will be used and needs to be switched on next context switch.
Fix "panic: npxintr: wrong process" with Xen.
 1.133 25-Nov-2008  bouyer npxsave_cpu() set ci_fpused so that the FPU will be disabled on next context
switch on Xen. Fix "npxintr: came from nowhere" kernel messages on Xen/i386.
 1.132 11-Nov-2008  ad PR port-i386/39299 FPU use in signal handlers is unsafe
 1.131 11-Nov-2008  ad PR port-amd64/38293 panic: fp_save ipi didn't

Fix race conditions in FPU IPI handling.
 1.130 11-Nov-2008  ad PR port-amd64/38293 panic: fp_save ipi didn't

Kill the FP flush IPI and always save. The synchronization here isn't strong
and we could easily pull the chain on an innocent LWP's FP state.

Another fix to follow.
 1.129 30-Apr-2008  cegger branches: 1.129.6; 1.129.8; 1.129.10;
AMD's APM Volume 2 says 'All control registers are 64bit in long mode'.
Fix the CR0 prototype to match this (the asm implementation is correct though).
OK ad
 1.128 28-Apr-2008  ad Make FPU handling preemption safe.
 1.127 04-Mar-2008  cube branches: 1.127.2; 1.127.4;
Split device_t and softc for npx(4).
 1.126 08-Feb-2008  christos branches: 1.126.2; 1.126.6;
The probe function hijacks 2 idt vectors and then restores them back. There
is no reason to permanently allocate idtvec[0x2d], which could be used
by compat_svr4 as the system call gate.
 1.125 20-Jan-2008  dyoung Do not reserve ISA bus space for npx@isa unless we hook IRQ 13,
which we ought to never do. If we have not hooked IRQ 13, we do
not need any resources in npx_softc to handle numeric coprocessor
exceptions, so let npx@isa detach.
 1.124 15-Jan-2008  ad Make it compile.
 1.123 15-Jan-2008  joerg Introduce optional cpu_offline_md to execute MD actions at the end of
cpu_offline. Use this on amd64/i386 to force a FPU save. As this was
triggered by npxsave_cpu/fpusave_cpu not working for a different CPU,
remove the cpu_info argument and adjust npxsave_*/fpusave_* to use bool
for the save.

OK ad@
 1.122 11-Jan-2008  bouyer Merge the bouyer-xeni386 branch to head, at tag bouyer-xeni386-merge1 (the
branch is still active and will see i386PAE support developement).
Sumary of changes:
- switch xeni386 to the x86/x86/pmap.c, and the xen/x86/x86_xpmap.c
pmap bootstrap.
- merge back most of xen/i386/ to i386/i386
- change the build to reduce diffs between i386 and amd64 in file locations
- remove include files that were identical to the i386/amd64 counterparts,
the build will find them via the xen-ma/machine link.
 1.121 26-Dec-2007  yamt - share idt entry allocation code among x86.
- introduce a function to reserve an idt entry and use it instead of
manipulating idt_allocmap directly.
- rename idt to xen_idt for amd64 xen. add missing #ifdef XEN.
 1.120 09-Dec-2007  jmcneill branches: 1.120.2;
Merge jmcneill-pm branch.
 1.119 14-Nov-2007  ad branches: 1.119.2; 1.119.4;
- Don't test for I686_CPU.
- splipi -> splhigh
- Remove some pointless ifdefs.
 1.118 17-Oct-2007  garbled branches: 1.118.2;
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.117 26-Sep-2007  ad branches: 1.117.2;
x86 changes for pcc and LKMs.

- Replace most inline assembly with proper functions. As a side effect
this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
smaller amount. Nearly all of the inlines did something slow, or something
that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.
 1.116 08-Dec-2006  yamt branches: 1.116.6; 1.116.14; 1.116.22; 1.116.24; 1.116.26;
- pass intrframe by-pointer, not by-value.
- make i386 and xen use per-cpu interrupt stack.

xen part is reviewed by Manuel Bouyer.
 1.115 16-Nov-2006  christos branches: 1.115.2;
__unused removal on arguments; approved by core.
 1.114 28-Oct-2006  christos Make npx work on the AMD Geode LX-800 processor by short-circuiting
the npx detection code. Since exception reporting is broken, check the
CPUID_FPU feature. This is what FreeBSD does.
 1.113 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.112 19-Apr-2006  christos branches: 1.112.8; 1.112.10;
Apply fix from FreeBSD's advisory: fxrstor on AMD FPU's does not restore
FIP,FDP,FOP thus leaking other process's execution history.
 1.111 19-Feb-2006  thorpej branches: 1.111.2; 1.111.4; 1.111.6;
Use aprint_*().
 1.110 26-Dec-2005  perry branches: 1.110.2; 1.110.4; 1.110.6;
u_intN_t -> uintN_t
 1.109 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.108 11-Dec-2005  christos merge ktrace-lwp.
 1.107 03-Feb-2005  perry branches: 1.107.4; 1.107.6; 1.107.14;
de-__P, partially ANSIfy
 1.106 06-Jul-2004  mycroft branches: 1.106.4; 1.106.6;
Back out part of the changes in rev 1.86. Remove npxdna_notset(), and instead
have the DNA trap handler point to npxdna_empty() by default. This way, if
there are no npx devices found and MATH_EMULATE is not configured, we go back
to the old behavior of issuing a SIGKILL and printing:
pid XXX killed due to lack of floating point
rather than panicking.
 1.105 23-Jun-2004  yamt remove a prototype for a function which doesn't exist. (npxdna)
 1.104 13-May-2004  yamt npxsave_lwp: issue pause in a busy loop.
 1.103 21-Mar-2004  simonb branches: 1.103.2;
Only initialise ksi if we use it.
 1.102 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.101 28-Jan-2004  yamt rename i386 mdlwp flags from MDP_ to MDL_
to avoid confusion with mdproc flags which also have MDP_ prefixes.
 1.100 26-Jan-2004  scw __splbarrier() is deprecated in favour of the MI __insn_barrier().
 1.99 05-Dec-2003  jdolecek fix IPRINTF() code to compile if the printf()s are enabled; also print
lwp pointers rather than proc pointer
 1.98 19-Oct-2003  cl don't uvm_swapout LWPs which are LSONPROC on another cpu.

uvm_swapout_threads will swapout LWPs which are running on another CPU:
- uvm_swapout_threads considers LWPs running on another CPU for swapout
if their l_swtime is high
- uvm_swapout_threads considers LWPs on the runqueue for swapout if their
l_swtime is high but these LWPs might be running by the time uvm_swapout
is called

symptoms of failure: panic in setrunqueue

fixes PR kern/23095
 1.97 08-Oct-2003  thorpej Use KSI_INIT_TRAP().
 1.96 07-Oct-2003  skd Support for proper siginfo FP codes. Also, set si_trap to fp status word.
Approved by fvdl.
 1.95 06-Sep-2003  christos SA_SIGINFO changes
 1.94 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.93 23-Jun-2003  martin branches: 1.93.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.92 03-Mar-2003  fvdl The IDT only contains gate descriptors, so define it as such.
 1.91 26-Feb-2003  fvdl Adapt for i386/x86 change.
 1.90 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.89 04-Dec-2002  fvdl Don't use delay() in the IPI wait loop. Use an empty one instead, with
a counter check in the DIAGNOSTIC case.
 1.88 22-Nov-2002  fvdl New interrupt code. The basic idea behind it is to hide the differences
in interrupt controllers in struct pic, and try to keep as much
common code as possible. At the lowest (asm) level, this is done
with CPP macros.

The main structure is now struct intrsource, describing an established
interrupt line, of any kind (soft/hard local apic/legacy apic/IO apic).
For quick masking, there may be a maximum of 32 sources per CPU.
Sources can be assigned to any CPU in the MP case, though currently they
all go to the boot CPU.
 1.87 05-Oct-2002  fvdl Adjust callers to setgate() to match new extra parameter.
 1.86 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.85 01-Apr-2002  jdolecek Make work on FPU-less computers again - if FPU is not detected in
npxprobe1(), set npxdna_func to new npxdna_empty(). This function just
returns 0 and thus fallbacks to a T_DNA trap (and math emulate, if present).
This fixes kern/15828 by Masaru Oki, tested on 386DX machine.
Reviewed by Jason Thorpe.

make npxdna_s87() and npxdna_xmm() static
g/c (npx_type == NPX_NONE) test from npxdna_s87(), it's no longer needed
 1.84 10-Jan-2002  enami Cope with rev. 1.16 of frame.h; trapframe now starts at if_gs in intrframe.
This fixes PR#14040.
 1.83 08-Jan-2002  toshii Remove fwait after fxsave.

Raising math exception from fpu_save causes machine reboots.
Also, this fwait would cause incorrect results, as pending exceptions
are to be handled later after fxrstor.
 1.82 15-Nov-2001  lukem add RCSID
 1.81 03-Sep-2001  thorpej Eliminate a needless test, pointed out by Bill Sommerfeld.
 1.80 03-Aug-2001  thorpej Upon further reading of the manual, don't save the MXCSR-at-last-exception.
Its status bits are sticky, and unaffacted by FNINIT.
 1.79 03-Aug-2001  thorpej Remember the MXCSR at last-exception the way we do the FPU SW/TW.
 1.78 02-Aug-2001  thorpej - Rename cpu_use_fxsave to i386_use_fxsave.
- If we detect SSE/SSE2 support in the CPU, enable SSE exceptions
and set i386_has_{sse,sse2} as appropriate.
- Expose i386_use_fxsave and i386_has_{sse,sse2} through sysctl
as machdep.{osfsxr,sse,sse2}.
 1.77 02-Aug-2001  thorpej Add support for saving/restoring SSE/SSE2 state using FXSAVE/FXRSTOR.

Reviewed by Frank.
 1.76 17-May-2001  lukem branches: 1.76.2;
don't bother providing duplicate code for {read,write}_eflags() since it's in cpufuncs.h anyway
 1.75 26-Apr-2001  thorpej Explicitly include <machine/pio.h>.
 1.74 17-Jan-2001  fvdl branches: 1.74.2;
Export some variables.
 1.73 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.72 16-Jun-2000  thorpej branches: 1.72.2;
Rearrange the npx driver a little to allow for multiple attachments
and add a pnpbios atttachment for it.
 1.71 17-Apr-2000  tron branches: 1.71.2;
Fix typo in comment.
 1.70 06-Oct-1999  fvdl branches: 1.70.2; 1.70.8;
Set variable i386_fpu_present to 1 if a functional FPU was detected. For
later retrieval by sysctl.
 1.69 24-Mar-1999  mrg branches: 1.69.8;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.68 26-Jan-1999  christos move the assembly functions to locore.s and make the variables used by
them non-static
 1.67 22-Mar-1998  drochner switch to non-BROKEN_INDIRECT_CONFIG
 1.66 20-Mar-1998  mycroft In npxdna(), if there was an exception state in the FPU but npxproc was
null, the frstor would fault on a PPro. I'm pretty sure this is not
how the chip is supposed to behave, but it's easy enough to do a fninit
to throw away the exception state.
Also, some other minor changes to the documentation.
 1.65 10-Feb-1998  mrg - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
 1.64 06-Feb-1998  mrg add the i386 MD portions for UVM.
 1.63 24-Jan-1998  mycroft Store the initial NPX control word appropriate for the emulation in the saved
FPU state, and use it when initializing the FPU on demand.
 1.62 23-Jan-1998  mycroft Some rearrangement of the startup code:
* Move some of the memory bootstrapping and the DDB startup earlier.
* Always put the IDT and the initial GDT and LDT in a separate page.
* Various minor changes.
 1.61 12-Jan-1998  thorpej Update for changes to config.
 1.60 16-Oct-1997  mycroft branches: 1.60.2;
Need vmmeter.h here now.
 1.59 13-Oct-1996  christos backout previous kprintf changes
 1.58 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.57 12-May-1996  mycroft Use intr.h.
 1.56 03-May-1996  christos - Add missing prototypes.
- Fix gcc warnings
 1.55 11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.54 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.53 07-Jan-1996  mycroft Put #includes in the right order.
 1.52 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.51 10-Oct-1995  mycroft Add USERMODE() and KERNELMODE() macros, and use them.
 1.50 05-Oct-1995  mycroft Remove unneeded input operands to fnsave(), fnstcw(), and fnstsw().
 1.49 06-Aug-1995  mycroft Merge npxinit() into npxdna(), and remove duplicated code.
 1.48 06-Aug-1995  mycroft Update the comment describing how this works.
 1.47 06-Aug-1995  mycroft Fix oversight in previous.
 1.46 06-Aug-1995  mycroft Eliminate direct uses of curproc in npxdna() and npxinit().
 1.45 06-Aug-1995  mycroft Stop using cr0 to flag that the FPU has not been used.
 1.44 06-Aug-1995  mycroft Move the `used fpu' flag into mdproc, so it can be referenced when a process
is swapped out. Implement process_{read,write}_fpregs.
 1.43 04-May-1995  mycroft If we decide to use IRQ 13, explicitly turn off CR0_NE to be sure.
 1.42 04-May-1995  mycroft Update a comment to match that last change.
 1.41 04-May-1995  mycroft npxinit() should not be called during autoconfig now. Watch for this
condition.
 1.40 04-May-1995  mycroft Move some comments from before npxsave1() to before npxsave().
 1.39 03-May-1995  mycroft Slight rearrangement, to make the TS handling easier to follow.
 1.38 03-May-1995  mycroft Set PCB_USEDFPU.
 1.37 01-May-1995  mycroft Update to match include files. Eliminate _ucodesel, _udatasel, and IdlePTD.
 1.36 01-May-1995  mycroft Be more aggressive about lazy saving and initialization.
 1.35 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.34 26-Jan-1995  mycroft Remove redundant assignments.
 1.33 26-Jan-1995  mycroft Introduce a `npx_softc' to make this driver more normal. Some other minor
cleanup.
 1.32 03-Jan-1995  mycroft Add interrupt sharing types.
 1.31 30-Nov-1994  mycroft Rework detection a bit, and check for the Pentium fdiv bug.
 1.30 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.29 07-Nov-1994  mycroft Garbage collect some variables which are no longer used.
 1.28 07-Nov-1994  mycroft Since npxdna() and npxsave() are only ever called at spl0 now, we can get rid
of all the overhead of frobbing the IDT, and just use a simple flag to tell
npxintr() to ignore interrupts. This allows lots of code reduction.
Also, update some comments and add some DIAGNOSTIC code to detect is these
assumptions ever become wrong.
 1.27 06-Nov-1994  mycroft Only save the FPU state if somebody else needs the FPU, or when forking.
 1.26 04-Nov-1994  mycroft Make IRQ_SLAVE a plain number, too, and remove IRQ{0-15}.
 1.25 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.24 03-Nov-1994  mycroft Update to match autoconfig code.
 1.23 27-Oct-1994  cgd new RCS ID format.
 1.22 26-Oct-1994  mycroft Implement new system call entry method. Clean up all of the IDT frobnication
code.
 1.21 28-Jun-1994  deraadt nice little colons
 1.20 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.19 24-Apr-1994  mycroft Rename two files.
 1.18 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.17 05-Apr-1994  mycroft npxexit() doesn't need its arg.
 1.16 05-Apr-1994  mycroft Don't bother checking npxproc on exit.
 1.15 29-Mar-1994  mycroft Updates for new autoconfig.
 1.14 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.13 03-Mar-1994  mycroft Add a magic DELAY() in the reset sequence which causes the ITT 387 to not.
From Brian de Alwis.
 1.12 03-Jan-1994  mycroft Inline all the [lr]cr[023]() `functions' in cpufunc.h.
 1.11 20-Dec-1993  mycroft Use cpufunc.h only where (currently) needed.
 1.10 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.9 20-Dec-1993  mycroft Increment cnt.v_trap in npxintr().
 1.8 16-Sep-1993  brezak Changes to use a trap frame for syscalls.
 1.7 14-Jun-1993  cgd branches: 1.7.4;
say "using exception 16" rather than "exception 16"; the latter
lookes like it could be an error message...
 1.6 27-May-1993  proven Cleaned up a little.
 1.5 26-May-1993  proven Compiles with gcc-2.3.3 now.
 1.4 20-May-1993  cgd require MATH_EMUALATE to be defined if you want to use the emulator
 1.3 09-May-1993  deraadt npx patches from Bruce Evans. patchkit 10002
 1.2 03-Apr-1993  cgd added changes from Steven Reiz <sreiz@aie.nl> (based on
those by Poul-Henning Kamp <phk@data.fls.dk>) to get the kernel
to compile properly when gcc2.* is cc. (should still work
when gcc1.39 is in use.)
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.4.13 05-Dec-1993  mycroft Fix probe routine.
 1.7.4.12 14-Nov-1993  mycroft Remove some more gratuitous casting.
 1.7.4.11 08-Nov-1993  mycroft If we get an unexpected DNA, try to clean up and keep running anyway.
 1.7.4.10 26-Oct-1993  mycroft Set to I/O area size. Don't bother to do the fwait while probing.
 1.7.4.9 17-Oct-1993  mycroft Minor cleanup.
 1.7.4.8 16-Oct-1993  mycroft Add missing dv_class entry to cfdrivers, and use dv_xname where appropriate.
 1.7.4.7 13-Oct-1993  mycroft Remove unused intrframe.
 1.7.4.6 12-Oct-1993  mycroft Remove stupid special case for immediate signal processing. This doesn't save
more than a few cycles, and causes interrupt frames to be bogusly large.
 1.7.4.5 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.7.4.4 10-Oct-1993  mycroft load_cr0 --> lcr0
 1.7.4.3 09-Oct-1993  mycroft Make npxintr() non-static so locore can get to it.
 1.7.4.2 07-Oct-1993  mycroft Convert to new config, with some general cleanup.
 1.7.4.1 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.60.2.2 05-May-1998  mycroft Pull up 1.66, per request of mycroft.
 1.60.2.1 29-Jan-1998  mellon Pull up 1.63 (mycroft)
 1.69.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.70.8.17 27-Apr-2002  sommerfeld Merge with current as of today
 1.70.8.16 28-Jan-2002  sommerfeld Yet Another mergeup with -current.
 1.70.8.15 29-Dec-2001  sommerfeld Yet another mergeup.

New work:
- Frank van der Linden's tlb shootdown fix.
Mainline functionality merged:
- IrDA
- Kernel RCSID's
- Transmeta CPU support
- ACPI
- XMM register access through procfs
 1.70.8.14 03-Sep-2001  sommerfeld Merge with -current once more.
 1.70.8.13 23-May-2001  sommerfeld Merge branch with tonight's current.
boots multiuser.
 1.70.8.12 30-Apr-2001  sommerfeld Merge sommerfeld_i386mp_1 branch with -current as of today.
GENERIC.MP kernel boots and runs multiuser on my ABIT BP6
 1.70.8.11 23-Jan-2001  thorpej Sync with the trunk.
 1.70.8.10 10-Jan-2001  sommerfeld Significant rewrite of slave CPU attach and initialization, centering
on identifycpu() and spreading outward.

Separate feature probes (cpuid invocation), which runs on the cpu
being attached, from the display of this information, which runs on
the boot cpu; remove some of the probe code from locore as it doesn't
need to run that early.

We now spin up secondary cpu's during cpu_attach, have them do a cpu
feature probe, and then have them spin waiting for a "go" signal.

We no longer pay attention to the cpu signature and cpuid features
reported by the MP BIOS since those are known to be truncated for at
least some bioses.

We now do npx initialization (including FDIV bug detection) on all
cpus.

XXX Change some of the cyrix bug workarounds to fit the new
identifycpu() system; this is untested.
 1.70.8.9 09-Jan-2001  sommerfeld Fix two bugs preventing this from working if !MULTIPROCESSOR
1) ci->ci_curproc is not (yet) used in uniprocessor mode.
2) change a "pushl cpu_info_primary" to the intended
"pushl $cpu_info_primary" (oops)
 1.70.8.8 25-Aug-2000  sommerfeld Get this to at least build again in the !MULTIPROCESSOR case..
 1.70.8.7 18-Aug-2000  sommerfeld GC dead code.
 1.70.8.6 18-Aug-2000  sommerfeld Restructure (based somewhat on how Jason adapted this for the alpha).
Now works in the multiprocessor case.
 1.70.8.5 07-Aug-2000  sommerfeld Merge sommerfeld_i386mp_1 branch forward to 20000806 sources
 1.70.8.4 26-Jun-2000  sommerfeld Start making npx.c MP-safe; Interface to npx now specifies the process
and/or cpu to act on. Implement an IPI for MP lazy FP save.
Tested and working when only one CPU is running; untested in the MP
case since we can't run user processes on multiple CPU's yet.

Along for the ride:
- Change i386_send_ipi to take a "struct cpu_info *" rather than a cpu number.
- Turn off the "give me the brain" test IPI's.
 1.70.8.3 25-Jun-2000  sommerfeld Merge up to just-post-1.5 -current
 1.70.8.2 22-Apr-2000  sommerfeld Merge up to -current.
 1.70.8.1 20-Feb-2000  sommerfeld Catch up to intr.h changes
 1.70.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.70.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.71.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.72.2.2 23-Feb-2002  he Pull up revision 1.84 (requested by enami):
Cope correctly with earlier update of i386 include/frame.h, which
put if_gs at the start of trapframe. Fixes PR#14040.
 1.72.2.1 30-Mar-2001  he Pull up revision 1.74 (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.74.2.17 11-Dec-2002  thorpej Sync with HEAD.
 1.74.2.16 18-Oct-2002  nathanw LWPify a couple of KDASSERT()s.
 1.74.2.15 18-Oct-2002  nathanw LWPify new code.

npxsave_proc() -> npxsave_lwp().
 1.74.2.14 18-Oct-2002  nathanw Catch up to -current.
 1.74.2.13 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.74.2.12 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.74.2.11 17-Apr-2002  nathanw Catch up to -current.
 1.74.2.10 04-Mar-2002  nathanw Oops, need another #endif.
 1.74.2.9 04-Mar-2002  nathanw Put in a very klugey workaround for the tsleep()/getmcontext()/npxsave()
problem, for the time being.
 1.74.2.8 28-Feb-2002  nathanw Catch up to -current.
 1.74.2.7 11-Jan-2002  nathanw More catchup.
 1.74.2.6 08-Jan-2002  nathanw Catch up to -current.
 1.74.2.5 21-Sep-2001  nathanw Catch up to -current.
 1.74.2.4 24-Aug-2001  nathanw A few files and lwp/proc conversions I missed in the last big update.
GENERIC runs again.
 1.74.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.74.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.74.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.76.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.76.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.76.2.4 11-Feb-2002  jdolecek Sync w/ -current.
 1.76.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.76.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.76.2.1 03-Aug-2001  lukem update to -current
 1.93.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.93.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.93.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.93.2.1 03-Aug-2004  skrll Sync with HEAD
 1.103.2.3 12-May-2006  tron Pull up following revision(s) (requested by adrianp in ticket #10553):
sys/arch/amd64/amd64/fpu.c: revision 1.14
sys/arch/i386/isa/npx.c: revision 1.112
Apply fix from FreeBSD's advisory: fxrstor on AMD FPU's does not restore
FIP,FDP,FOP thus leaking other process's execution history.
 1.103.2.2 07-Jul-2004  tron branches: 1.103.2.2.2; 1.103.2.2.4;
Pull up revision 1.106 (requested by mycroft in ticket #611):
Back out part of the changes in rev 1.86. Remove npxdna_notset(), and instead
have the DNA trap handler point to npxdna_empty() by default. This way, if
there are no npx devices found and MATH_EMULATE is not configured, we go back
to the old behavior of issuing a SIGKILL and printing:
pid XXX killed due to lack of floating point
rather than panicking.
 1.103.2.1 07-Jul-2004  tron Pull up revision 1.105 (requested by mycroft in ticket #611):
remove a prototype for a function which doesn't exist. (npxdna)
 1.103.2.2.4.1 12-May-2006  tron Pull up following revision(s) (requested by adrianp in ticket #10553):
sys/arch/amd64/amd64/fpu.c: revision 1.14
sys/arch/i386/isa/npx.c: revision 1.112
Apply fix from FreeBSD's advisory: fxrstor on AMD FPU's does not restore
FIP,FDP,FOP thus leaking other process's execution history.
 1.103.2.2.2.1 12-May-2006  tron Pull up following revision(s) (requested by adrianp in ticket #10553):
sys/arch/amd64/amd64/fpu.c: revision 1.14
sys/arch/i386/isa/npx.c: revision 1.112
Apply fix from FreeBSD's advisory: fxrstor on AMD FPU's does not restore
FIP,FDP,FOP thus leaking other process's execution history.
 1.106.6.1 12-Feb-2005  yamt sync with head.
 1.106.4.1 29-Apr-2005  kent sync with -current
 1.107.14.1 12-May-2006  tron Pull up following revision(s) (requested by adrianp in ticket #1321):
sys/arch/amd64/amd64/fpu.c: revision 1.14
sys/arch/i386/isa/npx.c: revision 1.112
Apply fix from FreeBSD's advisory: fxrstor on AMD FPU's does not restore
FIP,FDP,FOP thus leaking other process's execution history.
 1.107.6.7 17-Mar-2008  yamt sync with head.
 1.107.6.6 11-Feb-2008  yamt sync with head.
 1.107.6.5 21-Jan-2008  yamt sync with head
 1.107.6.4 15-Nov-2007  yamt sync with head.
 1.107.6.3 27-Oct-2007  yamt sync with head.
 1.107.6.2 30-Dec-2006  yamt sync with head.
 1.107.6.1 21-Jun-2006  yamt sync with head.
 1.107.4.2 30-May-2007  bouyer Pull up following revision(s) (requested by christos in ticket #1580):
sys/arch/i386/pnpbios/npx_pnpbios.c: revision 1.8 - 1.9
sys/arch/i386/acpi/npx_acpi.c: revision 1.14 - 1.15
sys/arch/i386/isa/npx_isa.c: revision 1.13 - 1.14
sys/arch/i386/isa/npx.c: revision 1.114
sys/arch/i386/isa/npxvar.h: revision 1.5
fix print formatting.
handle NPX_CPUID
Make npx work on the AMD Geode LX-800 processor by short-circuiting
the npx detection code. Since exception reporting is broken, check the
CPUID_FPU feature. This is what FreeBSD does.
 1.107.4.1 12-May-2006  tron Pull up following revision(s) (requested by adrianp in ticket #1321):
sys/arch/amd64/amd64/fpu.c: revision 1.14
sys/arch/i386/isa/npx.c: revision 1.112
Apply fix from FreeBSD's advisory: fxrstor on AMD FPU's does not restore
FIP,FDP,FOP thus leaking other process's execution history.
 1.110.6.1 22-Apr-2006  simonb Sync with head.
 1.110.4.1 09-Sep-2006  rpaulo sync with head
 1.110.2.1 01-Mar-2006  yamt sync with head.
 1.111.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.111.4.1 11-May-2006  elad sync with head
 1.111.2.1 24-May-2006  yamt sync with head.
 1.112.10.2 10-Dec-2006  yamt sync with head.
 1.112.10.1 22-Oct-2006  yamt sync with head
 1.112.8.2 12-Jan-2007  ad Sync with head.
 1.112.8.1 18-Nov-2006  ad Sync with head.
 1.115.2.1 18-Oct-2009  bouyer Pull up following revision(s) (requested by mlelstv in ticket #1363):
sys/arch/i386/isa/npx.c: revision 1.132 via patch
sys/arch/amd64/amd64/fpu.c: revision 1.29 via patch
sys/arch/amd64/amd64/machdep.c: revision 1.105 via patch
sys/arch/i386/i386/machdep.c: revision 1.647 via patch
PR port-i386/39299 FPU use in signal handlers is unsafe
Ensure FP state is reset, if FP is used in a signal handler.
Fixes PR kern/39299 for 32bit code.
 1.116.26.1 06-Oct-2007  yamt sync with head.
 1.116.24.3 23-Mar-2008  matt sync with HEAD
 1.116.24.2 09-Jan-2008  matt sync with HEAD
 1.116.24.1 06-Nov-2007  matt sync with HEAD
 1.116.22.5 08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.116.22.4 21-Nov-2007  joerg Sync with HEAD.
 1.116.22.3 06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.116.22.2 02-Oct-2007  joerg Sync with HEAD.
 1.116.22.1 05-Aug-2007  jmcneill Certain devices either don't require a power handler, or are restored
on resume outside of the pnp power management framework. For such devices,
introduce the null power handler, pnp_generic_power.
 1.116.14.1 03-Oct-2007  garbled Sync with HEAD
 1.116.6.2 03-Dec-2007  ad Sync with HEAD.
 1.116.6.1 09-Oct-2007  ad Sync with head.
 1.117.2.1 18-Nov-2007  bouyer Sync with HEAD
 1.118.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.118.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.118.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.119.4.1 11-Dec-2007  yamt sync with head.
 1.119.2.1 26-Dec-2007  ad Sync with head.
 1.120.2.4 23-Jan-2008  bouyer Sync with HEAD.
 1.120.2.3 19-Jan-2008  bouyer Sync with HEAD
 1.120.2.2 06-Jan-2008  bouyer Switch xen/i386 to the i386 npx.c. We have to keep npx_hv.c to attach npx
to hypervisor0.
 1.120.2.1 02-Jan-2008  bouyer Sync with HEAD
 1.126.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.126.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.126.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.126.2.1 24-Mar-2008  keiichi sync with head.
 1.127.4.4 11-Aug-2010  yamt sync with head.
 1.127.4.3 11-Mar-2010  yamt sync with head
 1.127.4.2 04-May-2009  yamt sync with head.
 1.127.4.1 16-May-2008  yamt sync with head.
 1.127.2.1 18-May-2008  yamt sync with head.
 1.129.10.6 22-Apr-2010  snj Apply patch (requested by jym in ticket #1380):
Fix the NX regression issue observed on amd64 kernels, where per-page
execution right was disabled (therefore leading to the inability
of the kernel to detect fraudulent use of memory mappings marked as not
being executable).
 1.129.10.5 27-Nov-2008  snj branches: 1.129.10.5.2; 1.129.10.5.4;
Pull up following revision(s) (requested by bouyer in ticket #129):
sys/arch/i386/isa/npx.c: revision 1.134
npxdna(): even if there's no effective FPU context switch set ci_fpused;
FPU will be used and needs to be switched on next context switch.
Fix "panic: npxintr: wrong process" with Xen.
 1.129.10.4 27-Nov-2008  snj Pull up following revision(s) (requested by bouyer in ticket #128):
sys/arch/i386/isa/npx.c: revision 1.133
npxsave_cpu() set ci_fpused so that the FPU will be disabled on next
context switch on Xen. Fix "npxintr: came from nowhere" kernel messages on
Xen/i386.
 1.129.10.3 20-Nov-2008  snj Pull up following revision(s) (requested by ad in ticket #71):
sys/arch/i386/isa/npx.c: revision 1.132
sys/arch/amd64/amd64/fpu.c: revision 1.29
sys/arch/amd64/amd64/machdep.c: revision 1.105
sys/arch/i386/i386/machdep.c: revision 1.647
PR port-i386/39299 FPU use in signal handlers is unsafe
 1.129.10.2 17-Nov-2008  snj Pull up following revision(s) (requested by ad in ticket #74):
sys/arch/i386/isa/npx.c: revision 1.131
sys/arch/amd64/amd64/fpu.c: revision 1.28
sys/arch/i386/i386/genassym.cf: revision 1.77
sys/arch/i386/i386/autoconf.c: revision 1.93
sys/arch/amd64/amd64/locore.S: revision 1.48
sys/arch/amd64/amd64/machdep.c: revision 1.104
sys/arch/i386/i386/machdep.c: revision 1.646
sys/arch/amd64/amd64/genassym.cf: revision 1.38
sys/arch/i386/i386/locore.S: revision 1.79
PR port-amd64/38293 panic: fp_save ipi didn't
Fix race conditions in FPU IPI handling.
 1.129.10.1 17-Nov-2008  snj Pull up following revision(s) (requested by ad in ticket #73):
sys/arch/amd64/amd64/fpu.c: revision 1.27
sys/arch/amd64/amd64/ipifuncs.c: revision 1.20
sys/arch/i386/i386/ipifuncs.c: revision 1.28
sys/arch/i386/isa/npx.c: revision 1.130
sys/arch/x86/include/intrdefs.h: revision 1.14
PR port-amd64/38293 panic: fp_save ipi didn't
Kill the FP flush IPI and always save. The synchronization here isn't
strong and we could easily pull the chain on an innocent LWP's FP state.
Another fix to follow.
 1.129.10.5.4.1 20-May-2011  matt bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat).
 1.129.10.5.2.1 23-Apr-2010  snj Apply patch (requested by jym in ticket #1380):
Fix the NX regression issue observed on amd64 kernels, where per-page
execution right was disabled (therefore leading to the inability
of the kernel to detect fraudulent use of memory mappings marked as not
being executable).
 1.129.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.129.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.134.4.3 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.134.4.2 10-Jan-2011  jym Sync with HEAD
 1.134.4.1 24-Oct-2010  jym Sync with HEAD
 1.135.4.4 12-Jun-2011  rmind sync with head
 1.135.4.3 05-Mar-2011  rmind sync with head
 1.135.4.2 03-Jul-2010  rmind sync with head
 1.135.4.1 30-May-2010  rmind sync with head
 1.135.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.135.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.139.6.3 25-Oct-2011  bouyer Make this build without options MULTIPROCESSOR
 1.139.6.2 31-Jul-2011  cherry grow MP support for i386. boots to single user
 1.139.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.143.16.1 18-May-2014  rmind sync with head
 1.143.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.143.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.23 26-Jan-2014  dsl Remove support for 'external' floating point units and the MS-DOS
compatible method of handling floating point exceptions.
Make kernel support for teh fpu non-optional (486SX should still work).
Only 386 cpus support external fpu, and i386 support was removed years ago.
This means that the npx code no longer uses port 0xf0 or interupt 13.
All the "npx at isa" lines go from the configs, arch/i386/isa/npx.c
is now mandatory for all i386 kernels.
I've renamed npxinit() to fpuinit() and npxinit_cpu() to fpuinit_cpu()
to match the very similar amd64 functions.
The fpu of the boot cpu is now initialised by a direct call from
cpu_configure(), this enables FP emulation for a 486SX.
(for amd64 the cr0 values are set in locore.S and similar).
This fixes a long-standing bug in linux_setregs() - which did not
save the fpu regsiters if they were active.
I've test booted a single cpu i386 kernel (using anita).
amd64 builds - none of teh changes should affect it.
The i386 XEN kernels build, but I'm not sure where they set cr0, and
it might have got lost!
 1.22 01-Jul-2011  dyoung branches: 1.22.2; 1.22.12; 1.22.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.21 04-May-2009  cegger struct cfdata * -> cfdata_t
 1.20 02-Apr-2009  dyoung During shutdown, detach devices in an orderly fashion.

Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks. For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown. Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags. Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag. The default for kern.detachall is 0. SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress. In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs. Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
 1.19 11-Apr-2008  cegger branches: 1.19.4; 1.19.12; 1.19.18;
remove extra blank.

before:
nxp0: reported by CPUID; using exception 16

now:
npx0: reported by CPUID; using exception 16
 1.18 04-Mar-2008  cube Split device_t and softc for npx(4).
 1.17 20-Jan-2008  dyoung branches: 1.17.2; 1.17.6;
Do not reserve ISA bus space for npx@isa unless we hook IRQ 13,
which we ought to never do. If we have not hooked IRQ 13, we do
not need any resources in npx_softc to handle numeric coprocessor
exceptions, so let npx@isa detach.
 1.16 02-Jan-2008  dyoung Use device_t, device_private(). Join some lines.
 1.15 16-Nov-2006  christos branches: 1.15.8; 1.15.28; 1.15.34; 1.15.42;
__unused removal on arguments; approved by core.
 1.14 29-Oct-2006  christos fix print formatting.
 1.13 28-Oct-2006  christos Make npx work on the AMD Geode LX-800 processor by short-circuiting
the npx detection code. Since exception reporting is broken, check the
CPUID_FPU feature. This is what FreeBSD does.
 1.12 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.11 19-Feb-2006  thorpej branches: 1.11.14; 1.11.16;
Use aprint_*().
 1.10 11-Dec-2005  christos branches: 1.10.2; 1.10.4; 1.10.6;
merge ktrace-lwp.
 1.9 07-Aug-2003  agc branches: 1.9.14; 1.9.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 22-Nov-2002  fvdl branches: 1.8.6;
New interrupt code. The basic idea behind it is to hide the differences
in interrupt controllers in struct pic, and try to keep as much
common code as possible. At the lowest (asm) level, this is done
with CPP macros.

The main structure is now struct intrsource, describing an established
interrupt line, of any kind (soft/hard local apic/legacy apic/IO apic).
For quick masking, there may be a maximum of 32 sources per CPU.
Sources can be assigned to any CPU in the MP case, though currently they
all go to the boot CPU.
 1.7 02-Oct-2002  thorpej Tidy up CFATTACH_DECL() formatting.
 1.6 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.3 15-Nov-2001  lukem add RCSID
 1.2 21-Jan-2001  thorpej branches: 1.2.2; 1.2.4;
Avoid doing Very Bad Things by passing a horrible IRQ value to
npxprobe1(). Fixes a problem on IBM Thinkpads reported by
Chuck Cranor.
 1.1 16-Jun-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Rearrange the npx driver a little to allow for multiple attachments
and add a pnpbios atttachment for it.
 1.1.8.3 11-Feb-2001  bouyer Sync with HEAD.
 1.1.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1 16-Jun-2000  bouyer file npx_isa.c was added on branch thorpej_scsipi on 2000-11-20 20:09:32 +0000
 1.1.6.4 28-Jan-2002  sommerfeld Yet Another mergeup with -current.
 1.1.6.3 29-Dec-2001  sommerfeld Yet another mergeup.

New work:
- Frank van der Linden's tlb shootdown fix.
Mainline functionality merged:
- IrDA
- Kernel RCSID's
- Transmeta CPU support
- ACPI
- XMM register access through procfs
 1.1.6.2 23-Jan-2001  thorpej Sync with the trunk.
 1.1.6.1 16-Jun-2000  thorpej file npx_isa.c was added on branch sommerfeld_i386mp_1 on 2001-01-23 06:34:57 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 16-Jun-2000  minoura file npx_isa.c was added on branch minoura-xpg4dl on 2000-06-22 17:00:36 +0000
 1.1.2.1 03-Feb-2001  he Pull up revision 1.2 (requested by thorpej):
Avoid doing Very Bad Things by passing a horrible IRQ value to
npxprobe1(). Fixes a problem on IBM Thinkpads.
 1.2.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.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.5 11-Dec-2002  thorpej Sync with HEAD.
 1.2.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.2 11-Jan-2002  nathanw More catchup.
 1.2.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.4 17-Mar-2008  yamt sync with head.
 1.9.16.3 21-Jan-2008  yamt sync with head
 1.9.16.2 30-Dec-2006  yamt sync with head.
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.9.14.1 30-May-2007  bouyer Pull up following revision(s) (requested by christos in ticket #1580):
sys/arch/i386/pnpbios/npx_pnpbios.c: revision 1.8 - 1.9
sys/arch/i386/acpi/npx_acpi.c: revision 1.14 - 1.15
sys/arch/i386/isa/npx_isa.c: revision 1.13 - 1.14
sys/arch/i386/isa/npx.c: revision 1.114
sys/arch/i386/isa/npxvar.h: revision 1.5
fix print formatting.
handle NPX_CPUID
Make npx work on the AMD Geode LX-800 processor by short-circuiting
the npx detection code. Since exception reporting is broken, check the
CPUID_FPU feature. This is what FreeBSD does.
 1.10.6.1 22-Apr-2006  simonb Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.10.2.1 01-Mar-2006  yamt sync with head.
 1.11.16.2 10-Dec-2006  yamt sync with head.
 1.11.16.1 22-Oct-2006  yamt sync with head
 1.11.14.1 18-Nov-2006  ad Sync with head.
 1.15.42.2 23-Jan-2008  bouyer Sync with HEAD.
 1.15.42.1 08-Jan-2008  bouyer Sync with HEAD
 1.15.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.15.28.2 23-Mar-2008  matt sync with HEAD
 1.15.28.1 09-Jan-2008  matt sync with HEAD
 1.15.8.2 03-Dec-2007  ad Sync with HEAD.
 1.15.8.1 29-Jul-2007  ad Hardware interrupts musn't occur 'under' soft interrupts.
 1.17.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.17.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.17.2.1 24-Mar-2008  keiichi sync with head.
 1.19.18.3 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.19.18.2 01-Nov-2009  jym Sync with HEAD.
 1.19.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.19.4.2 16-May-2009  yamt sync with head
 1.19.4.1 04-May-2009  yamt sync with head.
 1.22.16.1 18-May-2014  rmind sync with head
 1.22.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.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.9 26-Jan-2014  dsl Remove support for 'external' floating point units and the MS-DOS
compatible method of handling floating point exceptions.
Make kernel support for teh fpu non-optional (486SX should still work).
Only 386 cpus support external fpu, and i386 support was removed years ago.
This means that the npx code no longer uses port 0xf0 or interupt 13.
All the "npx at isa" lines go from the configs, arch/i386/isa/npx.c
is now mandatory for all i386 kernels.
I've renamed npxinit() to fpuinit() and npxinit_cpu() to fpuinit_cpu()
to match the very similar amd64 functions.
The fpu of the boot cpu is now initialised by a direct call from
cpu_configure(), this enables FP emulation for a 486SX.
(for amd64 the cr0 values are set in locore.S and similar).
This fixes a long-standing bug in linux_setregs() - which did not
save the fpu regsiters if they were active.
I've test booted a single cpu i386 kernel (using anita).
amd64 builds - none of teh changes should affect it.
The i386 XEN kernels build, but I'm not sure where they set cr0, and
it might have got lost!
 1.8 04-Mar-2008  cube branches: 1.8.38; 1.8.48; 1.8.54;
Split device_t and softc for npx(4).
 1.7 20-Jan-2008  dyoung branches: 1.7.2; 1.7.6;
Do not reserve ISA bus space for npx@isa unless we hook IRQ 13,
which we ought to never do. If we have not hooked IRQ 13, we do
not need any resources in npx_softc to handle numeric coprocessor
exceptions, so let npx@isa detach.
 1.6 08-Dec-2006  yamt branches: 1.6.24; 1.6.30; 1.6.36;
- pass intrframe by-pointer, not by-value.
- make i386 and xen use per-cpu interrupt stack.

xen part is reviewed by Manuel Bouyer.
 1.5 28-Oct-2006  christos Make npx work on the AMD Geode LX-800 processor by short-circuiting
the npx detection code. Since exception reporting is broken, check the
CPUID_FPU feature. This is what FreeBSD does.
 1.4 11-Dec-2005  christos branches: 1.4.20; 1.4.22;
merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.14; 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 22-Nov-2002  fvdl branches: 1.2.6;
New interrupt code. The basic idea behind it is to hide the differences
in interrupt controllers in struct pic, and try to keep as much
common code as possible. At the lowest (asm) level, this is done
with CPP macros.

The main structure is now struct intrsource, describing an established
interrupt line, of any kind (soft/hard local apic/legacy apic/IO apic).
For quick masking, there may be a maximum of 32 sources per CPU.
Sources can be assigned to any CPU in the MP case, though currently they
all go to the boot CPU.
 1.1 16-Jun-2000  thorpej branches: 1.1.4; 1.1.6; 1.1.8; 1.1.10;
Rearrange the npx driver a little to allow for multiple attachments
and add a pnpbios atttachment for it.
 1.1.10.1 11-Dec-2002  thorpej Sync with HEAD.
 1.1.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1 16-Jun-2000  bouyer file npxvar.h was added on branch thorpej_scsipi on 2000-11-20 20:09:32 +0000
 1.1.6.2 16-Jun-2000  thorpej Rearrange the npx driver a little to allow for multiple attachments
and add a pnpbios atttachment for it.
 1.1.6.1 16-Jun-2000  thorpej file npxvar.h was added on branch sommerfeld_i386mp_1 on 2000-06-16 03:47:25 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 16-Jun-2000  minoura file npxvar.h was added on branch minoura-xpg4dl on 2000-06-22 17:00:36 +0000
 1.2.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.6.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.3 17-Mar-2008  yamt sync with head.
 1.3.16.2 21-Jan-2008  yamt sync with head
 1.3.16.1 30-Dec-2006  yamt sync with head.
 1.3.14.1 30-May-2007  bouyer Pull up following revision(s) (requested by christos in ticket #1580):
sys/arch/i386/pnpbios/npx_pnpbios.c: revision 1.8 - 1.9
sys/arch/i386/acpi/npx_acpi.c: revision 1.14 - 1.15
sys/arch/i386/isa/npx_isa.c: revision 1.13 - 1.14
sys/arch/i386/isa/npx.c: revision 1.114
sys/arch/i386/isa/npxvar.h: revision 1.5
fix print formatting.
handle NPX_CPUID
Make npx work on the AMD Geode LX-800 processor by short-circuiting
the npx detection code. Since exception reporting is broken, check the
CPUID_FPU feature. This is what FreeBSD does.
 1.4.22.1 10-Dec-2006  yamt sync with head.
 1.4.20.2 12-Jan-2007  ad Sync with head.
 1.4.20.1 18-Nov-2006  ad Sync with head.
 1.6.36.1 23-Jan-2008  bouyer Sync with HEAD.
 1.6.30.1 18-Feb-2008  mjf Sync with HEAD.
 1.6.24.1 23-Mar-2008  matt sync with HEAD
 1.7.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.7.2.1 24-Mar-2008  keiichi sync with head.
 1.8.54.1 18-May-2014  rmind sync with head
 1.8.48.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.38.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.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 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.6 01-Oct-2002  fvdl branches: 1.6.6;
Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.5 05-May-1995  mycroft branches: 1.5.40; 1.5.46; 1.5.48;
Add definitions for NVRAM equipment byte.
 1.4 04-May-1995  cgd use the machine-independent definitions for the mc146818.
wrap the various uses of the chip (including the uses of the NVRAM on it)
around the new defintions, structures, and functions specified in the header.
 1.3 27-Oct-1994  cgd new RCS ID format.
 1.2 24-Sep-1993  mycroft branches: 1.2.2;
clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.1 14-Sep-1993  mycroft New i386 code.
 1.2.2.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.2.2.1 24-Sep-1993  mycroft file nvram.h was added on branch magnum on 1993-09-24 08:49:22 +0000
 1.5.48.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.5.46.1 18-Oct-2002  nathanw Catch up to -current.
 1.5.40.1 20-Feb-2000  sommerfeld Add NVRAM code needed for old-style AP boot.
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11 15-May-2003  wiz Remove last traces of obsolete olms and omms drivers.
Ok'd by drochner and fvdl.
 1.10 26-Nov-2002  christos si_ -> sel_
 1.9 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.8 02-Oct-2002  thorpej Tidy up CFATTACH_DECL() formatting.
 1.7 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 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.4 07-Jan-2002  thorpej branches: 1.4.2; 1.4.10;
Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.3 15-Nov-2001  lukem add RCSID
 1.2 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.1 23-Jan-1999  drochner branches: 1.1.22; 1.1.24; 1.1.26;
provide backwards-compatible busmouse drivers
(technically identical to lms.c/mms.c)
 1.1.26.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.1.26.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.24.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.24.3 02-Oct-2002  jdolecek do not need the (void *) cast for kn_hook anymore
 1.1.24.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.24.1 08-Sep-2001  thorpej Add kqueue support.
 1.1.22.8 11-Dec-2002  thorpej Sync with HEAD.
 1.1.22.7 11-Nov-2002  nathanw Catch up to -current
 1.1.22.6 18-Oct-2002  nathanw Catch up to -current.
 1.1.22.5 17-Sep-2002  nathanw Catch up to -current.
 1.1.22.4 28-Feb-2002  nathanw Catch up to -current.
 1.1.22.3 11-Jan-2002  nathanw More catchup.
 1.1.22.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.22.1 21-Sep-2001  nathanw Catch up to -current.
 1.4.10.1 17-May-2002  gehenna Add device switch.
 1.4.2.2 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.4.2.1 07-Jan-2002  thorpej file olms.c was added on branch sommerfeld_i386mp_1 on 2002-01-07 21:47:02 +0000
 1.11 15-May-2003  wiz Remove last traces of obsolete olms and omms drivers.
Ok'd by drochner and fvdl.
 1.10 26-Nov-2002  christos si_ -> sel_
 1.9 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.8 02-Oct-2002  thorpej Tidy up CFATTACH_DECL() formatting.
 1.7 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 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.4 07-Jan-2002  thorpej branches: 1.4.2; 1.4.10;
Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.3 15-Nov-2001  lukem add RCSID
 1.2 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.1 23-Jan-1999  drochner branches: 1.1.22; 1.1.24; 1.1.26;
provide backwards-compatible busmouse drivers
(technically identical to lms.c/mms.c)
 1.1.26.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.1.26.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.24.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.24.3 02-Oct-2002  jdolecek do not need the (void *) cast for kn_hook anymore
 1.1.24.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.24.1 08-Sep-2001  thorpej Add kqueue support.
 1.1.22.8 11-Dec-2002  thorpej Sync with HEAD.
 1.1.22.7 11-Nov-2002  nathanw Catch up to -current
 1.1.22.6 18-Oct-2002  nathanw Catch up to -current.
 1.1.22.5 17-Sep-2002  nathanw Catch up to -current.
 1.1.22.4 28-Feb-2002  nathanw Catch up to -current.
 1.1.22.3 11-Jan-2002  nathanw More catchup.
 1.1.22.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.22.1 21-Sep-2001  nathanw Catch up to -current.
 1.4.10.1 17-May-2002  gehenna Add device switch.
 1.4.2.2 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.4.2.1 07-Jan-2002  thorpej file omms.c was added on branch sommerfeld_i386mp_1 on 2002-01-07 21:47:03 +0000
 1.6 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.5 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.4 25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.3 14-Mar-1995  brezak Fixes defect port-i386/864 from John Woods (jfw@jfwhome.funhouse.com) with
supplied patch. pas.c doesn't recognize ProAudio Spectrum 16 Basic card.
 1.2 28-Feb-1995  brezak Use irq directly not as a mask
 1.1 21-Feb-1995  brezak PAS driver; uses SB emulation for now
 1.3 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.2 15-Mar-1995  brezak Add support for PAS 16 basic
 1.1 21-Feb-1995  brezak PAS driver; uses SB emulation for now
 1.188 19-Nov-2007  ad pccons was removed.
 1.187 10-Nov-2007  ad Call ttyflush() with tty_lock held.
 1.186 18-Oct-2007  joerg branches: 1.186.2;
Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
 1.185 17-Oct-2007  garbled 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.184 09-Jul-2007  ad branches: 1.184.8; 1.184.10; 1.184.14;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.183 04-Mar-2007  christos branches: 1.183.2; 1.183.4; 1.183.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.182 16-Nov-2006  christos branches: 1.182.4;
__unused removal on arguments; approved by core.
 1.181 13-Oct-2006  dogcow more unused variable fallout.
 1.180 01-Oct-2006  elad Fix typos (tty -> tp), pointed out by Matt Fleming, thanks!
 1.179 30-Sep-2006  elad Implement the "device" scope.

It uses an authorization wrapper per device class on the system to
ensure type-safety.

For now, it supports only terminal (TTY) devices, and has two actions
for them: "open terminal" and "privileged set". Sample usage has been
added to i386 and hp300 code for reference.

Update documentation.
 1.178 23-Jul-2006  ad branches: 1.178.4; 1.178.6;
Use the LWP cached credentials where sane.
 1.177 14-May-2006  elad integrate kauth.
 1.176 28-Mar-2006  thorpej Use device_unit().
 1.175 24-Dec-2005  perry branches: 1.175.4; 1.175.6; 1.175.8; 1.175.10; 1.175.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.174 11-Dec-2005  christos merge ktrace-lwp.
 1.173 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.172 02-Jun-2005  christos branches: 1.172.2;
minor nits.
 1.171 02-Jun-2005  martin Fix qualify/shadow warnings.
 1.170 03-Feb-2005  perry de-__P, partially ANSIfy
 1.169 13-Mar-2004  bjh21 branches: 1.169.8; 1.169.10;
Abstract the interface between pckbc(4), and the pckbd(4) and pms(4)
drivers that attach to it. This allows for other host interface chips
that use the same keyboards and mice, such as the ones in the ARM
IOMD20, ARM7500, and SA-1111. The PC-compatible driver is still
called pckbc(4), and the new abstraction layer is "pckbport", so the
child devices have moved from sys/dev/pckbc to sys/dev/pckbport, which
also contains some code shared between all host controllers. To avoid
incompatibility, pckbdreg.h is still installed in
/usr/include/dev/pckbc.

In theory, this shouldn't cause any behavioural changes in the drivers
concerned. Thy just use rather more function pointers than before. Tested
on i386 and (with a new host driver) acorn32. Compiled on several other
affected architectures.
 1.168 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.167 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.166 17-May-2003  dsl branches: 1.166.2;
Fix botched nathanw_sa_merge change
fixes port-i386/21603
 1.165 14-May-2003  drochner -remove opms attachment stuff which is pointless after
opms itself was removed
-do the bus_space reservation in any case
-extend a compile-time check: pccons and ega can't coexist either
 1.164 14-May-2003  drochner fix "unintialized variable" warning
 1.163 06-Mar-2003  taca Fix compile error with struct consdev change.
 1.162 26-Feb-2003  fvdl Adapt for i386/x86 change.
 1.161 19-Feb-2003  gson Reserve the I/O ports used by the CRT controller to keep them from
being allocated for other purposes such as PCMCIA I/O space. Fixes
port-i386/5177.
 1.160 19-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.159 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.158 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.157 02-Oct-2002  thorpej Tidy up CFATTACH_DECL() formatting.
 1.156 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.155 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.154 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.153 14-Apr-2002  lukem branches: 1.153.2; 1.153.4;
allow default colours to be overridden by
PCCONS_DEFAULT_FG PCCONS_DEFAULT_SO_FG
PCCONS_DEFAULT_BG PCCONS_DEFAULT_SO_BG
 1.152 17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.151 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.150 15-Nov-2001  lukem add RCSID
 1.149 31-Jul-2001  jdolecek branches: 1.149.4;
Make console polling (cnpollc/cngetc) work on IBM PS/2 keyboard controller
using level triggered interrupts, which livelocks calling intr routine
if the data register is not read in the interrupt routine, as it's case
when polling after interrupts are enabled during boot.

Block all interrupts when polling for keypress, and modify intr routine
to read and store value from data register. The latter one is to avoid
losing a keypress when one would manage to press a key when kernel is
not in spl-guarded code section.

Tested with classic pccons, 'pcconskbd at pckbc' and 'pckbd at pckbc'
configurations, on i386.
 1.148 24-Jul-2001  wiz Replace some memcpy()s with probably overlapping arguments with memmove()s.
 1.147 02-Jun-2001  jdolecek branches: 1.147.4;
Back the last revision off, upon Bill Sommerfeld's request
 1.146 02-Jun-2001  jdolecek When polling, raise priority level to tty, to block keyboard interrupts
when the system is "warm", i.e. interrupts are not blocked anymore.
This seems to be necessary on my PS/2 Model 70 keyboard - without this,
system ends up in endless loop calling the keyboard intr routine if a key
is pressed when polling. This _may_ be just specific to level-triggered
interrupts PS/2 MCA uses, though it's more likely it's just the way the
particular keyboard controller works.

Discussed on tech-kern@.
 1.145 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.144 01-Dec-2000  soren branches: 1.144.4;
<pc/display.h> has been moved to <dev/ic/pcdisplay.h>.
 1.143 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.142 12-Oct-2000  hpeyerl Sanity check the cursor position read from the 6845 and if clearly
off-screen, set it to 0x0. From dean@huxley.org.
 1.141 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.140 05-Jun-2000  sommerfeld branches: 1.140.2;
If rnd is configured into the kernel, do rnd(4) entropy collection
from devices connected to pckbc:
- Do actual sample collection in pckbc.
- Add rndsource_element_t to the slot data.
- Change pckbc_set_inputhandler() to take an additional argument,
the name of the device, which is (eventually) passed into
rnd_attach_source() to identify the source.
- Change callers of pckbc_set_inputhander() appropriately.
 1.139 23-Mar-2000  thorpej branches: 1.139.4;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.138 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.137 03-Dec-1999  thorpej Split the PC-like keyboard controller driver into chip back-end and
bus front-end.
 1.136 26-Jul-1999  wrstuden branches: 1.136.2; 1.136.8;
If we get into pcclose() without a defined tty, just exit rather than
dereferencing a null pointer.
 1.135 19-Mar-1999  cgd branches: 1.135.4;
if you pull in isavar.h, you don't need isa_machdep.h.
 1.134 06-Feb-1999  drochner sort the dependencies between terminal devices a bit and add consistency
checks to catch conflicting devices at compile time
 1.133 05-Nov-1998  mellon Fix a signed/unsigned thinko (this is cgd's fix)
 1.132 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.131 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.130 13-Aug-1998  rvb The sense of the pccons_is_console test is backwards
 1.129 05-Aug-1998  perry bzero->memset, bcopy->memcpy
 1.128 27-Jul-1998  perry NORVEGIAN -> NORWEGIAN
 1.127 05-Jul-1998  jonathan * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
 1.126 04-Jul-1998  jonathan defopt DDB.
 1.125 17-Apr-1998  drochner use the mi header (dev/pckbc/pckbdreg.h)
 1.124 02-Apr-1998  cgd kill unnecessary (unused) definition of partab (char partab[];), which
caused a compiler warning with egcs.
 1.123 22-Mar-1998  drochner Allow to use pccons with the new MI keyboard controller driver.
This is more or less for testing (it doesn't contribute to the beauty
of the code).
 1.122 22-Mar-1998  drochner switch to non-BROKEN_INDIRECT_CONFIG
 1.121 21-Mar-1998  mycroft Replace TS_WOPEN with t_wopen, per mail on tech-kern.
 1.120 22-Jan-1998  thorpej Generate dependenices on the XSERVER option.
 1.119 18-Jan-1998  drochner adapt to changed <dev/ic/i8042reg.h>
 1.118 12-Jan-1998  thorpej Update for changes to config.
 1.117 09-Jan-1998  mycroft Increase delays to the required 7us.
 1.116 16-Nov-1997  christos PR/4506: Andreas Gustafsson: Finnish keyboard mapping for pccons.
 1.115 31-Oct-1997  mycroft Format police.
 1.114 29-Oct-1997  thorpej Flush tty input queue when going in and out of X mode, PR #4321,
Chris Demetriou.
 1.113 09-Oct-1997  enami branches: 1.113.2;
Make sure that vs.color is always initialized. Fix PR#2510.

- separate initialization code in sput() into new function pcinit().
- call pcinit() in both sput() and pcattach() if (crtat == 0).
 1.112 01-Oct-1997  drochner Fix the problem described in PR port-i386/4177: scroll lock could cause
tsleep() to be called from an interrupt handler.
The semantics of the scroll-lock key is changed now: it issues a ^S or
^Q, depending on the current state. (It should probably issue
tp->t_cc[VSTOP] or tp->t_cc[VSTART] instead, but this would require more
serious structural changes because there is not always a tty context
present.)
The "scroll lock" LED is now controlled by pcstart()/pcstop(), so it
will show the real state even if the start/stop characters are remapped
or the normal ^S/^Q are used.
 1.111 30-Sep-1997  christos PR/4189: Matthias Scheler: pccons doesn't compile if national keyboard map
is used
 1.110 23-Aug-1997  drochner Put all console initialization into 1 exported function (pccnattach()).
Delay setting of cn_tab->cn_dev until autoconfiguration attach
to get the minor number right.
Delete unused pccnprobe() and pccninit().
 1.109 14-Aug-1997  drochner -Export variables needed for system console initialization.
-Because *cnputc()'s second argument is an "int" in cons.h, correct
pccnputc() accordingly.
 1.108 04-Aug-1997  perry Added CAPS_IS_CONTROL option that switches the caps lock and control
keys on a pccons console keyboard.
submitted in PR 899 by Alistair G. Crooks
Note that I only did this for the US type keyboard maps.
This and all other such options should be documented, and perhaps
rennamed with consistant PCCONS_ prefixes.
 1.107 04-Aug-1997  perry 1) add Matthieu Herrb's support for iso-latin1 and non-U.S. keyboards
o option DISPLAY_ISO8859 enables the display of iso-latin1
character set (instead of the IBM page code 437)
o option FRENCH_KBD, GERMAN_KBD or NORVEGIAN_KBD implement
support for national keyboards (implies DISPLAY_ISO8859).
Originally supplied in PR #1529
2) Add option PCCONS_REAL_BS which (for US keyboards only) forces
backspace to really be backspace and not delete. Intended to close
PR #2264 submitted by Greg Woods. He wanted it changed for everyone
-- I thought adding a kernel compile option was friendlier.

Note: Both of these sets of options really should be documented in an
i386 specific version of options(4).
 1.106 26-Jul-1997  drochner branches: 1.106.2;
Don't call kernel debugger on CTL-ALT-ESC hotkey if the keyboard doesn't
belong to the actual console. (ie, we have a serial console)
Closes PR port-i386/3131.
 1.105 05-Nov-1996  mikel make X support code dependent on XSERVER; PR port-i386/2528.
 1.104 24-Oct-1996  fvdl Make this compile without COMPAT_10 (unused variable).
 1.103 13-Oct-1996  christos backout previous kprintf changes
 1.102 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.101 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.100 30-May-1996  cgd add call to tty_attach() so pstat -t will work with pccons ttys.
 1.99 12-May-1996  mycroft branches: 1.99.4;
Use intr.h.
 1.98 05-May-1996  christos Remove unneeded casts to fillw() since now it takes a void * argument.
 1.97 03-May-1996  christos - Add missing prototypes.
- Fix gcc warnings
 1.96 11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.95 04-Apr-1996  cgd update for the fact that config_found() and config_rootfound() now
return pointers. (Check vs. NULL, rather than just boolean tests.)
 1.94 30-Mar-1996  mycroft Add explicit return types.
 1.93 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.92 16-Mar-1996  thorpej Change the PS/2 mouse driver to be a child of the "pckbd" attribute,
which represents the "keyboard controller". Give "pc" and "vt" drivers
the "pckbd" attribute. In pcattach() (pccons and pcvt), attach children
of the keyboard controller.
 1.91 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.90 11-Oct-1995  mycroft Various changes from John Kohl and me:
Map kernel stacks only at unique addresses.
Use one TSS per process.
Add sysarch calls for modifying IOPL and the I/O permission bitmap.
Add a compacting GDT entry allocator, for TSS and LDT selectors.
Enable modifying %fs and %gs with PT_SETREGS.
Sanitize various bits of code.
 1.89 04-May-1995  cgd two cases to quiet the compiler. perhaps should be fixed differently.
 1.88 03-May-1995  mycroft Fix pccnpollc().
 1.87 01-May-1995  mycroft Update to match include files. Eliminate _ucodesel, _udatasel, and IdlePTD.
 1.86 21-Apr-1995  mycroft Make this compile again.
 1.85 21-Apr-1995  mycroft Remove relocation of Crtat from locore.
 1.84 19-Apr-1995  mycroft Fix thinko in previous commit.
 1.83 19-Apr-1995  mycroft Garbage collect #includes.
 1.82 19-Apr-1995  mycroft Implement pctty().
 1.81 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.80 10-Apr-1995  mycroft Most of the console functions return void.
 1.79 03-Jan-1995  mycroft Add interrupt sharing types.
 1.78 13-Dec-1994  mycroft Add empty pcstop().
 1.77 01-Dec-1994  mycroft Don't futz with the cursor shape unless we really, really need to.
 1.76 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.75 04-Nov-1994  mycroft No longer needs icu.h.
 1.74 04-Nov-1994  mycroft Correct pcprobe() argument list.
 1.73 04-Nov-1994  mycroft Update to match autoconfig code.
 1.72 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.71 27-Oct-1994  cgd new RCS ID format.
 1.70 26-Oct-1994  mycroft Oops; need spltty() around call to print().
 1.69 26-Oct-1994  mycroft Implement *cnpollc().
 1.68 16-Oct-1994  mycroft Wait on the correct bit in the lower half of kbc_get8042cmd(); and some other
mostly stylistic changes. Based on suggestions from John Hood.
 1.67 09-Oct-1994  mycroft Put the delay in a macro, and implement it differently.
 1.66 17-Aug-1994  mycroft Validate unit number correctly.
 1.65 05-May-1994  mycroft branches: 1.65.2;
Remove now-bogus cast.
 1.64 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.63 24-Apr-1994  mycroft Rename two files.
 1.62 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.61 29-Mar-1994  mycroft Updates for new autoconfig.
 1.60 12-Mar-1994  mycroft Remove backward compatibility hacks for config(8), as they are no longer
useful.
 1.59 11-Mar-1994  deraadt hack to get cursor right on video cards with real 6845 chips
 1.58 03-Mar-1994  mycroft Move some code, but no functional difference.
 1.57 03-Mar-1994  mycroft Add some comments explaining this ridiculous interface, and enable the reset
code by default.
 1.56 03-Mar-1994  mycroft Flush the keyboard buffer before and after the reset. This should now work
on all machines and keyboards.
 1.55 02-Mar-1994  mycroft Add more experimental probe gunk, not enabled.
 1.54 02-Mar-1994  mycroft Set the keyboard to scancode table 1 rather than having the 8042 convert.
 1.53 02-Mar-1994  mycroft Remove scantokey[] and extscantokey[], as they are not used.
 1.52 02-Mar-1994  mycroft Add code to set the translation table number, but disabled for now.
 1.51 02-Mar-1994  mycroft Attempt to insure the keyboard is enabled after reset, but turn off the entire
reset sequence by default since it causes some keyboards to become catatonic.
 1.50 01-Mar-1994  mycroft Check for acks and naks in X mode.
 1.49 25-Feb-1994  mycroft Don't repeat lock keys in X, either.
 1.48 25-Feb-1994  mycroft Oops.
 1.47 25-Feb-1994  mycroft Two compatibility kluges for X; deal with the lock keys and reset the cursor
shape when X exits.
 1.46 23-Feb-1994  mycroft Allow keyboard-less boot.
 1.45 23-Feb-1994  mycroft Remove some more dead code.
 1.44 23-Feb-1994  mycroft Add insert and delete line capabilities.
 1.43 23-Feb-1994  mycroft Remove some code that is no longer used.
 1.42 22-Feb-1994  mycroft Most of the changes from the magnum branch; rearrange the parser to be a bit
faster, and rework the keyboard handling.
 1.41 17-Feb-1994  hpeyerl Herb sheepishly puts the keyboard connection code back in.
(which means Herb needs to buy a keyboard now)
 1.40 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.39 01-Feb-1994  cgd new cons.h location, etc.
 1.38 28-Jan-1994  deraadt ttrstrt definition doesn't belong here
 1.37 25-Jan-1994  hpeyerl I want to boot without a keyboard dammit!
 1.36 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.35 11-Nov-1993  mycroft Boundary check on backspace.
 1.34 28-Sep-1993  mycroft Make Ctrl-Space input a NUL and Ctrl-/ input a ^/ (undo in Emacs).
 1.33 28-Sep-1993  andrew Added keyboard typematic rate adjustment ioctl. Rudimentary support for
entering DDB from X11 by means of the F12 key (when XSERVER_DDB is
defined).
 1.32 16-Sep-1993  brezak Changes to use a trap frame for syscalls.
 1.31 06-Sep-1993  mycroft branches: 1.31.2;
Make Ctrl-Space and Ctrl-2 send a NUL, even without XSERVER defined.
(This has annoyed me for a while, and people are complaining about it.)
 1.30 05-Sep-1993  mycroft Check some boundary conditions is cursor movement and scrolling.
 1.29 29-Aug-1993  deraadt tty XXstart() routines return void
 1.28 12-Jul-1993  mycroft Change tty code to use clist interface, but with ring buffer implementation.
Also, fix a couple of bugs in tty.c and pccons.c, and some gross kluginess
in the hp300 stuff.
 1.27 11-Jul-1993  mycroft Yah, yah...
 1.26 11-Jul-1993  mycroft Oops. Back out clist changes, but leave the bug fix.
 1.25 11-Jul-1993  mycroft This is so utterly revolting I refuse to describe it, except to say that it
fixes the problem of console output hogging the CPU.
 1.24 08-Jul-1993  mycroft Implement scroll lock using sleep() and wakeup() so we don't get stuck at
spltty and freeze everyone.
 1.23 07-Jul-1993  deraadt pccons.c now dynamically allocates it's "struct tty"
cons.c's "struct tty *cn_tty" wasn't used by any of the kernel, and goes away.
 1.22 06-Jul-1993  deraadt clean up code for timeout/untimeout/wakeup prototypes.
 1.21 16-Jun-1993  mycroft Make sysbeep() take a frequency, not a timer count, and add constants
BEEP_FREQ and BEEP_TIME which can be overridden in the config file.
 1.20 31-May-1993  cgd fix bogus initializer
 1.19 28-May-1993  deraadt 1. It is now possible to build a kernel that does not have a pc0 device driver.
2. "press any key to reboot" reads the key from the console.
3. wddump() still needs a non-blocking getc() routine (or flush)
 1.18 26-May-1993  deraadt tty dynamic allocation
 1.17 22-May-1993  cgd add rcsids to everything and clean up headers
 1.16 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.15 10-May-1993  deraadt ring buffer code now uses rbchar's (shorts) instead of chars.
 1.14 04-May-1993  mycroft Don't autorepeat locking keys. (Can someone test this with X?)
 1.13 26-Apr-1993  mycroft Oops. sgetc() is used elsewhere, so should not be static.
 1.12 22-Apr-1993  mycroft Rename sput to sputc and make it and sgetc static.
 1.11 22-Apr-1993  mycroft Use rb_read to gather output; do exactly 4 spl calls, and don't hold the
interrupts locked very long, lest we overrun our serial port FIFOs.
 1.10 21-Apr-1993  mycroft Huge performance improvement (not so bloody many spl calls)!
 1.9 20-Apr-1993  mycroft Slight performance improvement.
 1.8 20-Apr-1993  mycroft Fix typo in last change.
 1.7 20-Apr-1993  mycroft Don't output NULs.
 1.6 11-Apr-1993  deraadt Whoops. vidio card io space is 16 bytes large, not 8 bytes large. probe
now returns the right thing
 1.5 11-Apr-1993  deraadt nay, pccons.c still did not return the right thing from probe.. --> 8
 1.4 10-Apr-1993  glass fixed to be compliant, subservient, and to take advantage of the newly
hacked config(8)
 1.3 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.31.2.33 01-Feb-1994  mycroft Fix prototype.
 1.31.2.32 01-Feb-1994  mycroft Updates from main branch.
 1.31.2.31 01-Feb-1994  mycroft Remove `noblock' flag to sget(), as it is no longer usesd.
 1.31.2.30 13-Dec-1993  mycroft Make caps lock work correctly, and rename two variables to be less confusing.
 1.31.2.29 25-Nov-1993  mycroft Read as many characters as the keyboard buffer may have.
 1.31.2.28 11-Nov-1993  mycroft Correct a condition where crtat and ps_col might get out of sync.
 1.31.2.27 10-Nov-1993  mycroft Check another boundary condition.
 1.31.2.26 10-Nov-1993  mycroft Optimize output of rows of printable characters. Other miscellaneous
optimizations.
 1.31.2.25 09-Nov-1993  mycroft Change bcopy()s to bcopyw()s for scrolling.
 1.31.2.24 08-Nov-1993  mycroft Make a panic message less cryptic.
 1.31.2.23 03-Nov-1993  mycroft Read exactly one character per interrupt, and just assume it's there. (This
is important for pms.)
 1.31.2.22 31-Oct-1993  mycroft Nuke some unused externs.
 1.31.2.21 29-Oct-1993  mycroft Don't output NULs.
 1.31.2.20 28-Oct-1993  mycroft Make ps_state a plain integer rather than a bitmap.
 1.31.2.19 28-Oct-1993  mycroft After a successful probe, patch the video memory back so we don't leave a
blinking `Z' in the corner of the screen.
 1.31.2.18 27-Oct-1993  mycroft Don't panic! If the user presses a lock key during pccngetc(), that is.
 1.31.2.17 27-Oct-1993  mycroft Make pcforceintr() actually work.
 1.31.2.16 27-Oct-1993  mycroft Ignore receiver interrupts if we are in pccngetc().
 1.31.2.15 26-Oct-1993  mycroft Put arguments to pcattach() is correct order.
 1.31.2.14 26-Oct-1993  mycroft Rearrange do_async_update() to allow printf()s in kbd_cmd() without looping.
Allow hard-wired configurations. Round shared memory size up to 1k. Add some
debugging code. Set a default attribute in pccninit(). Stack `kernel'
variable to avoid resetting it inside DDB.
 1.31.2.13 18-Oct-1993  mycroft More reorg. Should be `finished' now.
 1.31.2.12 17-Oct-1993  mycroft Way hacked. Don't ask.
 1.31.2.11 17-Oct-1993  mycroft Minor cleanup.
 1.31.2.10 16-Oct-1993  mycroft Add missing dv_class entry to cfdrivers, and use dv_xname where appropriate.
 1.31.2.9 16-Oct-1993  mycroft Don't forget to enable the interrupt line when registering a handler.
Change the first argument to isa_mem{check,alloc}() to a caddr_t.
 1.31.2.8 12-Oct-1993  mycroft Major reorg. Not finished.
 1.31.2.7 11-Oct-1993  mycroft #include pio.h where needed, and remove cpufunc.h.
 1.31.2.6 10-Oct-1993  mycroft Many speedups and other tweaks. More to come. Conversion to new config not
yet finished.
 1.31.2.5 09-Oct-1993  mycroft Use ISA_HOLE_VADDR() to calculate Crtat, and make it static.
 1.31.2.4 07-Oct-1993  mycroft Merge changes from trunk. Allow some string contants to be compacted.
 1.31.2.3 29-Sep-1993  mycroft lms.c: Update for new config.
lpa.c: Defunct.
lpt.c: Update for new config. Fix handling of interrupted writes. Merge code
from lpa driver. Make all operations interruptible. Remove a few other
bogons.
lptreg.h: Add LPT_NPORTS.
pccons.c: Merge changes from trunk.
 1.31.2.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.31.2.1 14-Sep-1993  mycroft New i386 code.
 1.65.2.3 16-Oct-1994  cgd from trunk, still use old delay mechanism.
 1.65.2.2 09-Oct-1994  mycroft Update from trunk, but still using old delay mechanism.
 1.65.2.1 17-Aug-1994  mycroft update from trunk
 1.99.4.1 04-Jun-1996  cgd pull up tty_attach() changes from trunk
 1.106.2.3 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.106.2.2 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.106.2.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.113.2.4 23-Nov-1998  cgd Fix many real and potential security problems with character device
driver mmap routines that did not properly bounds check offsets.
See NetBSD security advisory NetBSD-SA1998-005 for details. Done
as a patch because it's large, and a fair number of bits are different
in -current. (mrg)
 1.113.2.3 29-Jan-1998  mellon Pull up 1.116 (christos) and 1.117 (mycroft)
 1.113.2.2 31-Oct-1997  mellon Pull rev 1.115 up from trunk (mycroft)
 1.113.2.1 29-Oct-1997  thorpej Pull up from trunk:

Flush tty input queue when going in and out of X mode, PR #4321,
Chris Demetriou.
 1.135.4.1 02-Aug-1999  thorpej Update from trunk.
 1.136.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.136.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.136.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.136.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.139.4.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.140.2.2 16-Oct-2000  tv Pullup 1.142 [hpeyerl]:
Sanity check the cursor position read from the 6845 and if clearly
off-screen, set it to 0x0. From dean@huxley.org.
 1.140.2.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.144.4.11 11-Nov-2002  nathanw Catch up to -current
 1.144.4.10 18-Oct-2002  nathanw Catch up to -current.
 1.144.4.9 17-Sep-2002  nathanw Catch up to -current.
 1.144.4.8 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.144.4.7 17-Apr-2002  nathanw Catch up to -current.
 1.144.4.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.144.4.5 28-Feb-2002  nathanw Catch up to -current.
 1.144.4.4 11-Jan-2002  nathanw More catchup.
 1.144.4.3 08-Jan-2002  nathanw Catch up to -current.
 1.144.4.2 24-Aug-2001  nathanw Catch up with -current.
 1.144.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.147.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.147.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.147.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.147.4.1 03-Aug-2001  lukem update to -current
 1.149.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.149.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.153.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.153.2.2 14-Apr-2002  lukem allow default colours to be overridden by
PCCONS_DEFAULT_FG PCCONS_DEFAULT_SO_FG
PCCONS_DEFAULT_BG PCCONS_DEFAULT_SO_BG
 1.153.2.1 14-Apr-2002  lukem file pccons.c was added on branch sommerfeld_i386mp_1 on 2002-04-14 14:20:34 +0000
 1.166.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.166.2.5 04-Feb-2005  skrll Sync with HEAD.
 1.166.2.4 12-Nov-2004  skrll Adapt to branch.
 1.166.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.166.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.166.2.1 03-Aug-2004  skrll Sync with HEAD
 1.169.10.1 12-Feb-2005  yamt sync with head.
 1.169.8.1 29-Apr-2005  kent sync with -current
 1.172.2.6 07-Dec-2007  yamt sync with head
 1.172.2.5 15-Nov-2007  yamt sync with head.
 1.172.2.4 27-Oct-2007  yamt sync with head.
 1.172.2.3 03-Sep-2007  yamt sync with head.
 1.172.2.2 30-Dec-2006  yamt sync with head.
 1.172.2.1 21-Jun-2006  yamt sync with head.
 1.175.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.175.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.175.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.175.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.175.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.175.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.175.8.3 11-Aug-2006  yamt sync with head
 1.175.8.2 24-May-2006  yamt sync with head.
 1.175.8.1 01-Apr-2006  yamt sync with head.
 1.175.6.2 01-Jun-2006  kardel Sync with head.
 1.175.6.1 22-Apr-2006  simonb Sync with head.
 1.175.4.1 09-Sep-2006  rpaulo sync with head
 1.178.6.2 10-Dec-2006  yamt sync with head.
 1.178.6.1 22-Oct-2006  yamt sync with head
 1.178.4.1 18-Nov-2006  ad Sync with head.
 1.182.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.183.10.1 03-Oct-2007  garbled Sync with HEAD
 1.183.4.1 11-Jul-2007  mjf Sync with head.
 1.183.2.2 23-Oct-2007  ad Sync with head.
 1.183.2.1 15-Jul-2007  ad Sync with head.
 1.184.14.3 21-Nov-2007  bouyer Sync with HEAD
 1.184.14.2 13-Nov-2007  bouyer Sync with HEAD
 1.184.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.184.10.2 23-Mar-2008  matt sync with HEAD
 1.184.10.1 06-Nov-2007  matt sync with HEAD
 1.184.8.3 21-Nov-2007  joerg Sync with HEAD.
 1.184.8.2 11-Nov-2007  joerg Sync with HEAD.
 1.184.8.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.186.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.186.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.50 18-Apr-2002  wiz Remove opms(4) and its device, /dev/pms0, from the i386 port, because
it has been obsoleted by pms(4).

Reviewed by fvdl and christos.
 1.49 15-Nov-2001  lukem branches: 1.49.2;
add RCSID
 1.48 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.47 05-Jun-2000  sommerfeld branches: 1.47.6; 1.47.8; 1.47.10;
If rnd is configured into the kernel, do rnd(4) entropy collection
from devices connected to pckbc:
- Do actual sample collection in pckbc.
- Add rndsource_element_t to the slot data.
- Change pckbc_set_inputhandler() to take an additional argument,
the name of the device, which is (eventually) passed into
rnd_attach_source() to identify the source.
- Change callers of pckbc_set_inputhander() appropriately.
 1.46 03-Dec-1999  thorpej branches: 1.46.4;
Split the PC-like keyboard controller driver into chip back-end and
bus front-end.
 1.45 19-Aug-1999  drochner branches: 1.45.2; 1.45.8;
back out last rev - it looks like a local hack which shouldn't go here,
and it breaks the "opms at pckbc" case
 1.44 16-Aug-1999  augustss Add umodem device.
 1.43 06-May-1999  drochner sync diagnostic printouts in opms_pckbc_probe() with dev/pckbc/psm.c:
pmsprobe() -- most notably: put a part inside #ifdef DEBUG
 1.42 23-Jan-1999  drochner branches: 1.42.2; 1.42.4;
rename the autoconfiguration related symbols to opms* to avoid namespace
collisions with an mi wscons-capable pms driver
 1.41 20-Aug-1998  veego Add some braces to stop the new egcs warnings.
 1.40 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.39 22-Mar-1998  drochner Allow to attach the mouse driver to the new MI keyboard controller driver.
This should allow to use old X servers which depend on the old mouse
interface to work in the future.
XXX There can be only one attachment - either to an old console driver
or to the new pckbc driver - be configured.
 1.38 22-Mar-1998  drochner switch to non-BROKEN_INDIRECT_CONFIG
 1.37 12-Jan-1998  thorpej Update for changes to config.
 1.36 09-Jan-1998  mycroft Increase delays to the required 7us.
 1.35 18-Dec-1997  mycroft Add delays for lame keyboard controllers, as in the keyboard driver. Do a
better job of flushing input in various cases.
 1.34 15-Nov-1997  carrel Turn off reseting and disabling the device by default.
Document the option to turn them back on.
 1.33 17-Jul-1997  jtk branches: 1.33.6;
use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all *UNK uses in
isa code with the native names from locators.h
 1.32 13-Oct-1996  christos backout previous kprintf changes
 1.31 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.30 07-Sep-1996  mycroft Implement poll(2).
 1.29 12-May-1996  mycroft Use intr.h.
 1.28 05-May-1996  christos Fix gcc -Wall warnings
 1.27 11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.26 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.25 16-Mar-1996  thorpej Change the PS/2 mouse driver to be a child of the "pckbd" attribute,
which represents the "keyboard controller". Give "pc" and "vt" drivers
the "pckbd" attribute. In pcattach() (pccons and pcvt), attach children
of the keyboard controller.
 1.24 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.23 05-Oct-1995  mycroft Use ISA_IPL_TTY, to fix race conditions.
 1.22 05-Oct-1995  mycroft Switch the AUX_ENABLE and AUX_DISABLE flags, per Mathias Engan.
 1.21 18-Apr-1995  mycroft Finish updating for new interrupt registration mechanism.
 1.20 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.19 07-Jan-1995  mycroft Don't issue a controller self-test...
 1.18 03-Jan-1995  mycroft Add interrupt sharing types.
 1.17 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.16 03-Nov-1994  mycroft Update to match autoconfig code.
 1.15 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.14 27-Oct-1994  cgd new RCS ID format.
 1.13 19-Jul-1994  mycroft Fix various bugs, from Duncan McEwan and John Kohl.
 1.12 18-Jul-1994  mycroft Invert the button logic. (Oops.)
 1.11 17-Jul-1994  mycroft Minor cleanup.
 1.10 17-Jul-1994  mycroft Updated to match other drivers, and three bugs fixed.
 1.9 20-Dec-1993  mycroft branches: 1.9.2;
Canonicalize all #includes, and add pio.h where appropriate.
 1.8 02-Nov-1993  mycroft A theoretically working version. The probe routine needs work.
 1.7 02-Aug-1993  mycroft branches: 1.7.2;
Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.6 27-Jun-1993  andrew Replaced 386BSD conditionals with a NetBSD ones. Fixed a bug in 386BSD
support. Cast arguments to tsleep() and wakeup() to avoid compiler
warnings.
 1.5 23-Jun-1993  mycroft Oops. Reversed order of args to outb(). Still haven't gotten my 486 booted
with a new kernel to actually test this, though.
 1.4 14-Jun-1993  mycroft Explicitly disable mouse during attach.
 1.3 14-Jun-1993  mycroft Fix egregious stupidity.
 1.2 14-Jun-1993  mycroft Yeah, I'm awake.
 1.1 14-Jun-1993  mycroft Add preliminary (read: untested) PS/2 mouse driver.
 1.7.2.2 03-Nov-1993  mycroft Actually compiles now...
 1.7.2.1 03-Nov-1993  mycroft Recloned from other mouse drivers. Should work, but the probe routine may
cause the keyboard to lock up on machines with no auxiliary port.
 1.9.2.2 19-Jul-1994  cgd from trunk, per mycroft.
 1.9.2.1 18-Jul-1994  cgd from trunk, per mycroft
 1.33.6.2 29-Jan-1998  mellon Pull up 1.36 (mycroft)
 1.33.6.1 18-Dec-1997  perry Pull up a fix to a critical bug in the pms driver reported by several
people; this bug caused hangs. Fixed by Mycroft, reviewed by thorpej
and carrel, approved by thorpej and me.
 1.42.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.42.2.1 05-Nov-1999  cgd pull up rev 1.43 from trunk (requested by drochner):
Disable a diagnostic printout ("opmsprobe: command error" if no mouse
is connected) which is often misunderstood to be an error message.
 1.45.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.45.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.46.4.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.47.10.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.47.10.1 01-Oct-2001  fvdl Catch up with -current.
 1.47.8.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.47.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.47.8.1 08-Sep-2001  thorpej Add kqueue support.
 1.47.6.3 20-Jun-2002  nathanw Catch up to -current.
 1.47.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.47.6.1 21-Sep-2001  nathanw Catch up to -current.
 1.49.2.2 15-Nov-2001  lukem add RCSID
 1.49.2.1 15-Nov-2001  lukem file pms.c was added on branch sommerfeld_i386mp_1 on 2001-11-15 07:03:34 +0000
 1.5 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.4 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.3 25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.2 21-Mar-1995  brezak Fix probing of slave devices and remove unneeded ffs()'s
 1.1 21-Feb-1995  brezak PSS driver; needs testing with config.new
 1.2 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.1 21-Feb-1995  brezak PSS driver; needs testing with config.new
 1.8 04-May-1995  cgd use the machine-independent definitions for the mc146818.
wrap the various uses of the chip (including the uses of the NVRAM on it)
around the new defintions, structures, and functions specified in the header.
 1.7 27-Oct-1994  cgd new RCS ID format.
 1.6 09-Apr-1994  mycroft Deal with 2.88MB disk drives, but pretend they are 1.44MB for now.
 1.5 04-Aug-1993  mycroft Put RCS ids back...
 1.4 03-Aug-1993  brezak Bring to rtc clock code from Mach. Provides resettodr().
 1.3 22-May-1993  cgd add rcsids to everything and clean up headers
 1.2 10-May-1993  deraadt Floppy drives now print the same information as wd controllers
and scsi disks. See?
fd0 at fdc0 slave 0: 1.44MB 80 cyl, 2 head, 18 sec
Also, added a define for 720K disks, probably incorrect..
Note: the CMOS is used to find out what type the drive is.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.12 01-Mar-1995  mycroft Clean up deleted files.
 1.11 04-Jan-1995  mycroft Fix oversight in previous.
 1.10 03-Jan-1995  mycroft \
These files have been 99% rewritten from the original ast driver. Add an
appropriate copyright notice.
 1.9 03-Jan-1995  mycroft Add interrupt sharing types.
 1.8 02-Jan-1995  mycroft Use direct config for subdevices.
 1.7 18-Nov-1994  mycroft Stylistic changes.
 1.6 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.5 07-Nov-1994  mycroft Update for new autoconfig.
 1.4 04-Nov-1994  mycroft No longer needs icu.h.
 1.3 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.2 27-Oct-1994  cgd new RCS ID format.
 1.1 07-Aug-1994  mycroft branches: 1.1.2;
Add multiplexer for RT 4-port serial cards.
 1.1.2.2 07-Aug-1994  mycroft Add multiplexer for RT 4-port serial cards.
 1.1.2.1 07-Aug-1994  mycroft file rtfps.c was added on branch netbsd-1-0 on 1994-08-07 10:45:54 +0000
 1.24 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.23 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.22 25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.21 15-Mar-1995  glass fix compilation error. don't bother checking for IRQ2
 1.20 14-Mar-1995  brezak Fixes defect port-i386/860 from John Woods (jfw@jfwhome.funhouse.com) with
supplied patch. Kernel will not link with only ProAudio Spectrum driver
specified.
 1.19 08-Mar-1995  brezak Cleanup for SB16 (From Jan Sparud)
 1.18 28-Feb-1995  brezak Use irq directly not as a mask
 1.17 21-Feb-1995  brezak SoundBlaster driver for SB, SB16 and SBPRO
 1.16 03-Jan-1995  mycroft Add interrupt sharing types.
 1.15 17-Dec-1994  mycroft Fix flags to isa_dmastart().
 1.14 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.13 04-Nov-1994  mycroft No longer needs icu.h.
 1.12 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.11 03-Nov-1994  mycroft Update to match autoconfig code.
 1.10 27-Oct-1994  cgd new RCS ID format.
 1.9 24-Apr-1994  mycroft Don't need isa.h.
 1.8 22-Apr-1994  mycroft Separate DMA functions.
 1.7 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.6 29-Mar-1994  mycroft Updates for new autoconfig.
 1.5 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.4 02-Mar-1994  hpeyerl Make probe routines return amount of space used. Still needs some
work to determine difference between SB/SB-pro.
 1.3 28-Jan-1994  deraadt don't go boom in the presence of stray interrupts
 1.2 25-Jan-1994  hpeyerl This makes my soundblaster work.
 1.1 09-Jan-1994  cgd LBL /dev/audio and soundblaster drivers, as ported by brad@fcr.com.
both should work with both old- and new-config i386 trees.
Some notes:
bsd_audio.c has dependencies on the soundblaster. This should
be fixed, so that it can be used for the PC speaker
(when its driver has been modified), as well.
sb.c needs some cleanup, and will have sections trimmed, eventually
(when new config becomse standard for i386). additionally,
the SBPro support needs some cleanup.
 1.7 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.6 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.5 25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.4 14-Mar-1995  brezak Fixes defect port-i386/860 from John Woods (jfw@jfwhome.funhouse.com) with
supplied patch. Kernel will not link with only ProAudio Spectrum driver
specified.
 1.3 13-Mar-1995  brezak Fix SB8 playback. From David Gluss <david@pure.com>
 1.2 08-Mar-1995  brezak Cleanup for SB16 (From Jan Sparud)
 1.1 21-Feb-1995  brezak SoundBlaster driver for SB, SB16 and SBPRO
 1.6 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.5 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.4 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.3 25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.2 08-Mar-1995  brezak Cleanup for SB16 (From Jan Sparud)
 1.1 21-Feb-1995  brezak SoundBlaster driver for SB, SB16 and SBPRO
 1.12 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.11 15-Mar-1995  glass fix compilation error. don't bother checking for IRQ2
 1.10 13-Mar-1995  brezak Add IRQ 9 as a valid IRQ
 1.9 08-Mar-1995  brezak Cleanup for SB16 (From Jan Sparud)
 1.8 28-Feb-1995  brezak Use irq directly not as a mask
 1.7 21-Feb-1995  brezak SoundBlaster driver for SB, SB16 and SBPRO
 1.6 15-Nov-1994  mycroft Check IRQ 9, not IRQ 2.
 1.5 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.4 27-Oct-1994  cgd new RCS ID format.
 1.3 16-Sep-1994  mycroft Check the SB Pro IRQ and DRQ correctly. From Jason Thorpe.
 1.2 29-Mar-1994  mycroft branches: 1.2.2;
Updates for new autoconfig.
 1.1 09-Jan-1994  cgd LBL /dev/audio and soundblaster drivers, as ported by brad@fcr.com.
both should work with both old- and new-config i386 trees.
Some notes:
bsd_audio.c has dependencies on the soundblaster. This should
be fixed, so that it can be used for the PC speaker
(when its driver has been modified), as well.
sb.c needs some cleanup, and will have sections trimmed, eventually
(when new config becomse standard for i386). additionally,
the SBPro support needs some cleanup.
 1.2.2.1 06-Oct-1994  mycroft Update from trunk.
 1.8 01-Mar-1995  mycroft Clean up deleted files.
 1.7 13-Jan-1995  mycroft Simplify some sanity checks.
 1.6 03-Jan-1995  mycroft Add interrupt sharing types.
 1.5 02-Jan-1995  mycroft Need isareg.h.
 1.4 02-Jan-1995  mycroft Don't assume ia_maddr is in the hole.
 1.3 28-Dec-1994  mycroft Numerous changes. Many bugs fixed, better autoconfig, a few new features.
 1.2 03-Nov-1994  mycroft Update to match autoconfig code.
 1.1 03-Nov-1994  mycroft Commit this, though it really does need work.
 1.33 17-Apr-1998  drochner it's mi now (dev/isa)
 1.32 24-Mar-1998  frueauf Make this compile again: PCKBDCF_PORT->PCKBCPORTCF_PORT.
 1.31 22-Mar-1998  drochner switch to non-BROKEN_INDIRECT_CONFIG
 1.30 12-Jan-1998  thorpej Update for changes to config.
 1.29 07-Dec-1997  thorpej Use malloc()/free() for the temporary buffer, not geteblk()/brelse().
 1.28 17-Jul-1997  jtk branches: 1.28.6;
use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all *UNK uses in
isa code with the native names from locators.h
 1.27 13-Oct-1996  christos backout previous kprintf changes
 1.26 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.25 21-Jul-1996  jtk One more fix as pointed out by enami tsugutomo <enami@ba2.so-net.or.jp>:
check slen before accessing cp[1] in GETNUM macro.
 1.24 14-Jul-1996  jtk fix PRs 219, 2295, 2612: speaker bugs on i386 port: remove overruns due to
faulty bounds checking; repair faulty octave limiting.
 1.23 05-May-1996  christos branches: 1.23.4;
Make this compile again.
- use the abs function from libkern
- fix prototypes
 1.22 18-Mar-1996  jtk attach the speaker device to pckbd (it falls in the I/O range of the
keyboard/console device cluster)
 1.21 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.20 07-Mar-1996  jtk speaker takes one port, so declare it as such in isa_attach_args
fixes pr#2178
 1.19 03-Mar-1996  jtk set ia->ia_iosize to 0 so that the probe code doesn't spit out lots of
gunk.
 1.18 22-Feb-1996  scottr Move the speaker driver to 'new' config. (Closes PR 1361, from Rafal Boni)
 1.17 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.16 27-Oct-1994  cgd new RCS ID format.
 1.15 16-Jun-1994  mycroft b_un.b_addr -> b_data
 1.14 24-May-1994  mycroft MIN --> min
 1.13 24-Apr-1994  mycroft Fix an #include.
 1.12 24-Apr-1994  mycroft Rename two files.
 1.11 24-Apr-1994  mycroft Don't need isa.h.
 1.10 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.9 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.8 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.7 03-Dec-1993  mycroft Add dummy speakerattach() until it's made into a real device. Reported by
Mark_Weaver@brown.edu.
 1.6 28-Oct-1993  brezak Apply fix for PIT_MODE from Keith White <kwhite@csi.UOttawa.CA>
 1.5 16-Jun-1993  brezak branches: 1.5.4;
Use defines in timerreg.h and add spkr_reg.h for specific declarations.
 1.4 16-Jun-1993  brezak Move spkr.h to include/machine so users can use it.
 1.3 15-Jun-1993  mycroft Move definitions of TIMER_FREQ to timerreg.h, and fix value of CF for DELAY().
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 07-May-1993  cgd add PC speaker driver. from 386bsd patchkit patch 135
 1.5.4.2 02-Feb-1994  mycroft Updates from Andrew Chernov <ache@astral.msk.su>.
 1.5.4.1 25-Nov-1993  mycroft Conversion almost finished.
 1.23.4.2 03-Aug-1996  jtc Pulled up from rev 1.25 by request from jtk, approved by fvdl
 1.23.4.1 15-Jul-1996  fvdl Pull this one up, it fixes a bug that could cause a crash very easily.
 1.28.6.1 07-Dec-1997  thorpej Pull up from trunk: use malloc()/free(), not geteblk()/brelse().
 1.3 16-Jun-1993  mycroft Clean up deleted files.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 07-May-1993  cgd add PC speaker driver. from 386bsd patchkit patch 135
 1.3 24-Apr-1994  mycroft Clean up deleted files.
 1.2 02-Aug-1993  mycroft branches: 1.2.2;
Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.1 16-Jun-1993  brezak Use defines in timerreg.h and add spkr_reg.h for specific declarations.
 1.2.2.2 02-Dec-1993  mycroft Change TIMER_MSB to TIMER_16BIT in PIT_MODE.
 1.2.2.1 25-Nov-1993  mycroft Conversion almost finished.
 1.3 17-Apr-1998  drochner it's mi now (dev/isa)
 1.2 27-Oct-1994  cgd new RCS ID format.
 1.1 24-Apr-1994  mycroft Rename two files.
 1.5 13-Aug-2002  thorpej No need for two copies of the i8253 register definitions. Remove the
i386-specific copy, and adjust its users to add in the timer i/o base
as necessary.
 1.4 27-Oct-1994  cgd branches: 1.4.48; 1.4.50; 1.4.62;
new RCS ID format.
 1.3 15-Jun-1993  mycroft branches: 1.3.4;
Move definitions of TIMER_FREQ to timerreg.h, and fix value of CF for DELAY().
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 23-Mar-1993  cgd added support for microtime routines by Steve McCanne (mccanne@ee.lbl.gov)
 1.3.4.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.3.4.1 14-Sep-1993  mycroft New i386 code.
 1.4.62.1 31-Aug-2002  gehenna catch up with -current.
 1.4.50.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.48.1 27-Aug-2002  nathanw Catch up to -current.
 1.47 01-Mar-1995  mycroft Clean up deleted files.
 1.46 13-Jan-1995  mycroft Simplify some sanity checks.
 1.45 03-Jan-1995  mycroft Add interrupt sharing types.
 1.44 28-Dec-1994  mycroft Numerous changes. Many bugs fixed, better autoconfig, a few new features.
 1.43 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.42 04-Nov-1994  mycroft No longer needs icu.h.
 1.41 04-Nov-1994  mycroft Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
 1.40 03-Nov-1994  mycroft Update to match autoconfig code.
 1.39 27-Oct-1994  cgd new RCS ID format.
 1.38 22-Aug-1994  mycroft Disable EISA reset, for now.
 1.37 03-Aug-1994  mycroft Change iosize to 16.
 1.36 31-Jul-1994  mycroft Fix up u14_find() a bit; mainly, don't include a DRQ for the 34f.
 1.35 28-Jul-1994  mycroft Redo some of the EISA config stuff.
 1.34 27-Jul-1994  mycroft Remove unused macros.
 1.33 27-Jul-1994  mycroft Fix typo.
 1.32 27-Jul-1994  mycroft Fix the DMA setup.
 1.31 27-Jul-1994  mycroft Enable IRQ probing.
 1.30 08-Jun-1994  mycroft branches: 1.30.2;
Add (experimental) 24f handling.
 1.29 11-May-1994  mycroft Nothing of consequence.
 1.28 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.27 29-Apr-1994  cgd change timeout/untimeout/wakeup/sleep/tsleep args to void *
 1.26 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.25 29-Mar-1994  mycroft New SCSI system, based on Julian's more recent work.
 1.24 25-Mar-1994  mycroft Put controller target in scsi_switch.
 1.23 14-Mar-1994  mycroft Remove two bogus splx()s.
 1.22 12-Mar-1994  mycroft Fix bug in last change.
 1.21 12-Mar-1994  mycroft Update to match config(8).
 1.20 10-Mar-1994  mycroft Updates to match config(8).
 1.19 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.18 21-Jan-1994  glass cleaned up some warnings
 1.17 03-Jan-1994  mycroft Use KERNBASE, not 0xfe000000.
 1.16 20-Dec-1993  davidb Fixed bug where with two or more SCSI controllers of the same type, you
could not have devices at the same ID on each bus.
This patch not directly applicable to magnum branch, which is using Julian's
new SCSI code.
 1.15 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.14 07-Dec-1993  deraadt __386BSD__ -> __NetBSD__
 1.13 28-Jul-1993  cgd branches: 1.13.2;
incorporate changes from 0-9-base to 0-9-ALPHA
 1.12 17-Jul-1993  deraadt branches: 1.12.2;
scsi_switch had wrong entries for these controllers...
 1.11 09-Jun-1993  deraadt minor silliness related to two or more controllers
 1.10 22-May-1993  cgd add rcsids to everything and clean up headers
 1.9 04-May-1993  deraadt support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
 1.8 15-Apr-1993  deraadt ioconf changes, see previous cvs's that dumped core
 1.7 15-Apr-1993  deraadt ooops. DDB instead of NDDB. A typo, i swear
 1.6 15-Apr-1993  deraadt #ifdef DDB fix
 1.5 12-Apr-1993  deraadt new scsi subsystem.
changes also in config/mkioconf.c & sys/scsi/*
 1.4 10-Apr-1993  cgd was saying "not responding" on failed probe. that's bogus.
 1.3 10-Apr-1993  glass fixed to be compliant, subservient, and to take advantage of the newly
hacked config(8)
 1.2 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.1 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.12.2.1 22-Jul-1993  cgd slight (strange!) mod from julian to make it work with ultra34f, as well.
 1.13.2.11 25-Mar-1994  mycroft Stylistic changes.
 1.13.2.10 02-Feb-1994  mycroft Change some structure names.
 1.13.2.9 02-Feb-1994  mycroft Change second arg of probe to self.
 1.13.2.8 04-Dec-1993  mycroft Various cleanup, and two bug fixes.
 1.13.2.7 29-Nov-1993  mycroft Add some bzero()s before it bites me.
 1.13.2.6 28-Nov-1993  mycroft Stylistic changes.
 1.13.2.5 28-Nov-1993  mycroft Remove some unused variables.
 1.13.2.4 28-Nov-1993  mycroft Delete useless `flags' field in uha_data.
 1.13.2.3 28-Nov-1993  mycroft Stylistic changes.
 1.13.2.2 28-Nov-1993  mycroft Works.
 1.13.2.1 25-Nov-1993  mycroft New code from Julian, not yet converted.
 1.30.2.5 22-Aug-1994  mycroft update from trunk
 1.30.2.4 03-Aug-1994  cgd from trunk
 1.30.2.3 01-Aug-1994  cgd From trunk.
 1.30.2.2 28-Jul-1994  cgd from trunk.
 1.30.2.1 27-Jul-1994  cgd from trunk, per mycroft
 1.55 22-Nov-2002  fvdl Removed in the new intr world.
 1.54 11-Nov-2002  itohy XINTR_TSS() macro for non-ELF case
whitespace nit
 1.53 05-Oct-2002  fvdl Define XINTR_TSS
 1.52 03-Oct-2002  fvdl Make shared IRQs for the normal PIC case work again as they did before
the MP merge (i.e. treat them as having the lowest level of all registered
handlers in the chain for the IRQ).
 1.51 01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.50 10-Jun-2002  itohy s/XHOLE_VEC/XHOLD_VEC/
 1.49 31-May-2002  thorpej Make this work with an ISO C preprocessor.
 1.48 21-Sep-2001  fvdl branches: 1.48.10; 1.48.12;
Make the newer gas happy by explicitly adding '*' to indirect calls, and
matching mov extensions with register names.
 1.47 17-Jul-2001  mrg branches: 1.47.2;
use a shift instead of a divide.
 1.46 20-Jan-2000  enami branches: 1.46.2; 1.46.8; 1.46.10;
fix typo in comment.
 1.45 23-Aug-1999  kleink branches: 1.45.2;
Unlike in an i386 a.out assembler, where in an .align n directive n is meant
to be the logarithm to base 2 of the alignment, in an ELF environment n is
the actual alignment boundary; thus, adjust the directives accordingly.

Albeit the wonderful i386 architecture doesn't mind the smaller alignment in
an obvious way, it is likely to have resulted in some performance penalty
during the a.out->ELF transition.
 1.44 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.43 01-Dec-1998  thorpej Use _C_LABEL() to generate C labels in assembly code, don't prepend an
underscore (_) directly. (XXX Except in a few places, where traditional
CPP's macro evaluation semantics break things, so we test for __ELF__
directly in those places).
 1.42 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.41 04-Jul-1998  jonathan defopt DDB.
 1.40 10-Feb-1998  mrg - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
 1.39 06-Feb-1998  mrg add the i386 MD portions for UVM.
 1.38 16-Nov-1997  mycroft Minor change.
 1.37 16-Nov-1997  mycroft Fix a condition where we might keep interrupts blocked while servicing a soft
interrupt.
Fixes serial port silo overflow problems.
 1.36 28-Feb-1997  mycroft branches: 1.36.8;
Import interrupt priority changes from com patches:
* Make it a strict hierarchy. (It was close anyway).
* Add `serial' and rename `softtty' to `softserial'.
* Make soft interrupts a bit less special-case.
 1.35 20-Nov-1996  mycroft branches: 1.35.6;
Remove incomplete and unused `fast' vector code.
 1.34 20-Nov-1996  jonathan Fix cut-and-paste errors.
 1.33 20-Nov-1996  jonathan * Add old-style vmstat -i interrupt counters for normal and stray interrupts.
Interrupts for irqs with handlers are counted as normal, even if none of
the handlers claim the interrupt.
Should all be redone with hierarchical event counters. that count
hardware events and invocations of each handler separately.

* Increment cnt.v_intr for normal interrupts (bugfix).
 1.32 07-Jan-1996  mycroft branches: 1.32.4;
Stylistic changes.
 1.31 07-Jan-1996  mycroft Deal with GCC's dead code elimination being suboptimal.
 1.30 07-Jan-1996  mycroft Build the frame for recursive interrupts manually, and make sure to disable
interrupts to avoid races.
 1.29 08-May-1995  mycroft The previous optimization only works for edge-triggered interrupts...
 1.28 03-May-1995  mycroft By default, don't frob the ICU masks here. The software masking should
be sufficient.
 1.27 01-May-1995  mycroft Update to match include files. Eliminate _ucodesel, _udatasel, and IdlePTD.
 1.26 22-Apr-1995  mycroft Move some comments to more appropriate places.
 1.25 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.24 18-Nov-1994  mycroft Remove Xwild; it's no longer used.
 1.23 04-Nov-1994  mycroft isa.h -> isareg.h
 1.22 27-Oct-1994  cgd new RCS ID format.
 1.21 09-Oct-1994  mycroft Oops; slight optimization to the previous.
 1.20 09-Oct-1994  mycroft Oops. Just fake %ebp; nothing else.
 1.19 09-Oct-1994  mycroft If DDB is configured, make a fake stack frame.
 1.18 23-May-1994  cgd branches: 1.18.2;
notdef out some debug code that no longer works
 1.17 18-Apr-1994  mycroft Only report `stray' interrupts if DEBUG, since they occur normally.
 1.16 15-Apr-1994  cgd keep vmstat happy.
 1.15 07-Apr-1994  mycroft Macroize some more constants.
 1.14 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.13 02-Apr-1994  mycroft Minor code cleanup.
 1.12 19-Dec-1993  mycroft Clean up trap handling and macroize interrupt entry and exit code. From
magnum branch.
 1.11 17-Dec-1993  mycroft From magnum branch:
Remove Jolitz's netisr kluge. Make sure cpl == 0 really means base priority.
Other minor cleanup.
 1.10 02-Aug-1993  mycroft branches: 1.10.2;
Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.9 03-Jul-1993  cgd change interrupt vector names to begin with "X" rather than "V", so we're
like every other BSD system on the planet...
 1.8 03-Jul-1993  cgd Unless INTR_DEBUG is set, don't report all of the "random" event types.
also, unless INTR_DEBUG is set, make the internal branch labels for
the interrupt code be local labels, so profiling works OK.
 1.7 01-Jul-1993  andrew Fixed a typo.
 1.6 01-Jul-1993  mycroft Fix Andrew's real bug, and put back the FAST_VECTOR changes.
 1.5 30-Jun-1993  andrew Backed out the changes to the FAST_VECTOR code that were made in the
previous revision, as they apparently broke something.
 1.4 27-Jun-1993  andrew Neatened up the AUTO_EOI conditionals. FAST_VECTOR() now saves & restores
the ES register, just to be on the safe side (since ES is used in some
locore routines).
 1.3 14-Jun-1993  mycroft Add support for other networks than INET.
 1.2 06-Jun-1993  cgd apply patch 167, to fix some interrupt system bogosities
 1.1 06-Jun-1993  cgd incorporate Bruce Evans' interrupt changes, as hacked by Rod grimes,
for patchkit patch 158. it appears to work well.
 1.10.2.17 05-Dec-1993  mycroft Use specific EOIs always.
 1.10.2.16 05-Dec-1993  mycroft Turn off special mask mode by default. It is clearly not supported enough.
 1.10.2.15 11-Nov-1993  mycroft Macroize interrupt entry and exit code.
 1.10.2.14 01-Nov-1993  mycroft Take advantage of special mask mode by leaving interrupts masked in ISR until
they are serviced. No need to frob IMR.
 1.10.2.13 01-Nov-1993  mycroft imen --> imask
 1.10.2.12 31-Oct-1993  mycroft Reenable ICUs earlier in the interrupt sequence, and put the masking and
unmasking code into macros.
 1.10.2.11 29-Oct-1993  mycroft Remove dummy ether_output().
 1.10.2.10 27-Oct-1993  mycroft Somehow I managed to delete this rather critical instruction.
 1.10.2.9 27-Oct-1993  mycroft This is a kluge.
 1.10.2.8 22-Oct-1993  mycroft Add fast vectors. Remove some old comments that no longer apply.
 1.10.2.7 17-Oct-1993  mycroft Minor cleanup.
 1.10.2.6 15-Oct-1993  mycroft Vresume --> _Xresume. Add _Xintr table. Add _Xstray.
 1.10.2.5 13-Oct-1993  mycroft Oops. Rename _intrcnt to _intrcnt_actv.
 1.10.2.4 13-Oct-1993  mycroft Remove some useless NOPs. Add counters for pending interrupts.
 1.10.2.3 12-Oct-1993  mycroft Recode handlers for minimum latency in the masked case, and shorten the
non-masked case.
 1.10.2.2 09-Oct-1993  mycroft Majorly rewritten to deal with interrupt sharing. Unused fast vector cruft
removed.
 1.10.2.1 14-Sep-1993  mycroft New i386 code.
 1.18.2.1 11-Oct-1994  mycroft Update from trunk.
 1.32.4.2 26-Jan-1997  rat Fix oversight in previous pullup.
 1.32.4.1 06-Dec-1996  rat Pullup request 1.32 -> 1.33 from Jonathan Stone <jonathan@DSG.Stanford.EDU>

>This change adds vmstat -i counters, which are invaluable in debugging
>interrupt-related problems, performance measurement and tuning, etc.
 1.35.6.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.36.8.1 18-Nov-1997  mellon Pull rev 1.37 and 1.38 up from trunk (mycroft)
 1.45.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.46.10.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.46.10.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.46.10.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.46.10.1 03-Aug-2001  lukem update to -current
 1.46.8.6 11-Dec-2002  thorpej Sync with HEAD.
 1.46.8.5 11-Nov-2002  nathanw Catch up to -current
 1.46.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.46.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.46.8.2 21-Sep-2001  nathanw Catch up to -current.
 1.46.8.1 24-Aug-2001  nathanw Catch up with -current.
 1.46.2.4 25-Jun-2002  sommerfeld Resynch with -current.
 1.46.2.3 22-Sep-2001  sommerfeld Merge branch with current, post ubcperf, MTRR, etc., etc.,
with the recent fifo_putpages fix to the trunk, GENERIC.MPDEBUG config
boots multiuser on my BP6.
 1.46.2.2 19-Jul-2001  sommerfeld catch up with -current
 1.46.2.1 20-Feb-2000  sommerfeld MP: Weave level-based rather than mask-based representation of current
interrupt priority level into the mesh of interrupt stub and return
path..

XXX the flow of control between these two files could be better
documented, but I didn't really change much...

XXX could use some tuning.
 1.47.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.48.12.1 08-Feb-2003  jmc Hand patches (requested by yamt in ticket #1153)
Fix kernel stack overflow on i386. PR#20180
 1.48.10.1 14-Jul-2002  gehenna catch up with -current.
 1.130 01-Mar-1995  mycroft Clean up deleted files.
 1.129 13-Jan-1995  mycroft (Almost) allow sector sizes other than 512 bytes. Reduce some expensive operations.
 1.128 13-Jan-1995  mycroft Always boundary check I/O.
 1.127 13-Jan-1995  mycroft Fix another bug in the DMA code.
 1.126 13-Jan-1995  mycroft Minor rearrangement.
 1.125 13-Jan-1995  mycroft Change the way sc_skip is used. Fix a bug in the (incomplete) DMA code. Add a
new sc_blkno (which will be useful later).
 1.124 07-Jan-1995  mycroft Fix a race condition between normal I/O and wd_get_parms().
 1.123 03-Jan-1995  mycroft Add interrupt sharing types.
 1.122 14-Dec-1994  mycroft Remove dkbad.h.
 1.121 01-Dec-1994  mycroft Ignore ERR during diagnostics.
 1.120 30-Nov-1994  mycroft Clear the controller active flag after a timeout.
 1.119 23-Nov-1994  mycroft Officially credit Onno.
 1.118 23-Nov-1994  mycroft There's no point in bothering to unlock what we didn't lock.
 1.117 23-Nov-1994  mycroft Fix an outdated comment.
 1.116 23-Nov-1994  mycroft Use logical block addressing if available. Be a little more careful about
maintaining timeouts. Clean up wddump() a bit.
 1.115 22-Nov-1994  mycroft Implement 32-bit reads and writes, but for now assume 16-bit mode.
 1.114 22-Nov-1994  mycroft Add a missing newline in some error messages.
 1.113 22-Nov-1994  mycroft Implement EIDE multi-sector PIO and DMA modes, based on code from Onno van
der Linden. Also, various structural cleanup, and fix two bogons that crept
in, and remove all of the old clustering nonsense.
 1.112 22-Nov-1994  mycroft Minor fix to debugging code.
 1.111 22-Nov-1994  mycroft Fudge a couple more fields for ancient disks.
 1.110 22-Nov-1994  mycroft Change some constant names, etc., to better match the ATA spec.
 1.109 22-Nov-1994  mycroft Add still more locking.
 1.108 20-Nov-1994  mycroft Add some missing locking, and some general cleanup.
 1.107 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.106 04-Nov-1994  mycroft Fix stupid bug in last change.
 1.105 04-Nov-1994  mycroft Add a simplified version of wdcommand() that can be used in some cases.
Avoid needing a wd_softc inside wdprobe().
 1.104 04-Nov-1994  mycroft No longer needs icu.h.
 1.103 03-Nov-1994  mycroft *intr() arg does not need to be void*.
 1.102 03-Nov-1994  mycroft Use indirect config for subdevices, and add dkdrivers where missing.
 1.101 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.100 27-Oct-1994  cgd new RCS ID format.
 1.99 20-Oct-1994  mycroft Be careful not to stack multiple timeouts.
 1.98 20-Oct-1994  mycroft Remove the local timeout mechanism, and just use explicit timeout()/untimeout()
calls.
 1.97 20-Oct-1994  mycroft Always set d_secsize to 512 for now.
 1.96 20-Oct-1994  mycroft Don't switch to single-sector mode just because we got a corrected error.
 1.95 20-Oct-1994  mycroft Rearrange wdcstart() in a more logical fashion, and eliminate many redundant
calculations. Also, speed up bad block searching a little.
 1.94 20-Oct-1994  mycroft openpart -> openmask
 1.93 20-Oct-1994  mycroft Various changes:
* Add a dkdevice; move sc_*openpart, sc_label, and sc_cpulabel into it.
* Turn sc_wlabel into a flag, and don't set it automatically in DIOCWLABEL.
* If there is no label, disallow all I/O except to the raw partition.
* Don't allow I/O to `unused' partitions.
* Beginnings of support for block sizes other than 512 bytes.
Other minor changes.
 1.92 14-Oct-1994  cgd move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS.
 1.91 09-Oct-1994  mycroft Remove unneeded #includes.
 1.90 07-Oct-1994  mycroft Don't poll the BUSY bit until the SDH register is set.
 1.89 12-Sep-1994  mycroft Turn off the delay debugging messages again.
 1.88 15-Aug-1994  mycroft Eliminate struct pte and struct pde.
 1.87 15-Aug-1994  mycroft Don't use altsts. Sigh.
 1.86 26-Jul-1994  mycroft Normalize label handling.
 1.85 21-Jul-1994  mycroft Return EINVAL if the requested transfer size is weird.
 1.84 16-Jun-1994  mycroft branches: 1.84.2;
b_un.b_addr -> b_data
 1.83 09-Jun-1994  pk Set `uio_procp' field in case we ever need it.
 1.82 05-May-1994  mycroft Remove now-bogus casts.
 1.81 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.80 25-Apr-1994  mycroft Fix uninitialized pointer, pointed out by Michael VanLoon.
 1.79 24-Apr-1994  mycroft Don't need isa.h.
 1.78 20-Apr-1994  mycroft Use TAILQ_*() to maintain the drive activation queues.
 1.77 09-Apr-1994  mycroft Don't print a duplicate message about stray interrupts.
 1.76 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.75 30-Mar-1994  mycroft Turn off the timeout debugging info by default.
 1.74 29-Mar-1994  mycroft Updates for new autoconfig.
 1.73 12-Mar-1994  mycroft Prefix the busy-wait messages with `ignore this:' so people stop reporting
it as a bug.
 1.72 12-Mar-1994  mycroft Fix problem with reading the disk label if it's not at the beginning of the
disk.
 1.71 12-Mar-1994  mycroft Remove backward compatibility hacks for config(8), as they are no longer
useful.
 1.70 12-Mar-1994  mycroft Update to match config(8).
 1.69 11-Mar-1994  mycroft Various:
Put WDF_ERROR in the wdc_softc, to avoid gratuitously forcing non-active drives
into single-sector mode on the next transfer. Arrange to wait for an interrupt
after wdsetctlr(); this avoids long busy-wait delays, and gets rid of the
`extra interrupt' messages (except for one immediately after autoconfig on some
machines). Replace some uses of wdsetctlr() with simply lowering wd->sc_state;
no point in forcing this immediately. Allow control operations to time out.
Enable the warnings for long busy-wait delays by default. Some other minor
things not worth mentioning.
 1.68 10-Mar-1994  mycroft Add a heuristic for detecting old config(8)s. This is very temporary.
 1.67 10-Mar-1994  mycroft Now that the disk probe routines are actually called, they need to return
something.
 1.66 10-Mar-1994  mycroft More updates for new config.
 1.65 10-Mar-1994  mycroft Update for new config.
 1.64 10-Mar-1994  mycroft Cleanup to fit standard coding conventions, and *many* bugs fixed.
 1.63 07-Mar-1994  mycroft Some changes inspired by Bruce Evans's driver:
Consolidate error reporting in one function. Actually use the dk_status and
dk_error fields, and pass around only the error bit to avoid lots of unneeded
assignments and tests. No functional differences.
 1.62 07-Mar-1994  mycroft Remove DKFL_QUIET.
 1.61 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.60 05-Mar-1994  mycroft Move the drive select and various other things into wdcommand(), to avoid
duplicating code.
 1.59 04-Mar-1994  mycroft Make sure we clear the interrupt when necessary. Why this isn't needed on
my hardware is a mystery.
 1.58 04-Mar-1994  mycroft Add another missing splx().
 1.57 04-Mar-1994  mycroft Remember to splx() on some error conditions.
 1.56 04-Mar-1994  mycroft Start the timeout loop *after* we've decided there is a disk there.
 1.55 04-Mar-1994  mycroft De-ANSIfy. Move the timeout counter into struct disk. Remove unneeded args
to wd[gs]etctlr(). Other minor changes.
 1.54 03-Mar-1994  mycroft Watch `seek complete' bit per IBM documentation. Clean up wdioctl(). Other
minor cleanup.
 1.53 02-Mar-1994  mycroft Be more careful about clearing the controller and drive active flags.
 1.52 02-Mar-1994  mycroft Don't busy-wait for read or write completion.
 1.51 02-Mar-1994  mycroft Make wdc_wait() do an implicit wait_for_unbusy(). Pass structure pointers
rahter than unit numbers where appropriate. Fix conflict if two drives have
I/O pending at the same time. Add some more sanity checks. Some other minor
cleanup.
 1.50 26-Feb-1994  mycroft Get the residual count right.
 1.49 26-Feb-1994  mycroft Clean up busy-wait code a little, and we need a special disksort() to skip
over bufs in a combined transfer.
 1.48 26-Feb-1994  mycroft Fix bug from 1.43 correctly.
 1.47 26-Feb-1994  mycroft Fix typo.
 1.46 26-Feb-1994  mycroft Various cleanup, and fix last night's bug.
 1.45 26-Feb-1994  mycroft Fix typo.
 1.44 26-Feb-1994  mycroft Some more stylistic cleanup.
 1.43 25-Feb-1994  mycroft Fix an obvious bug that could stall the queue.
 1.42 25-Feb-1994  mycroft Remove some redundant code.
 1.41 25-Feb-1994  mycroft Increase polling delay.
 1.40 25-Feb-1994  mycroft Generalize busy-wait loops.
 1.39 25-Feb-1994  mycroft Don't bother #ifdefing things that are needed and always enabled.
 1.38 25-Feb-1994  mycroft Don't reimplement disksort().
 1.37 25-Feb-1994  mycroft `We are the KNF. You will be assimilated.'
 1.36 10-Feb-1994  mycroft Back pointers are not useful for disksort().
 1.35 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.34 06-Feb-1994  mycroft Remove another use of b_actl.
 1.33 06-Feb-1994  mycroft Use b_actf, not av_forw.
 1.32 03-Jan-1994  mycroft Inline all the [lr]cr[023]() `functions' in cpufunc.h.
 1.31 03-Jan-1994  mycroft Inline all the [lr]cr[023]() `functions' in cpufunc.h.
 1.30 24-Dec-1993  ws Correct dumping to WD (was destroyed by MACHINE_NONCONTIG code)
 1.29 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.28 16-Dec-1993  mycroft Eliminate reference to Maxmem.
 1.27 13-Dec-1993  cgd from Soeren Schmidt <sos@login.dkuug.dk>:
Basically it does a timeout on lost interrupts, starting the operation
again and logging and error message on the console.
additionally fixes some of the (newer ending) while loops
(that made it work with two IDE disks !)
 1.26 01-Aug-1993  mycroft branches: 1.26.2;
Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.25 28-Jul-1993  cgd incorporate changes from 0-9-base to 0-9-ALPHA
 1.24 08-Jul-1993  deraadt branches: 1.24.2;
documentation error
 1.23 07-Jul-1993  deraadt added a timeout debugging mode to wd.c so that people can see how slow
their controllers really are. Look for the WDCNDELAY_DEBUG definition.
 1.22 07-Jul-1993  deraadt ok, 5 second command timeouts..
 1.21 06-Jul-1993  deraadt number of changes:
1. controller reset code moved into one function, called from more places now.
2. more places now do timeouts. TIPCAT code turned on.
3. blew away the unused WDOPENLOCK test code.
4. delay is now done using WDCNDELAY repetitions of DELAY(25). Up to 2.5 second
pause accepted from controller (some controllers have some commands that are
actually this slow)
5. some of the old timeout code was really whacked.
 1.20 05-Jul-1993  deraadt added a missing {/} pair that barsoom seems to have taken out, but
which the standard 386bsd 0.1 driver did have. This is for a piece of
code in the bad block handling. found/fixed by hpeyerl.
 1.19 05-Jul-1993  deraadt all timeout code now calls DELAY() so the timeout delays are the same
length on all processors. Where possible, the controller is reset if it
times out.
 1.18 05-Jul-1993  deraadt increased the timeout inside wdcommand(). Some controllers impliment some
commands very slowly.
 1.17 18-Jun-1993  cgd fix the divide-by-zero problem w/old disks. this patch is ws's "fault."
 1.16 28-May-1993  deraadt 1. It is now possible to build a kernel that does not have a pc0 device driver.
2. "press any key to reboot" reads the key from the console.
3. wddump() still needs a non-blocking getc() routine (or flush)
 1.15 22-May-1993  cgd add rcsids to everything and clean up headers
 1.14 20-May-1993  deraadt First cut at cpu independent disklabels.
There will be niggly little details no doubt..
 1.13 10-May-1993  deraadt This patch allows the wd device driver to tell how big the disks are on
WD1007-derived controllers. In this example, wdc0 is a WD1007-clone,
and wdc1 is a WD1003-clone. WD1007 controllers are generally ESDI
and IDE controllers.
wdc0 at 0x1f0-0x1f7 irq 14 on isa
wd0 at wdc0 targ 0: 322MB 1224 cyl, 15 head, 36 sec <disktype>
wdc1 at 0x170-0x17f irq 7 on isa
wd2 at wdc1 targ 0: (unknown size) <disktype>
 1.12 09-May-1993  deraadt i thought i deleted this line before!
 1.11 04-May-1993  deraadt support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
 1.10 18-Apr-1993  deraadt slight code quality improvement. not related to the bug with very
old controllers or disks! :-)
 1.9 15-Apr-1993  deraadt Once more: some changes to the ioconf.c structure. It will now handle
devices hanging off controllers, any kind of controller.
A device on isa0 is called at probe(self), then attach(self)
A controller on isa0 is called at probe(self), then all it's children with
defined unit numbers are initialized by calling attach(subdev); next all
subdevices with unit ? are initialized by calling attach(sundev).
Almost all device entry points is now like the vax/sun model (intr being
the weird one)
 1.8 15-Apr-1993  deraadt wd driver would fail on calling wdgetctlr() for older drives and
controllers. New behaviour is that if the standard method fails, try
to recalibrate the drive. Success means the drive exists. patch by
hpeyerl@novatel.cuc.ab.ca (who owns several of these historical
artifacts)
 1.7 12-Apr-1993  deraadt new scsi subsystem.
changes also in config/mkioconf.c & sys/scsi/*
 1.6 09-Apr-1993  cgd have probe return size of io space on successful return, rather
than simply 1.
 1.5 08-Apr-1993  deraadt dmesg output at boottime now tries to print out information as
soon as it is available. The output looks much more like Sunos.
 1.4 06-Apr-1993  deraadt ripped out a message
 1.3 06-Apr-1993  deraadt Mod-barsoom wd additions. config program + kernel config files changed too.
fd support had to change slightly too.
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.24.2.3 28-Jul-1993  deraadt wd.c: fixes 1 drive systems
fd.c: improves reliability
changes from wolfgang
 1.24.2.2 22-Jul-1993  cgd fix comment for previous commit...
 1.24.2.1 20-Jul-1993  cgd change WDCNDELAY to 400000 -- delay -> 10s, at theo's request
 1.26.2.5 06-Feb-1994  mycroft Use b_actf, not av_forw.
 1.26.2.4 13-Dec-1993  cgd partial (hopefully correct) update from trunk
 1.26.2.3 27-Oct-1993  mycroft Minor cleanup.
 1.26.2.2 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.26.2.1 14-Sep-1993  mycroft New i386 code.
 1.84.2.7 11-Oct-1994  mycroft Update from trunk.
 1.84.2.6 07-Oct-1994  mycroft Update from trunk.
 1.84.2.5 12-Sep-1994  cgd from trunk.
 1.84.2.4 15-Aug-1994  mycroft update from trunk
 1.84.2.3 15-Aug-1994  mycroft update from trunk
 1.84.2.2 26-Jul-1994  cgd update from trunk.
 1.84.2.1 22-Jul-1994  cgd from trunk.
 1.20 01-Mar-1995  mycroft Clean up deleted files.
 1.19 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.18 27-Oct-1994  cgd new RCS ID format.
 1.17 16-Jun-1994  mycroft b_un.b_addr -> b_data
 1.16 25-Mar-1994  mycroft Put controller target in scsi_switch.
 1.15 12-Mar-1994  mycroft Fix bug in last change.
 1.14 12-Mar-1994  mycroft Update to match config(8).
 1.13 10-Mar-1994  mycroft Updates to match config(8).
 1.12 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.11 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.10 03-Jan-1994  mycroft Use KERNBASE, not 0xfe000000.
 1.9 20-Dec-1993  davidb Fixed bug where with two or more SCSI controllers of the same type, you
could not have devices at the same ID on each bus.
This patch not directly applicable to magnum branch, which is using Julian's
new SCSI code.
 1.8 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.7 10-Jun-1993  deraadt sigh. one day i'll finish this driver, meanwhile, one more fix..
 1.6 22-May-1993  cgd add rcsids to everything and clean up headers
 1.5 22-May-1993  deraadt fixed typo
 1.4 04-May-1993  deraadt support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
 1.3 12-Apr-1993  deraadt new scsi subsystem.
changes also in config/mkioconf.c & sys/scsi/*
 1.2 06-Apr-1993  deraadt wd7000 device driver, put in IO_WDS entry in isa.h. You can now build a
kernel with it. Hope your dma works better than mine <grr>
 1.1 06-Apr-1993  deraadt added: incomplete wd7000-asc scsi controller device driver.
 1.12 01-Mar-1995  mycroft Clean up deleted files.
 1.11 23-Nov-1994  mycroft Forgot to commit this as part of the LBA changes.
 1.10 22-Nov-1994  mycroft Implement EIDE multi-sector PIO and DMA modes, based on code from Onno van
der Linden. Also, various structural cleanup, and fix two bogons that crept
in, and remove all of the old clustering nonsense.
 1.9 22-Nov-1994  mycroft Change some constant names, etc., to better match the ATA spec.
 1.8 04-Nov-1994  mycroft Add a simplified version of wdcommand() that can be used in some cases.
Avoid needing a wd_softc inside wdprobe().
 1.7 27-Oct-1994  cgd new RCS ID format.
 1.6 22-Aug-1994  mycroft Fix typo in WDCS_BITS.
 1.5 10-Mar-1994  mycroft branches: 1.5.2;
Cleanup to fit standard coding conventions, and *many* bugs fixed.
 1.4 02-Mar-1994  mycroft Fix prototype of wdintr().
 1.3 11-Feb-1994  mycroft Add proc arg to wdioctl() proto.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.2.1 22-Aug-1994  mycroft update from trunk
 1.4 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.3 17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.2 25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.1 21-Feb-1995  brezak Driver for Windows sound system; not extensively tested
 1.2 17-Apr-1995  cgd these belong in dev/isa; they're being moved there now.
 1.1 21-Feb-1995  brezak Driver for Windows sound system; not extensively tested
 1.23 01-Mar-1995  mycroft Clean up deleted files.
 1.22 03-Jan-1995  mycroft Add interrupt sharing types.
 1.21 18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.20 03-Nov-1994  mycroft Update to match autoconfig code.
 1.19 30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.18 27-Oct-1994  cgd new RCS ID format.
 1.17 25-Jul-1994  mycroft Add missing splbio()s, pointed out by Gene Stark.
 1.16 16-Jun-1994  mycroft branches: 1.16.2;
b_un.b_addr -> b_data
 1.15 05-May-1994  mycroft Remove now-bogus cast.
 1.14 05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.13 22-Apr-1994  mycroft Separate DMA functions.
 1.12 21-Apr-1994  mycroft Fix return of I/O space size from wtprobe(), as reported by Rafal Boni.
 1.11 07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.10 29-Mar-1994  mycroft New version from Sergey Ryzhkov and Serge Vakulenko.
 1.9 08-Mar-1994  mycroft #include cpu.h in all files which use spl*().
 1.8 06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.7 09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.6 20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.5 28-Jul-1993  cgd branches: 1.5.2;
incorporate changes from 0-9-base to 0-9-ALPHA
 1.4 19-Jul-1993  cgd branches: 1.4.2;
kill damned RCS Log
 1.3 19-Jul-1993  cgd Reading file marks or writing end of tape return 0 bytes, AND THEY
DON'T SET THE ERROR BIT ON THE BUFFER UNLESS THE AUTHOR OF PHYSIO
IS STUPID!
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.2.2 19-Jul-1993  cgd my previous change to get rid of error flagging on EOM/EOF was wrong-headed
 1.4.2.1 19-Jul-1993  cgd file wt.c was added on branch netbsd-0-9 on 1993-07-19 19:31:23 +0000
 1.5.2.2 02-Feb-1994  mycroft Partial cleanup; needs work.
 1.5.2.1 24-Sep-1993  mycroft clock.c: Finish conversion. Make rtcput() work if VRT bit not set. Speed up
time conversion in delay().
fd.c: Minor changes to autoconfig. Use dv_parent rather than storing another
pointer to the fdc_softc in each fd_softc. Change disk label stuff for our
kernel.
icu.s: Make splx() and splnone() return previous cpl for now.
isa.c: Minor autoconfig changes.
isa.h: rtcin() is now nvram() and is declare in nvram.h. Make isaphysmem a
caddr_t.
pccons.c: XXXX: Maybe we should insist they open /dev/io now.
timerreg.h: #define TIMER_NPORTS.
wd.c: Delete unused wdnoreloc() and wddospart(), and use remaining two bits in
unit number. struct disk --> struct wd_softc. struct board --> struct
wdc_softc. Still needs much work.
 1.16.2.1 26-Jul-1994  cgd from trunk
 1.6 01-Mar-1995  mycroft Clean up deleted files.
 1.5 27-Oct-1994  cgd new RCS ID format.
 1.4 29-Mar-1994  mycroft New version from Sergey Ryzhkov and Serge Vakulenko.
 1.3 15-Feb-1994  mycroft Remove imbedded RCS logs.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources

RSS XML Feed