Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Make the amd64 post-halt-press-a-key code match i38...



details:   https://anonhg.NetBSD.org/src/rev/2ca9c27ee32e
branches:  trunk
changeset: 325843:2ca9c27ee32e
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Jan 09 00:57:25 2014 +0000

description:
Make the amd64 post-halt-press-a-key code match i386, and introduce
into both a message for the case where cngetc() doesn't work. If
there's no console attached, this won't accomplish anything; but if
there's a screen but no keyboard, or the keyboard's wedged, or
whatever, it might provide useful information.

Suggested back in 2009 by some stuff in PR 37924 and has been hanging
about in one of my trees ever since.

diffstat:

 sys/arch/amd64/amd64/machdep.c |  12 +++++++++---
 sys/arch/i386/i386/machdep.c   |   5 +++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diffs (59 lines):

diff -r 84467f03ea80 -r 2ca9c27ee32e sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Wed Jan 08 22:58:50 2014 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Thu Jan 09 00:57:25 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.200 2013/12/01 01:05:16 christos Exp $   */
+/*     $NetBSD: machdep.c,v 1.201 2014/01/09 00:57:25 dholland Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.200 2013/12/01 01:05:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.201 2014/01/09 00:57:25 dholland Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -728,7 +728,13 @@
                printf("The operating system has halted.\n");
                printf("Please press any key to reboot.\n\n");
                cnpollc(1);     /* for proper keyboard command handling */
-               cngetc();
+               if (cngetc() == 0) {
+                       /* no console attached, so just hlt */
+                       printf("No keyboard - cannot reboot after all.\n");
+                       for(;;) {
+                               x86_hlt();
+                       }
+               }
                cnpollc(0);
        }
 
diff -r 84467f03ea80 -r 2ca9c27ee32e sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Wed Jan 08 22:58:50 2014 +0000
+++ b/sys/arch/i386/i386/machdep.c      Thu Jan 09 00:57:25 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.740 2013/12/08 20:45:30 dsl Exp $        */
+/*     $NetBSD: machdep.c,v 1.741 2014/01/09 00:57:25 dholland Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.740 2013/12/08 20:45:30 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.741 2014/01/09 00:57:25 dholland Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -842,6 +842,7 @@
                cnpollc(1);     /* for proper keyboard command handling */
                if (cngetc() == 0) {
                        /* no console attached, so just hlt */
+                       printf("No keyboard - cannot reboot after all.\n");
                        for(;;) {
                                x86_hlt();
                        }



Home | Main Index | Thread Index | Old Index