Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Change the name of xen_pirq_alloc() to xen_vec_allo...



details:   https://anonhg.NetBSD.org/src/rev/78e81900ba8a
branches:  trunk
changeset: 993879:78e81900ba8a
user:      cherry <cherry%NetBSD.org@localhost>
date:      Sat Oct 06 16:49:54 2018 +0000

description:
Change the name of xen_pirq_alloc() to xen_vec_alloc() to reflect
its actual job.

The idea is that we will strip this down until it is as close to
idt_vec_alloc() as possible.

diffstat:

 sys/arch/x86/x86/intr.c     |   7 ++++---
 sys/arch/xen/include/intr.h |   4 ++--
 sys/arch/xen/x86/pintr.c    |  16 +++++++---------
 3 files changed, 13 insertions(+), 14 deletions(-)

diffs (99 lines):

diff -r dcd828dcffff -r 78e81900ba8a sys/arch/x86/x86/intr.c
--- a/sys/arch/x86/x86/intr.c   Sat Oct 06 16:44:55 2018 +0000
+++ b/sys/arch/x86/x86/intr.c   Sat Oct 06 16:49:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.131 2018/10/06 16:44:55 cherry Exp $        */
+/*     $NetBSD: intr.c,v 1.132 2018/10/06 16:49:54 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.131 2018/10/06 16:44:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.132 2018/10/06 16:49:54 cherry Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -1290,7 +1290,8 @@
        intrstr = intr_create_intrid(irq, pic, pin, intrstr_buf,
            sizeof(intrstr_buf));
 
-       vector = xen_pirq_alloc(&irq, type);
+       vector = xen_vec_alloc(irq);
+       irq = vect2irq[vector];
        irq = (legacy_irq == -1) ? irq : legacy_irq; /* ISA compat */
 
 #if NIOAPIC > 0
diff -r dcd828dcffff -r 78e81900ba8a sys/arch/xen/include/intr.h
--- a/sys/arch/xen/include/intr.h       Sat Oct 06 16:44:55 2018 +0000
+++ b/sys/arch/xen/include/intr.h       Sat Oct 06 16:49:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.46 2018/06/24 13:35:32 jdolecek Exp $       */
+/*     $NetBSD: intr.h,v 1.47 2018/10/06 16:49:54 cherry Exp $ */
 /*     NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp       */
 
 /*-
@@ -71,7 +71,7 @@
 #endif
 
 #if defined(DOM0OPS) || NPCI > 0
-int xen_pirq_alloc(intr_handle_t *, int);
+int xen_vec_alloc(intr_handle_t);
 #endif /* defined(DOM0OPS) || NPCI > 0 */
 
 #ifdef MULTIPROCESSOR
diff -r dcd828dcffff -r 78e81900ba8a sys/arch/xen/x86/pintr.c
--- a/sys/arch/xen/x86/pintr.c  Sat Oct 06 16:44:55 2018 +0000
+++ b/sys/arch/xen/x86/pintr.c  Sat Oct 06 16:49:54 2018 +0000
@@ -103,7 +103,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pintr.c,v 1.5 2018/10/06 16:44:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pintr.c,v 1.6 2018/10/06 16:49:54 cherry Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -160,10 +160,10 @@
 
 #if defined(DOM0OPS) || NPCI > 0
 int
-xen_pirq_alloc(intr_handle_t *pirq, int type)
+xen_vec_alloc(intr_handle_t pirq)
 {
        physdev_op_t op;
-       int irq = *pirq;
+       int irq = pirq;
 #if NIOAPIC > 0
 
        /*
@@ -178,14 +178,14 @@
         * or none is available.
         */
        static int xen_next_irq = 200;
-       struct ioapic_softc *ioapic = ioapic_find(APIC_IRQ_APIC(*pirq));
-       int pin = APIC_IRQ_PIN(*pirq);
+       struct ioapic_softc *ioapic = ioapic_find(APIC_IRQ_APIC(pirq));
+       int pin = APIC_IRQ_PIN(pirq);
 
-       if (*pirq & APIC_INT_VIA_APIC) {
+       if (pirq & APIC_INT_VIA_APIC) {
                irq = vect2irq[ioapic->sc_pins[pin].ip_vector];
                if (ioapic->sc_pins[pin].ip_vector == 0 || irq == 0) {
                        /* allocate IRQ */
-                       irq = APIC_IRQ_LEGACY_IRQ(*pirq);
+                       irq = APIC_IRQ_LEGACY_IRQ(pirq);
                        if (irq <= 0 || irq > 15)
                                irq = xen_next_irq--;
 retry:
@@ -207,8 +207,6 @@
                                 vect2irq[op.u.irq_op.vector] == irq));
                        vect2irq[op.u.irq_op.vector] = irq;
                }
-               *pirq &= ~0xff;
-               *pirq |= irq;
        } else
 #endif /* NIOAPIC */
        {



Home | Main Index | Thread Index | Old Index