Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Aug 2017 17:46:57 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322372 - in head/sys/x86: acpica x86
Message-ID:  <201708101746.v7AHkvdw014739@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Thu Aug 10 17:46:57 2017
New Revision: 322372
URL: https://svnweb.freebsd.org/changeset/base/322372

Log:
  mptable: fix i386 build failure
  
  Reported by:	emaste
  X-MFC-with:	r322347

Modified:
  head/sys/x86/acpica/madt.c
  head/sys/x86/x86/mptable.c

Modified: head/sys/x86/acpica/madt.c
==============================================================================
--- head/sys/x86/acpica/madt.c	Thu Aug 10 17:03:46 2017	(r322371)
+++ head/sys/x86/acpica/madt.c	Thu Aug 10 17:46:57 2017	(r322372)
@@ -325,12 +325,17 @@ static void
 madt_parse_cpu(unsigned int apic_id, unsigned int flags)
 {
 
-	if (!(flags & ACPI_MADT_ENABLED) || mp_ncpus == MAXCPU ||
+	if (!(flags & ACPI_MADT_ENABLED) ||
+#ifdef SMP
+	    mp_ncpus == MAXCPU ||
+#endif
 	    apic_id > MAX_APIC_ID)
 		return;
 
+#ifdef SMP
 	mp_ncpus++;
 	mp_maxid = mp_ncpus - 1;
+#endif
 	max_apic_id = max(apic_id, max_apic_id);
 }
 

Modified: head/sys/x86/x86/mptable.c
==============================================================================
--- head/sys/x86/x86/mptable.c	Thu Aug 10 17:03:46 2017	(r322371)
+++ head/sys/x86/x86/mptable.c	Thu Aug 10 17:46:57 2017	(r322372)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/kernel.h>
 #include <sys/limits.h>
 #include <sys/malloc.h>
+#include <sys/smp.h>
 #ifdef NEW_PCIB
 #include <sys/rman.h>
 #endif
@@ -330,8 +331,10 @@ mptable_probe_cpus(void)
 
 	/* Is this a pre-defined config? */
 	if (mpfps->config_type != 0) {
+#ifdef SMP
 		mp_ncpus = 2;
 		mp_maxid = 1;
+#endif
 		max_apic_id = 1;
 	} else {
 		mptable_walk_table(mptable_probe_cpus_handler, &cpu_mask);
@@ -346,6 +349,7 @@ static int
 mptable_setup_local(void)
 {
 	vm_paddr_t addr;
+	u_int cpu_mask;
 
 	/* Is this a pre-defined config? */
 	printf("MPTable: <");
@@ -478,8 +482,10 @@ mptable_probe_cpus_handler(u_char *entry, void *arg)
 		proc = (proc_entry_ptr)entry;
 		if (proc->cpu_flags & PROCENTRY_FLAG_EN &&
 		    proc->apic_id < MAX_LAPIC_ID && mp_ncpus < MAXCPU) {
+#ifdef SMP
 			mp_ncpus++;
 			mp_maxid = mp_ncpus - 1;
+#endif
 			max_apic_id = max(max_apic_id, proc->apic_id);
 		}
 		break;



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