-static inline struct pthread *__pthread_self()
+static inline uintptr_t __get_tp()
{
- struct pthread *self;
- __asm__ ("movq %%fs:0,%0" : "=r" (self) );
- return self;
+ uintptr_t tp;
+ __asm__ ("mov %%fs:0,%0" : "=r" (tp) );
+ return tp;
}
-#define PC_AT_SYS(c) \
- (*(uint16_t *)(((ucontext_t *)(c))->uc_mcontext.__gregs[16])==0x050f)
+#define MC_PC gregs[REG_RIP]