diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-06-05 10:07:31 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-06-05 10:07:31 +0000 |
commit | 46f09f74bc33db43b362a6fb6b4cf2c606eced10 (patch) | |
tree | 9bacf70236e8d66b008c4f40b3a9943124d7fea3 | |
parent | 03bdd660cde088ba7bed52e0fdd8cb45cd4092bc (diff) |
Direct MSIs at the appropriate CPU.
-rw-r--r-- | sys/arch/amd64/pci/pci_machdep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c index 1e0d562e10e..85346919afa 100644 --- a/sys/arch/amd64/pci/pci_machdep.c +++ b/sys/arch/amd64/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.47 2011/06/02 19:59:00 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.48 2011/06/05 10:07:30 kettenis Exp $ */ /* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -498,7 +498,7 @@ pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level, if (ih.line & APIC_INT_VIA_MSG) { struct intrhand *ih; struct intrsource *source; - pcireg_t reg; + pcireg_t reg, addr; int off, vec; if (pci_get_capability(pc, tag, PCI_CAP_MSI, &off, ®) == 0) @@ -510,14 +510,15 @@ pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level, return (NULL); source = ih->ih_cpu->ci_isources[ih->ih_slot]; + addr = 0xfee00000UL | (ih->ih_cpu->ci_apicid << 12); vec = source->is_idtvec; if (reg & PCI_MSI_MC_C64) { - pci_conf_write(pc, tag, off + PCI_MSI_MA, 0xfee00000); + pci_conf_write(pc, tag, off + PCI_MSI_MA, addr); pci_conf_write(pc, tag, off + PCI_MSI_MAU32, 0); pci_conf_write(pc, tag, off + PCI_MSI_MD64, vec); } else { - pci_conf_write(pc, tag, off + PCI_MSI_MA, 0xfee00000); + pci_conf_write(pc, tag, off + PCI_MSI_MA, addr); pci_conf_write(pc, tag, off + PCI_MSI_MD32, vec); } pci_conf_write(pc, tag, off, reg | PCI_MSI_MC_MSIE); |