[v3,5/9] aarch64: Use tpidr_el0 rather than __read_tp in librt

Message ID 1401046909-25821-6-git-send-email-rth@twiddle.net
State Committed
Headers

Commit Message

Richard Henderson May 25, 2014, 7:41 p.m. UTC
  From: Richard Henderson <rth@redhat.com>

---
 sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
  

Comments

Marcus Shawcroft May 29, 2014, 3:37 a.m. UTC | #1
On 25 May 2014 20:41, Richard Henderson <rth@twiddle.net> wrote:
> From: Richard Henderson <rth@redhat.com>
>
> ---
>  sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
> index fb37618..483d6fe 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
> +++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
> @@ -113,17 +113,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]


This looks ok. /Marcus
  

Patch

diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index fb37618..483d6fe 100644
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
@@ -113,17 +113,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