This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add control for netio line flushing


Index: hal/common/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/common/current/ChangeLog,v
retrieving revision 1.79
diff -u -p -5 -r1.79 ChangeLog
--- hal/common/current/ChangeLog	29 Aug 2002 16:15:33 -0000	1.79
+++ hal/common/current/ChangeLog	10 Sep 2002 19:04:14 -0000
@@ -1,5 +1,10 @@
+2002-09-11  Mark Salter  <msalter@redhat.com>
+
+	* include/hal_if.h: Add __COMMCTL_ENABLE_LINE_FLUSH and
+	__COMMCTL_DISABLE_LINE_FLUSH.
+
 2002-08-29  Mark Salter  <msalter@redhat.com>
 
 	* include/generic-stub.h: Add defines for Z packet types.
 	* src/bplist-dynamic.c: Add support for deferred hardware breakpoint
 	and watchpoint insertion/deletion. This gets around gdb problem where
Index: hal/common/current/include/hal_if.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/common/current/include/hal_if.h,v
retrieving revision 1.16
diff -u -p -5 -r1.16 hal_if.h
--- hal/common/current/include/hal_if.h	23 May 2002 23:02:47 -0000	1.16
+++ hal/common/current/include/hal_if.h	10 Sep 2002 19:04:14 -0000
@@ -148,10 +148,19 @@ typedef enum {
      * the driver. This only flushes the driver buffers, not necessarily
      * any hardware FIFO, etc.
      */
     __COMMCTL_FLUSH_OUTPUT,
 
+    /*
+     * Forces driver to enable or disable flushes when a newline is
+     * seen in the output stream. Flushing at line boundaries occurs
+     * in the driver, not necessarily any hardware FIFO, etc. Line
+     * buffering is optional and may only be available in some drivers.
+     */
+    __COMMCTL_ENABLE_LINE_FLUSH,
+    __COMMCTL_DISABLE_LINE_FLUSH,
+
 } __comm_control_cmd_t;
 
 
 #define CYGNUM_COMM_IF_CH_DATA                    0
 #define CYGNUM_COMM_IF_WRITE                      1
Index: redboot/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.77
diff -u -p -5 -r1.77 ChangeLog
--- redboot/current/ChangeLog	3 Sep 2002 12:48:51 -0000	1.77
+++ redboot/current/ChangeLog	10 Sep 2002 19:04:18 -0000
@@ -1,5 +1,10 @@
+2002-09-11  Mark Salter  <msalter@redhat.com>
+
+	* src/main.c (do_go): Turn on line flushes before jumping to function.
+	* src/net/net_io.c (net_io_control): Support flushes at end of lines.
+
 2002-09-03  Yoshinori Sato <qzb04471@nifty.ne.jp>
 2002-09-03  Mark Salter  <msalter@redhat.com>
 
 	* include/fs/disk.h (__SWAB32): Fix incorrect masking.
 	* src/fs/e2fs.c (e2fs_inode_block): Fix endianess of block numbers.
Index: redboot/current/src/main.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v
retrieving revision 1.34
diff -u -p -5 -r1.34 main.c
--- redboot/current/src/main.c	24 Aug 2002 11:34:50 -0000	1.34
+++ redboot/current/src/main.c	10 Sep 2002 19:04:19 -0000
@@ -383,10 +383,11 @@ do_go(int argc, char *argv[])
     code_fun *fun;
     bool wait_time_set;
     int  wait_time, res;
     struct option_info opts[1];
     char line[8];
+    hal_virtual_comm_table_t *__chan = CYGACC_CALL_IF_CONSOLE_PROCS();
 
     entry = entry_address;  // Default from last 'load' operation
     init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, 
               (void **)&wait_time, (bool *)&wait_time_set, "wait timeout");
     if (!scan_opts(argc, argv, 1, opts, 1, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address"))
@@ -410,10 +411,12 @@ do_go(int argc, char *argv[])
                 return;
             }
             script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT;
         }
     }
+    CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_ENABLE_LINE_FLUSH);
+
     fun = (code_fun *)entry;
     HAL_DISABLE_INTERRUPTS(oldints);
     HAL_DCACHE_SYNC();
     HAL_ICACHE_DISABLE();
     HAL_DCACHE_DISABLE();
Index: redboot/current/src/net/net_io.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/net/net_io.c,v
retrieving revision 1.30
diff -u -p -5 -r1.30 net_io.c
--- redboot/current/src/net/net_io.c	29 Aug 2002 19:30:28 -0000	1.30
+++ redboot/current/src/net/net_io.c	10 Sep 2002 19:04:19 -0000
@@ -146,10 +146,11 @@ static int in_buflen = 0;
 static unsigned char in_buf[64];
 static unsigned char *in_bufp;
 static int out_buflen = 0;
 static unsigned char out_buf[1024];
 static unsigned char *out_bufp;
+static bool flush_output_lines = false;
 
 // Functions in this module
 static void net_io_flush(void);
 static void net_io_revert_console(void);
 static void net_io_putc(void*, cyg_uint8);
@@ -301,10 +302,11 @@ net_io_putc(void* __ch_data, cyg_uint8 c
     if (have_dollar && (c == '#')) {
         have_hash = true;
         hash_count = 0;
     }
     if ((++out_buflen == sizeof(out_buf)) ||
+        (flush_output_lines && c == '\n') ||
         (have_hash && (++hash_count == 3))) {
         net_io_flush();
         have_dollar = false;
     }
     CYGARC_HAL_RESTORE_GP();
@@ -408,10 +410,16 @@ net_io_control(void *__ch_data, __comm_c
         break;
     }
     case __COMMCTL_FLUSH_OUTPUT:
         net_io_flush();
         break;
+    case __COMMCTL_ENABLE_LINE_FLUSH:
+	flush_output_lines = true;
+	break;
+    case __COMMCTL_DISABLE_LINE_FLUSH:
+	flush_output_lines = false;
+	break;
     default:
         break;
     }
     CYGARC_HAL_RESTORE_GP();
     return ret;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]