summaryrefslogtreecommitdiff
path: root/sys/arch/macppc
diff options
context:
space:
mode:
authorMasao Uebayashi <uebayasi@cvs.openbsd.org>2014-01-06 16:17:34 +0000
committerMasao Uebayashi <uebayasi@cvs.openbsd.org>2014-01-06 16:17:34 +0000
commit1e88169a4c6473b1224f97022cac2dc5d5ba55a7 (patch)
tree970ef180024cd5523e96b37be58c69cf649d5549 /sys/arch/macppc
parent226030c3f4ec0e0798c9171387c0f8a9b42daa75 (diff)
Make macppc/socppc boot() code path more similar to others.
This changes calling boot() during (cold != 0) to not call if_downall() and uvm_shutdown(). Both of which must not be specific to PowerPC. OK mpi@
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r--sys/arch/macppc/macppc/machdep.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index 5cc113ddf78..090b4bf1143 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.142 2013/11/18 08:20:22 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.143 2014/01/06 16:17:33 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -804,8 +804,18 @@ boot(int howto)
{
static int syncing;
+ if (cold) {
+ /*
+ * If the system is cold, just halt, unless the user
+ * explicitly asked for reboot.
+ */
+ if ((howto & RB_USERREQ) == 0)
+ howto |= RB_HALT;
+ goto haltsys;
+ }
+
boothowto = howto;
- if (!cold && !(howto & RB_NOSYNC) && !syncing) {
+ if (!(howto & RB_NOSYNC) && !syncing) {
syncing = 1;
vfs_shutdown(); /* sync */
@@ -825,8 +835,10 @@ boot(int howto)
uvm_shutdown();
splhigh();
- if (!cold && (howto & RB_DUMP))
+ if (howto & RB_DUMP)
dumpsys();
+
+haltsys:
doshutdownhooks();
if (!TAILQ_EMPTY(&alldevs))
config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN);