- #SNAPGENE VIEWER ABI REFERENCE SEQUENCE SOFTWARE#
- #SNAPGENE VIEWER ABI REFERENCE SEQUENCE CODE#
- #SNAPGENE VIEWER ABI REFERENCE SEQUENCE PLUS#
- #SNAPGENE VIEWER ABI REFERENCE SEQUENCE WINDOWS#
The callx8.tls assembler macro generates a callx8 instruction with an extra relocation specified by its second operand. Movi a8, a10, a8, relies on the assembler to relax the movi instructions to l32r instructions, so that both the literals and the instructions get the appropriate relocations. The assembly syntax for this instruction sequence is: The details of this are presumably similar to other processors and are not yet specified for Xtensa. The runtime linker can initialize the TLS function pointer in the GOT to a resolver function. This approach allows lazy relocation processing for TLS references, which should improve the start-up times. This tls_index structure is dynamically allocated in a hash table by the runtime linker. Otherwise, the function is set to _tls_get_addr and the argument is a pointer to the tls_index structure holding the offset and module values.
#SNAPGENE VIEWER ABI REFERENCE SEQUENCE PLUS#
If the thread-local symbol is in the static TLS, the runtime linker will set the argument to the TLS offset and the function to a short routine that returns the offset plus the thread pointer.
#SNAPGENE VIEWER ABI REFERENCE SEQUENCE CODE#
The Initial Exec and Local Exec models are the same as with the standard approach and are not shown here.įor the general dynamic model, the code sequence loads a function pointer and a single argument from the GOT and calls the function with that argument. (This is actually the same prototype for _tls_get_addr that is used for most processors with the standard approach.) The _tls_get_addr function has a different prototype with this approach:Įxtern void *_tls_get_addr (tls_index *ti) Although it would be convenient to share some of the platform-independent code, it is not required and will work regardless of whether those patches are ever accepted. As a new port, however, Xtensa can uses this optimized implementation without affecting legacy software. The current status of this alternative approach is somewhat ambiguous: it has been accepted into GCC and Binutils but the glibc patches have not made it into the mainline tree, yet. See also Oliva's implementation details for X86 and ARM. Alex Oliva later developed an alternative and heavily optimized version for a Linux port to the FR-V processor and subsequently ported it to x86, x86_64, and ARM Linux systems. "ELF Handling for Thread-Local Storage" provides background information and descriptions of the machine-independent aspects. Originally developed by Sun, the implementation concept for TLS has been modified and generalized by Ulrich Drepper for Linux for a variety of platforms. This is a description of the Xtensa-specific aspects of supporting thread-local storage (TLS).
![snapgene viewer abi reference sequence snapgene viewer abi reference sequence](https://cdn.snapgene.com/assets/12.7.3/assets/images/snapgene/features/features-image-6.png)
Upon return, a2 contains the return value or error code. Syscall number arg0, arg1, arg2, arg3, arg4, arg5 Register a2 is, therefore, moved to a6, a6 to a8, and a7 to a9, if the system call requires these arguments. One register up to maintain the original order. For improved efficiency, we try not to shift all parameters
![snapgene viewer abi reference sequence snapgene viewer abi reference sequence](https://cdn.snapgene.com/assets/12.7.3/assets/images/snapgene/homepage/homepage-hero-1.png)
#SNAPGENE VIEWER ABI REFERENCE SEQUENCE SOFTWARE#
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.
#SNAPGENE VIEWER ABI REFERENCE SEQUENCE WINDOWS#
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.
![snapgene viewer abi reference sequence snapgene viewer abi reference sequence](https://www.snapgene.com/wordpress/wp-content/uploads/2020/10/MTR-SQ.png)
Arguments are passed in both registers and memory.