[Rtai] suspend/resume

mantegazza at aero.polimi.it mantegazza at aero.polimi.it
Tue Dec 8 14:56:52 CET 2009


>
>
>
>
>
>
> Well I I believe that nam2num is not intended for kernel mode, is that
> right ? because I don't see it as a parameter for rt_task_init in kernel
> mode.
> I thought it was there because I saw it in other examples, but it was for
> user mode I believe.
>
> Is there a way of doing this all in kernel mode or I should put the
> control programs in user mode and the scheduler and other supervisor
> modules in kernel ?
>
> If so, is it possible with rt_get_adr from kernel get an RT_TASK pointer
> from a task running in user mode ?
>
> Thanks in advance, Robert.
>

If you register you object, or use named creation functions, then it can
be used in kernel mode also. It is not strictly needed in kernel mode
because everything is visible to any other module in kernel space.

> Is there a way of doing this all in kernel mode or I should put the
> control programs in user mode and the scheduler and other supervisor
> modules in kernel ?

I should have answered above, but if you are in kernel space only then the
problem does not existe. For exanple you can prepare a data module only
with your task structure in an array, export it and the use the index in
the task struct array to get what you want. Many othere ways are possible.
If in doubt register and use RTAI support in kernel also.

paolo

>> Date: Mon, 7 Dec 2009 00:01:34 +0100
>> From: e.simetti at gmail.com
>> To: robertperez67 at hotmail.com
>> CC: rtai at rtai.org
>> Subject: Re: [Rtai] suspend/resume
>>
>> You can use:
>>
>> RT_TASK* task = (RT_TASK*) (rt_get_adr(nam2num(taskname)));
>>
>> to get a RT_TASK pointer to the control task, of which you must know the
>> rtai name
>>
>> Ciao
>> Enrico
>>
>> Robert Perez wrote:
>> > Hi Paolo.
>> >
>> > My situation is as follows:
>> >
>> > I could have many control programs running, and each one creates
>> > itself as a rtai task.
>> > But, another rtai task wich is a scheduler, gives permission to run to
>> > each task one by one (you told me in some other mail to use rt_send
>> > and rt_receive, and in some situation suspend/resume).
>> > The problem is that the scheduler task doesn't have the RT_TASK
>> > pointer of the task I want to send/receive or suspend/resume, because
>> > it didn't create the RTAI task of the control program, it was the
>> > control program itself.
>> > So, that is why the scheduler needs a function call or something to
>> > get the RT_TASK pointer of a task perhaps based in the registered name
>> > of the task using the nam2num() function.
>> >
>> > Or perhaps you could have any suggestion to arrange the code
>> > differently or change the arquitecture.
>> >
>> > Thanks in advance and specially for answering so quicly!
>> > BR, Robert.
>> >
>> >
>> >
>> > > Date: Sun, 6 Dec 2009 23:35:40 +0100
>> > > Subject: Re: [Rtai] suspend/resume
>> > > From: mantegazza at aero.polimi.it
>> > > To: robertperez67 at hotmail.com
>> > > CC: rtai at rtai.org
>> > >
>> > > >
>> > > > Hi All.
>> > > >
>> > > > I have been looking on how to do something but I could not realize
>> it.
>> > > > My scenario is one scheduler task and many task running, but, each
>> > task
>> > > > initializes itself and creates the rt_task.
>> > > > The thing is the scheduler has to suspend/resume a task in some
>> > condition,
>> > > > but it doesn't has any rt_task pointer, although it has the names
>> of
>> > > > the task to perhaps use the nam2num function.
>> > > > Is that possible or any of you recommend any other alternative ?
>> > > >
>> > >
>> > > I find it unclear what you want ot do, can you draft a simple
>> example?
>> > >
>> > > paolo
>> > >
>> > > > Thanks in advance, Robert.
>> > > >
>> > > >
>> > > > _________________________________________________________________
>> > > > ¿Quieres aprender inglés mientras estás conectado? Prueba aquí
>> > > >
>> > http://englishtown.latam.msn.com/online/home.aspx?lng=sp&etag=lt_msncanal_______________________________________________
>> > > > Rtai mailing list
>> > > > Rtai at rtai.org
>> > > > https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
>> > > >
>> > >
>> > >
>> >
>> > ------------------------------------------------------------------------
>> > Guarda y comparte fotos, archivos, documentos y más. ¡Con Windows Live
>> > tienes 25 GB gratis! Pruébalo ahora. <http://skydrive.live.com>
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Rtai mailing list
>> > Rtai at rtai.org
>> > https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
>> >
>>
>
> _________________________________________________________________
> Toda la información que te interesa está en MSN Noticias. Clic aquí
> http://noticias.latam.msn.com/_______________________________________________
> Rtai mailing list
> Rtai at rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
>




More information about the Rtai mailing list