Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
glibc/ports/sysdeps/alpha/tls-macros.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25 lines (20 sloc)
819 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Macros to support TLS testing in times of missing compiler support. */ | |
extern void *__tls_get_addr (void *); | |
# define TLS_GD(x) \ | |
({ void *__result; \ | |
asm ("lda %0, " #x "($gp) !tlsgd" : "=r" (__result)); \ | |
__tls_get_addr (__result); }) | |
# define TLS_LD(x) \ | |
({ void *__result; \ | |
asm ("lda %0, " #x "($gp) !tlsldm" : "=r" (__result)); \ | |
__result = __tls_get_addr (__result); \ | |
asm ("lda %0, " #x "(%0) !dtprel" : "+r" (__result)); \ | |
__result; }) | |
# define TLS_IE(x) \ | |
({ long ofs; \ | |
asm ("ldq %0, " #x "($gp) !gottprel" : "=r"(ofs)); \ | |
__builtin_thread_pointer () + ofs; }) | |
# define TLS_LE(x) \ | |
({ void *__result = __builtin_thread_pointer (); \ | |
asm ("lda %0, " #x "(%0) !tprel" : "+r" (__result)); \ | |
__result; }) |