Module Name:    src
Committed By:   tsutsui
Date:           Sun Dec  6 02:21:55 UTC 2015

Modified Files:
        src/sys/arch/sh3/dev: scif.c

Log Message:
Make options SCIFCONSOLE patchable via a variable using gdb(1) etc.

Tested on dreamcast.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/sh3/dev/scif.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/sh3/dev/scif.c
diff -u src/sys/arch/sh3/dev/scif.c:1.65 src/sys/arch/sh3/dev/scif.c:1.66
--- src/sys/arch/sh3/dev/scif.c:1.65	Sat Nov 15 19:20:01 2014
+++ src/sys/arch/sh3/dev/scif.c	Sun Dec  6 02:21:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: scif.c,v 1.65 2014/11/15 19:20:01 christos Exp $ */
+/*	$NetBSD: scif.c,v 1.66 2015/12/06 02:21:55 tsutsui Exp $ */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.65 2014/11/15 19:20:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.66 2015/12/06 02:21:55 tsutsui Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_scif.h"
@@ -223,6 +223,10 @@ const struct cdevsw scif_cdevsw = {
 	.d_flag = D_TTY
 };
 
+#ifndef SCIFCONSOLE
+#define SCIFCONSOLE	0
+#endif
+int scifconsole = SCIFCONSOLE;	/* patchable */
 
 /* struct tty */
 static void scifstart(struct tty *);
@@ -1424,11 +1428,10 @@ scifcnprobe(struct consdev *cp)
 
 	/* Initialize required fields. */
 	cp->cn_dev = makedev(maj, 0);
-#ifdef SCIFCONSOLE
-	cp->cn_pri = CN_REMOTE;
-#else
-	cp->cn_pri = CN_NORMAL;
-#endif
+	if (scifconsole)
+		cp->cn_pri = CN_REMOTE;
+	else
+		cp->cn_pri = CN_NORMAL;
 }
 
 void

Reply via email to