Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/pci fix build of amd64/i386 with NO_PCI_MSI_MSI...



details:   https://anonhg.NetBSD.org/src/rev/eb915344fa06
branches:  trunk
changeset: 349187:eb915344fa06
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Mon Nov 28 05:00:41 2016 +0000

description:
fix build of amd64/i386 with NO_PCI_MSI_MSIX option.

diffstat:

 sys/arch/x86/pci/pci_intr_machdep.c |  25 +++++++++++++++++++------
 sys/arch/x86/pci/pci_msi_machdep.c  |  14 ++++++++++++--
 2 files changed, 31 insertions(+), 8 deletions(-)

diffs (161 lines):

diff -r 98a7b3e072e0 -r eb915344fa06 sys/arch/x86/pci/pci_intr_machdep.c
--- a/sys/arch/x86/pci/pci_intr_machdep.c       Mon Nov 28 04:18:08 2016 +0000
+++ b/sys/arch/x86/pci/pci_intr_machdep.c       Mon Nov 28 05:00:41 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_intr_machdep.c,v 1.38 2016/07/11 06:14:51 knakahara Exp $  */
+/*     $NetBSD: pci_intr_machdep.c,v 1.39 2016/11/28 05:00:41 knakahara Exp $  */
 
 /*-
  * Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.38 2016/07/11 06:14:51 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.39 2016/11/28 05:00:41 knakahara Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -274,8 +274,8 @@
        }
 }
 
-void *
-pci_intr_establish_xname(pci_chipset_tag_t pc, pci_intr_handle_t ih,
+static void *
+pci_intr_establish_xname_internal(pci_chipset_tag_t pc, pci_intr_handle_t ih,
     int level, int (*func)(void *), void *arg, const char *xname)
 {
        int pin, irq;
@@ -331,9 +331,20 @@
     int level, int (*func)(void *), void *arg)
 {
 
-       return pci_intr_establish_xname(pc, ih, level, func, arg, "unknown");
+       return pci_intr_establish_xname_internal(pc, ih, level, func, arg, "unknown");
 }
 
+#ifdef __HAVE_PCI_MSI_MSIX
+void *
+pci_intr_establish_xname(pci_chipset_tag_t pc, pci_intr_handle_t ih,
+    int level, int (*func)(void *), void *arg, const char *xname)
+{
+
+       return pci_intr_establish_xname_internal(pc, ih, level, func, arg, xname);
+}
+#endif
+
+
 void
 pci_intr_disestablish(pci_chipset_tag_t pc, void *cookie)
 {
@@ -351,6 +362,7 @@
 }
 
 #if NIOAPIC > 0
+#ifdef __HAVE_PCI_MSI_MSIX
 pci_intr_type_t
 pci_intr_type(pci_chipset_tag_t pc, pci_intr_handle_t ih)
 {
@@ -544,4 +556,5 @@
        }
 
 }
-#endif
+#endif /* __HAVE_PCI_MSI_MSIX */
+#endif /*  NIOAPIC > 0 */
diff -r 98a7b3e072e0 -r eb915344fa06 sys/arch/x86/pci/pci_msi_machdep.c
--- a/sys/arch/x86/pci/pci_msi_machdep.c        Mon Nov 28 04:18:08 2016 +0000
+++ b/sys/arch/x86/pci/pci_msi_machdep.c        Mon Nov 28 05:00:41 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_msi_machdep.c,v 1.9 2015/08/17 06:16:03 knakahara Exp $    */
+/*     $NetBSD: pci_msi_machdep.c,v 1.10 2016/11/28 05:00:41 knakahara Exp $   */
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.9 2015/08/17 06:16:03 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.10 2016/11/28 05:00:41 knakahara Exp $");
 
 #include "opt_intrdebug.h"
 
@@ -88,6 +88,7 @@
        return pih;
 }
 
+#ifdef __HAVE_PCI_MSI_MSIX
 static pci_intr_handle_t *
 pci_msi_alloc_vectors(struct pic *msi_pic, uint *table_indexes, int *count)
 {
@@ -130,6 +131,7 @@
 
        return vectors;
 }
+#endif /* __HAVE_PCI_MSI_MSIX */
 
 static void
 pci_msi_free_vectors(struct pic *msi_pic, pci_intr_handle_t *pihs, int count)
@@ -151,6 +153,7 @@
        kmem_free(pihs, sizeof(pihs[0]) * count);
 }
 
+#ifdef __HAVE_PCI_MSI_MSIX
 static int
 pci_msi_alloc_common(pci_intr_handle_t **ihps, int *count,
     const struct pci_attach_args *pa, bool exact)
@@ -205,6 +208,7 @@
        *ihps = vectors;
        return 0;
 }
+#endif /* __HAVE_PCI_MSI_MSIX */
 
 static void *
 pci_msi_common_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih,
@@ -231,6 +235,7 @@
        intr_disestablish(cookie);
 }
 
+#ifdef __HAVE_PCI_MSI_MSIX
 static int
 pci_msix_alloc_common(pci_intr_handle_t **ihps, u_int *table_indexes,
     int *count, const struct pci_attach_args *pa, bool exact)
@@ -299,6 +304,7 @@
 
        return pci_msi_alloc_common(ihps, &count, pa, true);
 }
+#endif /* __HAVE_PCI_MSI_MSIX */
 
 static void
 x86_pci_msi_release_internal(pci_intr_handle_t *pihs, int count)
@@ -313,6 +319,7 @@
        msipic_destruct_msi_pic(pic);
 }
 
+#ifdef __HAVE_PCI_MSI_MSIX
 static int
 x86_pci_msix_alloc(pci_intr_handle_t **ihps, int *count,
     const struct pci_attach_args *pa)
@@ -336,6 +343,7 @@
 
        return pci_msix_alloc_common(ihps, table_indexes, &count, pa, true);
 }
+#endif /* __HAVE_PCI_MSI_MSIX */
 
 static void
 x86_pci_msix_release_internal(pci_intr_handle_t *pihs, int count)
@@ -467,6 +475,7 @@
        pci_msi_common_disestablish(pc, cookie);
 }
 
+#ifdef __HAVE_PCI_MSI_MSIX
 /*****************************************************************************/
 /*
  * extern for MI code.
@@ -638,3 +647,4 @@
 
        return x86_pci_msix_alloc_map(ihps, table_indexes, count, pa);
 }
+#endif /* __HAVE_PCI_MSI_MSIX */



Home | Main Index | Thread Index | Old Index