- COMMPAGE_DESCRIPTOR(pthread_getspecific_sprg3,_COMM_PAGE_PTHREAD_GETSPECIFIC,k64Bit,0,0)
+ COMMPAGE_DESCRIPTOR(pthread_getspecific_sprg3_32,_COMM_PAGE_PTHREAD_GETSPECIFIC,k64Bit,0,kCommPage32)
+
+
+// ***********************************************************
+// * P T H R E A D _ G E T S P E C I F I C _ S P R G 3 _ 6 4 *
+// ***********************************************************
+//
+// For processors with user-readable SPRG3, in 64-bit mode. This may not be used
+// because the 64-bit ABI uses r13 for the thread-local-data pointer. Called with:
+// r3 = word number
+// r4 = offset to thread specific data (_PTHREAD_TSD_OFFSET)
+
+pthread_getspecific_sprg3_64:
+ sldi r5,r3,3 // convert double-word# to byte offset
+ mfspr r3,USER_SPRG3 // get per-thread cookie
+ add r5,r5,r4 // add in offset to first word
+ ldx r3,r3,r5 // get the thread-specific doubleword
+ blr
+
+ COMMPAGE_DESCRIPTOR(pthread_getspecific_sprg3_64,_COMM_PAGE_PTHREAD_GETSPECIFIC,k64Bit,0,kCommPage64)