static int kmoutput(struct tty *tp) { /* * FIXME - to be grokked...copied from m68k km.c. */ char buf[80]; char *cp; int cc = -1; while (tp->t_outq.c_cc > 0) { cc = ndqb(&tp->t_outq, 0); if (cc == 0) break; cc = min(cc, sizeof buf); (void) q_to_b(&tp->t_outq, (unsigned char *)buf, cc); for (cp = buf; cp < &buf[cc]; cp++) kmputc(tp->t_dev, *cp & 0x7f); } if (tp->t_outq.c_cc > 0) { timeout((timeout_fcn_t)kmtimeout, tp, hz); } tp->t_state &= ~TS_BUSY; (*linesw[tp->t_line].l_start)(tp); return 0; }
/* * kmoutput * * Locks: Assumes tp is locked on entry, remains locked on exit * * Notes: Called from kmstart() and kmtimeout(); kmtimeout() is a * timer initiated by this routine to deal with pending * output not yet flushed (output is flushed at a maximum * of sizeof(buf) charatcers at a time before dropping into * the timeout code). */ static int kmoutput(struct tty *tp) { char buf[80]; /* buffer; limits output per call */ char *cp; int cc = -1; /* While there is data available to be output... */ while (tp->t_outq.c_cc > 0) { cc = ndqb(&tp->t_outq, 0); if (cc == 0) break; /* * attempt to output as many characters as are available, * up to the available transfer buffer size. */ cc = min(cc, sizeof buf); /* copy the output queue contents to the buffer */ (void) q_to_b(&tp->t_outq, (unsigned char *)buf, cc); for (cp = buf; cp < &buf[cc]; cp++) { /* output the buffer one charatcer at a time */ kmputc(tp->t_dev, *cp & 0x7f); } } if (tp->t_outq.c_cc > 0) { timeout((timeout_fcn_t)kmtimeout, tp, hz); } tp->t_state &= ~TS_BUSY; (*linesw[tp->t_line].l_start)(tp); return 0; }
static int kmoutput( struct tty *tp) { /* * FIXME - to be grokked...copied from m68k km.c. */ char buf[80]; char *cp; int cc = -1; extern int hz; while (tp->t_outq.c_cc > 0) { cc = ndqb(&tp->t_outq, 0); if (cc == 0) break; cc = min(cc, sizeof buf); (void) q_to_b(&tp->t_outq, buf, cc); for (cp = buf; cp < &buf[cc]; cp++) { kmputc(*cp & 0x7f); } } if (tp->t_outq.c_cc > 0) { timeout((timeout_fcn_t)kmtimeout, tp, hz); } tp->t_state &= ~TS_BUSY; ttwwakeup(tp); return 0; }
/* * kmoutput * * Locks: Assumes tp is locked on entry, remains locked on exit * * Notes: Called from kmstart() and kmtimeout(); kmtimeout() is a * timer initiated by this routine to deal with pending * output not yet flushed (output is flushed at a maximum * of sizeof(buf) charatcers at a time before dropping into * the timeout code). */ static int kmoutput(struct tty *tp) { unsigned char buf[80]; /* buffer; limits output per call */ unsigned char *cp; int cc = -1; /* * While there is data available to be output... */ while (tp->t_outq.c_cc > 0) { cc = ndqb(&tp->t_outq, 0); if (cc == 0) break; /* * attempt to output as many characters as are available, * up to the available transfer buffer size. */ cc = min(cc, sizeof(buf)); /* * copy the output queue contents to the buffer */ (void) q_to_b(&tp->t_outq, buf, cc); for (cp = buf; cp < &buf[cc]; cp++) { /* * output the buffer one charatcer at a time */ kmputc(tp->t_dev, *cp & 0x7f); } } /* * XXX This is likely not necessary, as the tty output queue is not * XXX writeable while we hold the tty_lock(). */ if (tp->t_outq.c_cc > 0) { timeout(kmtimeout, tp, hz); } tp->t_state &= ~TS_BUSY; /* * Start the output processing for the line discipline */ (*linesw[tp->t_line].l_start) (tp); return 0; }