Classic.

On Mon, Nov 9, 2009 at 3:22 PM, Remco den Breeje <re...@vioco.nl> wrote:
> On Mon, Nov 9, 2009 at 2:06 PM, Jan Kiszka <jan.kis...@siemens.com> wrote:
>> The design. :)
>
> I totally agree :) However, I'm using generated (user-space) code that
> I want to modify as little as possible. So with a simple ioctl-call I
> want to be able to switch between software (pthread) and hardware
> triggering (rtdm-driver).
>
>> The proper design is to use a rtdm semaphore or event *inside* the
>> kernel and let the application block on it when it calls a related IOCTL
>> or other device function that shall synchronize on that condition.
>>
>> Don't share resources like this between kernel and user space. It's
>> unclean, specifically as you once may want to access driver managed data
>> along the sleeping/waking as well.
>>
>> Jan
>
> The sem_open documentation states  "a connection between the semaphore
> named name and the calling context (kernel-space as a whole, or
> user-space process)". I interpreted this as exactly what I want - a
> synchronization between user- and kernel-space. Please correct me if
> I'm wrong.
>
>>
>> --
>> Siemens AG, Corporate Technology, CT SE 2
>> Corporate Competence Center Embedded Linux
>>
>
> Attached you find an example.
> You can run it by executing: `make && sudo insmod ./km.ko && sudo ./um
> ; sudo rmmod km`
>
> My syslog-output is: "Error opening clock semaphore (2)"
>
> Thanks,
>
> Remco den Breeje
>

Attachment: sem-sharing.tar.gz
Description: GNU Zip compressed data

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to