-.\" $OpenBSD: atomic_cas_uint.9,v 1.5 2014/02/13 12:03:47 dlg Exp $
+.\" $OpenBSD: atomic_cas_uint.9,v 1.6 2014/07/18 10:40:14 dlg Exp $
.\"
.\" Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
.\" All rights reserved.
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: February 13 2014 $
+.Dd $Mdocdate: July 18 2014 $
.Dt ATOMIC_CAS_UINT 9
.Os
.Sh NAME
.Ft unsigned long
.Fn atomic_cas_ulong "volatile unsigned long *p" "unsigned long expected" "unsigned long new"
.Ft void *
-.Fn atomic_cas_ptr "volatile void **p" "void *expected" "void *new"
+.Fn atomic_cas_ptr "volatile void *p" "void *expected" "void *new"
.Sh DESCRIPTION
The atomic_cas set of functions provide an interface for atomically
performing compare-and-swap operations with respect to interrupts
-.\" $OpenBSD: atomic_swap_uint.9,v 1.5 2014/02/13 12:03:47 dlg Exp $
+.\" $OpenBSD: atomic_swap_uint.9,v 1.6 2014/07/18 10:40:14 dlg Exp $
.\"
.\" Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
.\" All rights reserved.
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: February 13 2014 $
+.Dd $Mdocdate: July 18 2014 $
.Dt ATOMIC_SWAP_UINT 9
.Os
.Sh NAME
.Ft unsigned long
.Fn atomic_swap_ulong "volatile unsigned long *p" "unsigned long new"
.Ft void *
-.Fn atomic_swap_ptr "volatile void **p" "void *new"
+.Fn atomic_swap_ptr "volatile void *p" "void *new"
.Sh DESCRIPTION
The atomic_swap set of functions provide an interface for atomically
performing swap operations with respect to interrupts and multiple
-/* $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 $ */
/*
#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);
-/* $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 */
((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)
-/* $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>
*
#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);
}
-/* $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 */
#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)