projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make new TLS setup block even implementation-internals signals
[musl]
/
arch
/
mips
/
atomic.h
diff --git
a/arch/mips/atomic.h
b/arch/mips/atomic.h
index
33e53d4
..
f3478ef
100644
(file)
--- a/
arch/mips/atomic.h
+++ b/
arch/mips/atomic.h
@@
-27,6
+27,7
@@
static inline int a_cas(volatile int *p, int t, int s)
int dummy;
__asm__ __volatile__(
".set push\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%2)\n"
" bne %0, %3, 1f\n"
".set noreorder\n"
"1: ll %0, 0(%2)\n"
" bne %0, %3, 1f\n"
@@
-56,6
+57,7
@@
static inline int a_swap(volatile int *x, int v)
int old, dummy;
__asm__ __volatile__(
".set push\n"
int old, dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%2)\n"
" addu %1, %3, $0\n"
".set noreorder\n"
"1: ll %0, 0(%2)\n"
" addu %1, %3, $0\n"
@@
-70,19
+72,20
@@
static inline int a_swap(volatile int *x, int v)
static inline int a_fetch_add(volatile int *x, int v)
{
static inline int a_fetch_add(volatile int *x, int v)
{
- int
new
;
+ int
old, dummy
;
__asm__ __volatile__(
".set push\n"
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
".set noreorder\n"
- "1: ll %0, 0(%
1
)\n"
- " addu %
0, %0, %2
\n"
- " sc %
0, 0(%1
)\n"
- " beq %
0
, $0, 1b\n"
+ "1: ll %0, 0(%
2
)\n"
+ " addu %
1, %0, %3
\n"
+ " sc %
1, 0(%2
)\n"
+ " beq %
1
, $0, 1b\n"
" nop\n"
"1: \n"
".set pop\n"
" nop\n"
"1: \n"
".set pop\n"
- : "=&r"(
new
) : "r"(x), "r"(v) : "memory" );
- return
new-v
;
+ : "=&r"(
old), "=&r"(dummy
) : "r"(x), "r"(v) : "memory" );
+ return
old
;
}
static inline void a_inc(volatile int *x)
}
static inline void a_inc(volatile int *x)
@@
-90,6
+93,7
@@
static inline void a_inc(volatile int *x)
int dummy;
__asm__ __volatile__(
".set push\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" addu %0, %0, 1\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" addu %0, %0, 1\n"
@@
-106,6
+110,7
@@
static inline void a_dec(volatile int *x)
int dummy;
__asm__ __volatile__(
".set push\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" subu %0, %0, 1\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" subu %0, %0, 1\n"
@@
-122,6
+127,7
@@
static inline void a_store(volatile int *p, int x)
int dummy;
__asm__ __volatile__(
".set push\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" addu %0, %2, $0\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" addu %0, %2, $0\n"
@@
-147,6
+153,7
@@
static inline void a_and(volatile int *p, int v)
int dummy;
__asm__ __volatile__(
".set push\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" and %0, %0, %2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" and %0, %0, %2\n"
@@
-163,6
+170,7
@@
static inline void a_or(volatile int *p, int v)
int dummy;
__asm__ __volatile__(
".set push\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" or %0, %0, %2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" or %0, %0, %2\n"