diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2008-06-08 20:56:34 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2008-06-08 20:56:34 +0000 |
commit | a587c12e336de345a9c788100500c94b6fa7c0f4 (patch) | |
tree | 9301e79819cbe867666914955ba04a4495a52979 /sys/arch/armish | |
parent | e0d2181c0e1ef5ee5bda6da2ae6cd582eabe8996 (diff) |
Change boot() logic, to match what other platforms do and avoid duplicating
code in the cold case.
Diffstat (limited to 'sys/arch/armish')
-rw-r--r-- | sys/arch/armish/armish/armish_machdep.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/sys/arch/armish/armish/armish_machdep.c b/sys/arch/armish/armish/armish_machdep.c index 78e7b89534e..2c6eeabf0ca 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.11 2008/03/23 17:05:41 deraadt Exp $ */ +/* $OpenBSD: armish_machdep.c,v 1.12 2008/06/08 20:56:31 miod Exp $ */ /* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */ /* @@ -240,28 +240,16 @@ void board_powerdown(void); void boot(int howto) { - /* - * If we are still cold then hit the air brakes - * and crash to earth fast - */ if (cold) { - doshutdownhooks(); - if ((howto & (RB_HALT | RB_USERREQ)) != RB_USERREQ) { - printf("The operating system has halted.\n"); - printf("Please press any key to reboot.\n\n"); - cngetc(); - } - printf("rebooting...\n"); - delay(60000); - cpu_reset(); - printf("reboot failed; spinning\n"); - while(1); - /*NOTREACHED*/ + /* + * If the system is cold, just halt, unless the user + * explicitely asked for reboot. + */ + if ((howto & RB_USERREQ) == 0) + howto |= RB_HALT; + goto haltsys; } - /* Disable console buffering */ -/* cnpollc(1);*/ - /* * If RB_NOSYNC was not specified sync the discs. * Note: Unless cold is set to 1 here, syslogd will die during the @@ -279,7 +267,7 @@ boot(int howto) if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP) dumpsys(); - /* Run any shutdown hooks */ +haltsys: doshutdownhooks(); /* Make sure IRQ's are disabled */ @@ -293,7 +281,9 @@ boot(int howto) printf("The operating system has halted.\n"); printf("Please press any key to reboot.\n\n"); + cnpollc(1); cngetc(); + cnpollc(0); } printf("rebooting...\n"); |