diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2010-11-18 14:58:01 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2013-03-14 22:47:08 +0100 |
commit | daecc9a410a6f23d80daf8ce3afd280fea329e63 (patch) | |
tree | 8d603dd538809431cc01b9e656c827d1f0709052 /libpthread/nptl/sysdeps/metag/pthread_spin_trylock.S | |
parent | 20221281b3d67880439cd1d16c151f4528d034fb (diff) |
metag: Add NPTL support
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/metag/pthread_spin_trylock.S')
-rw-r--r-- | libpthread/nptl/sysdeps/metag/pthread_spin_trylock.S | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libpthread/nptl/sysdeps/metag/pthread_spin_trylock.S b/libpthread/nptl/sysdeps/metag/pthread_spin_trylock.S new file mode 100644 index 000000000..e0b9b5083 --- /dev/null +++ b/libpthread/nptl/sysdeps/metag/pthread_spin_trylock.S @@ -0,0 +1,24 @@ +! Copyright (C) 2013 Imagination Technologies Ltd. + +! Licensed under LGPL v2.1 or later, see the file COPYING.LIB in this tarball. + +#include <pthread-errnos.h> + + .text + .global _pthread_spin_trylock + .type _pthread_spin_trylock,function +_pthread_spin_trylock: +1: MOVT D0Re0, #HI(#EBUSY) + ADD D0Re0, D0Re0, #LO(#EBUSY) + LNKGETD D0Ar2, [D1Ar1] + CMP D0Ar2, #0 + ADD D0Ar2, D0Ar2, #1 + LNKSETDEQ [D1Ar1], D0Ar2 + BNE 2f + DEFR D0Ar2, TXSTAT + ANDT D0Ar2, D0Ar2, #HI(0x3f000000) + CMPT D0Ar2, #HI(0x02000000) + BNZ 1b + MOV D0Re0, #0 +2: MOV PC, D1RtP + .size _pthread_spin_trylock,.-_pthread_spin_trylock |