diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-01-24 21:20:24 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-01-24 21:20:24 +0000 |
commit | d4a187bae134668945865f62e224c9333378e752 (patch) | |
tree | 7839da6fe1df5678ec3b7eaccad7137e8efc685a | |
parent | d958ee0b990b20bc947acecc117fbad6cde9e724 (diff) |
Disable lapic when halting CPUs. Allegedly this is necessary to make
suspend work on some machines.
ok deraadt@, mlarkin@
-rw-r--r-- | sys/arch/i386/i386/acpi_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/ipifuncs.c | 3 | ||||
-rw-r--r-- | sys/arch/i386/i386/lapic.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/include/i82489var.h | 3 |
4 files changed, 14 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/acpi_machdep.c b/sys/arch/i386/i386/acpi_machdep.c index e6c65befa40..b8238257f51 100644 --- a/sys/arch/i386/i386/acpi_machdep.c +++ b/sys/arch/i386/i386/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.50 2013/12/19 21:30:02 deraadt Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.51 2014/01/24 21:20:23 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -254,8 +254,10 @@ void acpi_sleep_clocks(struct acpi_softc *sc, int state) { rtcstop(); + #if NLAPIC > 0 save_lapic_tpr = lapic_tpr; + lapic_disable(); #endif } diff --git a/sys/arch/i386/i386/ipifuncs.c b/sys/arch/i386/i386/ipifuncs.c index 5d7bc599431..c2a26d9afb3 100644 --- a/sys/arch/i386/i386/ipifuncs.c +++ b/sys/arch/i386/i386/ipifuncs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipifuncs.c,v 1.22 2013/12/19 21:30:02 deraadt Exp $ */ +/* $OpenBSD: ipifuncs.c,v 1.23 2014/01/24 21:20:23 kettenis Exp $ */ /* $NetBSD: ipifuncs.c,v 1.1.2.3 2000/06/26 02:04:06 sommerfeld Exp $ */ /*- @@ -100,6 +100,7 @@ i386_ipi_halt(struct cpu_info *ci) SCHED_ASSERT_UNLOCKED(); npxsave_cpu(ci, 1); disable_intr(); + lapic_disable(); wbinvd(); ci->ci_flags &= ~CPUF_RUNNING; wbinvd(); diff --git a/sys/arch/i386/i386/lapic.c b/sys/arch/i386/i386/lapic.c index ee85de6d9e3..5a6dc442b67 100644 --- a/sys/arch/i386/i386/lapic.c +++ b/sys/arch/i386/i386/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.33 2013/10/26 16:55:12 kettenis Exp $ */ +/* $OpenBSD: lapic.c,v 1.34 2014/01/24 21:20:23 kettenis Exp $ */ /* $NetBSD: lapic.c,v 1.1.2.8 2000/02/23 06:10:50 sommerfeld Exp $ */ /*- @@ -108,6 +108,12 @@ lapic_enable(void) } void +lapic_disable(void) +{ + i82489_writereg(LAPIC_SVR, 0); +} + +void lapic_set_softvectors(void) { idt_vec_set(LAPIC_SOFTCLOCK_VECTOR, Xintrsoftclock); diff --git a/sys/arch/i386/include/i82489var.h b/sys/arch/i386/include/i82489var.h index 41a36e47d9d..ee09e52b688 100644 --- a/sys/arch/i386/include/i82489var.h +++ b/sys/arch/i386/include/i82489var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82489var.h,v 1.13 2011/06/25 19:20:41 jsg Exp $ */ +/* $OpenBSD: i82489var.h,v 1.14 2014/01/24 21:20:23 kettenis Exp $ */ /* $NetBSD: i82489var.h,v 1.1.2.2 2000/02/21 18:46:14 sommerfeld Exp $ */ /*- @@ -121,6 +121,7 @@ extern void lapic_initclocks(void); extern void lapic_set_lvt(void); extern void lapic_set_softvectors(void); extern void lapic_enable(void); +extern void lapic_disable(void); extern void lapic_calibrate_timer(struct cpu_info *); #define lapic_cpu_number() (i82489_readreg(LAPIC_ID)>>LAPIC_ID_SHIFT) |