1
0

pthread_arch.h 572 B

12345678910111213141516171819202122
  1. #if ((__ARM_ARCH_6K__ || __ARM_ARCH_6ZK__) && !__thumb__) \
  2. || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
  3. static inline __attribute__((const)) pthread_t __pthread_self()
  4. {
  5. char *p;
  6. __asm__( "mrc p15,0,%0,c13,c0,3" : "=r"(p) );
  7. return (void *)(p+8-sizeof(struct pthread));
  8. }
  9. #else
  10. typedef char *(*__ptr_func_t)(void) __attribute__((const));
  11. #define __pthread_self() \
  12. ((pthread_t)(((__ptr_func_t)0xffff0fe0)()+8-sizeof(struct pthread)))
  13. #endif
  14. #define TLS_ABOVE_TP
  15. #define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) - 8)
  16. #define CANCEL_REG_IP 18