static void kbd_send_chars(void *opaque)

{

    TextConsole *s = opaque;

    int len;

    uint8_t buf[16];



    len = qemu_chr_can_read(s->chr);

    if (len > s->out_fifo.count)

        len = s->out_fifo.count;

    if (len > 0) {

        if (len > sizeof(buf))

            len = sizeof(buf);

        qemu_fifo_read(&s->out_fifo, buf, len);

        qemu_chr_read(s->chr, buf, len);

    }

    /* characters are pending: we send them a bit later (XXX:

       horrible, should change char device API) */

    if (s->out_fifo.count > 0) {

        qemu_mod_timer(s->kbd_timer, qemu_get_clock(rt_clock) + 1);

    }

}

static void kbd_send_chars(void *opaque)

{

    TextConsole *s = opaque;

    int len;

    uint8_t buf[16];



    len = qemu_chr_can_read(s->chr);

    if (len > s->out_fifo.count)

        len = s->out_fifo.count;

    if (len > 0) {

        if (len > sizeof(buf))

            len = sizeof(buf);

        qemu_fifo_read(&s->out_fifo, buf, len);

        qemu_chr_read(s->chr, buf, len);

    }

    



    if (s->out_fifo.count > 0) {

        qemu_mod_timer(s->kbd_timer, qemu_get_clock(rt_clock) + 1);

    }

}

static void FUNC_0(void *VAR_0)

{

    TextConsole *s = VAR_0;

    int VAR_1;

    uint8_t buf[16];



    VAR_1 = qemu_chr_can_read(s->chr);

    if (VAR_1 > s->out_fifo.count)

        VAR_1 = s->out_fifo.count;

    if (VAR_1 > 0) {

        if (VAR_1 > sizeof(buf))

            VAR_1 = sizeof(buf);

        qemu_fifo_read(&s->out_fifo, buf, VAR_1);

        qemu_chr_read(s->chr, buf, VAR_1);

    }

    



    if (s->out_fifo.count > 0) {

        qemu_mod_timer(s->kbd_timer, qemu_get_clock(rt_clock) + 1);

    }

}

static void FUNC_0(void *VAR_0)
{ TextConsole *s = VAR_0; int VAR_1; uint8_t buf[16]; VAR_1 = qemu_chr_can_read(s->chr); if (VAR_1 > s->out_fifo.count)
VAR_1 = s->out_fifo.count; if (VAR_1 > 0) { if (VAR_1 > sizeof(buf))
VAR_1 = sizeof(buf); qemu_fifo_read(&s->out_fifo, buf, VAR_1); qemu_chr_read(s->chr, buf, VAR_1); } if (s->out_fifo.count > 0) { qemu_mod_timer(s->kbd_timer, qemu_get_clock(rt_clock) + 1); } }