Home | History | Annotate | only in /src/sys/dev/ofw
History log of /src/sys/dev/ofw
RevisionDateAuthorComments
 1.5 11-Apr-2001  jdolecek Put back all header files defining ioctls
 1.4 11-Apr-2001  jdolecek Only install headers which are actually used by our userland. This
saves about 2.2MB under /usr/include/dev/. Discussed on tech-kern@
recently.

I HOPE to get the list right. The headers I left in are ones
used for MI tools and those whose usage I discovered by grep over tree sources.
Feel free to put needed includes back in if you encounter anything which
should not be removed from lists.
 1.3 14-Nov-2000  matt branches: 1.3.2;
Add openfirmio which is an ioctl interface to OpenFirmware.
 1.2 04-May-1999  thorpej branches: 1.2.2;
Define some things related to the PCI Bus binding to OpenFirmware.
 1.1 12-Jun-1998  cgd branches: 1.1.8;
Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.1.8.1 06-May-1999  perry branches: 1.1.8.1.2;
pullup 1.1->1.2 (thorpej)
 1.1.8.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.2.2.1 22-Nov-2000  bouyer Sync with HEAD.
 1.3.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.18 14-Sep-2025  thorpej Make SPI direct configuration less #ifdef'y. No more checking what kind
of platform device tree; instead, use a device call to enumerate the
direct config children of the bus.
 1.17 12-May-2021  thorpej - Define a device call for PCI bus instances to fetch a direct child's
device handle given the device's device/function #s (extracted from
a pcitag_t). Use it to associate the handle with the child device
at config_found() time.
- Implement this device call for ACPI and OpenFirmware.
- Enable the OpenFirmware variant for evbarm FDT, macppc, ofppc, sparc64.
- Obsolete acpi_device_register(); it is no longer needed.
- Obsolete setting the OpenFirmware handle in PCI devices in the
sparc64 device_register(); it is no longer needed.
 1.16 04-Feb-2021  thorpej branches: 1.16.4; 1.16.6;
Split the i2c and spi stuff out into their own files.
 1.15 03-Apr-2020  macallan branches: 1.15.4;
make OpenFirmware info available via sysctl.ofw
tested on macppc, shark and sparc64
 1.14 16-Dec-2015  jmcneill branches: 1.14.18;
fix FDT build without openfirm pseudo-device
 1.13 08-Jan-2007  macallan branches: 1.13.90; 1.13.110;
pull in ofw_subr.c with openfirm so we can use stuff like of_compatible()
without ofbus
 1.12 27-Sep-2002  thorpej branches: 1.12.22; 1.12.52; 1.12.58;
Fix a latent bug uncovered by the new autoconfiguration code: make
sure the "ofbus" device carries the "ofbus" interface attribute.

This is the other part of the fix for PR #18433.
 1.11 14-Nov-2000  matt branches: 1.11.2; 1.11.4;
Add openfirmio which is an ioctl interface to OpenFirmware.
 1.10 24-Mar-2000  ws Update several ports to at least work again without IPKDB
after the update of that.
Sorry for breaking this with my last changes :-(.
Fixes PR#9671 by Lennart Augustsson.
 1.9 22-Jul-1998  thorpej branches: 1.9.14;
Add common OpenFirmware network interface functions. Currently supports
decoding the `supported-network-types' and `chosen-network-type' properties
into ifmedia words.
 1.8 24-Feb-1998  mycroft Several things:
Clean up the name space here a bit.
Add a `busname' element to struct ofprobe (now struct ofbus_attach_args), and
check against it.
Nuke `ofroot'.
Rename the `openfirm' attribute to `ofbus'.
 1.7 16-Feb-1998  thorpej Remove "class" declarations, and add "devclass" declarations where
appropriate. Fix several inconsistencies between device class and
attributes. Mostly from Chris Demetriou.
 1.6 26-Jan-1998  cgd add ofw_subr.c, a file containing common OFW routines.
 1.5 12-Jan-1998  thorpej Update for config changes.
 1.4 23-Jul-1997  thorpej RCS id police.
 1.3 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.2 16-Oct-1996  ws branches: 1.2.6;
Rename recently checked in KGDB to IPKDB to resolve conflicts with older KGDB
 1.1 30-Sep-1996  ws PowerPC port
 1.2.6.1 09-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.9.14.2 22-Nov-2000  bouyer Sync with HEAD.
 1.9.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.4.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.2.1 18-Oct-2002  nathanw Catch up to -current.
 1.12.58.1 04-Mar-2007  bouyer Pull up following revision(s) (requested by macallan in ticket #473):
sys/dev/ofw/files.ofw: revision 1.13
pull in ofw_subr.c with openfirm so we can use stuff like
of_compatible() without ofbus
 1.12.52.1 12-Jan-2007  ad Sync with head.
 1.12.22.1 26-Feb-2007  yamt sync with head.
 1.13.110.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.13.90.1 03-Dec-2017  jdolecek update from HEAD
 1.14.18.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.15.4.1 03-Apr-2021  thorpej Sync with HEAD.
 1.16.6.1 31-May-2021  cjep sync with head
 1.16.4.1 13-May-2021  thorpej Sync with HEAD.
 1.31 22-Jan-2022  thorpej Change the devhandle_from_*() functions to also take a "super handle",
from which the newly created handle will inherit it's implementation.
The root implementation for a new handle type is used if an invalid
"super handle" is passed.
 1.30 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.29 30-Apr-2021  thorpej branches: 1.29.6;
If we're enumerating the root bus, skip some well-known nodes that
don't have any useful device child nodes:

aliases
options
openprom
chosen
packages

...and also allow machdep additions to this list (XXX which are temporarily
declared here for arm32 until there's a consistent machine/ofw_machdep.h
header file).
 1.28 27-Apr-2021  thorpej If we are attaching the OFW root, print out the banner-name and model
properties, if they exist.
 1.27 24-Apr-2021  thorpej branches: 1.27.2;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.26 10-Mar-2017  macallan branches: 1.26.30;
attach display devices first so we see more kernel output on shark
 1.25 03-Jun-2011  matt branches: 1.25.12; 1.25.30; 1.25.34; 1.25.38;
-CFATTACH_DECL(foo, sizeof(struct device),
+CFATTACH_DECL_NEW(foo, 0,
 1.24 12-May-2009  cegger branches: 1.24.4; 1.24.6; 1.24.10;
struct device * -> device_t, no functional changes intended.
 1.23 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.22 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.21 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.20 11-Dec-2005  christos branches: 1.20.74; 1.20.84; 1.20.90;
merge ktrace-lwp.
 1.19 04-Feb-2005  perry de-__P
 1.18 22-Apr-2004  itojun branches: 1.18.4; 1.18.6;
sprintf -> snprintf
 1.17 01-Jan-2003  thorpej branches: 1.17.2;
Use aprint_normal() in cfprint routines.
 1.16 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.15 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 18-Sep-2002  chs implement device_register() for ofppc.
use ofcons_cnprobe().
 1.12 13-Nov-2001  lukem add RCSIDs
 1.11 22-Oct-2001  thorpej Remove hack to skip OFW nodes which don't correspond to devices. These
are generally only at the toplevel of the OFW tree, and are best handled
by the code that configures the toplevel (which often needs special
handling anyway).
 1.10 24-Feb-1998  mycroft branches: 1.10.26; 1.10.28;
Several things:
Clean up the name space here a bit.
Add a `busname' element to struct ofprobe (now struct ofbus_attach_args), and
check against it.
Nuke `ofroot'.
Rename the `openfirm' attribute to `ofbus'.
 1.9 03-Feb-1998  cgd s/of_nodename/of_packagename/. Eventually, we'll probably want something
similar for instances.
 1.8 03-Feb-1998  cgd in ofbattach(), don't both doing an ofbprint() by hand if the root node.
The old ofbprint() wasn't particularly good (it forced the root node
to have a 'name' property, which apparently violates the OFW spec), and
the new one (though it normally prints more useful information) has
nothing useful to say about the root node. It's not clear to me that
'ofroot' should exist at all.
 1.7 02-Feb-1998  cgd make ofbprint() use of_nodename(). cleanup.
 1.6 26-Jan-1998  cgd (1) kill ofnmmatch(); nothing used it (and it's not clear that
anything _should_ use it).
(2) in the child properties check, also check for 'compatible,' and
config_found() if the child has it.
 1.5 12-Jan-1998  thorpej Update for config changes.
 1.4 16-Apr-1997  thorpej Update for no __BROKEN_INDIRECT_CONFIG.
 1.3 13-Oct-1996  christos backout kprintf changes
 1.2 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 30-Sep-1996  ws PowerPC port
 1.10.28.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.10.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.26.4 03-Jan-2003  thorpej Sync with HEAD.
 1.10.26.3 18-Oct-2002  nathanw Catch up to -current.
 1.10.26.2 14-Nov-2001  nathanw Catch up to -current.
 1.10.26.1 22-Oct-2001  nathanw Catch up to -current.
 1.17.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.17.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.18.6.1 12-Feb-2005  yamt sync with head.
 1.18.4.1 29-Apr-2005  kent sync with -current
 1.20.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.84.1 28-Apr-2009  skrll Sync with HEAD.
 1.20.74.2 16-May-2009  yamt sync with head
 1.20.74.1 04-May-2009  yamt sync with head.
 1.24.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.24.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.24.4.1 12-Jun-2011  rmind sync with head
 1.25.38.1 21-Apr-2017  bouyer Sync with HEAD
 1.25.34.1 20-Mar-2017  pgoyette Sync with HEAD
 1.25.30.1 28-Aug-2017  skrll Sync with HEAD
 1.25.12.1 03-Dec-2017  jdolecek update from HEAD
 1.26.30.2 04-Apr-2021  thorpej Associate the OpenFirmware phandle associated with a found device (including
PCI bus instances) by using CFARG_DEVHANDLE.
 1.26.30.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.27.2.1 13-May-2021  thorpej Sync with HEAD.
 1.29.6.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.45 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.44 16-Mar-2014  dholland branches: 1.44.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.43 26-Jul-2011  mrg branches: 1.43.2; 1.43.12; 1.43.16;
convert to device_t, cfdata_t and CFATTACH_DECL_NEW.
 1.42 24-Apr-2011  rmind Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.41 29-May-2009  rjs branches: 1.41.4; 1.41.6;
Pass correct argument to q_to_b().
 1.40 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.39 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.38 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.37 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.36 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.35 03-Jan-2009  yamt branches: 1.35.2;
remove extra semicolons.
 1.34 12-Jun-2008  cegger branches: 1.34.4;
use device_lookup_private to get softc
 1.33 19-Nov-2007  ad branches: 1.33.14; 1.33.16; 1.33.18; 1.33.20; 1.33.22;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.32 18-Oct-2007  joerg branches: 1.32.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.31 09-Jul-2007  ad branches: 1.31.6; 1.31.8; 1.31.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.30 04-Mar-2007  christos branches: 1.30.2; 1.30.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.29 01-Oct-2006  elad branches: 1.29.4;
Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!

Also, add forgotten splx() calls in some places.
 1.28 21-Jul-2006  ad branches: 1.28.4; 1.28.6;
- Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.27 15-May-2006  yamt - include kauth.h for kauth_authorize_generic.
- whitespace.
 1.26 14-May-2006  elad integrate kauth.
 1.25 29-Mar-2006  thorpej Use device_private().
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10; 1.24.12;
merge ktrace-lwp.
 1.23 27-Feb-2005  perry branches: 1.23.4;
nuke trailing whitespace
 1.22 04-Feb-2005  perry de-__P
 1.21 23-Oct-2002  jdolecek branches: 1.21.6; 1.21.14; 1.21.16;
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.20 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.19 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.18 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.17 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.16 17-Mar-2002  atatat branches: 1.16.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.15 13-Nov-2001  lukem add RCSIDs
 1.14 25-Aug-2001  matt branches: 1.14.2;
Make this compile with -Wmissing-prototypes by adding appropriate
cdev_decl, bdev_decl, cons_decl
 1.13 02-May-2001  scw branches: 1.13.2;
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 02-Nov-2000  eeh branches: 1.12.2;
Adapt to the new line discipline scheme.
 1.11 14-Apr-2000  scw Fix some callout fallout. Hi Jason!
 1.10 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.9 21-Mar-1998  mycroft branches: 1.9.14;
Replace TS_WOPEN with t_wopen, per mail on tech-kern.
 1.8 24-Feb-1998  mycroft Several things:
Clean up the name space here a bit.
Add a `busname' element to struct ofprobe (now struct ofbus_attach_args), and
check against it.
Nuke `ofroot'.
Rename the `openfirm' attribute to `ofbus'.
 1.7 26-Jan-1998  cgd of_decode_int() the stdin and stdout properties.
 1.6 12-Jan-1998  thorpej Update for config changes.
 1.5 28-Apr-1997  mycroft DTRT if OF_read() returns 0 when no data is available.
 1.4 16-Apr-1997  thorpej Update for no __BROKEN_INDIRECT_CONFIG.
 1.3 13-Oct-1996  christos backout kprintf changes
 1.2 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 30-Sep-1996  ws PowerPC port
 1.9.14.2 22-Nov-2000  bouyer Sync with HEAD.
 1.9.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.2.7 11-Nov-2002  nathanw Catch up to -current
 1.12.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.12.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.12.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.12.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.12.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.12.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.13.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.13.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.13.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.14.2.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.14.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.16.4.1 16-May-2002  gehenna Add the character device switch.
Replace the direct-access to devsw table with calling devsw API.
 1.21.16.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.21.16.1 12-Feb-2005  yamt sync with head.
 1.21.14.1 29-Apr-2005  kent sync with -current
 1.21.6.3 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.6.2 04-Feb-2005  skrll Sync with HEAD.
 1.21.6.1 31-Jan-2005  skrll Adapt to branch.
 1.23.4.5 07-Dec-2007  yamt sync with head
 1.23.4.4 27-Oct-2007  yamt sync with head.
 1.23.4.3 03-Sep-2007  yamt sync with head.
 1.23.4.2 30-Dec-2006  yamt sync with head.
 1.23.4.1 21-Jun-2006  yamt sync with head.
 1.24.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.24.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.24.10.3 19-Apr-2006  elad sync with head.
 1.24.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.24.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.24.8.3 11-Aug-2006  yamt sync with head
 1.24.8.2 24-May-2006  yamt sync with head.
 1.24.8.1 01-Apr-2006  yamt sync with head.
 1.24.6.2 01-Jun-2006  kardel Sync with head.
 1.24.6.1 22-Apr-2006  simonb Sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.28.6.1 22-Oct-2006  yamt sync with head
 1.28.4.1 18-Nov-2006  ad Sync with head.
 1.29.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.4.1 11-Jul-2007  mjf Sync with head.
 1.30.2.2 23-Oct-2007  ad Sync with head.
 1.30.2.1 01-Jul-2007  ad Adapt to callout API change.
 1.31.12.2 21-Nov-2007  bouyer Sync with HEAD
 1.31.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.31.8.2 09-Jan-2008  matt sync with HEAD
 1.31.8.1 06-Nov-2007  matt sync with HEAD
 1.31.6.2 21-Nov-2007  joerg Sync with HEAD.
 1.31.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.32.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.33.22.1 18-Jun-2008  simonb Sync with head.
 1.33.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.33.18.3 20-Jun-2009  yamt sync with head
 1.33.18.2 16-May-2009  yamt sync with head
 1.33.18.1 04-May-2009  yamt sync with head.
 1.33.16.1 17-Jun-2008  yamt sync with head.
 1.33.14.2 17-Jan-2009  mjf Sync with HEAD.
 1.33.14.1 29-Jun-2008  mjf Sync with HEAD.
 1.34.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.34.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.35.2.2 23-Jul-2009  jym Sync with HEAD.
 1.35.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.41.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.41.4.1 31-May-2011  rmind sync with head
 1.43.16.1 18-May-2014  rmind sync with head
 1.43.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.43.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.44.2.1 10-Aug-2014  tls Rebase.
 1.54 26-Jan-2020  thorpej Fix __HAVE_OLD_DISKLABEL bits so they at least compile.
 1.53 27-Mar-2019  martin branches: 1.53.6;
Add a disk ioctl DIOCRMWEDGES to remove all wedges of a given disk
(if not busy).
 1.52 25-Mar-2017  martin branches: 1.52.6; 1.52.14;
Virtio block devices may have a "scsi" device_type instead of "block",
so accept both.
 1.51 26-Apr-2015  mlelstv branches: 1.51.2; 1.51.4;
Use C99-style initializers for struct dkdriver.
 1.50 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.49 31-Dec-2014  christos Centralize wedge ioctls in disk_ioctl.
 1.48 09-Nov-2014  mlelstv branches: 1.48.2;
support DIOCMWEDGES ioctl
 1.47 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.46 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.45 16-Mar-2014  dholland branches: 1.45.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.44 26-Jul-2011  mrg branches: 1.44.2; 1.44.12; 1.44.16;
convert to device_t, cfdata_t and CFATTACH_DECL_NEW.
 1.43 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.42 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.41 12-Jun-2008  cegger branches: 1.41.10;
use device_lookup_private to get softc
 1.40 08-Apr-2008  cegger branches: 1.40.2; 1.40.4; 1.40.6; 1.40.8;
use aprint_*_dev and device_xname
 1.39 17-Oct-2007  he branches: 1.39.16;
Correct the order of the arguments to disk_init().
 1.38 08-Oct-2007  ad branches: 1.38.2;
Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.37 29-Jul-2007  ad branches: 1.37.4; 1.37.6; 1.37.8; 1.37.10;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.36 21-Jul-2007  ad Replace some uses of lockmgr().
 1.35 04-Mar-2007  christos branches: 1.35.2; 1.35.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.34 29-Jan-2007  hubertf branches: 1.34.2;
Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
 1.33 29-Mar-2006  thorpej branches: 1.33.8;
Use device_private().
 1.32 11-Dec-2005  christos branches: 1.32.4; 1.32.6; 1.32.8; 1.32.10; 1.32.12;
merge ktrace-lwp.
 1.31 09-Jun-2005  he branches: 1.31.2;
Now that OF_read and OF_write have different signatures, we need to
cast one of them before assigning to a common function pointer.
Yes, this breaks strict type checking, but is needed to compile with
-Wcast-qual turned on.
 1.30 27-Feb-2005  perry nuke trailing whitespace
 1.29 25-Sep-2004  thorpej branches: 1.29.4; 1.29.6;
Add support for wedges to the OpenFirmware disk driver.
 1.28 23-Apr-2004  itojun use safer string manipulation function
 1.27 10-May-2003  thorpej branches: 1.27.2;
Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.26 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.25 01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.24 23-Oct-2002  jdolecek merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.22 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.21 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20 18-Sep-2002  chs fix error checking in ofdisk_open().
remove all vesitages of dk_establish().
 1.19 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.18 13-Nov-2001  lukem branches: 1.18.8;
add RCSIDs
 1.17 26-Aug-2001  matt branches: 1.17.2;
Make compile with -Wmissing-prototype -Wstrict-prototypes
 1.16 25-Aug-2001  matt Make this compile with -Wmissing-prototypes by adding appropriate
cdev_decl, bdev_decl, cons_decl
 1.15 08-Jan-2001  fvdl branches: 1.15.2; 1.15.4;
Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
 1.14 07-Jan-2001  fvdl Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
 1.13 16-May-2000  thorpej branches: 1.13.4;
Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
 1.12 21-Mar-1998  cgd branches: 1.12.14;
-Wall (one real bug, even!)
 1.11 24-Feb-1998  mycroft Minor style change.
 1.10 24-Feb-1998  mycroft Several things:
Clean up the name space here a bit.
Add a `busname' element to struct ofprobe (now struct ofbus_attach_args), and
check against it.
Nuke `ofroot'.
Rename the `openfirm' attribute to `ofbus'.
 1.9 12-Jan-1998  thorpej Update for config changes.
 1.8 08-Oct-1997  thorpej Oops, fix a couple of typos.
 1.7 08-Oct-1997  thorpej Implement DIOCGDEFLABEL.
 1.6 23-Jul-1997  thorpej branches: 1.6.2;
Fix an oversight and a typo.
 1.5 24-Jun-1997  thorpej Three changes to ofdsize():
- If the partition is already open, skip the open/close step. (Sync
with other disk drivers.)
- foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
- Pass correct arguments to ofdopen() and ofdclose().
 1.4 16-Apr-1997  thorpej - Update for no __BROKEN_INDIRECT_CONFIG.
- Determine and remember if we are a floppy.
- Workaround for what is apparently a firmware bug - ignore the sector
size returned by the device. On my Firepower's floppy, block-size
is the same as max-transfer, which causes Lossage.
- Don't read the disklabel on a floppy; do what the ISA floppy driver
does, which is assign the entire disk to each "partition", although
we do not deal with the density stuff.
- FIREPOWERBUGS -> FIRMWORKSBUGS
- Some general cleanup.
 1.3 13-Oct-1996  christos backout kprintf changes
 1.2 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 30-Sep-1996  ws PowerPC port
 1.6.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.14.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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.13.4.1 01-May-2001  he Pull up revisions 1.14-1.15 (requested by fvdl):
Increase the number of BSD disklabel partitions on i386 to 16.
 1.15.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.15.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.15.2.7 11-Nov-2002  nathanw Catch up to -current
 1.15.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.15.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.15.2.4 10-Jul-2002  nathanw Need curproc as parameter to ofdisk_{open,close}().
 1.15.2.3 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.15.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.15.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.17.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.18.8.1 16-May-2002  gehenna Add the block/character device switches.
 1.27.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.27.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.27.2.5 31-Jan-2005  skrll Adapt to branch.
 1.27.2.4 19-Oct-2004  skrll Sync with HEAD
 1.27.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.27.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.27.2.1 03-Aug-2004  skrll Sync with HEAD
 1.29.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.29.4.1 29-Apr-2005  kent sync with -current
 1.31.2.4 27-Oct-2007  yamt sync with head.
 1.31.2.3 03-Sep-2007  yamt sync with head.
 1.31.2.2 26-Feb-2007  yamt sync with head.
 1.31.2.1 21-Jun-2006  yamt sync with head.
 1.32.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.32.10.1 19-Apr-2006  elad sync with head.
 1.32.8.1 01-Apr-2006  yamt sync with head.
 1.32.6.1 22-Apr-2006  simonb Sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.33.8.1 01-Feb-2007  ad Sync with head.
 1.34.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.35.10.1 15-Aug-2007  skrll Sync with HEAD.
 1.35.2.3 23-Oct-2007  ad Sync with head.
 1.35.2.2 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.35.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.37.10.2 29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.37.10.1 29-Jul-2007  ad file ofdisk.c was added on branch matt-mips64 on 2007-07-29 12:15:44 +0000
 1.37.8.2 18-Oct-2007  yamt sync with head.
 1.37.8.1 14-Oct-2007  yamt sync with head.
 1.37.6.1 06-Nov-2007  matt sync with HEAD
 1.37.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.38.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.39.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.39.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.40.8.1 18-Jun-2008  simonb Sync with head.
 1.40.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.40.4.2 16-May-2009  yamt sync with head
 1.40.4.1 04-May-2009  yamt sync with head.
 1.40.2.1 17-Jun-2008  yamt sync with head.
 1.41.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.44.16.1 18-May-2014  rmind sync with head
 1.44.12.2 03-Dec-2017  jdolecek update from HEAD
 1.44.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.44.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.45.2.1 10-Aug-2014  tls Rebase.
 1.48.2.3 28-Aug-2017  skrll Sync with HEAD
 1.48.2.2 06-Jun-2015  skrll Sync with HEAD
 1.48.2.1 06-Apr-2015  skrll Sync with HEAD
 1.51.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.51.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.52.14.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.52.14.1 10-Jun-2019  christos Sync with HEAD
 1.52.6.1 05-Apr-2019  msaitoh Pull up following revision(s) (requested by martin in ticket #1223):
sys/sys/dkio.h: revision 1.25
sys/kern/subr_disk.c: revision 1.123
sys/dev/dksubr.c: revision 1.107
sys/dev/ccd.c: revision 1.179
sys/dev/ofw/ofdisk.c: revision 1.53
Add a disk ioctl DIOCRMWEDGES to remove all wedges of a given disk
(if not busy).
 1.53.6.1 29-Feb-2020  ad Sync with head.
 1.63 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.62 05-Feb-2019  msaitoh branches: 1.62.6;
Remove very old IFF_NOTRAILERS flag.
 1.61 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.60 15-Jul-2018  maxv Retire ipkdb entirely. The option was removed from the config files
yesterday.

ok kamil christos
 1.59 26-Jun-2018  msaitoh branches: 1.59.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.58 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.57 15-Dec-2016  ozaki-r branches: 1.57.8; 1.57.14;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.56 02-Oct-2016  christos MFREE -> m_free
 1.55 10-Jun-2016  ozaki-r branches: 1.55.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.54 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.53 27-Oct-2012  chs branches: 1.53.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.52 26-Jul-2011  mrg branches: 1.52.2; 1.52.12;
convert to device_t, cfdata_t and CFATTACH_DECL_NEW.
 1.51 08-Aug-2010  chs remove an unused variable.
 1.50 05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.49 19-Jan-2010  pooka branches: 1.49.2; 1.49.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.48 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.47 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.46 18-Apr-2009  tsutsui Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.45 20-Mar-2009  cegger Correct bungled bcopy() -> memcpy() conversion
 1.44 18-Mar-2009  cegger bcopy -> memcpy
 1.43 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.42 07-Nov-2008  dyoung branches: 1.42.4;
*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.41 08-Apr-2008  cegger branches: 1.41.4; 1.41.10; 1.41.12;
use aprint_*_dev and device_xname
 1.40 09-Jul-2007  ad branches: 1.40.28;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.39 08-Mar-2007  matt branches: 1.39.2; 1.39.4;
Fix more caddr_t -> void * lossage
 1.38 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 14-May-2006  elad branches: 1.37.14;
integrate kauth.
 1.36 29-Mar-2006  thorpej Use device_private().
 1.35 28-Mar-2006  thorpej Use device_unit().
 1.34 11-Dec-2005  christos branches: 1.34.4; 1.34.6; 1.34.8; 1.34.10; 1.34.12;
merge ktrace-lwp.
 1.33 27-Feb-2005  perry branches: 1.33.4;
nuke trailing whitespace
 1.32 30-Jan-2005  thorpej Eliminate use of M_HASFCS. Use a buffer large enough to receive a
full-length Ethernet frame.
 1.31 15-Jan-2003  bouyer branches: 1.31.2; 1.31.10; 1.31.12;
Zero out the buffer when padding packet to ETHER_MIN_LEN-ETHER_CRC_LEN
 1.30 22-Oct-2002  chs in ofnet_read(), interpret returns of either -2 or 0 from OF_read() as
meaning that there is no packet available. the OF spec reportedly
says that it's supposed to return 0 in this case, but my Firepower box
uses -2, so this is probably another of those FIRMWORKSBUGS things.
we'll accept both values in any case.
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.26 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.25 18-Sep-2002  chs use splnet() around the body of ofnet_read(). this is logically the
receive interrupt handler since it passes received packets to the
interface's input handler. that ends up scheduling a network softint
and queuing the packet on the interface's receive queue (in that order),
so if softnet isn't blocked at this point then softnet() doesn't find
the packet until it's triggered again by something else.
remove all vesitages of dk_establish().
 1.24 05-Mar-2002  itojun branches: 1.24.8;
bring in latest ALTQ from kjc. ALTQify some of the drivers.
 1.23 13-Nov-2001  lukem add RCSIDs
 1.22 20-Oct-2001  billc FCS check and padding for minimum size Ethernet packet
 1.21 26-Aug-2001  matt Make compile with -Wmissing-prototype -Wstrict-prototypes
 1.20 15-Nov-2000  thorpej branches: 1.20.2; 1.20.4;
Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.19 16-May-2000  thorpej Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
 1.18 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.17 18-May-1999  thorpej branches: 1.17.2;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.16 04-May-1999  thorpej Make this compile again.
 1.15 05-Jul-1998  jonathan branches: 1.15.6; 1.15.10;
defopt INET, NETATALK.
 1.14 10-Jun-1998  tv Missing include <sys/systm.h>.
 1.13 24-Feb-1998  mycroft Several things:
Clean up the name space here a bit.
Add a `busname' element to struct ofprobe (now struct ofbus_attach_args), and
check against it.
Nuke `ofroot'.
Rename the `openfirm' attribute to `ofbus'.
 1.12 27-Jan-1998  cgd Make sure the data after the Ethernet header is aligned. (It's been
in the Shark source tree for a while, but Jason's recent commit to
dp8390.c spurred me to check it in here.)
XXX Assumes the device is an ethernet, but then so does other code in
this driver.
 1.11 22-Jan-1998  cgd fix typo: s/max-address/mac-address/
 1.10 12-Jan-1998  thorpej Update for config changes.
 1.9 28-Apr-1997  mycroft Oops; forgot to GC the last mbuf allocated when out of clusters.
Also, DTRT if OF_read() returns 0 when no data is available..
 1.8 24-Apr-1997  mycroft Fix typo in previous.
 1.7 24-Apr-1997  mycroft If we fail to allocate a cluster to hold a large packet, simply
drop it rather than using a chain of tiny mbufs.
 1.6 16-Apr-1997  thorpej - Update for no __BROKEN_INDIRECT_CONFIG.
- Fix BPF hooks.
 1.5 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.4 16-Oct-1996  ws branches: 1.4.6;
Rename recently checked in KGDB to IPKDB to resolve conflicts with older KGDB
 1.3 13-Oct-1996  christos backout kprintf changes
 1.2 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 30-Sep-1996  ws PowerPC port
 1.4.6.2 09-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.4.6.1 03-Mar-1997  is Convert to the new world order.
 1.15.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.15.6.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.17.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.17.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.20.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.20.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.20.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.20.2.7 17-Jan-2003  thorpej Sync with HEAD.
 1.20.2.6 11-Nov-2002  nathanw Catch up to -current
 1.20.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.20.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.20.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.20.2.2 22-Oct-2001  nathanw Catch up to -current.
 1.20.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.24.8.1 27-Jan-2003  jmc Pullup revisions 1.30-1.31 (requested by bouyer in ticket #1091)
Zero out the buffer when padding packet to ETHER_MIN_LEN-ETHER_CRC_LEN
 1.31.12.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.31.12.1 12-Feb-2005  yamt sync with head.
 1.31.10.1 29-Apr-2005  kent sync with -current
 1.31.2.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.31.2.1 04-Feb-2005  skrll Sync with HEAD.
 1.33.4.2 03-Sep-2007  yamt sync with head.
 1.33.4.1 21-Jun-2006  yamt sync with head.
 1.34.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.34.10.1 19-Apr-2006  elad sync with head.
 1.34.8.1 01-Apr-2006  yamt sync with head.
 1.34.6.1 22-Apr-2006  simonb Sync with head.
 1.34.4.1 09-Sep-2006  rpaulo sync with head
 1.37.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.39.4.1 11-Jul-2007  mjf Sync with head.
 1.39.2.1 01-Jul-2007  ad Adapt to callout API change.
 1.40.28.2 17-Jan-2009  mjf Sync with HEAD.
 1.40.28.1 02-Jun-2008  mjf Sync with HEAD.
 1.41.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.41.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.41.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.41.4.4 11-Aug-2010  yamt sync with head.
 1.41.4.3 11-Mar-2010  yamt sync with head
 1.41.4.2 16-May-2009  yamt sync with head
 1.41.4.1 04-May-2009  yamt sync with head.
 1.42.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.49.4.2 05-Mar-2011  rmind sync with head
 1.49.4.1 30-May-2010  rmind sync with head
 1.49.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.49.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.52.12.2 03-Dec-2017  jdolecek update from HEAD
 1.52.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.52.2.1 30-Oct-2012  yamt sync with head
 1.53.14.4 05-Feb-2017  skrll Sync with HEAD
 1.53.14.3 05-Oct-2016  skrll Sync with HEAD
 1.53.14.2 09-Jul-2016  skrll Sync with HEAD
 1.53.14.1 19-Mar-2016  skrll Sync with HEAD
 1.55.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.55.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.57.14.3 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.57.14.2 28-Jul-2018  pgoyette Sync with HEAD
 1.57.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.57.8.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.59.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.59.2.1 10-Jun-2019  christos Sync with HEAD
 1.62.6.1 29-Feb-2020  ad Sync with head.
 1.24 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.23 26-Jul-2011  mrg convert to device_t, cfdata_t and CFATTACH_DECL_NEW.
 1.22 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.21 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.20 13-Sep-2006  gdamore branches: 1.20.54; 1.20.70;
Convert shark and ofppc to new common ofrtc and MI todr code. Tested
on shark. Ok christos@, martin@.
 1.19 29-Mar-2006  thorpej branches: 1.19.8;
Use device_private().
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10; 1.18.12;
merge ktrace-lwp.
 1.17 27-Feb-2005  perry branches: 1.17.4;
nuke trailing whitespace
 1.16 04-Feb-2005  perry de-__P
 1.15 23-Oct-2002  jdolecek branches: 1.15.6; 1.15.14; 1.15.16;
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.14 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.13 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.11 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.10 13-Nov-2001  lukem branches: 1.10.8;
add RCSIDs
 1.9 26-Aug-2001  matt branches: 1.9.2;
Make compile with -Wmissing-prototype -Wstrict-prototypes
 1.8 25-Aug-2001  matt Make this compile with -Wmissing-prototypes by adding appropriate
cdev_decl, bdev_decl, cons_decl
 1.7 21-Mar-1998  cgd branches: 1.7.26; 1.7.28;
-Wall
 1.6 24-Feb-1998  mycroft Several things:
Clean up the name space here a bit.
Add a `busname' element to struct ofprobe (now struct ofbus_attach_args), and
check against it.
Nuke `ofroot'.
Rename the `openfirm' attribute to `ofbus'.
 1.5 12-Jan-1998  thorpej Update for config changes.
 1.4 16-Apr-1997  thorpej Update for no __BROKEN_INDIRECT_CONFIG.
 1.3 13-Oct-1996  christos backout kprintf changes
 1.2 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 30-Sep-1996  ws PowerPC port
 1.7.28.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.7.28.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.28.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.7.26.5 11-Nov-2002  nathanw Catch up to -current
 1.7.26.4 18-Oct-2002  nathanw Catch up to -current.
 1.7.26.3 17-Sep-2002  nathanw Catch up to -current.
 1.7.26.2 14-Nov-2001  nathanw Catch up to -current.
 1.7.26.1 21-Sep-2001  nathanw Catch up to -current.
 1.9.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.10.8.1 16-May-2002  gehenna Add the character device switch.
 1.15.16.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.15.16.1 12-Feb-2005  yamt sync with head.
 1.15.14.1 29-Apr-2005  kent sync with -current
 1.15.6.3 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.6.2 04-Feb-2005  skrll Sync with HEAD.
 1.15.6.1 31-Jan-2005  skrll Adapt to branch.
 1.17.4.2 30-Dec-2006  yamt sync with head.
 1.17.4.1 21-Jun-2006  yamt sync with head.
 1.18.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.18.10.1 19-Apr-2006  elad sync with head.
 1.18.8.2 14-Sep-2006  yamt sync with head.
 1.18.8.1 01-Apr-2006  yamt sync with head.
 1.18.6.1 22-Apr-2006  simonb Sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.19.8.1 18-Nov-2006  ad Sync with head.
 1.20.70.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.54.1 16-May-2009  yamt sync with head
 1.3 18-Sep-2025  thorpej In the "i2c-child-devices" array, don't pass in a "cookie" and "cookietype".
Instead, just create the appropriate devhandle and pass that along as a
data object.
 1.2 16-Sep-2025  thorpej As with ACPI, iic_attach() now fetches the child device array directly
in the FDT case. Adjust the OFW case so that we're not forced to indirect
through a dictionary if it's not needed.
 1.1 04-Feb-2021  thorpej branches: 1.1.4; 1.1.6; 1.1.16;
Split the i2c and spi stuff out into their own files.
 1.1.16.4 11-Sep-2021  thorpej Building on the previous, some Sun OpenFirmware device trees have a
similar schema (e.g. /pci/pmu@6/i2c@0,0), but use a slightly different
name ("i2c" vs "i2c-bus"). Handle this.
 1.1.16.3 11-Sep-2021  thorpej The Device Tree bindings state that if a controller has a
child node named "i2c-bus", then that is the node beneath
which the child devices are populated.
 1.1.16.2 10-Sep-2021  thorpej Remove unnecessary references to i2c_attach_args::ia_prop and mark the ones
that remain as XXX.
 1.1.16.1 09-Aug-2021  thorpej Port over the changes from thorpej-i2c-spi-conf to thorpej-i2c-spi-conf2,
which is based on a newer HEAD revision.
 1.1.6.9 08-Aug-2021  thorpej If OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY, ensure that clist_size
is not negative for the call to kmem_tmpbuf_alloc().
 1.1.6.8 18-May-2021  thorpej There is no code of DEC lineage in this file.
 1.1.6.7 14-May-2021  thorpej Do that again, but slightly differently: a "compatible" property is
required by the Device Tree i2c bindings, and is present on all of
the Sun i2c device nodes that are useful (the notable exception being
the i2c "idprom" nodes, which are actually duplicates of a regular
serial eeprom node). However, Apple's older OpenFirmware implementations
are rife with i2c nodes that lack a "compatible" property. So, define
a OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY quirk, and enable it in
the __HAVE_OPENFIRMWARE_VARIANT_AAPL case.
 1.1.6.6 14-May-2021  thorpej Ooops, no, revert that.
 1.1.6.5 14-May-2021  thorpej Skip nodes without a "compatible" property.
 1.1.6.4 14-May-2021  thorpej Define __HAVE_OPENFIRMWARE_VARIANT_SUNW for sparc64 systems and handle
its OpenFirmware quirks with respect to i2c:

- "reg" property is 2 cells, the first one containing the channel the
device is on, the second one containing the i2c device address.
- The i2c device address is shifted left 1 bit to account for the r/w
bit on the wire.
 1.1.6.3 14-May-2021  thorpej Deal with quirks / differences in OpenFirmware implementations'
interpreation of the i2c "reg" property by embedding knowledge
of those quicks directly, rather than forcing lots of drivers
to provide their own devhandle implementations. We default to
assuming the Device Tree bindings, and tweak based on platform-
specific #ifdefs.

Start with __HAVE_OPENFIRMWARE_VARIANT_AAPL (all i2c "reg" properties
encode an address that's shifted left 1 bit to account for the R/W bit
that appears on the wire).
 1.1.6.2 08-May-2021  thorpej There are no more consumers of i2c attach args "cookie" and "cookietype",
so garbage-collect them.
 1.1.6.1 25-Apr-2021  thorpej Implement "i2c-enumerate-devices" for OFW / FDT.
 1.1.4.2 03-Apr-2021  thorpej Sync with HEAD.
 1.1.4.1 04-Feb-2021  thorpej file ofw_i2c_subr.c was added on branch thorpej-futex on 2021-04-03 22:28:45 +0000
 1.1 18-Oct-2025  thorpej Add OpenFirmware property information from the September 23, 1996 draft
ISA Bus Bindings document for IEEE Std 1275-1994.

(These definitions also match what the Shark OpenFirmware implementation
uses.)
 1.10 27-Jan-2021  thorpej Use DEVICE_COMPAT_EOL.
 1.9 24-Jan-2021  thorpej Rewrite of_network_decode_media() to use strlist_next() and
device_compatible_lookup().
 1.8 29-May-2019  msaitoh branches: 1.8.10;
KNF. No functional change.
 1.7 14-Mar-2009  dsl branches: 1.7.64;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.6 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.5 28-Apr-2008  martin branches: 1.5.8; 1.5.14;
Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.70; 1.4.72; 1.4.74;
merge ktrace-lwp.
 1.3 04-Feb-2005  perry de-__P
 1.2 13-Nov-2001  lukem branches: 1.2.16; 1.2.24; 1.2.26;
add RCSIDs
 1.1 22-Jul-1998  thorpej branches: 1.1.26; 1.1.28;
Add common OpenFirmware network interface functions. Currently supports
decoding the `supported-network-types' and `chosen-network-type' properties
into ifmedia words.
 1.1.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.26.1 14-Nov-2001  nathanw Catch up to -current.
 1.2.26.1 12-Feb-2005  yamt sync with head.
 1.2.24.1 29-Apr-2005  kent sync with -current
 1.2.16.1 04-Feb-2005  skrll Sync with HEAD.
 1.4.74.2 04-May-2009  yamt sync with head.
 1.4.74.1 16-May-2008  yamt sync with head.
 1.4.72.1 18-May-2008  yamt sync with head.
 1.4.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.64.1 10-Jun-2019  christos Sync with HEAD
 1.8.10.1 03-Apr-2021  thorpej Sync with HEAD.
 1.8 18-Oct-2025  thorpej u_int32_t -> uint32_t
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.70; 1.6.72; 1.6.74;
merge ktrace-lwp.
 1.5 22-Oct-2003  mjl Typo in comment. From OpenBSD.
 1.4 17-Feb-2001  mrg branches: 1.4.24;
add OFW_PCI_PHYS_HI_BUS()
 1.3 16-Feb-2001  mrg expand this a little further to include defines of:
OFW_PCI_PHYS_HI_DEVICE() - extract PCI device from phys_hi
OFW_PCI_PHYS_HI_FUNCTION() - extract PCI function from phys_hi
and the definition of `struct ofw_pci_register'.
 1.2 05-May-1999  tsubai branches: 1.2.2; 1.2.6; 1.2.8;
Fix OFW_PCI_PHYS_HI_DEVICEMASK value.
 1.1 04-May-1999  thorpej Define some things related to the PCI Bus binding to OpenFirmware.
 1.2.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.2.6.2 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.2.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.2.2.2 05-May-1999  tsubai Fix OFW_PCI_PHYS_HI_DEVICEMASK value.
 1.2.2.1 05-May-1999  tsubai file ofw_pci.h was added on branch netbsd-1-4 on 1999-05-05 08:09:35 +0000
 1.4.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.24.1 03-Aug-2004  skrll Sync with HEAD
 1.6.74.1 16-May-2008  yamt sync with head.
 1.6.72.1 18-May-2008  yamt sync with head.
 1.6.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.3 22-Jan-2022  thorpej Change the devhandle_from_*() functions to also take a "super handle",
from which the newly created handle will inherit it's implementation.
The root implementation for a new handle type is used if an invalid
"super handle" is passed.
 1.2 15-Sep-2021  thorpej Adjust the device_call() calling convention so as to provide type checking
of the arguments passed to the call, using auto-generated argument
structures and binding macros.
 1.1 12-May-2021  thorpej branches: 1.1.2; 1.1.4;
- Define a device call for PCI bus instances to fetch a direct child's
device handle given the device's device/function #s (extracted from
a pcitag_t). Use it to associate the handle with the child device
at config_found() time.
- Implement this device call for ACPI and OpenFirmware.
- Enable the OpenFirmware variant for evbarm FDT, macppc, ofppc, sparc64.
- Obsolete acpi_device_register(); it is no longer needed.
- Obsolete setting the OpenFirmware handle in PCI devices in the
sparc64 device_register(); it is no longer needed.
 1.1.4.2 31-May-2021  cjep sync with head
 1.1.4.1 12-May-2021  cjep file ofw_pci_subr.c was added on branch cjep_staticlib_x on 2021-05-31 22:15:18 +0000
 1.1.2.2 13-May-2021  thorpej Sync with HEAD.
 1.1.2.1 12-May-2021  thorpej file ofw_pci_subr.c was added on branch thorpej-i2c-spi-conf on 2021-05-13 00:47:31 +0000
 1.4 14-Sep-2025  thorpej Make SPI direct configuration less #ifdef'y. No more checking what kind
of platform device tree; instead, use a device call to enumerate the
direct config children of the bus.
 1.3 10-Sep-2025  thorpej Do the #address-cells dance inside of_copy_spi_devs(), and make calling
it a bit simpler.
 1.2 10-Sep-2025  thorpej Remove pointless containment of SPI device array inside a dictionary
that never gets passed on to anyone.
 1.1 04-Feb-2021  thorpej branches: 1.1.4; 1.1.6; 1.1.16;
Split the i2c and spi stuff out into their own files.
 1.1.16.1 09-Aug-2021  thorpej Port over the changes from thorpej-i2c-spi-conf to thorpej-i2c-spi-conf2,
which is based on a newer HEAD revision.
 1.1.6.1 18-May-2021  thorpej Define a "spi-enumerate-devices" device call and use it for direct
configuration of SPI devices, rather than slinging arrays of dictionaries
around. Implement this device call for OpenFirmware / FDT, following
the SPI bindings for Device Tree.
 1.1.4.2 03-Apr-2021  thorpej Sync with HEAD.
 1.1.4.1 04-Feb-2021  thorpej file ofw_spi_subr.c was added on branch thorpej-futex on 2021-04-03 22:28:45 +0000
 1.62 04-Oct-2025  thorpej Add a platform device tree passthrough for device properties. First,
the device's properties dictionary is consulted, and if it doesn't have
what we're looking for, we go ask the platform device tree. The upshot
is that we can g/c (or not have to add) code that duplicates values from
the device tree into the properties dictionary (either in something like
device_register() or in a driver attachment front-end -- there are multiple
example of both in the system, currently), and everyone gets to use a
consistent interface (which will, over time, allow more code to de-duplicated).

Implement back-ends for ACPI, Sun OpenBoot, and OpenFirmware (including FDT).
 1.61 03-Oct-2025  thorpej Add a device_register() hook for the platform device tree. For ACPI and
OpenFirmware (including FDT), use this to record the firmware path to
the device in the "device-path" property.
 1.60 22-Jan-2022  thorpej Change the devhandle_from_*() functions to also take a "super handle",
from which the newly created handle will inherit it's implementation.
The root implementation for a new handle type is used if an invalid
"super handle" is passed.
 1.59 15-Sep-2021  thorpej Adjust the device_call() calling convention so as to provide type checking
of the arguments passed to the call, using auto-generated argument
structures and binding macros.
 1.58 24-Apr-2021  thorpej Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.57 05-Feb-2021  thorpej branches: 1.57.2;
OpenFirmware device handle implementation.
 1.56 04-Feb-2021  thorpej Split the i2c and spi stuff out into their own files.
 1.55 27-Jan-2021  thorpej G/C of_match_compatible().
 1.54 27-Jan-2021  thorpej Rename of_match_compat_data() to of_compatible_match(). Similarly,
rename of_search_compatible() to of_compatible_lookup().

Standardize on of_compatible_match() for driver matching, and adapt
all call sites.
 1.53 26-Jan-2021  thorpej Replace use of of_match_compatible().
 1.52 26-Jan-2021  thorpej There is not much point in of_compatible() returning -1 for "no match"
and >= 0 for "match". Just make it return 0 for "no match" and >0 for
"match" so it can be treated like a boolean expression.

As such of_match_compatible() (a wrapper around of_compatible()) is now
obsolete, and will be removed once all call sites are converted to an
appropriate replacement.
 1.51 26-Jan-2021  thorpej Minor comment changes.
 1.50 25-Jan-2021  mrg s/boolean_t/bool/. boolean_t is obsolete (from Mach), and this
also fixes a new build issue in libkvm on sparc*.
 1.49 25-Jan-2021  jmcneill Add "cookietype" to i2c attach args, so the consumer knows if ia_cookie
is either an OF phandle or an ACPI_HANDLE. Add NXP0002 compatible mapping
while here.
 1.48 24-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.47 24-Jan-2021  thorpej Rewrite of_compatible() using strlist_match().
 1.46 24-Jan-2021  thorpej Implement of_match_compat_data() using device_compatible_match_strlist().
Implement of_search_compatible() using device_compatible_lookup_strlist().
 1.45 24-Jan-2021  thorpej Update a comment.
 1.44 24-Jan-2021  thorpej Change of_search_compable() to return NULL on no-match, which is much more
sensible than the previous behavior. As such, back out rev 1.7 of
sunxi_sramc.c. All other of_search_compable() call sites have been audited.
 1.43 20-Jan-2021  jmcneill update comment to match new reality
 1.42 18-Jan-2021  thorpej Remove "struct of_compat_data" and replace its usage with
"struct device_compatible_entry"; they are ABI-compatible.

Fix several "loses const qualifier" bugs encountered during
this conversion.
 1.41 31-Dec-2020  ryo add of_getprop_uint32_array()
 1.40 16-Jul-2020  jmcneill branches: 1.40.2;
Add of_find_bycompat helper to search a tree for a node by compat string.
 1.39 26-Jun-2020  martin Remove !cold KASSERT - it does not compile on all kernels, and it is not the
right thing to test for anyway. XXX should we panic instead? Are "compatible"
strings this long happening in real devices?
 1.38 25-Jun-2020  rin Fix fallout from migration from alloca() to malloc() in the previous.

of_compatible() is used at least for macppc in very early boot stage
where malloc() is still not available.

Therefore, for small (<= OFW_MAX_STACK_BUF_SIZE = 256) buffer, use
statically allocated one in the stack. For larger one, we continue to
use malloc() but KASSERT(!cold) is added for sure.

Fix boot failure for macppc reported by martin:
http://mail-index.netbsd.org/port-macppc/2020/06/25/msg002756.html
 1.37 25-Jun-2020  jdolecek no need for alloca() in of_compatible(), malloc() is fine
 1.36 12-Jun-2020  thorpej Update for proplib(3) API changes.
 1.35 11-Jun-2020  thorpej Update for proplib(3) API changes.
 1.34 06-Aug-2019  tnn ofw: add of_enter_spi_devs helper method

For translating OFW child nodes of SPI controller into "spi-child-devices"
property. In similar spirit to the existing of_enter_i2c_devs method.
 1.33 26-Sep-2018  jakllsch Set "i2c-indirect-config" to false in the right place so that iic(4)
better behaves itself.
 1.32 23-Aug-2018  jmcneill Add of_getprop_uint64
 1.31 26-Jun-2018  thorpej branches: 1.31.2;
In of_enter_i2c_devs(), we no longer need to set a "size" property
for a couple of models of Atmel EEPROMs because the driver can figure
this out on its own now (based on the same "compatible" criteria that
we're using).
 1.30 03-Jul-2017  jmcneill branches: 1.30.4;
Add of_match_compat_data.

This routine searches an array of compat_data structures for a
matching "compatible" entry matching the supplied OFW node.
 1.29 30-Jun-2017  jmcneill Add of_search_compatible, which searches an array of compat_data structures
for a matching "compatible" entry matching the supplied OFW node. This
allows us to associate data with compatible strings.
 1.28 30-Apr-2017  jmcneill branches: 1.28.2;
Rename of_getprop_bool to of_hasprop and make of_getprop_bool an alias.
 1.27 16-Dec-2015  jmcneill branches: 1.27.8;
add of_getprop_bool and of_getprop_uint32 helpers
 1.26 13-Dec-2015  jmcneill add an addr_shift parameter to of_enter_i2c_devs
 1.25 13-Dec-2015  jmcneill OF properties are stored in big endian, but the host might not be. Swap
the value of the "reg" property where appropriate.
 1.24 12-Dec-2015  jmcneill Change the meaning of of_compatible return values >= 0. Previously, the
function would return the index of the matching compatibility string in
the "strings" parameter on success. None of the callers in tree use this,
so instead change the function to return a reverse index of the matching
compatibility string in the phandle's "compatible" property. The result is
that the function will return a higher number for earlier "compatible"
matches.

Add a new of_match_compatible() that simply returns of_compatible() + 1,
for use in driver match functions.
 1.23 25-Oct-2013  jdc branches: 1.23.6;
Add "i2c-at34c02" AT34C02 EEPROM. This is compatible with the AT24C02
EEPROM, apart from software write protection (not supported in our driver).
 1.22 24-Sep-2013  jdc Add a property "i2c-indirect-config" to allow/disallow i2c indirect config.
If missing, "allowed" is assumed. Set it to false for OFW machines.
Patch from martin@. Removes erroneous i2c probe messages that appeared with
wildcard support.
 1.21 08-Feb-2013  jdc branches: 1.21.2;
Set the size for EEPROM's that we know about ("i2c-at24c64" is set to 8192).
Allows seeprom(4) to attach correctly, when combined with the direct
configuration support there.
 1.20 03-Feb-2013  jdc The i2c bus number (0 or 1) is encoded in bit 33 of the register for a node,
but we encode it in bit 8 of i2c_addr_t. If bit 33 is set, unset it and
set bit 9 instead (we later shift by one bit).
 1.19 02-Nov-2012  jdc Only create the "i2c-child-devices" property if we actually found any
child devices (rather than unconditionally).
Allows indirect config of i2c busses to work (e,g. for Tadpole SPARCle).
 1.18 28-Feb-2010  martin branches: 1.18.10; 1.18.20;
Interpret the "reg" property of i2c nodes more liberal, and depending
on the cell size in use.
I have been unable to find any documents about the i2c bindings for OF,
so this is all pretty much voodoo.
 1.17 28-Feb-2010  martin Supporting cast for i2c direct configuration on OF machines
 1.16 21-Jan-2010  martin branches: 1.16.2;
fix a ref counting leak
 1.15 11-Nov-2009  macallan add another convenience function - of_get_mode_string() to extract a Sun-like
video mode specifier from output-device
 1.14 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.13 07-Nov-2007  garbled branches: 1.13.18; 1.13.26; 1.13.32;
Add three new MI functions taken from macppc/autoconf.c:
of_getnode_byname(): Finds a node named X
of_to_uint32_prop(): sets an uint32_t prop_t from an OFW property
of_to_dataprop(): sets a data prop_t from an OFW property

These looked more generally useful, and seemed like something other
OFW-capable machines might want to take advantage of.
 1.12 25-Oct-2007  garbled branches: 1.12.2;
Add a new convenience function, of_find_firstchild_byname(), and apply
some minor KNF to this ofw_subr.c.
 1.11 11-Dec-2005  christos branches: 1.11.44; 1.11.46; 1.11.50;
merge ktrace-lwp.
 1.10 27-Feb-2005  perry branches: 1.10.4;
nuke trailing whitespace
 1.9 22-Apr-2004  itojun branches: 1.9.4; 1.9.6;
sprintf -> snprintf
 1.8 06-Jan-2003  wiz branches: 1.8.2;
compatibility, not compatiblity.
 1.7 13-Nov-2001  lukem add RCSIDs
 1.6 13-Mar-2000  soren branches: 1.6.6; 1.6.8;
Fix doubled 'the's in comments.
 1.5 24-Feb-1998  mycroft branches: 1.5.14;
Forcibly NUL-terminate the path name, just to be sure.
 1.4 03-Feb-1998  cgd s/of_nodename/of_packagename/. Eventually, we'll probably want something
similar for instances.
 1.3 02-Feb-1998  cgd add of_nodename(), a function to stuff the last component of a node's
name into a caller-provided buffer (helpful for generating
autoconfiguration output). Also, other minor cleanup.
 1.2 28-Jan-1998  cgd clean up comments and includes. add an of_compatible() function
which checks for the presence of any of a set of caller-provided
strings in a node's "compatible" property (the _right_ way to
determine driver compatibility).
 1.1 26-Jan-1998  cgd new file containing common OFW-related routines. Right now just contains
of_decode_int(), a function which decodes OFW integer properties.
 1.5.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.6.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.6.2 07-Jan-2003  thorpej Sync with HEAD.
 1.6.6.1 14-Nov-2001  nathanw Catch up to -current.
 1.8.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.4.1 29-Apr-2005  kent sync with -current
 1.10.4.2 15-Nov-2007  yamt sync with head.
 1.10.4.1 27-Oct-2007  yamt sync with head.
 1.11.50.1 13-Nov-2007  bouyer Sync with HEAD
 1.11.46.2 08-Nov-2007  matt sync with -HEAD
 1.11.46.1 06-Nov-2007  matt sync with HEAD
 1.11.44.2 11-Nov-2007  joerg Sync with HEAD.
 1.11.44.1 28-Oct-2007  joerg Sync with HEAD.
 1.12.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.13.32.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.26.1 28-Apr-2009  skrll Sync with HEAD.
 1.13.18.2 11-Mar-2010  yamt sync with head
 1.13.18.1 04-May-2009  yamt sync with head.
 1.16.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.18.20.4 03-Dec-2017  jdolecek update from HEAD
 1.18.20.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.20.2 25-Feb-2013  tls resync with head
 1.18.20.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.10.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.18.10.1 16-Jan-2013  yamt sync with (a bit old) head
 1.21.2.1 18-May-2014  rmind sync with head
 1.23.6.2 28-Aug-2017  skrll Sync with HEAD
 1.23.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.27.8.1 02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.28.2.1 18-Jul-2017  snj Pull up following revision(s) (requested by jmcneill in ticket #114):
sys/arch/arm/samsung/exynos_intr.h: revision 1.3
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.1
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.2
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.3
sys/arch/arm/sunxi/sunxi_gates.c: revision 1.1
distrib/utils/embedded/mkimage: revision 1.66
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.4
sys/arch/arm/sunxi/sunxi_rsb.c: revision 1.1
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.5
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.6
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.7
sys/dev/gpio/gpio.c: revision 1.59
sys/arch/arm/sunxi/sunxi_ccu_prediv.c: revision 1.1
sys/conf/Makefile.kern.inc: revision 1.257
sys/arch/evbarm/conf/ODROID-XU_INSTALL: file removal
sys/arch/arm/sunxi/sunxi_ccu_prediv.c: revision 1.2
sys/conf/Makefile.kern.inc: revision 1.258
sys/arch/arm/fdt/psci_fdt.h: revision 1.1
sys/arch/arm/sunxi/sunxi_resets.c: revision 1.1
sys/arch/evbarm/conf/files.sunxi: revision 1.1
sys/arch/evbarm/fdt/fdt_machdep.c: revision 1.8
sys/arch/evbarm/fdt/fdt_machdep.c: revision 1.9
sys/arch/arm/samsung/files.exynos: revision 1.22
distrib/utils/embedded/conf/armv7.conf: revision 1.13
sys/arch/arm/samsung/files.exynos: revision 1.23
sys/arch/evbarm/conf/std.tegra: revision 1.15
distrib/utils/embedded/conf/armv7.conf: revision 1.14
sys/arch/arm/samsung/files.exynos: revision 1.24
distrib/utils/embedded/conf/armv7.conf: revision 1.15
sys/arch/evbarm/sunxi/genassym.cf: revision 1.1
sys/arch/arm/samsung/exynos_fdt.c: file removal
sys/dev/fdt/fdt_pinctrl.c: revision 1.4
sys/arch/arm/samsung/exynos_sysmmu.c: revision 1.2
sys/arch/arm/sunxi/sun8i_h3_gpio.c: revision 1.1
sys/arch/arm/sunxi/sunxi_twi.c: revision 1.1
sys/dev/usb/ehci.c: revision 1.255
sys/arch/arm/sunxi/sunxi_twi.c: revision 1.2
sys/arch/arm/sunxi/sun8i_a83t_ccu.h: revision 1.1
sys/dev/ic/dwc_mmc.c: revision 1.11
sys/arch/arm/cortex/gic.c: revision 1.24
distrib/evbarm/instkernel/ramdisk/Makefile: revision 1.17
etc/etc.evbarm/Makefile.inc: revision 1.87
etc/etc.evbarm/Makefile.inc: revision 1.88
sys/arch/arm/fdt/gic_fdt.c: revision 1.5
etc/Makefile: revision 1.429
sys/arch/arm/fdt/gic_fdt.c: revision 1.6
sys/arch/arm/fdt/gic_fdt.c: revision 1.7
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.1
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.2
sys/arch/evbarm/conf/std.sunxi: revision 1.1
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.3
sys/arch/evbarm/conf/std.sunxi: revision 1.2
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.4
sys/arch/evbarm/conf/std.sunxi: revision 1.3
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.5
sys/arch/arm/sunxi/sunxi_ccu_div.c: revision 1.1
sys/dev/gpio/gpiovar.h: revision 1.17
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.6
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.7
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.8
sys/arch/arm/sunxi/sunxi_rsb.h: revision 1.1
sys/arch/arm/samsung/exynos_i2c.c: revision 1.12
sys/dev/fdt/fdtvar.h: revision 1.21
sys/arch/evbarm/sunxi/sunxi_start.S: revision 1.1
sys/arch/arm/samsung/exynos_i2c.c: revision 1.13
sys/dev/fdt/fdtvar.h: revision 1.22
sys/arch/evbarm/conf/SUNXI: revision 1.10
sys/dev/fdt/fdtvar.h: revision 1.23
sys/arch/evbarm/conf/SUNXI: revision 1.11
sys/dev/fdt/gpioleds.c: revision 1.1
sys/dev/fdt/fdtvar.h: revision 1.24
sys/arch/evbarm/conf/SUNXI: revision 1.12
sys/arch/evbarm/conf/SUNXI: revision 1.13
sys/arch/arm/cortex/gic.c: revision 1.30
sys/arch/evbarm/conf/SUNXI: revision 1.14
sys/arch/evbarm/conf/SUNXI: revision 1.15
sys/arch/evbarm/conf/SUNXI: revision 1.16
sys/arch/arm/sunxi/sunxi_emac.c: revision 1.1
etc/Makefile: revision 1.430
sys/arch/arm/sunxi/sunxi_emac.c: revision 1.2
etc/Makefile: revision 1.431
sys/arch/evbarm/conf/VEXPRESS_A15: revision 1.17
sys/arch/arm/sunxi/sunxi_emac.c: revision 1.3
sys/arch/arm/sunxi/sunxi_emac.c: revision 1.4
sys/arch/arm/samsung/exynos5422_clock.c: revision 1.6
sys/arch/arm/samsung/exynos_platform.c: revision 1.1
sys/dev/ofw/ofw_subr.c: revision 1.29
sys/arch/arm/samsung/exynos_platform.c: revision 1.2
sys/arch/evbarm/conf/mk.vexpress: revision 1.3
sys/arch/arm/samsung/exynos_platform.c: revision 1.3
sys/arch/evbarm/conf/mk.vexpress: revision 1.4
sys/arch/arm/samsung/exynos_platform.c: revision 1.4
sys/arch/arm/arm/psci.h: revision 1.1
sys/arch/arm/samsung/exynos_platform.c: revision 1.5
sys/arch/arm/samsung/exynos_platform.c: revision 1.6
sys/arch/evbarm/fdt/fdt_machdep.c: revision 1.10
external/bsd/mdocml/bin/mandoc/Makefile: revision 1.12
sys/dev/fdt/files.fdt: revision 1.17
sys/dev/fdt/files.fdt: revision 1.18
sys/dev/fdt/files.fdt: revision 1.19
sys/arch/arm/samsung/exynos_sscom.c: revision 1.8
sys/arch/arm/sunxi/sun8i_a83t_ccu.c: revision 1.1
sys/arch/arm/sunxi/sunxi_mmc.c: revision 1.1
sys/arch/arm/samsung/exynos_sscom.c: revision 1.9
sys/arch/arm/conf/files.arm: revision 1.133
sys/arch/arm/samsung/mct_var.h: revision 1.5
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.1
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.2
sys/arch/evbarm/conf/std.vexpress: revision 1.6
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.3
sys/arch/arm/sunxi/sun6i_a31_gpio.c: revision 1.1
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.4
sys/arch/arm/sunxi/sun6i_a31_gpio.c: revision 1.2
sys/arch/arm/sunxi/files.sunxi: revision 1.1
sys/dev/ofw/ofw_subr.c: revision 1.30
sys/arch/arm/sunxi/files.sunxi: revision 1.2
sys/dev/ofw/openfirm.h: revision 1.35
sys/arch/arm/sunxi/files.sunxi: revision 1.3
sys/dev/ofw/openfirm.h: revision 1.36
sys/arch/arm/sunxi/files.sunxi: revision 1.4
sys/arch/arm/sunxi/files.sunxi: revision 1.5
sys/arch/evbarm/exynos/exynos_machdep.c: file removal
sys/arch/arm/sunxi/sunxi_gpio.h: revision 1.1
sys/arch/arm/samsung/sscom.c: revision 1.9
sys/arch/arm/sunxi/files.sunxi: revision 1.6
sys/dev/fdt/ohci_fdt.c: revision 1.1
sys/arch/arm/sunxi/sunxi_usbphy.c: revision 1.1
sys/arch/arm/sunxi/sunxi_gpio.h: revision 1.2
sys/arch/arm/sunxi/files.sunxi: revision 1.7
sys/arch/arm/sunxi/sunxi_usbphy.c: revision 1.2
sys/arch/arm/sunxi/sunxi_gpio.h: revision 1.3
sys/arch/arm/sunxi/files.sunxi: revision 1.8
sys/arch/arm/sunxi/sunxi_usbphy.c: revision 1.3
sys/arch/arm/sunxi/files.sunxi: revision 1.9
sys/arch/arm/samsung/exynos_sscom.c: revision 1.10
sys/arch/evbarm/conf/mk.tegra: revision 1.5
sys/arch/arm/samsung/exynos_dwcmmc.c: revision 1.4
sys/arch/evbarm/conf/mk.tegra: revision 1.6
sys/arch/evbarm/conf/EXYNOS: revision 1.15
sys/arch/evbarm/conf/EXYNOS: revision 1.16
sys/arch/evbarm/conf/EXYNOS: revision 1.17
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.1
sys/arch/evbarm/conf/EXYNOS: revision 1.19
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.2
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.3
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.4
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.5
sys/arch/arm/sunxi/sunxi_emac.h: revision 1.1
sys/arch/evbarm/conf/mk.sunxi: revision 1.1
sys/arch/evbarm/include/bootconfig.h: revision 1.7
sys/arch/evbarm/conf/TEGRA: revision 1.24
sys/arch/arm/arm/psci.c: revision 1.1
sys/dev/led.c: revision 1.1
sys/dev/led.c: revision 1.2
sys/arch/arm/arm/psci_arm.S: revision 1.1
sys/arch/arm/sunxi/sunxi_ccu_gate.c: revision 1.1
sys/arch/arm/sunxi/sunxi_ccu_gate.c: revision 1.2
sys/dev/fdt/ehci_fdt.c: revision 1.1
sys/dev/fdt/ehci_fdt.c: revision 1.2
sys/arch/arm/sunxi/sun6i_a31_ccu.h: revision 1.1
sys/arch/evbarm/conf/EXYNOS: revision 1.21
sys/arch/arm/sunxi/files.sunxi: revision 1.10
sys/arch/arm/sunxi/files.sunxi: revision 1.11
sys/dev/fdt/fdtbus.c: revision 1.14
sys/arch/arm/sunxi/sunxi_mmc.h: revision 1.1
sys/arch/arm/samsung/exynos5422_dma.c: file removal
usr.bin/config/mkmakefile.c: revision 1.69
sys/conf/files: revision 1.1178
sys/arch/arm/sunxi/sunxi_platform.h: revision 1.1
sys/arch/evbarm/exynos/exynos_start.S: revision 1.4
sys/arch/arm/samsung/exynos_pinctrl.c: revision 1.11
sys/arch/arm/samsung/exynos_pinctrl.c: revision 1.12
sys/arch/arm/sunxi/sunxi_rtc.c: revision 1.1
sys/arch/arm/sunxi/sun8i_h3_ccu.h: revision 1.1
sys/arch/arm/samsung/exynos5410_clock.c: revision 1.1
sys/arch/arm/samsung/exynos5410_clock.c: revision 1.2
sys/arch/evbarm/conf/SUNXI: revision 1.1
external/bsd/elftosb/usr.sbin/elftosb/Makefile: revision 1.5
sys/arch/evbarm/conf/SUNXI: revision 1.2
sys/arch/arm/fdt/psci_fdt.c: revision 1.1
sys/arch/evbarm/conf/SUNXI: revision 1.3
sys/arch/evbarm/conf/SUNXI: revision 1.4
sys/arch/evbarm/conf/files.exynos: revision 1.3
sys/arch/evbarm/conf/SUNXI: revision 1.5
sys/arch/evbarm/conf/SUNXI: revision 1.6
sys/arch/arm/sunxi/sunxi_ccu_nm.c: revision 1.1
sys/dev/fdt/fixedfactorclock.c: revision 1.1
sys/dev/fdt/fdt_subr.c: revision 1.14
sys/arch/evbarm/conf/SUNXI: revision 1.7
sys/arch/arm/sunxi/sunxi_ccu_nm.c: revision 1.2
sys/arch/arm/sunxi/sun8i_a83t_gpio.c: revision 1.1
sys/dev/fdt/fdt_subr.c: revision 1.15
sys/arch/evbarm/conf/SUNXI: revision 1.8
sys/arch/arm/sunxi/sunxi_ccu_nm.c: revision 1.3
sys/dev/ic/dwc_mmc_reg.h: revision 1.6
sys/dev/fdt/fdt_subr.c: revision 1.16
sys/arch/evbarm/conf/SUNXI: revision 1.9
usr.bin/config/mkmakefile.c: revision 1.70
sys/dev/fdt/fdt_phy.c: revision 1.1
sys/arch/evbarm/conf/ODROID-XU: file removal
sys/arch/arm/fdt/arm_fdt.c: revision 1.4
sys/arch/arm/samsung/exynos_reg.h: revision 1.14
sys/conf/files: revision 1.1180
sys/arch/arm/samsung/exynos_reg.h: revision 1.15
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.1
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.2
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.3
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.4
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.5
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.6
sys/dev/ic/dwc_mmc_var.h: revision 1.6
sys/arch/arm/samsung/exynos_combiner.c: revision 1.7
sys/arch/evbarm/exynos/platform.h: revision 1.2
sys/arch/arm/fdt/files.fdt: revision 1.12
sys/arch/evbarm/conf/std.exynos: revision 1.2
sys/arch/evbarm/conf/std.exynos: revision 1.3
sys/arch/arm/rockchip/rockchip_dwcmmc.c: revision 1.6
sys/arch/arm/sunxi/sunxi_com.c: revision 1.1
sys/dev/led.h: revision 1.1
sys/arch/evbarm/conf/std.exynos: revision 1.5
sys/arch/arm/sunxi/sunxi_com.c: revision 1.2
sys/arch/evbarm/conf/files.evbarm: revision 1.26
usr.bin/config/defs.h: revision 1.99
sys/arch/arm/fdt/arm_fdtvar.h: revision 1.6
sys/arch/arm/samsung/exynos_soc.c: revision 1.32
sys/arch/arm/sunxi/sun6i_a31_ccu.c: revision 1.1
sys/arch/arm/sunxi/sun6i_a31_ccu.c: revision 1.2
sys/arch/arm/samsung/mct.c: revision 1.11
sys/arch/evbarm/conf/ODROID-U: file removal
sys/arch/arm/samsung/mct.c: revision 1.12
sys/arch/arm/sunxi/sunxi_ccu_nkmp.c: revision 1.1
sys/arch/arm/sunxi/sunxi_ccu_nkmp.c: revision 1.2
sys/arch/arm/sunxi/sunxi_ccu_nkmp.c: revision 1.3
sys/arch/arm/sunxi/sunxi_ccu_nkmp.c: revision 1.4
Get the EXYNOS kernel building again with recent FDT changes. Untested.
Use arm_fdt_cpu_hatch and add mmu entry for DTB
Fix exynos5 devmap, bootstrap, and implement early_putchar.
Calculate UART frequency based on bootloader config.
Fix KERNEL_BASE_PHYS (how did this ever work?)
Avoid divide-by-zero for unconfigured PLLs
Correctly initialize i2cbus attach args.
Add delay and enable mct timecounter.
Fix build w/o VERBOSE_INIT_ARM
Remove ODROID-U and ODROID-XU kernel configs as they no longer work.
- Replace CONSADDR with SSCOM2CONSOLE in example
- Remove gtmr (Exynos5422 uses mct)
- cinclude EXYNOS.local instead of TEGRA.local
Use fdtbus_intr_establish to hook in block interrupts instead of
intr_establish.
Simplify MCT; just enable it and then attach an ARMv7 generic timer.
Add support for building DTB files during kernel build, from christos.
build vexpress-v2p-ca15-tc1.dtb with the kernel
build tegra124-apalis-eval.dtb, tegra124-jetson-tk1.dtb, tegra124-nyan-big.dtb, tegra124-nyan-blaze.dtb, and tegra124-venice2.dtb with the kernel
Allow multiline makeoptions to work by quoting the newline..
Bump for quoting makeoptions with multiple lines.
un-c99
bump required config version for multiline makeoptions feature
Set DTS makeoption in kernel config
Assign DTB files to a variable so we can make -V DTB
put the dtb files with their kernels.
no need for debug printing.
Don't assume that CPU index = GIC CPU interface number. We can determine
the current CPU interface number by reading from the read-only
GICD_ITARGETSR0 through GICD_ITARGETSR7 registers.
This gets interrupts working on Exynos 5422, where the boot processor has
GIC CPU interface #4.
use -v to get the expanded variable.
Use -v to get the expanded variables.
Get baud rate from sclk_uartN instead of uartN. Print IRQ number at attach.
Fix PLL con0 register locations and add uart clocks
Disable exyortc for now, it doesn't work.
More or less a rewrite of dwc_mmc, based on awin_mmc, adding DMA support.
Update for new dwc_mmc driver
Fix dmesg
Add Exynos 5410 clock controller driver.
Fix a few typos in clock parent names for mmc clocks.
From jmcneill@
Update for new dwc_mmc driver
Implement platform reset for exynos5
Attach fdtbus to a /clocks node with no compatible string.
Add support for ARM Power State Coordination Interface (PSCI).
Support interrupt sharing.
Add initial support for Allwinner H3 SoC.
ARM Trusted Firmware reserves SGIs 8-15 for secure use. Even without ATF,
U-Boot on some platforms may use SGIs in this range for the PSCI
implementation.
Change ARMGIC_IPI_BASE to 0 from (16 - NIPI) and add a compile-time assert
to ensure that we don't end up with a conflict.
Add H3 MMC support
SD/MMC clock fixes
Add FDT PHY interface.
Add glue for generic ehci/ohci bindings.
Rename a variable, NFC.
Support parents in different clock domains.
Add USB stuff. Doesn't quite work yet.
Synopsys DesignWare APB UART needs "options COM_AWIN" for now.
Add i2c glue.
Add RTC driver.
PHY registers start at index 1. Now USB works.
Don't allow sharing edge and level triggered interrupts.
Add arm_fdt_memory_dump helper for dumping physical addresses from ddb
Print clocks with aprint_debug
Remove unused defines
Add fdtbus_get_string helper
Add of_search_compatible, which searches an array of compat_data structures
for a matching "compatible" entry matching the supplied OFW node. This
allows us to associate data with compatible strings.
Add driver for Allwinner Gigabit Ethernet (EMAC) as found in sun8i and
later family SoCs.
This is a port of my FreeBSD driver which has been confirmed to work on
Allwinner H3, A83T, and A64 SoCs.
Fix dmesg
Add basic support for Allwinner A31.
Add basic FDT GPIO support.
Fix the pinctrl api to match the spec. A pinctrl config can have more
than one xref, and an xref may have specifier data associated with it.
Enable sunxi pinctrl support
Adjust to new pinctrl API
Add P2WI/RSB driver, based on awin_p2wi.c.
Fix typo in a compat string.
Configure pin defaults at attach
No need to explicitly set pinctrl config 0 now
Fix some register definitions.
Disallow sharing between MPSAFE and non-MPSAFE handlers.
Add of_match_compat_data.
This routine searches an array of compat_data structures for a
matching "compatible" entry matching the supplied OFW node.
Add options __HAVE_CPU_UAREA_ALLOC_IDLELWP
Add support for reserved memory and MEMORY_DISK_DYNAMIC for FDT-based
kernels.
the extent code cannot use the full range of u_long,
so ignore the last page before 4GB too. ok jmcneill@
Copy install ramdisk to releasedir. Provide both a raw ffs and
Legacy U-Boot version of it.
Replace HUMMINGBIRD_A31 with SUNXI kernel on armv7.img and include .dtb
files for SUNXI and TEGRA kernels on the MSDOS partition.
Let the controller provide a default name for pins. This makes pins easier
to locate when we have multiple banks and a variable number of pins per
bank.
Attach gpio(4) to sunxigpio
Test for kernel build directory before reading DTB list
Add support for Allwinner A83T SoC.
Add A83T files
Fixup busdma sync and locking in the RX path. Disable batch RX/TX ints.
Fix AHB2 register definition and explicitly set AHB2 parent to PLL_PERIPH0/2 -- this gives us 50% more bus bandwidth for emac
Restore TX_INTERVAL_DEFAULT to 64
Drop the sunxi_emac_rx_batch feature. It was originally designed to
reduce the amount of mutex unlock/lock cycles during the RX path on
FreeBSD and if_input, but it is not required to drop the lock before
calling if_percpuq_enqueue on NetBSD.
Write back the data value instead of mask in sunxi_gpio_write
Add a helper for exposing LED controls via sysctl.
Add GPIO LED driver.
add gpioleds
Add misc. gates and resets driver, and explicitly enable PIO clocks
at attach.
Add fdtbus_get_string_index helper.
Add driver for fixed-factor clocks.
Add ffclock
Remove the requirement for ehci to attach after companion devices.
"go for it" - skrll@
Remove the hack to find companion devices and just assume 1 companion if
ETTF flag is not set.
Remove pass numbers for ehci/ohci now that the attach order no longer matters
Use unsigned char for ctype functions, suggested by christos
Add : to body of populate_sunxi to appease bash.
port-evbarm/52388: Fix number of args to a debug printf.
 1.30.4.3 30-Sep-2018  pgoyette Ssync with HEAD
 1.30.4.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.30.4.1 28-Jul-2018  pgoyette Sync with HEAD
 1.31.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.31.2.1 10-Jun-2019  christos Sync with HEAD
 1.40.2.2 03-Apr-2021  thorpej Sync with HEAD.
 1.40.2.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.57.2.1 03-Apr-2021  thorpej - FDT device enumeration now sets the device handle using CFARG_DEVHANDLE.
- fdtbus_device_register() is now obsolete, so G/C it.
- of_device_register() is now obsolete, so G/C it.
 1.2 03-Apr-2020  macallan branches: 1.2.2;
various fixes:
- don't create hw.ofw if there is no /openprom node
- just copy 'model' and 'version' properties if present instead of reporting
'model' as 'version'...
 1.1 03-Apr-2020  macallan make OpenFirmware info available via sysctl.ofw
tested on macppc, shark and sparc64
 1.2.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.2.1 03-Apr-2020  martin file ofw_sysctl.c was added on branch phil-wifi on 2020-04-08 14:08:08 +0000
 1.52 16-Sep-2025  thorpej As with ACPI, iic_attach() now fetches the child device array directly
in the FDT case. Adjust the OFW case so that we're not forced to indirect
through a dictionary if it's not needed.
 1.51 14-Sep-2025  thorpej Make SPI direct configuration less #ifdef'y. No more checking what kind
of platform device tree; instead, use a device call to enumerate the
direct config children of the bus.
 1.50 10-Sep-2025  thorpej Do the #address-cells dance inside of_copy_spi_devs(), and make calling
it a bit simpler.
 1.49 10-Sep-2025  thorpej Remove pointless containment of SPI device array inside a dictionary
that never gets passed on to anyone.
 1.48 22-Jan-2022  thorpej Change the devhandle_from_*() functions to also take a "super handle",
from which the newly created handle will inherit it's implementation.
The root implementation for a new handle type is used if an invalid
"super handle" is passed.
 1.47 24-Apr-2021  thorpej branches: 1.47.2; 1.47.12;
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.46 06-Feb-2021  thorpej branches: 1.46.2;
Wrap some definite-only-in-kernel-environment prototypees in _KERNEL.
 1.45 05-Feb-2021  thorpej OpenFirmware device handle implementation.
 1.44 27-Jan-2021  thorpej G/C of_match_compatible().
 1.43 27-Jan-2021  thorpej Rename of_match_compat_data() to of_compatible_match(). Similarly,
rename of_search_compatible() to of_compatible_lookup().

Standardize on of_compatible_match() for driver matching, and adapt
all call sites.
 1.42 25-Jan-2021  mrg s/boolean_t/bool/. boolean_t is obsolete (from Mach), and this
also fixes a new build issue in libkvm on sparc*.
 1.41 18-Jan-2021  thorpej Remove "struct of_compat_data" and replace its usage with
"struct device_compatible_entry"; they are ABI-compatible.

Fix several "loses const qualifier" bugs encountered during
this conversion.
 1.40 31-Dec-2020  ryo add of_getprop_uint32_array()
 1.39 16-Jul-2020  jmcneill branches: 1.39.2;
Add of_find_bycompat helper to search a tree for a node by compat string.
 1.38 06-Aug-2019  tnn ofw: add of_enter_spi_devs helper method

For translating OFW child nodes of SPI controller into "spi-child-devices"
property. In similar spirit to the existing of_enter_i2c_devs method.
 1.37 23-Aug-2018  jmcneill Add of_getprop_uint64
 1.36 03-Jul-2017  jmcneill branches: 1.36.4; 1.36.6;
Add of_match_compat_data.

This routine searches an array of compat_data structures for a
matching "compatible" entry matching the supplied OFW node.
 1.35 30-Jun-2017  jmcneill Add of_search_compatible, which searches an array of compat_data structures
for a matching "compatible" entry matching the supplied OFW node. This
allows us to associate data with compatible strings.
 1.34 30-Apr-2017  jmcneill branches: 1.34.2;
Rename of_getprop_bool to of_hasprop and make of_getprop_bool an alias.
 1.33 16-Dec-2015  jmcneill branches: 1.33.8;
add of_getprop_bool and of_getprop_uint32 helpers
 1.32 13-Dec-2015  jmcneill add an addr_shift parameter to of_enter_i2c_devs
 1.31 12-Dec-2015  jmcneill Change the meaning of of_compatible return values >= 0. Previously, the
function would return the index of the matching compatibility string in
the "strings" parameter on success. None of the callers in tree use this,
so instead change the function to return a reverse index of the matching
compatibility string in the phandle's "compatible" property. The result is
that the function will return a higher number for earlier "compatible"
matches.

Add a new of_match_compatible() that simply returns of_compatible() + 1,
for use in driver match functions.
 1.30 16-May-2013  christos branches: 1.30.10;
sort by name, add OF_quiesce
 1.29 28-Feb-2010  martin branches: 1.29.10; 1.29.20;
Interpret the "reg" property of i2c nodes more liberal, and depending
on the cell size in use.
I have been unable to find any documents about the i2c bindings for OF,
so this is all pretty much voodoo.
 1.28 28-Feb-2010  martin Supporting cast for i2c direct configuration on OF machines
 1.27 11-Nov-2009  macallan branches: 1.27.2;
add another convenience function - of_get_mode_string() to extract a Sun-like
video mode specifier from output-device
 1.26 25-Dec-2007  perry branches: 1.26.10;
Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.25 07-Nov-2007  garbled branches: 1.25.2; 1.25.6;
Add three new MI functions taken from macppc/autoconf.c:
of_getnode_byname(): Finds a node named X
of_to_uint32_prop(): sets an uint32_t prop_t from an OFW property
of_to_dataprop(): sets a data prop_t from an OFW property

These looked more generally useful, and seemed like something other
OFW-capable machines might want to take advantage of.
 1.24 25-Oct-2007  garbled branches: 1.24.2;
Add a new convenience function, of_find_firstchild_byname(), and apply
some minor KNF to this ofw_subr.c.
 1.23 20-Jan-2007  he branches: 1.23.18; 1.23.20; 1.23.24;
Unify the declaration of OF_interpret() between sparc{,64} and macppc
by adding the "nargs" argument to the macppc version, and fix the macppc
ports uses of OF_interpret() accordingly.

Also move the declaration of OF_interpt() from macppc's autoconf.h to
ofw/openfirm.h. This fixes the build of the macppc port.

Approved by macallan@.
 1.22 14-Jun-2006  uwe branches: 1.22.6;
G/c struct ofbus_softc. Last use (in sys/arch/powerpc/powerpc/ofw_machdep.c)
has perished long ago along with vestiges of dk_establish.
 1.21 11-Dec-2005  christos branches: 1.21.4; 1.21.8; 1.21.14;
merge ktrace-lwp.
 1.20 31-May-2005  christos branches: 1.20.2;
sprinkle const.
 1.19 05-Oct-2002  chs branches: 1.19.6;
add missing protos.
 1.18 18-Sep-2002  chs implement device_register() for ofppc.
use ofcons_cnprobe().
 1.17 19-Jun-2001  simonb branches: 1.17.2;
Don't use argument names in function declarations.
 1.16 10-Jun-2001  tsubai Rename ofb_softc to ofbus_softc. (XXX Is this good name?)
 1.15 15-Nov-2000  pk branches: 1.15.2;
OF_nextprop: make OUT argument type `void *'
 1.14 14-Nov-2000  matt Add OF_nextprop and OF_setprop prototypes.
 1.13 14-Nov-2000  matt de __P'd.
 1.12 10-Mar-1999  mrg branches: 1.12.8;
oops, fix previous.
 1.11 09-Mar-1999  mrg no need to use __P inside __P.
 1.10 03-Feb-1999  pk Update last prototyping change.
 1.9 02-Feb-1999  pk Make this pass the `strict prototype' test.
 1.8 22-Jul-1998  thorpej Add common OpenFirmware network interface functions. Currently supports
decoding the `supported-network-types' and `chosen-network-type' properties
into ifmedia words.
 1.7 24-Feb-1998  mycroft Several things:
Clean up the name space here a bit.
Add a `busname' element to struct ofprobe (now struct ofbus_attach_args), and
check against it.
Nuke `ofroot'.
Rename the `openfirm' attribute to `ofbus'.
 1.6 03-Feb-1998  cgd s/of_nodename/of_packagename/. Eventually, we'll probably want something
similar for instances.
 1.5 02-Feb-1998  cgd add a prototype for of_nodename(), a function to stuff the last
component of a node's name into a caller-provided buffer (helpful
for generating autoconfiguration output).
 1.4 02-Feb-1998  thorpej Prototype OF_getproplen().
 1.3 28-Jan-1998  cgd prototype of_compatible
 1.2 26-Jan-1998  cgd clean up for other changes (removal of ofnmmatch(), addition of
of_decode_int()), reorganize.
 1.1 30-Sep-1996  ws PowerPC port
 1.12.8.1 22-Nov-2000  bouyer Sync with HEAD.
 1.15.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.15.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.17.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.19.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.2.5 21-Jan-2008  yamt sync with head
 1.20.2.4 15-Nov-2007  yamt sync with head.
 1.20.2.3 27-Oct-2007  yamt sync with head.
 1.20.2.2 26-Feb-2007  yamt sync with head.
 1.20.2.1 21-Jun-2006  yamt sync with head.
 1.21.14.1 19-Jun-2006  chap Sync with head.
 1.21.8.1 26-Jun-2006  yamt sync with head.
 1.21.4.1 09-Sep-2006  rpaulo sync with head
 1.22.6.1 01-Feb-2007  ad Sync with head.
 1.23.24.1 13-Nov-2007  bouyer Sync with HEAD
 1.23.20.3 09-Jan-2008  matt sync with HEAD
 1.23.20.2 08-Nov-2007  matt sync with -HEAD
 1.23.20.1 06-Nov-2007  matt sync with HEAD
 1.23.18.2 11-Nov-2007  joerg Sync with HEAD.
 1.23.18.1 28-Oct-2007  joerg Sync with HEAD.
 1.24.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.24.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.25.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.25.2.1 26-Dec-2007  ad Sync with head.
 1.26.10.1 11-Mar-2010  yamt sync with head
 1.27.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.29.20.2 03-Dec-2017  jdolecek update from HEAD
 1.29.20.1 23-Jun-2013  tls resync from head
 1.29.10.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.30.10.2 28-Aug-2017  skrll Sync with HEAD
 1.30.10.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.33.8.1 02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.34.2.1 18-Jul-2017  snj Pull up following revision(s) (requested by jmcneill in ticket #114):
sys/arch/arm/samsung/exynos_intr.h: revision 1.3
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.1
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.2
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.3
sys/arch/arm/sunxi/sunxi_gates.c: revision 1.1
distrib/utils/embedded/mkimage: revision 1.66
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.4
sys/arch/arm/sunxi/sunxi_rsb.c: revision 1.1
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.5
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.6
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.7
sys/dev/gpio/gpio.c: revision 1.59
sys/arch/arm/sunxi/sunxi_ccu_prediv.c: revision 1.1
sys/conf/Makefile.kern.inc: revision 1.257
sys/arch/evbarm/conf/ODROID-XU_INSTALL: file removal
sys/arch/arm/sunxi/sunxi_ccu_prediv.c: revision 1.2
sys/conf/Makefile.kern.inc: revision 1.258
sys/arch/arm/fdt/psci_fdt.h: revision 1.1
sys/arch/arm/sunxi/sunxi_resets.c: revision 1.1
sys/arch/evbarm/conf/files.sunxi: revision 1.1
sys/arch/evbarm/fdt/fdt_machdep.c: revision 1.8
sys/arch/evbarm/fdt/fdt_machdep.c: revision 1.9
sys/arch/arm/samsung/files.exynos: revision 1.22
distrib/utils/embedded/conf/armv7.conf: revision 1.13
sys/arch/arm/samsung/files.exynos: revision 1.23
sys/arch/evbarm/conf/std.tegra: revision 1.15
distrib/utils/embedded/conf/armv7.conf: revision 1.14
sys/arch/arm/samsung/files.exynos: revision 1.24
distrib/utils/embedded/conf/armv7.conf: revision 1.15
sys/arch/evbarm/sunxi/genassym.cf: revision 1.1
sys/arch/arm/samsung/exynos_fdt.c: file removal
sys/dev/fdt/fdt_pinctrl.c: revision 1.4
sys/arch/arm/samsung/exynos_sysmmu.c: revision 1.2
sys/arch/arm/sunxi/sun8i_h3_gpio.c: revision 1.1
sys/arch/arm/sunxi/sunxi_twi.c: revision 1.1
sys/dev/usb/ehci.c: revision 1.255
sys/arch/arm/sunxi/sunxi_twi.c: revision 1.2
sys/arch/arm/sunxi/sun8i_a83t_ccu.h: revision 1.1
sys/dev/ic/dwc_mmc.c: revision 1.11
sys/arch/arm/cortex/gic.c: revision 1.24
distrib/evbarm/instkernel/ramdisk/Makefile: revision 1.17
etc/etc.evbarm/Makefile.inc: revision 1.87
etc/etc.evbarm/Makefile.inc: revision 1.88
sys/arch/arm/fdt/gic_fdt.c: revision 1.5
etc/Makefile: revision 1.429
sys/arch/arm/fdt/gic_fdt.c: revision 1.6
sys/arch/arm/fdt/gic_fdt.c: revision 1.7
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.1
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.2
sys/arch/evbarm/conf/std.sunxi: revision 1.1
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.3
sys/arch/evbarm/conf/std.sunxi: revision 1.2
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.4
sys/arch/evbarm/conf/std.sunxi: revision 1.3
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.5
sys/arch/arm/sunxi/sunxi_ccu_div.c: revision 1.1
sys/dev/gpio/gpiovar.h: revision 1.17
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.6
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.7
sys/arch/arm/sunxi/sunxi_gpio.c: revision 1.8
sys/arch/arm/sunxi/sunxi_rsb.h: revision 1.1
sys/arch/arm/samsung/exynos_i2c.c: revision 1.12
sys/dev/fdt/fdtvar.h: revision 1.21
sys/arch/evbarm/sunxi/sunxi_start.S: revision 1.1
sys/arch/arm/samsung/exynos_i2c.c: revision 1.13
sys/dev/fdt/fdtvar.h: revision 1.22
sys/arch/evbarm/conf/SUNXI: revision 1.10
sys/dev/fdt/fdtvar.h: revision 1.23
sys/arch/evbarm/conf/SUNXI: revision 1.11
sys/dev/fdt/gpioleds.c: revision 1.1
sys/dev/fdt/fdtvar.h: revision 1.24
sys/arch/evbarm/conf/SUNXI: revision 1.12
sys/arch/evbarm/conf/SUNXI: revision 1.13
sys/arch/arm/cortex/gic.c: revision 1.30
sys/arch/evbarm/conf/SUNXI: revision 1.14
sys/arch/evbarm/conf/SUNXI: revision 1.15
sys/arch/evbarm/conf/SUNXI: revision 1.16
sys/arch/arm/sunxi/sunxi_emac.c: revision 1.1
etc/Makefile: revision 1.430
sys/arch/arm/sunxi/sunxi_emac.c: revision 1.2
etc/Makefile: revision 1.431
sys/arch/evbarm/conf/VEXPRESS_A15: revision 1.17
sys/arch/arm/sunxi/sunxi_emac.c: revision 1.3
sys/arch/arm/sunxi/sunxi_emac.c: revision 1.4
sys/arch/arm/samsung/exynos5422_clock.c: revision 1.6
sys/arch/arm/samsung/exynos_platform.c: revision 1.1
sys/dev/ofw/ofw_subr.c: revision 1.29
sys/arch/arm/samsung/exynos_platform.c: revision 1.2
sys/arch/evbarm/conf/mk.vexpress: revision 1.3
sys/arch/arm/samsung/exynos_platform.c: revision 1.3
sys/arch/evbarm/conf/mk.vexpress: revision 1.4
sys/arch/arm/samsung/exynos_platform.c: revision 1.4
sys/arch/arm/arm/psci.h: revision 1.1
sys/arch/arm/samsung/exynos_platform.c: revision 1.5
sys/arch/arm/samsung/exynos_platform.c: revision 1.6
sys/arch/evbarm/fdt/fdt_machdep.c: revision 1.10
external/bsd/mdocml/bin/mandoc/Makefile: revision 1.12
sys/dev/fdt/files.fdt: revision 1.17
sys/dev/fdt/files.fdt: revision 1.18
sys/dev/fdt/files.fdt: revision 1.19
sys/arch/arm/samsung/exynos_sscom.c: revision 1.8
sys/arch/arm/sunxi/sun8i_a83t_ccu.c: revision 1.1
sys/arch/arm/sunxi/sunxi_mmc.c: revision 1.1
sys/arch/arm/samsung/exynos_sscom.c: revision 1.9
sys/arch/arm/conf/files.arm: revision 1.133
sys/arch/arm/samsung/mct_var.h: revision 1.5
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.1
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.2
sys/arch/evbarm/conf/std.vexpress: revision 1.6
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.3
sys/arch/arm/sunxi/sun6i_a31_gpio.c: revision 1.1
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.4
sys/arch/arm/sunxi/sun6i_a31_gpio.c: revision 1.2
sys/arch/arm/sunxi/files.sunxi: revision 1.1
sys/dev/ofw/ofw_subr.c: revision 1.30
sys/arch/arm/sunxi/files.sunxi: revision 1.2
sys/dev/ofw/openfirm.h: revision 1.35
sys/arch/arm/sunxi/files.sunxi: revision 1.3
sys/dev/ofw/openfirm.h: revision 1.36
sys/arch/arm/sunxi/files.sunxi: revision 1.4
sys/arch/arm/sunxi/files.sunxi: revision 1.5
sys/arch/evbarm/exynos/exynos_machdep.c: file removal
sys/arch/arm/sunxi/sunxi_gpio.h: revision 1.1
sys/arch/arm/samsung/sscom.c: revision 1.9
sys/arch/arm/sunxi/files.sunxi: revision 1.6
sys/dev/fdt/ohci_fdt.c: revision 1.1
sys/arch/arm/sunxi/sunxi_usbphy.c: revision 1.1
sys/arch/arm/sunxi/sunxi_gpio.h: revision 1.2
sys/arch/arm/sunxi/files.sunxi: revision 1.7
sys/arch/arm/sunxi/sunxi_usbphy.c: revision 1.2
sys/arch/arm/sunxi/sunxi_gpio.h: revision 1.3
sys/arch/arm/sunxi/files.sunxi: revision 1.8
sys/arch/arm/sunxi/sunxi_usbphy.c: revision 1.3
sys/arch/arm/sunxi/files.sunxi: revision 1.9
sys/arch/arm/samsung/exynos_sscom.c: revision 1.10
sys/arch/evbarm/conf/mk.tegra: revision 1.5
sys/arch/arm/samsung/exynos_dwcmmc.c: revision 1.4
sys/arch/evbarm/conf/mk.tegra: revision 1.6
sys/arch/evbarm/conf/EXYNOS: revision 1.15
sys/arch/evbarm/conf/EXYNOS: revision 1.16
sys/arch/evbarm/conf/EXYNOS: revision 1.17
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.1
sys/arch/evbarm/conf/EXYNOS: revision 1.19
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.2
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.3
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.4
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.5
sys/arch/arm/sunxi/sunxi_emac.h: revision 1.1
sys/arch/evbarm/conf/mk.sunxi: revision 1.1
sys/arch/evbarm/include/bootconfig.h: revision 1.7
sys/arch/evbarm/conf/TEGRA: revision 1.24
sys/arch/arm/arm/psci.c: revision 1.1
sys/dev/led.c: revision 1.1
sys/dev/led.c: revision 1.2
sys/arch/arm/arm/psci_arm.S: revision 1.1
sys/arch/arm/sunxi/sunxi_ccu_gate.c: revision 1.1
sys/arch/arm/sunxi/sunxi_ccu_gate.c: revision 1.2
sys/dev/fdt/ehci_fdt.c: revision 1.1
sys/dev/fdt/ehci_fdt.c: revision 1.2
sys/arch/arm/sunxi/sun6i_a31_ccu.h: revision 1.1
sys/arch/evbarm/conf/EXYNOS: revision 1.21
sys/arch/arm/sunxi/files.sunxi: revision 1.10
sys/arch/arm/sunxi/files.sunxi: revision 1.11
sys/dev/fdt/fdtbus.c: revision 1.14
sys/arch/arm/sunxi/sunxi_mmc.h: revision 1.1
sys/arch/arm/samsung/exynos5422_dma.c: file removal
usr.bin/config/mkmakefile.c: revision 1.69
sys/conf/files: revision 1.1178
sys/arch/arm/sunxi/sunxi_platform.h: revision 1.1
sys/arch/evbarm/exynos/exynos_start.S: revision 1.4
sys/arch/arm/samsung/exynos_pinctrl.c: revision 1.11
sys/arch/arm/samsung/exynos_pinctrl.c: revision 1.12
sys/arch/arm/sunxi/sunxi_rtc.c: revision 1.1
sys/arch/arm/sunxi/sun8i_h3_ccu.h: revision 1.1
sys/arch/arm/samsung/exynos5410_clock.c: revision 1.1
sys/arch/arm/samsung/exynos5410_clock.c: revision 1.2
sys/arch/evbarm/conf/SUNXI: revision 1.1
external/bsd/elftosb/usr.sbin/elftosb/Makefile: revision 1.5
sys/arch/evbarm/conf/SUNXI: revision 1.2
sys/arch/arm/fdt/psci_fdt.c: revision 1.1
sys/arch/evbarm/conf/SUNXI: revision 1.3
sys/arch/evbarm/conf/SUNXI: revision 1.4
sys/arch/evbarm/conf/files.exynos: revision 1.3
sys/arch/evbarm/conf/SUNXI: revision 1.5
sys/arch/evbarm/conf/SUNXI: revision 1.6
sys/arch/arm/sunxi/sunxi_ccu_nm.c: revision 1.1
sys/dev/fdt/fixedfactorclock.c: revision 1.1
sys/dev/fdt/fdt_subr.c: revision 1.14
sys/arch/evbarm/conf/SUNXI: revision 1.7
sys/arch/arm/sunxi/sunxi_ccu_nm.c: revision 1.2
sys/arch/arm/sunxi/sun8i_a83t_gpio.c: revision 1.1
sys/dev/fdt/fdt_subr.c: revision 1.15
sys/arch/evbarm/conf/SUNXI: revision 1.8
sys/arch/arm/sunxi/sunxi_ccu_nm.c: revision 1.3
sys/dev/ic/dwc_mmc_reg.h: revision 1.6
sys/dev/fdt/fdt_subr.c: revision 1.16
sys/arch/evbarm/conf/SUNXI: revision 1.9
usr.bin/config/mkmakefile.c: revision 1.70
sys/dev/fdt/fdt_phy.c: revision 1.1
sys/arch/evbarm/conf/ODROID-XU: file removal
sys/arch/arm/fdt/arm_fdt.c: revision 1.4
sys/arch/arm/samsung/exynos_reg.h: revision 1.14
sys/conf/files: revision 1.1180
sys/arch/arm/samsung/exynos_reg.h: revision 1.15
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.1
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.2
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.3
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.4
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.5
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.6
sys/dev/ic/dwc_mmc_var.h: revision 1.6
sys/arch/arm/samsung/exynos_combiner.c: revision 1.7
sys/arch/evbarm/exynos/platform.h: revision 1.2
sys/arch/arm/fdt/files.fdt: revision 1.12
sys/arch/evbarm/conf/std.exynos: revision 1.2
sys/arch/evbarm/conf/std.exynos: revision 1.3
sys/arch/arm/rockchip/rockchip_dwcmmc.c: revision 1.6
sys/arch/arm/sunxi/sunxi_com.c: revision 1.1
sys/dev/led.h: revision 1.1
sys/arch/evbarm/conf/std.exynos: revision 1.5
sys/arch/arm/sunxi/sunxi_com.c: revision 1.2
sys/arch/evbarm/conf/files.evbarm: revision 1.26
usr.bin/config/defs.h: revision 1.99
sys/arch/arm/fdt/arm_fdtvar.h: revision 1.6
sys/arch/arm/samsung/exynos_soc.c: revision 1.32
sys/arch/arm/sunxi/sun6i_a31_ccu.c: revision 1.1
sys/arch/arm/sunxi/sun6i_a31_ccu.c: revision 1.2
sys/arch/arm/samsung/mct.c: revision 1.11
sys/arch/evbarm/conf/ODROID-U: file removal
sys/arch/arm/samsung/mct.c: revision 1.12
sys/arch/arm/sunxi/sunxi_ccu_nkmp.c: revision 1.1
sys/arch/arm/sunxi/sunxi_ccu_nkmp.c: revision 1.2
sys/arch/arm/sunxi/sunxi_ccu_nkmp.c: revision 1.3
sys/arch/arm/sunxi/sunxi_ccu_nkmp.c: revision 1.4
Get the EXYNOS kernel building again with recent FDT changes. Untested.
Use arm_fdt_cpu_hatch and add mmu entry for DTB
Fix exynos5 devmap, bootstrap, and implement early_putchar.
Calculate UART frequency based on bootloader config.
Fix KERNEL_BASE_PHYS (how did this ever work?)
Avoid divide-by-zero for unconfigured PLLs
Correctly initialize i2cbus attach args.
Add delay and enable mct timecounter.
Fix build w/o VERBOSE_INIT_ARM
Remove ODROID-U and ODROID-XU kernel configs as they no longer work.
- Replace CONSADDR with SSCOM2CONSOLE in example
- Remove gtmr (Exynos5422 uses mct)
- cinclude EXYNOS.local instead of TEGRA.local
Use fdtbus_intr_establish to hook in block interrupts instead of
intr_establish.
Simplify MCT; just enable it and then attach an ARMv7 generic timer.
Add support for building DTB files during kernel build, from christos.
build vexpress-v2p-ca15-tc1.dtb with the kernel
build tegra124-apalis-eval.dtb, tegra124-jetson-tk1.dtb, tegra124-nyan-big.dtb, tegra124-nyan-blaze.dtb, and tegra124-venice2.dtb with the kernel
Allow multiline makeoptions to work by quoting the newline..
Bump for quoting makeoptions with multiple lines.
un-c99
bump required config version for multiline makeoptions feature
Set DTS makeoption in kernel config
Assign DTB files to a variable so we can make -V DTB
put the dtb files with their kernels.
no need for debug printing.
Don't assume that CPU index = GIC CPU interface number. We can determine
the current CPU interface number by reading from the read-only
GICD_ITARGETSR0 through GICD_ITARGETSR7 registers.
This gets interrupts working on Exynos 5422, where the boot processor has
GIC CPU interface #4.
use -v to get the expanded variable.
Use -v to get the expanded variables.
Get baud rate from sclk_uartN instead of uartN. Print IRQ number at attach.
Fix PLL con0 register locations and add uart clocks
Disable exyortc for now, it doesn't work.
More or less a rewrite of dwc_mmc, based on awin_mmc, adding DMA support.
Update for new dwc_mmc driver
Fix dmesg
Add Exynos 5410 clock controller driver.
Fix a few typos in clock parent names for mmc clocks.
From jmcneill@
Update for new dwc_mmc driver
Implement platform reset for exynos5
Attach fdtbus to a /clocks node with no compatible string.
Add support for ARM Power State Coordination Interface (PSCI).
Support interrupt sharing.
Add initial support for Allwinner H3 SoC.
ARM Trusted Firmware reserves SGIs 8-15 for secure use. Even without ATF,
U-Boot on some platforms may use SGIs in this range for the PSCI
implementation.
Change ARMGIC_IPI_BASE to 0 from (16 - NIPI) and add a compile-time assert
to ensure that we don't end up with a conflict.
Add H3 MMC support
SD/MMC clock fixes
Add FDT PHY interface.
Add glue for generic ehci/ohci bindings.
Rename a variable, NFC.
Support parents in different clock domains.
Add USB stuff. Doesn't quite work yet.
Synopsys DesignWare APB UART needs "options COM_AWIN" for now.
Add i2c glue.
Add RTC driver.
PHY registers start at index 1. Now USB works.
Don't allow sharing edge and level triggered interrupts.
Add arm_fdt_memory_dump helper for dumping physical addresses from ddb
Print clocks with aprint_debug
Remove unused defines
Add fdtbus_get_string helper
Add of_search_compatible, which searches an array of compat_data structures
for a matching "compatible" entry matching the supplied OFW node. This
allows us to associate data with compatible strings.
Add driver for Allwinner Gigabit Ethernet (EMAC) as found in sun8i and
later family SoCs.
This is a port of my FreeBSD driver which has been confirmed to work on
Allwinner H3, A83T, and A64 SoCs.
Fix dmesg
Add basic support for Allwinner A31.
Add basic FDT GPIO support.
Fix the pinctrl api to match the spec. A pinctrl config can have more
than one xref, and an xref may have specifier data associated with it.
Enable sunxi pinctrl support
Adjust to new pinctrl API
Add P2WI/RSB driver, based on awin_p2wi.c.
Fix typo in a compat string.
Configure pin defaults at attach
No need to explicitly set pinctrl config 0 now
Fix some register definitions.
Disallow sharing between MPSAFE and non-MPSAFE handlers.
Add of_match_compat_data.
This routine searches an array of compat_data structures for a
matching "compatible" entry matching the supplied OFW node.
Add options __HAVE_CPU_UAREA_ALLOC_IDLELWP
Add support for reserved memory and MEMORY_DISK_DYNAMIC for FDT-based
kernels.
the extent code cannot use the full range of u_long,
so ignore the last page before 4GB too. ok jmcneill@
Copy install ramdisk to releasedir. Provide both a raw ffs and
Legacy U-Boot version of it.
Replace HUMMINGBIRD_A31 with SUNXI kernel on armv7.img and include .dtb
files for SUNXI and TEGRA kernels on the MSDOS partition.
Let the controller provide a default name for pins. This makes pins easier
to locate when we have multiple banks and a variable number of pins per
bank.
Attach gpio(4) to sunxigpio
Test for kernel build directory before reading DTB list
Add support for Allwinner A83T SoC.
Add A83T files
Fixup busdma sync and locking in the RX path. Disable batch RX/TX ints.
Fix AHB2 register definition and explicitly set AHB2 parent to PLL_PERIPH0/2 -- this gives us 50% more bus bandwidth for emac
Restore TX_INTERVAL_DEFAULT to 64
Drop the sunxi_emac_rx_batch feature. It was originally designed to
reduce the amount of mutex unlock/lock cycles during the RX path on
FreeBSD and if_input, but it is not required to drop the lock before
calling if_percpuq_enqueue on NetBSD.
Write back the data value instead of mask in sunxi_gpio_write
Add a helper for exposing LED controls via sysctl.
Add GPIO LED driver.
add gpioleds
Add misc. gates and resets driver, and explicitly enable PIO clocks
at attach.
Add fdtbus_get_string_index helper.
Add driver for fixed-factor clocks.
Add ffclock
Remove the requirement for ehci to attach after companion devices.
"go for it" - skrll@
Remove the hack to find companion devices and just assume 1 companion if
ETTF flag is not set.
Remove pass numbers for ehci/ohci now that the attach order no longer matters
Use unsigned char for ctype functions, suggested by christos
Add : to body of populate_sunxi to appease bash.
port-evbarm/52388: Fix number of args to a debug printf.
 1.36.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.36.6.1 10-Jun-2019  christos Sync with HEAD
 1.36.4.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.39.2.2 03-Apr-2021  thorpej Sync with HEAD.
 1.39.2.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.46.2.1 03-Apr-2021  thorpej - FDT device enumeration now sets the device handle using CFARG_DEVHANDLE.
- fdtbus_device_register() is now obsolete, so G/C it.
- of_device_register() is now obsolete, so G/C it.
 1.47.12.1 09-Aug-2021  thorpej Port over the changes from thorpej-i2c-spi-conf to thorpej-i2c-spi-conf2,
which is based on a newer HEAD revision.
 1.47.2.2 14-May-2021  thorpej Deal with quirks / differences in OpenFirmware implementations'
interpreation of the i2c "reg" property by embedding knowledge
of those quicks directly, rather than forcing lots of drivers
to provide their own devhandle implementations. We default to
assuming the Device Tree bindings, and tweak based on platform-
specific #ifdefs.

Start with __HAVE_OPENFIRMWARE_VARIANT_AAPL (all i2c "reg" properties
encode an address that's shifted left 1 bit to account for the R/W bit
that appears on the wire).
 1.47.2.1 25-Apr-2021  thorpej Implement "i2c-enumerate-devices" for OFW / FDT.
 1.15 06-Dec-2019  mrg revert this change from early this year. it appears the
changes macallan@ commited to fix FIRMWORKSBUGS issues
in openfirmware() have fixed the hangs seen on PegasosII.

hooray!

---
Log Message:
workaround a problem with the pegasos firmware interface:
attempting to use /dev/openfirm on this machine hangs hard.

this isn't a new problem, and i've been meaning to try to
figure it out for years, but it's become a problem since
the xf86-video-radeon driver gained code to look for the
macppc model using this interface.

this is why xorg-server 1.18 and 1.20 hang recently on the
pegasosII.

this change is fairly ugly but i couldn't think of a less
ugly method to avoid /dev/openfirm working just on this
one platform. introduce new __OPENFIRMIO_OPEN_CHECK_BROKEN
macro and associated __openfirmio_open_check_broken(), and
use them in the new openfirmopen() to fail opens.

include proplib.h in macppc and ofppc autoconf.h since they
use it.
---
 1.14 08-Jan-2019  mrg workaround a problem with the pegasos firmware interface:
attempting to use /dev/openfirm on this machine hangs hard.

this isn't a new problem, and i've been meaning to try to
figure it out for years, but it's become a problem since
the xf86-video-radeon driver gained code to look for the
macppc model using this interface.

this is why xorg-server 1.18 and 1.20 hang recently on the
pegasosII.


this change is fairly ugly but i couldn't think of a less
ugly method to avoid /dev/openfirm working just on this
one platform. introduce new __OPENFIRMIO_OPEN_CHECK_BROKEN
macro and associated __openfirmio_open_check_broken(), and
use them in the new openfirmopen() to fail opens.

include proplib.h in macppc and ofppc autoconf.h since they
use it.
 1.13 25-Jul-2014  dholland branches: 1.13.26; 1.13.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.12 16-Mar-2014  dholland branches: 1.12.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.11 04-Mar-2007  christos branches: 1.11.76; 1.11.86; 1.11.92;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 28-Feb-2007  macallan enable ioctl(OFIOCSET) so eeprom can actually change PROM settings on
OpenFirmware machines
 1.9 11-Dec-2005  christos branches: 1.9.26;
merge ktrace-lwp.
 1.8 07-Aug-2003  agc branches: 1.8.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.7 29-Jun-2003  fvdl branches: 1.7.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.6 29-Jun-2003  darrenr 'struct proc *' -> 'struct lwp *' as required to get GENERIC for macppc built
 1.5 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.4 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.3 13-Nov-2001  lukem branches: 1.3.8;
add RCSIDs
 1.2 14-Nov-2000  matt branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
some cleanup. Add back OFIOCGETOPTNODE.
 1.1 14-Nov-2000  matt Add openfirmio which is an ioctl interface to OpenFirmware.
 1.2.8.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.2.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.2.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.3 11-Nov-2002  nathanw Catch up to -current
 1.2.4.2 17-Sep-2002  nathanw Catch up to -current.
 1.2.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.2.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.2.2.1 14-Nov-2000  bouyer file openfirmio.c was added on branch thorpej_scsipi on 2000-11-22 16:03:57 +0000
 1.3.8.1 16-May-2002  gehenna Add the character device switch.
 1.7.2.4 21-Nov-2004  skrll Adapt to branch.
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.2 03-Sep-2007  yamt sync with head.
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.92.1 18-May-2014  rmind sync with head
 1.11.86.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.76.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.12.2.1 10-Aug-2014  tls Rebase.
 1.13.28.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.13.28.1 10-Jun-2019  christos Sync with HEAD
 1.13.26.1 18-Jan-2019  pgoyette Synch with HEAD
 1.7 06-Sep-2015  dholland More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
 1.6 11-Dec-2005  christos branches: 1.6.120; 1.6.140;
merge ktrace-lwp.
 1.5 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.4 06-Sep-2002  gehenna branches: 1.4.6;
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.3 08-Jun-2001  matt branches: 1.3.2; 1.3.4; 1.3.14;
Add multiple inclusion protection. Define prototypes for openfirm
routines used in cdevsw.
 1.2 14-Nov-2000  matt branches: 1.2.2; 1.2.4;
Add OFIOCGETOPTNODE (now that I know how to implement it).
 1.1 14-Nov-2000  matt Add openfirmio which is an ioctl interface to OpenFirmware.
 1.2.4.2 17-Sep-2002  nathanw Catch up to -current.
 1.2.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.2.2.1 14-Nov-2000  bouyer file openfirmio.h was added on branch thorpej_scsipi on 2000-11-22 16:04:00 +0000
 1.3.14.1 16-May-2002  gehenna Remove some prototypes.
 1.3.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.3.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.140.1 22-Sep-2015  skrll Sync with HEAD
 1.6.120.1 03-Dec-2017  jdolecek update from HEAD

RSS XML Feed