ia64/xen-unstable

changeset 4988:aa22e2575a10

bitkeeper revision 1.1159.258.137 (428b746dvt7HoFn2rjyGGO-i1yesPg)

Ensure that domain0 console receiver does not get stuck if serial
input is received early during boot. Fixes bugzilla bug #41.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 18 16:59:25 2005 +0000 (2005-05-18)
parents c390ce4856bf
children bdc5114b6f20 65f0179fc567
files xen/drivers/char/console.c
line diff
     1.1 --- a/xen/drivers/char/console.c	Wed May 18 07:56:56 2005 +0000
     1.2 +++ b/xen/drivers/char/console.c	Wed May 18 16:59:25 2005 +0000
     1.3 @@ -260,15 +260,13 @@ static void switch_serial_input(void)
     1.4  static void __serial_rx(unsigned char c, struct xen_regs *regs)
     1.5  {
     1.6      if ( xen_rx )
     1.7 -    {
     1.8 -        handle_keypress(c, regs);
     1.9 -    }
    1.10 -    else if ( (serial_rx_prod-serial_rx_cons) != SERIAL_RX_SIZE )
    1.11 -    {
    1.12 -        serial_rx_ring[SERIAL_RX_MASK(serial_rx_prod)] = c;
    1.13 -        if ( serial_rx_prod++ == serial_rx_cons )
    1.14 -            send_guest_virq(dom0, VIRQ_CONSOLE);
    1.15 -    }
    1.16 +        return handle_keypress(c, regs);
    1.17 +
    1.18 +    /* Deliver input to guest buffer, unless it is already full. */
    1.19 +    if ( (serial_rx_prod-serial_rx_cons) != SERIAL_RX_SIZE )
    1.20 +        serial_rx_ring[SERIAL_RX_MASK(serial_rx_prod++)] = c;
    1.21 +    /* Always notify the guest: prevents receive path from getting stuck. */
    1.22 +    send_guest_virq(dom0, VIRQ_CONSOLE);
    1.23  }
    1.24  
    1.25  static void serial_rx(unsigned char c, struct xen_regs *regs)