aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1995-01-20 07:34:18 +0000
committerBill Paul <wpaul@FreeBSD.org>1995-01-20 07:34:18 +0000
commit2b237b40581f53f84d9cd974e9b2356a3cddf9d7 (patch)
tree8d194e8fb76406a9e2735b0ce7da1fb32fca653c /sys/dev
parentc665f1dabd79a43946bf95fb7517d83da4183595 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sio/sio.c28
-rw-r--r--sys/dev/sio/sioreg.h11
2 files changed, 26 insertions, 13 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 853c773713112..60fd3574524f5 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.63 1995/01/05 00:00:37 ache Exp $
+ * $Id: sio.c,v 1.64 1995/01/06 15:03:41 bde Exp $
*/
#include "sio.h"
@@ -44,6 +44,7 @@
*/
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/reboot.h>
#include <sys/ioctl.h>
#define TTYDEFCHARS /* XXX TK2.0 */
#include <sys/tty.h>
@@ -298,10 +299,12 @@ struct isa_driver siodriver = {
};
#ifdef COMCONSOLE
-static int comconsole = COMCONSOLE;
+#define COMCONSOLE 1
#else
-static int comconsole = -1;
+#define COMCONSOLE 0
#endif
+
+static int comconsole = CONUNIT;
static speed_t comdefaultrate = TTYDEF_SPEED;
static u_int com_events; /* input chars + weighted output completions */
static int commajor;
@@ -609,7 +612,7 @@ sioattach(isdp)
com->it_in.c_oflag = 0;
com->it_in.c_cflag = TTYDEF_CFLAG;
com->it_in.c_lflag = 0;
- if (unit == comconsole) {
+ if (unit == comconsole && ((boothowto & RB_SERIAL) || COMCONSOLE)) {
com->it_in.c_iflag = TTYDEF_IFLAG;
com->it_in.c_oflag = TTYDEF_OFLAG;
com->it_in.c_cflag = TTYDEF_CFLAG | CLOCAL;
@@ -692,7 +695,8 @@ determined_type: ;
#ifdef KGDB
if (kgdb_dev == makedev(commajor, unit)) {
- if (unit == comconsole)
+ if (unit == comconsole && ((boothowto & RB_SERIAL)
+ || COMCONSOLE))
kgdb_dev = -1; /* can't debug over console port */
else {
int divisor;
@@ -1003,7 +1007,8 @@ siowrite(dev, uio, flag)
* is not the console. In that situation we don't need/want the X
* server taking over the console.
*/
- if (constty && unit == comconsole)
+ if (constty && unit == comconsole && ((boothowto & RB_SERIAL)
+ || COMCONSOLE))
constty = NULL;
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
@@ -2039,11 +2044,12 @@ siocnprobe(cp)
/* initialize required fields */
cp->cn_dev = makedev(commajor, unit);
-#ifdef COMCONSOLE
- cp->cn_pri = CN_REMOTE; /* Force a serial port console */
-#else
- cp->cn_pri = CN_NORMAL;
-#endif
+
+ if (boothowto & RB_SERIAL || COMCONSOLE)
+ cp->cn_pri = CN_REMOTE; /* Force a serial port console */
+ else
+ cp->cn_pri = CN_NORMAL;
+
}
void
diff --git a/sys/dev/sio/sioreg.h b/sys/dev/sio/sioreg.h
index 4b0f1b6fa5de7..d43bcdf02ee94 100644
--- a/sys/dev/sio/sioreg.h
+++ b/sys/dev/sio/sioreg.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
- * $Id$
+ * $Id: sioreg.h,v 1.2 1993/10/16 19:17:18 rgrimes Exp $
*/
@@ -109,6 +109,13 @@
/*
* WARNING: Serial console is assumed to be at COM1 address
* and CONUNIT must be 0.
+ *
+ * Well, maybe not...
*/
-#define CONADDR (0x3f8)
+#ifndef CONADDR
+#define CONADDR (0x3F8)
+#endif
+
+#ifndef CONUNIT
#define CONUNIT (0)
+#endif