static __inline int
atomic_cmpset_int(volatile u_int *_dst, u_int _old, u_int _new)
{
- int res = _old;
+ u_int res = _old;
__asm __volatile(MPLOCKED "cmpxchgl %2,%1; " \
: "+a" (res), "=m" (*_dst) \
ATOMIC_STORE_LOAD(int, "cmpxchgl %0,%1", "xchgl %1,%0");
ATOMIC_STORE_LOAD(long, "cmpxchgq %0,%1", "xchgq %1,%0");
+#undef ATOMIC_ASM
+#undef ATOMIC_STORE_LOAD
+
/* Acquire and release variants are identical to the normal ones. */
#define atomic_set_acq_char atomic_set_char
#define atomic_set_rel_char atomic_set_char
static __inline int
atomic_cmpset_int(volatile u_int *_dst, u_int _old, u_int _new)
{
- int res = _old;
+ u_int res = _old;
__asm __volatile(MPLOCKED "cmpxchgl %2,%1; " \
: "+a" (res), "=m" (*_dst) \
ATOMIC_STORE_LOAD(int, "cmpxchgl %0,%1", "xchgl %1,%0");
ATOMIC_STORE_LOAD(long, "cmpxchgl %0,%1", "xchgl %1,%0");
+#undef ATOMIC_ASM
+#undef ATOMIC_STORE_LOAD
+
/* Acquire and release variants are identical to the normal ones. */
#define atomic_set_acq_char atomic_set_char
#define atomic_set_rel_char atomic_set_char
#undef _MACHINE_ATOMIC_H_ /* forget we included it */
#undef _CPU_ATOMIC_H_ /* forget we included it */
#undef KLD_MODULE
-#undef ATOMIC_ASM
/* Make atomic.h generate public functions */
#define static
#undef _MACHINE_ATOMIC_H_ /* forget we included it */
#undef _CPU_ATOMIC_H_ /* forget we included it */
#undef KLD_MODULE
-#undef ATOMIC_ASM
/* Make atomic.h generate public functions */
#define static