From 3cd246d9a99f73e3a35aa99a2a8f643957db6f02 Mon Sep 17 00:00:00 2001 From: Bruce Evans <bde@FreeBSD.org> Date: Sun, 10 Jun 2018 14:49:13 +0000 Subject: [PATCH] Untangle configuration ifdefs a little. On x86, msi is optional on pci, and also on apic in common and i386 files (except for xen it is optional only on xenhvm), but it was not ifdefed except on apic in common and i386 files. This is all that is left from an attempt to build a (sub-)minimal kernel without any devices. The isa "option" is still used without ifdefs in many standard files even on amd64. ISAPNP is not optional on at least i386. ATPIC is not optional on i386 (it is used mainly for Xspuriousint). But pci is now supposed to be optional on x86. --- sys/amd64/amd64/machdep.c | 3 +++ sys/x86/x86/nexus.c | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index e65434cbbf28..2ff9f5b1f653 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" #include "opt_maxmem.h" #include "opt_mp_watchdog.h" +#include "opt_pci.h" #include "opt_platform.h" #include "opt_sched.h" @@ -184,7 +185,9 @@ struct init_ops init_ops = { .mp_bootaddress = mp_bootaddress, .start_all_aps = native_start_all_aps, #endif +#ifdef DEV_PCI .msi_init = msi_init, +#endif }; /* diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c index 6999e9658bbd..9bceff204863 100644 --- a/sys/x86/x86/nexus.c +++ b/sys/x86/x86/nexus.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" #endif #include "opt_isa.h" +#include "opt_pci.h" #include <sys/param.h> #include <sys/systm.h> @@ -131,7 +132,7 @@ static int nexus_get_resource(device_t, device_t, int, int, static void nexus_delete_resource(device_t, device_t, int, int); static int nexus_get_cpus(device_t, device_t, enum cpu_sets, size_t, cpuset_t *); -#ifdef DEV_APIC +#if defined(DEV_APIC) && defined(DEV_PCI) static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs); static int nexus_alloc_msix(device_t pcib, device_t dev, int *irq); @@ -172,7 +173,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_get_cpus, nexus_get_cpus), /* pcib interface */ -#ifdef DEV_APIC +#if defined(DEV_APIC) && defined(DEV_PCI) DEVMETHOD(pcib_alloc_msi, nexus_alloc_msi), DEVMETHOD(pcib_release_msi, nexus_release_msi), DEVMETHOD(pcib_alloc_msix, nexus_alloc_msix), @@ -701,7 +702,7 @@ nexus_add_irq(u_long irq) panic("%s: failed", __func__); } -#ifdef DEV_APIC +#if defined(DEV_APIC) && defined(DEV_PCI) static int nexus_alloc_msix(device_t pcib, device_t dev, int *irq) { @@ -736,7 +737,7 @@ nexus_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *da return (msi_map(irq, addr, data)); } -#endif +#endif /* DEV_APIC && DEV_PCI */ /* Placeholder for system RAM. */ static void