]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: morello: nptl: fix thread pointer setup
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 13 Jul 2022 11:15:16 +0000 (12:15 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 27 Oct 2022 13:46:52 +0000 (14:46 +0100)
sysdeps/aarch64/nptl/tls.h

index 8d62b31e23d53ff2789bb32a828eac2254434679..92eb5a3b51a6dc9056830829c75c5b8f82719a45 100644 (file)
@@ -71,8 +71,13 @@ typedef struct
 /* Code to initially initialize the thread pointer.  This might need
    special attention since 'errno' is not yet available and if the
    operation can cause a failure 'errno' must not be touched.  */
+# ifdef __CHERI_PURE_CAPABILITY__
+# define TLS_INIT_TP(tcbp) \
+  ({ __asm __volatile ("msr ctpidr_el0, %0" : : "r" (tcbp)); NULL; })
+# else
 # define TLS_INIT_TP(tcbp) \
   ({ __asm __volatile ("msr tpidr_el0, %0" : : "r" (tcbp)); NULL; })
+# endif
 
 /* Value passed to 'clone' for initialization of the thread register.  */
 # define TLS_DEFINE_INIT_TP(tp, pd) void *tp = (pd) + 1