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
F163570809: D43442.id.diff
Fri, Jul 24, 2:45 PM
Unknown Object (File)
Sun, Jul 19, 10:13 PM
Unknown Object (File)
Wed, Jul 15, 7:57 PM
Unknown Object (File)
Sun, Jul 5, 6:59 PM
Unknown Object (File)
Jun 23 2026, 10:49 AM
Unknown Object (File)
May 30 2026, 7:10 PM
Unknown Object (File)
May 29 2026, 3:00 PM
Unknown Object (File)
May 17 2026, 3:16 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