Module Name: src Committed By: knakahara Date: Mon Nov 28 05:00:41 UTC 2016
Modified Files: src/sys/arch/x86/pci: pci_intr_machdep.c pci_msi_machdep.c Log Message: fix build of amd64/i386 with NO_PCI_MSI_MSIX option. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/x86/pci/pci_intr_machdep.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/pci/pci_msi_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/pci/pci_intr_machdep.c diff -u src/sys/arch/x86/pci/pci_intr_machdep.c:1.38 src/sys/arch/x86/pci/pci_intr_machdep.c:1.39 --- src/sys/arch/x86/pci/pci_intr_machdep.c:1.38 Mon Jul 11 06:14:51 2016 +++ src/sys/arch/x86/pci/pci_intr_machdep.c Mon Nov 28 05:00:41 2016 @@ -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 @@ pci_intr_setattr(pci_chipset_tag_t pc, p } } -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,8 +331,19 @@ pci_intr_establish(pci_chipset_tag_t pc, 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 @@ pci_intr_disestablish(pci_chipset_tag_t } #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 @@ pci_intr_release(pci_chipset_tag_t pc, p } } -#endif +#endif /* __HAVE_PCI_MSI_MSIX */ +#endif /* NIOAPIC > 0 */ Index: src/sys/arch/x86/pci/pci_msi_machdep.c diff -u src/sys/arch/x86/pci/pci_msi_machdep.c:1.9 src/sys/arch/x86/pci/pci_msi_machdep.c:1.10 --- src/sys/arch/x86/pci/pci_msi_machdep.c:1.9 Mon Aug 17 06:16:03 2015 +++ src/sys/arch/x86/pci/pci_msi_machdep.c Mon Nov 28 05:00:41 2016 @@ -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 @@ pci_msi_calculate_handle(struct pic *msi 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 @@ pci_msi_alloc_vectors(struct pic *msi_pi 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 @@ pci_msi_free_vectors(struct pic *msi_pic 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 @@ pci_msi_alloc_common(pci_intr_handle_t * *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 @@ pci_msi_common_disestablish(pci_chipset_ 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 @@ x86_pci_msi_alloc_exact(pci_intr_handle_ 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 @@ x86_pci_msi_release_internal(pci_intr_ha 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 @@ x86_pci_msix_alloc_map(pci_intr_handle_t 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 @@ x86_pci_msix_disestablish(pci_chipset_ta pci_msi_common_disestablish(pc, cookie); } +#ifdef __HAVE_PCI_MSI_MSIX /*****************************************************************************/ /* * extern for MI code. @@ -638,3 +647,4 @@ pci_msix_alloc_map(const struct pci_atta return x86_pci_msix_alloc_map(ihps, table_indexes, count, pa); } +#endif /* __HAVE_PCI_MSI_MSIX */