From: Philippe Gerum <rpm@xenomai.org>
To: Matthias Schneider <ma30002000@yahoo.de>,
"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] FreeRTOS skin #2
Date: Fri, 20 Jun 2014 09:55:42 +0200 [thread overview]
Message-ID: <53A3E8FE.5020005@xenomai.org> (raw)
In-Reply-To: <1401734780.6508.YahooMailNeo@web171606.mail.ir2.yahoo.com>
On 06/02/2014 08:46 PM, Matthias Schneider wrote:
> Please find enclosed a new version of the FreeRTOS skin. It adapts to the
> latest changes in forge/next and also removes the previously included
> workarounds - thanks to the changes done based on the first review round
> they were no longer necessary.
>
Thanks. Here we go:
* vTaskStartScheduler()
Dropping the task_list lock then yielding is superfluous, the caller
will wait on the condvar for the scheduler state to switch to SUSPENDING
anyway, implicitly releasing this lock before going to sleep.
* vTaskDelay()
Cobalt wraps sched_yield(), so you likely want to call
__RT(sched_yield()) to pick the proper implementation depending on the
underlying real-time core.
* __xTaskGenericCreate()
- It looks like the mutex attribute initialized locally is a left over
from a previous implementation.
- Drawing unique identifier labels should be done using a name
generator, e.g.
static DEFINE_NAME_GENERATOR(task_namegen, struct freertos_task, name);
...
generate_name(task->name, name, &task_namegen);
The open-coded method also used by other emulators is racy.
* vPortEnter/ExitCritical()
- wouldn't these calls better emulated by threadobj_lock_sched()
assuming they stand for a global serialization mechanism?
* Task registry support
The code looks outdated, using fsobstacks is recommended. The registry
helpers in lib/alchemy/alarm.c illustrate a basic usage.
* vTaskSuspendAll()
Running check_processors() there may switch the caller to linux mode
at each invocation, due to calling sysconf/sched_getaffinity indirectly.
I would rather assume that the CPU affinity is not allowed to change
once started, and determine whether a task is bound to more than a
single CPU in the trampoline code. Then vTaskSuspendAll() may do a
simple flag-based test for checking the consistency, still allowing
different freertos tasks to be pinned on distinct CPUs though. At any
rate, this would be an acceptable restriction, since freertos does not
seem to be SMP-capable in its reference implementation anyway.
Next time, I'll start reviewing other parts of the emulator.
HTH,
--
Philippe.
next prev parent reply other threads:[~2014-06-20 7:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-22 19:46 [Xenomai] FreeRTOS skin #2 Matthias Schneider
2014-06-02 18:46 ` Matthias Schneider
2014-06-20 7:55 ` Philippe Gerum [this message]
2014-06-23 10:31 ` Matthias Schneider
2014-06-23 20:27 ` Matthias Schneider
2014-07-01 16:48 ` Matthias Schneider
2014-07-09 7:42 ` Philippe Gerum
2014-07-09 8:24 ` Philippe Gerum
2014-07-14 19:12 ` Matthias Schneider
2014-07-14 19:18 ` Matthias Schneider
2014-07-14 20:15 ` Philippe Gerum
2014-07-09 7:46 ` 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=53A3E8FE.5020005@xenomai.org \
--to=rpm@xenomai.org \
--cc=ma30002000@yahoo.de \
--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.