Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Make the use of 'irqs' in the range 0 < irq < 255 b...



details:   https://anonhg.NetBSD.org/src/rev/e3bb397eeb3f
branches:  trunk
changeset: 433362:e3bb397eeb3f
user:      cherry <cherry%NetBSD.org@localhost>
date:      Mon Sep 10 05:08:55 2018 +0000

description:
Make the use of 'irqs' in the range 0 < irq < 255 by xen
as a handle for internal use explicit.

This allows us to pass up the handle as "legacy" irq while
establishing interrupt handlers for xen.

No functional change.

diffstat:

 sys/arch/x86/x86/intr.c         |  11 +++++++----
 sys/arch/xen/include/intrdefs.h |   5 ++++-
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (56 lines):

diff -r fa1e2dd7cc09 -r e3bb397eeb3f sys/arch/x86/x86/intr.c
--- a/sys/arch/x86/x86/intr.c   Mon Sep 10 02:49:23 2018 +0000
+++ b/sys/arch/x86/x86/intr.c   Mon Sep 10 05:08:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.127 2018/07/03 11:45:54 kamil Exp $ */
+/*     $NetBSD: intr.c,v 1.128 2018/09/10 05:08:55 cherry Exp $        */
 
 /*
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.127 2018/07/03 11:45:54 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.128 2018/09/10 05:08:55 cherry Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -1266,15 +1266,18 @@
        intr_handle_t irq;
        int evtchn;
 
-       KASSERTMSG(legacy_irq == -1 || (0 <= legacy_irq && legacy_irq < 16),
+       KASSERTMSG(legacy_irq == -1 || (0 <= legacy_irq && legacy_irq < NUM_XEN_IRQS),
            "bad legacy IRQ value: %d", legacy_irq);
        KASSERTMSG(!(legacy_irq == -1 && pic == &i8259_pic),
            "non-legacy IRQon i8259 ");
 
        if (pic->pic_type != PIC_I8259) {
 #if NIOAPIC > 0
+               /* Are we passing mp tranmogrified/cascaded irqs ? */
+               irq = (legacy_irq == -1) ? 0 : legacy_irq;
+
                /* will do interrupts via I/O APIC */
-               irq = APIC_INT_VIA_APIC;
+               irq |= APIC_INT_VIA_APIC;
                irq |= pic->pic_apicid << APIC_INT_APIC_SHIFT;
                irq |= pin << APIC_INT_PIN_SHIFT;
 #else /* NIOAPIC */
diff -r fa1e2dd7cc09 -r e3bb397eeb3f sys/arch/xen/include/intrdefs.h
--- a/sys/arch/xen/include/intrdefs.h   Mon Sep 10 02:49:23 2018 +0000
+++ b/sys/arch/xen/include/intrdefs.h   Mon Sep 10 05:08:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intrdefs.h,v 1.12 2014/05/19 22:47:54 rmind Exp $ */
+/* $NetBSD: intrdefs.h,v 1.13 2018/09/10 05:08:55 cherry Exp $ */
 
 /* This file co-exists, and is included via machine/intrdefs.h */
 
@@ -17,4 +17,7 @@
 /* Note: IPI_KICK does not have a handler. */
 #define XEN_NIPIS              6
 
+/* The number of 'irqs' that XEN understands */
+#define NUM_XEN_IRQS           256
+
 #endif /* _XEN_INTRDEFS_H_ */



Home | Main Index | Thread Index | Old Index