summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Cosgrove <tom@cvs.openbsd.org>2016-10-08 17:02:49 +0000
committerTom Cosgrove <tom@cvs.openbsd.org>2016-10-08 17:02:49 +0000
commit472ee6023efd227997712117c6e19b1e7f799040 (patch)
tree930b9ac80b2ddcff34f97ad38a012e3476b17f0a
parent72e80f6efc1869f01564c1235657a5cd5f319232 (diff)
Simplify handling of cold reboot on armv7 to match other platforms
Suggested by and ok both patrick@ and kettenis@
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index 419c8050569..f62e8e91a6f 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.42 2016/10/05 07:44:24 patrick Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.43 2016/10/08 17:02:48 tom Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -237,19 +237,9 @@ boot(int howto)
#endif
if (cold) {
- config_suspend_all(DVACT_POWERDOWN);
- 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(500000);
- if (cpuresetfn)
- (*cpuresetfn)();
- printf("reboot failed; spinning\n");
- while(1);
- /*NOTREACHED*/
+ if ((howto & RB_USERREQ) == 0)
+ howto |= RB_HALT;
+ goto haltsys;
}
/* Disable console buffering */
@@ -274,6 +264,7 @@ boot(int howto)
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
dumpsys();
+haltsys:
config_suspend_all(DVACT_POWERDOWN);
/* Make sure IRQ's are disabled */
@@ -296,7 +287,8 @@ boot(int howto)
if (cpuresetfn)
(*cpuresetfn)();
printf("reboot failed; spinning\n");
- for (;;) ;
+ for (;;)
+ continue;
/* NOTREACHED */
}