Fix __errno for LP64 and clean up __get_tls.

If __get_tls has the right type, a lot of confusing casting can disappear.

It was probably a mistake that __get_tls was exposed as a function for mips
and x86 (but not arm), so let's (a) ensure that the __get_tls function
always matches the macro, (b) that we have the function for arm too, and
(c) that we don't have the function for any 64-bit architecture.

Change-Id: Ie9cb989b66e2006524ad7733eb6e1a65055463be
This commit is contained in:
Elliott Hughes
2013-10-08 18:50:24 -07:00
parent 777a4ee677
commit 2a0b873065
14 changed files with 56 additions and 104 deletions

View File

@@ -64,6 +64,5 @@ __LIBC_ABI_PRIVATE__ void _pthread_internal_add(pthread_internal_t* thread) {
}
__LIBC_ABI_PRIVATE__ pthread_internal_t* __get_thread(void) {
void** tls = reinterpret_cast<void**>(const_cast<void*>(__get_tls()));
return reinterpret_cast<pthread_internal_t*>(tls[TLS_SLOT_THREAD_ID]);
return reinterpret_cast<pthread_internal_t*>(__get_tls()[TLS_SLOT_THREAD_ID]);
}