summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/soft-fp
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-11-19 13:39:56 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-11-19 13:39:56 +0000
commit73c1ce4fdbdf117b4d91b6e894686228155bd702 (patch)
treea996f6b56852c7fc2a39dec8d5a41456365990cf /sysdeps/powerpc/soft-fp
parentb5449b12962da665c29f0a1c85f705de4bc4abf2 (diff)
downloadglibc-73c1ce4fdbdf117b4d91b6e894686228155bd702.tar.gz
Make powerpc-nofpu floating-point state thread-local (bug 15483).
Diffstat (limited to 'sysdeps/powerpc/soft-fp')
-rw-r--r--sysdeps/powerpc/soft-fp/sfp-machine.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/sysdeps/powerpc/soft-fp/sfp-machine.h b/sysdeps/powerpc/soft-fp/sfp-machine.h
index 0411878071..35a38b0031 100644
--- a/sysdeps/powerpc/soft-fp/sfp-machine.h
+++ b/sysdeps/powerpc/soft-fp/sfp-machine.h
@@ -95,21 +95,18 @@ libc_hidden_proto (__feraiseexcept_soft)
# define FP_EX_INEXACT (1 << (31 - 6))
# define FP_HANDLE_EXCEPTIONS __simulate_exceptions (_fex)
-# define FP_ROUNDMODE __sim_round_mode
-# define FP_TRAPPING_EXCEPTIONS (~__sim_disabled_exceptions & 0x3e000000)
+# define FP_ROUNDMODE __sim_round_mode_thread
+# define FP_TRAPPING_EXCEPTIONS \
+ (~__sim_disabled_exceptions_thread & 0x3e000000)
#endif
-/* FIXME: these variables should be thread specific (see bugzilla bug
- 15483) and ideally preserved across signal handlers, like hardware
- FP status words, but the latter is quite difficult to accomplish in
- userland. */
-
-extern int __sim_exceptions;
-libc_hidden_proto (__sim_exceptions);
-extern int __sim_disabled_exceptions;
-libc_hidden_proto (__sim_disabled_exceptions);
-extern int __sim_round_mode;
-libc_hidden_proto (__sim_round_mode);
+extern __thread int __sim_exceptions_thread attribute_tls_model_ie;
+libc_hidden_tls_proto (__sim_exceptions_thread, tls_model ("initial-exec"));
+extern __thread int __sim_disabled_exceptions_thread attribute_tls_model_ie;
+libc_hidden_tls_proto (__sim_disabled_exceptions_thread,
+ tls_model ("initial-exec"));
+extern __thread int __sim_round_mode_thread attribute_tls_model_ie;
+libc_hidden_tls_proto (__sim_round_mode_thread, tls_model ("initial-exec"));
extern void __simulate_exceptions (int x) attribute_hidden;