[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [PATCH] mini-os: Remove \r\n conversion when writing to PV serial port



This change removes \n to \r\n conversion when writing to a PV serial
port so that binary protocols carried over the port are not corrupted.

The change enables new use-cases for example connectivity from the Windows
Kernel Debugger to a guest via it's IOEMU stubdom.

Signed-off-by: Simon Waterman <watermansrdev@xxxxxxxxx>
---
 console/console.c | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/console/console.c b/console/console.c
index 5538bd4..de94ad6 100644
--- a/console/console.c
+++ b/console/console.c
@@ -82,10 +82,6 @@ void xencons_tx(void)
 
 void console_print(struct consfront_dev *dev, char *data, int length)
 {
-    char *curr_char, saved_char;
-    char copied_str[length+1];
-    char *copied_ptr;
-    int part_len;
     int (*ring_send_fn)(struct consfront_dev *dev, const char *data, unsigned 
length);
 
     if(!console_initialised)
@@ -93,30 +89,7 @@ void console_print(struct consfront_dev *dev, char *data, 
int length)
     else
         ring_send_fn = xencons_ring_send;
 
-    copied_ptr = copied_str;
-    memcpy(copied_ptr, data, length);
-    for(curr_char = copied_ptr; curr_char < copied_ptr+length-1; curr_char++)
-    {
-        if(*curr_char == '\n')
-        {
-            *curr_char = '\r';
-            saved_char = *(curr_char+1);
-            *(curr_char+1) = '\n';
-            part_len = curr_char - copied_ptr + 2;
-            ring_send_fn(dev, copied_ptr, part_len);
-            *(curr_char+1) = saved_char;
-            copied_ptr = curr_char+1;
-            length -= part_len - 1;
-        }
-    }
-
-    if (copied_ptr[length-1] == '\n') {
-        copied_ptr[length-1] = '\r';
-        copied_ptr[length] = '\n';
-        length++;
-    }
-    
-    ring_send_fn(dev, copied_ptr, length);
+    ring_send_fn(dev, data, length);
 }
 
 void print(int direct, const char *fmt, va_list args)
-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.