about summary refs log tree commit diff
path: root/sysdeps/powerpc/nofpu/soft-supp.h
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/nofpu/soft-supp.h
parentb5449b12962da665c29f0a1c85f705de4bc4abf2 (diff)
downloadglibc-73c1ce4fdbdf117b4d91b6e894686228155bd702.tar.gz
glibc-73c1ce4fdbdf117b4d91b6e894686228155bd702.tar.xz
glibc-73c1ce4fdbdf117b4d91b6e894686228155bd702.zip
Make powerpc-nofpu floating-point state thread-local (bug 15483).
Diffstat (limited to 'sysdeps/powerpc/nofpu/soft-supp.h')
-rw-r--r--sysdeps/powerpc/nofpu/soft-supp.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/sysdeps/powerpc/nofpu/soft-supp.h b/sysdeps/powerpc/nofpu/soft-supp.h
index 18b4550e3b..0a0614aa6a 100644
--- a/sysdeps/powerpc/nofpu/soft-supp.h
+++ b/sysdeps/powerpc/nofpu/soft-supp.h
@@ -33,16 +33,31 @@ typedef union
 
 #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"));
+
+/* These variables were formerly global, so there are compat symbols
+   for global versions as well.  */
+
+#include <shlib-compat.h>
+#define SIM_GLOBAL_COMPAT SHLIB_COMPAT (libc, GLIBC_2_3_2, GLIBC_2_19)
+#if SIM_GLOBAL_COMPAT
+extern int __sim_exceptions_global;
+libc_hidden_proto (__sim_exceptions_global);
+extern int __sim_disabled_exceptions_global ;
+libc_hidden_proto (__sim_disabled_exceptions_global);
+extern int __sim_round_mode_global;
+libc_hidden_proto (__sim_round_mode_global);
+# define SIM_COMPAT_SYMBOL(GLOBAL_NAME, NAME) \
+  compat_symbol (libc, GLOBAL_NAME, NAME, GLIBC_2_3_2)
+# define SIM_SET_GLOBAL(GLOBAL_VAR, THREAD_VAR) ((GLOBAL_VAR) = (THREAD_VAR))
+#else
+# define SIM_SET_GLOBAL(GLOBAL_VAR, THREAD_VAR) ((void) 0)
+#endif
 
 extern void __simulate_exceptions (int x) attribute_hidden;