This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: How to debug synchronisation in the usbs.c in a new usb-driver for the ARM at91sam7s...
- From: <oli at snr dot ch>
- To: <derek dot bouius at sympatico dot ca>
- Cc: <bartv at ecoscentric dot com>, "Andrew Lunn" <andrew at lunn dot ch>, "oliver munz @ s p e a g" <munz at speag dot ch>, <ecos-discuss at sourceware dot org>
- Date: Thu, 2 Mar 2006 13:56:22 +0100
- Subject: [ECOS] RE: How to debug synchronisation in the usbs.c in a new usb-driver for the ARM at91sam7s...
I tested the following Patch from Bart Veer and it works. Please update the
CVS...
Index: 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
--- usbs.c 23 May 2002 23:06:36 -0000 1.5
+++ usbs.c 20 Feb 2006 13:37:06 -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;
Oliver
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss