This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 18/26] arm: Use GET_TLS more often


---
	* sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_undefweak): Use GET_TLS,
	save LR in R1, and return directly from R1.
	(_dl_tlsdesc_dynamic): Use GET_TLS.
	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 
	(SINGLE_THREAD_P): Use GET_TLS.
---
 ports/sysdeps/arm/dl-tlsdesc.S                     | 23 +++++++---------------
 .../unix/sysv/linux/arm/nptl/sysdep-cancel.h       |  2 +-
 2 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/ports/sysdeps/arm/dl-tlsdesc.S b/ports/sysdeps/arm/dl-tlsdesc.S
index 6c47743..12214f1 100644
--- a/ports/sysdeps/arm/dl-tlsdesc.S
+++ b/ports/sysdeps/arm/dl-tlsdesc.S
@@ -44,22 +44,13 @@ _dl_tlsdesc_return:
 	.fnstart
 	.align 2
 _dl_tlsdesc_undefweak:
-	@ Are we allowed a misaligned stack pointer calling read_tp?
-	.save	{lr}
-	push	{lr}
-	cfi_adjust_cfa_offset (4)
-	cfi_rel_offset (lr,0)
-	bl 	__aeabi_read_tp
+	@ ??? The only GET_TLS implementation in tree is Linux,
+	@ which is guaranteed to clobber only R0 and LR.
+	mov	r1, lr
+	cfi_register (lr, r1)
+	GET_TLS
 	rsb 	r0, r0, #0
-#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
-	pop	{lr}
-	cfi_adjust_cfa_offset (-4)
-	cfi_restore (lr)
-	bx	lr
-#else
-	pop	{pc}
-#endif
-
+	BX	(r1)
 	cfi_endproc
 	.fnend
 	.size	_dl_tlsdesc_undefweak, .-_dl_tlsdesc_undefweak
@@ -104,7 +95,7 @@ _dl_tlsdesc_dynamic:
 	cfi_rel_offset (r4,8)
 	cfi_rel_offset (lr,12)
 	ldr	r1, [r0] /* td */
-	bl	__aeabi_read_tp
+	GET_TLS
 	mov	r4, r0 /* r4 = tp */
 	ldr	r0, [r0]
 	ldr	r2, [r1, #8] /* gen_count */
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index f0f7043..c2ab0ce 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -220,7 +220,7 @@ extern int __local_multiple_threads attribute_hidden;
 	push	{r0, lr};						\
 	cfi_adjust_cfa_offset (8);					\
 	cfi_rel_offset (lr, 4);						\
-	bl	__aeabi_read_tp;					\
+	GET_TLS;							\
 	NEGOFF_ADJ_BASE(r0, MULTIPLE_THREADS_OFFSET);			\
 	ldr	ip, NEGOFF_OFF1(r0, MULTIPLE_THREADS_OFFSET);		\
 	pop	{r0, lr};						\
-- 
1.8.1.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]