aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-02-03 06:04:08 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 11:32:04 -0500
commit8145916996b91d42b8bb4b0fcd508af295222c7c (patch)
tree298ec43ab4e40888d142ffd5e84be67c80e07c9f
parent84542838a3829f34630c589c1eb570656c455a1c (diff)
[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>
-rw-r--r--arch/v850/kernel/simcons.c25
-rw-r--r--arch/xtensa/platform-iss/console.c4
-rw-r--r--drivers/serial/mcfserial.c3
3 files changed, 12 insertions, 20 deletions
diff --git a/arch/v850/kernel/simcons.c b/arch/v850/kernel/simcons.c
index 7f0efaa025c9..3975aa02cef8 100644
--- a/arch/v850/kernel/simcons.c
+++ b/arch/v850/kernel/simcons.c
@@ -117,6 +117,7 @@ late_initcall(simcons_tty_init);
117 tty driver. */ 117 tty driver. */
118void simcons_poll_tty (struct tty_struct *tty) 118void simcons_poll_tty (struct tty_struct *tty)
119{ 119{
120 char buf[32]; /* Not the nicest way to do it but I need it correct first */
120 int flip = 0, send_break = 0; 121 int flip = 0, send_break = 0;
121 struct pollfd pfd; 122 struct pollfd pfd;
122 pfd.fd = 0; 123 pfd.fd = 0;
@@ -124,21 +125,15 @@ void simcons_poll_tty (struct tty_struct *tty)
124 125
125 if (V850_SIM_SYSCALL (poll, &pfd, 1, 0) > 0) { 126 if (V850_SIM_SYSCALL (poll, &pfd, 1, 0) > 0) {
126 if (pfd.revents & POLLIN) { 127 if (pfd.revents & POLLIN) {
127 int left = TTY_FLIPBUF_SIZE - tty->flip.count; 128 /* Real block hardware knows the transfer size before
128 129 transfer so the new tty buffering doesn't try to handle
129 if (left > 0) { 130 this rather weird simulator specific case well */
130 unsigned char *buf = tty->flip.char_buf_ptr; 131 int rd = V850_SIM_SYSCALL (read, 0, buf, 32);
131 int rd = V850_SIM_SYSCALL (read, 0, buf, left); 132 if (rd > 0) {
132 133 tty_insert_flip_string(tty, buf, rd);
133 if (rd > 0) { 134 flip = 1;
134 tty->flip.count += rd; 135 } else
135 tty->flip.char_buf_ptr += rd; 136 send_break = 1;
136 memset (tty->flip.flag_buf_ptr, 0, rd);
137 tty->flip.flag_buf_ptr += rd;
138 flip = 1;
139 } else
140 send_break = 1;
141 }
142 } else if (pfd.revents & POLLERR) 137 } else if (pfd.revents & POLLERR)
143 send_break = 1; 138 send_break = 1;
144 } 139 }
diff --git a/arch/xtensa/platform-iss/console.c b/arch/xtensa/platform-iss/console.c
index 4fbddf92a921..94fdfe474ac1 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)
128 128
129 while (__simc(SYS_select_one, 0, XTISS_SELECT_ONE_READ, (int)&tv,0,0)){ 129 while (__simc(SYS_select_one, 0, XTISS_SELECT_ONE_READ, (int)&tv,0,0)){
130 __simc (SYS_read, 0, (unsigned long)&c, 1, 0, 0); 130 __simc (SYS_read, 0, (unsigned long)&c, 1, 0, 0);
131 tty->flip.count++; 131 tty_insert_flip_char(tty, c, TTY_NORMAL);
132 *tty->flip.char_buf_ptr++ = c;
133 *tty->flip.flag_buf_ptr++ = TTY_NORMAL;
134 i++; 132 i++;
135 } 133 }
136 134
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index d957a3a9edf1..0ef648fa4b2d 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -350,8 +350,7 @@ static inline void receive_chars(struct mcf_serial *info)
350 } 350 }
351 tty_insert_flip_char(tty, ch, flag); 351 tty_insert_flip_char(tty, ch, flag);
352 } 352 }
353 353 tty_flip_buffer_push(tty);
354 schedule_work(&tty->flip.work);
355 return; 354 return;
356} 355}
357 356