summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-10-26 23:59:17 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-10-26 23:59:17 +0000
commitf99ef02878c3a5abeb6f5ed14235c936056efc68 (patch)
tree2138853a28a8cabd0f897a282a89c12c352599ce
parenta4799d425e063f05cee73489604c0328097cbb0c (diff)
Add memory clobbers to the atomic_*_return functions. I hope this
fixes the file corruption / `D' state processes people observe.
-rw-r--r--include/asm-mips/atomic.h21
-rw-r--r--include/asm-mips64/atomic.h6
2 files changed, 8 insertions, 19 deletions
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index e4084d577..6bb29f1b7 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -80,21 +80,6 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
return temp;
}
-extern __inline__ void atomic_clear_mask(unsigned long mask, unsigned long * v)
-{
- unsigned long temp;
- int flags;
-
- save_flags(flags);
- cli();
- temp = *v;
- temp &= ~mask;
- *v = temp;
- restore_flags(flags);
-
- return;
-}
-
#else
/*
@@ -144,7 +129,8 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
"addu\t%0,%1,%3\n\t"
".set\treorder"
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
- : "Ir" (i), "m" (v->counter));
+ : "Ir" (i), "m" (v->counter)
+ : "memory");
return result;
}
@@ -162,7 +148,8 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
"subu\t%0,%1,%3\n\t"
".set\treorder"
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
- : "Ir" (i), "m" (v->counter));
+ : "Ir" (i), "m" (v->counter)
+ : "memory");
return result;
}
diff --git a/include/asm-mips64/atomic.h b/include/asm-mips64/atomic.h
index 0ed12d406..bef7dfef7 100644
--- a/include/asm-mips64/atomic.h
+++ b/include/asm-mips64/atomic.h
@@ -66,7 +66,8 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
"addu\t%0,%1,%3\n\t"
".set\treorder"
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
- : "Ir" (i), "m" (v->counter));
+ : "Ir" (i), "m" (v->counter)
+ : "memory");
return result;
}
@@ -84,7 +85,8 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
"subu\t%0,%1,%3\n\t"
".set\treorder"
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
- : "Ir" (i), "m" (v->counter));
+ : "Ir" (i), "m" (v->counter)
+ : "memory");
return result;
}