aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/mips/sysdep.h
diff options
context:
space:
mode:
authorAndrew Bennett <andrew.bennett@imgtec.com>2015-08-24 22:06:29 +0100
committerMatthew Fortune <matthew.fortune@imgtec.com>2015-09-08 16:52:43 +0100
commit7498d7676dc9ffb38fcb39635bae7c195740d6f7 (patch)
tree777b1522f456dde55596ed3388229f57eb6a9dfe /sysdeps/unix/mips/sysdep.h
parent697ed91ca901f8e2ce3ba2b7cf69cdb18c8b37ad (diff)
downloadglibc-7498d7676dc9ffb38fcb39635bae7c195740d6f7.tar
glibc-7498d7676dc9ffb38fcb39635bae7c195740d6f7.tar.gz
glibc-7498d7676dc9ffb38fcb39635bae7c195740d6f7.tar.bz2
glibc-7498d7676dc9ffb38fcb39635bae7c195740d6f7.zip
MIPS: Only use .set mips* assembler directives when necessary
There are a few .set mips* assembler directives used in the MIPS specific sysdep code that force an instruction to be assembled for a specific ISA. The reason for these is to allow an instruction to be encoded when it might not be supported in the current ISA (when the code is run the Linux kernel will trap and emulate any unsupported instructions). Unfortunately forcing a specific ISA means that when assembling for a newer ISA, where the instruction has a different encoding, the wrong encoding will be used. * sysdeps/mips/bits/atomic.h [_MIPS_SIM == _ABIO32] (MIPS_PUSH_MIPS2): Only use .set mips2 if the current ISA is below mips2. * sysdeps/mips/sys/tas.h [_MIPS_SIM == _ABIO32] (_test_and_set): Likewise. * sysdeps/mips/nptl/tls.h (READ_THREAD_POINTER): Only use .set mips32r2 if the current ISA is below mips32r2. * sysdeps/mips/tls-macros.h (TLS_RDHWR): New define. (TLS_IE): Updated to use the TLD_RDHWR macro. (TLS_LE): Likewise. * sysdeps/unix/mips/sysdep.h (__mips_isa_rev): Moved out of #ifdef __ASSEMBLER__ condition.
Diffstat (limited to 'sysdeps/unix/mips/sysdep.h')
-rw-r--r--sysdeps/unix/mips/sysdep.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/unix/mips/sysdep.h b/sysdeps/unix/mips/sysdep.h
index 4fd58f75c7..08595cc980 100644
--- a/sysdeps/unix/mips/sysdep.h
+++ b/sysdeps/unix/mips/sysdep.h
@@ -19,6 +19,10 @@
#include <sgidefs.h>
#include <sysdeps/unix/sysdep.h>
+#ifndef __mips_isa_rev
+# define __mips_isa_rev 0
+#endif
+
#ifdef __ASSEMBLER__
#include <regdef.h>
@@ -78,8 +82,4 @@
# define L(label) .L ## label
#endif
-#ifndef __mips_isa_rev
-# define __mips_isa_rev 0
-#endif
-
#endif