@@ -8,7 +8,8 @@
static inline int a_ll(volatile int *p)
{
int v;
-#if __mips < 2
+ /* The R5900 reports itself as MIPS III but it does not have LL/SC. */
+#if __mips < 2 || defined(_MIPS_ARCH_R5900)
__asm__ __volatile__ (
".set push ; .set mips2\n\t"
"ll %0, %1"
@@ -26,7 +27,8 @@ static inline int a_ll(volatile int *p)
static inline int a_sc(volatile int *p, int v)
{
int r;
-#if __mips < 2
+ /* The R5900 reports itself as MIPS III but it does not have LL/SC. */
+#if __mips < 2 || defined(_MIPS_ARCH_R5900)
__asm__ __volatile__ (
".set push ; .set mips2\n\t"
"sc %0, %1"