This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: how to build a driver to a single library


On Tue, Jul 19, 2005 at 09:14:47AM +0800, Tianjun - zdk wrote:
> >For your device driver in your library you cannot use the same
> >trick. So instead your application must reference something in the
> >device driver so that it is pulled in. Typically a device driver has a
> >DEVTAB_ENTRY, eg
> >
> >DEVTAB_ENTRY(ebsa285_serial_io,
> >             CYGDAT_IO_SERIAL_ARM_EBSA285_SERIAL_NAME,
> >             0,                     // Does not depend on a lower level interface
> >             &cyg_io_serial_devio,
> >             ebsa285_serial_init,
> >             ebsa285_serial_lookup,     // Serial driver may need initializing
> >             &ebsa285_serial_channel
> >    );
> >
> >Doing something like:
> >
> >  extern cyg_devtab_entry_t *ebsa285_serial_io;
> >  ebsa285_serial_io = ebsa285_serial_io;

This is effectively a nop, a no operation. But the compiler will do
it, so forcing a reference to the symbol ebsa285_serial_io. This means
the linker is forced to include the symbol in the application.

You want to do something similar with your driver otherwise the link
may decide to not include it in the application.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]