WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Small cleanups to console-input-redirect

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Small cleanups to console-input-redirect code in Xen.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Nov 2007 04:20:44 -0800
Delivery-date: Fri, 09 Nov 2007 04:24:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1194280668 0
# Node ID d945240821e7e8f0a047468fa814f86470f1a884
# Parent  dfe9c0c10a2cf0405236bdfd475d7c8939b692c4
Small cleanups to console-input-redirect code in Xen.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/drivers/char/console.c |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff -r dfe9c0c10a2c -r d945240821e7 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Mon Nov 05 13:23:55 2007 +0000
+++ b/xen/drivers/char/console.c        Mon Nov 05 16:37:48 2007 +0000
@@ -43,7 +43,7 @@ string_param("console", opt_console);
 /* Char 1: CTRL+<char1> is used to switch console input between Xen and DOM0 */
 /* Char 2: If this character is 'x', then do not auto-switch to DOM0 when it */
 /*         boots. Any other value, or omitting the char, enables auto-switch */
-static unsigned char opt_conswitch[5] = "a";
+static unsigned char opt_conswitch[3] = "a";
 string_param("conswitch", opt_conswitch);
 
 /* sync_console: force synchronous console output (useful for debugging). */
@@ -267,19 +267,18 @@ static void sercon_puts(const char *s)
 }
 
 /* CTRL-<switch_char> switches input direction between Xen and DOM0. */
-#define SWITCH_CODE (opt_conswitch[0]-'a'+1)
+#define switch_code (opt_conswitch[0]-'a'+1)
 static int xen_rx = 1; /* FALSE => serial input passed to domain 0. */
 
 static void switch_serial_input(void)
 {
     static char *input_str[2] = { "DOM0", "Xen" };
     xen_rx = !xen_rx;
-    if ( (SWITCH_CODE != 0) && (dom0 != NULL) )
-    {
-        printk("*** Serial input -> %s "
-               "(type 'CTRL-%c' three times to switch input to %s).\n",
-               input_str[xen_rx], opt_conswitch[0], input_str[!xen_rx]);
-    }
+    printk("*** Serial input -> %s", input_str[xen_rx]);
+    if ( switch_code )
+        printk(" (type 'CTRL-%c' three times to switch input to %s)",
+               opt_conswitch[0], input_str[!xen_rx]);
+    printk("\n");
 }
 
 static void __serial_rx(char c, struct cpu_user_regs *regs)
@@ -298,20 +297,19 @@ static void serial_rx(char c, struct cpu
 {
     static int switch_code_count = 0;
 
-    if ( (SWITCH_CODE != 0) && (c == SWITCH_CODE) )
+    if ( switch_code && (c == switch_code) )
     {
         /* We eat CTRL-<switch_char> in groups of 3 to switch console input. */
         if ( ++switch_code_count == 3 )
         {
             switch_serial_input();
             switch_code_count = 0;
-            return;
-        }
-    }
-    else
-    {
-        switch_code_count = 0;
-    }
+        }
+        return;
+    }
+
+    for ( ; switch_code_count != 0; switch_code_count-- )
+        __serial_rx(switch_code, regs);
 
     /* Finally process the just-received character. */
     __serial_rx(c, regs);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Small cleanups to console-input-redirect code in Xen., Xen patchbot-unstable <=