Skip to content

Commit fd5cde8

Browse files
committed
pythongh-112535: Update _Py_ThreadId() to support PowerPC
1 parent 939fc6d commit fd5cde8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Include/object.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ _Py_ThreadId(void)
261261
__asm__ ("mrs %0, tpidrro_el0" : "=r" (tid));
262262
#elif defined(__aarch64__)
263263
__asm__ ("mrs %0, tpidr_el0" : "=r" (tid));
264+
#elif defined(__powerpc64__)
265+
register uintptr_t thread_pointer __asm__ ("r13");
266+
tid = thread_pointer;
267+
#elif defined(__powerpc__)
268+
register uintptr_t thread_pointer __asm__ ("r2");
269+
tid = thread_pointer;
264270
#else
265271
# error "define _Py_ThreadId for this platform"
266272
#endif

0 commit comments

Comments
 (0)