OLD | NEW |
| (Empty) |
1 static inline struct pthread* __pthread_self() { | |
2 #ifdef __clang__ | |
3 char* tp; | |
4 __asm__ __volatile__("mr %0, 2" : "=r"(tp) : :); | |
5 #else | |
6 register char* tp __asm__("r2"); | |
7 __asm__ __volatile__("" : "=r"(tp)); | |
8 #endif | |
9 return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); | |
10 } | |
11 | |
12 #define TLS_ABOVE_TP | |
13 #define TP_ADJ(p) ((char*)(p) + sizeof(struct pthread) + 0x7000) | |
14 | |
15 #define DTP_OFFSET 0x8000 | |
16 | |
17 // the kernel calls the ip "nip", it's the first saved value after the 32 | |
18 // GPRs. | |
19 #define MC_PC gregs[32] | |
20 | |
21 #define CANARY canary_at_end | |
OLD | NEW |