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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to