Module Name: src Committed By: cherry Date: Sun Dec 2 08:19:44 UTC 2018
Modified Files: src/sys/arch/amd64/amd64: mainbus.c src/sys/arch/i386/i386: mainbus.c src/sys/arch/x86/pci: pci_intr_machdep.c src/sys/arch/x86/x86: intr.c Log Message: make options NO_PCI_MSI_MSIX work again for arch/x86/ To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/amd64/amd64/mainbus.c cvs rdiff -u -r1.103 -r1.104 src/sys/arch/i386/i386/mainbus.c cvs rdiff -u -r1.47 -r1.48 src/sys/arch/x86/pci/pci_intr_machdep.c cvs rdiff -u -r1.135 -r1.136 src/sys/arch/x86/x86/intr.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/amd64/amd64/mainbus.c diff -u src/sys/arch/amd64/amd64/mainbus.c:1.38 src/sys/arch/amd64/amd64/mainbus.c:1.39 --- src/sys/arch/amd64/amd64/mainbus.c:1.38 Tue May 23 08:54:38 2017 +++ src/sys/arch/amd64/amd64/mainbus.c Sun Dec 2 08:19:44 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.38 2017/05/23 08:54:38 nonaka Exp $ */ +/* $NetBSD: mainbus.c,v 1.39 2018/12/02 08:19:44 cherry Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.38 2017/05/23 08:54:38 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.39 2018/12/02 08:19:44 cherry Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -74,7 +74,9 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v #include <arch/x86/pci/pci_addr_fixup.h> #endif #endif +#ifdef __HAVE_PCI_MSI_MSIX #include <arch/x86/pci/msipic.h> +#endif /* __HAVE_PCI_MSI_MSIX */ #endif /* @@ -179,7 +181,9 @@ mainbus_attach(device_t parent, device_t #endif #if NPCI > 0 +#ifdef __HAVE_PCI_MSI_MSIX msipic_init(); +#endif /* * ACPI needs to be able to access PCI configuration space. @@ -209,9 +213,9 @@ mainbus_attach(device_t parent, device_t */ if (acpi_present) mpacpi_active = mpacpi_scan_apics(self, &numcpus) != 0; -#endif if (!mpacpi_active) { +#endif #ifdef MPBIOS if (mpbios_present) mpbios_scan(self, &numcpus); @@ -227,7 +231,9 @@ mainbus_attach(device_t parent, device_t config_found_ia(self, "cpubus", &caa, mainbus_print); } +#if NACPICA > 0 } +#endif #if NISADMA > 0 && NACPICA > 0 /* Index: src/sys/arch/i386/i386/mainbus.c diff -u src/sys/arch/i386/i386/mainbus.c:1.103 src/sys/arch/i386/i386/mainbus.c:1.104 --- src/sys/arch/i386/i386/mainbus.c:1.103 Tue May 23 08:54:38 2017 +++ src/sys/arch/i386/i386/mainbus.c Sun Dec 2 08:19:44 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.103 2017/05/23 08:54:38 nonaka Exp $ */ +/* $NetBSD: mainbus.c,v 1.104 2018/12/02 08:19:44 cherry Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.103 2017/05/23 08:54:38 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.104 2018/12/02 08:19:44 cherry Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -86,7 +86,9 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v #include <arch/x86/pci/pci_addr_fixup.h> #endif #endif +#ifdef __HAVE_PCI_MSI_MSIX #include <arch/x86/pci/msipic.h> +#endif /* __HAVE_PCI_MSI_MSIX */ #endif void mainbus_childdetached(device_t, device_t); Index: src/sys/arch/x86/pci/pci_intr_machdep.c diff -u src/sys/arch/x86/pci/pci_intr_machdep.c:1.47 src/sys/arch/x86/pci/pci_intr_machdep.c:1.48 --- src/sys/arch/x86/pci/pci_intr_machdep.c:1.47 Tue Nov 27 21:03:50 2018 +++ src/sys/arch/x86/pci/pci_intr_machdep.c Sun Dec 2 08:19:44 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_intr_machdep.c,v 1.47 2018/11/27 21:03:50 jdolecek Exp $ */ +/* $NetBSD: pci_intr_machdep.c,v 1.48 2018/12/02 08:19:44 cherry 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.47 2018/11/27 21:03:50 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.48 2018/12/02 08:19:44 cherry Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -102,6 +102,8 @@ __KERNEL_RCSID(0, "$NetBSD: pci_intr_mac #include <machine/mpbiosvar.h> #include <machine/pic.h> #include <x86/pci/pci_msi_machdep.h> +#else +#include <machine/i82093var.h> #endif #ifdef MPBIOS @@ -232,8 +234,10 @@ pci_intr_string(pci_chipset_tag_t pc, pc buf, len); } +#if defined(__HAVE_PCI_MSI_MSIX) if (INT_VIA_MSI(ih)) return x86_pci_msi_string(pc, ih, buf, len); +#endif return intr_string(ih & ~MPSAFE_MASK, buf, len); } @@ -319,6 +323,8 @@ pci_intr_establish_xname_internal(pci_ch pc, ih, level, func, arg); } + +#ifdef __HAVE_PCI_MSI_MSIX if (INT_VIA_MSI(ih)) { if (MSI_INT_IS_MSIX(ih)) return x86_pci_msix_establish(pc, ih, level, func, arg, @@ -327,7 +333,7 @@ pci_intr_establish_xname_internal(pci_ch return x86_pci_msi_establish(pc, ih, level, func, arg, xname); } - +#endif if (pci_intr_find_intx_irq(ih, &irq, &pic, &pin)) { aprint_normal("%s: bad pic %d\n", __func__, APIC_IRQ_APIC(ih)); Index: src/sys/arch/x86/x86/intr.c diff -u src/sys/arch/x86/x86/intr.c:1.135 src/sys/arch/x86/x86/intr.c:1.136 --- src/sys/arch/x86/x86/intr.c:1.135 Wed Oct 24 03:51:21 2018 +++ src/sys/arch/x86/x86/intr.c Sun Dec 2 08:19:44 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.135 2018/10/24 03:51:21 cherry Exp $ */ +/* $NetBSD: intr.c,v 1.136 2018/12/02 08:19:44 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.135 2018/10/24 03:51:21 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.136 2018/12/02 08:19:44 cherry Exp $"); #include "opt_intrdebug.h" #include "opt_multiprocessor.h" @@ -184,7 +184,7 @@ __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.1 #include <x86/pci/msipic.h> #include <x86/pci/pci_msi_machdep.h> -#if NPCI == 0 +#if NPCI == 0 || !defined(__HAVE_PCI_MSI_MSIX) #define msipic_is_msi_pic(PIC) (false) #endif @@ -500,6 +500,7 @@ intr_create_intrid(int legacy_irq, struc int ih = 0; #if NPCI > 0 +#if defined(__HAVE_PCI_MSI_MSIX) if ((pic->pic_type == PIC_MSI) || (pic->pic_type == PIC_MSIX)) { uint64_t pih; int dev, vec; @@ -516,6 +517,7 @@ intr_create_intrid(int legacy_irq, struc return x86_pci_msi_string(NULL, pih, buf, len); } +#endif /* __HAVE_PCI_MSI_MSIX */ #endif #if defined(XEN)