Page MenuHomeFreeBSD

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

Authored by jhb on Feb 27 2024, 7:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 5:20 PM
Unknown Object (File)
Mon, Dec 2, 10:09 PM
Unknown Object (File)
Oct 9 2024, 5:02 PM
Unknown Object (File)
Sep 19 2024, 9:28 AM
Unknown Object (File)
Sep 18 2024, 11:35 PM
Unknown Object (File)
Sep 18 2024, 7:17 AM
Unknown Object (File)
Sep 17 2024, 3:20 PM
Unknown Object (File)
Sep 17 2024, 4:02 AM
Subscribers

Details

Summary

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

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56297
Build 53185: arc lint + arc unit

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