MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ttydisc_wakeup_watermark

Function ttydisc_wakeup_watermark

freebsd/kern/tty_ttydisc.c:1173–1192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1171}
1172
1173static void
1174ttydisc_wakeup_watermark(struct tty *tp)
1175{
1176 size_t c;
1177
1178 c = ttyoutq_bytesleft(&tp->t_outq);
1179 if (tp->t_flags & TF_HIWAT_OUT) {
1180 /* Only allow us to run when we're below the watermark. */
1181 if (c < tp->t_outlow)
1182 return;
1183
1184 /* Reset the watermark. */
1185 tp->t_flags &= ~TF_HIWAT_OUT;
1186 } else {
1187 /* Only run when we have data at all. */
1188 if (c == 0)
1189 return;
1190 }
1191 tty_wakeup(tp, FWRITE);
1192}
1193
1194size_t
1195ttydisc_getc(struct tty *tp, void *buf, size_t len)

Callers 2

ttydisc_getcFunction · 0.85
ttydisc_getc_uioFunction · 0.85

Calls 2

ttyoutq_bytesleftFunction · 0.85
tty_wakeupFunction · 0.85

Tested by

no test coverage detected