From: Alan Cox Date: Sun, 18 Nov 2018 21:56:27 +0000 (+0000) Subject: tty: simple optimization for a very hot path X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6ff5ee55bb58d2bc585c830ffa7a8e6febf204b5;p=FUZIX.git tty: simple optimization for a very hot path We can do the valaddr once on Fuzix as we don't have threads or sleep races to worry about --- diff --git a/Kernel/tty.c b/Kernel/tty.c index ec8e27df..6a90fdbd 100644 --- a/Kernel/tty.c +++ b/Kernel/tty.c @@ -106,6 +106,9 @@ int tty_write(uint8_t minor, uint8_t rawflag, uint8_t flag) used(rawflag); + if (!valaddr(udata.u_base, udata.u_count)) + return -1; + t = &ttydata[minor]; while (udata.u_done != udata.u_count) { @@ -136,7 +139,7 @@ int tty_write(uint8_t minor, uint8_t rawflag, uint8_t flag) if (udata.u_sysio) c = *udata.u_base; else - c = ugetc(udata.u_base); + c = _ugetc(udata.u_base); if (t->termios.c_oflag & OPOST) { if (c == '\n' && (t->termios.c_oflag & ONLCR))