static void serial_update_parameters(SerialState *s)

{

    int speed, parity, data_bits, stop_bits, frame_size;

    QEMUSerialSetParams ssp;



    if (s->divider == 0)

        return;



    /* Start bit. */

    frame_size = 1;

    if (s->lcr & 0x08) {

        /* Parity bit. */

        frame_size++;

        if (s->lcr & 0x10)

            parity = 'E';

        else

            parity = 'O';

    } else {

            parity = 'N';

    }

    if (s->lcr & 0x04)

        stop_bits = 2;

    else

        stop_bits = 1;



    data_bits = (s->lcr & 0x03) + 5;

    frame_size += data_bits + stop_bits;

    speed = s->baudbase / s->divider;

    ssp.speed = speed;

    ssp.parity = parity;

    ssp.data_bits = data_bits;

    ssp.stop_bits = stop_bits;

    s->char_transmit_time =  (NANOSECONDS_PER_SECOND / speed) * frame_size;

    qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);



    DPRINTF("speed=%d parity=%c data=%d stop=%d\n",

           speed, parity, data_bits, stop_bits);

}

static void serial_update_parameters(SerialState *s)

{

    int speed, parity, data_bits, stop_bits, frame_size;

    QEMUSerialSetParams ssp;



    if (s->divider == 0)

        return;



    

    frame_size = 1;

    if (s->lcr & 0x08) {

        

        frame_size++;

        if (s->lcr & 0x10)

            parity = 'E';

        else

            parity = 'O';

    } else {

            parity = 'N';

    }

    if (s->lcr & 0x04)

        stop_bits = 2;

    else

        stop_bits = 1;



    data_bits = (s->lcr & 0x03) + 5;

    frame_size += data_bits + stop_bits;

    speed = s->baudbase / s->divider;

    ssp.speed = speed;

    ssp.parity = parity;

    ssp.data_bits = data_bits;

    ssp.stop_bits = stop_bits;

    s->char_transmit_time =  (NANOSECONDS_PER_SECOND / speed) * frame_size;

    qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);



    DPRINTF("speed=%d parity=%c data=%d stop=%d\n",

           speed, parity, data_bits, stop_bits);

}

    if (s->divider == 0)
static void FUNC_0(SerialState *VAR_0)

{

    int VAR_1, VAR_2, VAR_3, VAR_4, VAR_5;

    QEMUSerialSetParams ssp;



    if (VAR_0->divider == 0)

        return;



    

    VAR_5 = 1;

    if (VAR_0->lcr & 0x08) {

        

        VAR_5++;

        if (VAR_0->lcr & 0x10)

            VAR_2 = 'E';

        else

            VAR_2 = 'O';

    } else {

            VAR_2 = 'N';

    }

    if (VAR_0->lcr & 0x04)

        VAR_4 = 2;

    else

        VAR_4 = 1;



    VAR_3 = (VAR_0->lcr & 0x03) + 5;

    VAR_5 += VAR_3 + VAR_4;

    VAR_1 = VAR_0->baudbase / VAR_0->divider;

    ssp.VAR_1 = VAR_1;

    ssp.VAR_2 = VAR_2;

    ssp.VAR_3 = VAR_3;

    ssp.VAR_4 = VAR_4;

    VAR_0->char_transmit_time =  (NANOSECONDS_PER_SECOND / VAR_1) * VAR_5;

    qemu_chr_fe_ioctl(VAR_0->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);



    DPRINTF("VAR_1=%d VAR_2=%c data=%d stop=%d\n",

           VAR_1, VAR_2, VAR_3, VAR_4);

}

static void FUNC_0(SerialState *VAR_0)
{ int VAR_1, VAR_2, VAR_3, VAR_4, VAR_5; QEMUSerialSetParams ssp; if (VAR_0->divider == 0)
return; VAR_5 = 1; if (VAR_0->lcr & 0x08) { VAR_5++; if (VAR_0->lcr & 0x10)
VAR_2 = 'E'; else
VAR_2 = 'O'; } else { VAR_2 = 'N'; } if (VAR_0->lcr & 0x04)
VAR_4 = 2; else
VAR_4 = 1; VAR_3 = (VAR_0->lcr & 0x03) + 5; VAR_5 += VAR_3 + VAR_4; VAR_1 = VAR_0->baudbase / VAR_0->divider; ssp.VAR_1 = VAR_1; ssp.VAR_2 = VAR_2; ssp.VAR_3 = VAR_3; ssp.VAR_4 = VAR_4; VAR_0->char_transmit_time =  (NANOSECONDS_PER_SECOND / VAR_1) * VAR_5; qemu_chr_fe_ioctl(VAR_0->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp); DPRINTF("VAR_1=%d VAR_2=%c data=%d stop=%d\n",
VAR_1, VAR_2, VAR_3, VAR_4); }