Skip to content

Commit 5aa317e

Browse files
authored
gh-112535: Add comment for ppc32/64 registers (gh-112746)
1 parent 2f20caf commit 5aa317e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Include/object.h

+2
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ _Py_ThreadId(void)
265265
#if defined(__clang__) && _Py__has_builtin(__builtin_thread_pointer)
266266
tid = (uintptr_t)__builtin_thread_pointer();
267267
#else
268+
// r13 is reserved for use as system thread ID by the Power 64-bit ABI.
268269
register uintptr_t tp __asm__ ("r13");
269270
__asm__("" : "=r" (tp));
270271
tid = tp;
@@ -273,6 +274,7 @@ _Py_ThreadId(void)
273274
#if defined(__clang__) && _Py__has_builtin(__builtin_thread_pointer)
274275
tid = (uintptr_t)__builtin_thread_pointer();
275276
#else
277+
// r2 is reserved for use as system thread ID by the Power 32-bit ABI.
276278
register uintptr_t tp __asm__ ("r2");
277279
__asm__ ("" : "=r" (tp));
278280
tid = tp;

0 commit comments

Comments
 (0)