From owner-p4-projects@FreeBSD.ORG Sat Apr 26 18:06:21 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1449037B404; Sat, 26 Apr 2003 18:06:21 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E638237B40B for ; Sat, 26 Apr 2003 18:06:19 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B13F43F75 for ; Sat, 26 Apr 2003 18:06:19 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3R16J0U085664 for ; Sat, 26 Apr 2003 18:06:19 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3R16J3A085659 for perforce@freebsd.org; Sat, 26 Apr 2003 18:06:19 -0700 (PDT) Date: Sat, 26 Apr 2003 18:06:19 -0700 (PDT) Message-Id: <200304270106.h3R16J3A085659@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 29844 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2003 01:06:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=29844 Change 29844 by jmallett@jmallett_dalek on 2003/04/26 18:06:14 Add acq and rel membar forms of cmpset atomics. Affected files ... .. //depot/projects/mips/sys/mips/include/atomic.h#13 edit Differences ... ==== //depot/projects/mips/sys/mips/include/atomic.h#13 (text+ko) ==== @@ -43,6 +43,16 @@ mips_write_membar(); \ } +#define ATOMIC_ACQ_CMPSET(type) \ +static __inline int \ +atomic_cmpset_acq_ ## type(volatile u_ ## type *p, u_ ## type old, u_ ## type val) \ +{ \ + int r; \ + r = atomic_cmpset_ ## type(p, old, val); \ + mips_write_membar(); \ + return (r); \ +} + #define ATOMIC_REL_OP(type, op) \ static __inline void \ atomic_ ## op ## _rel_ ## type(volatile u_ ## type *p, u_ ## type val) \ @@ -51,6 +61,16 @@ atomic_ ## op ## _ ## type(p, val); \ } +#define ATOMIC_REL_CMPSET(type) \ +static __inline int \ +atomic_cmpset_rel_ ## type(volatile u_ ## type *p, u_ ## type old, u_ ## type val) \ +{ \ + int r; \ + mips_read_membar(); \ + atomic_cmpset_ ## type(p, old, val); \ + return (r); \ +} + #define ATOMIC_ACQ_LOAD(type) \ static __inline u_ ## type \ atomic_load_acq_ ## type(volatile u_ ## type *p) \ @@ -134,6 +154,9 @@ return res; } +ATOMIC_ACQ_CMPSET(int) +ATOMIC_REL_CMPSET(int) + static __inline u_int atomic_readandclear_int(volatile u_int *p) { @@ -219,6 +242,9 @@ return res; } +ATOMIC_ACQ_CMPSET(long) +ATOMIC_REL_CMPSET(long) + static __inline u_long atomic_readandclear_long(volatile u_long *p) { @@ -308,7 +334,9 @@ * Clean up after the membar stuff. */ #undef ATOMIC_ACQ_OP +#undef ATOMIC_ACQ_CMPSET #undef ATOMIC_REL_OP +#undef ATOMIC_REL_CMPSET #undef ATOMIC_ACQ_LOAD #undef ATOMIC_REL_STORE