diff options
author | marcel <marcel@FreeBSD.org> | 2006-08-30 00:57:35 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2006-08-30 00:57:35 +0000 |
commit | 0b6bc8a47b82a98048cd7a2da3caffef19eff7aa (patch) | |
tree | c53cdb37a443afcaf7a378cc87c63b45fd26169c /lib/libc/powerpc | |
parent | 007866fe9c5db6dfe7001acab1424b1f8d7c039a (diff) | |
download | FreeBSD-src-0b6bc8a47b82a98048cd7a2da3caffef19eff7aa.zip FreeBSD-src-0b6bc8a47b82a98048cd7a2da3caffef19eff7aa.tar.gz |
Avoid dead code elimination of the assignment to TP by using inline
assembly.
Diffstat (limited to 'lib/libc/powerpc')
-rw-r--r-- | lib/libc/powerpc/gen/_set_tp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/powerpc/gen/_set_tp.c b/lib/libc/powerpc/gen/_set_tp.c index 045416d..cfedddc 100644 --- a/lib/libc/powerpc/gen/_set_tp.c +++ b/lib/libc/powerpc/gen/_set_tp.c @@ -29,7 +29,7 @@ void _set_tp(void *tpval) { - register void* tp __asm__("r2"); + register void *tp __asm__("r2"); - tp = (char*) tpval + 0x7008; + __asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7008)); } |