merge with xen-unstable.hg
authorawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Mon, 15 Jan 2007 22:15:26 +0000 (15:15 -0700)
committerawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Mon, 15 Jan 2007 22:15:26 +0000 (15:15 -0700)
1  2 
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c

index a1b7eafc4efdd421930d1086d9ef9245298b9458,409783c0c985560ef6dd23dd40b8648f1829b2d7..321a166d0596051fe162bd134357ea307121d581
@@@ -179,22 -179,24 +179,29 @@@ static int get_hypercall_stubs(void
  #define get_hypercall_stubs() (0)
  #endif
  
- static int get_callback_irq(struct pci_dev *pdev)
+ static uint64_t get_callback_via(struct pci_dev *pdev)
  {
  #ifdef __ia64__
 -      int irq;
 +      int irq, rid;
        for (irq = 0; irq < 16; irq++) {
                if (isa_irq_to_vector(irq) == pdev->irq)
                        return irq;
        }
 -      return 0;
 +      /* use Requester-ID as callback_irq */
 +      /* RID: '<#bus(8)><#dev(5)><#func(3)>' (cf. PCI-Express spec) */
 +      rid = ((pdev->bus->number & 0xff) << 8) | pdev->devfn;
 +      printk(KERN_INFO DRV_NAME ":use Requester-ID(%04x) as callback irq\n",
 +             rid);
 +      return rid | IA64_CALLBACK_IRQ_RID;
  #else /* !__ia64__ */
-       return pdev->irq;
+       if (pdev->irq < 16)
+               return pdev->irq; /* ISA IRQ */
+       /* We don't know the GSI. Specify the PCI INTx line instead. */
+       return (((uint64_t)0x01 << 56) | /* PCI INTx identifier */
+               ((uint64_t)pci_domain_nr(pdev->bus) << 32) |
+               ((uint64_t)pdev->bus->number << 16) |
+               ((uint64_t)(pdev->devfn & 0xff) << 8) |
+               ((uint64_t)(pdev->pin - 1) & 3));
  #endif
  }