Date: Thu, 26 Feb 2015 23:05:47 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279338 - head/sys/arm/include Message-ID: <201502262305.t1QN5lmY075787@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Thu Feb 26 23:05:46 2015 New Revision: 279338 URL: https://svnweb.freebsd.org/changeset/base/279338 Log: Add casting to make atomic ops work for pointers. (Apparently nobody has ever done atomic ops on pointers before now on arm). Submitted by: Svatopluk Kraus <onwahe@gmail.com> Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Thu Feb 26 22:46:01 2015 (r279337) +++ head/sys/arm/include/atomic.h Thu Feb 26 23:05:46 2015 (r279338) @@ -1103,13 +1103,23 @@ atomic_store_long(volatile u_long *dst, *dst = src; } -#define atomic_clear_ptr atomic_clear_32 -#define atomic_set_ptr atomic_set_32 -#define atomic_cmpset_ptr atomic_cmpset_32 -#define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 -#define atomic_cmpset_acq_ptr atomic_cmpset_acq_32 -#define atomic_store_ptr atomic_store_32 -#define atomic_store_rel_ptr atomic_store_rel_32 +#define atomic_clear_ptr(p, v) \ + atomic_clear_32((volatile uint32_t *)(p), (uint32_t)(v)) +#define atomic_set_ptr(p, v) \ + atomic_set_32((volatile uint32_t *)(p), (uint32_t)(v)) +#define atomic_cmpset_ptr(p, cmpval, newval) \ + atomic_cmpset_32((volatile u_int32_t *)(p), (u_int32_t)(cmpval), \ + (u_int32_t)(newval)) +#define atomic_cmpset_rel_ptr(p, cmpval, newval) \ + atomic_cmpset_rel_32((volatile u_int32_t *)(p), (u_int32_t)(cmpval), \ + (u_int32_t)(newval)) +#define atomic_cmpset_acq_ptr(p, cmpval, newval) \ + atomic_cmpset_acq_32((volatile u_int32_t *)(p), (u_int32_t)(cmpval), \ + (u_int32_t)(newval)) +#define atomic_store_ptr(p, v) \ + atomic_store_32((volatile uint32_t *)(p), (uint32_t)(v)) +#define atomic_store_rel_ptr(p, v) \ + atomic_store_rel_32((volatile uint32_t *)(p), (uint32_t)(v)) #define atomic_add_int atomic_add_32 #define atomic_add_acq_int atomic_add_acq_32
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502262305.t1QN5lmY075787>