summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2010-05-20 06:18:03 +0000
committerphk <phk@FreeBSD.org>2010-05-20 06:18:03 +0000
commit3cad03a86c7b5013695166f282aeadccdd37d2de (patch)
tree993f6999d7e74797b56b3d9d075e8fb5f2a2e031
parent3c3fa2f5b0c7640373fcbcc3f667bf7794e8e609 (diff)
downloadFreeBSD-src-3cad03a86c7b5013695166f282aeadccdd37d2de.zip
FreeBSD-src-3cad03a86c7b5013695166f282aeadccdd37d2de.tar.gz
Rename an argument from "exp" to "expect" since the former makes FlexeLint
uneasy, in case anybody think it might be exp(3) in libm. This also makes it consistent with other archs.
-rw-r--r--sys/amd64/include/atomic.h14
-rw-r--r--sys/i386/include/atomic.h16
2 files changed, 15 insertions, 15 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h
index a2bd930..bcf61f9 100644
--- a/sys/amd64/include/atomic.h
+++ b/sys/amd64/include/atomic.h
@@ -76,8 +76,8 @@
void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \
void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
-int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src);
-int atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src);
+int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src);
+int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src);
u_int atomic_fetchadd_int(volatile u_int *p, u_int v);
u_long atomic_fetchadd_long(volatile u_long *p, u_long v);
@@ -124,13 +124,13 @@ struct __hack
/*
* Atomic compare and set, used by the mutex functions
*
- * if (*dst == exp) *dst = src (all 32 bit words)
+ * if (*dst == expect) *dst = src (all 32 bit words)
*
* Returns 0 on failure, non-zero on success
*/
static __inline int
-atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
+atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
{
u_char res;
@@ -143,7 +143,7 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
: "=a" (res), /* 0 */
"=m" (*dst) /* 1 */
: "r" (src), /* 2 */
- "a" (exp), /* 3 */
+ "a" (expect), /* 3 */
"m" (*dst) /* 4 */
: "memory");
@@ -151,7 +151,7 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
}
static __inline int
-atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
+atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src)
{
u_char res;
@@ -164,7 +164,7 @@ atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
: "=a" (res), /* 0 */
"=m" (*dst) /* 1 */
: "r" (src), /* 2 */
- "a" (exp), /* 3 */
+ "a" (expect), /* 3 */
"m" (*dst) /* 4 */
: "memory");
diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h
index b00eb45..59c7dd9 100644
--- a/sys/i386/include/atomic.h
+++ b/sys/i386/include/atomic.h
@@ -76,7 +76,7 @@
void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \
void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
-int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src);
+int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src);
u_int atomic_fetchadd_int(volatile u_int *p, u_int v);
#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \
@@ -122,7 +122,7 @@ struct __hack
/*
* Atomic compare and set, used by the mutex functions
*
- * if (*dst == exp) *dst = src (all 32 bit words)
+ * if (*dst == expect) *dst = src (all 32 bit words)
*
* Returns 0 on failure, non-zero on success
*/
@@ -130,7 +130,7 @@ struct __hack
#ifdef CPU_DISABLE_CMPXCHG
static __inline int
-atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
+atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
{
u_char res;
@@ -147,7 +147,7 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
: "=q" (res), /* 0 */
"=m" (*dst) /* 1 */
: "r" (src), /* 2 */
- "r" (exp), /* 3 */
+ "r" (expect), /* 3 */
"m" (*dst) /* 4 */
: "memory");
@@ -157,7 +157,7 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
#else /* !CPU_DISABLE_CMPXCHG */
static __inline int
-atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
+atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
{
u_char res;
@@ -170,7 +170,7 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
: "=a" (res), /* 0 */
"=m" (*dst) /* 1 */
: "r" (src), /* 2 */
- "a" (exp), /* 3 */
+ "a" (expect), /* 3 */
"m" (*dst) /* 4 */
: "memory");
@@ -292,10 +292,10 @@ ATOMIC_STORE_LOAD(long, "cmpxchgl %0,%1", "xchgl %1,%0");
#ifndef WANT_FUNCTIONS
static __inline int
-atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
+atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src)
{
- return (atomic_cmpset_int((volatile u_int *)dst, (u_int)exp,
+ return (atomic_cmpset_int((volatile u_int *)dst, (u_int)expect,
(u_int)src));
}
OpenPOWER on IntegriCloud