diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 13:54:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 13:54:38 +0000 |
commit | 8c1ab65c0f548d20b7f177bdb736daaf603340e1 (patch) | |
tree | df55b7e75bf43f2bf500845b105afe3ac3a5157e /libc-top-half/musl/arch/arm/pthread_arch.h | |
parent | Initial commit. (diff) | |
download | wasi-libc-upstream/0.0_git20221206.8b7148f.tar.xz wasi-libc-upstream/0.0_git20221206.8b7148f.zip |
Adding upstream version 0.0~git20221206.8b7148f.upstream/0.0_git20221206.8b7148f
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-top-half/musl/arch/arm/pthread_arch.h')
-rw-r--r-- | libc-top-half/musl/arch/arm/pthread_arch.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libc-top-half/musl/arch/arm/pthread_arch.h b/libc-top-half/musl/arch/arm/pthread_arch.h new file mode 100644 index 0000000..157e2ea --- /dev/null +++ b/libc-top-half/musl/arch/arm/pthread_arch.h @@ -0,0 +1,32 @@ +#if ((__ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \ + || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7 + +static inline uintptr_t __get_tp() +{ + uintptr_t tp; + __asm__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(tp) ); + return tp; +} + +#else + +#if __ARM_ARCH_4__ || __ARM_ARCH_4T__ || __ARM_ARCH == 4 +#define BLX "mov lr,pc\n\tbx" +#else +#define BLX "blx" +#endif + +static inline uintptr_t __get_tp() +{ + extern hidden uintptr_t __a_gettp_ptr; + register uintptr_t tp __asm__("r0"); + __asm__ ( BLX " %1" : "=r"(tp) : "r"(__a_gettp_ptr) : "cc", "lr" ); + return tp; +} + +#endif + +#define TLS_ABOVE_TP +#define GAP_ABOVE_TP 8 + +#define MC_PC arm_pc |