]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
Fix remove_userlocal_code() for n32.
authorjhb <jhb@FreeBSD.org>
Tue, 13 Dec 2016 19:27:31 +0000 (19:27 +0000)
committerjhb <jhb@FreeBSD.org>
Tue, 13 Dec 2016 19:27:31 +0000 (19:27 +0000)
n32 kernels use a 64-bit store to the TLS register rather than a 32-bit
store.

Sponsored by: DARPA / AFRL

sys/mips/mips/cpu.c

index fa68fd32e7437f897996422d7fcffb366ee2cb09..149bec32f9275ac0ba0db1ba3ceeba504f9dad6b 100644 (file)
@@ -78,9 +78,6 @@ struct mips_cpuinfo cpuinfo;
 #   define     _ADDU_V0_T0_T1 \
     _ENCODE_INSN(0, T0, T1, V0, OP_DADDU)
 
-#   define _MTC0_V0_USERLOCAL \
-    _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2)
-
 #else /* mips 32 */
 
 #   define     _LOAD_T0_MDTLS_A1 \
@@ -93,10 +90,19 @@ struct mips_cpuinfo cpuinfo;
 #   define     _ADDU_V0_T0_T1 \
     _ENCODE_INSN(0, T0, T1, V0, OP_ADDU)
 
+#endif /* ! __mips_n64 */
+
+#if defined(__mips_n64) || defined(__mips_n32)
+
+#   define _MTC0_V0_USERLOCAL \
+    _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2)
+
+#else /* mips o32 */
+
 #   define _MTC0_V0_USERLOCAL \
     _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2)
 
-#endif /* ! __mips_n64 */
+#endif /* ! (__mips_n64 || __mipsn32) */
 
 #define        _JR_RA  _ENCODE_INSN(OP_SPECIAL, RA, 0, 0, OP_JR)
 #define        _NOP    0