This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: SPI driver and constructor execution
- From: Rycerz Roman-G11565 <roman dot rycerz at motorola dot com>
- To: "'ecos-discuss at sources dot redhat dot com'" <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 7 Apr 2005 09:45:51 -0500
- Subject: RE: [ECOS] SPI driver and constructor execution
Bart
Thanks... I think I am doing that... But I do reference the spi_transfer routines..
If I am doing it right... I should see the spi init routines is the symbol table right ????
Roman
-----Original Message-----
From: Bart Veer [mailto:bartv@ecoscentric.com]
Sent: Wednesday, April 06, 2005 11:40 AM
To: Rycerz Roman-G11565
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] SPI driver and constructor execution
>>>>> "Roman" == Rycerz Roman-G11565 <roman.rycerz@motorola.com> writes:
Roman> I have modified the SPI driver software that was posted
Roman> here and in CVS. I can can get it to compile and link...
Roman> the problem I have having is that when the system is
Roman> initializing the spi bus constructors don't get built... in
Roman> the image I don't even see the init routines or the cxx
Roman> files in insight when I go to debug it. I think I have
Roman> implemented the same macros and such... but something is
Roman> missing ????
Roman> I have looked at other drivers that are inited this was and
Roman> haven't found what I am missing.....
Roman> Any ideas ?
Does the application reference any of the SPI code or cyg_spi_device structures, e.g. by calling cyg_spi_transfer() with a suitable first argument? The SPI subsystem has been designed such that it all gets eliminated by link-time garbage collection unless there is code which actually uses it. That way SPI support can be added to a platform without adding overhead to applications which do not use SPI.
If the application does reference a cyg_spi_device structure then that will get linked in. The device structure references a cyg_spi_bus so the linker has to pull that in, and that should cause the appropriate constructor to be added to the executable automatically.
Bart
--
Bart Veer eCos Configuration Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss