Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: fusl/src/ldso/x86_64/tlsdesc.s

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/ldso/x86_64/dlsym.s ('k') | fusl/src/legacy/cuserid.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/ldso/x86_64/tlsdesc.s
diff --git a/fusl/src/ldso/x86_64/tlsdesc.s b/fusl/src/ldso/x86_64/tlsdesc.s
new file mode 100644
index 0000000000000000000000000000000000000000..8238c3ebf4d6ecb44b92573133e36cfa882ea383
--- /dev/null
+++ b/fusl/src/ldso/x86_64/tlsdesc.s
@@ -0,0 +1,44 @@
+.text
+.global __tlsdesc_static
+.hidden __tlsdesc_static
+.type __tlsdesc_static,@function
+__tlsdesc_static:
+ mov 8(%rax),%rax
+ ret
+
+.hidden __tls_get_new
+
+.global __tlsdesc_dynamic
+.hidden __tlsdesc_dynamic
+.type __tlsdesc_dynamic,@function
+__tlsdesc_dynamic:
+ mov 8(%rax),%rax
+ push %rdx
+ mov %fs:8,%rdx
+ push %rcx
+ mov (%rax),%rcx
+ cmp %rcx,(%rdx)
+ jc 1f
+ mov 8(%rax),%rax
+ add (%rdx,%rcx,8),%rax
+2: pop %rcx
+ sub %fs:0,%rax
+ pop %rdx
+ ret
+1: push %rdi
+ push %rdi
+ push %rsi
+ push %r8
+ push %r9
+ push %r10
+ push %r11
+ mov %rax,%rdi
+ call __tls_get_new
+ pop %r11
+ pop %r10
+ pop %r9
+ pop %r8
+ pop %rsi
+ pop %rdi
+ pop %rdi
+ jmp 2b
« no previous file with comments | « fusl/src/ldso/x86_64/dlsym.s ('k') | fusl/src/legacy/cuserid.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698