X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fv850%2Fkernel%2Fsimcons.c;h=9973596ae3044e7dffc937bf8fc074f06ae451c5;hb=refs%2Fremotes%2Fvserver;hp=7f0efaa025c9ba99fe2e130ac502824ae70ffcc5;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/arch/v850/kernel/simcons.c b/arch/v850/kernel/simcons.c index 7f0efaa02..9973596ae 100644 --- a/arch/v850/kernel/simcons.c +++ b/arch/v850/kernel/simcons.c @@ -77,7 +77,7 @@ int simcons_tty_chars_in_buffer (struct tty_struct *tty) return 0; } -static struct tty_operations ops = { +static const struct tty_operations ops = { .open = simcons_tty_open, .write = simcons_tty_write, .write_room = simcons_tty_write_room, @@ -117,6 +117,7 @@ late_initcall(simcons_tty_init); tty driver. */ void simcons_poll_tty (struct tty_struct *tty) { + char buf[32]; /* Not the nicest way to do it but I need it correct first */ int flip = 0, send_break = 0; struct pollfd pfd; pfd.fd = 0; @@ -124,21 +125,15 @@ void simcons_poll_tty (struct tty_struct *tty) if (V850_SIM_SYSCALL (poll, &pfd, 1, 0) > 0) { if (pfd.revents & POLLIN) { - int left = TTY_FLIPBUF_SIZE - tty->flip.count; - - if (left > 0) { - unsigned char *buf = tty->flip.char_buf_ptr; - int rd = V850_SIM_SYSCALL (read, 0, buf, left); - - if (rd > 0) { - tty->flip.count += rd; - tty->flip.char_buf_ptr += rd; - memset (tty->flip.flag_buf_ptr, 0, rd); - tty->flip.flag_buf_ptr += rd; - flip = 1; - } else - send_break = 1; - } + /* Real block hardware knows the transfer size before + transfer so the new tty buffering doesn't try to handle + this rather weird simulator specific case well */ + int rd = V850_SIM_SYSCALL (read, 0, buf, 32); + if (rd > 0) { + tty_insert_flip_string(tty, buf, rd); + flip = 1; + } else + send_break = 1; } else if (pfd.revents & POLLERR) send_break = 1; }