mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-01 07:58:31 +00:00
Use the compiler builtin for the ARM thread id.
The mrc to c13/c0/3 (thread id register) is undefined on ARMv5 (e.g. ARM926EJ-S) and SIGILL'd during init. __builtin_thread_pointer lowers to the same mrc on targets with a thread pointer register and to __aeabi_read_tp on soft-TLS targets.
This commit is contained in:
@@ -743,7 +743,7 @@ get_thread_id(void) {
|
||||
__asm__("movq %%fs:0, %0" : "=r" (tid) : : );
|
||||
# endif
|
||||
# elif defined(__arm__)
|
||||
__asm__ volatile ("mrc p15, 0, %0, c13, c0, 3" : "=r" (tid));
|
||||
tid = (uintptr_t)__builtin_thread_pointer();
|
||||
# elif defined(__aarch64__)
|
||||
# if defined(__MACH__)
|
||||
// tpidr_el0 likely unused, always return 0 on iOS
|
||||
|
||||
Reference in New Issue
Block a user