summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/mptable.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-07-23 19:04:28 +0000
committerjhb <jhb@FreeBSD.org>2003-07-23 19:04:28 +0000
commit318967d8e2ff6804bf1d4e5ae5ba15704526fcdd (patch)
treeb5da0efa9cf4b3e96e6f851a5258fd39ac246fac /sys/i386/include/mptable.h
parent1ab48551b3699374e93b8f727bf39421c0d1c294 (diff)
downloadFreeBSD-src-318967d8e2ff6804bf1d4e5ae5ba15704526fcdd.zip
FreeBSD-src-318967d8e2ff6804bf1d4e5ae5ba15704526fcdd.tar.gz
Use macros from apic.h to when writing to the ICR to send IPIs to startup
APs rather than magic numbers. Tested by: scottl
Diffstat (limited to 'sys/i386/include/mptable.h')
-rw-r--r--sys/i386/include/mptable.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index 9061759..0bb0fc7 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -2279,16 +2279,21 @@ start_ap(int logical_cpu, u_int boot_addr)
icr_hi |= (physical_cpu << 24);
lapic.icr_hi = icr_hi;
+ /* setup common fields for subsequent IPIs */
+ icr_lo = lapic.icr_lo & APIC_ICRLO_RESV_MASK;
+ icr_lo |= APIC_DESTMODE_PHY;
+
/* do an INIT IPI: assert RESET */
- icr_lo = lapic.icr_lo & 0xfff00000;
- lapic.icr_lo = icr_lo | 0x0000c500;
+ lapic.icr_lo = icr_lo | APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE |
+ APIC_LEVEL_ASSERT | APIC_DELMODE_INIT;
/* wait for pending status end */
while (lapic.icr_lo & APIC_DELSTAT_MASK)
/* spin */ ;
/* do an INIT IPI: deassert RESET */
- lapic.icr_lo = icr_lo | 0x00008500;
+ lapic.icr_lo = icr_lo | APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL |
+ APIC_LEVEL_DEASSERT | APIC_DELMODE_INIT;
/* wait for pending status end */
u_sleep(10000); /* wait ~10mS */
@@ -2305,7 +2310,8 @@ start_ap(int logical_cpu, u_int boot_addr)
*/
/* do a STARTUP IPI */
- lapic.icr_lo = icr_lo | 0x00000600 | vector;
+ lapic.icr_lo = icr_lo | APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE |
+ APIC_LEVEL_DEASSERT | APIC_DELMODE_STARTUP | vector;
while (lapic.icr_lo & APIC_DELSTAT_MASK)
/* spin */ ;
u_sleep(200); /* wait ~200uS */
@@ -2317,7 +2323,8 @@ start_ap(int logical_cpu, u_int boot_addr)
* recognized after hardware RESET or INIT IPI.
*/
- lapic.icr_lo = icr_lo | 0x00000600 | vector;
+ lapic.icr_lo = icr_lo | APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE |
+ APIC_LEVEL_DEASSERT | APIC_DELMODE_STARTUP | vector;
while (lapic.icr_lo & APIC_DELSTAT_MASK)
/* spin */ ;
u_sleep(200); /* wait ~200uS */
OpenPOWER on IntegriCloud