From: Philippe Gerum <rpm@xenomai.org>
To: ROSSIER Daniel <Daniel.Rossier@domain.hid>
Cc: adeos-main@gna.org, xenomai@xenomai.org
Subject: Re: [Xenomai-core] Xenomai on Freescale i.MX21 (ARM926J)
Date: Fri, 21 Apr 2006 17:44:23 +0200 [thread overview]
Message-ID: <4448FDD7.2060708@domain.hid> (raw)
In-Reply-To: <FDBBB5CC70676540B3EF7CFE83FD94E0043151@domain.hid>
Hi Daniel,
Some comments about the Adeos patch for the i.MX21/CSB535FS board. The inlined patch
has been rebuilt by diff'ing the vanilla Adeos 1.2-00 support with yours.
> --- linux-2.6.14/arch/arm/kernel/ipipe-core.c 2006-04-21 16:17:02.000000000 +0200
> +++ linux-2.6.14-heig/arch/arm/kernel/ipipe-core.c 2006-04-21 15:33:47.000000000 +0200
> @@ -22,6 +22,12 @@
> * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
> *
> * Architecture-dependent I-PIPE core support for ARM.
> + *
> + * April 2006 :
> + * Adapted to ARM9 i.MX21/CSB535FS board with Xenomai by S.Gerber, G.Boutillier and D.Rossier
> + * University of Applied Sciences Western Switzerland
> + * Reconfigurable & Embedded Digital Systems, REDS Institute
> + *
> */
>
> #include <linux/config.h>
> @@ -320,11 +326,19 @@ static void __ipipe_set_decr(void)
> int ipipe_tune_timer(unsigned long ns, int flags)
> {
> unsigned long x, ticks;
> + unsigned long us;
>
> if (flags & IPIPE_RESET_TIMER)
> ticks = __ipipe_mach_ticks_per_jiffy;
> else {
> - ticks = ns * __ipipe_mach_ticks_per_jiffy / (1000000000 / HZ);
> +
> + /*
> + * FIXME : Temporary convert ns to us. With nanosecondes we have a problem
> + * with overflow.
> + * ticks = ns * __ipipe_mach_ticks_per_jiffy / (1000000000 / HZ);
> + */
> + us = ns / 1000;
> + ticks = ((us * __ipipe_mach_ticks_per_jiffy) / 10000);
>
This change is going to be wrong when CONFIG_HZ != 1000,
this is why HZ should remain in the picture. This said, the original expression looks
overly complicated, something like the following should do without risking the overflow:
- ticks = ns * __ipipe_mach_ticks_per_jiffy / (1000000000 / HZ);
+ ticks = ns / (TICKS_PER_uSEC * 1000);
> if (ticks > __ipipe_mach_ticks_per_jiffy)
> return -EINVAL;
> diff -uNrp linux-2.6.14/arch/arm/kernel/process.c linux-2.6.14-heig/arch/arm/kernel/process.c
> --- linux-2.6.14/arch/arm/kernel/process.c 2006-04-21 16:17:02.000000000 +0200
> +++ linux-2.6.14-heig/arch/arm/kernel/process.c 2006-04-21 15:33:47.000000000 +0200
> @@ -7,6 +7,12 @@
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License version 2 as
> * published by the Free Software Foundation.
> + *
> + * April 2006 :
> + * Adapted to ARM9 i.MX21/CSB535FS board with Xenomai by S.Gerber, G.Boutillier and D.Rossier
> + * University of Applied Sciences Western Switzerland
> + * Reconfigurable & Embedded Digital Systems, REDS Institute
> + *
> */
> #include <stdarg.h>
>
> @@ -111,7 +117,14 @@ void cpu_idle(void)
> preempt_disable();
> leds_event(led_idle_start);
> while (!need_resched())
> +/*
> + * Width idle -> latenca of interrupts
> + */
> +#ifndef CONFIG_IPIPE
> idle();
> +#else
> + ;
> +#endif
Ouch. It would be saner to implement the idle mode switch one could pass
as a boot argument to the kernel (e.g. arch/i386/kernel/process.c),
accepting "poll" or "default", instead of hard-wiring the poll mode.
> leds_event(led_idle_end);
> preempt_enable();
> schedule();
> diff -uNrp linux-2.6.14/init/Kconfig linux-2.6.14-heig/init/Kconfig
> --- linux-2.6.14/init/Kconfig 2006-04-21 16:17:02.000000000 +0200
> +++ linux-2.6.14-heig/init/Kconfig 2006-04-21 15:34:01.000000000 +0200
> @@ -502,3 +502,20 @@ config STOP_MACHINE
> help
> Need stop_machine() primitive.
> endmenu
> +
> +menu "Real-time sub-system"
> +
The Xenomai-related stuff does not belong to the Adeos patch.
--
Philippe.
next prev parent reply other threads:[~2006-04-21 15:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-20 9:27 [Xenomai-core] Xenomai on Freescale i.MX21 (ARM926J) ROSSIER Daniel
2006-04-20 13:43 ` Philippe Gerum
2006-04-20 15:36 ` Marco Cavallini
2006-04-21 6:55 ` RE : " ROSSIER Daniel
2006-04-21 7:31 ` Jan Kiszka
2006-04-21 8:44 ` RE : " ROSSIER Daniel
2006-04-21 13:28 ` Philippe Gerum
2006-04-21 15:44 ` Philippe Gerum [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-04-25 12:54 ROSSIER Daniel
2006-04-25 13:16 ROSSIER Daniel
2006-05-09 14:46 ROSSIER Daniel
2006-05-09 15:37 ` Philippe Gerum
2006-05-11 13:49 ` Philippe Gerum
2006-05-11 15:10 ROSSIER Daniel
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=4448FDD7.2060708@domain.hid \
--to=rpm@xenomai.org \
--cc=Daniel.Rossier@domain.hid \
--cc=adeos-main@gna.org \
--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.