From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gary Thomas To: Phung Te Ha Cc: ecos-discuss@sources.redhat.com Subject: RE: [ECOS] serial.c, dsr_lock for read or write Date: Wed, 23 May 2001 06:11:00 -0000 Message-id: References: <20010522221129.89737.qmail@web12104.mail.yahoo.com> X-SW-Source: 2001-05/msg00387.html On 22-May-2001 Phung Te Ha wrote: > Hi everyone, > > I'm using eCos on a custom board. The CPU is an ARM7. > I use serial.c to buffer my USB device driver and > realize that there's a call to > cyg_drv_dsr_lock()/unlock() around the serial_read() > and serial_write core. This blocks the other DSRs if I > have a blocking read waiting for data for instance. > > Am I seeing it right? It seems too strong for me > blocking all the DSRs, and possibly quite long time > this way. DSRs are only locked out while shared data structures are being examined. Once it is determined that the driver needs to wait for data to move (in or out), the lock will be dropped. Note: this mechanism really only works for interrupt-driven devices.