local_irq_save(flags); if (spin_trylock(&srmcons_callback_lock)) { if (!srmcons_do_receive_chars(port))
incr = 100;
spin_unlock(&srmcons_callback_lock);
}
spin_lock(&port->lock); if (port->tty)
mod_timer(&srmconsp->timer, jiffies + incr);
spin_unlock(&port->lock);
local_irq_restore(flags);
}
/* called with callback_lock held */ staticvoid
srmcons_do_write(struct tty_port *port, const u8 *buf, size_t count)
{
size_t c;
srmcons_result result;
while (count > 0) { bool need_cr = false; /* * Break it up into reasonable size chunks to allow a chance * for input to get in
*/ for (c = 0; c < min_t(size_t, 128U, count) && !need_cr; c++) if (buf[c] == '\n')
need_cr = true;
while (c > 0) {
result.as_long = callback_puts(0, buf, c);
c -= result.bits.c;
count -= result.bits.c;
buf += result.bits.c;
/* * Check for pending input iff a tty port was provided
*/ if (port)
srmcons_do_receive_chars(port);
}
while (need_cr) {
result.as_long = callback_puts(0, "\r", 1); if (result.bits.c > 0)
need_cr = false;
}
}
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.