summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1999-01-06 01:31:21 +0000
committerkstailey <kstailey@cvs.openbsd.org>1999-01-06 01:31:21 +0000
commita44888a3032ccf75992f5de8016d53df2d6f325a (patch)
tree043282b4a94c3c54826d5b1de1ad4494b887eab4 /sys/arch
parentfb55e2a7de084a37a01b4713e499a5f1f26699bc (diff)
fix for "halt -p" and BIOS goes "no disk drives"
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/apm.c7
-rw-r--r--sys/arch/i386/i386/machdep.c8
2 files changed, 10 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index 4ec43777237..e3324f310dd 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.23 1998/11/15 16:36:49 art Exp $ */
+/* $OpenBSD: apm.c,v 1.24 1999/01/06 01:31:20 kstailey Exp $ */
/*-
* Copyright (c) 1995 John T. Kohl. All rights reserved.
@@ -527,7 +527,10 @@ apm_set_powstate(dev, state)
regs.cx = state;
if (apmcall(APM_SET_PWR_STATE, dev, &regs) != 0) {
apm_perror("set power state", &regs);
- return EIO;
+ if (APM_ERR_CODE(&regs) == APM_ERR_UNRECOG_DEV)
+ return ENXIO;
+ else
+ return EIO;
}
return 0;
}
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index bda1cfdd4a0..bc1f2fb8dab 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.95 1998/12/28 11:03:57 downsj Exp $ */
+/* $OpenBSD: machdep.c,v 1.96 1999/01/06 01:31:20 kstailey Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -1229,6 +1229,8 @@ haltsys:
if (howto & RB_HALT) {
#if NAPM > 0
if (howto & RB_POWERDOWN) {
+ int rv;
+
printf("\nAttempting to power down...\n");
/*
* Turn off, if we can. But try to turn disk off and
@@ -1239,8 +1241,8 @@ haltsys:
* try to turn the system off.
*/
delay(500000);
- if (apm_set_powstate(APM_DEV_DISK(0xff),
- APM_SYS_OFF) == 0) {
+ rv = apm_set_powstate(APM_DEV_DISK(0xff), APM_SYS_OFF);
+ if (rv == 0 || rv == ENXIO) {
delay(500000);
(void) apm_set_powstate(APM_DEV_ALLDEVS,
APM_SYS_OFF);