summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@FreeBSD.org>2025-05-28 20:23:10 +0000
committerJessica Clarke <jrtc27@FreeBSD.org>2025-12-15 16:58:45 +0000
commitd07b82ecbe64e29668b457019081846518c0e4b5 (patch)
tree9e8f7dee350cf3295bb9e2f5f184fbf8c04da058 /lib/libc
parentacf47e5d105ef05ea25b635672417a294a933e13 (diff)
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/riscv/static_tls.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/riscv/static_tls.h b/lib/libc/riscv/static_tls.h
index ce9fa23338a6..40e9abd685e3 100644
--- a/lib/libc/riscv/static_tls.h
+++ b/lib/libc/riscv/static_tls.h
@@ -31,12 +31,14 @@
#ifndef _LIBC_RISCV_STATIC_TLS_H
#define _LIBC_RISCV_STATIC_TLS_H
+#include <machine/tls.h>
+
static __inline uintptr_t
_libc_get_static_tls_base(size_t offset)
{
uintptr_t tlsbase;
- __asm __volatile("mv %0, tp" : "=r"(tlsbase));
+ tlsbase = (uintptr_t)_tcb_get();
tlsbase += offset;
return (tlsbase);
}