diff options
-rw-r--r-- | sys/conf/options.sparc64 | 1 | ||||
-rw-r--r-- | sys/dev/ofw/ofw_console.c | 26 | ||||
-rw-r--r-- | sys/sparc64/conf/NOTES | 2 |
3 files changed, 20 insertions, 9 deletions
diff --git a/sys/conf/options.sparc64 b/sys/conf/options.sparc64 index a8ce3e7..307ce70 100644 --- a/sys/conf/options.sparc64 +++ b/sys/conf/options.sparc64 @@ -9,6 +9,7 @@ GFB_NO_MODE_CHANGE opt_gfb.h PSYCHO_DEBUG opt_psycho.h DEBUGGER_ON_POWERFAIL opt_psycho.h OFW_PCI_DEBUG opt_ofw_pci.h +OFWCONS_POLL_HZ opt_ofw.h # Debug IOMMU inserts/removes using diagnostic accesses. Very loud. IOMMU_DIAG opt_iommu.h PMAP_STATS opt_pmap.h diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c index 5ee5914..9dfe713 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); diff --git a/sys/sparc64/conf/NOTES b/sys/sparc64/conf/NOTES index d4e00fb..4edc15f 100644 --- a/sys/sparc64/conf/NOTES +++ b/sys/sparc64/conf/NOTES @@ -50,6 +50,8 @@ device "mk48txx" # Mostek MK48T02, MK48T08, MK48T59 clock device sab # Siemens SAB82532 based serial ports device zs # Zilog 8530 based serial ports +option OFWCONS_POLL_HZ=4 # 20 or more works best on Ultra2 + ##################################################################### # Devices we don't want to deal with |