summaryrefslogtreecommitdiff
path: root/sys/dev/ofw
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2004-06-24 02:57:11 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2004-06-24 02:57:11 +0000
commita82b25f9b23d656e4b667c404e4b468d26af804d (patch)
tree76bb7d8802bc7656b088251222a80b55f2038926 /sys/dev/ofw
parentd7af790b0d579a100226de0f9be1b1444c6170bb (diff)
Notes
Diffstat (limited to 'sys/dev/ofw')
-rw-r--r--sys/dev/ofw/ofw_console.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index 5ee59147e593..9dfe71334c02 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$");
#include "opt_ddb.h"
#include "opt_comconsole.h"
+#include "opt_ofw.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -42,7 +43,10 @@ __FBSDID("$FreeBSD$");
#include <ddb/ddb.h>
-#define OFW_POLL_HZ 4
+#ifndef OFWCONS_POLL_HZ
+#define OFWCONS_POLL_HZ 4 /* 50-100 works best on Ultra2 */
+#endif
+#define OFBURSTLEN 128 /* max number of bytes to write in one chunk */
static d_open_t ofw_dev_open;
static d_close_t ofw_dev_close;
@@ -125,7 +129,7 @@ ofw_dev_open(struct cdev *dev, int flag, int mode, struct thread *td)
ttychars(tp);
tp->t_iflag = TTYDEF_IFLAG;
tp->t_oflag = TTYDEF_OFLAG;
- tp->t_cflag = TTYDEF_CFLAG|CLOCAL;
+ tp->t_cflag = TTYDEF_CFLAG;
tp->t_lflag = TTYDEF_LFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
ttsetwater(tp);
@@ -138,7 +142,7 @@ ofw_dev_open(struct cdev *dev, int flag, int mode, struct thread *td)
error = ttyld_open(tp, dev);
if (error == 0 && setuptimeout) {
- polltime = hz / OFW_POLL_HZ;
+ polltime = hz / OFWCONS_POLL_HZ;
if (polltime < 1) {
polltime = 1;
}
@@ -162,6 +166,8 @@ ofw_dev_close(struct cdev *dev, int flag, int mode, struct thread *td)
return (ENXIO);
}
+ /* XXX Should be replaced with callout_stop(9) */
+ untimeout(ofw_timeout, tp, ofw_timeouthandle);
ttyld_close(tp, flag);
ttyclose(tp);
@@ -179,16 +185,18 @@ ofw_tty_param(struct tty *tp, struct termios *t)
static void
ofw_tty_start(struct tty *tp)
{
+ struct clist *cl;
+ int len;
+ u_char buf[OFBURSTLEN];
+
- if (tp->t_state & (TS_TIMEOUT | TS_TTSTOP)) {
- ttwwakeup(tp);
+ if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP))
return;
- }
tp->t_state |= TS_BUSY;
- while (tp->t_outq.c_cc != 0) {
- ofw_cons_putc(NULL, getc(&tp->t_outq));
- }
+ cl = &tp->t_outq;
+ len = q_to_b(cl, buf, OFBURSTLEN);
+ OF_write(stdout, buf, len);
tp->t_state &= ~TS_BUSY;
ttwwakeup(tp);