Date: Wed, 18 Oct 2006 15:57:25 +0200 From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: arm@freebsd.org Subject: atomic operations Message-ID: <86d58p916i.fsf@dwp.des.no>
next in thread | raw e-mail | index | archive | help
--=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Seems arm's atomic.h doesn't define the full set. Any objections to the attached patch? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=atomic-arm.diff Index: sys/arm/include/atomic.h =================================================================== RCS file: /home/ncvs/src/sys/arm/include/atomic.h,v retrieving revision 1.19 diff -u -r1.19 atomic.h --- sys/arm/include/atomic.h 15 May 2006 13:08:12 -0000 1.19 +++ sys/arm/include/atomic.h 18 Oct 2006 13:31:30 -0000 @@ -308,45 +308,57 @@ #endif /* _LOCORE */ - -static __inline int -atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src) -{ - return (atomic_cmpset_32((volatile u_int *)dst, (u_int)exp, - (u_int)src)); -} - -#define atomic_set_rel_int atomic_set_32 -#define atomic_set_acq_long atomic_set_32 -#define atomic_set_int atomic_set_32 -#define atomic_readandclear_int atomic_readandclear_32 -#define atomic_clear_int atomic_clear_32 -#define atomic_clear_acq_long atomic_clear_32 -#define atomic_subtract_int atomic_subtract_32 -#define atomic_subtract_rel_int atomic_subtract_32 -#define atomic_subtract_rel_32 atomic_subtract_32 -#define atomic_subtract_acq_int atomic_subtract_32 -#define atomic_add_int atomic_add_32 +#define atomic_fetchadd_int atomic_fetchadd_32 +#define atomic_fetchadd_long atomic_fetchadd_32 +#define atomic_add_acq_32 atomic_add_32 +#define atomic_add_acq_int atomic_add_32 #define atomic_add_acq_long atomic_add_32 -#define atomic_add_rel_int atomic_add_32 +#define atomic_add_int atomic_add_32 +#define atomic_add_long atomic_add_32 #define atomic_add_rel_32 atomic_add_32 -#define atomic_add_acq_int atomic_add_32 -#define atomic_cmpset_int atomic_cmpset_32 -#define atomic_cmpset_rel_int atomic_cmpset_32 -#define atomic_cmpset_rel_ptr atomic_cmpset_ptr +#define atomic_add_rel_int atomic_add_32 +#define atomic_add_rel_long atomic_add_32 +#define atomic_clear_acq_32 atomic_clear_32 +#define atomic_clear_acq_int atomic_clear_32 +#define atomic_clear_acq_long atomic_clear_32 +#define atomic_clear_int atomic_clear_32 +#define atomic_clear_long atomic_clear_32 +#define atomic_clear_rel_32 atomic_clear_32 +#define atomic_clear_rel_int atomic_clear_32 +#define atomic_clear_rel_long atomic_clear_32 +#define atomic_cmpset_acq_32 atomic_cmpset_32 #define atomic_cmpset_acq_int atomic_cmpset_32 -#define atomic_cmpset_acq_ptr atomic_cmpset_ptr -#define atomic_cmpset_acq_long atomic_cmpset_long -#define atomic_store_rel_ptr atomic_store_ptr -#define atomic_store_rel_int atomic_store_32 +#define atomic_cmpset_acq_long atomic_cmpset_32 +#define atomic_cmpset_int atomic_cmpset_32 +#define atomic_cmpset_long atomic_cmpset_32 #define atomic_cmpset_rel_32 atomic_cmpset_32 -#define atomic_cmpset_rel_ptr atomic_cmpset_ptr -#define atomic_load_acq_int atomic_load_32 +#define atomic_cmpset_rel_int atomic_cmpset_32 +#define atomic_cmpset_rel_int atomic_cmpset_32 +#define atomic_cmpset_rel_long atomic_cmpset_32 #define atomic_load_acq_32 atomic_load_32 -#define atomic_clear_ptr atomic_clear_32 -#define atomic_store_ptr atomic_store_32 -#define atomic_cmpset_ptr atomic_cmpset_32 -#define atomic_set_ptr atomic_set_32 -#define atomic_fetchadd_int atomic_fetchadd_32 +#define atomic_load_acq_int atomic_load_32 +#define atomic_load_acq_long atomic_load_32 +#define atomic_readandclear_int atomic_readandclear_32 +#define atomic_readandclear_long atomic_readandclear_32 +#define atomic_set_32 atomic_set_32 +#define atomic_set_acq_32 atomic_set_32 +#define atomic_set_acq_int atomic_set_32 +#define atomic_set_acq_long atomic_set_32 +#define atomic_set_int atomic_set_32 +#define atomic_set_long atomic_set_32 +#define atomic_set_rel_32 atomic_set_32 +#define atomic_set_rel_int atomic_set_32 +#define atomic_set_rel_long atomic_set_32 +#define atomic_store_rel_32 atomic_store_32 +#define atomic_store_rel_int atomic_store_32 +#define atomic_store_rel_long atomic_store_32 +#define atomic_subtract_acq_32 atomic_subtract_32 +#define atomic_subtract_acq_int atomic_subtract_32 +#define atomic_subtract_acq_long atomic_subtract_32 +#define atomic_subtract_int atomic_subtract_32 +#define atomic_subtract_long atomic_subtract_32 +#define atomic_subtract_rel_32 atomic_subtract_32 +#define atomic_subtract_rel_int atomic_subtract_32 +#define atomic_subtract_rel_long atomic_subtract_32 #endif /* _MACHINE_ATOMIC_H_ */ --=-=-=--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86d58p916i.fsf>