[5/6] aarch64: Use tpidr_el0 rather than __read_tp in librt
diff mbox

Message ID 1400619378-7262-6-git-send-email-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson May 20, 2014, 8:56 p.m. UTC
From: Richard Henderson <rth@redhat.com>

	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
	[!IS_IN_libpthread && NOT_IN_libc] (SINGLE_THREAD_P):
	Use tpidr_el0 rather than __read_tp.
---
 sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

Patch
diff mbox

diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index 5cf3fd5..3578650 100644
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
@@ -108,8 +108,8 @@  extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  else
 #   define SINGLE_THREAD_P(R)						\
-  adrp	x##R, __local_multiple_threads;					\
-  ldr	w##R, [x##R, #:lo12:__local_multiple_threads]
+	adrp	x##R, __local_multiple_threads;				\
+	ldr	w##R, [x##R, :lo12:__local_multiple_threads]
 #  endif
 # else
 /*  There is no __local_multiple_threads for librt, so use the TCB.  */
@@ -119,17 +119,9 @@  extern int __local_multiple_threads attribute_hidden;
 				   header.multiple_threads) == 0, 1)
 #  else
 #   define SINGLE_THREAD_P(R)						\
-  stp	x0, x30, [sp, -16]!;						\
-  cfi_adjust_cfa_offset (16);						\
-  cfi_rel_offset (x0, 0);						\
-  cfi_rel_offset (x30, 8);						\
-  bl	__read_tp;							\
-  sub	x0, x0, PTHREAD_SIZEOF;						\
-  ldr	w##R, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET];			\
-  ldp	x0, x30, [sp], 16;						\
-  cfi_restore (x0);							\
-  cfi_restore (x30);							\
-  cfi_adjust_cfa_offset (-16)
+	mrs     x##R, tpidr_el0;					\
+	sub	x##R, x##R, PTHREAD_SIZEOF;				\
+	ldr	w##R, [x##R, PTHREAD_MULTIPLE_THREADS_OFFSET]
 #  endif
 # endif