예제 #1
0
static void
receive_chars(struct async_struct *info, int *status, struct pt_regs *regs)
{
    struct tty_struct *tty = info->tty;
    unsigned char ch;
    int __ch;

    while (1) {
        __ch = pdc_console_poll_key(NULL);

        if (__ch == -1)	/* no character available */
            break;

        ch = (unsigned char) ((unsigned) __ch & 0x000000ffu);

        if (tty->flip.count >= TTY_FLIPBUF_SIZE)
            continue;

        *tty->flip.char_buf_ptr = ch;
        *tty->flip.flag_buf_ptr = 0;

        tty->flip.flag_buf_ptr++;
        tty->flip.char_buf_ptr++;
        tty->flip.count++;
    }

    tty_flip_buffer_push(tty);
}
예제 #2
0
파일: pdc_cons.c 프로젝트: AllenDou/linux
static void pdc_console_poll(unsigned long unused)
{
	int data, count = 0;
	struct tty_struct *tty = tty_port_tty_get(&tty_port);

	if (!tty)
		return;

	while (1) {
		data = pdc_console_poll_key(NULL);
		if (data == -1)
			break;
		tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL);
		count ++;
	}

	if (count)
		tty_flip_buffer_push(tty);

	tty_kref_put(tty);

	if (pdc_cons.flags & CON_ENABLED)
		mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY);
}