This is the mail archive of the ecos-patches@sourceware.org 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]

USB locking


As per
http://ecos.sourceware.org/ml/ecos-discuss/2006-03/msg00017.html,
pending possible changes to the driver API.

Bart

Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/usb/slave/current/ChangeLog,v
retrieving revision 1.13
diff -u -r1.13 ChangeLog
--- ChangeLog	26 Jun 2005 21:21:37 -0000	1.13
+++ ChangeLog	10 Mar 2006 20:46:47 -0000
@@ -1,3 +1,8 @@
+2006-03-10  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/usbs.c (usbs_devtab_cwrite, usbs_devtab_cwrite): add
+	DSR locking
+
 2005-06-26  Bart Veer  <bartv@ecoscentric.com>
 
 	* host/usbhost.c, host/configure.in: cope with incompatible
Index: src/usbs.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/usb/slave/current/src/usbs.c,v
retrieving revision 1.5
diff -u -r1.5 usbs.c
--- src/usbs.c	23 May 2002 23:06:36 -0000	1.5
+++ src/usbs.c	10 Mar 2006 20:48:28 -0000
@@ -111,9 +111,11 @@
     (*endpoint->start_tx_fn)(endpoint);
     
     cyg_drv_mutex_lock(&wait.lock);
+    cyg_drv_dsr_lock();
     while (!wait.completed) {
         cyg_drv_cond_wait(&wait.signal);
     }
+    cyg_drv_dsr_unlock();
     cyg_drv_mutex_unlock(&wait.lock);
     if (wait.result < 0) {
         result = wait.result;
@@ -155,9 +157,11 @@
     endpoint->complete_data     = (void*) &wait;
     (*endpoint->start_rx_fn)(endpoint);
     cyg_drv_mutex_lock(&wait.lock);
+    cyg_drv_dsr_lock();
     while (!wait.completed) {
         cyg_drv_cond_wait(&wait.signal);
     }
+    cyg_drv_dsr_unlock();
     cyg_drv_mutex_unlock(&wait.lock);
     if (wait.result < 0) {
         result = wait.result;


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