]> git.ipfire.org Git - thirdparty/glibc.git/commit
MIPS: Use `.set mips2' to emulate LL/SC for the R5900 too
authorFredrik Noring <noring@nocrew.org>
Thu, 1 Nov 2018 14:36:48 +0000 (14:36 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Thu, 1 Nov 2018 14:36:48 +0000 (14:36 +0000)
commit8e3c00db16fcedea0ea47d93c2acb6d7d5ba9164
treeb774ab536eb15aa08450ca13aeeb40960329250f
parentfc783076ec496a55c029be14617ea16a24589f55
MIPS: Use `.set mips2' to emulate LL/SC for the R5900 too

GAS treats the R5900 as MIPS III, with some modifications.  The MIPS III
designation means that the GNU C Library will try to assemble the LL and
SC instructions, even though they are not implemented in the R5900.  GAS
will therefore produce the following errors:

Error: opcode not supported on this processor: r5900 (mips3) `ll $2,0($4)'
Error: opcode not supported on this processor: r5900 (mips3) `sc $6,0($4)'

The MIPS II ISA override as used here enables the kernel to trap and
emulate the LL and SC instructions, as required.

This change has been tested by compiling the GNU C Library 2.27 with a
GCC 8.2.0 cross-compiler for mipsr5900el-unknown-linux-gnu under Gentoo.

* sysdeps/mips/sys/tas.h (_test_and_set): Handle the R5900 CPU
with the ISA override.
ChangeLog
sysdeps/mips/sys/tas.h