diff options
author | jhb <jhb@FreeBSD.org> | 2003-07-23 19:04:28 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-07-23 19:04:28 +0000 |
commit | 318967d8e2ff6804bf1d4e5ae5ba15704526fcdd (patch) | |
tree | b5da0efa9cf4b3e96e6f851a5258fd39ac246fac /sys/amd64 | |
parent | 1ab48551b3699374e93b8f727bf39421c0d1c294 (diff) | |
download | FreeBSD-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/amd64')
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 17 | ||||
-rw-r--r-- | sys/amd64/amd64/mptable.c | 17 | ||||
-rw-r--r-- | sys/amd64/include/mptable.h | 17 |
3 files changed, 36 insertions, 15 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 9061759..0bb0fc7 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -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 */ diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index 9061759..0bb0fc7 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -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 */ diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index 9061759..0bb0fc7 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/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 */ |