Module Name: src Committed By: thorpej Date: Fri Feb 5 17:03:35 UTC 2021
Modified Files: src/sys/kern: subr_device.c src/sys/sys: device.h param.h Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/kern/subr_device.c cvs rdiff -u -r1.165 -r1.166 src/sys/sys/device.h cvs rdiff -u -r1.683 -r1.684 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.