Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Dec 2009 21:52:53 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/dev/pci pci.c src/sys/kern subr_bus.c src/sys/sys bus.h
Message-ID:  <200912092153.nB9Lrj4s071381@repoman.freebsd.org>

index | next in thread | raw e-mail

jhb         2009-12-09 21:52:53 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/pci          pci.c 
    sys/kern             subr_bus.c 
    sys/sys              bus.h 
  Log:
  SVN rev 200315 on 2009-12-09 21:52:53Z by jhb
  
  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
  
  Revision  Changes    Path
  1.391     +22 -62    src/sys/dev/pci/pci.c
  1.236     +151 -2    src/sys/kern/subr_bus.c
  1.92      +15 -0     src/sys/sys/bus.h


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912092153.nB9Lrj4s071381>