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]

IO/SERIAL: Some small tweaks


Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/serial/current/ChangeLog,v
retrieving revision 1.52
diff -u -5 -r1.52 ChangeLog
--- ChangeLog	21 May 2003 16:31:22 -0000	1.52
+++ ChangeLog	14 Jun 2003 18:09:10 -0000
@@ -1,5 +1,17 @@
+2003-06-09  Nick Garnett  <nickg@balti.calivar.com>
+
+	* src/common/serial.c: Changed all calls to cyg_drv_cond_signal()
+	to cyg_drv_cond_broadcast(). Removed comment asking whether this
+	matters: it does.
+
+	* include/serialio.h: Added includes of pkgconf files so that the
+	ifdefs in this file work properly.
+	
+	* include/serial.h: Added include of devtab.h to fix compile
+	error.
+
 2003-05-21  Gary Thomas  <gary@mlbassoc.com> 	
 
 	* src/common/serial.c (serial_get_config): Restart receiver 
 	after input queue flush if it had been throttled.  Inspired
 	by David Marqvar <DAM@tt.dk>
Index: include/serial.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/serial/current/include/serial.h,v
retrieving revision 1.11
diff -u -5 -r1.11 serial.h
--- include/serial.h	23 May 2002 23:06:25 -0000	1.11
+++ include/serial.h	14 Jun 2003 18:09:11 -0000
@@ -58,10 +58,11 @@
 #include <pkgconf/io_serial.h>
 
 #include <cyg/infra/cyg_type.h>
 #include <cyg/io/io.h>
 #include <cyg/io/serialio.h>
+#include <cyg/io/devtab.h>
 #include <cyg/hal/drv_api.h>
 
 #ifdef CYGPKG_IO_SERIAL_SELECT_SUPPORT
 #include <cyg/fileio/fileio.h>
 #endif
Index: include/serialio.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/serial/current/include/serialio.h,v
retrieving revision 1.9
diff -u -5 -r1.9 serialio.h
--- include/serialio.h	23 May 2002 23:06:25 -0000	1.9
+++ include/serialio.h	14 Jun 2003 18:09:11 -0000
@@ -52,10 +52,12 @@
 //
 // ====================================================================
 
 // This file contains the user-level visible I/O interfaces
 
+#include <pkgconf/system.h>
+#include <pkgconf/io_serial.h>
 #include <pkgconf/hal.h>
 #include <cyg/infra/cyg_type.h>
 #include <cyg/io/config_keys.h>
 
 #ifdef __cplusplus
Index: src/common/serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/serial/current/src/common/serial.c,v
retrieving revision 1.21
diff -u -5 -r1.21 serial.c
--- src/common/serial.c	21 May 2003 16:31:22 -0000	1.21
+++ src/common/serial.c	14 Jun 2003 18:09:13 -0000
@@ -290,12 +290,10 @@
 #endif // CYGDBG_USE_ASSERTS
     chan->init = true;
 }
 
 // ---------------------------------------------------------------------------
-// FIXME:@@@ Throughout this file there are uses of cyg_drv_cond_signal and
-// cyg_drv_cond_broadcast. Does it matter which? -Jifl
 
 static Cyg_ErrNo 
 serial_write(cyg_io_handle_t handle, const void *_buf, cyg_uint32 *len)
 {
     cyg_devtab_entry_t *t = (cyg_devtab_entry_t *)handle;
@@ -611,11 +609,11 @@
         if (in_cbuf->len == 0) break;  // Nothing to do if not buffered
         cyg_drv_mutex_lock(&in_cbuf->lock);  // Stop any further input processing
         cyg_drv_dsr_lock();
         if (in_cbuf->waiting) {
             in_cbuf->abort = true;
-            cyg_drv_cond_signal(&in_cbuf->wait);
+            cyg_drv_cond_broadcast(&in_cbuf->wait);
             in_cbuf->waiting = false;
         }
         in_cbuf->get = in_cbuf->put = in_cbuf->nb = 0;  // Flush buffered input
 
         // Pass to the hardware driver in case it wants to flush FIFOs etc.
@@ -635,15 +633,15 @@
     case CYG_IO_GET_CONFIG_SERIAL_ABORT:
         // Abort any outstanding I/O, including blocked reads
         // Caution - assumed to be called from 'timeout' (i.e. DSR) code
         if (in_cbuf->len != 0) {
             in_cbuf->abort = true;
-            cyg_drv_cond_signal(&in_cbuf->wait);
+            cyg_drv_cond_broadcast(&in_cbuf->wait);
         }
         if (out_cbuf->len != 0) {
             out_cbuf->abort = true;
-            cyg_drv_cond_signal(&out_cbuf->wait);
+            cyg_drv_cond_broadcast(&out_cbuf->wait);
         }
         break;
 
     case CYG_IO_GET_CONFIG_SERIAL_OUTPUT_FLUSH:
 // Throw away any pending output
@@ -658,11 +656,11 @@
         (funs->set_config)(chan,
                            CYG_IO_SET_CONFIG_SERIAL_OUTPUT_FLUSH,
                            NULL, NULL);
         if (out_cbuf->waiting) {
             out_cbuf->abort = true;
-            cyg_drv_cond_signal(&out_cbuf->wait);
+            cyg_drv_cond_broadcast(&out_cbuf->wait);
             out_cbuf->waiting = false;
         }
         cyg_drv_dsr_unlock();
         cyg_drv_mutex_unlock(&out_cbuf->lock);
         break;
@@ -886,11 +884,11 @@
     // must signal waiters, and wake up selecters for the case when
     // this was the last char to be sent and they hadn't been signalled
     // before (e.g. because of flow control)
     if (cbuf->waiting) {
         cbuf->waiting = false;
-        cyg_drv_cond_signal(&cbuf->wait);
+        cyg_drv_cond_broadcast(&cbuf->wait);
     }
 #ifdef CYGPKG_IO_SERIAL_SELECT_SUPPORT
     cyg_selwakeup( &cbuf->selinfo );
 #endif                    
 }
@@ -960,11 +958,11 @@
             _stime = (int)cyg_current_time();
             diag_printf("Signal reader - time: %x.%x\n", _stime, _time);
             enable_diag_uart = _enable;
 #endif // CYGDBG_DIAG_BUF
         cbuf->waiting = false;
-        cyg_drv_cond_signal(&cbuf->wait);
+        cyg_drv_cond_broadcast(&cbuf->wait);
     }
 }
 
 //----------------------------------------------------------------------------
 // Flow control indication callback
@@ -1074,11 +1072,11 @@
     CYG_ASSERT(cbuf->put < cbuf->len, "Invalid put ptr");
     CYG_ASSERT(cbuf->get < cbuf->len, "Invalid get ptr");
 
     if (cbuf->waiting) {
         cbuf->waiting = false;
-        cyg_drv_cond_signal(&cbuf->wait);
+        cyg_drv_cond_broadcast(&cbuf->wait);
     }
 #ifdef CYGPKG_IO_SERIAL_FLOW_CONTROL
     // If we've hit the high water mark, tell the other side to stop
     if ( cbuf->nb >= cbuf->high_water ) {
         throttle_rx( chan, false );


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


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