diff --git a/sys/arch/x86/pci/pci_intr_machdep.c b/sys/arch/x86/pci/pci_intr_machdep.c index cf1116df3857..5bba2c1460bc 100644 --- a/sys/arch/x86/pci/pci_intr_machdep.c +++ b/sys/arch/x86/pci/pci_intr_machdep.c @@ -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 -__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 #include @@ -274,8 +274,8 @@ pci_intr_setattr(pci_chipset_tag_t pc, pci_intr_handle_t *ih, } } -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 @@ pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, 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 pc, void *cookie) } #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, pci_intr_handle_t *pih, int count) } } -#endif +#endif /* __HAVE_PCI_MSI_MSIX */ +#endif /* NIOAPIC > 0 */ diff --git a/sys/arch/x86/pci/pci_msi_machdep.c b/sys/arch/x86/pci/pci_msi_machdep.c index f3f14d935ac0..9b2cdf7a9d17 100644 --- a/sys/arch/x86/pci/pci_msi_machdep.c +++ b/sys/arch/x86/pci/pci_msi_machdep.c @@ -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 -__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_pic, int vector) 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_pic, uint *table_indexes, int *count) 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, pci_intr_handle_t *pihs, int count) 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, int *count, *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_tag_t pc, void *cookie) 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_t **ihps, int count, 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_handle_t *pihs, int count) 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 **ihps, u_int *table_indexes, 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_tag_t pc, void *cookie) 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_attach_args *pa, pci_intr_handle_t **ihps, return x86_pci_msix_alloc_map(ihps, table_indexes, count, pa); } +#endif /* __HAVE_PCI_MSI_MSIX */