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

Unified Diff: fusl/src/ldso/i386/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/i386/dlsym.s ('k') | fusl/src/ldso/microblaze/dlsym.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/ldso/i386/tlsdesc.s
diff --git a/fusl/src/ldso/i386/tlsdesc.s b/fusl/src/ldso/i386/tlsdesc.s
new file mode 100644
index 0000000000000000000000000000000000000000..4a553bce11ee1457d284a00cf7ecdf3a40dc6bba
--- /dev/null
+++ b/fusl/src/ldso/i386/tlsdesc.s
@@ -0,0 +1,31 @@
+.text
+.global __tlsdesc_static
+.hidden __tlsdesc_static
+.type __tlsdesc_static,@function
+__tlsdesc_static:
+ mov 4(%eax),%eax
+ ret
+
+.hidden __tls_get_new
+
+.global __tlsdesc_dynamic
+.hidden __tlsdesc_dynamic
+.type __tlsdesc_dynamic,@function
+__tlsdesc_dynamic:
+ mov 4(%eax),%eax
+ push %edx
+ mov %gs:4,%edx
+ push %ecx
+ mov (%eax),%ecx
+ cmp %ecx,(%edx)
+ jc 1f
+ mov 4(%eax),%eax
+ add (%edx,%ecx,4),%eax
+2: pop %ecx
+ sub %gs:0,%eax
+ pop %edx
+ ret
+1: push %eax
+ call __tls_get_new
+ pop %ecx
+ jmp 2b
« no previous file with comments | « fusl/src/ldso/i386/dlsym.s ('k') | fusl/src/ldso/microblaze/dlsym.s » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698