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)
Thu, May 2, 7:43 PM
Unknown Object (File)
Sat, Apr 27, 2:38 AM
Unknown Object (File)
Mon, Apr 22, 8:32 AM
Unknown Object (File)
Apr 12 2024, 8:46 AM
Unknown Object (File)
Apr 4 2024, 2:07 PM
Unknown Object (File)
Mar 5 2024, 5:07 PM
Unknown Object (File)
Mar 2 2024, 4:42 PM
Unknown Object (File)
Feb 19 2024, 10:14 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