summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-12-09 21:52:53 +0000
committerjhb <jhb@FreeBSD.org>2009-12-09 21:52:53 +0000
commit2f9d87159f5d613da2c056aaac7bd15b0ff65321 (patch)
tree78b5b1cc0d0ca2bef712c38d3b03a18d90c486b4 /usr.bin
parent406b6e267438bc964488f714b956cfc3a8de788f (diff)
downloadFreeBSD-src-2f9d87159f5d613da2c056aaac7bd15b0ff65321.zip
FreeBSD-src-2f9d87159f5d613da2c056aaac7bd15b0ff65321.tar.gz
For some buses, devices may have active resources assigned even though they
are not allocated by the device driver. These resources should still appear allocated from the system's perspective so that their assigned ranges are not reused by other resource requests. The PCI bus driver has used a hack to effect this for a while now where it uses rman_set_device() to assign devices to the PCI bus when they are first encountered and later assigns them to the actual device when a driver allocates a BAR. A few downsides of this approach is that it results in somewhat confusing devinfo -r output as well as not being very easily portable to other bus drivers. This commit adds generic support for "reserved" resources to the resource list API used by many bus drivers to manage the resources of child devices. A resource may be reserved via resource_list_reserve(). This will allocate the resource from the bus' parent without activating it. resource_list_alloc() recognizes an attempt to allocate a reserved resource. When this happens it activates the resource (if requested) and then returns the reserved resource. Similarly, when a reserved resource is released via resource_list_release(), it is deactivated (if it is active) and the resource is then marked reserved again, but is left allocated from the bus' parent. To completely remove a reserved resource, a bus driver may use resource_list_unreserve(). A bus driver may use resource_list_busy() to determine if a reserved resource is allocated by a child device or if it can be unreserved. The PCI bus driver has been changed to use this framework instead of abusing rman_set_device() to keep track of reserved vs allocated resources. Submitted by: imp (an older version many moons ago) MFC after: 1 month
Diffstat (limited to 'usr.bin')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud