summaryrefslogtreecommitdiff
path: root/sys/arch/i386/pci
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2012-09-21 14:07:47 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2012-09-21 14:07:47 +0000
commit435dd7662458f4444988e5c2144782dff64f14bf (patch)
treeb522898b99bbcd9a529d0ed85fda68e29ac969f5 /sys/arch/i386/pci
parent2f35e8059795c4730b5105914752f8883b1bc691 (diff)
Make sure we send MSIs to the primary CPU like we do on amd64.
Based on a diff from Christian Ehrhardt.
Diffstat (limited to 'sys/arch/i386/pci')
-rw-r--r--sys/arch/i386/pci/pci_machdep.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c
index b513acf36fa..8d0033a9edd 100644
--- a/sys/arch/i386/pci/pci_machdep.c
+++ b/sys/arch/i386/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.70 2012/09/19 23:03:12 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.71 2012/09/21 14:07:46 kettenis Exp $ */
/* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */
/*-
@@ -780,7 +780,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;
- pcireg_t reg;
+ pcireg_t reg, addr;
int off, vec;
if (pci_get_capability(pc, tag, PCI_CAP_MSI, &off, &reg) == 0)
@@ -807,12 +807,14 @@ pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
apic_intrhand[vec] = ih;
idt_vec_set(vec, apichandler[vec & 0xf]);
+ addr = 0xfee00000UL | (cpu_info_primary.apicid << 12);
+
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);