2016-04-18 05:19:13 +00:00
|
|
|
static inline struct pthread *__pthread_self()
|
|
|
|
{
|
|
|
|
#if __mips_isa_rev < 2
|
|
|
|
register char *tp __asm__("$3");
|
2018-10-16 18:08:01 +00:00
|
|
|
__asm__ (".word 0x7c03e83b" : "=r" (tp) );
|
2016-04-18 05:19:13 +00:00
|
|
|
#else
|
|
|
|
char *tp;
|
2018-10-16 18:08:01 +00:00
|
|
|
__asm__ ("rdhwr %0, $29" : "=r" (tp) );
|
2016-04-18 05:19:13 +00:00
|
|
|
#endif
|
|
|
|
return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TLS_ABOVE_TP
|
2018-06-01 23:52:01 +00:00
|
|
|
#define GAP_ABOVE_TP 0
|
2016-04-18 05:19:13 +00:00
|
|
|
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
|
|
|
|
|
|
|
|
#define DTP_OFFSET 0x8000
|
|
|
|
|
|
|
|
#define MC_PC pc
|