diff options
author | Roger A. Faulkner <Roger.Faulkner@Sun.COM> | 2009-09-23 17:01:56 -0700 |
---|---|---|
committer | Roger A. Faulkner <Roger.Faulkner@Sun.COM> | 2009-09-23 17:01:56 -0700 |
commit | 35e6f27ad0d19ae8ac48ddcbccbe1af717832f29 (patch) | |
tree | 7b4358ff35039f841475879305ea18a2b827fc88 /usr/src/lib/libc/port/threads/thr.c | |
parent | 1caae4fbfd50fd4b25e58671b37fd9a0ee43d46a (diff) | |
download | illumos-gate-35e6f27ad0d19ae8ac48ddcbccbe1af717832f29.tar.gz |
6883880 non-8-byte-aligned mutexes: update needed for solaris_nevada
Diffstat (limited to 'usr/src/lib/libc/port/threads/thr.c')
-rw-r--r-- | usr/src/lib/libc/port/threads/thr.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/usr/src/lib/libc/port/threads/thr.c b/usr/src/lib/libc/port/threads/thr.c index bfad10c06a..5cfcb2daef 100644 --- a/usr/src/lib/libc/port/threads/thr.c +++ b/usr/src/lib/libc/port/threads/thr.c @@ -1434,6 +1434,26 @@ libc_init(void) self->ul_adaptive_spin = thread_adaptive_spin; self->ul_queue_spin = thread_queue_spin; +#if defined(__sparc) && !defined(_LP64) + if (self->ul_misaligned) { + /* + * Tell the kernel to fix up ldx/stx instructions that + * refer to non-8-byte aligned data instead of giving + * the process an alignment trap and generating SIGBUS. + * + * Programs compiled for 32-bit sparc with the Studio SS12 + * compiler get this done for them automatically (in _init()). + * We do it here for the benefit of programs compiled with + * other compilers, like gcc. + * + * This is necessary for the _THREAD_LOCKS_MISALIGNED=1 + * environment variable horrible hack to work. + */ + extern void _do_fix_align(void); + _do_fix_align(); + } +#endif + /* * When we have initialized the primary link map, inform * the dynamic linker about our interface functions. |