Module Name: src
Committed By: tsutsui
Date: Fri Apr 9 11:09:03 UTC 2010
Modified Files:
src/sys/arch/atari/dev: ser.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/atari/dev/ser.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/atari/dev/ser.c
diff -u src/sys/arch/atari/dev/ser.c:1.48 src/sys/arch/atari/dev/ser.c:1.49
--- src/sys/arch/atari/dev/ser.c:1.48 Fri Apr 9 10:49:37 2010
+++ src/sys/arch/atari/dev/ser.c Fri Apr 9 11:09:03 2010
@@ -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