* [Xenomai-help] shadow task and rt_task_self()
@ 2009-01-23 19:04 Steven Seeger
2009-01-23 19:24 ` Gilles Chanteperdrix
0 siblings, 1 reply; 7+ messages in thread
From: Steven Seeger @ 2009-01-23 19:04 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 185 bytes --]
Using the latest xenomai we seem to always get back NULL from a shadow
task using rt_task_self(). We used to get something valid with r3415.
Any idea?
Thanks,
Steven
[-- Attachment #2: Type: text/html, Size: 4464 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] shadow task and rt_task_self()
2009-01-23 19:04 [Xenomai-help] shadow task and rt_task_self() Steven Seeger
@ 2009-01-23 19:24 ` Gilles Chanteperdrix
2009-01-23 19:43 ` Steven Seeger
0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2009-01-23 19:24 UTC (permalink / raw)
To: Steven Seeger; +Cc: xenomai
Steven Seeger wrote:
> Using the latest xenomai we seem to always get back NULL from a shadow
> task using rt_task_self(). We used to get something valid with r3415.
> Any idea?
Please send us a little test program that we can run to observe the
issue. And tell us which branch has the problem trunk or v2.4.x?
--
Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] shadow task and rt_task_self()
2009-01-23 19:24 ` Gilles Chanteperdrix
@ 2009-01-23 19:43 ` Steven Seeger
2009-01-23 19:46 ` Gilles Chanteperdrix
0 siblings, 1 reply; 7+ messages in thread
From: Steven Seeger @ 2009-01-23 19:43 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
Gilles, the problem is very simple. The initial task has self->opaque
set to XN_NO_HANDLE. After you shadow that task, rt_task_self() still
returns NULL.
This is either an oversight or you aren't supposed to shadow the initial
task?
Thanks,
Steven
> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Friday, January 23, 2009 12:24 PM
> To: Steven Seeger
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] shadow task and rt_task_self()
>
> Steven Seeger wrote:
> > Using the latest xenomai we seem to always get back NULL from a
> shadow
> > task using rt_task_self(). We used to get something valid with
r3415.
> > Any idea?
>
> Please send us a little test program that we can run to observe the
> issue. And tell us which branch has the problem trunk or v2.4.x?
>
> --
> Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] shadow task and rt_task_self()
2009-01-23 19:43 ` Steven Seeger
@ 2009-01-23 19:46 ` Gilles Chanteperdrix
2009-01-23 19:50 ` Steven Seeger
0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2009-01-23 19:46 UTC (permalink / raw)
To: Steven Seeger; +Cc: xenomai
Steven Seeger wrote:
> Gilles, the problem is very simple. The initial task has self->opaque
> set to XN_NO_HANDLE. After you shadow that task, rt_task_self() still
> returns NULL.
>
> This is either an oversight or you aren't supposed to shadow the initial
> task?
Maybe, but please do the work of writing the simplest example. Maybe you
will discover that it is something else in your bigger example that
causes it. And you still did not tell me if this is a trunk issue or a
v2.4.x branch issue.
--
Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] shadow task and rt_task_self()
2009-01-23 19:46 ` Gilles Chanteperdrix
@ 2009-01-23 19:50 ` Steven Seeger
2009-01-23 20:06 ` Gilles Chanteperdrix
0 siblings, 1 reply; 7+ messages in thread
From: Steven Seeger @ 2009-01-23 19:50 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 987 bytes --]
Gilles,
Attached is my simple test that repeats this problem.
Output is:
0
0 0
This is using latest xenomai trunk.
Thanks,
Steven
> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Friday, January 23, 2009 12:46 PM
> To: Steven Seeger
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] shadow task and rt_task_self()
>
> Steven Seeger wrote:
> > Gilles, the problem is very simple. The initial task has
self->opaque
> > set to XN_NO_HANDLE. After you shadow that task, rt_task_self()
still
> > returns NULL.
> >
> > This is either an oversight or you aren't supposed to shadow the
> initial
> > task?
>
> Maybe, but please do the work of writing the simplest example. Maybe
> you
> will discover that it is something else in your bigger example that
> causes it. And you still did not tell me if this is a trunk issue or a
> v2.4.x branch issue.
>
> --
> Gilles.
[-- Attachment #2: self.cpp --]
[-- Type: application/octet-stream, Size: 402 bytes --]
#include <sys/mman.h>
#include <iostream>
#include <native/task.h>
//#include "i387.h"
static RT_TASK shadowed_task;
int main()
{
int ret;
mlockall(MCL_CURRENT | MCL_FUTURE);
std::cout << (void*)rt_task_self() << std::endl;
ret = rt_task_shadow(&shadowed_task, "shadow test", 1, 0);
std::cout << (void*)rt_task_self() << ' ' << ret << std::endl;
return 0;
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] shadow task and rt_task_self()
2009-01-23 19:50 ` Steven Seeger
@ 2009-01-23 20:06 ` Gilles Chanteperdrix
2009-01-23 20:11 ` Steven Seeger
0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2009-01-23 20:06 UTC (permalink / raw)
To: Steven Seeger; +Cc: xenomai
Steven Seeger wrote:
> Gilles,
>
> Attached is my simple test that repeats this problem.
>
> Output is:
>
> 0
> 0 0
>
> This is using latest xenomai trunk.
>
Ok. Try this:
Index: src/skins/native/task.c
===================================================================
--- src/skins/native/task.c (revision 4570)
+++ src/skins/native/task.c (working copy)
@@ -210,8 +210,12 @@ int rt_task_shadow(RT_TASK *task, const
err = XENOMAI_SKINCALL2(__native_muxid, __native_task_create, &bulk,
NULL);
- if (!err)
+ if (!err) {
+#ifdef HAVE___THREAD
+ __native_self = *task;
+#endif /* HAVE___THREAD */
xeno_set_current();
+ }
return err;
}
--
Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] shadow task and rt_task_self()
2009-01-23 20:06 ` Gilles Chanteperdrix
@ 2009-01-23 20:11 ` Steven Seeger
0 siblings, 0 replies; 7+ messages in thread
From: Steven Seeger @ 2009-01-23 20:11 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
That worked perfectly. Or at the very least, did not return NULL. :)
Thank you!
Steven
> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Friday, January 23, 2009 1:06 PM
> To: Steven Seeger
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] shadow task and rt_task_self()
>
> Steven Seeger wrote:
> > Gilles,
> >
> > Attached is my simple test that repeats this problem.
> >
> > Output is:
> >
> > 0
> > 0 0
> >
> > This is using latest xenomai trunk.
> >
>
> Ok. Try this:
>
> Index: src/skins/native/task.c
> ===================================================================
> --- src/skins/native/task.c (revision 4570)
> +++ src/skins/native/task.c (working copy)
> @@ -210,8 +210,12 @@ int rt_task_shadow(RT_TASK *task, const
> err = XENOMAI_SKINCALL2(__native_muxid, __native_task_create,
> &bulk,
> NULL);
>
> - if (!err)
> + if (!err) {
> +#ifdef HAVE___THREAD
> + __native_self = *task;
> +#endif /* HAVE___THREAD */
> xeno_set_current();
> + }
>
> return err;
> }
>
>
> --
> Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-01-23 20:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-23 19:04 [Xenomai-help] shadow task and rt_task_self() Steven Seeger
2009-01-23 19:24 ` Gilles Chanteperdrix
2009-01-23 19:43 ` Steven Seeger
2009-01-23 19:46 ` Gilles Chanteperdrix
2009-01-23 19:50 ` Steven Seeger
2009-01-23 20:06 ` Gilles Chanteperdrix
2009-01-23 20:11 ` Steven Seeger
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.