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)
Nov 22 2024, 2:25 PM
Unknown Object (File)
Oct 22 2024, 6:16 PM
Unknown Object (File)
Oct 22 2024, 3:34 AM
Unknown Object (File)
Oct 20 2024, 2:51 AM
Unknown Object (File)
Oct 2 2024, 12:35 PM
Unknown Object (File)
Oct 2 2024, 8:06 AM
Unknown Object (File)
Oct 1 2024, 2:59 AM
Unknown Object (File)
Oct 1 2024, 1:38 AM
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