From: uebayasi Date: Tue, 22 Jul 2014 01:04:04 +0000 (+0000) Subject: boot(9): Reduce diffs between hppa & hppa64 (& others) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=51942ed32e8f8f8083d032ea81ad78b83fc16fd5;p=openbsd boot(9): Reduce diffs between hppa & hppa64 (& others) --- diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index a9bc5cb41e7..39a79d64c62 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.232 2014/07/21 17:25:47 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.233 2014/07/22 01:04:04 uebayasi Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -942,7 +942,7 @@ haltsys: (*cold_hook)(HPPA_COLD_COLD); if ((howto & RB_HALT) != 0) { - if ((howto & RB_POWERDOWN) != 0 && cold_hook) { + if ((howto & RB_POWERDOWN) != 0) { printf("Powering off..."); DELAY(2000000); (*cold_hook)(HPPA_COLD_OFF); diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c index 5578ef0ba60..9e074884364 100644 --- a/sys/arch/hppa64/hppa64/machdep.c +++ b/sys/arch/hppa64/hppa64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.70 2014/07/21 17:25:47 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.71 2014/07/22 01:04:04 uebayasi Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -537,6 +537,15 @@ boot(int howto) { struct device *mainbus; + /* + * On older systems without software power control, prevent mi code + * from spinning disks off, in case the operator changes his mind + * and prefers to reboot - the firmware will not send a spin up + * command to the disks. + */ + if (cold_hook == NULL) + howto &= ~RB_POWERDOWN; + if (cold) { if ((howto & RB_USERREQ) == 0) howto |= RB_HALT; @@ -575,7 +584,7 @@ haltsys: (*cold_hook)(HPPA_COLD_COLD); if ((howto & RB_HALT) != 0) { - if ((howto & RB_POWERDOWN) != 0 && cold_hook) { + if ((howto & RB_POWERDOWN) != 0) { printf("Powering off..."); DELAY(2000000); (*cold_hook)(HPPA_COLD_OFF);