From a33dc57c7c2b181cf7e76d843f8b031dbb6d4fa8 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 18 Jun 2013 13:26:22 -0700 Subject: [PATCH] Always use v1 for MIPS TLS access. Change-Id: Ic2850b90185cfbc5b0eff804c8b74a1c553c0852 --- libc/private/bionic_tls.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h index 225a617d0..61b894f9c 100644 --- a/libc/private/bionic_tls.h +++ b/libc/private/bionic_tls.h @@ -89,7 +89,8 @@ extern int __set_tls(void* ptr); (volatile void*) __val; }) #elif defined(__mips__) # define __get_tls() \ - ({ register unsigned int __val; \ + /* On mips32r1, this goes via a kernel illegal instruction trap that's optimized for v1. */ \ + ({ register unsigned int __val asm("v1"); \ asm (" .set push\n" \ " .set mips32r2\n" \ " rdhwr %0,$29\n" \ -- 2.11.0