All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: niklaus.giger@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] SOLO: Too limited priorities for vxWorks threads
Date: Sun, 18 May 2008 16:18:58 +0200	[thread overview]
Message-ID: <48303AD2.7090702@domain.hid> (raw)
In-Reply-To: <200805181433.08142.niklaus.giger@domain.hid>

Niklaus Giger wrote:
> Am Sonntag, 18. Mai 2008 schrieb Philippe Gerum:
>> Niklaus Giger wrote:
>>> Hi
>>>
>>> I just tried to get a sample test program to run under Xenomai-SOLO
>>> and run into this panic message:
>>> Xenomai/SOLO: current implementation restricts VxWorkspriority levels to range [-2..0]
>>> looking at the code I found at taskLib.c
>>>> 263     {
>>>> 264             if (wind_prio < 0 || wind_prio > 255) /* In theory. */
>>>> 265                     return S_taskLib_ILLEGAL_PRIORITY;
>>>> 266
>>>> 267             if (wind_prio >= threadobj_max_prio - 1) /* In practice. */
>>>> 268                     panic("current implementation restricts VxWorks"
>>>> 269                           "priority levels to range [%d..0]",
>>>> 270                           threadobj_max_prio - 2);
>>>> 271             return OK;
>>> Therefore I seem to have only the option of priority 0 which is way too limited.
>>>
>> The SOLO version is purely Linux native, so you only get what the underlying
>> kernel provides you, including in terms of available priority scales. Since RT
>> threads are members of the SCHED_FIFO class, you get 99 priority levels, unless
>> you patch the vanilla kernel to handle more. The way to solve this properly for
>> SOLO is to write a patch against PREEMPT_RT that allows wider priority scales,
>> and to get it merged upstream.
> Sorry, but you did not get my point. I tried to call it with priority 50, which
> should be in this range, which I verified with gdb
> (gdb) info stack
> #0  panic (fmt=0xb7eebb90 "current implementation restricts VxWorkspriority levels to range [%d..0]") at panic.c:45
> #1  0xb7eea1ac in check_task_priority (wind_prio=50) at taskLib.c:268
> #2  0xb7eea1d9 in __taskInit (task=0x9eda0e0, tcb=0x9eda10c, name=0xbfc43760 "BSysAsyncTimerMgrThread", prio=50, flags=0,
>     entry=0x81281c4 <BSysOsWrapperThread_callback(int)>, stacksize=51200) at taskLib.c:284
> <...>
> 
> I am happy with the rang 0.99 and also will no run any latency tests, as
> xenomai-SOLO is for me at the moment just a test bed to check for compiler
> error etc, as at the moment I have no running powerpc kernel for my PPC440
> target.
>

Have a look at my next answer: the test fails because threadobj_max_prio is
zero, which can't be the case after the emulator has properly initialized. You
may have run into either of the following problems:

- since you seem to be using C++, don't create tasks in static constructors.
They are run before solo_init() is called.

- make sure to call kernelInit() from the VxWorks emulation lib, just like the
tests from the test suite do.


> Best regards
> 


-- 
Philippe.


  reply	other threads:[~2008-05-18 14:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-18  9:42 [Xenomai-core] SOLO: Too limited priorities for vxWorks threads Niklaus Giger
2008-05-18 11:45 ` Philippe Gerum
2008-05-18 12:33   ` Niklaus Giger
2008-05-18 14:18     ` Philippe Gerum [this message]
2008-05-18 14:21       ` Philippe Gerum
2008-05-18 11:47 ` 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=48303AD2.7090702@domain.hid \
    --to=rpm@xenomai.org \
    --cc=niklaus.giger@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.