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.
This commit is contained in:
Bruce Evans 2018-06-10 14:49:13 +00:00
parent 09e3c9a4ec
commit 3cd246d9a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334925
2 changed files with 8 additions and 4 deletions

View File

@ -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
};
/*

View File

@ -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