PERFORCE change 185533 for review
John Baldwin
jhb at FreeBSD.org
Mon Nov 8 20:38:05 UTC 2010
http://p4web.freebsd.org/@@185533?ac=10
Change 185533 by jhb at jhb_jhbbsd on 2010/11/08 20:38:02
Loop back removal of acpi.ko.
Affected files ...
.. //depot/projects/smpng/sys/i386/acpica/madt.c#30 integrate
.. //depot/projects/smpng/sys/i386/i386/machdep.c#166 integrate
.. //depot/projects/smpng/sys/i386/i386/mp_machdep.c#135 integrate
.. //depot/projects/smpng/sys/i386/xen/mptable.c#4 integrate
.. //depot/projects/smpng/sys/modules/acpi/Makefile#36 integrate
.. //depot/projects/smpng/sys/x86/x86/local_apic.c#9 integrate
.. //depot/projects/smpng/sys/x86/x86/mptable.c#2 integrate
Differences ...
==== //depot/projects/smpng/sys/i386/acpica/madt.c#30 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/acpica/madt.c,v 1.36 2010/11/08 20:05:22 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/acpica/madt.c,v 1.37 2010/11/08 20:35:09 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -203,7 +203,7 @@
apic_register_enumerator(&madt_enumerator);
}
-SYSINIT(madt_register, SI_SUB_CPU - 1, SI_ORDER_SECOND, madt_register, NULL);
+SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, madt_register, NULL);
/*
* Call the handler routine for each entry in the MADT table.
==== //depot/projects/smpng/sys/i386/i386/machdep.c#166 (text+ko) ====
@@ -38,9 +38,8 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/machdep.c,v 1.711 2010/11/05 13:42:58 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/machdep.c,v 1.712 2010/11/08 20:32:35 jhb Exp $");
-#include "opt_apic.h"
#include "opt_atalk.h"
#include "opt_compat.h"
#include "opt_cpu.h"
@@ -3614,102 +3613,6 @@
return 0;
}
-#ifndef DEV_APIC
-#include <machine/apicvar.h>
-
-/*
- * Provide stub functions so that the MADT APIC enumerator in the acpi
- * kernel module will link against a kernel without 'device apic'.
- *
- * XXX - This is a gross hack.
- */
-void
-apic_register_enumerator(struct apic_enumerator *enumerator)
-{
-}
-
-void *
-ioapic_create(vm_paddr_t addr, int32_t apic_id, int intbase)
-{
- return (NULL);
-}
-
-int
-ioapic_disable_pin(void *cookie, u_int pin)
-{
- return (ENXIO);
-}
-
-int
-ioapic_get_vector(void *cookie, u_int pin)
-{
- return (-1);
-}
-
-void
-ioapic_register(void *cookie)
-{
-}
-
-int
-ioapic_remap_vector(void *cookie, u_int pin, int vector)
-{
- return (ENXIO);
-}
-
-int
-ioapic_set_extint(void *cookie, u_int pin)
-{
- return (ENXIO);
-}
-
-int
-ioapic_set_nmi(void *cookie, u_int pin)
-{
- return (ENXIO);
-}
-
-int
-ioapic_set_polarity(void *cookie, u_int pin, enum intr_polarity pol)
-{
- return (ENXIO);
-}
-
-int
-ioapic_set_triggermode(void *cookie, u_int pin, enum intr_trigger trigger)
-{
- return (ENXIO);
-}
-
-void
-lapic_create(u_int apic_id, int boot_cpu)
-{
-}
-
-void
-lapic_init(vm_paddr_t addr)
-{
-}
-
-int
-lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode)
-{
- return (ENXIO);
-}
-
-int
-lapic_set_lvt_polarity(u_int apic_id, u_int lvt, enum intr_polarity pol)
-{
- return (ENXIO);
-}
-
-int
-lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger)
-{
- return (ENXIO);
-}
-#endif
-
#ifdef KDB
/*
==== //depot/projects/smpng/sys/i386/i386/mp_machdep.c#135 (text+ko) ====
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.322 2010/11/04 08:51:45 avg Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.323 2010/11/08 20:35:09 jhb Exp $");
#include "opt_apic.h"
#include "opt_cpu.h"
@@ -465,8 +465,10 @@
boot_cpu_id = apic_id;
cpu_info[apic_id].cpu_bsp = 1;
}
- if (mp_ncpus < MAXCPU)
+ if (mp_ncpus < MAXCPU) {
mp_ncpus++;
+ mp_maxid = mp_ncpus - 1;
+ }
if (bootverbose)
printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" :
"AP");
@@ -476,7 +478,19 @@
cpu_mp_setmaxid(void)
{
- mp_maxid = MAXCPU - 1;
+ /*
+ * mp_maxid should be already set by calls to cpu_add().
+ * Just sanity check its value here.
+ */
+ if (mp_ncpus == 0)
+ KASSERT(mp_maxid == 0,
+ ("%s: mp_ncpus is zero, but mp_maxid is not", __func__));
+ else if (mp_ncpus == 1)
+ mp_maxid = 0;
+ else
+ KASSERT(mp_maxid >= mp_ncpus - 1,
+ ("%s: counters out of sync: max %d, count %d", __func__,
+ mp_maxid, mp_ncpus));
}
int
@@ -504,6 +518,7 @@
* One CPU was found, so this must be a UP system with
* an I/O APIC.
*/
+ mp_maxid = 0;
return (0);
}
==== //depot/projects/smpng/sys/i386/xen/mptable.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/xen/mptable.c,v 1.3 2010/11/01 18:18:46 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/xen/mptable.c,v 1.4 2010/11/08 20:35:09 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -109,7 +109,7 @@
apic_register_enumerator(&mptable_enumerator);
}
-SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register,
+SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, mptable_register,
NULL);
==== //depot/projects/smpng/sys/modules/acpi/Makefile#36 (text+ko) ====
@@ -1,10 +1,6 @@
-# $FreeBSD: src/sys/modules/acpi/Makefile,v 1.56 2010/07/25 17:55:57 rpaulo Exp $
+# $FreeBSD: src/sys/modules/acpi/Makefile,v 1.57 2010/11/08 20:30:59 jhb Exp $
-.if ${MACHINE} == "i386"
-SUBDIR= acpi
-.endif
-
-SUBDIR+= acpi_asus acpi_fujitsu acpi_hp acpi_ibm \
+SUBDIR= acpi_asus acpi_fujitsu acpi_hp acpi_ibm \
acpi_panasonic acpi_sony acpi_toshiba acpi_video \
acpi_dock acpi_wmi aibs
==== //depot/projects/smpng/sys/x86/x86/local_apic.c#9 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/x86/x86/local_apic.c,v 1.16 2010/11/08 20:03:51 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/x86/x86/local_apic.c,v 1.17 2010/11/08 20:35:09 jhb Exp $");
#include "opt_hwpmc_hooks.h"
#include "opt_kdtrace.h"
@@ -1285,7 +1285,7 @@
if (resource_disabled("apic", 0))
return;
- /* First, probe all the enumerators to find the best match. */
+ /* Probe all the enumerators to find the best match. */
best_enum = NULL;
best = 0;
SLIST_FOREACH(enumerator, &enumerators, apic_next) {
@@ -1321,13 +1321,12 @@
}
#endif
- /* Second, probe the CPU's in the system. */
+ /* Probe the CPU's in the system. */
retval = best_enum->apic_probe_cpus();
if (retval != 0)
printf("%s: Failed to probe CPUs: returned %d\n",
best_enum->apic_name, retval);
-#ifdef __amd64__
}
SYSINIT(apic_init, SI_SUB_TUNABLES - 1, SI_ORDER_SECOND, apic_init, NULL);
@@ -1342,19 +1341,14 @@
if (best_enum == NULL)
return;
-#endif
- /* Third, initialize the local APIC. */
+
+ /* Initialize the local APIC. */
retval = best_enum->apic_setup_local();
if (retval != 0)
printf("%s: Failed to setup the local APIC: returned %d\n",
best_enum->apic_name, retval);
}
-#ifdef __amd64__
-SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local,
- NULL);
-#else
-SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_SECOND, apic_init, NULL);
-#endif
+SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local, NULL);
/*
* Setup the I/O APICs.
==== //depot/projects/smpng/sys/x86/x86/mptable.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/x86/x86/mptable.c,v 1.2 2010/11/01 18:18:46 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/x86/x86/mptable.c,v 1.3 2010/11/08 20:35:09 jhb Exp $");
#include "opt_mptable_force_htt.h"
#include <sys/param.h>
@@ -389,7 +389,7 @@
apic_register_enumerator(&mptable_enumerator);
}
-SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register,
+SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, mptable_register,
NULL);
/*
More information about the p4-projects
mailing list