* [Xenomai] Timer support in user-space
@ 2012-12-12 16:26 dave.joynson
2012-12-12 16:43 ` Philippe Gerum
2012-12-15 12:11 ` Gilles Chanteperdrix
0 siblings, 2 replies; 6+ messages in thread
From: dave.joynson @ 2012-12-12 16:26 UTC (permalink / raw)
To: xenomai
Hi,
I have recently started to use Xenomai on Raspberry Pi. My experience with
Linux Kernel building etc. is zero so I downloaded the pre-built image
from powet.eu. I have successfully created a cross compile environment to
create user-space applications using the Posix skin. While tracking down
some mode changes I came across the limitation of Posix skin Timers in
that the timer expiry creates a signal which causes a mode switch.
I have considered creating an application layer timer module using a pool
of threads that use nanosleep and a callback function on expiry. Careful
management of these threads using a custom timer API could fulfill my
requirements.
While exploring the documentation for alternatives, I noticed that the
RTDM Driver Development API provides access to native timers that would
seem to perform the functionality that I need, On trying to use them in a
user-space application, however, it seems that they may only be used in
kernel-space. This leads me to the following question:
Is the documentation incorrect for rtdm_timer_init() when it says
it may be used in user-space tasks?
Dave Joynson
Alstom Grid | Research & Technology | Senior Research Technologist
Phone: +44 (0)1785 223 251 ext. 6577 | E-mail: dave.joynson@alstom.com
Office address: St Leonard Avenue - Stafford ST17 4LX - England
Site: www.alstom.com
** Please consider the environment before printing this e-mail **
P Before printing, please consider the environment!
ALSTOM Grid UK Limited, Registered in England and Wales No. 4955841.
Registered Office St Leonards Avenue, Stafford, ST17 4LX
:._______________
CONFIDENTIALITY : This e-mail and any attachments are confidential and
may be privileged. If you are not a named recipient, please notify the
sender immediately and do not disclose the contents to another person, use
it for any purpose or store or copy the information in any medium.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xenomai] Timer support in user-space
2012-12-12 16:26 [Xenomai] Timer support in user-space dave.joynson
@ 2012-12-12 16:43 ` Philippe Gerum
2012-12-14 10:33 ` dave.joynson
2012-12-15 12:11 ` Gilles Chanteperdrix
1 sibling, 1 reply; 6+ messages in thread
From: Philippe Gerum @ 2012-12-12 16:43 UTC (permalink / raw)
To: dave.joynson; +Cc: xenomai
On 12/12/2012 05:26 PM, dave.joynson@alstom.com wrote:
> Hi,
> I have recently started to use Xenomai on Raspberry Pi. My experience with
> Linux Kernel building etc. is zero so I downloaded the pre-built image
> from powet.eu. I have successfully created a cross compile environment to
> create user-space applications using the Posix skin. While tracking down
> some mode changes I came across the limitation of Posix skin Timers in
> that the timer expiry creates a signal which causes a mode switch.
> I have considered creating an application layer timer module using a pool
> of threads that use nanosleep and a callback function on expiry. Careful
> management of these threads using a custom timer API could fulfill my
> requirements.
> While exploring the documentation for alternatives, I noticed that the
> RTDM Driver Development API provides access to native timers that would
> seem to perform the functionality that I need, On trying to use them in a
> user-space application, however, it seems that they may only be used in
> kernel-space. This leads me to the following question:
>
> Is the documentation incorrect for rtdm_timer_init() when it says
> it may be used in user-space tasks?
Yes. This is likely a copy&paste leftover.
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] Timer support in user-space
2012-12-12 16:43 ` Philippe Gerum
@ 2012-12-14 10:33 ` dave.joynson
2012-12-14 16:05 ` Philippe Gerum
0 siblings, 1 reply; 6+ messages in thread
From: dave.joynson @ 2012-12-14 10:33 UTC (permalink / raw)
To: Philippe Gerum; +Cc: xenomai
Thanks for your prompt reply Philippe. Do you welcome reports of
innacurate documentation etc. and if so, is there a mechanism, other than
this list, to report them?
I must say that in general, the quality of the documentation is excellent
and allowed me, an experienced software engineer but a Linux novice, to
get up and running relatively quickly.
Thanks for the effort you have put in to this excellent project.
Dave.
Philippe Gerum <rpm@xenomai.org>
12/12/2012 16:45
To
Dave JOYNSON/GBSRD01/Grid/ALSTOM@GA
cc
xenomai@xenomai.org
Subject
Re: [Xenomai] Timer support in user-space
On 12/12/2012 05:26 PM, dave.joynson@alstom.com wrote:
>
> Is the documentation incorrect for rtdm_timer_init() when it
says
> it may be used in user-space tasks?
Yes. This is likely a copy&paste leftover.
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] Timer support in user-space
2012-12-14 10:33 ` dave.joynson
@ 2012-12-14 16:05 ` Philippe Gerum
0 siblings, 0 replies; 6+ messages in thread
From: Philippe Gerum @ 2012-12-14 16:05 UTC (permalink / raw)
To: dave.joynson; +Cc: xenomai
On 12/14/2012 11:33 AM, dave.joynson@alstom.com wrote:
>
> Thanks for your prompt reply Philippe. Do you welcome reports of
> innacurate documentation etc. and if so, is there a mechanism, other
> than this list, to report them?
We can either pull changes from a public git repository you would
maintain, or merge properly formatted commits sent to this list inline.
> I must say that in general, the quality of the documentation is
> excellent and allowed me, an experienced software engineer but a Linux
> novice, to get up and running relatively quickly.
> Thanks for the effort you have put in to this excellent project.
>
You are welcome.
> Dave.
>
>
>
> *Philippe Gerum <rpm@xenomai.org>*
>
> 12/12/2012 16:45
>
>
> To
> Dave JOYNSON/GBSRD01/Grid/ALSTOM@GA
> cc
> xenomai@xenomai.org
> Subject
> Re: [Xenomai] Timer support in user-space
>
>
>
>
>
>
>
>
> On 12/12/2012 05:26 PM, dave.joynson@alstom.com wrote:
> >
> > Is the documentation incorrect for rtdm_timer_init() when it
> says
> > it may be used in user-space tasks?
>
> Yes. This is likely a copy&paste leftover.
>
>
> --
> Philippe.
>
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] Timer support in user-space
2012-12-12 16:26 [Xenomai] Timer support in user-space dave.joynson
2012-12-12 16:43 ` Philippe Gerum
@ 2012-12-15 12:11 ` Gilles Chanteperdrix
2012-12-15 17:21 ` Philippe Gerum
1 sibling, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2012-12-15 12:11 UTC (permalink / raw)
To: dave.joynson; +Cc: xenomai
On 12/12/2012 05:26 PM, dave.joynson@alstom.com wrote:
> Hi,
> I have recently started to use Xenomai on Raspberry Pi. My experience with
> Linux Kernel building etc. is zero so I downloaded the pre-built image
> from powet.eu. I have successfully created a cross compile environment to
> create user-space applications using the Posix skin. While tracking down
> some mode changes I came across the limitation of Posix skin Timers in
> that the timer expiry creates a signal which causes a mode switch.
Yes that is a shame. To finish the posix timers implementation, we need
to implement signals for xenomai tasks. Thanks to the work made on the
watchdog code, we now have everything needed, but implementing signals
is trickier as it seems, in particular because it involves
saving/restoring fpu contexts, and we know by experience that we never
got code touching FPU right the first time.
So, in the mean time, you can use native skin timers.
> I have considered creating an application layer timer module using a pool
> of threads that use nanosleep and a callback function on expiry. Careful
> management of these threads using a custom timer API could fulfill my
> requirements.
> While exploring the documentation for alternatives, I noticed that the
> RTDM Driver Development API provides access to native timers that would
> seem to perform the functionality that I need, On trying to use them in a
> user-space application, however, it seems that they may only be used in
> kernel-space. This leads me to the following question:
>
> Is the documentation incorrect for rtdm_timer_init() when it says
> it may be used in user-space tasks?
>From what I understand, the only RTDM services available to user-space
tasks are the posix open/close/ead/write/ioctl services. So, everything
else happens in kernel-space, and when I read that an RTDM service is
available to user-space tasks, I understand that it is available on the
context of a user-space task running kernel-space code, such as a driver
callback. But I may be wrong, and it may be actually a cut and paste error.
--
Gilles.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xenomai] Timer support in user-space
2012-12-15 12:11 ` Gilles Chanteperdrix
@ 2012-12-15 17:21 ` Philippe Gerum
0 siblings, 0 replies; 6+ messages in thread
From: Philippe Gerum @ 2012-12-15 17:21 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
On 12/15/2012 01:11 PM, Gilles Chanteperdrix wrote:
> On 12/12/2012 05:26 PM, dave.joynson@alstom.com wrote:
>
>> Hi,
>> I have recently started to use Xenomai on Raspberry Pi. My experience with
>> Linux Kernel building etc. is zero so I downloaded the pre-built image
>> from powet.eu. I have successfully created a cross compile environment to
>> create user-space applications using the Posix skin. While tracking down
>> some mode changes I came across the limitation of Posix skin Timers in
>> that the timer expiry creates a signal which causes a mode switch.
>
>
> Yes that is a shame. To finish the posix timers implementation, we need
> to implement signals for xenomai tasks. Thanks to the work made on the
> watchdog code, we now have everything needed, but implementing signals
> is trickier as it seems, in particular because it involves
> saving/restoring fpu contexts, and we know by experience that we never
> got code touching FPU right the first time.
>
> So, in the mean time, you can use native skin timers.
>
>> I have considered creating an application layer timer module using a pool
>> of threads that use nanosleep and a callback function on expiry. Careful
>> management of these threads using a custom timer API could fulfill my
>> requirements.
>> While exploring the documentation for alternatives, I noticed that the
>> RTDM Driver Development API provides access to native timers that would
>> seem to perform the functionality that I need, On trying to use them in a
>> user-space application, however, it seems that they may only be used in
>> kernel-space. This leads me to the following question:
>>
>> Is the documentation incorrect for rtdm_timer_init() when it says
>> it may be used in user-space tasks?
>
>
>>From what I understand, the only RTDM services available to user-space
> tasks are the posix open/close/ead/write/ioctl services. So, everything
> else happens in kernel-space, and when I read that an RTDM service is
> available to user-space tasks, I understand that it is available on the
> context of a user-space task running kernel-space code, such as a driver
> callback. But I may be wrong, and it may be actually a cut and paste error.
>
No, the documentation is really about mentioning directly callable APIs,
otherwise you might also consider all the linux kernel API as being
available to userland by mean of driver handlers, which would be quite
confusing.
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-12-15 17:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 16:26 [Xenomai] Timer support in user-space dave.joynson
2012-12-12 16:43 ` Philippe Gerum
2012-12-14 10:33 ` dave.joynson
2012-12-14 16:05 ` Philippe Gerum
2012-12-15 12:11 ` Gilles Chanteperdrix
2012-12-15 17:21 ` Philippe Gerum
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.