HomeFreeBSD

new-bus: Introduce a simpler bus API for managing resources

Description

new-bus: Introduce a simpler bus API for managing resources

Remove the 'type' and 'rid' arguments from the wrapper bus API
functions (e.g. bus_release_resource) that accept a struct resource.
The "new" versions extract the 'type' and/or 'rid' from the passed in
resource object via rman_get_type and rman_get_rid.

This commit adds the new API as functions with a _new suffix. Wrapper
macros choose between the old and new functions based on the number of
arguments provided to the macro. This commit does not change the ABI
but can be safely MFCd to older branches so long as older kernels use
rman_set_type when allocating resources.

Future commits will push the removal of these extraneous arguments
through the bus implementation.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44124

Details

Provenance
jhbAuthored on Mar 13 2024, 10:05 PM
Reviewer
imp
Differential Revision
D44124: new-bus: Introduce a simpler bus API for managing resources
Parents
rG1b9bcffff39a: sys: Set the type of allocated bus resources
Branches
Unknown
Tags
Unknown