One register up to maintain the original order. For improved efficiency, we try not to shift all parameters The ABI and Xtensa software conventions require the system-call number in a2. Linux takes system-call arguments in registers. Return addr stack ptr arg0, arg1, arg2, arg3, arg4, arg5 The return values are stored in a2 through a5 (so a function with return value occupying more than 2 registers may not be called with call12). Large arguments (8-bytes) are always passed in an even/odd register pair even if that means to omit a register for alignment. Therefore, the first argument in case of a call4 instruction is placed into a6, and for a call8 instruction into a10. Depending on the call instruction and, thus, the rotation of the register window, the arguments are passed starting starting with register a(2+N), where N is the size of the window rotation. Because Xtensa uses register windows that rotate during a function call, outgoing arguments that will become the incoming arguments must be stored to different register numbers. The first six incoming arguments are stored in registers a2 through a7, and additional arguments are stored on the stack starting at the current stack pointer a1. Arguments are passed in both registers and memory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |