]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/src/thread/i386/tls.s
WASI libc prototype implementation.
[wasi-libc.git] / libc-top-half / musl / src / thread / i386 / tls.s
1 .text
2 .global ___tls_get_addr
3 .type ___tls_get_addr,@function
4 ___tls_get_addr:
5 mov %gs:4,%edx
6 mov (%eax),%ecx
7 cmp %ecx,(%edx)
8 jc 1f
9 mov 4(%eax),%eax
10 add (%edx,%ecx,4),%eax
11 ret
12 1: push %eax
13 .weak __tls_get_new
14 .hidden __tls_get_new
15 call __tls_get_new
16 pop %edx
17 ret