The caller should allocate stack frames for argument area?
Michael Meissner
meissner@linux.vnet.ibm.com
Thu Oct 23 18:39:00 GMT 2008
On Thu, Oct 23, 2008 at 12:07:51PM +0800, Pan ruochen wrote:
> Page 3-15 says:
> (SYSTEM V APPLICATION BINARY INTERFACE, MIPS RISC Processor
> Supplement
> 3rd Edition)
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> function call argument area. In a non-leaf function the maximum number
> of bytes of arguments used to call other functions from the non-leaf func-
> tion must be allocated. However, at least four words (16 bytes) must al-
> ways be reserved, even if the maximum number of arguments to any
> called function is fewer than four words.
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
>
> Do these words mean the caller is responsible for allocating function call
> argument area on the run-time stack before calling the callee
> function? And within
> the callee function, the argument area is assumed ready and can be
> used directly?
Yes, that is what it means. I believe the intention is that varargs functions
can just store all of the arguments that are passed in registers in the place
reserved for them on the stack that would be contiguous with the arguments
passed on the stack, and the varargs pointer will just become a simple pointer.
Note, there are other ABIs on the MIPS that have different requirements.
--
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com
More information about the Gcc-help
mailing list