The wrapper functions such as bus_alloc_resource_any() still support
passing the rid by value or pointer, but the underlying implementation
now passes by value.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 68171 Build 65054: arc lint + arc unit
Event Timeline
This will need a __FreeBSD_version bump, and I know that at least drm-kmod will need an #if test based on that as it has an internal call to BUS_ALLOC_RESOURCE (not one of the wrapper functions) that needs to be patched after this.
I wonder if that FreeBSD specific code could actually be handled inside LinuxKPI as the #ifdef for pci_bus_alloc_resource() doesn't seem too complicated. That way at least the FreeBSD-specific code migrates into LinuxKPI and out of drm-kmod and that could be done upfront and once the all branches and the ports are updated this one can go in. Just asking. I am on the road so haven't done much due diligens.
I do not think it can. It isn't part of LinuxKPI per se, but has to do with vgpci0 being a pseudo-bus.
@manu This change causes a build breakage in drm-kmod that I have worked around locally with the patch below. I plan to bump __FreeBSD_version when committing this, and just want to coordinate on the fix as I won't know the new version number until I actually push the change.
diff --git a/drivers/gpu/drm/i915/intel_freebsd.c b/drivers/gpu/drm/i915/intel_freebsd.c index 3a8a3b9fa5..37bf3a7c62 100644 --- a/drivers/gpu/drm/i915/intel_freebsd.c +++ b/drivers/gpu/drm/i915/intel_freebsd.c @@ -58,7 +58,7 @@ bsd_intel_pci_bus_alloc_mem(device_t dev, int *rid, uintmax_t size, vga = device_get_parent(dev); res = BUS_ALLOC_RESOURCE(device_get_parent(vga), dev, SYS_RES_MEMORY, - rid, 0, ~0UL, size, RF_ACTIVE | RF_SHAREABLE); + *rid, 0, ~0UL, size, RF_ACTIVE | RF_SHAREABLE); if (res != NULL) { *start = rman_get_start(res); *end = rman_get_end(res);
I also don't know if you want to fix this differently in your tree.