diff options
author | midipix <writeonce@midipix.org> | 2016-09-16 23:01:35 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-09-16 23:01:35 -0400 |
commit | b511dbe488cc7faffe6300812c10af7d7293d9a0 (patch) | |
tree | 1271d882ed07935fc5bd35993bd439ebefb54d1f | |
parent | 13724e65ab6ca7132e138e4a8d39ec927efa0177 (diff) | |
download | mmglue-b511dbe488cc7faffe6300812c10af7d7293d9a0.tar.bz2 mmglue-b511dbe488cc7faffe6300812c10af7d7293d9a0.tar.xz |
__emutls_get_address(): unify cases, fix dsoidx-based pointer arithmetic.
-rw-r--r-- | arch/nt32/src/crt_tls.c | 6 | ||||
-rw-r--r-- | arch/nt64/src/crt_tls.c | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/arch/nt32/src/crt_tls.c b/arch/nt32/src/crt_tls.c index 15183d3..a3375d8 100644 --- a/arch/nt32/src/crt_tls.c +++ b/arch/nt32/src/crt_tls.c @@ -18,10 +18,6 @@ void * __emutls_get_address (struct __emutls_object * obj) { int dsoidx = obj->align & 0xFFFF0000; struct __tlca * tlca = (struct __tlca *)__psx_tlca(); - - if (dsoidx) - return (*tlca->pthread_dtls)[dsoidx >> 16] + obj->offset; - else - return tlca->pthread_tls + obj->offset; + return tlca->pthread_dtls[dsoidx >> 16] + obj->offset; } diff --git a/arch/nt64/src/crt_tls.c b/arch/nt64/src/crt_tls.c index 15183d3..a3375d8 100644 --- a/arch/nt64/src/crt_tls.c +++ b/arch/nt64/src/crt_tls.c @@ -18,10 +18,6 @@ void * __emutls_get_address (struct __emutls_object * obj) { int dsoidx = obj->align & 0xFFFF0000; struct __tlca * tlca = (struct __tlca *)__psx_tlca(); - - if (dsoidx) - return (*tlca->pthread_dtls)[dsoidx >> 16] + obj->offset; - else - return tlca->pthread_tls + obj->offset; + return tlca->pthread_dtls[dsoidx >> 16] + obj->offset; } |