Browse files

apic: Initialize LAPIC before programming I/O APIC

On the system without IMCR, I/O APIC is enabled when it is first accessed.
Before I/O APIC is enabled, LAPIC should be initialized.
  • Loading branch information...
1 parent 4d08e03 commit a40ec0038b5c39aa2950b64996e0f05138fc0a2e Sepherosa Ziehau committed Mar 19, 2011
Showing with 12 additions and 12 deletions.
  1. +6 −6 sys/platform/pc32/i386/mp_machdep.c
  2. +6 −6 sys/platform/pc64/x86_64/mp_machdep.c
View
12 sys/platform/pc32/i386/mp_machdep.c
@@ -652,6 +652,9 @@ mp_enable(u_int boot_addr)
lapic_config();
+ /* Initialize BSP's local APIC */
+ lapic_init(TRUE);
+
if (apic_io_enable)
ioapic_config();
@@ -689,6 +692,9 @@ if (apic_io_enable && ioapic_use_old) {
}
+ /* Finalize PIC */
+ MachIntrABI.finalize();
+
/* start each Application Processor */
start_all_aps(boot_addr);
}
@@ -2137,12 +2143,6 @@ start_all_aps(u_int boot_addr)
POSTCODE(START_ALL_APS_POST);
- /* Initialize BSP's local APIC */
- lapic_init(TRUE);
-
- /* Finalize PIC */
- MachIntrABI.finalize();
-
/* install the AP 1st level boot code */
install_ap_tramp(boot_addr);
View
12 sys/platform/pc64/x86_64/mp_machdep.c
@@ -673,6 +673,9 @@ mp_enable(u_int boot_addr)
lapic_config();
+ /* Initialize BSP's local APIC */
+ lapic_init(TRUE);
+
if (apic_io_enable)
ioapic_config();
@@ -710,6 +713,9 @@ if (apic_io_enable && ioapic_use_old) {
}
+ /* Finalize PIC */
+ MachIntrABI.finalize();
+
/* start each Application Processor */
start_all_aps(boot_addr);
}
@@ -2134,12 +2140,6 @@ start_all_aps(u_int boot_addr)
POSTCODE(START_ALL_APS_POST);
- /* Initialize BSP's local APIC */
- lapic_init(TRUE);
-
- /* Finalize PIC */
- MachIntrABI.finalize();
-
/* install the AP 1st level boot code */
pmap_kenter(va, boot_address);
cpu_invlpg((void *)va); /* JG XXX */

0 comments on commit a40ec00

Please sign in to comment.