Page MenuHomeFreeBSD

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

Authored by jhb on Feb 27 2024, 7:47 PM.
Referenced Files
Unknown Object (File)
Mon, Jun 17, 4:25 PM
Unknown Object (File)
Fri, May 31, 9:32 AM
Unknown Object (File)
Fri, May 24, 11:48 PM
Unknown Object (File)
May 13 2024, 10:12 PM
Unknown Object (File)
May 13 2024, 10:10 PM
Unknown Object (File)
May 13 2024, 1:20 PM
Unknown Object (File)
May 13 2024, 12:18 PM
Unknown Object (File)
May 6 2024, 4:03 AM



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 API
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.

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Feb 27 2024, 7:47 PM

This looks good, though having _new in the ABI seems a little weird... It would just be for the life of whatever branches you merge this to, though.

This revision is now accepted and ready to land.Mar 8 2024, 6:29 PM