cvs commit: src/sys/i386/pci pci_pir.c

John Baldwin jhb at FreeBSD.org
Wed Feb 18 14:40:25 PST 2004


jhb         2004/02/18 14:40:23 PST

  FreeBSD src repository

  Modified files:
    sys/i386/pci         pci_pir.c 
  Log:
  Rework the $PIR (aka PCIBIOS) PCI interrupt routing code and split it off
  into its own file:
  - All of the $PIR interrupt routing is now done in a link-centric fashion.
    When a host-PCI bridge that uses the $PIR attaches, it calls pir_parse()
    to parse the table.  This scans for link devices and merges all the masks
    for each link device from the table entries.  It then looks at the intline
    register of PCI devices connected to a link to figure out if the BIOS has
    routed this link and if so to which IRQ.
  - The IRQ for any given link can be overridden via a hint like so:
    'hw.pci.link.0x62.irq=10'  Any IRQ set in this matter is treated as if it
    were set that way by the BIOS.
  - We only call the BIOS to route each link device once.
  - When a PCI device wants to route an interrupt, we look it up in the $PIR
    to find the associated link.  If the link is routed, we simply return the
    IRQ it is using.  If it is not routed, we have to pick one.  This uses a
    different algorithm from the old code.  First off, when we try to pick
    an interrupt from a mask of possible interrupts, we try to pick the one
    that is least loaded as far as PCI devices.  We maintain this weight based
    on the number of devices attached to each link device.  When choosing an
    IRQ, we first attempt to route using any PCI only interrupts (the old
    code did this as well).  If that doesn't work, we try to use the list of
    IRQs that the BIOS has used.  This is a new step that the new code didn't
    do and avoids using IRQ 3 or 4 for every virgin interrupt routing.  If
    none of the IRQs that the BIOS used worked, then we fall back to trying
    anything.
  - The fallback mask for !PC98 was fixed to include IRQ 3 and not allow IRQ
    2.
  - We don't use the $PIR to route interrupts on a PCI-PCI bridge unless it
    has already been used to route on at least one Host-PCI bridge.  This
    helps to avoid mixing and matching x86 firmware PCI interrupt routing
    methods (which is a Bad Thing(tm)).
  
  Silence on:     current@
  
  Revision  Changes    Path
  1.109     +447 -611  src/sys/i386/pci/pci_pir.c


More information about the cvs-src mailing list