From: Philippe Gerum <rpm@xenomai.org>
To: Thomas Necker <thomas.necker@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] xnpod_announce_tick when migrating from 2.3 to 2.4
Date: Thu, 18 Oct 2007 16:10:05 +0200 [thread overview]
Message-ID: <1192716605.5884.35.camel@domain.hid> (raw)
In-Reply-To: <1192715021.5884.32.camel@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 1173 bytes --]
On Thu, 2007-10-18 at 15:43 +0200, Philippe Gerum wrote:
> > It's actually much simpler with 2.4. You may install a hook into the
> > periodic tick handler by calling the following helper, somewhere in
> your
> > module init code:
> >
> > xntbase_set_hook(psos_tbase, your_psos_hook);
> >
> > The only difference compared to your current approach is that
> Xenomai
> > will have processed the incoming tick before calling your hook, so
> you
> > don't need to forward the tick anymore. Sidenote: this only works
> with
> > periodic timebases so far.
> >
>
> Actually, I now think we should rather implement to the traditional
> "daisy-chain" pattern here, with the user-defined hook being called in
> replacement of the genuine tick processing code, and the hook expected
> to call into xntbase_tick() to signal the incoming tick when it sees
> fit. This would allow the skin to implement time slowdowns etc.
>
> Thomas, I'm going to send a patch asap to this end. Please rely on the
> common behaviour (i.e. daisy-chain) you would expect from pSOS.
Here we are. This patch is against 2.4-rc4, and allows to implement a
daisy-chain of tick handlers.
--
Philippe.
[-- Attachment #2: tick-daisy-chain.patch --]
[-- Type: text/x-patch, Size: 1776 bytes --]
Index: include/nucleus/timer.h
===================================================================
--- include/nucleus/timer.h (revision 3081)
+++ include/nucleus/timer.h (working copy)
@@ -710,6 +710,8 @@
void xntimer_tick_periodic(xntimer_t *timer);
+void xntimer_tick_periodic_inner(xntslave_t *slave);
+
void xntimer_adjust_all_aperiodic(xnsticks_t delta);
#ifdef CONFIG_SMP
Index: ksrc/nucleus/timer.c
===================================================================
--- ksrc/nucleus/timer.c (revision 3081)
+++ ksrc/nucleus/timer.c (working copy)
@@ -465,9 +465,8 @@
* @note Only active timers are inserted into the timer wheel.
*/
-void xntimer_tick_periodic(xntimer_t *mtimer)
+void xntimer_tick_periodic_inner(xntslave_t *slave)
{
- xntslave_t *slave = timer2slave(mtimer);
xnsched_t *sched = xnpod_current_sched();
xntbase_t *base = &slave->base;
xntlholder_t *holder;
@@ -502,9 +501,17 @@
}
xnpod_do_rr(); /* Do round-robin management. */
+}
- if (base->hook)
+void xntimer_tick_periodic(xntimer_t *mtimer)
+{
+ xntslave_t *slave = timer2slave(mtimer);
+ xntbase_t *base = &slave->base;
+
+ if (unlikely(base->hook))
base->hook();
+ else
+ xntimer_tick_periodic_inner(slave);
}
static void
Index: ksrc/nucleus/timebase.c
===================================================================
--- ksrc/nucleus/timebase.c (revision 3081)
+++ ksrc/nucleus/timebase.c (working copy)
@@ -475,9 +475,8 @@
if (base == &nktbase)
xntimer_tick_aperiodic();
else {
- unsigned cpu = xnarch_current_cpu();
- struct percpu_cascade *pc = &base2slave(base)->cascade[cpu];
- xntimer_tick_periodic(&pc->timer);
+ xntslave_t *slave = base2slave(base);
+ xntimer_tick_periodic_inner(slave);
}
xnlock_put_irqrestore(&nklock, s);
next prev parent reply other threads:[~2007-10-18 14:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-18 12:11 [Xenomai-help] xnpod_announce_tick when migrating from 2.3 to 2.4 Thomas Necker
2007-10-18 13:15 ` Jan Kiszka
2007-10-18 15:36 ` Thomas Necker
2007-10-18 15:45 ` Jan Kiszka
2007-10-18 13:27 ` Philippe Gerum
2007-10-18 13:43 ` Philippe Gerum
2007-10-18 14:10 ` Philippe Gerum [this message]
2007-10-18 15:58 ` [Xenomai-help] xnpod_announce_tick when migrating from 2.3 to2.4 Thomas Necker
2007-10-18 16:12 ` 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=1192716605.5884.35.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=thomas.necker@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.