tls-macros-arc.h 877 B

12345678910111213141516171819202122232425262728
  1. /* For now */
  2. #define TLS_LD(x) TLS_IE(x)
  3. #define TLS_GD(x) \
  4. ({ int *__result; \
  5. __asm__ ("add r0, pcl, @" #x "@tlsgd \n" \
  6. ".tls_gd_ld " #x "`bl __tls_get_addr@plt \n" \
  7. "mov %0, r0 \n" \
  8. : "=&r" (__result) \
  9. ::"r0","r1","r2","r3","r4","r5","r6","r7", \
  10. "r8","r9","r10","r11","r12"); \
  11. __result; })
  12. #define TLS_LE(x) \
  13. ({ int *__result; \
  14. void *tp = __builtin_thread_pointer(); \
  15. __asm__ ("add %0, %1, @" #x "@tpoff \n" \
  16. : "=r" (__result) : "r"(tp)); \
  17. __result; })
  18. #define TLS_IE(x) \
  19. ({ int *__result; \
  20. void *tp = __builtin_thread_pointer(); \
  21. __asm__ ("ld %0, [pcl, @" #x "@tlsie] \n" \
  22. "add %0, %1, %0 \n" \
  23. : "=&r" (__result) : "r" (tp)); \
  24. __result; })