From owner-p4-projects@FreeBSD.ORG Thu Dec 14 16:10:09 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C613116A47E; Thu, 14 Dec 2006 16:10:08 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A098816A412 for ; Thu, 14 Dec 2006 16:10:08 +0000 (UTC) (envelope-from ticso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72EE843E3D for ; Thu, 14 Dec 2006 16:02:39 +0000 (GMT) (envelope-from ticso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBEG454d031905 for ; Thu, 14 Dec 2006 16:04:05 GMT (envelope-from ticso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBEG45Wu031902 for perforce@freebsd.org; Thu, 14 Dec 2006 16:04:05 GMT (envelope-from ticso@freebsd.org) Date: Thu, 14 Dec 2006 16:04:05 GMT Message-Id: <200612141604.kBEG45Wu031902@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ticso@freebsd.org using -f From: Bernd Walter To: Perforce Change Reviews Cc: Subject: PERFORCE change 111697 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Dec 2006 16:10:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=111697 Change 111697 by ticso@ticso on 2006/12/14 16:03:42 Add missing atomic functions Based on a patch by: des Affected files ... .. //depot/projects/arm/src/sys/arm/include/atomic.h#9 edit Differences ... ==== //depot/projects/arm/src/sys/arm/include/atomic.h#9 (text+ko) ==== @@ -308,46 +308,76 @@ #endif /* _LOCORE */ +#define atomic_add_long(p, v) \ + atomic_add_32((volatile u_int *)(p), (u_int)(v)) +#define atomic_add_acq_long atomic_add_long +#define atomic_add_rel_long atomic_add_long +#define atomic_subtract_long(p, v) \ + atomic_subtract_32((volatile u_int *)(p), (u_int)(v)) +#define atomic_subtract_acq_long atomic_subtract_long +#define atomic_subtract_rel_long atomic_subtract_long +#define atomic_clear_long(p, v) \ + atomic_clear_32((volatile u_int *)(p), (u_int)(v)) +#define atomic_clear_acq_long atomic_clear_long +#define atomic_clear_rel_long atomic_clear_long +#define atomic_set_long(p, v) \ + atomic_set_32((volatile u_int *)(p), (u_int)(v)) +#define atomic_set_acq_long atomic_set_long +#define atomic_set_rel_long atomic_set_long +#define atomic_cmpset_long(dst, old, new) \ + atomic_cmpset_32((volatile u_int *)(dst), (u_int)(old), (u_int)(new)) +#define atomic_cmpset_acq_long atomic_cmpset_long +#define atomic_cmpset_rel_long atomic_cmpset_long +#define atomic_fetchadd_long(p, v) \ + atomic_fetchadd_32((volatile u_int *)(p), (u_int)(v)) +#define atomic_readandclear_long(p) \ + atomic_readandclear_long((volatile u_int *)(p)) +#define atomic_load_long(p) \ + atomic_load_32((volatile u_int *)(p)) +#define atomic_load_acq_long atomic_load_long +#define atomic_store_rel_long(p, v) \ + atomic_store_rel_32((volatile u_int *)(p), (u_int)(v)) + -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_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_ptr +#define atomic_cmpset_acq_ptr atomic_cmpset_ptr +#define atomic_store_ptr atomic_store_32 +#define atomic_store_rel_ptr atomic_store_ptr -#define atomic_set_rel_int atomic_set_32 -#define atomic_set_acq_long atomic_set_32 +#define atomic_add_int atomic_add_32 +#define atomic_add_acq_int atomic_add_int +#define atomic_add_rel_int atomic_add_int +#define atomic_subtract_int atomic_subtract_32 +#define atomic_subtract_acq_int atomic_subtract_int +#define atomic_subtract_rel_int atomic_subtract_int +#define atomic_clear_int atomic_clear_32 +#define atomic_clear_acq_int atomic_clear_int +#define atomic_clear_rel_int atomic_clear_int #define atomic_set_int atomic_set_32 +#define atomic_set_acq_int atomic_set_int +#define atomic_set_rel_int atomic_set_int +#define atomic_cmpset_int atomic_cmpset_32 +#define atomic_cmpset_acq_int atomic_cmpset_int +#define atomic_cmpset_rel_int atomic_cmpset_int +#define atomic_fetchadd_int atomic_fetchadd_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_load_acq_int atomic_load_32 +#define atomic_store_rel_int atomic_store_32 + +#define atomic_add_acq_32 atomic_add_32 +#define atomic_add_rel_32 atomic_add_32 +#define atomic_subtract_acq_32 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_add_acq_long atomic_add_32 -#define atomic_add_rel_int 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_cmpset_acq_int atomic_cmpset_32 -#define atomic_cmpset_acq_ptr atomic_cmpset_ptr -#define atomic_cmpset_acq_long atomic_cmpset_long +#define atomic_clear_acq_32 atomic_clear_32 +#define atomic_clear_rel_32 atomic_clear_32 +#define atomic_set_acq_32 atomic_set_32 +#define atomic_set_rel_32 atomic_set_32 #define atomic_cmpset_acq_32 atomic_cmpset_32 -#define atomic_store_rel_ptr atomic_store_ptr -#define atomic_store_rel_int atomic_store_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_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_store_rel_32 atomic_store_32 #endif /* _MACHINE_ATOMIC_H_ */