1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-21 15:45:02 +00:00
freebsd/sys/dev/pci
John Baldwin 42a346fa63 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
2009-12-09 21:52:53 +00:00
..
eisa_pci.c
fixup_pci.c
hostb_pci.c
ignore_pci.c
isa_pci.c
pci_if.m Revamp the MSI/MSI-X code a bit to achieve two main goals: 2007-05-02 17:50:36 +00:00
pci_pci.c Revert junk from last commit. These are WIP and not ready (and don't 2009-05-20 22:00:39 +00:00
pci_private.h Further refine the handling of resources for BARs in the PCI bus driver. 2009-03-03 16:38:59 +00:00
pci_user.c pci(4): don't perform maximum register number check 2009-09-11 18:48:49 +00:00
pci.c For some buses, devices may have active resources assigned even though they 2009-12-09 21:52:53 +00:00
pcib_if.m Revert junk from last commit. These are WIP and not ready (and don't 2009-05-20 22:00:39 +00:00
pcib_private.h Two fixes: 2009-03-14 14:08:53 +00:00
pcireg.h number of cleanups in i386 and amd64 pci md code 2009-09-24 07:11:23 +00:00
pcivar.h pci: remove definitions of duplicate constants 2009-09-10 19:27:53 +00:00
vga_pci.c - Partially revert hackish r198964 and r199002. 2009-11-12 17:56:56 +00:00