Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/fdt Use ARM_PCI_INTR_* definitions from pci_mac...



details:   https://anonhg.NetBSD.org/src/rev/6ca8b42f7bde
branches:  trunk
changeset: 452244:6ca8b42f7bde
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jun 23 22:06:03 2019 +0000

description:
Use ARM_PCI_INTR_* definitions from pci_machdep.h instead of own copies

diffstat:

 sys/arch/arm/fdt/pcihost_fdt.c |  17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diffs (66 lines):

diff -r bf8426570fab -r 6ca8b42f7bde sys/arch/arm/fdt/pcihost_fdt.c
--- a/sys/arch/arm/fdt/pcihost_fdt.c    Sun Jun 23 17:17:18 2019 +0000
+++ b/sys/arch/arm/fdt/pcihost_fdt.c    Sun Jun 23 22:06:03 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcihost_fdt.c,v 1.10 2019/06/12 22:47:03 jmcneill Exp $ */
+/* $NetBSD: pcihost_fdt.c,v 1.11 2019/06/23 22:06:03 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.10 2019/06/12 22:47:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.11 2019/06/23 22:06:03 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -53,9 +53,6 @@
 #include <arm/pci/pci_msi_machdep.h>
 #include <arm/fdt/pcihost_fdtvar.h>
 
-#define        IH_INDEX_MASK                   0x0000ffff
-#define        IH_MPSAFE                       0x80000000
-
 #define        PCIHOST_DEFAULT_BUS_MIN         0
 #define        PCIHOST_DEFAULT_BUS_MAX         255
 
@@ -572,7 +569,7 @@
        } else if (ih & ARM_PCI_INTR_MSI) {
                snprintf(buf, len, "irq %d (MSI vec %d)", irq, vec);
        } else {
-               specifier = pcihost_find_intr(sc, ih & IH_INDEX_MASK, &ihandle);
+               specifier = pcihost_find_intr(sc, ih & ARM_PCI_INTR_IRQ, &ihandle);
                if (specifier == NULL)
                        return NULL;
 
@@ -595,9 +592,9 @@
        switch (attr) {
        case PCI_INTR_MPSAFE:
                if (data)
-                       *ih |= IH_MPSAFE;
+                       *ih |= ARM_PCI_INTR_MPSAFE;
                else
-                       *ih &= ~IH_MPSAFE;
+                       *ih &= ~ARM_PCI_INTR_MPSAFE;
                return 0;
        default:
                return ENODEV;
@@ -609,14 +606,14 @@
     int (*callback)(void *), void *arg, const char *xname)
 {
        struct pcihost_softc *sc = v;
-       const int flags = (ih & IH_MPSAFE) ? FDT_INTR_MPSAFE : 0;
+       const int flags = (ih & ARM_PCI_INTR_MPSAFE) ? FDT_INTR_MPSAFE : 0;
        const u_int *specifier;
        int ihandle;
 
        if ((ih & (ARM_PCI_INTR_MSI | ARM_PCI_INTR_MSIX)) != 0)
                return arm_pci_msi_intr_establish(&sc->sc_pc, ih, ipl, callback, arg, xname);
 
-       specifier = pcihost_find_intr(sc, ih & IH_INDEX_MASK, &ihandle);
+       specifier = pcihost_find_intr(sc, ih & ARM_PCI_INTR_IRQ, &ihandle);
        if (specifier == NULL)
                return NULL;
 



Home | Main Index | Thread Index | Old Index