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: Question about compiling consideration(GNUPro, GCC for SPARC)? Thanks


> Q4. In the ABI docs it says some registers are call-clobbered or
> call-preserved, what's the exact meaning of that?

clobbered is not a commonly used word in written English. The Jargon
file has a nice definition:

>From Jargon File (4.0.0/24 July 1996) [jargon]:

  clobber /vt./  To overwrite, usually unintentionally: "I
     walked off the end of the array and clobbered the stack."  Compare
     {mung}, {scribble}, {trash}, and {smash the stack}.


In the contest of the ABI, it means registers that are call-clobbered
can be overwritten inside a function call. So the caller should not
assume the register have the same value after a function call as
before.

If you want to use a Call-preserved registers inside a function, you
need to save it, and restore the value before the function exits.

     Andrew

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


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