Skip to content

Commit

Permalink
add riscv __get_tls method
Browse files Browse the repository at this point in the history
  • Loading branch information
luxufan committed Nov 15, 2021
1 parent e27590d commit 2511f43
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler-rt/lib/sanitizer_common/sanitizer_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ inline void ReleaseMemoryPagesToOSAndZeroFill(uptr beg, uptr end) {
#elif defined(__x86_64__)
# define __get_tls() \
({ void** __v; __asm__("mov %%fs:0, %0" : "=r"(__v)); __v; })
#elif defined(__riscv)
# define __get_tls() \
({ void** __v; __asm__("mv %0, tp" : "=r"(__v)); __v; })
#else
#error "Unsupported architecture."
#endif
Expand Down

0 comments on commit 2511f43

Please sign in to comment.