Re: Kernel Calling Conventions
- From: "Sprunk, Stephen" <spamtrap@xxxxxxxxxx>
- Date: Thu, 23 Mar 2006 13:45:22 -0500
"Robert Redelmeier" <redelm@xxxxxxxxxxxxxxx> wrote in message
news:byrTf.61766$dW3.56969@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Kroll <spamtrap@xxxxxxxxxx> wrote in part:....
Greetings all, I was reading the "FreeBSD Assembly Language
Programming" tutorial (http://www.int80h.org/bsdasm/),
when I came across something that piqued my curiosity.
The C calling convention is touted as being more convenient, and
superior to the calling convention used by linux and microsoft
of passing arguments within registers. I was wondering if this
is just a bias on the part of the writer or what.
IMHO, "bias" is too mild a word :)
The main advantage of stack params is that many more
can be passed.
Typically, calling conventions are designed so that the first N
parameters
are passed in registers, and if the call exceeds that the remainder are
put
on the stack. N is typically around half the number of GPRs; x86 ABIs
set
N=0 in most cases since there are so few to spare.
IIRC, the AMD64 ABI has an interesting quirk that the call stack has
space
reserved for the register parameters so that the called code has an easy
place to spill them if needed.
S
--
Stephen Sprunk "Stupid people surround themselves with smart
CCIE #3723 people. Smart people surround themselves with
K5SSS smart people who disagree with them." --Aaron Sorkin
- Prev by Date: Re: ld dynamic linker x86-64 ?!
- Next by Date: Re: Kernel Calling Conventions
- Previous by thread: Re: Kernel Calling Conventions
- Next by thread: Re: Kernel Calling Conventions
- Index(es):
Relevant Pages
|