Home | History | Annotate | only in /src/sys/arch/sh3/dev
History log of /src/sys/arch/sh3/dev
RevisionDateAuthorComments
 1.16 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.15 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.14 24-Apr-2021  thorpej branches: 1.14.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.13 08-Aug-2010  chs branches: 1.13.74;
make this compile with DIAGNOSTIC.
 1.12 30-Apr-2009  nonaka branches: 1.12.2; 1.12.4;
Support SH7706
 1.11 05-Apr-2009  uwe Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.
 1.10 16-Dec-2008  christos branches: 1.10.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.9 27-Mar-2008  uwe branches: 1.9.4; 1.9.12;
Use cfdata_t, aprint_*.
 1.8 27-Mar-2008  uwe Use device_t. Convert to use CFATTACH_DECL_NEW.
 1.7 27-Oct-2006  uwe branches: 1.7.52;
Nuke GPROF cargo-cult I've been cut-n-pasting around in my drivers.
 1.6 11-Dec-2005  christos branches: 1.6.20; 1.6.22;
merge ktrace-lwp.
 1.5 26-Aug-2005  drochner s/locdesc_t/int/g
 1.4 30-Jun-2005  drochner branches: 1.4.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.3 22-Oct-2003  uwe branches: 1.3.4;
Use adcvar.h.
 1.2 19-Oct-2003  uwe __KERNEL_RCSID.
 1.1 18-Oct-2003  uwe Driver for analog->digital converter in sh7709.
 1.3.4.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 22-Oct-2003  skrll file adc.c was added on branch ktrace-lwp on 2004-08-03 10:40:15 +0000
 1.4.2.2 30-Dec-2006  yamt sync with head.
 1.4.2.1 21-Jun-2006  yamt sync with head.
 1.6.22.1 10-Dec-2006  yamt sync with head.
 1.6.20.1 18-Nov-2006  ad Sync with head.
 1.7.52.2 17-Jan-2009  mjf Sync with HEAD.
 1.7.52.1 03-Apr-2008  mjf Sync with HEAD.
 1.9.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.9.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.4.2 11-Aug-2010  yamt sync with head.
 1.9.4.1 04-May-2009  yamt sync with head.
 1.10.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.12.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.13.74.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.13.74.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.13.74.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.13.74.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.13.74.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

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

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.14.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 22-Oct-2003  uwe branches: 1.1.4;
Use adcvar.h.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 22-Oct-2003  skrll file adcvar.h was added on branch ktrace-lwp on 2004-08-03 10:40:15 +0000
 1.2 13-Sep-1999  msaitoh remove mainbus pseudo floppy drive
 1.1 13-Sep-1999  itojun Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.2 13-Sep-1999  msaitoh remove mainbus pseudo floppy drive
 1.1 13-Sep-1999  itojun Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.6 24-Mar-2002  uch branches: 1.6.4;
mmeye specific devices are moved to mmeye/dev
 1.5 12-Feb-2002  uch ANSIfy KNF.
 1.4 01-Sep-2000  tsubai branches: 1.4.4;
Correct iosize.
 1.3 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.2 14-Sep-1999  tsubai branches: 1.2.2;
Catch up with -current.
 1.1 13-Sep-1999  itojun Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.2.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.6.4.2 24-Mar-2002  uch mmeye specific devices are moved to mmeye/dev
 1.6.4.1 24-Mar-2002  uch file pcic_shb.c was added on branch nathanw_sa on 2002-03-24 18:08:45 +0000
 1.5 24-Mar-2002  uch branches: 1.5.4;
mmeye specific devices are moved to mmeye/dev
 1.4 12-Feb-2002  uch ANSIfy KNF.
 1.3 29-Jun-2000  mrg branches: 1.3.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.2 14-Sep-1999  tsubai branches: 1.2.2;
Catch up with -current.
 1.1 13-Sep-1999  itojun Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.2.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.5.4.2 24-Mar-2002  uch mmeye specific devices are moved to mmeye/dev
 1.5.4.1 24-Mar-2002  uch file pcic_shbsubr.c was added on branch nathanw_sa on 2002-03-24 18:08:45 +0000
 1.13 13-Oct-2025  thorpej Use "start-year" than "sh3_rtc_baseyear" as the RTC base year property
name, matching the dsrtc driver and the Devicetree binding.
 1.12 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

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

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.11 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.10 20-Nov-2014  christos use the inline bcdtobin and bintobcd directly instead through a macro.
 1.9 08-Sep-2014  martin Adapt formats for debug printfs to clock_subr type changes.
 1.8 22-May-2010  tsutsui branches: 1.8.18; 1.8.34;
HPW-50PA PERSONA seems to use a different RTC base year value
(1996, not 1900 or 2000) so handle the quirk by device properties
and set it in MD device_register().
Also make RTC baseyear value patchable in sh3/dev/rtc.c.

No visible changes to other sh3 RTC users.
 1.7 05-Apr-2009  uwe branches: 1.7.2; 1.7.4;
Register with pmf(9), tell it we don't need anything.
 1.6 16-Dec-2008  christos branches: 1.6.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.5 28-Apr-2008  martin branches: 1.5.8;
Remove clause 3 and 4 from TNF licenses
 1.4 27-Mar-2008  uwe branches: 1.4.2; 1.4.4;
Add RCSID comment.
 1.3 27-Mar-2008  uwe Split device_t and softc. Use aprint_*.
 1.2 30-Mar-2007  uwe branches: 1.2.34;
On attach check if clock is running, mark it invalid if not. Return
error from gettime method if clock is not valid. Mark clock as valid
on settime.

Report more debugging info.
 1.1 20-Sep-2006  uwe branches: 1.1.2; 1.1.4; 1.1.8; 1.1.10; 1.1.14; 1.1.16;
Switch the rest of sh3 ports to todr(9)
Split code to handle on-chip rtc into a separate driver
Eliminate all todr code from clock.c
Move __HAVE_GENERIC_TODR to sh3/include/types.h
 1.1.16.1 11-Jul-2007  mjf Sync with head.
 1.1.14.1 10-Apr-2007  ad Sync with head.
 1.1.10.1 15-Apr-2007  yamt sync with head.
 1.1.8.3 03-Sep-2007  yamt sync with head.
 1.1.8.2 30-Dec-2006  yamt sync with head.
 1.1.8.1 20-Sep-2006  yamt file rtc.c was added on branch yamt-lazymbuf on 2006-12-30 20:46:54 +0000
 1.1.4.2 18-Nov-2006  ad Sync with head.
 1.1.4.1 20-Sep-2006  ad file rtc.c was added on branch newlock2 on 2006-11-18 21:29:31 +0000
 1.1.2.2 22-Oct-2006  yamt sync with head
 1.1.2.1 20-Sep-2006  yamt file rtc.c was added on branch yamt-splraiseipl on 2006-10-22 06:04:59 +0000
 1.2.34.3 17-Jan-2009  mjf Sync with HEAD.
 1.2.34.2 02-Jun-2008  mjf Sync with HEAD.
 1.2.34.1 03-Apr-2008  mjf Sync with HEAD.
 1.4.4.3 11-Aug-2010  yamt sync with head.
 1.4.4.2 04-May-2009  yamt sync with head.
 1.4.4.1 16-May-2008  yamt sync with head.
 1.4.2.1 18-May-2008  yamt sync with head.
 1.5.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.5.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.6.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.4.1 30-May-2010  rmind sync with head
 1.7.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.8.34.1 12-Nov-2014  snj Pull up following revision(s) (requested by martin in ticket #216):
share/man/man9/todr.9: revision 1.17
sys/arch/sh3/dev/rtc.c: revision 1.9
sys/dev/clock_subr.c: revision 1.17-1.22
sys/dev/clock_subr.h: revision 1.22
sys/fs/msdosfs/msdosfs_conv.c: revision 1.10
tools/compat/compat_defs.h: revision 1.98
tools/compat/dev/clock_subr.h: revision 1.1-1.2
usr.sbin/makefs/msdos/Makefile.inc: revision 1.6
clock_secs_to_ymdhms(9) takes seconds as a time_t, not int.
--
Make this compile- and usable from userland as well.
--
Add a slightly stripped down version of sys/dev/clock/clock_subr.h to make
this code available for tools.
--
Reformulate an overflow test so it can be used in tool builds (i.e. does
not depend on netbsd specific macros).
--
Make msdosfs time conversion use the y/m/d/h/m/s conversion functions
from clock_subr.c and compile that into the userland (and tools)
makefs as well.
--
Copy definitions of __type_min(t), __type_max(t), and some related macros,
from <sys/cdefs.h>, for use when building tools.
--
Revert previous; test secs > __type_max(time_t) again, now
that __type_max is available in tools/compat/compat_defs.h.
--
If HAVE_NBTOOL_CONFIG_H is set, then include "nbtool_config.h",
because this file is compiled as part of tools/makefs.
--
Counting leap years was fine while we had 32bit time_t - but now it
is not a good idea for dates far away in the future.
For dates in the year 2000 or later, use arithmetic instead (since the
repeating periods are well aligned). Should fix PR 49144.
--
Avoid overflowing the "year" value by making the field uint64_t. Adapt
arguments and local variables accordingly.
This now fixes PR 49144 for real.
--
Adapt formats for debug printfs to clock_subr type changes.
 1.8.18.1 03-Dec-2017  jdolecek update from HEAD
 1.65 17-Sep-2023  andvar remove unneeded whitespace in empty line from my previous commit.
 1.64 16-Sep-2023  andvar sh3/sci(4): replace undefined scistatus with DPRINTF.

Fixes the build with SCI_DEBUG enabled.
 1.63 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.62 10-Nov-2019  chs branches: 1.62.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.61 15-Nov-2014  christos branches: 1.61.20;
centralize the call unit / dialout macros
 1.60 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.59 19-Jun-2014  msaitoh fix -Werror=unused-but-set-variable compile error
 1.58 16-Mar-2014  dholland branches: 1.58.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.57 12-Dec-2012  tsutsui branches: 1.57.2;
Fix one more device/softc split error:
- set sc->sc_dev properly
 1.56 29-Oct-2012  chs fix device/softc split errors.
 1.55 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.54 02-Feb-2012  tls branches: 1.54.6;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.53 24-Apr-2011  rmind branches: 1.53.4; 1.53.8;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.52 14-Mar-2009  dsl branches: 1.52.4; 1.52.6;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.51 13-Jun-2008  cegger branches: 1.51.4; 1.51.10;
use device_lookup_private to get softc
 1.50 28-Apr-2008  martin branches: 1.50.2; 1.50.4;
Remove clause 3 and 4 from TNF licenses
 1.49 19-Nov-2007  ad branches: 1.49.14; 1.49.16; 1.49.18;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.48 17-Oct-2007  garbled branches: 1.48.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.47 09-Jul-2007  ad branches: 1.47.8; 1.47.10; 1.47.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.46 04-Mar-2007  christos branches: 1.46.2; 1.46.4; 1.46.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.45 01-Oct-2006  elad branches: 1.45.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.44 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.43 23-Jul-2006  ad branches: 1.43.4; 1.43.6;
Use the LWP cached credentials where sane.
 1.42 14-May-2006  elad integrate kauth.
 1.41 07-Mar-2006  uebayasi branches: 1.41.2; 1.41.4;
* Don't define SET/CLR/ISSET locally.
* Avoid shadow in a pointer-to-function declaration.
 1.40 20-Feb-2006  thorpej branches: 1.40.2;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.39 11-Dec-2005  christos branches: 1.39.2; 1.39.4; 1.39.6;
merge ktrace-lwp.
 1.38 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.37 11-Mar-2005  matt branches: 1.37.4;
Don't compare scalars against NULL, use 0.
 1.36 13-Dec-2004  chs branches: 1.36.2; 1.36.4;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.35 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.34 15-Jul-2003  lukem __KERNEL_RCSID()
 1.33 23-Oct-2002  jdolecek branches: 1.33.6;
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.32 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.31 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.28 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.27 16-Aug-2002  msaitoh remove extra CRLF conversion
 1.26 19-May-2002  msaitoh branches: 1.26.4;
fix some overflow cases.
 1.25 28-Apr-2002  uch branches: 1.25.2;
Use "#define<tab>", white space nits.
 1.24 28-Apr-2002  msaitoh add missing softintr_establish() call.
 1.23 26-Apr-2002  msaitoh fix around PTR and PDR
 1.22 24-Mar-2002  uch Rework interrupt code.
+ Fully utilize SH SR.I[0:3] interrupt level.
+ software interrupt is emulated by TMU1, 2 one shot interrupt.
+ implement generic soft interrupts.
+ implement clockframe correctly.
 1.21 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.20 24-Feb-2002  uch use sh_clock_get_pclock() instead of PCLOCK.
 1.19 22-Feb-2002  uch New NetBSD/sh3 clock framework.
+ hardclock source is moved from TMU1 to TMU0.
+ SH3/SH4 common kernel support.
+ PCLOCK estimation.
+ remove duplicated code.
 1.18 12-Feb-2002  uch ANSIfy KNF.
 1.17 01-Feb-2002  uch if PCLOCK isn't setted, use estimated value calculated by kernel.
 1.16 10-Sep-2001  msaitoh add missing check for framing error
 1.15 12-Jun-2001  wiz branches: 1.15.2; 1.15.4;
receive, not recieve
 1.14 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.13 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.12 14-Jan-2001  thorpej branches: 1.12.2;
Rename __GENERIC_SOFT_INTERRUPTS to __HAVE_GENERIC_SOFT_INTERRUPTS,
and place the definition in <machine/types.h>. This can now be used
as a flag to indicate whether or not <machine/intr.h> can be included
to get the generic soft interrupt API.
 1.11 22-Nov-2000  msaitoh - fix \n conversion from \n\r to \r\n
- cleanup
 1.10 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.9 19-Jun-2000  msaitoh branches: 1.9.2;
clear ORER, FER and PER bit of the SCSSR reg.
(This bits aren't cleared automatically)
 1.8 27-Mar-2000  msaitoh branches: 1.8.2;
fix the sci[f]cninit() bugs to work both SCI and SCIF at the same time.
 1.7 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.6 22-Feb-2000  msaitoh bugfixes:
o SCI accesses SCI registers (not SCIF) correctly
o If there is serial inputs in boot time, it could hangup in interrupt routine
o some cleanups(KNF)
 1.5 07-Jan-2000  msaitoh implement send/recieve break signal routines
 1.4 17-Sep-1999  msaitoh branches: 1.4.2;
check SCI(F)CONSOLE
 1.3 16-Sep-1999  msaitoh sync with sci*.h and tmureg.h
 1.2 13-Sep-1999  msaitoh add some comments.
 1.1 13-Sep-1999  itojun Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.4.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.4.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.4.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.4.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.8.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.2.1 30-Sep-2001  he Pull up revisions 1.11,1.15 (requested by msaitoh):
Fix \n conversion from \n\r to \r\n, and some cleanup.
 1.12.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.15.4.3 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.15.4.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.15.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.15.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.15.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.15.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.15.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.25.2.3 31-Aug-2002  gehenna catch up with -current.
 1.25.2.2 30-May-2002  gehenna Catch up with -current.
 1.25.2.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.26.4.5 11-Nov-2002  nathanw Catch up to -current
 1.26.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.26.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.26.4.2 27-Aug-2002  nathanw Catch up to -current.
 1.26.4.1 19-May-2002  nathanw file sci.c was added on branch nathanw_sa on 2002-08-27 23:45:23 +0000
 1.33.6.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.6.6 01-Apr-2005  skrll Sync with HEAD.
 1.33.6.5 25-Jan-2005  skrll Adapt to branch.
 1.33.6.4 18-Dec-2004  skrll Sync with HEAD.
 1.33.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.33.6.1 03-Aug-2004  skrll Sync with HEAD
 1.36.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.36.2.1 29-Apr-2005  kent sync with -current
 1.37.4.4 07-Dec-2007  yamt sync with head
 1.37.4.3 03-Sep-2007  yamt sync with head.
 1.37.4.2 30-Dec-2006  yamt sync with head.
 1.37.4.1 21-Jun-2006  yamt sync with head.
 1.39.6.2 01-Jun-2006  kardel Sync with head.
 1.39.6.1 22-Apr-2006  simonb Sync with head.
 1.39.4.1 09-Sep-2006  rpaulo sync with head
 1.39.2.1 01-Mar-2006  yamt sync with head.
 1.40.2.3 11-Aug-2006  yamt sync with head
 1.40.2.2 24-May-2006  yamt sync with head.
 1.40.2.1 13-Mar-2006  yamt sync with head.
 1.41.4.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.41.2.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.41.2.3 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.41.2.2 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.41.2.1 07-Mar-2006  elad file sci.c was added on branch elad-kernelauth on 2006-03-08 00:43:13 +0000
 1.43.6.1 22-Oct-2006  yamt sync with head
 1.43.4.1 18-Nov-2006  ad Sync with head.
 1.45.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.46.10.1 03-Oct-2007  garbled Sync with HEAD
 1.46.4.1 11-Jul-2007  mjf Sync with head.
 1.46.2.3 03-Dec-2007  ad Sync with HEAD.
 1.46.2.2 15-Jul-2007  ad Sync with head.
 1.46.2.1 01-Jul-2007  ad Adapt to callout API change.
 1.47.14.1 21-Nov-2007  bouyer Sync with HEAD
 1.47.10.2 09-Jan-2008  matt sync with HEAD
 1.47.10.1 06-Nov-2007  matt sync with HEAD
 1.47.8.1 21-Nov-2007  joerg Sync with HEAD.
 1.48.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.49.18.2 04-May-2009  yamt sync with head.
 1.49.18.1 16-May-2008  yamt sync with head.
 1.49.16.2 17-Jun-2008  yamt sync with head.
 1.49.16.1 18-May-2008  yamt sync with head.
 1.49.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.49.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.50.4.1 18-Jun-2008  simonb Sync with head.
 1.50.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.51.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.51.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.52.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.52.4.1 31-May-2011  rmind sync with head
 1.53.8.1 18-Feb-2012  mrg merge to -current.
 1.53.4.4 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.53.4.3 16-Jan-2013  yamt sync with (a bit old) head
 1.53.4.2 30-Oct-2012  yamt sync with head
 1.53.4.1 17-Apr-2012  yamt sync with head
 1.54.6.4 03-Dec-2017  jdolecek update from HEAD
 1.54.6.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.54.6.2 25-Feb-2013  tls resync with head
 1.54.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.57.2.1 18-May-2014  rmind sync with head
 1.58.2.1 10-Aug-2014  tls Rebase.
 1.61.20.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.62.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.70 16-Sep-2023  andvar sh3/scif(4): redefine DPRINTF again, not all SH ports has machine/debug.h.
Those are defined for hpc only.

unbreaks build for evbsh some kernel configs and SFIC_DEBUG still builds.
 1.69 15-Sep-2023  andvar sh3/scif(4): replace undefined scifstatus with DPRINTF.

fixes the build with SCIF_DEBUG enabled.
 1.68 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.67 10-Nov-2019  chs branches: 1.67.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.66 06-Dec-2015  tsutsui branches: 1.66.18;
Make options SCIFCONSOLE patchable via a variable using gdb(1) etc.

Tested on dreamcast.
 1.65 15-Nov-2014  christos branches: 1.65.2;
centralize the call unit / dialout macros
 1.64 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.63 16-Mar-2014  dholland branches: 1.63.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.62 09-Nov-2013  christos fixed unused variable warning
 1.61 02-Feb-2012  tls branches: 1.61.6; 1.61.10;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.60 24-Apr-2011  rmind branches: 1.60.4; 1.60.8;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.59 05-Apr-2009  uwe branches: 1.59.4; 1.59.6;
Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.
 1.58 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.57 28-Apr-2008  martin branches: 1.57.8; 1.57.14;
Remove clause 3 and 4 from TNF licenses
 1.56 27-Mar-2008  uwe branches: 1.56.2; 1.56.4;
Split device_t and softc.
 1.55 03-Dec-2007  ad branches: 1.55.14;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.54 19-Nov-2007  ad - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.53 06-Nov-2007  uwe Misc cleanup: use device_* and aprint_*, group declarations, g/c some
dead code, etc.
 1.52 17-Oct-2007  garbled branches: 1.52.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.51 09-Jul-2007  ad branches: 1.51.8; 1.51.10; 1.51.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.50 04-Mar-2007  christos branches: 1.50.2; 1.50.4; 1.50.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.49 01-Oct-2006  elad branches: 1.49.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.48 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.47 23-Jul-2006  ad branches: 1.47.4; 1.47.6;
Use the LWP cached credentials where sane.
 1.46 14-May-2006  elad integrate kauth.
 1.45 06-Mar-2006  he branches: 1.45.2; 1.45.4;
Remove yet another instance of the SET/CLR/ISSET macro triplet, now
that they are in <sys/types.h>.
 1.44 20-Feb-2006  thorpej branches: 1.44.2;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.43 23-Jan-2006  uwe branches: 1.43.2; 1.43.4;
Pacify -Wuninitialized for SH3 && SH4 case.
 1.42 11-Dec-2005  christos branches: 1.42.2;
merge ktrace-lwp.
 1.41 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.40 29-Jun-2005  christos branches: 1.40.2;
Need 2ms delay (from nonaka's landisk port).
 1.39 31-May-2005  uwe Fix shadowing.
 1.38 13-Dec-2004  chs for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.37 19-Oct-2004  uwe First step towards bus_space - wrap register accesses into macros.
Same object code is generated.
 1.36 19-Oct-2004  uwe KNF cosmetic. Same object code is generated.
Use continue for explicit empty loop body.
Use for (;;) instead of while (1).
Fix an indentation glitch.
 1.35 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.34 15-Jul-2003  lukem __KERNEL_RCSID()
 1.33 23-Oct-2002  jdolecek branches: 1.33.6;
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.32 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.31 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.28 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.27 16-Aug-2002  msaitoh remove extra CRLF conversion
 1.26 19-May-2002  msaitoh branches: 1.26.4;
fix some overflow cases.
 1.25 28-Apr-2002  uch branches: 1.25.2;
Use "#define<tab>", white space nits.
 1.24 24-Mar-2002  uch Rework interrupt code.
+ Fully utilize SH SR.I[0:3] interrupt level.
+ software interrupt is emulated by TMU1, 2 one shot interrupt.
+ implement generic soft interrupts.
+ implement clockframe correctly.
 1.23 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.22 02-Mar-2002  uch Initial support for KGDB on the sh3.
 1.21 22-Feb-2002  uch New NetBSD/sh3 clock framework.
+ hardclock source is moved from TMU1 to TMU0.
+ SH3/SH4 common kernel support.
+ PCLOCK estimation.
+ remove duplicated code.
 1.20 12-Feb-2002  uch ANSIfy KNF.
 1.19 01-Feb-2002  uch if PCLOCK isn't setted, use estimated value calculated by kernel.
 1.18 12-Jun-2001  wiz branches: 1.18.2; 1.18.4;
receive, not recieve
 1.17 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.16 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.15 14-Jan-2001  thorpej branches: 1.15.2;
Rename __GENERIC_SOFT_INTERRUPTS to __HAVE_GENERIC_SOFT_INTERRUPTS,
and place the definition in <machine/types.h>. This can now be used
as a flag to indicate whether or not <machine/intr.h> can be included
to get the generic soft interrupt API.
 1.14 22-Nov-2000  msaitoh - fix \n conversion from \n\r to \r\n
- cleanup
 1.13 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.12 31-Oct-2000  msaitoh - fix error handing in getc.
Now we can handle BREAK signal and framing error correctly.

- cleanup.
 1.11 11-Jul-2000  msaitoh callout()->callout_reset()
 1.10 19-Jun-2000  msaitoh branches: 1.10.2;
clear the ER bit of the SCSSR2 reg.
(This bit isn't cleared automatically)
 1.9 27-Mar-2000  msaitoh branches: 1.9.2;
fix the sci[f]cninit() bugs to work both SCI and SCIF at the same time.
 1.8 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.7 22-Feb-2000  msaitoh bugfixes:
o SCI accesses SCI registers (not SCIF) correctly
o If there is serial inputs in boot time, it could hangup in interrupt routine
o some cleanups(KNF)
 1.6 07-Jan-2000  msaitoh implement send/recieve break signal routines
 1.5 06-Oct-1999  msaitoh branches: 1.5.2;
- unset RS/CS flow control bit from default setting
- GC
 1.4 17-Sep-1999  msaitoh branches: 1.4.2;
check SCI(F)CONSOLE
 1.3 16-Sep-1999  msaitoh sync with sci*.h and tmureg.h
 1.2 13-Sep-1999  msaitoh add some comments.
 1.1 13-Sep-1999  itojun Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.5.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.5.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.2.3 30-Sep-2001  he Pull up revisions 1.14,1.18 (requested by msaitoh):
Fix \n conversion from \n\r to \r\n, and some cleanup.
 1.10.2.2 05-Nov-2000  tv Pullup 1.12 [msaitoh]:
fix error handing in getc
We can handle BREAK signal and framing error correctly.
 1.10.2.1 08-Aug-2000  msaitoh Pull up revision 1.11 (approved by thorpej):

fix old callout interface to new callout interface (callout_reset())
 1.15.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.18.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.18.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.18.2.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.18.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.18.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.18.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.18.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.25.2.3 31-Aug-2002  gehenna catch up with -current.
 1.25.2.2 30-May-2002  gehenna Catch up with -current.
 1.25.2.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.26.4.5 11-Nov-2002  nathanw Catch up to -current
 1.26.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.26.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.26.4.2 27-Aug-2002  nathanw Catch up to -current.
 1.26.4.1 19-May-2002  nathanw file scif.c was added on branch nathanw_sa on 2002-08-27 23:45:23 +0000
 1.33.6.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.6.6 17-Jan-2005  skrll Adapt to branch.
 1.33.6.5 18-Dec-2004  skrll Sync with HEAD.
 1.33.6.4 19-Oct-2004  skrll Sync with HEAD
 1.33.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.33.6.1 03-Aug-2004  skrll Sync with HEAD
 1.40.2.5 07-Dec-2007  yamt sync with head
 1.40.2.4 15-Nov-2007  yamt sync with head.
 1.40.2.3 03-Sep-2007  yamt sync with head.
 1.40.2.2 30-Dec-2006  yamt sync with head.
 1.40.2.1 21-Jun-2006  yamt sync with head.
 1.42.2.2 01-Mar-2006  yamt sync with head.
 1.42.2.1 01-Feb-2006  yamt sync with head.
 1.43.4.2 01-Jun-2006  kardel Sync with head.
 1.43.4.1 22-Apr-2006  simonb Sync with head.
 1.43.2.1 09-Sep-2006  rpaulo sync with head
 1.44.2.3 11-Aug-2006  yamt sync with head
 1.44.2.2 24-May-2006  yamt sync with head.
 1.44.2.1 13-Mar-2006  yamt sync with head.
 1.45.4.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.45.2.3 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.45.2.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.45.2.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.47.6.1 22-Oct-2006  yamt sync with head
 1.47.4.1 18-Nov-2006  ad Sync with head.
 1.49.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.50.10.1 03-Oct-2007  garbled Sync with HEAD
 1.50.4.1 11-Jul-2007  mjf Sync with head.
 1.50.2.2 03-Dec-2007  ad Sync with HEAD.
 1.50.2.1 15-Jul-2007  ad Sync with head.
 1.51.14.2 21-Nov-2007  bouyer Sync with HEAD
 1.51.14.1 13-Nov-2007  bouyer Sync with HEAD
 1.51.10.2 09-Jan-2008  matt sync with HEAD
 1.51.10.1 06-Nov-2007  matt sync with HEAD
 1.51.8.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.51.8.2 21-Nov-2007  joerg Sync with HEAD.
 1.51.8.1 06-Nov-2007  joerg Sync with HEAD.
 1.52.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.52.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.55.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.55.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.56.4.2 04-May-2009  yamt sync with head.
 1.56.4.1 16-May-2008  yamt sync with head.
 1.56.2.1 18-May-2008  yamt sync with head.
 1.57.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.57.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.59.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.59.4.1 31-May-2011  rmind sync with head
 1.60.8.1 18-Feb-2012  mrg merge to -current.
 1.60.4.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.60.4.1 17-Apr-2012  yamt sync with head
 1.61.10.1 18-May-2014  rmind sync with head
 1.61.6.2 03-Dec-2017  jdolecek update from HEAD
 1.61.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.63.2.1 10-Aug-2014  tls Rebase.
 1.65.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.66.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.67.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.2 02-Mar-2002  uch branches: 1.2.10;
Initial support for KGDB on the sh3.
 1.1 24-Feb-2000  msaitoh branches: 1.1.6; 1.1.10;
global variable declaration
 1.1.10.1 16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 24-Feb-2000  bouyer file scifvar.h was added on branch thorpej_scsipi on 2000-11-20 20:24:28 +0000
 1.2.10.2 02-Mar-2002  uch Initial support for KGDB on the sh3.
 1.2.10.1 02-Mar-2002  uch file scifvar.h was added on branch nathanw_sa on 2002-03-02 22:26:28 +0000
 1.1 24-Feb-2000  msaitoh branches: 1.1.6;
global variable declaration
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 24-Feb-2000  bouyer file scivar.h was added on branch thorpej_scsipi on 2000-11-20 20:24:28 +0000
 1.16 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.15 24-Apr-2021  thorpej branches: 1.15.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.14 05-Apr-2009  uwe branches: 1.14.78;
Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.
 1.13 28-Apr-2008  martin branches: 1.13.8; 1.13.14;
Remove clause 3 and 4 from TNF licenses
 1.12 27-Mar-2008  uwe branches: 1.12.2; 1.12.4;
Use device_t, &c. Convert to use CFATTACH_DECL_NEW (no softc).
 1.11 29-Oct-2006  uwe branches: 1.11.52;
Lift extern shb_cd declaration to the top level.
Make all routines static.
 1.10 11-Dec-2005  christos branches: 1.10.20; 1.10.22;
merge ktrace-lwp.
 1.9 26-Aug-2005  drochner s/locdesc_t/int/g
 1.8 30-Jun-2005  drochner branches: 1.8.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 02-Oct-2002  thorpej branches: 1.6.6;
Add trailing ; to CFATTACH_DECL.
 1.5 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.2 28-Apr-2002  uch branches: 1.2.6; 1.2.8;
Use "#define<tab>", white space nits.
 1.1 24-Mar-2002  uch shb device is integrated to sh3/dev/shb.c and clean up locators.
 1.2.8.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1 28-Apr-2002  jdolecek file shb.c was added on branch kqueue on 2002-06-23 17:40:35 +0000
 1.2.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.6.1 28-Apr-2002  nathanw file shb.c was added on branch nathanw_sa on 2002-10-18 02:39:43 +0000
 1.6.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.8.2.2 30-Dec-2006  yamt sync with head.
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.10.22.1 10-Dec-2006  yamt sync with head.
 1.10.20.1 18-Nov-2006  ad Sync with head.
 1.11.52.2 02-Jun-2008  mjf Sync with HEAD.
 1.11.52.1 03-Apr-2008  mjf Sync with HEAD.
 1.12.4.2 04-May-2009  yamt sync with head.
 1.12.4.1 16-May-2008  yamt sync with head.
 1.12.2.1 18-May-2008  yamt sync with head.
 1.13.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.14.78.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.14.78.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.14.78.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.14.78.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.14.78.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

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

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.15.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.23 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.22 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.21 24-Apr-2021  thorpej branches: 1.21.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.20 07-Jul-2020  thorpej branches: 1.20.4;
Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
Provide a new resource provider API:

==> pciconf_resource_init() -- Initialize a PCI configuration resources
container.
==> pciconf_resource_add() -- Add a PCI configuration resource to the
container (I/O, MEM, or prefetchable MEM). Multiple resources of
each type may be added.
==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
container once the bus has been configured.

This is much easier to use than the previous method of providing an
extent map for each kind of resource, and works better for e.g. ACPI
platforms that provide potentially multiple PCI resources in tables
provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
rather than extent maps.
 1.19 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.18 02-Oct-2015  msaitoh PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.17 27-Jan-2012  para branches: 1.17.6; 1.17.24;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.16 21-Jan-2012  nonaka fix my license notice.
 1.15 01-Jul-2011  dyoung branches: 1.15.2; 1.15.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 17-May-2011  dyoung PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name. Correct that.

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

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

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
 1.13 02-Aug-2009  nonaka branches: 1.13.4; 1.13.6;
fix build failure.
 1.12 27-Mar-2008  uwe branches: 1.12.4; 1.12.14; 1.12.22;
Convert to use CFATTACH_DECL_NEW (no softc).
 1.11 06-Nov-2007  uwe branches: 1.11.14;
Get rid of local product table, instead just match id register and
pci_devinfo(). While here, convert to device_t, aprint_*.
 1.10 24-Dec-2005  perry branches: 1.10.30; 1.10.48; 1.10.50; 1.10.54; 1.10.56;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 16-Aug-2005  nonaka Added SH7751{,R} integrated PCI controller support.
 1.7 24-Mar-2002  uch branches: 1.7.4; 1.7.10; 1.7.16;
mmeye specific devices are moved to mmeye/dev
 1.6 12-Feb-2002  uch ANSIfy KNF.
 1.5 15-Dec-2001  soren To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.4 29-Jun-2000  mrg branches: 1.4.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.3 20-Apr-2000  tsubai Fill paa_busname field in pcmciabus_attach_args.
 1.2 14-Sep-1999  tsubai branches: 1.2.2;
Catch up with -current.
 1.1 13-Sep-1999  itojun Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.2.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.16.2 15-Nov-2007  yamt sync with head.
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.7.10.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.4.2 24-Mar-2002  uch mmeye specific devices are moved to mmeye/dev
 1.7.4.1 24-Mar-2002  uch file shpcic.c was added on branch nathanw_sa on 2002-03-24 18:08:44 +0000
 1.10.56.1 19-Nov-2007  mjf Sync with HEAD.
 1.10.54.1 13-Nov-2007  bouyer Sync with HEAD
 1.10.50.1 06-Nov-2007  matt sync with HEAD
 1.10.48.1 06-Nov-2007  joerg Sync with HEAD.
 1.10.30.1 03-Dec-2007  ad Sync with HEAD.
 1.11.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.12.22.1 21-Apr-2010  matt sync to netbsd-5
 1.12.14.1 04-Oct-2009  snj Pull up following revision(s) (requested by mrg in ticket #1063):
sys/arch/landisk/dev/obio.c: revision 1.7
sys/arch/landisk/include/bus.h: revision 1.5
sys/arch/landisk/landisk/shpcic_machdep.c: revision 1.2
sys/arch/sh3/dev/shpcic.c: revision 1.13
sys/arch/sh3/dev/shpcicvar.h: revision 1.7
fix build failure.
 1.12.4.1 19-Aug-2009  yamt sync with head.
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 31-May-2011  rmind sync with head
 1.15.6.1 18-Feb-2012  mrg merge to -current.
 1.15.2.1 17-Apr-2012  yamt sync with head
 1.17.24.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.17.6.1 03-Dec-2017  jdolecek update from HEAD
 1.20.4.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.21.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 24-Mar-2002  uch branches: 1.2.4;
mmeye specific devices are moved to mmeye/dev
 1.1 13-Sep-1999  itojun branches: 1.1.16;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.16.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.4.2 24-Mar-2002  uch mmeye specific devices are moved to mmeye/dev
 1.2.4.1 24-Mar-2002  uch file shpcicreg.h was added on branch nathanw_sa on 2002-03-24 18:08:43 +0000
 1.9 21-Jan-2012  nonaka fix my license notice.
 1.8 01-Jul-2011  dyoung branches: 1.8.2; 1.8.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.7 02-Aug-2009  nonaka fix build failure.
 1.6 11-Dec-2005  christos branches: 1.6.78; 1.6.88; 1.6.96;
merge ktrace-lwp.
 1.5 16-Aug-2005  nonaka Added SH7751{,R} integrated PCI controller support.
 1.4 24-Mar-2002  uch branches: 1.4.4; 1.4.10; 1.4.16;
mmeye specific devices are moved to mmeye/dev
 1.3 12-Feb-2002  uch ANSIfy KNF.
 1.2 15-Dec-2001  soren To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.1 13-Sep-1999  itojun branches: 1.1.16;
Merge in NetBSD/sh3 from cvs.kame.net repository.

Tree structure:
- sys/arch/sh3: sh3 generic code
As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
 1.1.16.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.16.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.4.10.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.4.2 24-Mar-2002  uch mmeye specific devices are moved to mmeye/dev
 1.4.4.1 24-Mar-2002  uch file shpcicvar.h was added on branch nathanw_sa on 2002-03-24 18:08:43 +0000
 1.6.96.1 21-Apr-2010  matt sync to netbsd-5
 1.6.88.1 04-Oct-2009  snj Pull up following revision(s) (requested by mrg in ticket #1063):
sys/arch/landisk/dev/obio.c: revision 1.7
sys/arch/landisk/include/bus.h: revision 1.5
sys/arch/landisk/landisk/shpcic_machdep.c: revision 1.2
sys/arch/sh3/dev/shpcic.c: revision 1.13
sys/arch/sh3/dev/shpcicvar.h: revision 1.7
fix build failure.
 1.6.78.1 19-Aug-2009  yamt sync with head.
 1.8.6.1 18-Feb-2012  mrg merge to -current.
 1.8.2.1 17-Apr-2012  yamt sync with head
 1.20 27-Jan-2025  andvar s/probeing/probing/ in comments.
 1.19 20-Dec-2023  thorpej branches: 1.19.2;
Remove unnecessary <sys/malloc.h>.
 1.18 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.17 16-Mar-2014  dholland branches: 1.17.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.16 27-Mar-2008  uwe branches: 1.16.38; 1.16.48; 1.16.54;
Split device_t and softc.
 1.15 04-Mar-2007  christos branches: 1.15.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 11-Dec-2005  christos branches: 1.14.26;
merge ktrace-lwp.
 1.13 15-Jul-2003  lukem branches: 1.13.16;
__KERNEL_RCSID()
 1.12 23-Oct-2002  jdolecek branches: 1.12.6;
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.11 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.10 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.7 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.6 24-Mar-2002  uch branches: 1.6.2; 1.6.6;
Rework interrupt code.
+ Fully utilize SH SR.I[0:3] interrupt level.
+ software interrupt is emulated by TMU1, 2 one shot interrupt.
+ implement generic soft interrupts.
+ implement clockframe correctly.
 1.5 12-Feb-2002  uch ANSIfy KNF.
 1.4 31-Oct-2000  msaitoh branches: 1.4.2; 1.4.4; 1.4.6;
add interrupt mode into wdog

To use:

ioctl(fd, SIOWDOGSETMODE, &val)

val: WDOGM_RESET -> reset when counter expired
WDOGM_INTR -> print PC when counter expired (new!)

This interface is still under experimental.
 1.3 20-Apr-2000  msaitoh remove a debug log
 1.2 24-Feb-2000  msaitoh add RCSID and copyright
 1.1 24-Feb-2000  msaitoh watchdog timer
 1.4.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.4.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.6.1 16-Mar-2002  jdolecek Catch up with -current.
 1.4.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.4.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.4.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.2.1 31-Oct-2000  bouyer file wdog.c was added on branch thorpej_scsipi on 2000-11-20 20:24:28 +0000
 1.6.6.4 11-Nov-2002  nathanw Catch up to -current
 1.6.6.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.6.2 17-Sep-2002  nathanw Catch up to -current.
 1.6.6.1 24-Mar-2002  nathanw file wdog.c was added on branch nathanw_sa on 2002-09-17 21:17:24 +0000
 1.6.2.1 17-May-2002  gehenna Add device switch.
 1.12.6.4 24-Jan-2005  skrll Adapt to branch.
 1.12.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.6.1 03-Aug-2004  skrll Sync with HEAD
 1.13.16.2 03-Sep-2007  yamt sync with head.
 1.13.16.1 21-Jun-2006  yamt sync with head.
 1.14.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.16.54.1 18-May-2014  rmind sync with head
 1.16.48.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.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.17.2.1 10-Aug-2014  tls Rebase.
 1.19.2.1 02-Aug-2025  perseant Sync with HEAD

RSS XML Feed