You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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>
This commit is contained in:
+10
-15
@@ -117,6 +117,7 @@ late_initcall(simcons_tty_init);
|
|||||||
tty driver. */
|
tty driver. */
|
||||||
void simcons_poll_tty (struct tty_struct *tty)
|
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;
|
int flip = 0, send_break = 0;
|
||||||
struct pollfd pfd;
|
struct pollfd pfd;
|
||||||
pfd.fd = 0;
|
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 (V850_SIM_SYSCALL (poll, &pfd, 1, 0) > 0) {
|
||||||
if (pfd.revents & POLLIN) {
|
if (pfd.revents & POLLIN) {
|
||||||
int left = TTY_FLIPBUF_SIZE - tty->flip.count;
|
/* Real block hardware knows the transfer size before
|
||||||
|
transfer so the new tty buffering doesn't try to handle
|
||||||
if (left > 0) {
|
this rather weird simulator specific case well */
|
||||||
unsigned char *buf = tty->flip.char_buf_ptr;
|
int rd = V850_SIM_SYSCALL (read, 0, buf, 32);
|
||||||
int rd = V850_SIM_SYSCALL (read, 0, buf, left);
|
if (rd > 0) {
|
||||||
|
tty_insert_flip_string(tty, buf, rd);
|
||||||
if (rd > 0) {
|
flip = 1;
|
||||||
tty->flip.count += rd;
|
} else
|
||||||
tty->flip.char_buf_ptr += rd;
|
send_break = 1;
|
||||||
memset (tty->flip.flag_buf_ptr, 0, rd);
|
|
||||||
tty->flip.flag_buf_ptr += rd;
|
|
||||||
flip = 1;
|
|
||||||
} else
|
|
||||||
send_break = 1;
|
|
||||||
}
|
|
||||||
} else if (pfd.revents & POLLERR)
|
} else if (pfd.revents & POLLERR)
|
||||||
send_break = 1;
|
send_break = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)){
|
while (__simc(SYS_select_one, 0, XTISS_SELECT_ONE_READ, (int)&tv,0,0)){
|
||||||
__simc (SYS_read, 0, (unsigned long)&c, 1, 0, 0);
|
__simc (SYS_read, 0, (unsigned long)&c, 1, 0, 0);
|
||||||
tty->flip.count++;
|
tty_insert_flip_char(tty, c, TTY_NORMAL);
|
||||||
*tty->flip.char_buf_ptr++ = c;
|
|
||||||
*tty->flip.flag_buf_ptr++ = TTY_NORMAL;
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -350,8 +350,7 @@ static inline void receive_chars(struct mcf_serial *info)
|
|||||||
}
|
}
|
||||||
tty_insert_flip_char(tty, ch, flag);
|
tty_insert_flip_char(tty, ch, flag);
|
||||||
}
|
}
|
||||||
|
tty_flip_buffer_push(tty);
|
||||||
schedule_work(&tty->flip.work);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user