Page MenuHomeFreeBSD

bus_alloc_resource: First step in passing resource IDs by value
ClosedPublic

Authored by jhb on Tue, Oct 28, 5:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 4, 7:22 PM
Unknown Object (File)
Mon, Nov 3, 5:12 PM
Unknown Object (File)
Fri, Oct 31, 8:50 PM
Unknown Object (File)
Fri, Oct 31, 8:50 PM
Unknown Object (File)
Fri, Oct 31, 4:19 PM
Unknown Object (File)
Fri, Oct 31, 4:19 PM
Unknown Object (File)
Wed, Oct 29, 1:53 AM
Unknown Object (File)
Tue, Oct 28, 11:52 PM
Subscribers

Details

Summary

Add wrapper inline functions for bus_alloc_resource* that accept a
resource ID by value (instead of a pointer). The rest of the bus
resource API (outside of compat shims) does not accept resource IDs as
arguments, but instead obtains the resource ID from the resource
itself when needed. As such, there is no reason to return any
potentially modified resource IDs to the caller.

Diff Detail

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

Event Timeline

jhb requested review of this revision.Tue, Oct 28, 5:17 PM

This will also need a __FreeBSD_version bump. I intend to merge this back to the stable branches that support the newer bus_release_resource such as stable/14 and stable/15.

Nice transition work with _Generic.

sys/sys/bus.h
644

Do we want to mark this for removal in 16 sometime?

This revision is now accepted and ready to land.Tue, Oct 28, 10:40 PM
sys/sys/bus.h
644

There's not a good way to mark it. I plan to remove the earlier compat shims below this in 16 and when fixing drivers to stop passing type/rid to the other functions, I will probably fix them for this change at the same time, so probably I will be able to remove then.