mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] Fix atomic_arch.h for MIPS32 R6
@ 2016-03-21  6:03 Jaydeep Patil
  2016-03-21 17:37 ` dalias
  0 siblings, 1 reply; 18+ messages in thread
From: Jaydeep Patil @ 2016-03-21  6:03 UTC (permalink / raw)
  To: dalias; +Cc: musl, nsz

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

Hi Rich,

The arch/mips/atomic_arch.h uses MIPS2 opcode for LL and SC instructions. Opcodes of these instructions differ on MIPSR6.

Refer to https://github.com/JaydeepIMG/musl-1/tree/fix_atomic_for_MIPS32_R6 for the patch.

From 63428cfc5dfa75d2771ba8205067c438942e1a60 Mon Sep 17 00:00:00 2001
From: Jaydeep Patil <jaydeep.patil@imgtec.com>
Date: Mon, 21 Mar 2016 06:00:39 +0000
Subject: [PATCH] Fix for opcodes of LL/SC instructions for MIPSR6

---
arch/mips/atomic_arch.h | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/mips/atomic_arch.h b/arch/mips/atomic_arch.h
index ce2823b..16b1542 100644
--- a/arch/mips/atomic_arch.h
+++ b/arch/mips/atomic_arch.h
@@ -3,9 +3,13 @@ static inline int a_ll(volatile int *p)
{
        int v;
        __asm__ __volatile__ (
+#if __mips_isa_rev < 6
                ".set push ; .set mips2\n\t"
+#endif
                "ll %0, %1"
+#if __mips_isa_rev < 6
                "\n\t.set pop"
+#endif
                : "=r"(v) : "m"(*p));
        return v;
}
@@ -15,9 +19,13 @@ static inline int a_sc(volatile int *p, int v)
{
        int r;
        __asm__ __volatile__ (
+#if __mips_isa_rev < 6
                ".set push ; .set mips2\n\t"
+#endif
                "sc %0, %1"
+#if __mips_isa_rev < 6
                "\n\t.set pop"
+#endif
                : "=r"(r), "=m"(*p) : "0"(v) : "memory");
        return r;
}
--
2.1.4

Regards,
Jaydeep


[-- Attachment #2: Type: text/html, Size: 6123 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-03-31  5:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21  6:03 [PATCH] Fix atomic_arch.h for MIPS32 R6 Jaydeep Patil
2016-03-21 17:37 ` dalias
2016-03-22  4:58   ` Jaydeep Patil
2016-03-22 21:22     ` Rich Felker
2016-03-23  6:37       ` Jaydeep Patil
2016-03-23 15:03         ` Rich Felker
2016-03-28  5:07           ` Jaydeep Patil
2016-03-28 13:04             ` Rich Felker
2016-03-29  2:19               ` Rich Felker
2016-03-29  3:54               ` Jaydeep Patil
2016-03-29  4:10                 ` Rich Felker
2016-03-29  7:16                   ` Jaydeep Patil
2016-03-29 13:32                     ` Rich Felker
2016-03-30  9:45                       ` Jaydeep Patil
2016-03-30 14:29                         ` Rich Felker
2016-03-30 15:28                           ` Rich Felker
2016-03-31  5:20                             ` Jaydeep Patil
2016-03-29  3:55               ` Jaydeep Patil

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).