public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Tianjun - zdk <Tianjun@zcom.unimis.com>
Cc: "ecos-discuss@sources.redhat.com" <ecos-discuss@sources.redhat.com>
Subject: Re: Re: [ECOS] how to build a driver to a single library
Date: Tue, 19 Jul 2005 07:19:00 -0000	[thread overview]
Message-ID: <20050719071739.GN15048@lunn.ch> (raw)
In-Reply-To: <NETWEB05VJi0LJEwN9G0000d107@netweb05.net.unimis>

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

  reply	other threads:[~2005-07-19  7:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-19  1:15 Tianjun - zdk
2005-07-19  7:19 ` Andrew Lunn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-07-19  1:01 Tianjun - zdk
2005-07-19  7:15 ` Andrew Lunn

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=20050719071739.GN15048@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Tianjun@zcom.unimis.com \
    --cc=ecos-discuss@sources.redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).