This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_addrword_t data type
- To: Sandeep Rikhi <sr at cdotb dot ernet dot in>
- Subject: Re: [ECOS] cyg_addrword_t data type
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Fri, 15 Sep 2000 18:36:34 +0100
- CC: "eCos Discussion Gp." <ecos-discuss at sourceware dot cygnus dot com>
- Organization: Red Hat UK Ltd.
- References: <Pine.OSF.4.21.0009151048080.9684-100000@ws9.cdotb.ernet.in>
Sandeep Rikhi wrote:
>
> I'm working on eCos for an ADSL Modem to be used on MPC 850 micro
> processor.
> Sir,The definition of
> cyg_addrword_t says that it is basically a cyg_uint32 i.e 32 bit unsigned
> integer. But the description says, it can be used as apointer to some
> memory location or a data word. Isn't it ambiguous.
> e.g. If accidently a type mismatch occurs, some serious fatal errors can
> occur. Please put some light on the usage of this particular data
> structure.
A cyg_addrword_t is special and is only to be used in certain circumstances
- to pass around opaque data of unknown type. On some machines the size of
an integer or long variable, and the size of a memory address, may all
differ. In such cases, a cyg_addrword_t would have to be the largest of
these sizes.
An example of when it is useful is starting a thread - the entry_data
argument (which is used as an argument to the thread entry function) is
something the thread creator passes and may be anything - an integer, an
address, anything.
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault