summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authortsutsui <tsutsui@NetBSD.org>2021-10-09 20:00:41 +0000
committertsutsui <tsutsui@NetBSD.org>2021-10-09 20:00:41 +0000
commitdc398f1e3bc5bbdfc50fd84a894bbf435147a5ca (patch)
tree25fbed3f01906165a9ad0d515837765b7dbf4d9f /sys
parentf0dec67fc64579dd1723cbd92c4b4e048750d6cc (diff)
Call cnpollc(9) before cngetc(9) as the cons(9) man page says.
Currently most ports do nothing in cnpollc(9), but this is required to handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/atari/atari/machdep.c9
-rw-r--r--sys/arch/cesfic/cesfic/machdep.c8
-rw-r--r--sys/arch/hp300/hp300/machdep.c8
-rw-r--r--sys/arch/luna68k/luna68k/machdep.c6
-rw-r--r--sys/arch/mac68k/mac68k/machdep.c6
-rw-r--r--sys/arch/mvme68k/mvme68k/machdep.c6
-rw-r--r--sys/arch/news68k/news68k/machdep.c6
-rw-r--r--sys/arch/next68k/next68k/machdep.c6
-rw-r--r--sys/arch/x68k/x68k/machdep.c8
9 files changed, 44 insertions, 19 deletions
diff --git a/sys/arch/atari/atari/machdep.c b/sys/arch/atari/atari/machdep.c
index 6519980344b..557c9cf0291 100644
--- a/sys/arch/atari/atari/machdep.c
+++ b/sys/arch/atari/atari/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.184 2021/01/03 17:42:10 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.185 2021/10/09 20:00:41 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.184 2021/01/03 17:42:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.185 2021/10/09 20:00:41 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -440,7 +440,10 @@ dumpsys(void)
#if defined(DDB) || defined(PANICWAIT)
printf("Do you want to dump memory? [y]");
- cnputc(i = cngetc());
+ cnpollc(1);
+ i = cngetc();
+ cnpollc(0);
+ cnputc(i);
switch (i) {
case 'n':
case 'N':
diff --git a/sys/arch/cesfic/cesfic/machdep.c b/sys/arch/cesfic/cesfic/machdep.c
index 72193b82f70..f5845053f60 100644
--- a/sys/arch/cesfic/cesfic/machdep.c
+++ b/sys/arch/cesfic/cesfic/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.71 2020/06/11 19:20:43 ad Exp $ */
+/* $NetBSD: machdep.c,v 1.72 2021/10/09 20:00:41 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.71 2020/06/11 19:20:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.72 2021/10/09 20:00:41 tsutsui Exp $");
#include "opt_bufcache.h"
#include "opt_ddb.h"
@@ -337,7 +337,9 @@ cpu_reboot(int howto, char *bootstr)
#if defined(PANICWAIT) && !defined(DDB)
if ((howto & RB_HALT) == 0 && panicstr) {
printf("hit any key to reboot...\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
printf("\n");
}
#endif
@@ -345,7 +347,9 @@ cpu_reboot(int howto, char *bootstr)
/* Finally, halt/reboot the system. */
if (howto & RB_HALT) {
printf("System halted. Hit any key to reboot.\n\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
}
printf("rebooting...\n");
diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c
index 88c548c0459..9becf3b9269 100644
--- a/sys/arch/hp300/hp300/machdep.c
+++ b/sys/arch/hp300/hp300/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.235 2021/08/06 05:22:21 tsutsui Exp $ */
+/* $NetBSD: machdep.c,v 1.236 2021/10/09 20:00:41 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.235 2021/08/06 05:22:21 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.236 2021/10/09 20:00:41 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -612,7 +612,9 @@ cpu_reboot(int howto, char *bootstr)
#if defined(PANICWAIT) && !defined(DDB)
if ((howto & RB_HALT) == 0 && panicstr) {
printf("hit any key to reboot...\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
printf("\n");
}
#endif
@@ -620,7 +622,9 @@ cpu_reboot(int howto, char *bootstr)
/* Finally, halt/reboot the system. */
if (howto & RB_HALT) {
printf("System halted. Hit any key to reboot.\n\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
}
printf("rebooting...\n");
diff --git a/sys/arch/luna68k/luna68k/machdep.c b/sys/arch/luna68k/luna68k/machdep.c
index 61f6a0ecd1f..0375b28e9ba 100644
--- a/sys/arch/luna68k/luna68k/machdep.c
+++ b/sys/arch/luna68k/luna68k/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.107 2021/09/25 15:18:38 tsutsui Exp $ */
+/* $NetBSD: machdep.c,v 1.108 2021/10/09 20:00:41 tsutsui Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.107 2021/09/25 15:18:38 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.108 2021/10/09 20:00:41 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -472,7 +472,9 @@ haltsys:
}
if (howto & RB_HALT) {
printf("System halted. Hit any key to reboot.\n\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
}
printf("rebooting...\n");
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c
index cf4b900eed2..d84f4c7cd45 100644
--- a/sys/arch/mac68k/mac68k/machdep.c
+++ b/sys/arch/mac68k/mac68k/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.362 2021/04/28 02:28:05 rin Exp $ */
+/* $NetBSD: machdep.c,v 1.363 2021/10/09 20:00:41 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.362 2021/04/28 02:28:05 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.363 2021/10/09 20:00:41 tsutsui Exp $");
#include "opt_adb.h"
#include "opt_compat_netbsd.h"
@@ -500,7 +500,9 @@ cpu_reboot(int howto, char *bootstr)
printf("\n");
printf("The operating system has halted.\n");
printf("Please press any key to reboot.\n\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
}
/* Map the last physical page VA = PA for doboot() */
diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c
index 4d14c6a791e..3d1b74b3843 100644
--- a/sys/arch/mvme68k/mvme68k/machdep.c
+++ b/sys/arch/mvme68k/mvme68k/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.158 2020/06/11 19:20:44 ad Exp $ */
+/* $NetBSD: machdep.c,v 1.159 2021/10/09 20:00:41 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.158 2020/06/11 19:20:44 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.159 2021/10/09 20:00:41 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_m060sp.h"
@@ -654,7 +654,9 @@ cpu_reboot(int howto, char *bootstr)
#if defined(PANICWAIT) && !defined(DDB)
if ((howto & RB_HALT) == 0 && panicstr) {
printf("hit any key to reboot...\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
printf("\n");
}
#endif
diff --git a/sys/arch/news68k/news68k/machdep.c b/sys/arch/news68k/news68k/machdep.c
index 3d1683c3d40..cf15c1125ba 100644
--- a/sys/arch/news68k/news68k/machdep.c
+++ b/sys/arch/news68k/news68k/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.109 2021/08/06 05:53:50 tsutsui Exp $ */
+/* $NetBSD: machdep.c,v 1.110 2021/10/09 20:00:42 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.109 2021/08/06 05:53:50 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.110 2021/10/09 20:00:42 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -321,7 +321,9 @@ cpu_reboot(int howto, char *bootstr)
#if defined(PANICWAIT) && !defined(DDB)
if ((howto & RB_HALT) == 0 && panicstr) {
printf("hit any key to reboot...\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
printf("\n");
}
#endif
diff --git a/sys/arch/next68k/next68k/machdep.c b/sys/arch/next68k/next68k/machdep.c
index 2c87a81bcea..44d637e567e 100644
--- a/sys/arch/next68k/next68k/machdep.c
+++ b/sys/arch/next68k/next68k/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.115 2020/06/11 19:20:44 ad Exp $ */
+/* $NetBSD: machdep.c,v 1.116 2021/10/09 20:00:42 tsutsui Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.115 2020/06/11 19:20:44 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.116 2021/10/09 20:00:42 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -469,7 +469,9 @@ cpu_reboot(int howto, char *bootstr)
#if defined(PANICWAIT) && !defined(DDB)
if ((howto & RB_HALT) == 0 && panicstr) {
printf("hit any key to reboot...\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
printf("\n");
}
#endif
diff --git a/sys/arch/x68k/x68k/machdep.c b/sys/arch/x68k/x68k/machdep.c
index 31dc8bee4d4..59c721bbdc0 100644
--- a/sys/arch/x68k/x68k/machdep.c
+++ b/sys/arch/x68k/x68k/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.206 2021/08/06 04:21:56 isaki Exp $ */
+/* $NetBSD: machdep.c,v 1.207 2021/10/09 20:00:42 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.206 2021/08/06 04:21:56 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.207 2021/10/09 20:00:42 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -518,7 +518,9 @@ cpu_reboot(int howto, char *bootstr)
#if defined(PANICWAIT) && !defined(DDB)
if ((howto & RB_HALT) == 0 && panicstr) {
printf("hit any key to reboot...\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
printf("\n");
}
#endif
@@ -551,7 +553,9 @@ cpu_reboot(int howto, char *bootstr)
/* PASSTHROUGH even if came back */
} else if ((howto & RB_HALT) == RB_HALT) {
printf("System halted. Hit any key to reboot.\n\n");
+ cnpollc(1);
(void)cngetc();
+ cnpollc(0);
}
printf("rebooting...\n");