diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-02-03 03:04:08 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-03 08:32:04 -0800 |
commit | 8145916996b91d42b8bb4b0fcd508af295222c7c (patch) | |
tree | 298ec43ab4e40888d142ffd5e84be67c80e07c9f /arch | |
parent | 84542838a3829f34630c589c1eb570656c455a1c (diff) | |
download | op-kernel-dev-8145916996b91d42b8bb4b0fcd508af295222c7c.zip op-kernel-dev-8145916996b91d42b8bb4b0fcd508af295222c7c.tar.gz |
[PATCH] Fix some ucLinux breakage from the tty updates
Breakage reported by Adrian Bunk
Untested (no hardware)
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/v850/kernel/simcons.c | 25 | ||||
-rw-r--r-- | arch/xtensa/platform-iss/console.c | 4 |
2 files changed, 11 insertions, 18 deletions
diff --git a/arch/v850/kernel/simcons.c b/arch/v850/kernel/simcons.c index 7f0efaa..3975aa0 100644 --- a/arch/v850/kernel/simcons.c +++ b/arch/v850/kernel/simcons.c @@ -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; } diff --git a/arch/xtensa/platform-iss/console.c b/arch/xtensa/platform-iss/console.c index 4fbddf9..94fdfe4 100644 --- a/arch/xtensa/platform-iss/console.c +++ b/arch/xtensa/platform-iss/console.c @@ -128,9 +128,7 @@ static void rs_poll(unsigned long priv) while (__simc(SYS_select_one, 0, XTISS_SELECT_ONE_READ, (int)&tv,0,0)){ __simc (SYS_read, 0, (unsigned long)&c, 1, 0, 0); - tty->flip.count++; - *tty->flip.char_buf_ptr++ = c; - *tty->flip.flag_buf_ptr++ = TTY_NORMAL; + tty_insert_flip_char(tty, c, TTY_NORMAL); i++; } |