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] Drop characters if an asynchronous serial

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Drop characters if an asynchronous serial tx buffer fills up.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Apr 2008 06:20:13 -0700
Delivery-date: Wed, 23 Apr 2008 06:21:29 -0700
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.fraser@xxxxxxxxxx>
# Date 1208956655 -3600
# Node ID 64c0014ae75787eddb7da44c9cbbbed53e85385f
# Parent  a7ddd6bcd564965af54a9df236d89503a76923e1
Drop characters if an asynchronous serial tx buffer fills up.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/drivers/char/serial.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff -r a7ddd6bcd564 -r 64c0014ae757 xen/drivers/char/serial.c
--- a/xen/drivers/char/serial.c Wed Apr 23 14:06:51 2008 +0100
+++ b/xen/drivers/char/serial.c Wed Apr 23 14:17:35 2008 +0100
@@ -15,6 +15,9 @@
 #include <xen/mm.h>
 #include <xen/serial.h>
 
+/* Never drop characters, even if the async transmit buffer fills. */
+/* #define SERIAL_NEVER_DROP_CHARS 1 */
+
 unsigned int serial_txbufsz = 16384;
 static void __init parse_serial_tx_buffer(const char *s)
 {
@@ -91,22 +94,24 @@ void serial_tx_interrupt(struct serial_p
 
 static void __serial_putc(struct serial_port *port, char c)
 {
-    int i;
-
     if ( (port->txbuf != NULL) && !port->sync )
     {
         /* Interrupt-driven (asynchronous) transmitter. */
+#ifdef SERIAL_NEVER_DROP_CHARS
         if ( (port->txbufp - port->txbufc) == serial_txbufsz )
         {
-            /* Buffer is full: we spin, but could alternatively drop chars. */
+            /* Buffer is full: we spin waiting for space to appear. */
+            int i;
             while ( !port->driver->tx_empty(port) )
                 cpu_relax();
             for ( i = 0; i < port->tx_fifo_size; i++ )
                 port->driver->putc(
                     port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]);
             port->txbuf[mask_serial_txbuf_idx(port->txbufp++)] = c;
-        }
-        else if ( ((port->txbufp - port->txbufc) == 0) &&
+            return;
+        }
+#endif
+        if ( ((port->txbufp - port->txbufc) == 0) &&
                   port->driver->tx_empty(port) )
         {
             /* Buffer and UART FIFO are both empty. */

_______________________________________________
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] Drop characters if an asynchronous serial tx buffer fills up., Xen patchbot-unstable <=