From owner-p4-projects Thu Feb 13 13:52: 8 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8225937B405; Thu, 13 Feb 2003 13:52:05 -0800 (PST) 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 1A65537B401 for ; Thu, 13 Feb 2003 13:52:05 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBD7643F85 for ; Thu, 13 Feb 2003 13:52:04 -0800 (PST) (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 h1DLq4bv006807 for ; Thu, 13 Feb 2003 13:52:04 -0800 (PST) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h1DLq4PS006786 for perforce@freebsd.org; Thu, 13 Feb 2003 13:52:04 -0800 (PST) Date: Thu, 13 Feb 2003 13:52:04 -0800 (PST) Message-Id: <200302132152.h1DLq4PS006786@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett Subject: PERFORCE change 25113 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=25113 Change 25113 by jmallett@jmallett_dalek on 2003/02/13 13:51:32 Pointer atomics. Affected files ... .. //depot/projects/mips/sys/mips/include/atomic.h#10 edit Differences ... ==== //depot/projects/mips/sys/mips/include/atomic.h#10 (text+ko) ==== @@ -130,6 +130,8 @@ return res; } +#undef ATOMIC_OP + /* * Long atomic operations, hardware calls this double. */ @@ -189,4 +191,53 @@ return res; } +#undef ATOMIC_DOP + +/* + * Pointer atomic operations, just wrappers for long. + */ +#define ATOMIC_POP(op) \ +static __inline void \ +atomic_ ## op ## _ptr(void *p, uintptr_t val) \ +{ \ + atomic_ ## op ## _long(p, val); \ +} \ +static __inline void \ +atomic_ ## op ## _acq_ptr(void *p, uintptr_t val) \ +{ \ + atomic_ ## op ## _acq_long(p, val); \ +} \ +static __inline void \ +atomic_ ## op ## _rel_ptr(void *p, uintptr_t val) \ +{ \ + atomic_ ## op ## _rel_long(p, val); \ +} + +ATOMIC_POP(add) +ATOMIC_POP(clear) +ATOMIC_POP(set) +ATOMIC_POP(subtract) + +static __inline void * +atomic_load_acq_ptr(void *p) +{ + return (void *)atomic_load_acq_long(p); +} + +static __inline void +atomic_store_rel_ptr(void *p, void *val) +{ + atomic_store_rel_long(p, (u_long)val); +} + +#undef ATOMIC_POP + +/* + * Clean up after the membar stuff. + */ +#undef ATOMIC_ACQ_OP +#undef ATOMIC_REL_OP +#undef ATOMIC_ACQ_LOAD +#undef ATOMIC_REL_STORE + #endif /* !_MACHINE_ATOMIC_H_ */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message