Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 2003 14:23:02 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 43467 for review
Message-ID:  <200312052223.hB5MN2uC060978@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=43467

Change 43467 by peter@peter_daintree on 2003/12/05 14:22:30

	Integ -b i386_hammer -I.  This catches up with jhb's changes.
	One change isn't relevant because there is no way to compile out
	the apic code on amd64, so we dont need the apic stubs.

Affected files ...

.. //depot/projects/hammer/sys/amd64/acpica/madt.c#23 integrate
.. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#26 integrate
.. //depot/projects/hammer/sys/amd64/amd64/machdep.c#74 integrate
.. //depot/projects/hammer/sys/amd64/amd64/mptable.c#18 integrate
.. //depot/projects/hammer/sys/amd64/conf/GENERIC#27 integrate

Differences ...

==== //depot/projects/hammer/sys/amd64/acpica/madt.c#23 (text+ko) ====

@@ -190,7 +190,7 @@
 	XSDT_DESCRIPTOR *xsdt;
 	int i, count;
 
-	if (resource_disabled("acpi", 0) || resource_disabled("apic", 0))
+	if (resource_disabled("acpi", 0))
 		return (ENXIO);
 
 	/*
@@ -351,8 +351,7 @@
 
 	apic_register_enumerator(&madt_enumerator);
 }
-SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST,
-    madt_register, NULL)
+SYSINIT(madt_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, madt_register, NULL)
 
 /*
  * Call the handler routine for each entry in the MADT table.
@@ -644,7 +643,7 @@
 
 	if (madt == NULL)
 		return;
-	for (i = 0; i < MAXCPU; i++) {
+	for (i = 0; i <= mp_maxid; i++) {
 		if (CPU_ABSENT(i))
 			continue;
 		pc = pcpu_find(i);

==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#26 (text+ko) ====

@@ -542,9 +542,8 @@
 }
 
 /*
- * We have to look for CPU's very, very early because certain subsystems
- * want to know how many CPU's we have extremely early on in the boot
- * process.
+ * Probe the APIC enumerators, enumerate CPUs, and initialize the
+ * local APIC.
  */
 static void
 apic_init(void *dummy __unused)
@@ -556,6 +555,10 @@
 	if (!(cpu_feature & CPUID_APIC))
 		return;
 
+	/* Don't probe if APIC mode is disabled. */
+	if (resource_disabled("apic", 0))
+		return;
+
 	/* First, probe all the enumerators to find the best match. */
 	best_enum = NULL;
 	best = 0;
@@ -583,26 +586,14 @@
 	if (retval != 0)
 		printf("%s: Failed to probe CPUs: returned %d\n",
 		    best_enum->apic_name, retval);
-}
-SYSINIT(apic_init, SI_SUB_TUNABLES - 1, SI_ORDER_SECOND, apic_init, NULL)
 
-/*
- * Setup the local APIC.  We have to do this prior to starting up the APs
- * in the SMP case.
- */
-static void
-apic_setup_local(void *dummy __unused)
-{
-	int retval;
-
-	if (best_enum == NULL)
-		return;
+	/* Third, 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);
 }
-SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_FIRST, apic_setup_local, NULL)
+SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_FIRST, apic_init, NULL)
 
 /*
  * Setup the I/O APICs.

==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#74 (text+ko) ====


==== //depot/projects/hammer/sys/amd64/amd64/mptable.c#18 (text+ko) ====

@@ -370,8 +370,8 @@
 
 	apic_register_enumerator(&mptable_enumerator);
 }
-SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST,
-    mptable_register, NULL)
+SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register,
+    NULL)
 
 /*
  * Call the handler routine for each entry in the MP config table.

==== //depot/projects/hammer/sys/amd64/conf/GENERIC#27 (text+ko) ====



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