Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jun 2018 14:49:13 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334925 - in head/sys: amd64/amd64 x86/x86
Message-ID:  <201806101449.w5AEnDLJ065156@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bde
Date: Sun Jun 10 14:49:13 2018
New Revision: 334925
URL: https://svnweb.freebsd.org/changeset/base/334925

Log:
  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.

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/x86/x86/nexus.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Sun Jun 10 14:21:01 2018	(r334924)
+++ head/sys/amd64/amd64/machdep.c	Sun Jun 10 14:49:13 2018	(r334925)
@@ -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
 };
 
 /*

Modified: head/sys/x86/x86/nexus.c
==============================================================================
--- head/sys/x86/x86/nexus.c	Sun Jun 10 14:21:01 2018	(r334924)
+++ head/sys/x86/x86/nexus.c	Sun Jun 10 14:49:13 2018	(r334925)
@@ -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,
 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, ui
 
 	return (msi_map(irq, addr, data));
 }
-#endif
+#endif /* DEV_APIC && DEV_PCI */
 
 /* Placeholder for system RAM. */
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806101449.w5AEnDLJ065156>