2005-02-18 23:10:29 +03:00
|
|
|
START_FILE
|
2005-02-19 02:16:04 +03:00
|
|
|
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
2008-06-25 07:07:53 +04:00
|
|
|
#include <sys/asm.h>
|
2010-11-17 05:36:03 +03:00
|
|
|
#else
|
|
|
|
#include <asm.h>
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
#include <regdef.h>
|
|
|
|
|
2005-02-18 23:10:29 +03:00
|
|
|
TEXT
|
|
|
|
|
2005-02-19 02:16:04 +03:00
|
|
|
ALIGN(8)
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_mb)
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
sync
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
j ra
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_mb)
|
2005-02-19 02:16:04 +03:00
|
|
|
|
|
|
|
|
|
|
|
ALIGN(8)
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_rmb)
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
sync
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
j ra
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_rmb)
|
2005-02-19 02:16:04 +03:00
|
|
|
|
|
|
|
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_wmb)
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
sync
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
j ra
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_wmb)
|
2005-02-19 02:16:04 +03:00
|
|
|
|
|
|
|
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_cmpset_32)
|
2005-02-19 02:16:04 +03:00
|
|
|
.set noreorder
|
|
|
|
retry1:
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
ll $3, 0($4)
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
bne $3, $5, done1
|
|
|
|
or $2, $6, 0
|
2011-01-28 01:42:26 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
sc $2, 0($4)
|
2011-01-28 01:42:26 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2008-12-19 01:38:31 +03:00
|
|
|
beqz $2, retry1
|
2005-02-19 02:16:04 +03:00
|
|
|
done1:
|
|
|
|
xor $3,$3,$5
|
|
|
|
j ra
|
|
|
|
sltu $2,$3,1
|
2014-01-21 20:42:49 +04:00
|
|
|
.set reorder
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_cmpset_32)
|
2005-02-19 02:16:04 +03:00
|
|
|
|
|
|
|
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_cmpset_acq_32)
|
2005-02-19 02:16:04 +03:00
|
|
|
.set noreorder
|
|
|
|
retry2:
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
ll $3, 0($4)
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
bne $3, $5, done2
|
|
|
|
or $2, $6, 0
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
sc $2, 0($4)
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2008-12-19 01:38:31 +03:00
|
|
|
beqz $2, retry2
|
2005-02-19 02:16:04 +03:00
|
|
|
done2:
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
sync
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
xor $3,$3,$5
|
|
|
|
j ra
|
|
|
|
sltu $2,$3,1
|
2014-01-21 20:42:49 +04:00
|
|
|
.set reorder
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_cmpset_acq_32)
|
2005-02-19 02:16:04 +03:00
|
|
|
|
|
|
|
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_cmpset_rel_32)
|
2005-02-19 02:16:04 +03:00
|
|
|
.set noreorder
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
sync
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
retry3:
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
ll $3, 0($4)
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
bne $3, $5, done3
|
|
|
|
or $2, $6, 0
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips2
|
|
|
|
#endif
|
2005-02-19 02:16:04 +03:00
|
|
|
sc $2, 0($4)
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __linux__
|
|
|
|
.set mips0
|
|
|
|
#endif
|
2008-12-19 01:38:31 +03:00
|
|
|
beqz $2, retry3
|
2005-02-19 02:16:04 +03:00
|
|
|
done3:
|
|
|
|
xor $3,$3,$5
|
|
|
|
j ra
|
|
|
|
sltu $2,$3,1
|
2014-01-21 20:42:49 +04:00
|
|
|
.set reorder
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_cmpset_rel_32)
|
2005-02-19 02:16:04 +03:00
|
|
|
|
2010-11-17 05:36:03 +03:00
|
|
|
#ifdef __mips64
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_cmpset_64)
|
2014-01-21 20:42:49 +04:00
|
|
|
.set noreorder
|
2005-02-19 02:16:04 +03:00
|
|
|
retry4:
|
|
|
|
lld $3, 0($4)
|
|
|
|
bne $3, $5, done4
|
|
|
|
or $2, $6, 0
|
|
|
|
scd $2, 0($4)
|
2008-12-19 01:38:31 +03:00
|
|
|
beqz $2, retry4
|
2005-02-19 02:16:04 +03:00
|
|
|
done4:
|
2014-01-21 20:42:49 +04:00
|
|
|
xor $3,$3,$5
|
2005-02-19 02:16:04 +03:00
|
|
|
j ra
|
2014-01-21 20:42:49 +04:00
|
|
|
sltu $2,$3,1
|
|
|
|
.set reorder
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_cmpset_64)
|
2005-02-19 02:16:04 +03:00
|
|
|
|
|
|
|
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_cmpset_acq_64)
|
2005-02-19 02:16:04 +03:00
|
|
|
.set noreorder
|
|
|
|
retry5:
|
|
|
|
lld $3, 0($4)
|
|
|
|
bne $3, $5, done5
|
|
|
|
or $2, $6, 0
|
|
|
|
scd $2, 0($4)
|
2008-12-19 01:38:31 +03:00
|
|
|
beqz $2, retry5
|
2005-02-19 02:16:04 +03:00
|
|
|
done5:
|
|
|
|
sync
|
2014-01-21 20:42:49 +04:00
|
|
|
xor $3,$3,$5
|
2005-02-19 02:16:04 +03:00
|
|
|
j ra
|
2014-01-21 20:42:49 +04:00
|
|
|
sltu $2,$3,1
|
|
|
|
.set reorder
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_cmpset_acq_64)
|
2005-02-19 02:16:04 +03:00
|
|
|
|
|
|
|
|
2005-07-04 01:38:51 +04:00
|
|
|
LEAF(opal_atomic_cmpset_rel_64)
|
2005-02-19 02:16:04 +03:00
|
|
|
.set noreorder
|
|
|
|
sync
|
|
|
|
retry6:
|
|
|
|
lld $3, 0($4)
|
|
|
|
bne $3, $5, done6
|
|
|
|
or $2, $6, 0
|
|
|
|
scd $2, 0($4)
|
2008-12-19 01:38:31 +03:00
|
|
|
beqz $2, retry6
|
2005-02-19 02:16:04 +03:00
|
|
|
done6:
|
2014-01-21 20:42:49 +04:00
|
|
|
xor $3,$3,$5
|
2005-02-19 02:16:04 +03:00
|
|
|
j ra
|
2014-01-21 20:42:49 +04:00
|
|
|
sltu $2,$3,1
|
|
|
|
.set reorder
|
2005-07-04 01:38:51 +04:00
|
|
|
END(opal_atomic_cmpset_rel_64)
|
2010-11-17 05:36:03 +03:00
|
|
|
#endif /* __mips64 */
|