Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen/xen APIC related macros are mixed with IOAPIC r...
details: https://anonhg.NetBSD.org/src/rev/2e4fe4f4375a
branches: trunk
changeset: 355378:2e4fe4f4375a
user: cherry <cherry%NetBSD.org@localhost>
date: Fri Jul 28 07:42:41 2017 +0000
description:
APIC related macros are mixed with IOAPIC related ones.
This needs separation.
Until then, band-aid it.
This fixes pci-passthrough build failures on XEN3_DOMU pointed out by
msaitoh@
diffstat:
sys/arch/xen/xen/pci_intr_machdep.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diffs (54 lines):
diff -r de5dd45ece76 -r 2e4fe4f4375a sys/arch/xen/xen/pci_intr_machdep.c
--- a/sys/arch/xen/xen/pci_intr_machdep.c Fri Jul 28 03:58:54 2017 +0000
+++ b/sys/arch/xen/xen/pci_intr_machdep.c Fri Jul 28 07:42:41 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_intr_machdep.c,v 1.19 2017/07/16 14:02:48 cherry Exp $ */
+/* $NetBSD: pci_intr_machdep.c,v 1.20 2017/07/28 07:42:41 cherry Exp $ */
/*
* Copyright (c) 2005 Manuel Bouyer.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.19 2017/07/16 14:02:48 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.20 2017/07/28 07:42:41 cherry Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -61,6 +61,15 @@
#include <machine/mpacpi.h>
#endif
+/* XXX: cherry@: Hack - this is a symptom of lapic vs. ioapic
+ * needing more code separation.
+ */
+#if NIOAPIC > 0
+#define IRQ_LEGACY_IRQ(_irq) APIC_IRQ_LEGACY_IRQ(_irq)
+#else
+#define IRQ_LEGACY_IRQ(_irq) (_irq & 0xff)
+#endif
+
int
pci_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
@@ -157,7 +166,7 @@
{
int evtch;
- evtch = get_pirq_to_evtch(APIC_IRQ_LEGACY_IRQ(ih));
+ evtch = get_pirq_to_evtch(IRQ_LEGACY_IRQ(ih));
#if NIOAPIC > 0
struct ioapic_softc *pic;
if (ih & APIC_INT_VIA_APIC) {
@@ -217,8 +226,8 @@
#endif
snprintf(evname, sizeof(evname), "irq%"PRIu64, intrh);
- return (void *)pirq_establish(APIC_IRQ_LEGACY_IRQ(intrh),
- get_pirq_to_evtch(APIC_IRQ_LEGACY_IRQ(intrh)), func, arg, level, evname);
+ return (void *)pirq_establish(IRQ_LEGACY_IRQ(intrh),
+ get_pirq_to_evtch(IRQ_LEGACY_IRQ(intrh)), func, arg, level, evname);
}
void
Home |
Main Index |
Thread Index |
Old Index