Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/arch/arm/arm32 Pull up following revision(s) (request...
details: https://anonhg.NetBSD.org/src/rev/aab9e138b9d2
branches: netbsd-7
changeset: 799483:aab9e138b9d2
user: snj <snj%NetBSD.org@localhost>
date: Fri Jul 17 03:48:00 2015 +0000
description:
Pull up following revision(s) (requested by christos in ticket #876):
sys/arch/arm/arm32/arm32_reboot.c: revisions 1.7, 1.8
- print a warning about powerdown not supported like other ports do
- merge duplicated code
- if halt is requested and there is no console, keep looping instead of
rebooting.
--
Mark end of cpu_reboot as unreachable.
diffstat:
sys/arch/arm/arm32/arm32_reboot.c | 52 +++++++++++++++++++++------------------
1 files changed, 28 insertions(+), 24 deletions(-)
diffs (85 lines):
diff -r 203959ba8568 -r aab9e138b9d2 sys/arch/arm/arm32/arm32_reboot.c
--- a/sys/arch/arm/arm32/arm32_reboot.c Fri Jul 17 03:44:09 2015 +0000
+++ b/sys/arch/arm/arm32/arm32_reboot.c Fri Jul 17 03:48:00 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arm32_reboot.c,v 1.6 2013/08/18 06:28:18 matt Exp $ */
+/* $NetBSD: arm32_reboot.c,v 1.6.6.1 2015/07/17 03:48:00 snj Exp $ */
/*
* Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved.
@@ -122,7 +122,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.6 2013/08/18 06:28:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_reboot.c,v 1.6.6.1 2015/07/17 03:48:00 snj Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -136,6 +136,29 @@
#include <arm/locore.h>
#include <arm/arm32/machdep.h>
+static int
+docpureset(int howto)
+{
+ if (howto & RB_POWERDOWN)
+ printf("WARNING: powerdown not supported\r\n");
+
+ if (howto & RB_HALT) {
+ printf("The operating system has halted.\r\n");
+ printf("Please press any key to reboot.\r\n");
+ cnpollc(true); /* for proper keyboard command handling */
+ /* If there is no keyboard, cngetc() returns 0, so loop */
+ while (cngetc() == 0)
+ delay(100000);
+ cnpollc(false);
+ }
+
+ printf("rebooting...\r\n");
+ if (cpu_reset_address)
+ (*cpu_reset_address)();
+ cpu_reset();
+ /*NOTREACHED*/
+}
+
void
cpu_reboot(int howto, char *bootstr)
{
@@ -146,15 +169,7 @@
*/
if (cold) {
doshutdownhooks();
- printf("The operating system has halted.\r\n");
- printf("Please press any key to reboot.\r\n");
- cnpollc(true); /* for proper keyboard command handling */
- cngetc();
- cnpollc(false);
- printf("rebooting...\r\n");
- if (cpu_reset_address)
- (*cpu_reset_address)();
- cpu_reset();
+ docpureset(RB_HALT | howto);
}
/*
@@ -187,17 +202,6 @@
/* Make sure IRQ's are disabled */
IRQdisable;
- if (howto & RB_HALT) {
- printf("The operating system has halted.\r\n");
- printf("Please press any key to reboot.\r\n");
- cnpollc(true); /* for proper keyboard command handling */
- cngetc();
- cnpollc(false);
- }
-
- printf("rebooting...\r\n");
- if (cpu_reset_address)
- (*cpu_reset_address)();
- cpu_reset();
- /*NOTREACHED*/
+ docpureset(howto);
+ __unreachable();
}
Home |
Main Index |
Thread Index |
Old Index