diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/include/atomic.h | 8 | ||||
-rw-r--r-- | sys/arch/m88k/include/atomic.h | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/include/atomic.h | 8 | ||||
-rw-r--r-- | sys/arch/vax/include/atomic.h | 16 |
4 files changed, 19 insertions, 19 deletions
diff --git a/sys/arch/amd64/include/atomic.h b/sys/arch/amd64/include/atomic.h index d25ec726796..e371c438d32 100644 --- a/sys/arch/amd64/include/atomic.h +++ b/sys/arch/amd64/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.12 2014/03/29 18:09:28 guenther Exp $ */ +/* $OpenBSD: atomic.h,v 1.13 2014/07/18 10:40:14 dlg Exp $ */ /* $NetBSD: atomic.h,v 1.1 2003/04/26 18:39:37 fvdl Exp $ */ /* @@ -80,11 +80,11 @@ _atomic_cas_ulong(volatile unsigned long *p, unsigned long e, unsigned long n) #define atomic_cas_ulong(_p, _e, _n) _atomic_cas_ulong((_p), (_e), (_n)) static inline void * -_atomic_cas_ptr(volatile void **p, void *e, void *n) +_atomic_cas_ptr(volatile void *p, void *e, void *n) { __asm volatile(LOCK " cmpxchgq %2, %1" - : "=a" (n), "=m" (*p) - : "r" (n), "a" (e), "m" (*p) + : "=a" (n), "=m" (*(unsigned long *)p) + : "r" (n), "a" (e), "m" (*(unsigned long *)p) : "memory"); return (n); diff --git a/sys/arch/m88k/include/atomic.h b/sys/arch/m88k/include/atomic.h index 73e89a532fc..7a0f8d34c88 100644 --- a/sys/arch/m88k/include/atomic.h +++ b/sys/arch/m88k/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.11 2014/07/13 08:13:07 miod Exp $ */ +/* $OpenBSD: atomic.h,v 1.12 2014/07/18 10:40:14 dlg Exp $ */ /* Public Domain */ @@ -137,12 +137,12 @@ atomic_clear_int(volatile unsigned int *uip) ((unsigned long)atomic_cas_uint((unsigned int *)p, (unsigned int)o, \ (unsigned int)n)) #define atomic_cas_ptr(p,o,n) \ - ((void *)atomic_cas_uint((void **)p, (void *)o, (void *)n)) + ((void *)atomic_cas_uint((void *)p, (void *)o, (void *)n)) #define atomic_swap_ulong(p,o) \ ((unsigned long)atomic_swap_uint((unsigned int *)p, (unsigned int)o) #define atomic_swap_ptr(p,o) \ - ((void *)atomic_swap_uint((void **)p, (void *)o)) + ((void *)atomic_swap_uint((void *)p, (void *)o)) static inline void __sync_synchronize(void) diff --git a/sys/arch/sparc64/include/atomic.h b/sys/arch/sparc64/include/atomic.h index 29d05829631..bcf412ee6b3 100644 --- a/sys/arch/sparc64/include/atomic.h +++ b/sys/arch/sparc64/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.11 2014/03/29 18:09:30 guenther Exp $ */ +/* $OpenBSD: atomic.h,v 1.12 2014/07/18 10:40:14 dlg Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> * @@ -43,11 +43,11 @@ _atomic_cas_ulong(volatile unsigned long *p, unsigned long e, unsigned long n) #define atomic_cas_ulong(_p, _e, _n) _atomic_cas_ulong((_p), (_e), (_n)) static inline void * -_atomic_cas_ptr(volatile void **p, void *e, void *n) +_atomic_cas_ptr(volatile void *p, void *e, void *n) { __asm volatile("casx [%2], %3, %0" - : "+r" (n), "=m" (*p) - : "r" (p), "r" (e), "m" (*p)); + : "+r" (n), "=m" (*(volatile unsigned long *)p) + : "r" (p), "r" (e), "m" (*(volatile unsigned long *)p)); return (n); } diff --git a/sys/arch/vax/include/atomic.h b/sys/arch/vax/include/atomic.h index 701c31d2aac..6a35b0f8146 100644 --- a/sys/arch/vax/include/atomic.h +++ b/sys/arch/vax/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.7 2014/07/12 09:47:05 miod Exp $ */ +/* $OpenBSD: atomic.h,v 1.8 2014/07/18 10:40:14 dlg Exp $ */ /* Public Domain */ @@ -93,20 +93,20 @@ atomic_swap_uint_sp(unsigned int *p, unsigned int v) #define atomic_swap_uint atomic_swap_uint_sp #define atomic_add_long_nv(p,v) \ - ((unsigned long)atomic_add_int_nv((unsigned int *)p, (unsigned int)v)) + ((unsigned long)atomic_add_int_nv((unsigned long *)p, (unsigned long)v)) #define atomic_sub_long_nv(p,v) \ - ((unsigned long)atomic_sub_int_nv((unsigned int *)p, (unsigned int)v)) + ((unsigned long)atomic_sub_int_nv((unsigned long *)p, (unsigned long)v)) #define atomic_cas_ulong(p,o,n) \ - ((unsigned long)atomic_cas_uint((unsigned int *)p, (unsigned int)o, \ - (unsigned int)n)) + ((unsigned long)atomic_cas_uint((unsigned long *)p, (unsigned long)o, \ + (unsigned long)n)) #define atomic_cas_ptr(p,o,n) \ - ((void *)atomic_cas_uint((void **)p, (void *)o, (void *)n)) + ((void *)atomic_cas_uint((void *)p, (void *)o, (void *)n)) #define atomic_swap_ulong(p,o) \ - ((unsigned long)atomic_swap_uint((unsigned int *)p, (unsigned int)o) + ((unsigned long)atomic_swap_uint((unsigned long *)p, (unsigned long)o) #define atomic_swap_ptr(p,o) \ - ((void *)atomic_swap_uint((void **)p, (void *)o)) + ((void *)atomic_swap_uint((void *)p, (void *)o)) static inline void __sync_synchronize(void) |