Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/subr_device.c
RevisionDateAuthorComments
 1.14  27-Aug-2024  thorpej - Remove devhandle_impl_inherit() and re-implement as devhandle_impl_subclass()
and a helper devhandle_subclass().
- Add a devhandle_t argument to device_call_generic(); don't imply it from
the device; let the device_call() wrapper own that logic.

(Ride the bump to 10.99.12; I've been sitting on this change for ages
waiting for a version bump to go by.)
 1.13  28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.12  03-Mar-2022  riastradh driver(9): New device_set_private.

Used to initialize a device_t's private pointer at most once. Only
for drivers with zero cfattach size so autoconf doesn't preallocate;
KASSERT checks for this mistake.
 1.11  22-Jan-2022  thorpej Add a function to compare 2 devhandles.
 1.10  21-Jan-2022  thorpej Replace devhandle_invalidate(), which invalidates a devhandle, with
devhandle_invalid(), which returns an invalid devhandle.
 1.9  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.8  07-Aug-2021  thorpej branches: 1.8.2;
Export devhandle_lookup_device_call().
 1.7  06-Feb-2021  thorpej branches: 1.7.4;
Fix a comment. Thanks rillig@ for pointing it out!
 1.6  05-Feb-2021  thorpej Introduce a generalized "device handle", designed to abstract the handles
used by platform description mechanisms like OpenFirmware, Device Tree,
and ACPI. In addition to encapsulating the handle's opaque value, the
handle also contains a pointer to an "implementation", which can be used
to invoke methods on a device / device handle.

Device handles are designed to be passed around by-value. It is expected
that any other memory objects they refer to will be durable. They are an
aggregate type that consumes 2 pointers worth of storage space.

When device_t's are created, they initially have an invalid device handle.
It is currently the responsibility of platform-specific code to assign
device handles to device_t's.

When necessary, platform-specific code can override a handle's implementation
in a way that resembles sub-classing, such that specific methods can by
intercepted, but others simply passed through. This also allows platforms
that do not otherwise have a platform description mechanism to provide
handle implementations in specific circumstances to describe the hardware
to platform-independent code.

A general device method calling infrastructure is provided. Method names
that begin with "device-" are reserved for / defined by the autoconfiguration
subsystem. Define the "device-enumerate-children" method. Other subsystems
are free to define their own device method calls and bindings.

Welcome to NetBSD 9.99.80.
 1.5  04-Feb-2021  thorpej Add device_attached_to_iattr(), which return true if the device
attached to the specified interface attribute.
 1.4  28-Jan-2021  thorpej In device_is_a(), handle dev or dev->dv_cfdriver being NULL. This
makes the calling pattern:

device_is_a(device_parent(dev), "whatever")

safe.
 1.3  09-Mar-2015  pooka branches: 1.3.30;
The use of root_device is not limited to vfs, so don't supply it in
vfs_mount.c, use subr_device.c instead.

Fixes rump kernels built with DEBUG by again not making the base depend
on the vfs faction, as reported by Patrick Welche.
 1.2  31-Jan-2010  pooka branches: 1.2.22; 1.2.40;
Device accessors are only marginally related to autoconf, so put them
into subr_device.c instead of having them in subr_autoconf.c.

Since none of the copyrights in subr_autoconf.c really match the
history of device accessors, I took the liberty of slapping (c)
2006 TNF onto subr_device.c.
 1.1  16-Dec-2007  cube branches: 1.1.2; 1.1.4; 1.1.12;
file subr_device.c was initially added on branch cube-autoconf.
 1.1.12.1  11-Mar-2010  yamt sync with head
 1.1.4.2  16-Dec-2007  cube file subr_device.c was initially added on branch cube-autoconf.
 1.1.4.1  16-Dec-2007  cube file subr_device.c was added on branch mjf-devfs on 2007-12-16 18:54:07 +0000
 1.1.2.2  30-Jan-2008  cube Allow device_private(NULL), returning NULL. It makes a lot of stuff
simpler, and in the situations where device_private was expected to crash,
it will soon enough anyway.
 1.1.2.1  16-Dec-2007  cube Split off device-specific stuff out of subr_autconf.c, and split off
autoconf-specific stuff out of device.h.

The only functional change is the removal of the unused evcnt.h include in
device.h which (*sigh*) has side-effects in x86's intr.h, and probably some
other in the rest of the tree but I'm only compiling i386's QEMU for the
time being.
 1.2.40.1  06-Apr-2015  skrll Sync with HEAD
 1.2.22.1  03-Dec-2017  jdolecek update from HEAD
 1.3.30.1  03-Apr-2021  thorpej Sync with HEAD.
 1.7.4.1  15-May-2021  thorpej Expose devhandle_lookup_device_call(), which can be useful when
"sub-classing" a devhandle implementation.
 1.8.2.1  11-Sep-2021  thorpej Add a devhandle_subclass() helper function to simplify the common case
and use it. Improve some comments.

RSS XML Feed