1static inline struct pthread *__pthread_self()
2{
3#ifdef __clang__
4	char *tp;
5	__asm__ __volatile__ ("or %0, t1, x0" : "=r" (tp) );
6#else
7	register char *tp __asm__("t1");
8#endif
9	return (struct pthread *) (tp - sizeof(struct pthread));
10}
11
12#define TLS_ABOVE_TP
13#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
14
15/* word-offset to 'pc' in mcontext_t */
16#define CANCEL_REG_IP 32
17
18#define MC_PC regs.pc
19