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]

Re: cyg_addrword_t data type


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

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