From: Zhaobin Zhu <zzhu@emc.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Question regarding PowerPC routine compilation.
Date: Mon, 25 Sep 2000 16:33:14 -0400 [thread overview]
Message-ID: <39CFB68A.816F6737@emc.com> (raw)
In-Reply-To: 006d01bfc716$3017b050$4a1f76d8@washington
Hi,
This is a newbie question regarding (PowerPC) calling a C routine within a .S
file:
Let me take an example:
in arch/ppc/kernel/head.S,
...
mr r3,r31
mr r4,r30
mr r5,r29
mr r6,r28
mr r7,r27
bl identify_machine
...
The code calls rountine identify_machine(..) in setup.c.
Questions:
The identify_machine(..) in setup.c will certainly use some of the registers
(r0-r31).
Will the compiler protect the registers used in the routine (for example
push them into stack before entering the routine and pop them out
after exiting the routine ) ?
If yes, how the compiler does the protection ? Will it simply save all the
regs
into stack before entering routine and restore them after returning from the
routine (except R3 wiich may be used as a pointer to some returned value).
If compiler does no reg protection, then there is no gurantee that the
register set
will be the same before and after calling a C routine. It's the calling
code's
responsibility to make sure some important regs will not be altered after
return
from a C routine.
Thanks,
--
Zhaobin Zhu
zzhu@emc.com
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2000-09-25 20:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-09-25 19:23 NFS problem Navin Boppuri
2000-09-25 20:33 ` Zhaobin Zhu [this message]
2000-09-25 20:50 ` Question regarding PowerPC routine compilation Jerry Van Baren
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=39CFB68A.816F6737@emc.com \
--to=zzhu@emc.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
/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 NNTP newsgroup(s).