summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-07-10 21:46:04 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-07-10 21:46:04 +0000
commit772a80c79188981e74651961c96c65117a0b46c3 (patch)
tree03fa5372b6a066940fc862cfc67d03e088209d9e /sys/arch
parentbaed53032561b8641613288804ac4719273fd74d (diff)
Set cold to 1 before executing the DVACT_POWERDOWN handlers when halting or
rebooting a machine, like it is done in the hibernate case. At least some USB host controller drivers rely on this to busy way instead of sleeping. Avoid a panic on macppc with an uhci(4) cardbus plugged in. ok deraadt@, uebayashi@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/alpha/machdep.c3
-rw-r--r--sys/arch/amd64/amd64/machdep.c3
-rw-r--r--sys/arch/armish/armish/armish_machdep.c7
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c7
-rw-r--r--sys/arch/aviion/aviion/machdep.c3
-rw-r--r--sys/arch/hppa/hppa/machdep.c5
-rw-r--r--sys/arch/hppa64/hppa64/machdep.c5
-rw-r--r--sys/arch/i386/i386/machdep.c3
-rw-r--r--sys/arch/landisk/landisk/machdep.c3
-rw-r--r--sys/arch/loongson/loongson/machdep.c5
-rw-r--r--sys/arch/luna88k/luna88k/machdep.c3
-rw-r--r--sys/arch/macppc/macppc/machdep.c3
-rw-r--r--sys/arch/octeon/octeon/machdep.c5
-rw-r--r--sys/arch/sgi/sgi/machdep.c5
-rw-r--r--sys/arch/socppc/socppc/machdep.c3
-rw-r--r--sys/arch/solbourne/solbourne/machdep.c5
-rw-r--r--sys/arch/sparc/sparc/machdep.c5
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c5
-rw-r--r--sys/arch/vax/vax/machdep.c5
-rw-r--r--sys/arch/zaurus/zaurus/zaurus_machdep.c7
20 files changed, 51 insertions, 39 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c
index 0f7790a3b0e..f4db5286c86 100644
--- a/sys/arch/alpha/alpha/machdep.c
+++ b/sys/arch/alpha/alpha/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.159 2014/07/10 20:15:26 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.160 2014/07/10 21:46:02 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */
/*-
@@ -1007,6 +1007,7 @@ boot(int howto)
uvm_shutdown();
splhigh(); /* Disable interrupts. */
+ cold = 1;
#if defined(MULTIPROCESSOR)
/*
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index a6836c63f19..3d755d5758e 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.183 2014/07/10 20:15:26 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.184 2014/07/10 21:46:02 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -776,6 +776,7 @@ boot(int howto)
uvm_shutdown();
splhigh(); /* Disable interrupts. */
+ cold = 1;
/* Do a dump if requested. */
if (howto & RB_DUMP)
diff --git a/sys/arch/armish/armish/armish_machdep.c b/sys/arch/armish/armish/armish_machdep.c
index b4466803bf9..fc80ce47b15 100644
--- a/sys/arch/armish/armish/armish_machdep.c
+++ b/sys/arch/armish/armish/armish_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armish_machdep.c,v 1.27 2014/07/10 20:15:26 uebayasi Exp $ */
+/* $OpenBSD: armish_machdep.c,v 1.28 2014/07/10 21:46:02 mpi Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -270,9 +270,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
-
- /* Say NO to interrupts */
- splhigh();
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
/* Do a dump if requested. */
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index 4b091453140..67cade65b58 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.c
+++ b/sys/arch/armv7/armv7/armv7_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.c,v 1.10 2014/07/10 20:37:41 uebayasi Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.11 2014/07/10 21:46:02 mpi Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -286,9 +286,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
-
- /* Say NO to interrupts */
- splhigh();
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
/* Do a dump if requested. */
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
diff --git a/sys/arch/aviion/aviion/machdep.c b/sys/arch/aviion/aviion/machdep.c
index 9452d47f7d4..7e4a8299e78 100644
--- a/sys/arch/aviion/aviion/machdep.c
+++ b/sys/arch/aviion/aviion/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.67 2014/07/10 20:15:26 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.68 2014/07/10 21:46:02 mpi Exp $ */
/*
* Copyright (c) 2007 Miodrag Vallat.
*
@@ -318,6 +318,7 @@ boot(int howto)
uvm_shutdown();
splhigh(); /* Disable interrupts. */
+ cold = 1;
/* If rebooting and a dump is requested, do it. */
if (howto & RB_DUMP)
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 54b0f519434..b38152df010 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.225 2014/07/10 20:15:26 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.226 2014/07/10 21:46:02 mpi Exp $ */
/*
* Copyright (c) 1999-2003 Michael Shalayeff
@@ -919,10 +919,9 @@ boot(int howto)
}
if_downall();
- /* XXX probably save howto into stable storage */
-
uvm_shutdown();
splhigh();
+ cold = 1;
if (howto & RB_DUMP)
dumpsys();
diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c
index b986a4f8056..b74cc83b73e 100644
--- a/sys/arch/hppa64/hppa64/machdep.c
+++ b/sys/arch/hppa64/hppa64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.63 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.64 2014/07/10 21:46:03 mpi Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -556,10 +556,9 @@ boot(int howto)
}
if_downall();
- /* XXX probably save howto into stable storage */
-
uvm_shutdown();
splhigh();
+ cold = 1;
if (howto & RB_DUMP)
dumpsys();
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 97c166adb9c..032caa718f4 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.544 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.545 2014/07/10 21:46:03 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -2590,6 +2590,7 @@ boot(int howto)
uvm_shutdown();
splhigh(); /* Disable interrupts. */
+ cold = 1;
/* Do a dump if requested. */
if (howto & RB_DUMP)
diff --git a/sys/arch/landisk/landisk/machdep.c b/sys/arch/landisk/landisk/machdep.c
index c1df9245632..7bf1ace830e 100644
--- a/sys/arch/landisk/landisk/machdep.c
+++ b/sys/arch/landisk/landisk/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.35 2014/07/10 13:34:32 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.36 2014/07/10 21:46:03 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*-
@@ -214,6 +214,7 @@ boot(int howto)
uvm_shutdown();
splhigh(); /* Disable interrupts. */
+ cold = 1;
/* Do a dump if requested. */
if (howto & RB_DUMP)
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index 8be7e038af4..cd5198084e9 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.52 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.53 2014/07/10 21:46:03 mpi Exp $ */
/*
* Copyright (c) 2009, 2010, 2014 Miodrag Vallat.
@@ -931,7 +931,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
- (void) splhigh(); /* Extreme priority. */
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
if (howto & RB_DUMP)
dumpsys();
diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c
index 3cb1d31ecbb..1b0b68eeb48 100644
--- a/sys/arch/luna88k/luna88k/machdep.c
+++ b/sys/arch/luna88k/luna88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.104 2014/07/10 20:37:42 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.105 2014/07/10 21:46:03 mpi Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -492,6 +492,7 @@ boot(int howto)
uvm_shutdown();
splhigh(); /* Disable interrupts. */
+ cold = 1;
/* If rebooting and a dump is requested, do it. */
if (howto & RB_DUMP)
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index d82c9ca931e..2aa1f42183d 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.156 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.157 2014/07/10 21:46:03 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -827,6 +827,7 @@ boot(int howto)
uvm_shutdown();
splhigh();
+ cold = 1;
if (howto & RB_DUMP)
dumpsys();
diff --git a/sys/arch/octeon/octeon/machdep.c b/sys/arch/octeon/octeon/machdep.c
index a6e1b9cddc1..982a314e9a7 100644
--- a/sys/arch/octeon/octeon/machdep.c
+++ b/sys/arch/octeon/octeon/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.52 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.53 2014/07/10 21:46:03 mpi Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -695,7 +695,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
- (void) splhigh(); /* Extreme priority. */
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
if (howto & RB_DUMP)
dumpsys();
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index 8931455cdcf..7eee5220b4a 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.143 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.144 2014/07/10 21:46:03 mpi Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -858,7 +858,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
- (void) splhigh(); /* Extreme priority. */
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
if (howto & RB_DUMP)
dumpsys();
diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c
index 8a57eb55f12..68adb42c1bf 100644
--- a/sys/arch/socppc/socppc/machdep.c
+++ b/sys/arch/socppc/socppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.51 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.52 2014/07/10 21:46:03 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -1055,6 +1055,7 @@ boot(int howto)
uvm_shutdown();
splhigh();
+ cold = 1;
if ((howto & RB_DUMP))
dumpsys();
diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c
index 5fa3e964b49..0c2a93a3bdd 100644
--- a/sys/arch/solbourne/solbourne/machdep.c
+++ b/sys/arch/solbourne/solbourne/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.36 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.37 2014/07/10 21:46:03 mpi Exp $ */
/* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */
/*
@@ -546,7 +546,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
- (void) splhigh(); /* ??? */
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
if (howto & RB_DUMP)
dumpsys();
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index 4ad110f77de..8f74a95f5e3 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.157 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.158 2014/07/10 21:46:03 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -555,7 +555,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
- (void) splhigh(); /* ??? */
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
if (howto & RB_DUMP)
dumpsys();
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index 860570d437c..98f2c855c33 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.160 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.161 2014/07/10 21:46:03 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -644,7 +644,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
- (void) splhigh(); /* ??? */
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
/* If rebooting and a dump is requested, do it. */
if (howto & RB_DUMP)
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index 69ea1aea017..bcff7777f15 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.139 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.140 2014/07/10 21:46:03 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */
/*
@@ -532,7 +532,8 @@ boot(int howto)
if_downall();
uvm_shutdown();
- splhigh(); /* extreme priority */
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
/* If rebooting and a dump is requested, do it. */
if (howto & RB_DUMP)
diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c
index 0e3d2e3512b..68397a3cb26 100644
--- a/sys/arch/zaurus/zaurus/zaurus_machdep.c
+++ b/sys/arch/zaurus/zaurus/zaurus_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_machdep.c,v 1.46 2014/07/10 20:15:27 uebayasi Exp $ */
+/* $OpenBSD: zaurus_machdep.c,v 1.47 2014/07/10 21:46:03 mpi Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -311,8 +311,9 @@ boot(int howto)
if (!(howto & RB_NOSYNC))
bootsync(howto);
- /* Say NO to interrupts */
- splhigh();
+ uvm_shutdown();
+ splhigh(); /* Disable interrupts. */
+ cold = 1;
/* Do a dump if requested. */
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)