From: Andrew Lunn <andrew@lunn.ch>
To: "oliver munz @ s p e a g" <munz@speag.ch>
Cc: ecos-devel@sources.redhat.com
Subject: Re: why use the SA1110-USB-driver a static /dev/usbs... definition ???
Date: Mon, 27 Jun 2005 13:02:00 -0000 [thread overview]
Message-ID: <20050627130201.GD11071@lunn.ch> (raw)
In-Reply-To: <007a01c57b16$39a30890$5e188481@cadpad>
On Mon, Jun 27, 2005 at 02:46:23PM +0200, oliver munz @ s p e a g wrote:
> Hello
>
> I'm writing a device-driver on basis of the SA1110-USB-driver.
> First I made a package without functionality. Then I tryed to get a handel
> of my driver. It dosent worked. There was also no entry in the
> ..._install\lib\\libextras.a.
>
> After houres of searching, I found, that the reason is the static definition
> of the ..._devtab_entry. After removing the "static" key-word, my
> test-program found his handels and does some pseudo inits...
>
> The question for me is now, what is the reason for a static devtab?
>
> The original source is:
>
> "...\ecos\packages\devs\usb\sa11x0\current\src\usbs_sa11x0_data.cxx"
>
> static CHAR_DEVIO_TABLE(usbs_sa11x0_ep0_devtab_functions,
> &cyg_devio_cwrite,
> &cyg_devio_cread,
> &cyg_devio_select,
> &usbs_devtab_get_config,
> &usbs_devtab_set_config);
>
> static CHAR_DEVTAB_ENTRY(usbs_sa11x0_ep0_devtab_entry,
> CYGDAT_DEVS_USB_SA11X0_DEVTAB_BASENAME "0c",
> 0,
> &usbs_sa11x0_ep0_devtab_functions,
> &usbs_sa11x0_devtab_ep0_init,
> 0,
> (void*) &usbs_sa11x0_ep0);
This sounds like a garbage collection problem. Without the static the
variables the macros define will be global. So the compiler cannot
throw it away if its not referenced within the local file. If its
declared static and nothing references it within the file the compiler
has probably decided the variables are not needed and throw them
away. Hence they don't end up in libextras.a.
What version of gcc are you using? Something newish?
Andrew
next prev parent reply other threads:[~2005-06-27 13:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-27 12:46 oliver munz @ s p e a g
2005-06-27 13:02 ` Andrew Lunn [this message]
2005-06-27 13:41 ` Andrew Lunn
2005-06-27 14:34 ` oliver munz @ s p e a g
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=20050627130201.GD11071@lunn.ch \
--to=andrew@lunn.ch \
--cc=ecos-devel@sources.redhat.com \
--cc=munz@speag.ch \
/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).