From: Szabolcs Nagy Date: Wed, 13 Jul 2022 11:15:16 +0000 (+0100) Subject: aarch64: morello: nptl: fix thread pointer setup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01faa1bcd44274b672ab75f13fd7282c9ce9656d;p=thirdparty%2Fglibc.git aarch64: morello: nptl: fix thread pointer setup --- diff --git a/sysdeps/aarch64/nptl/tls.h b/sysdeps/aarch64/nptl/tls.h index 8d62b31e23d..92eb5a3b51a 100644 --- a/sysdeps/aarch64/nptl/tls.h +++ b/sysdeps/aarch64/nptl/tls.h @@ -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