2007/6/8, Gilles Chanteperdrix <[EMAIL PROTECTED]>:
> BOUIN Alexandre wrote:
> > > When we released our last version of adeos-ipipe-2.6.19-arm-AT91.patch,
> we suggested to merge code for at91rm9200 and at91sam926x.
> > > These 2 code are split but quite similar, so we think it could be a good
> idea. Are you OK for removing duplicated code ?
> If I have to choose between duplicating some Linux code in I-pipe code
> and have some duplication in the I-pipe patch, I choose duplication in
> the I-pipe patch. If you duplicate Linux code, you will have to avoid
> forgetting to update this duplicate code when Linux code evolves.
Well the first mail wasn't very clear. I am going to explain what we
have in mind.
In Linux code for AT91 timer there are two files: at91sam926x_time.c
and at91rm9200_time.c because AT91RM9200 and AT91SAM926x have
different system timer: AT91RM9200 use AT91_ST peripheral and
AT91SAM926x use AT91_PIT peripheral.
But with i-pipe we use TC (timer counter) in both case, and code is
the same (the only difference are in the name of internal function).
When CONFIG_IPIPE is defined, original Linux code is no more used and
it is new i-pipe code which is used.
I suggest to add a new file in i-pipe patch, let's call it
"at91ipipe_time.c". In this file we will find the common ipipe code.
This file will be compiled in place of at91sam926x_time.c and
at91rm9200_time.c. For doing this we just have to change Makefile with
something like this:
# CPU-specific support
obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_devices.o
obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam9260_devices.o
obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam9261_devices.o
obj-$(CONFIG_ARCH_AT91RM9200) += at91ipipe_time.o
obj-$(CONFIG_ARCH_AT91SAM9260) += at91ipipe_time.o
obj-$(CONFIG_ARCH_AT91SAM9261) += at91ipipe_time.o at91sam9261_devices.o
obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200_time.o
obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam926x_time.o
obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam926x_time.o
2, chemin du Ruisseau - BP21
69136 Ecully Cedex
Tel : +33-4 72 18 08 40
Xenomai-core mailing list