This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Question about compiling consideration(GNUPro, GCC for SPARC)? Thanks
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: Qiang Huang <jameshq at liverpool dot ac dot uk>
- Cc: Ecos-Discuss <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 7 Oct 2002 15:08:47 +0200
- Subject: Re: [ECOS] Question about compiling consideration(GNUPro, GCC for SPARC)? Thanks
- References: <BDEPKKELILOKGOAOMONOOEDICAAA.jameshq@liv.ac.uk>
> 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