Which irq files are taken and what is *_mng_*

Ralf Corsepius corsepiu at faw.uni-ulm.de
Tue Sep 23 00:41:10 UTC 2003


On Tue, 2003-09-23 at 01:15, Till Straumann wrote:
> Leon Pollak wrote:
> > Hello, gurus.
> > 
> > 	1. Looking for something different, I found that the 
> > .../src/lib/libbsp/powerpc/shared/irq
> > and, for example,
> > .../src/lib/libbsp/powerpc/mbx8xx/irq
> > both contain the same named files irq.c, irq.h, irq_init.c with different 
> > realization of the same named function. 
> Good point - bad practice.
Not quite. As you correctly point out below, both implementations
basically are separate. 

It's using VPATH which makes them unreliable and error-prone. If using
hard-coded paths, there wouldn't be any problems with it.

>  I guess this is for historical reasons.
Definitely. Sharing code between BSPs and trying to identify shareable
code to be shared between different flavors of cpus and cpu-families has
been a permanent problem in RTEMS history, and has not really been
solved until today.

> It is not the link process but Makefile VPATH magic. Contrary to what
> the name suggests 'libbsp/powerpc/shared' is not really shared among
> all PPC BSPs. Only different flavors of the motorola_powerpc BSP use
> code from 'shared'. The others (such as mbx8xx) used the 'copy' approach,
> i.e. they use their own copy.

> Since e.g. mbx8xx is not using 'shared' (although its 'irq.c' & friends
> are almost identical), its VPATH doesn't instruct 'make' to search the
> 'powerpc/shared' subtree for sources and the 'shared' ones will never
> be actually compiled.
Furthermore, VPATH only tells make "where" to for files (It's a search
path), it doesn't tell make "which" files to search for. 

The files being actually compiled are listed in other make-variables (In
most cases: *_C_FILES, *_S_FILES etc.).

Ralf

PS.: IMO, to put it politely, this design leaves a lot to be desired.
But unless somebody comes up with a compelling replacement, it probably
won't change any time soon.





More information about the users mailing list