From: Philippe Gerum <rpm@xenomai.org>
To: ROSSIER Daniel <Daniel.Rossier@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Xenomai on Xscale (Linux 2.6.20)
Date: Wed, 24 Oct 2007 17:30:59 +0200 [thread overview]
Message-ID: <471F6533.2090603@domain.hid> (raw)
In-Reply-To: <FDBBB5CC70676540B3EF7CFE83FD94E0B47622@domain.hid>
ROSSIER Daniel wrote:
> Hi all,
>
> I've found a bug in arch/arm/xenomai/switch.S which solved the problem below. It actually comes from the iWMMXT (Intel Wireless MMX) coprocessor which is an extension of the ARM core in Xscale processor (and of course which is not available in the AT91 series ;-).
>
> When a thread switch occurs, rthal_thread_switch(in arch/arm/xenomai/switch.S) is called to perform switching of registers and stacks between threads. The PXA version must also perform a switch of MMX registers by invoking iwmmxt_task_switch(in arch/arm/kernel/iwmmxt.S). This is done in rthal_task_switch() as well.
>
> However, between Linux 2.6.15 and Linux 2.6.20, the general scheme of low-level task switching procedure changed a little bit: it is now relying on a call chain notifier-based mechanism. Therefore, the iwmmxt_task_switch() function has been updated since the function is called now from the notifier, and not directly from __switch_to() as in 2.6.15. And the ipipe (ARM) patch did not take into account that.. and it fails.
>
> So, as a first workaround, I simply duplicated the iwmmxt_task_switch() function making the version (from 2.6.15) proprietary to ipipe by renaming to iwmmxt_task_switch_from_ipipe(), and modified arch/arm/xenomai/switch.S accordingly (be careful, switch.S is a symlink and actually belongs to Xenomai tree (ksrc/arch/arm).
>
> It seems to work so far, but further tests are needed (and will be done).
>
> I attached a patch to be applied in the (xenomai-patched) Linux tree.
> (Linux 2.6.20, xenomai from today svn).
>
Task switching is not I-pipe's business, and we should refrain from
recycling code from older kernel versions into recent ones. AFAICS, we
only need to conform to some new internal API. Food for thought below:
--- ksrc/arch/arm/switch.S (revision 3095)
+++ ksrc/arch/arm/switch.S (working copy)
@@ -18,6 +18,7 @@
*/
#include <linux/linkage.h>
+#include <linux/version.h>
#include <asm/assembler.h>
#include <asm/asm-offsets.h>
@@ -86,7 +87,13 @@
VFPFMXR FPEXC, r4
#endif
#if defined(CONFIG_IWMMXT)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+ mr r0, r2
bl iwmmxt_task_switch
+ mr r2, r0
+#else
+ bl iwmmxt_task_switch
+#endif
#elif defined(CONFIG_CPU_XSCALE)
add r4, r2, #40 @ cpu_context_save->extra
ldmib r4, {r4, r5}
--
Philippe.
next prev parent reply other threads:[~2007-10-24 15:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 14:55 [Xenomai-core] Xenomai on Xscale (Linux 2.6.20) ROSSIER Daniel
2007-10-24 15:30 ` Philippe Gerum [this message]
2007-10-24 16:25 ` Gilles Chanteperdrix
2007-10-24 16:45 ` Philippe Gerum
2007-12-03 11:56 ` linux
2007-12-03 13:09 ` Gilles Chanteperdrix
2007-12-03 14:36 ` Patrick
2007-10-24 15:56 ` Gilles Chanteperdrix
-- strict thread matches above, loose matches on Subject: below --
2007-10-22 16:53 Patrick
2007-10-22 17:07 ` Jan Kiszka
2007-10-22 19:36 ` Gilles Chanteperdrix
2007-10-11 16:35 ROSSIER Daniel
2007-10-11 17:00 ` Philippe Gerum
2007-10-12 12:28 ` Daniel Rossier
2007-10-12 12:43 ` Gilles Chanteperdrix
2007-10-11 17:02 ` Jan Kiszka
2007-10-12 11:48 ` Daniel Rossier
2007-10-12 12:34 ` Gilles Chanteperdrix
2007-10-12 12:46 ` Daniel Rossier
2007-10-12 13:14 ` Gilles Chanteperdrix
2007-10-13 15:34 ` ROSSIER Daniel
2007-10-13 17:06 ` Gilles Chanteperdrix
2007-10-22 16:38 ` Patrick
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=471F6533.2090603@domain.hid \
--to=rpm@xenomai.org \
--cc=Daniel.Rossier@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.