Sebastian Kuzminsky wrote:
> I could add a "threadsafe" flag to the board driver struct, which gets 
> set by the board driver if the board I/O hardware is thread safe (PCI), 
> and cleared if it's not (EPP).  The high-level hostmot2 driver would 
> examine this and only export the "full" read()/write() functions if the 
> board driver is not thread safe.  If the board driver *is* thread safe, 
> the hostmot2 driver would in addition export gpio_read()/gpio_write().

If RTAI supported mutexes and thread-blocking, then fast gpio access 
could be easily done even on the EPP boards.  Instead of low-level 
drivers exporting a "threadsafe" flag, the high-level hostmot2 driver 
would create a mutex for each board, to make sure at most one RTAI 
thread was executing in the low-level driver's read()/write() code at a 
time.  If another thread wanted to access the board, it would try to 
lock the mutex and block until the first user was done.

It looks like rtai has semaphores but doesnt support blocking in the 
kernel (no run queues).  Maybe something like spinlocks could be built 
around the non-blocking semaphore calls.

Any comments on this?  Anyone know RTAI?


-- 
Sebastian Kuzminsky
You think you can defeat me with your rebellious beard?
<http://www.youtube.com/watch?v=k_QAPjtO2cA>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to