cvs commit: src/sys/dev/acpica acpi_pci_link.c

John Baldwin jhb at
Tue Nov 30 09:53:41 PST 2004

On Tuesday 30 November 2004 01:55 am, Nate Lawson wrote:
> njl         2004-11-30 06:55:43 UTC
>   FreeBSD src repository
>   Modified files:
>     sys/dev/acpica       acpi_pci_link.c
>   Log:
>   Make sure the link array is big enough to hold both _CRS and _PRS
>   resource lists.  It used to be sized based only on _CRS, hence _PRS could
>   perform an out-of-bounds access if it was larger (i.e., when there are
>   dependent functions).  Add asserts to detect this case.  Note, this is
>   only a temporary fix and I believe _PRS and _CRS should have separate
>   arrays.
>   Also, fix a typo where the wrong irq was being check for the APIC case.
>   Submitted by:   tegge

The real fix is not separate arrays per se but real dependent function 
support.  We need a resource management concept of resource sets, so that 
each set of dependent resources with a dependent start/end pair are 
considered a set, and a driver can query 1) how many sets there are and 2) 
set the current set of resources.  Trying to use more resources than are in 
_CRS is probably a bug and might break _SRS on these machines.  Hmm, also, the 
code assumes when doing _SRS that the link indices are the resource indices, 
so you just broke _SRS for any link devices that have a non-IRQ resource. :(

What I think we should do for now is to only include the first resource set as 
the current resources for an ACPI device that has multiple resource sets 
instead of just including all the resources.  I'll try to work on this.

John Baldwin <jhb at>  <><
"Power Users Use the Power to Serve"  =

More information about the cvs-src mailing list