pthread_arch.h 323 B

12345678910111213
  1. static inline struct pthread *__pthread_self()
  2. {
  3. uintptr_t tp = __syscall(SYS_get_thread_area);
  4. return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
  5. }
  6. #define TLS_ABOVE_TP
  7. #define GAP_ABOVE_TP 0
  8. #define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
  9. #define DTP_OFFSET 0x8000
  10. #define MC_PC gregs[R_PC]