summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/riscv64/dl-tls.h
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2024-03-17 18:01:24 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2024-03-19 14:50:57 +0100
commitae11f049fc55c63a79b95ce0de69a1aee0d53faf (patch)
tree81cadde791e058896cb87e996c215dc469916b83 /libpthread/nptl/sysdeps/riscv64/dl-tls.h
parent9e7b342fde5505c0a1d4968e9d70537ac406f640 (diff)
riscv64: sync with glibc, fix all TLS errors in uClibc-ng-test
Diffstat (limited to 'libpthread/nptl/sysdeps/riscv64/dl-tls.h')
-rw-r--r--libpthread/nptl/sysdeps/riscv64/dl-tls.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libpthread/nptl/sysdeps/riscv64/dl-tls.h b/libpthread/nptl/sysdeps/riscv64/dl-tls.h
index 01663edf3..31991be0d 100644
--- a/libpthread/nptl/sysdeps/riscv64/dl-tls.h
+++ b/libpthread/nptl/sysdeps/riscv64/dl-tls.h
@@ -21,4 +21,14 @@ typedef struct
unsigned long int ti_offset;
} tls_index;
+/* The thread pointer points to the first static TLS block. */
+#define TLS_TP_OFFSET 0
+
+/* Dynamic thread vector pointers point 0x800 past the start of each
+ TLS block. */
+#define TLS_DTV_OFFSET 0x800
+
extern void *__tls_get_addr (tls_index *ti);
+
+#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
+#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)