summaryrefslogtreecommitdiff
path: root/sys/arch/i386/pci
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2012-09-25 10:32:55 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2012-09-25 10:32:55 +0000
commit56d736e0acad2f7972cc7fdff77eec07415ba3b8 (patch)
tree9874f8ac575bdcd58db64098fc42a27756f62e7c /sys/arch/i386/pci
parentcff94cff536a71f84170a61092b9ce7c60644a8e (diff)
Make sure we send MSIs to the primary CPU like we do on amd64.
This is a fixed version reinstating the previous commit, fix from Christian Ehrhardt, same fix from brad@.
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 46b418550d6..334d5748f03 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.72 2012/09/22 11:02:36 sthen Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.73 2012/09/25 10:32:54 sthen 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.ci_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);