summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorcltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-29 09:29:55 +0000
committercltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-29 09:29:55 +0000
commit396bc2f7057181b9e500f714c21d5cca7a527551 (patch)
tree3bf1bc0c11aafa989fb02cec5db74b15242fbafc /libgomp
parentf0414285e56fd3e8dac3fcdacdb930159e8a3501 (diff)
downloadgcc-396bc2f7057181b9e500f714c21d5cca7a527551.tar.gz
2012-08-29 Chung-Lin Tang <cltang@codesourcery.com>
libgomp/ * config/linux/mips/futex.h (sys_futex0): Change to static function with noinline, nomips16 attributes under MIPS16. Adjust asm statement to place 'li v0,SYS_futex' immediately before syscall insn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190772 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog7
-rw-r--r--libgomp/config/linux/mips/futex.h14
2 files changed, 17 insertions, 4 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 52c269dfbda..2f761d7177f 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,10 @@
+2012-08-29 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * config/linux/mips/futex.h (sys_futex0): Change to static
+ function with noinline, nomips16 attributes under MIPS16. Adjust
+ asm statement to place 'li v0,SYS_futex' immediately before
+ syscall insn.
+
2012-07-04 Sandra Loosemore <sandra@codesourcery.com>
* libgomp.texi (Library Index): Renamed from "Index" to prevent
diff --git a/libgomp/config/linux/mips/futex.h b/libgomp/config/linux/mips/futex.h
index 93655d3114c..83b0aefede7 100644
--- a/libgomp/config/linux/mips/futex.h
+++ b/libgomp/config/linux/mips/futex.h
@@ -28,20 +28,26 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
+#ifdef __mips16
+static void __attribute__((noinline,nomips16))
+#else
static inline void
+#endif
sys_futex0 (int *addr, int op, int val)
{
- register unsigned long __v0 asm("$2") = (unsigned long) SYS_futex;
+ register unsigned long __v0 asm("$2");
register unsigned long __a0 asm("$4") = (unsigned long) addr;
register unsigned long __a1 asm("$5") = (unsigned long) op;
register unsigned long __a2 asm("$6") = (unsigned long) val;
register unsigned long __a3 asm("$7") = 0;
- __asm volatile ("syscall"
+ __asm volatile ("li $2, %6\n\t"
+ "syscall"
/* returns $a3 (errno), $v0 (return value) */
: "=r" (__v0), "=r" (__a3)
- /* arguments in v0 (syscall) a0-a3 */
- : "r" (__v0), "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a3)
+ /* arguments in a0-a3, and syscall number */
+ : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a3),
+ "IK" (SYS_futex)
/* clobbers at, v1, t0-t9, memory */
: "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", "$14",
"$15", "$24", "$25", "memory");