/* * t_oproc for this driver; called from within the line discipline * * Locks: Assumes tp is locked on entry, remains locked on exit */ static void kmstart(struct tty *tp) { if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) goto out; if (tp->t_outq.c_cc == 0) goto out; tp->t_state |= TS_BUSY; if (tp->t_outq.c_cc > tp->t_lowat) { /* * Start immediately. */ kmoutput(tp); } else { /* * Wait a bit... */ #if 0 /* FIXME */ timeout(kmtimeout, tp, hz); #else kmoutput(tp); #endif } return; out: (*linesw[tp->t_line].l_start) (tp); return; }
static void kmstart( struct tty *tp) { extern int hz; if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) goto out; if (tp->t_outq.c_cc == 0) goto out; tp->t_state |= TS_BUSY; if (tp->t_outq.c_cc > tp->t_lowat) { /* * Start immediately. */ kmoutput(tp); } else { /* * Wait a bit... */ #if 0 /* FIXME */ timeout(kmtimeout, tp, hz); #else kmoutput(tp); #endif } out: ttwwakeup(tp); }
/* * One-shot output retry timeout from kmoutput(); re-calls kmoutput() at * intervals until the output queue for the tty is empty, at which point * the timeout is not rescheduled by kmoutput() * * This function must take the tty_lock() around the kmoutput() call; it * ignores the return value. */ static void kmtimeout(void *arg) { struct tty *tp = (struct tty *) arg; tty_lock(tp); (void) kmoutput(tp); tty_unlock(tp); }
static void kmtimeout(struct tty *tp) { boolean_t funnel_state; funnel_state = thread_funnel_set(kernel_flock, TRUE); kmoutput(tp); (void) thread_funnel_set(kernel_flock, funnel_state); }
/* * t_oproc for this driver; called from within the line discipline * * Locks: Assumes tp is locked on entry, remains locked on exit */ static void kmstart(struct tty *tp) { if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) goto out; if (tp->t_outq.c_cc == 0) goto out; tp->t_state |= TS_BUSY; kmoutput(tp); return; out: (*linesw[tp->t_line].l_start) (tp); return; }