ia64/xen-unstable

changeset 1248:dbb603dba154

bitkeeper revision 1.825.3.9 (40648b15Z2oQl7l-e-LvK-_LuJdOVA)

console.c:
Back to ctrl-a for console redirect but pass the sequence up and just count it.
author kaf24@scramble.cl.cam.ac.uk
date Fri Mar 26 19:57:09 2004 +0000 (2004-03-26)
parents 57d3d92c1ccc
children 4ca11b869b2f
files xen/drivers/char/console.c
line diff
     1.1 --- a/xen/drivers/char/console.c	Fri Mar 26 19:31:55 2004 +0000
     1.2 +++ b/xen/drivers/char/console.c	Fri Mar 26 19:57:09 2004 +0000
     1.3 @@ -227,8 +227,8 @@ long read_console_ring(unsigned long str
     1.4  static char serial_rx_ring[SERIAL_RX_SIZE];
     1.5  static unsigned int serial_rx_cons, serial_rx_prod;
     1.6  
     1.7 -/* CTRL-g switches input direction between Xen and DOM0. */
     1.8 -#define CTRL_G 0x07
     1.9 +/* CTRL-a switches input direction between Xen and DOM0. */
    1.10 +#define CTRL_A 0x01
    1.11  static int xen_rx = 1; /* FALSE => serial input passed to domain 0. */
    1.12  
    1.13  static void switch_serial_input(void)
    1.14 @@ -236,7 +236,7 @@ static void switch_serial_input(void)
    1.15      static char *input_str[2] = { "DOM0", "Xen" };
    1.16      xen_rx = !xen_rx;
    1.17      printk("*** Serial input -> %s "
    1.18 -           "(type 'CTRL-g' three times to switch input to %s).\n",
    1.19 +           "(type 'CTRL-a' three times to switch input to %s).\n",
    1.20             input_str[xen_rx], input_str[!xen_rx]);
    1.21  }
    1.22  
    1.23 @@ -264,25 +264,24 @@ static void __serial_rx(unsigned char c,
    1.24  
    1.25  static void serial_rx(unsigned char c, struct pt_regs *regs)
    1.26  {
    1.27 -    static int ctrl_g_count = 0;
    1.28 +    static int ctrl_a_count = 0;
    1.29  
    1.30 -    if ( c == CTRL_G )
    1.31 +    if ( c == CTRL_A )
    1.32      {
    1.33 -        /* We eat CTRL-g in groups of three to switch console input. */
    1.34 -        if ( ++ctrl_g_count == 3 )
    1.35 +        /* We eat CTRL-a in groups of three to switch console input. */
    1.36 +        if ( ++ctrl_a_count == 3 )
    1.37          {
    1.38              switch_serial_input();
    1.39 -            ctrl_g_count = 0;
    1.40 +            ctrl_a_count = 0;
    1.41          }
    1.42      }
    1.43      else
    1.44      {
    1.45 -        /* Flush any pending CTRL-b's. They weren't for us. */
    1.46 -        for ( ; ctrl_g_count != 0; ctrl_g_count-- )
    1.47 -            __serial_rx(CTRL_G, regs);
    1.48 -        /* Finally process the just-received character. */
    1.49 -        __serial_rx(c, regs);
    1.50 +        ctrl_a_count = 0;
    1.51      }
    1.52 +
    1.53 +    /* Finally process the just-received character. */
    1.54 +    __serial_rx(c, regs);
    1.55  }
    1.56  
    1.57  long do_console_io(int cmd, int count, char *buffer)