Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/atari/dev Make options SERCONSOLE (force serial con...
details: https://anonhg.NetBSD.org/src/rev/457b452ce7bc
branches: trunk
changeset: 753756:457b452ce7bc
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Fri Apr 09 11:09:03 2010 +0000
description:
Make options SERCONSOLE (force serial console if DCD is detected)
patchable by binpatch(8) like:
---
# binpatch -s serconsole -r 0 /netbsd
serconsole(0x23bac4): 0x00000001 (1), at offset 0x23bb44 in /netbsd
new value: 0x00000000 (0)
#
---
May work around PR port-atari/39849
(netbsd-ATARITT kernel fails with serial port connected)
and some old TT030 with early revision boards.
diffstat:
sys/arch/atari/dev/ser.c | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
diffs (67 lines):
diff -r 97025ec40705 -r 457b452ce7bc sys/arch/atari/dev/ser.c
--- a/sys/arch/atari/dev/ser.c Fri Apr 09 10:49:37 2010 +0000
+++ b/sys/arch/atari/dev/ser.c Fri Apr 09 11:09:03 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ser.c,v 1.48 2010/04/09 10:49:37 tsutsui Exp $ */
+/* $NetBSD: ser.c,v 1.49 2010/04/09 11:09:03 tsutsui Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.48 2010/04/09 10:49:37 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.49 2010/04/09 11:09:03 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_mbtype.h"
@@ -263,6 +263,11 @@
serstop, sertty, serpoll, nommap, ttykqfilter, D_TTY
};
+#ifndef SERCONSOLE
+#define SERCONSOLE 0
+#endif
+int serconsole = SERCONSOLE; /* patchable */
+
/*ARGSUSED*/
static int
sermatch(device_t parent, cfdata_t cf, void *aux)
@@ -316,13 +321,13 @@
callout_init(&sc->sc_diag_ch, 0);
-#if SERCONSOLE > 0
- /*
- * Activate serial console when DCD present...
- */
- if ((MFP->mf_gpip & MCR_DCD) == 0)
- SET(sc->sc_hwflags, SER_HW_CONSOLE);
-#endif /* SERCONSOLE > 0 */
+ if (serconsole) {
+ /*
+ * Activate serial console when DCD present...
+ */
+ if ((MFP->mf_gpip & MCR_DCD) == 0)
+ SET(sc->sc_hwflags, SER_HW_CONSOLE);
+ }
aprint_normal(": modem1 on 68901 MFP1 USART\n");
if (ISSET(sc->sc_hwflags, SER_HW_CONSOLE)) {
@@ -1361,11 +1366,10 @@
/* initialize required fields */
/* XXX: LWP What unit? */
cp->cn_dev = makedev(cdevsw_lookup_major(&ser_cdevsw), 0);
-#if SERCONSOLE > 0
- cp->cn_pri = CN_REMOTE; /* Force a serial port console */
-#else
- cp->cn_pri = CN_NORMAL;
-#endif /* SERCONSOLE > 0 */
+ if (serconsole)
+ cp->cn_pri = CN_REMOTE; /* Force a serial port console */
+ else
+ cp->cn_pri = CN_NORMAL;
}
void
Home |
Main Index |
Thread Index |
Old Index