PERFORCE change 73834 for review
John Baldwin
jhb at FreeBSD.org
Fri Mar 25 14:25:33 PST 2005
http://perforce.freebsd.org/chv.cgi?CH=73834
Change 73834 by jhb at jhb_twclab on 2005/03/25 22:24:34
Various typo compile fixes to the atomic ops.
Affected files ...
.. //depot/projects/smpng/sys/alpha/include/atomic.h#13 edit
.. //depot/projects/smpng/sys/i386/include/atomic.h#24 edit
.. //depot/projects/smpng/sys/sparc64/include/atomic.h#8 edit
Differences ...
==== //depot/projects/smpng/sys/alpha/include/atomic.h#13 (text+ko) ====
@@ -56,7 +56,7 @@
#ifdef __GNUCLIKE_ASM
__asm __volatile (
- "1:\tldl_l %0, %2\n\t" /* load old value */
+ "1:\tldl_l %0, %1\n\t" /* load old value */
"bis %0, %2, %0\n\t" /* calculate new value */
"stl_c %0, %1\n\t" /* attempt to store */
"beq %0, 1b\n" /* spin if failed */
==== //depot/projects/smpng/sys/i386/include/atomic.h#24 (text+ko) ====
@@ -69,7 +69,8 @@
*/
#if defined(KLD_MODULE)
#define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \
-void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
+void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \
+ATOMIC_ACQ(NAME, TYPE)
int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src);
@@ -142,7 +143,7 @@
" movzbl %%al,%0 ; "
" popfl ; "
"# atomic_cmpset_int"
- : "+a" (res) /* 0 (result) */
+ : "+a" (res), /* 0 (result) */
"=m" (*dst) /* 1 */
: "r" (src), /* 2 */
"m" (*dst)); /* 3 */
@@ -164,7 +165,7 @@
" movzbl %%al,%0 ; "
"1: "
"# atomic_cmpset_int"
- : "+a" (res) /* 0 (result) */
+ : "+a" (res), /* 0 (result) */
"=m" (*dst) /* 1 */
: "r" (src), /* 2 */
"m" (*dst)); /* 3 */
@@ -243,13 +244,13 @@
#define ATOMIC_ACQ(NAME, TYPE) \
static __inline void \
-atomic_##NAME##_##TYPE##_acq(volatile u_##TYPE *p, u_##TYPE v)\
+atomic_##NAME##_acq_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
{ \
atomic_##NAME##_##TYPE(p, v); \
__asm __volatile("" ::: "memory"); \
} \
struct __hack
-
+
ATOMIC_ASM(set, char, "orb %b1,%0", "iq", v);
ATOMIC_ASM(clear, char, "andb %b1,%0", "iq", ~v);
ATOMIC_ASM(add, char, "addb %b1,%0", "iq", v);
==== //depot/projects/smpng/sys/sparc64/include/atomic.h#8 (text+ko) ====
@@ -278,7 +278,7 @@
ATOMIC_GEN(long, u_long *, u_long, u_long, 64);
ATOMIC_GEN(64, uint64_t *, uint64_t, uint64_t, 64);
-ATOMIC_GEN(ptr, void *, void *, uintptr_t, 64);
+ATOMIC_GEN(ptr, void **, void *, uintptr_t, 64);
#undef ATOMIC_GEN
#undef atomic_cas
More information about the p4-projects
mailing list