From: Philippe Gerum <rpm@xenomai.org>
To: Ronny Meeus <ronny.meeus@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Xenomai-forge: SEGFAULT is pSOS skin
Date: Wed, 12 Oct 2011 19:19:07 +0200 [thread overview]
Message-ID: <1318439947.2112.74.camel@domain.hid> (raw)
In-Reply-To: <CAMJ=MEc42w7WhZf5XK4E_e=wK7PLGx2P-a=JoCc0e8Mkkc5MrQ@mail.gmail.com>
On Wed, 2011-10-12 at 19:16 +0200, Ronny Meeus wrote:
> On Tue, Oct 4, 2011 at 5:41 PM, Philippe Gerum <rpm@xenomai.org> wrote:
> > On Mon, 2011-09-26 at 22:01 +0200, Ronny Meeus wrote:
> >
> > <snip>
> >
> >> Next to this I also adapted the task priority automatically using
> >> following algorithm:
> >> static int check_task_priority(u_long *psos_prio)
> >> {
> >> if (*psos_prio < 1 || *psos_prio > 255) /* In theory. */
> >> return ERR_PRIOR;
> >> /* Do not change priorities <=10 and >= 240.
> >> * Priorities in between are divided by 4 */
> >> if (*psos_prio > 240)
> >> *psos_prio = 70 + *psos_prio - 240;
> >> else if (*psos_prio > 10)
> >> *psos_prio = 11 + ((*psos_prio-10)/4);
> >>
> >> if ((int)(*psos_prio) >= threadobj_max_prio - 1) /* In practice. */
> >> panic("current implementation restricts pSOS "
> >> "priority levels to range [1..%d]",
> >> threadobj_max_prio - 2);
> >>
> >> return SUCCESS;
> >> }
> >>
> >> It also works well for our application.
> >> Please share your thoughts.
> >
> > Since we cannot generalize the priority mapping rules, a better way may
> > be to allow your own code to be called by the pSOS emulator when such
> > mapping is required. So I have committed a tentative solution, defining
> > psos_task_normalize_priority() as a weak function, which receives the
> > pSOS priority, and should return the POSIX one.
> >
> > A default implementation is provided by the emulator which does a
> > trivial 1:1 mapping.
> >
> > --
> > Philippe.
> >
> >
> >
>
> Philippe
>
> as Thomas indicated in his mail today (see PSOS skin: mismatch in
> function signatures cause buffer overflow), we synced with the forge
> repo. We used this psos_task_normalize_priority function to remap the
> priority for our application and it works well.
> Thanks.
Ok, so this interface is now official. Thanks.
>
> Ronny
--
Philippe.
next prev parent reply other threads:[~2011-10-12 17:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-22 20:15 [Xenomai-help] Xenomai-forge: SEGFAULT is pSOS skin Ronny Meeus
2011-09-23 13:00 ` Philippe Gerum
2011-09-23 20:21 ` Ronny Meeus
2011-09-23 20:23 ` Philippe Gerum
2011-09-26 10:46 ` Philippe Gerum
2011-09-26 20:01 ` Ronny Meeus
2011-09-26 21:11 ` Philippe Gerum
2011-11-01 11:52 ` Philippe Gerum
2011-11-18 10:57 ` Thomas De Schampheleire
2011-10-04 15:41 ` Philippe Gerum
2011-10-12 17:16 ` Ronny Meeus
2011-10-12 17:19 ` Philippe Gerum [this message]
2011-09-23 13:56 ` Gilles Chanteperdrix
2011-09-23 17:05 ` Ronny Meeus
2011-09-23 17:20 ` Gilles Chanteperdrix
2011-09-23 19:58 ` Ronny Meeus
2011-09-26 10:49 ` Philippe Gerum
2011-09-26 20:02 ` Ronny Meeus
2011-09-26 20:57 ` Philippe Gerum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1318439947.2112.74.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=ronny.meeus@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.