summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2011-06-21 17:51:40 -0700
committerRichard Lowe <richlowe@richlowe.net>2011-07-02 22:17:16 -0400
commit906a285718609002bb270fe81f8b37d8db2dcbe0 (patch)
treedf448781d9aab942628acec555da763825550bc3
parentc61bc1fbd55cd1affdf956f9607c89db75cc6cf1 (diff)
downloadillumos-joyent-906a285718609002bb270fe81f8b37d8db2dcbe0.tar.gz
libc: Mark %g7 as #scratch in _curthread, and implement directly
We do this because GCC 4.4 will spit out a .register declaration for %g7 which differs from those in __curthread if we do not.
-rw-r--r--usr/src/lib/libc/inc/thr_inlines.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/lib/libc/inc/thr_inlines.h b/usr/src/lib/libc/inc/thr_inlines.h
index 57eb3523f0..7376109aa5 100644
--- a/usr/src/lib/libc/inc/thr_inlines.h
+++ b/usr/src/lib/libc/inc/thr_inlines.h
@@ -36,17 +36,19 @@
extern __GNU_INLINE ulwp_t *
_curthread(void)
{
-#if defined(__amd64)
ulwp_t *__value;
- __asm__ __volatile__("movq %%fs:0, %0" : "=r" (__value));
+ __asm__ __volatile__(
+#if defined(__amd64)
+ "movq %%fs:0, %0\n\t"
#elif defined(__i386)
- ulwp_t *__value;
- __asm__ __volatile__("movl %%gs:0, %0" : "=r" (__value));
+ "movl %%gs:0, %0\n\t"
#elif defined(__sparc)
- register ulwp_t *__value __asm__("g7");
+ ".register %%g7, #scratch\n\t"
+ "mov %%g7, %0\n\t"
#else
#error "port me"
#endif
+ : "=r" (__value));
return (__value);
}