1
0

pthread_arch.h 654 B

1234567891011121314151617181920212223242526272829303132
  1. #if ((__ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \
  2. || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
  3. static inline uintptr_t __get_tp()
  4. {
  5. uintptr_t tp;
  6. __asm__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(tp) );
  7. return tp;
  8. }
  9. #else
  10. #if __ARM_ARCH_4__ || __ARM_ARCH_4T__ || __ARM_ARCH == 4
  11. #define BLX "mov lr,pc\n\tbx"
  12. #else
  13. #define BLX "blx"
  14. #endif
  15. static inline uintptr_t __get_tp()
  16. {
  17. extern hidden uintptr_t __a_gettp_ptr;
  18. register uintptr_t tp __asm__("r0");
  19. __asm__ ( BLX " %1" : "=r"(tp) : "r"(__a_gettp_ptr) : "cc", "lr" );
  20. return tp;
  21. }
  22. #endif
  23. #define TLS_ABOVE_TP
  24. #define GAP_ABOVE_TP 8
  25. #define MC_PC arm_pc