|
Packit |
6c4009 |
/* Include sysdeps/powerpc/tls-macros.h for __TLS_CALL_CLOBBERS */
|
|
Packit |
6c4009 |
#include_next "tls-macros.h"
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* PowerPC32 Local Exec TLS access. */
|
|
Packit |
6c4009 |
#define TLS_LE(x) \
|
|
Packit |
6c4009 |
({ int *__result; \
|
|
Packit |
6c4009 |
asm ("addi %0,2," #x "@tprel" \
|
|
Packit |
6c4009 |
: "=r" (__result)); \
|
|
Packit |
6c4009 |
__result; })
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* PowerPC32 Initial Exec TLS access. */
|
|
Packit |
6c4009 |
#define TLS_IE(x) \
|
|
Packit |
6c4009 |
({ int *__result; \
|
|
Packit |
6c4009 |
asm ("bcl 20,31,1f\n1:\t" \
|
|
Packit |
6c4009 |
"mflr %0\n\t" \
|
|
Packit |
6c4009 |
"addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
|
|
Packit |
6c4009 |
"addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
|
|
Packit |
6c4009 |
"lwz %0," #x "@got@tprel(%0)\n\t" \
|
|
Packit |
6c4009 |
"add %0,%0," #x "@tls" \
|
|
Packit |
6c4009 |
: "=b" (__result) : \
|
|
Packit |
6c4009 |
: "lr"); \
|
|
Packit |
6c4009 |
__result; })
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* PowerPC32 Local Dynamic TLS access. */
|
|
Packit |
6c4009 |
#define TLS_LD(x) \
|
|
Packit |
6c4009 |
({ int *__result; \
|
|
Packit |
6c4009 |
asm ("bcl 20,31,1f\n1:\t" \
|
|
Packit |
6c4009 |
"mflr 3\n\t" \
|
|
Packit |
6c4009 |
"addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
|
|
Packit |
6c4009 |
"addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
|
|
Packit |
6c4009 |
"addi 3,3," #x "@got@tlsld\n\t" \
|
|
Packit |
6c4009 |
"bl __tls_get_addr@plt\n\t" \
|
|
Packit |
6c4009 |
"addi %0,3," #x "@dtprel" \
|
|
Packit |
6c4009 |
: "=r" (__result) : \
|
|
Packit |
6c4009 |
: "3", __TLS_CALL_CLOBBERS); \
|
|
Packit |
6c4009 |
__result; })
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* PowerPC32 General Dynamic TLS access. */
|
|
Packit |
6c4009 |
#define TLS_GD(x) \
|
|
Packit |
6c4009 |
({ register int *__result __asm__ ("r3"); \
|
|
Packit |
6c4009 |
asm ("bcl 20,31,1f\n1:\t" \
|
|
Packit |
6c4009 |
"mflr 3\n\t" \
|
|
Packit |
6c4009 |
"addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
|
|
Packit |
6c4009 |
"addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
|
|
Packit |
6c4009 |
"addi 3,3," #x "@got@tlsgd\n\t" \
|
|
Packit |
6c4009 |
"bl __tls_get_addr@plt" \
|
|
Packit |
6c4009 |
: "=r" (__result) : \
|
|
Packit |
6c4009 |
: __TLS_CALL_CLOBBERS); \
|
|
Packit |
6c4009 |
__result; })
|