diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-09-28 18:36:37 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-09-28 18:36:37 +0000 |
commit | 4af7368b7c2c8f50f1f972754d9e26589bc6c83c (patch) | |
tree | 993058d251dfbcad28a0feee6a0e94c39e3ae6fb /sys/arch | |
parent | b132baf16157998866fb4083bebc449ac677617e (diff) |
In low-level suspend routines, set cold=2. In tsleep(), use this to
spit out a ddb trace to console. This should allow us to find suspend
or resume routines which break the rules. It depends on the console
output function being non-sleeping.... but that's another codepath which
should try to be safe when cold is set.
ok kettenis
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/apm.c | 4 | ||||
-rw-r--r-- | sys/arch/loongson/dev/apm.c | 4 | ||||
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_apm.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index c6b8a21d9d3..02478e33796 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.113 2015/02/07 01:19:40 deraadt Exp $ */ +/* $OpenBSD: apm.c,v 1.114 2015/09/28 18:36:36 deraadt Exp $ */ /*- * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. @@ -253,6 +253,7 @@ apm_suspend(int state) s = splhigh(); disable_intr(); + cold = 2; config_suspend_all(DVACT_SUSPEND); suspend_randomness(); @@ -275,6 +276,7 @@ apm_suspend(int state) inittodr(time_second); config_suspend_all(DVACT_RESUME); + cold = 0; enable_intr(); splx(s); diff --git a/sys/arch/loongson/dev/apm.c b/sys/arch/loongson/dev/apm.c index f04599fcc98..48865f48be1 100644 --- a/sys/arch/loongson/dev/apm.c +++ b/sys/arch/loongson/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.28 2015/02/07 01:19:40 deraadt Exp $ */ +/* $OpenBSD: apm.c,v 1.29 2015/09/28 18:36:36 deraadt Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -380,7 +380,7 @@ apm_suspend(int state) s = splhigh(); (void)disableintr(); - cold = 1; + cold = 2; rv = config_suspend_all(DVACT_SUSPEND); diff --git a/sys/arch/zaurus/dev/zaurus_apm.c b/sys/arch/zaurus/dev/zaurus_apm.c index 26bb24aae9b..a0c2e1685d6 100644 --- a/sys/arch/zaurus/dev/zaurus_apm.c +++ b/sys/arch/zaurus/dev/zaurus_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_apm.c,v 1.33 2015/02/11 07:05:39 dlg Exp $ */ +/* $OpenBSD: zaurus_apm.c,v 1.34 2015/09/28 18:36:36 deraadt Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> @@ -656,6 +656,7 @@ zapm_poweroff(void) #endif /* NWSDISPLAY > 0 */ s = splhigh(); + cold = 2; config_suspend_all(DVACT_SUSPEND); suspend_randomness(); @@ -687,6 +688,7 @@ zapm_poweroff(void) zapm_restart(); /* NOTREACHED */ + cold = 0; config_suspend_all(DVACT_RESUME); splx(s); |