From: Sascha Wildner Date: Tue, 28 Jul 2009 11:58:37 +0000 (+0200) Subject: atomic.[ch]: Clean up some warnings that crept up in the recent weeks. X-Git-Tag: v2.4.0~386^2~14 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/750f8fdbfcf59a0254f4ecdd12ae4eaf1dec8423 atomic.[ch]: Clean up some warnings that crept up in the recent weeks. --- diff --git a/sys/cpu/amd64/include/atomic.h b/sys/cpu/amd64/include/atomic.h index 2f8e7df095..b9bc20be71 100644 --- a/sys/cpu/amd64/include/atomic.h +++ b/sys/cpu/amd64/include/atomic.h @@ -383,7 +383,7 @@ extern u_int atomic_fetchadd_int(volatile u_int *p, u_int v); 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) \ @@ -489,6 +489,9 @@ ATOMIC_STORE_LOAD(short,"cmpxchgw %w0,%1", "xchgw %w1,%0"); 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 diff --git a/sys/cpu/i386/include/atomic.h b/sys/cpu/i386/include/atomic.h index 90ee4a3630..1433e763d3 100644 --- a/sys/cpu/i386/include/atomic.h +++ b/sys/cpu/i386/include/atomic.h @@ -360,7 +360,7 @@ extern u_int atomic_fetchadd_int(volatile u_int *p, u_int v); 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) \ @@ -461,6 +461,9 @@ ATOMIC_STORE_LOAD(short,"cmpxchgw %w0,%1", "xchgw %w1,%0"); 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 diff --git a/sys/cpu/i386/misc/atomic.c b/sys/cpu/i386/misc/atomic.c index bc6fb7d517..a97d672ce0 100644 --- a/sys/cpu/i386/misc/atomic.c +++ b/sys/cpu/i386/misc/atomic.c @@ -39,7 +39,6 @@ #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 diff --git a/sys/platform/pc64/amd64/atomic.c b/sys/platform/pc64/amd64/atomic.c index 4bd3b352bf..508e7b1565 100644 --- a/sys/platform/pc64/amd64/atomic.c +++ b/sys/platform/pc64/amd64/atomic.c @@ -39,7 +39,6 @@ #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