File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,22 @@ _Py_ThreadId(void)
261
261
__asm__ ("mrs %0, tpidrro_el0" : "=r" (tid ));
262
262
#elif defined(__aarch64__ )
263
263
__asm__ ("mrs %0, tpidr_el0" : "=r" (tid ));
264
+ #elif defined(__powerpc64__ )
265
+ #if defined(__clang__ ) && _Py__has_builtin (__builtin_thread_pointer )
266
+ tid = (uintptr_t )__builtin_thread_pointer ();
267
+ #else
268
+ register uintptr_t tp __asm__ ("r13" );
269
+ __asm__("" : "=r" (tp ));
270
+ tid = tp ;
271
+ #endif
272
+ #elif defined(__powerpc__ )
273
+ #if defined(__clang__ ) && _Py__has_builtin (__builtin_thread_pointer )
274
+ tid = (uintptr_t )__builtin_thread_pointer ();
275
+ #else
276
+ register uintptr_t tp __asm__ ("r2" );
277
+ __asm__ ("" : "=r" (tp ));
278
+ tid = tp ;
279
+ #endif
264
280
#else
265
281
# error "define _Py_ThreadId for this platform"
266
282
#endif
You can’t perform that action at this time.
0 commit comments