Page MenuHomeFreeBSD

simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY
ClosedPublic

Authored by jhb on Jan 12 2024, 10:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 8, 3:31 AM
Unknown Object (File)
Thu, Sep 25, 11:56 PM
Unknown Object (File)
Sep 6 2025, 5:06 AM
Unknown Object (File)
Aug 26 2025, 1:07 AM
Unknown Object (File)
Aug 15 2025, 12:57 AM
Unknown Object (File)
Aug 11 2025, 12:55 AM
Unknown Object (File)
Aug 11 2025, 12:42 AM
Unknown Object (File)
Aug 10 2025, 4:42 PM
Subscribers
None

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jan 12 2024, 10:33 PM
jhb created this revision.

If a driver calls bus_alloc_resource() with SYS_RES_IOPORT, it will also call bus_release_resource with SYS_RES_IOPORT during detach, so if a resource type is remapped it needs to be done so consistently.

It would be more ideal IMO if we only passed the 'type' to bus_alloc_resource and then saved the type in the returned struct resource (just as we save the rid today) so that other routines that acted on allocated resources like bus_activate_resource and bus_release_resource only passed in struct resource *r and the rid and type were obtained from r. However, that is a larger API change. We could play some games with macros to change these APIs in 15 perhaps similar to how I removed the devclass argument from DRIVER_MODULE in 14.

This revision is now accepted and ready to land.Jan 22 2024, 5:38 PM